From 2f0ec2028b12d9445a394d394ea00c413fdeb31a Mon Sep 17 00:00:00 2001 From: Bartosz Prusinowski Date: Wed, 13 Oct 2021 13:11:19 +0200 Subject: [PATCH 1/6] feat: Display a contact email field in the dataset preview --- app/configurator/components/dataset-metadata.tsx | 14 ++++++++++++++ app/locales/de/messages.po | 14 +++++++++----- app/locales/en/messages.po | 14 +++++++++----- app/locales/fr/messages.po | 14 +++++++++----- app/locales/it/messages.po | 14 +++++++++----- 5 files changed, 50 insertions(+), 20 deletions(-) diff --git a/app/configurator/components/dataset-metadata.tsx b/app/configurator/components/dataset-metadata.tsx index c722d5e9a..9aaf2ba18 100644 --- a/app/configurator/components/dataset-metadata.tsx +++ b/app/configurator/components/dataset-metadata.tsx @@ -1,4 +1,5 @@ import { Trans } from "@lingui/macro"; +import Link from "next/link"; import { ReactNode } from "react"; import { Box } from "theme-ui"; import { Loading } from "../../components/hint"; @@ -59,6 +60,19 @@ export const DataSetMetadata = ({ dataSetIri }: { dataSetIri: string }) => { {data.dataCubeByIri.version ?? "–"} + + + Contact E-mail + + + {data.dataCubeByIri.contactEmail ? ( + + {data.dataCubeByIri.contactEmail} + + ) : ( + "–" + )} + ); } else { diff --git a/app/locales/de/messages.po b/app/locales/de/messages.po index 1aaaa230a..c191695b4 100644 --- a/app/locales/de/messages.po +++ b/app/locales/de/messages.po @@ -294,19 +294,19 @@ msgstr "Bitte ein Beschreibungsfeld auswählen, um dieses zu bearbeiten." msgid "controls.interactive.filters.dataFilter" msgstr "Datenfilter" -#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:266 +#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:263 msgid "controls.interactiveFilters.dataFilters.toggledataFilters" msgstr "Datenfilter anzeigen" -#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:69 +#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:63 msgid "controls.interactiveFilters.legend.toggleInteractiveLegend" msgstr "Filterbare Legende anzeigen" -#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:204 +#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:198 msgid "controls.interactiveFilters.time.noTimeDimension" msgstr "Keine Zeitdimension verfügbar!" -#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:178 +#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:172 msgid "controls.interactiveFilters.time.toggleTimeFilter" msgstr "Zeitfilter anzeigen" @@ -379,7 +379,7 @@ msgstr "Gruppierungen" msgid "controls.section.interactive.filters" msgstr "Interaktive Filter hinzufügen" -#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:100 +#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:94 msgid "controls.section.interactiveFilters.dataFilters" msgstr "Datenfilter" @@ -565,6 +565,10 @@ msgstr "Erstellungsdatum" msgid "dataset.metadata.description" msgstr "Beschreibung" +#: app/configurator/components/dataset-metadata.tsx:64 +msgid "dataset.metadata.email" +msgstr "Kontakt E-mail" + #: app/configurator/components/dataset-metadata.tsx:34 msgid "dataset.metadata.source" msgstr "Quelle" diff --git a/app/locales/en/messages.po b/app/locales/en/messages.po index 7b050a5ea..4d16118ef 100644 --- a/app/locales/en/messages.po +++ b/app/locales/en/messages.po @@ -294,19 +294,19 @@ msgstr "Select an annotation field to modify its content." msgid "controls.interactive.filters.dataFilter" msgstr "Data Filters" -#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:266 +#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:263 msgid "controls.interactiveFilters.dataFilters.toggledataFilters" msgstr "Show data filters" -#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:69 +#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:63 msgid "controls.interactiveFilters.legend.toggleInteractiveLegend" msgstr "Show legend filter" -#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:204 +#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:198 msgid "controls.interactiveFilters.time.noTimeDimension" msgstr "There is no time dimension!" -#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:178 +#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:172 msgid "controls.interactiveFilters.time.toggleTimeFilter" msgstr "Show time filter" @@ -379,7 +379,7 @@ msgstr "Groups" msgid "controls.section.interactive.filters" msgstr "Interactive Filters" -#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:100 +#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:94 msgid "controls.section.interactiveFilters.dataFilters" msgstr "Data Filters" @@ -565,6 +565,10 @@ msgstr "Date created" msgid "dataset.metadata.description" msgstr "Description" +#: app/configurator/components/dataset-metadata.tsx:64 +msgid "dataset.metadata.email" +msgstr "Contact E-mail" + #: app/configurator/components/dataset-metadata.tsx:34 msgid "dataset.metadata.source" msgstr "Source" diff --git a/app/locales/fr/messages.po b/app/locales/fr/messages.po index 783cb6b0c..b9fd2a6ef 100644 --- a/app/locales/fr/messages.po +++ b/app/locales/fr/messages.po @@ -294,19 +294,19 @@ msgstr "Sélectionnez une des annotations proposées pour la modifier." msgid "controls.interactive.filters.dataFilter" msgstr "Filtres de données" -#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:266 +#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:263 msgid "controls.interactiveFilters.dataFilters.toggledataFilters" msgstr "Afficher les filtres de données" -#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:69 +#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:63 msgid "controls.interactiveFilters.legend.toggleInteractiveLegend" msgstr "Afficher la légende filtrante" -#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:204 +#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:198 msgid "controls.interactiveFilters.time.noTimeDimension" msgstr "Il n'y a pas de dimension temporelle!" -#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:178 +#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:172 msgid "controls.interactiveFilters.time.toggleTimeFilter" msgstr "Afficher le filtre temporel" @@ -379,7 +379,7 @@ msgstr "Groupes" msgid "controls.section.interactive.filters" msgstr "Filtres interactifs" -#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:100 +#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:94 msgid "controls.section.interactiveFilters.dataFilters" msgstr "Filtres de données" @@ -565,6 +565,10 @@ msgstr "Date de création" msgid "dataset.metadata.description" msgstr "Description" +#: app/configurator/components/dataset-metadata.tsx:64 +msgid "dataset.metadata.email" +msgstr "Email du contact" + #: app/configurator/components/dataset-metadata.tsx:34 msgid "dataset.metadata.source" msgstr "Source" diff --git a/app/locales/it/messages.po b/app/locales/it/messages.po index 5674afe5d..9a7839b44 100644 --- a/app/locales/it/messages.po +++ b/app/locales/it/messages.po @@ -294,19 +294,19 @@ msgstr "Seleziona una delle annotazioni proposte per modificarla." msgid "controls.interactive.filters.dataFilter" msgstr "Filtri di dati" -#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:266 +#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:263 msgid "controls.interactiveFilters.dataFilters.toggledataFilters" msgstr "Mostra i filtri di dati" -#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:69 +#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:63 msgid "controls.interactiveFilters.legend.toggleInteractiveLegend" msgstr "Mostra la legenda filtrante" -#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:204 +#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:198 msgid "controls.interactiveFilters.time.noTimeDimension" msgstr "Nessuna dimensione temporale disponibile!" -#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:178 +#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:172 msgid "controls.interactiveFilters.time.toggleTimeFilter" msgstr "Mostra i filtri temporali" @@ -379,7 +379,7 @@ msgstr "Gruppi" msgid "controls.section.interactive.filters" msgstr "Filtri interattivi" -#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:100 +#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:94 msgid "controls.section.interactiveFilters.dataFilters" msgstr "Filtri di dati" @@ -565,6 +565,10 @@ msgstr "Data di creazione" msgid "dataset.metadata.description" msgstr "Descrizione" +#: app/configurator/components/dataset-metadata.tsx:64 +msgid "dataset.metadata.email" +msgstr "Contatto E-mail" + #: app/configurator/components/dataset-metadata.tsx:34 msgid "dataset.metadata.source" msgstr "Fonte" From 7c01058d5619f8b16cbcbfeededdb0f33f1da5bd Mon Sep 17 00:00:00 2001 From: Bartosz Prusinowski Date: Wed, 13 Oct 2021 13:19:31 +0200 Subject: [PATCH 2/6] feat: Update email matadata translations --- .../components/dataset-metadata.tsx | 2 +- app/locales/de/messages.po | 24 +++++++++---------- app/locales/en/messages.po | 24 +++++++++---------- app/locales/fr/messages.po | 24 +++++++++---------- app/locales/it/messages.po | 24 +++++++++---------- 5 files changed, 49 insertions(+), 49 deletions(-) diff --git a/app/configurator/components/dataset-metadata.tsx b/app/configurator/components/dataset-metadata.tsx index 9aaf2ba18..fb0f292ec 100644 --- a/app/configurator/components/dataset-metadata.tsx +++ b/app/configurator/components/dataset-metadata.tsx @@ -62,7 +62,7 @@ export const DataSetMetadata = ({ dataSetIri }: { dataSetIri: string }) => { - Contact E-mail + Contact points {data.dataCubeByIri.contactEmail ? ( diff --git a/app/locales/de/messages.po b/app/locales/de/messages.po index c191695b4..2c0657706 100644 --- a/app/locales/de/messages.po +++ b/app/locales/de/messages.po @@ -294,19 +294,19 @@ msgstr "Bitte ein Beschreibungsfeld auswählen, um dieses zu bearbeiten." msgid "controls.interactive.filters.dataFilter" msgstr "Datenfilter" -#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:263 +#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:266 msgid "controls.interactiveFilters.dataFilters.toggledataFilters" msgstr "Datenfilter anzeigen" -#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:63 +#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:69 msgid "controls.interactiveFilters.legend.toggleInteractiveLegend" msgstr "Filterbare Legende anzeigen" -#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:198 +#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:204 msgid "controls.interactiveFilters.time.noTimeDimension" msgstr "Keine Zeitdimension verfügbar!" -#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:172 +#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:178 msgid "controls.interactiveFilters.time.toggleTimeFilter" msgstr "Zeitfilter anzeigen" @@ -379,7 +379,7 @@ msgstr "Gruppierungen" msgid "controls.section.interactive.filters" msgstr "Interaktive Filter hinzufügen" -#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:94 +#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:100 msgid "controls.section.interactiveFilters.dataFilters" msgstr "Datenfilter" @@ -557,27 +557,27 @@ msgstr "Titel hinzufügen" msgid "dataset.includeDrafts" msgstr "Entwurfs-Datensätze anzeigen" -#: app/configurator/components/dataset-metadata.tsx:48 +#: app/configurator/components/dataset-metadata.tsx:49 msgid "dataset.metadata.date.created" msgstr "Erstellungsdatum" -#: app/configurator/components/dataset-metadata.tsx:25 +#: app/configurator/components/dataset-metadata.tsx:26 msgid "dataset.metadata.description" msgstr "Beschreibung" -#: app/configurator/components/dataset-metadata.tsx:64 +#: app/configurator/components/dataset-metadata.tsx:65 msgid "dataset.metadata.email" -msgstr "Kontakt E-mail" +msgstr "Kontaktstellen" -#: app/configurator/components/dataset-metadata.tsx:34 +#: app/configurator/components/dataset-metadata.tsx:35 msgid "dataset.metadata.source" msgstr "Quelle" -#: app/configurator/components/dataset-metadata.tsx:20 +#: app/configurator/components/dataset-metadata.tsx:21 msgid "dataset.metadata.title" msgstr "Titel" -#: app/configurator/components/dataset-metadata.tsx:57 +#: app/configurator/components/dataset-metadata.tsx:58 msgid "dataset.metadata.version" msgstr "Version" diff --git a/app/locales/en/messages.po b/app/locales/en/messages.po index 4d16118ef..1b614c58f 100644 --- a/app/locales/en/messages.po +++ b/app/locales/en/messages.po @@ -294,19 +294,19 @@ msgstr "Select an annotation field to modify its content." msgid "controls.interactive.filters.dataFilter" msgstr "Data Filters" -#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:263 +#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:266 msgid "controls.interactiveFilters.dataFilters.toggledataFilters" msgstr "Show data filters" -#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:63 +#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:69 msgid "controls.interactiveFilters.legend.toggleInteractiveLegend" msgstr "Show legend filter" -#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:198 +#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:204 msgid "controls.interactiveFilters.time.noTimeDimension" msgstr "There is no time dimension!" -#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:172 +#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:178 msgid "controls.interactiveFilters.time.toggleTimeFilter" msgstr "Show time filter" @@ -379,7 +379,7 @@ msgstr "Groups" msgid "controls.section.interactive.filters" msgstr "Interactive Filters" -#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:94 +#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:100 msgid "controls.section.interactiveFilters.dataFilters" msgstr "Data Filters" @@ -557,27 +557,27 @@ msgstr "Title" msgid "dataset.includeDrafts" msgstr "Include draft datasets" -#: app/configurator/components/dataset-metadata.tsx:48 +#: app/configurator/components/dataset-metadata.tsx:49 msgid "dataset.metadata.date.created" msgstr "Date created" -#: app/configurator/components/dataset-metadata.tsx:25 +#: app/configurator/components/dataset-metadata.tsx:26 msgid "dataset.metadata.description" msgstr "Description" -#: app/configurator/components/dataset-metadata.tsx:64 +#: app/configurator/components/dataset-metadata.tsx:65 msgid "dataset.metadata.email" -msgstr "Contact E-mail" +msgstr "Contact points" -#: app/configurator/components/dataset-metadata.tsx:34 +#: app/configurator/components/dataset-metadata.tsx:35 msgid "dataset.metadata.source" msgstr "Source" -#: app/configurator/components/dataset-metadata.tsx:20 +#: app/configurator/components/dataset-metadata.tsx:21 msgid "dataset.metadata.title" msgstr "Title" -#: app/configurator/components/dataset-metadata.tsx:57 +#: app/configurator/components/dataset-metadata.tsx:58 msgid "dataset.metadata.version" msgstr "Version" diff --git a/app/locales/fr/messages.po b/app/locales/fr/messages.po index b9fd2a6ef..8ca1e108f 100644 --- a/app/locales/fr/messages.po +++ b/app/locales/fr/messages.po @@ -294,19 +294,19 @@ msgstr "Sélectionnez une des annotations proposées pour la modifier." msgid "controls.interactive.filters.dataFilter" msgstr "Filtres de données" -#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:263 +#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:266 msgid "controls.interactiveFilters.dataFilters.toggledataFilters" msgstr "Afficher les filtres de données" -#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:63 +#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:69 msgid "controls.interactiveFilters.legend.toggleInteractiveLegend" msgstr "Afficher la légende filtrante" -#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:198 +#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:204 msgid "controls.interactiveFilters.time.noTimeDimension" msgstr "Il n'y a pas de dimension temporelle!" -#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:172 +#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:178 msgid "controls.interactiveFilters.time.toggleTimeFilter" msgstr "Afficher le filtre temporel" @@ -379,7 +379,7 @@ msgstr "Groupes" msgid "controls.section.interactive.filters" msgstr "Filtres interactifs" -#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:94 +#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:100 msgid "controls.section.interactiveFilters.dataFilters" msgstr "Filtres de données" @@ -557,27 +557,27 @@ msgstr "Titre" msgid "dataset.includeDrafts" msgstr "Inclure les jeux de données à l'état d'ébauche" -#: app/configurator/components/dataset-metadata.tsx:48 +#: app/configurator/components/dataset-metadata.tsx:49 msgid "dataset.metadata.date.created" msgstr "Date de création" -#: app/configurator/components/dataset-metadata.tsx:25 +#: app/configurator/components/dataset-metadata.tsx:26 msgid "dataset.metadata.description" msgstr "Description" -#: app/configurator/components/dataset-metadata.tsx:64 +#: app/configurator/components/dataset-metadata.tsx:65 msgid "dataset.metadata.email" -msgstr "Email du contact" +msgstr "Points de contact" -#: app/configurator/components/dataset-metadata.tsx:34 +#: app/configurator/components/dataset-metadata.tsx:35 msgid "dataset.metadata.source" msgstr "Source" -#: app/configurator/components/dataset-metadata.tsx:20 +#: app/configurator/components/dataset-metadata.tsx:21 msgid "dataset.metadata.title" msgstr "Titre" -#: app/configurator/components/dataset-metadata.tsx:57 +#: app/configurator/components/dataset-metadata.tsx:58 msgid "dataset.metadata.version" msgstr "Version" diff --git a/app/locales/it/messages.po b/app/locales/it/messages.po index 9a7839b44..3409c695c 100644 --- a/app/locales/it/messages.po +++ b/app/locales/it/messages.po @@ -294,19 +294,19 @@ msgstr "Seleziona una delle annotazioni proposte per modificarla." msgid "controls.interactive.filters.dataFilter" msgstr "Filtri di dati" -#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:263 +#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:266 msgid "controls.interactiveFilters.dataFilters.toggledataFilters" msgstr "Mostra i filtri di dati" -#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:63 +#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:69 msgid "controls.interactiveFilters.legend.toggleInteractiveLegend" msgstr "Mostra la legenda filtrante" -#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:198 +#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:204 msgid "controls.interactiveFilters.time.noTimeDimension" msgstr "Nessuna dimensione temporale disponibile!" -#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:172 +#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:178 msgid "controls.interactiveFilters.time.toggleTimeFilter" msgstr "Mostra i filtri temporali" @@ -379,7 +379,7 @@ msgstr "Gruppi" msgid "controls.section.interactive.filters" msgstr "Filtri interattivi" -#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:94 +#: app/configurator/interactive-filters/interactive-filters-config-options.tsx:100 msgid "controls.section.interactiveFilters.dataFilters" msgstr "Filtri di dati" @@ -557,27 +557,27 @@ msgstr "Titolo" msgid "dataset.includeDrafts" msgstr "Includi la bozza del set di dati" -#: app/configurator/components/dataset-metadata.tsx:48 +#: app/configurator/components/dataset-metadata.tsx:49 msgid "dataset.metadata.date.created" msgstr "Data di creazione" -#: app/configurator/components/dataset-metadata.tsx:25 +#: app/configurator/components/dataset-metadata.tsx:26 msgid "dataset.metadata.description" msgstr "Descrizione" -#: app/configurator/components/dataset-metadata.tsx:64 +#: app/configurator/components/dataset-metadata.tsx:65 msgid "dataset.metadata.email" -msgstr "Contatto E-mail" +msgstr "Punti di contatto" -#: app/configurator/components/dataset-metadata.tsx:34 +#: app/configurator/components/dataset-metadata.tsx:35 msgid "dataset.metadata.source" msgstr "Fonte" -#: app/configurator/components/dataset-metadata.tsx:20 +#: app/configurator/components/dataset-metadata.tsx:21 msgid "dataset.metadata.title" msgstr "Titolo" -#: app/configurator/components/dataset-metadata.tsx:57 +#: app/configurator/components/dataset-metadata.tsx:58 msgid "dataset.metadata.version" msgstr "versione" From c1d8524b743388879a7276f2a7c4e51d431c015c Mon Sep 17 00:00:00 2001 From: Bartosz Prusinowski Date: Wed, 13 Oct 2021 15:49:32 +0200 Subject: [PATCH 3/6] feat: Add landingPage to the GQL Cube --- app/graphql/queries/data-cubes.graphql | 1 + app/graphql/query-hooks.ts | 4 +++- app/graphql/resolver-types.ts | 2 ++ app/graphql/resolvers.ts | 1 + app/graphql/schema.graphql | 1 + 5 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/graphql/queries/data-cubes.graphql b/app/graphql/queries/data-cubes.graphql index ba3884d7d..d45b10857 100644 --- a/app/graphql/queries/data-cubes.graphql +++ b/app/graphql/queries/data-cubes.graphql @@ -70,6 +70,7 @@ query DataCubeMetadata($iri: String!, $locale: String!) { version contactName contactEmail + landingPage datePublished publicationStatus } diff --git a/app/graphql/query-hooks.ts b/app/graphql/query-hooks.ts index e38738686..40d5dff62 100644 --- a/app/graphql/query-hooks.ts +++ b/app/graphql/query-hooks.ts @@ -25,6 +25,7 @@ export type DataCube = { version?: Maybe; contactName?: Maybe; contactEmail?: Maybe; + landingPage?: Maybe; publisher?: Maybe; description?: Maybe; datePublished?: Maybe; @@ -221,7 +222,7 @@ export type DataCubeMetadataQueryVariables = Exact<{ }>; -export type DataCubeMetadataQuery = { __typename: 'Query', dataCubeByIri?: Maybe<{ __typename: 'DataCube', iri: string, title: string, description?: Maybe, publisher?: Maybe, version?: Maybe, contactName?: Maybe, contactEmail?: Maybe, datePublished?: Maybe, publicationStatus: DataCubePublicationStatus }> }; +export type DataCubeMetadataQuery = { __typename: 'Query', dataCubeByIri?: Maybe<{ __typename: 'DataCube', iri: string, title: string, description?: Maybe, publisher?: Maybe, version?: Maybe, contactName?: Maybe, contactEmail?: Maybe, landingPage?: Maybe, datePublished?: Maybe, publicationStatus: DataCubePublicationStatus }> }; export type DataCubeMetadataWithComponentValuesQueryVariables = Exact<{ iri: Scalars['String']; @@ -384,6 +385,7 @@ export const DataCubeMetadataDocument = gql` version contactName contactEmail + landingPage datePublished publicationStatus } diff --git a/app/graphql/resolver-types.ts b/app/graphql/resolver-types.ts index 1f019131b..c0c6351e8 100644 --- a/app/graphql/resolver-types.ts +++ b/app/graphql/resolver-types.ts @@ -30,6 +30,7 @@ export type DataCube = { version?: Maybe; contactName?: Maybe; contactEmail?: Maybe; + landingPage?: Maybe; publisher?: Maybe; description?: Maybe; datePublished?: Maybe; @@ -283,6 +284,7 @@ export type DataCubeResolvers, ParentType, ContextType>; contactName?: Resolver, ParentType, ContextType>; contactEmail?: Resolver, ParentType, ContextType>; + landingPage?: Resolver, ParentType, ContextType>; publisher?: Resolver, ParentType, ContextType>; description?: Resolver, ParentType, ContextType>; datePublished?: Resolver, ParentType, ContextType>; diff --git a/app/graphql/resolvers.ts b/app/graphql/resolvers.ts index 233188be4..43f49801f 100644 --- a/app/graphql/resolvers.ts +++ b/app/graphql/resolvers.ts @@ -111,6 +111,7 @@ const DataCube: DataCubeResolvers = { publisher: ({ data: { publisher } }) => publisher ?? null, contactName: ({ data: { contactPoint } }) => contactPoint?.name ?? null, contactEmail: ({ data: { contactPoint } }) => contactPoint?.email ?? null, + landingPage: ({ data: { landingPage } }) => landingPage ?? null, publicationStatus: ({ data: { publicationStatus } }) => publicationStatus, description: ({ data: { description } }) => description ?? null, datePublished: ({ data: { datePublished } }) => datePublished ?? null, diff --git a/app/graphql/schema.graphql b/app/graphql/schema.graphql index d8a5f167b..d768b0d88 100644 --- a/app/graphql/schema.graphql +++ b/app/graphql/schema.graphql @@ -25,6 +25,7 @@ type DataCube { version: String contactName: String contactEmail: String + landingPage: String publisher: String description: String datePublished: String From e691a608b9a4a7d409478d8392c201b4338b5e8a Mon Sep 17 00:00:00 2001 From: Bartosz Prusinowski Date: Wed, 13 Oct 2021 15:50:39 +0200 Subject: [PATCH 4/6] feat: Display a landing page field in the dataset preview --- .../components/dataset-metadata.tsx | 51 +++++++++++++++++-- 1 file changed, 46 insertions(+), 5 deletions(-) diff --git a/app/configurator/components/dataset-metadata.tsx b/app/configurator/components/dataset-metadata.tsx index fb0f292ec..5c3de5101 100644 --- a/app/configurator/components/dataset-metadata.tsx +++ b/app/configurator/components/dataset-metadata.tsx @@ -1,7 +1,6 @@ import { Trans } from "@lingui/macro"; -import Link from "next/link"; import { ReactNode } from "react"; -import { Box } from "theme-ui"; +import { Box, Link } from "theme-ui"; import { Loading } from "../../components/hint"; import { useFormatDate } from "../../configurator/components/ui-helpers"; import { useDataCubeMetadataQuery } from "../../graphql/query-hooks"; @@ -66,9 +65,27 @@ export const DataSetMetadata = ({ dataSetIri }: { dataSetIri: string }) => { {data.dataCubeByIri.contactEmail ? ( - - {data.dataCubeByIri.contactEmail} - + + ) : ( + "–" + )} + + + + Further information + + + {data.dataCubeByIri.landingPage ? ( + ) : ( "–" )} @@ -107,3 +124,27 @@ const DataSetMetadataBody = ({ children }: { children: ReactNode }) => ( {children} ); + +const DatasetMetadataLink = ({ + href, + label, +}: { + href: string; + label: string; +}) => ( + + {label} + +); From 85e6ed3770e50ed369adb62ca7929c139fc7061c Mon Sep 17 00:00:00 2001 From: Bartosz Prusinowski Date: Wed, 13 Oct 2021 15:50:58 +0200 Subject: [PATCH 5/6] feat: Add translation for the landingPage metadata --- app/locales/de/messages.po | 16 ++++++++++------ app/locales/en/messages.po | 16 ++++++++++------ app/locales/fr/messages.po | 16 ++++++++++------ app/locales/it/messages.po | 16 ++++++++++------ 4 files changed, 40 insertions(+), 24 deletions(-) diff --git a/app/locales/de/messages.po b/app/locales/de/messages.po index 2c0657706..9e9049d6e 100644 --- a/app/locales/de/messages.po +++ b/app/locales/de/messages.po @@ -557,27 +557,31 @@ msgstr "Titel hinzufügen" msgid "dataset.includeDrafts" msgstr "Entwurfs-Datensätze anzeigen" -#: app/configurator/components/dataset-metadata.tsx:49 +#: app/configurator/components/dataset-metadata.tsx:48 msgid "dataset.metadata.date.created" msgstr "Erstellungsdatum" -#: app/configurator/components/dataset-metadata.tsx:26 +#: app/configurator/components/dataset-metadata.tsx:25 msgid "dataset.metadata.description" msgstr "Beschreibung" -#: app/configurator/components/dataset-metadata.tsx:65 +#: app/configurator/components/dataset-metadata.tsx:64 msgid "dataset.metadata.email" msgstr "Kontaktstellen" -#: app/configurator/components/dataset-metadata.tsx:35 +#: app/configurator/components/dataset-metadata.tsx:78 +msgid "dataset.metadata.landingPage" +msgstr "Weitere Informationen" + +#: app/configurator/components/dataset-metadata.tsx:34 msgid "dataset.metadata.source" msgstr "Quelle" -#: app/configurator/components/dataset-metadata.tsx:21 +#: app/configurator/components/dataset-metadata.tsx:20 msgid "dataset.metadata.title" msgstr "Titel" -#: app/configurator/components/dataset-metadata.tsx:58 +#: app/configurator/components/dataset-metadata.tsx:57 msgid "dataset.metadata.version" msgstr "Version" diff --git a/app/locales/en/messages.po b/app/locales/en/messages.po index 1b614c58f..b24708771 100644 --- a/app/locales/en/messages.po +++ b/app/locales/en/messages.po @@ -557,27 +557,31 @@ msgstr "Title" msgid "dataset.includeDrafts" msgstr "Include draft datasets" -#: app/configurator/components/dataset-metadata.tsx:49 +#: app/configurator/components/dataset-metadata.tsx:48 msgid "dataset.metadata.date.created" msgstr "Date created" -#: app/configurator/components/dataset-metadata.tsx:26 +#: app/configurator/components/dataset-metadata.tsx:25 msgid "dataset.metadata.description" msgstr "Description" -#: app/configurator/components/dataset-metadata.tsx:65 +#: app/configurator/components/dataset-metadata.tsx:64 msgid "dataset.metadata.email" msgstr "Contact points" -#: app/configurator/components/dataset-metadata.tsx:35 +#: app/configurator/components/dataset-metadata.tsx:78 +msgid "dataset.metadata.landingPage" +msgstr "Further information" + +#: app/configurator/components/dataset-metadata.tsx:34 msgid "dataset.metadata.source" msgstr "Source" -#: app/configurator/components/dataset-metadata.tsx:21 +#: app/configurator/components/dataset-metadata.tsx:20 msgid "dataset.metadata.title" msgstr "Title" -#: app/configurator/components/dataset-metadata.tsx:58 +#: app/configurator/components/dataset-metadata.tsx:57 msgid "dataset.metadata.version" msgstr "Version" diff --git a/app/locales/fr/messages.po b/app/locales/fr/messages.po index 8ca1e108f..4cefe080d 100644 --- a/app/locales/fr/messages.po +++ b/app/locales/fr/messages.po @@ -557,27 +557,31 @@ msgstr "Titre" msgid "dataset.includeDrafts" msgstr "Inclure les jeux de données à l'état d'ébauche" -#: app/configurator/components/dataset-metadata.tsx:49 +#: app/configurator/components/dataset-metadata.tsx:48 msgid "dataset.metadata.date.created" msgstr "Date de création" -#: app/configurator/components/dataset-metadata.tsx:26 +#: app/configurator/components/dataset-metadata.tsx:25 msgid "dataset.metadata.description" msgstr "Description" -#: app/configurator/components/dataset-metadata.tsx:65 +#: app/configurator/components/dataset-metadata.tsx:64 msgid "dataset.metadata.email" msgstr "Points de contact" -#: app/configurator/components/dataset-metadata.tsx:35 +#: app/configurator/components/dataset-metadata.tsx:78 +msgid "dataset.metadata.landingPage" +msgstr "Informations complémentaires" + +#: app/configurator/components/dataset-metadata.tsx:34 msgid "dataset.metadata.source" msgstr "Source" -#: app/configurator/components/dataset-metadata.tsx:21 +#: app/configurator/components/dataset-metadata.tsx:20 msgid "dataset.metadata.title" msgstr "Titre" -#: app/configurator/components/dataset-metadata.tsx:58 +#: app/configurator/components/dataset-metadata.tsx:57 msgid "dataset.metadata.version" msgstr "Version" diff --git a/app/locales/it/messages.po b/app/locales/it/messages.po index 3409c695c..35117eea2 100644 --- a/app/locales/it/messages.po +++ b/app/locales/it/messages.po @@ -557,27 +557,31 @@ msgstr "Titolo" msgid "dataset.includeDrafts" msgstr "Includi la bozza del set di dati" -#: app/configurator/components/dataset-metadata.tsx:49 +#: app/configurator/components/dataset-metadata.tsx:48 msgid "dataset.metadata.date.created" msgstr "Data di creazione" -#: app/configurator/components/dataset-metadata.tsx:26 +#: app/configurator/components/dataset-metadata.tsx:25 msgid "dataset.metadata.description" msgstr "Descrizione" -#: app/configurator/components/dataset-metadata.tsx:65 +#: app/configurator/components/dataset-metadata.tsx:64 msgid "dataset.metadata.email" msgstr "Punti di contatto" -#: app/configurator/components/dataset-metadata.tsx:35 +#: app/configurator/components/dataset-metadata.tsx:78 +msgid "dataset.metadata.landingPage" +msgstr "Addizionali informazioni" + +#: app/configurator/components/dataset-metadata.tsx:34 msgid "dataset.metadata.source" msgstr "Fonte" -#: app/configurator/components/dataset-metadata.tsx:21 +#: app/configurator/components/dataset-metadata.tsx:20 msgid "dataset.metadata.title" msgstr "Titolo" -#: app/configurator/components/dataset-metadata.tsx:58 +#: app/configurator/components/dataset-metadata.tsx:57 msgid "dataset.metadata.version" msgstr "versione" From 9337c661d20443e54ab506c548fde3cbf7e99b14 Mon Sep 17 00:00:00 2001 From: Bartosz Prusinowski Date: Thu, 14 Oct 2021 09:50:22 +0200 Subject: [PATCH 6/6] feat: Create primary and inline link variants --- app/components/chart-footnotes.tsx | 19 ++----------- app/components/data-download.tsx | 21 ++------------ .../components/dataset-metadata.tsx | 14 +--------- app/themes/federal.ts | 28 +++++++++++++++++-- 4 files changed, 32 insertions(+), 50 deletions(-) diff --git a/app/components/chart-footnotes.tsx b/app/components/chart-footnotes.tsx index 2f3c74608..189061e5e 100644 --- a/app/components/chart-footnotes.tsx +++ b/app/components/chart-footnotes.tsx @@ -52,26 +52,11 @@ export const ChartFootnotes = ({ <> · Created with visualize.admin.ch diff --git a/app/components/data-download.tsx b/app/components/data-download.tsx index 434213009..654b2806c 100644 --- a/app/components/data-download.tsx +++ b/app/components/data-download.tsx @@ -1,8 +1,8 @@ import { Trans } from "@lingui/macro"; -import { Box, Button, Link } from "theme-ui"; import { csvFormat } from "d3"; import { saveAs } from "file-saver"; import { memo, ReactNode, useMemo } from "react"; +import { Box, Button, Link } from "theme-ui"; import { ChartConfig, ChartFields } from "../configurator"; import { Observation } from "../domain/data"; import { @@ -58,23 +58,8 @@ export const DataDownload = memo( <> · ( - + {label} ); diff --git a/app/themes/federal.ts b/app/themes/federal.ts index 3d30bd4c2..8c4de97f1 100644 --- a/app/themes/federal.ts +++ b/app/themes/federal.ts @@ -70,8 +70,7 @@ export const theme: Theme = { warningLight: "#fffab2", }, fonts: { - body: - "FrutigerNeue, -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol", + body: "FrutigerNeue, -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol", monospace: "Menlo, monospace", }, fontSizes: [ @@ -362,6 +361,31 @@ export const theme: Theme = { }, }, }, + links: { + primary: { + color: "primary", + textDecoration: "none", + wordBreak: "break-word", + "&:hover": { + textDecoration: "underline", + }, + }, + inline: { + display: "inline", + textDecoration: "none", + color: "primary", + textAlign: "left", + fontFamily: "body", + lineHeight: [1, 2, 2], + fontWeight: "regular", + fontSize: [1, 2, 2], + border: "none", + cursor: "pointer", + "&:hover": { + textDecoration: "underline", + }, + }, + }, }; /**