Skip to content

Commit 360aacd

Browse files
committed
#2069: make scenario descriptor tags error save
1 parent 2bd53b6 commit 360aacd

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

factsheet/frontend/src/components/scenarioBundle.tsx

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2803,14 +2803,25 @@ const renderScenariosOverview = () => (
28032803
</span>
28042804
</Grid>
28052805
<Grid item xs={9} style={{ paddingTop: '10px' }}>
2806-
{selectedStudyKewords.map((v, i) => (
2807-
<span> <span>
2808-
<Chip label={StudyKeywords.filter((i) => i[1] == v)[0][0]}
2809-
size="small"
2810-
variant={StudyKeywords.filter((i) => i[1] == v)[0][1] === "" ? "" : "outlined"}
2811-
onClick={() => handleOpenURL(StudyKeywords.filter((i) => i[1] == v)[0][1])} />
2812-
</span> <span> <b className="separator-dot"> </b></span> </span>
2813-
))}
2806+
{selectedStudyKewords.map((v, i) => {
2807+
const match = StudyKeywords.find((it) => it[1] === v) || [v, ""];
2808+
const [label, url] = match;
2809+
const variant = url ? "outlined" : "filled";
2810+
2811+
return (
2812+
<span key={`${v}-${i}`}>
2813+
<span>
2814+
<Chip
2815+
label={label}
2816+
size="small"
2817+
variant={variant}
2818+
onClick={url ? () => handleOpenURL(url) : undefined}
2819+
/>
2820+
</span>
2821+
<span><b className="separator-dot"> </b></span>
2822+
</span>
2823+
);
2824+
})}
28142825
</Grid>
28152826
</InfoListItem>
28162827
<InfoListItem>

0 commit comments

Comments
 (0)