Skip to content

Commit

Permalink
Fix error on datasets
Browse files Browse the repository at this point in the history
  • Loading branch information
kreafox committed Dec 2, 2022
1 parent fd2c67c commit ad9d7eb
Showing 1 changed file with 23 additions and 9 deletions.
32 changes: 23 additions & 9 deletions src/components/ItemView/Datasets.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react';
import { Icon, List, Accordion } from 'semantic-ui-react';

import servicesSVG from './icons/services.svg';
import lockSVG from 'remixicon/icons/System/lock-line.svg';

Expand Down Expand Up @@ -315,15 +314,30 @@ const Datasets = (props) => {
</span>
);
})}
{(dataset.linkProtocol || [])
.filter((i) => i.includes('ESRI') || i.includes('OGC'))
.map((item, i) => {
return (
<span className="format-label" key={i}>
{item}

{Array.isArray(dataset.linkProtocol) ? (
<>
{dataset.linkProtocol
.filter(
(i) => i.includes('ESRI') || i.includes('OGC'),
)
.map((item, i) => {
return (
<span className="format-label" key={i}>
{item}
</span>
);
})}
</>
) : (
<>
{['ESRI', 'OGC'].includes(dataset.linkProtocol) && (
<span className="format-label">
{dataset.linkProtocol}
</span>
);
})}
)}
</>
)}
</span>

{is_internal(dataset) && <SVGIcon name={lockSVG} size="18" />}
Expand Down

0 comments on commit ad9d7eb

Please sign in to comment.