Skip to content

Commit

Permalink
Merge pull request #1217 from visualize-admin/fix/empty-tags
Browse files Browse the repository at this point in the history
fix: Do not show empty tags
bprusinowski authored Oct 12, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 6e7d5bb + 96521d6 commit 83ab630
Showing 1 changed file with 28 additions and 26 deletions.
54 changes: 28 additions & 26 deletions app/components/dataset-metadata.tsx
Original file line number Diff line number Diff line change
@@ -182,33 +182,35 @@ const DatasetTags = ({
<Trans id="dataset-preview.keywords">Keywords</Trans>
</DatasetMetadataTitle>
<Stack spacing={1} direction="column" sx={{ mt: 3 }}>
{[cube.creator, ...cube.themes].filter(truthy).map((t) => (
<NextLink
key={t.iri}
href={`/browse/${
t.__typename === "DataCubeTheme" ? "theme" : "organization"
}/${encodeURIComponent(t.iri)}`}
passHref
legacyBehavior
>
<Tag
component={MUILink}
// @ts-ignore
underline="none"
type={t.__typename}
title={t.label || undefined}
sx={{
maxWidth: "100%",
display: "flex",
whiteSpace: "nowrap",
textOverflow: "ellipsis",
overflow: "hidden",
}}
{[cube.creator, ...cube.themes].filter(truthy).map((t) =>
t.label ? (
<NextLink
key={t.iri}
href={`/browse/${
t.__typename === "DataCubeTheme" ? "theme" : "organization"
}/${encodeURIComponent(t.iri)}`}
passHref
legacyBehavior
>
{t.label}
</Tag>
</NextLink>
))}
<Tag
component={MUILink}
// @ts-ignore
underline="none"
type={t.__typename}
title={t.label || undefined}
sx={{
maxWidth: "100%",
display: "flex",
whiteSpace: "nowrap",
textOverflow: "ellipsis",
overflow: "hidden",
}}
>
{t.label}
</Tag>
</NextLink>
) : null
)}
</Stack>
</>
);

1 comment on commit 83ab630

@vercel
Copy link

@vercel vercel bot commented on 83ab630 Oct 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

visualization-tool – ./

visualization-tool-ixt1.vercel.app
visualization-tool-git-main-ixt1.vercel.app
visualization-tool-alpha.vercel.app

Please sign in to comment.