Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move landing page link #662

Merged
merged 1 commit into from
Aug 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 26 additions & 29 deletions app/components/chart-footnotes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,20 +98,6 @@ export const ChartFootnotes = ({
)}
</Typography>

{dataCubeByIri.landingPage && (
<Link
href={dataCubeByIri.landingPage}
underline="always"
target="_blank"
typography="caption"
color="grey.600"
sx={{ display: "flex", alignItems: "center", gap: "0.25rem" }}
>
<Icon name="linkExternal" size={12} />
<Trans id="dataset.metadata.landingpage">Landing page</Trans>
</Link>
)}

<Box
sx={{
mt: 2,
Expand Down Expand Up @@ -158,19 +144,32 @@ export const ChartFootnotes = ({
? getChartIcon(chartConfig.chartType)
: "table"
}
size={16}
/>
}
onClick={() => setIsChartTablePreview(!isChartTablePreview)}
sx={{ p: 0 }}
sx={{ p: 0, typography: "caption" }}
>
{isChartTablePreview ? (
<Trans id="metadata.switch.chart">Switch to chart view</Trans>
) : (
<Trans id="metadata.switch.table">Switch to table view</Trans>
)}
</Button>
)}
{dataCubeByIri.landingPage && (
<Button
variant="text"
component="a"
href={dataCubeByIri.landingPage}
target="_blank"
color="primary"
size="small"
sx={{ p: 0, typography: "caption" }}
startIcon={<Icon name="linkExternal" />}
>
<Typography variant="caption">
{isChartTablePreview ? (
<Trans id="metadata.switch.chart">Switch to chart view</Trans>
) : (
<Trans id="metadata.switch.table">Switch to table view</Trans>
)}
</Typography>
<Trans id="dataset.metadata.learnmore">
Learn more about the dataset
</Trans>
</Button>
)}
{sparqlEditorUrl && (
Expand All @@ -182,16 +181,14 @@ export const ChartFootnotes = ({
variant="text"
color="primary"
size="small"
sx={{ p: 0 }}
sx={{ p: 0, typography: "caption" }}
href={shareUrl}
target="_blank"
rel="noopener noreferrer"
>
<Typography variant="caption">
<Trans id="metadata.link.created.with.visualize">
Created with visualize.admin.ch
</Trans>
</Typography>
<Trans id="metadata.link.created.with.visualize">
Created with visualize.admin.ch
</Trans>
</Button>
)}
</Box>
Expand Down
2 changes: 1 addition & 1 deletion app/configurator/components/dataset-metadata.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export const DataSetMetadata = ({
href={cube.landingPage}
external
label={
<Trans id="dataset.metadata.landingpage">Landing page</Trans>
<Trans id="dataset.metadata.learnmore">Learn more about the dataset</Trans>
}
/>
) : (
Expand Down
4 changes: 2 additions & 2 deletions app/locales/de/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -719,8 +719,8 @@ msgstr "Weitere Informationen"

#: app/components/chart-footnotes.tsx:111
#: app/configurator/components/dataset-metadata.tsx:117
msgid "dataset.metadata.landingpage"
msgstr "Zielseite"
msgid "dataset.metadata.learnmore"
msgstr "Erfahren Sie mehr über diesen Datensatz"

#: app/configurator/components/dataset-metadata.tsx:67
msgid "dataset.metadata.source"
Expand Down
4 changes: 2 additions & 2 deletions app/locales/en/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -719,8 +719,8 @@ msgstr "Further information"

#: app/components/chart-footnotes.tsx:111
#: app/configurator/components/dataset-metadata.tsx:117
msgid "dataset.metadata.landingpage"
msgstr "Landing page"
msgid "dataset.metadata.learnmore"
msgstr "Learn more about the dataset"

#: app/configurator/components/dataset-metadata.tsx:67
msgid "dataset.metadata.source"
Expand Down
4 changes: 2 additions & 2 deletions app/locales/fr/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -719,8 +719,8 @@ msgstr "Informations complémentaires"

#: app/components/chart-footnotes.tsx:111
#: app/configurator/components/dataset-metadata.tsx:117
msgid "dataset.metadata.landingpage"
msgstr "Page d'accueil"
msgid "dataset.metadata.learnmore"
msgstr "En savoir plus sur le jeu de données"

#: app/configurator/components/dataset-metadata.tsx:67
msgid "dataset.metadata.source"
Expand Down
4 changes: 2 additions & 2 deletions app/locales/it/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -719,8 +719,8 @@ msgstr "Addizionali informazioni"

#: app/components/chart-footnotes.tsx:111
#: app/configurator/components/dataset-metadata.tsx:117
msgid "dataset.metadata.landingpage"
msgstr "Pagina di destinazione"
msgid "dataset.metadata.learnmore"
msgstr "Ulteriori informazioni sul set di dati"

#: app/configurator/components/dataset-metadata.tsx:67
msgid "dataset.metadata.source"
Expand Down