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

feat: Add browsing description #268

Merged
merged 3 commits into from
Jan 20, 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
57 changes: 43 additions & 14 deletions app/configurator/components/select-dataset-step.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ import { Trans } from "@lingui/macro";
import NextLink from "next/link";
import { Router, useRouter } from "next/router";
import React, { useMemo } from "react";
import { Box, Link, Text } from "theme-ui";
import { Box, Button, Text } from "theme-ui";
import { useDebounce } from "use-debounce";
import { DataSetHint } from "../../components/hint";
import { useDataCubesQuery } from "../../graphql/query-hooks";
import { useConfiguratorState, useLocale } from "../../src";
import {
BrowseStateProvider,
buildURLFromBrowseState,
DataCubeAbout,
DatasetResults,
SearchDatasetBox,
SearchFilters,
Expand Down Expand Up @@ -86,18 +87,18 @@ export const SelectDatasetStepContent = () => {
>
<PanelLeftWrapper
raised={false}
sx={{ mt: "2.25rem", bg: "transparent" }}
sx={{ pt: "1.25rem", bg: "transparent" }}
>
{dataset ? (
<>
<Box px={4}>
<NextLink passHref href={backLink}>
<Link variant="primary">
<Button variant="secondary">
←{" "}
<Trans id="dataset-preview.back-to-results">
Back to the list
</Trans>
</Link>
</Button>
</NextLink>
</Box>
<DataSetMetadata sx={{ mt: "3rem" }} dataSetIri={dataset} />
Expand All @@ -113,16 +114,44 @@ export const SelectDatasetStepContent = () => {
}}
>
<Box sx={{ maxWidth: 900 }}>
<Text variant="heading1" sx={{ mb: 4 }}>
{dataset ? null : filters.length > 0 ? (
filters
.filter((f) => f.__typename !== "DataCubeAbout")
.map((f) => (f.__typename !== "DataCubeAbout" ? f.label : null))
.join(", ")
) : (
<Trans id="browse.datasets.all-datasets">All datasets</Trans>
)}
</Text>
{dataset ? null : filters.length > 0 ? (
filters
.filter(
(f): f is Exclude<typeof f, DataCubeAbout> =>
f.__typename !== "DataCubeAbout"
)
.map((f) => f.label)
.join(", ")
) : (
<>
<Text
variant="heading1"
color="monochrome800"
mb={4}
sx={{ display: "block" }}
>
<Trans id="browse.datasets.all-datasets">All datasets</Trans>
</Text>
<Text
variant="paragraph1"
color="monochrome800"
sx={{
mb: 4,
maxWidth: 800,
fontWeight: "light",
display: "block",
}}
>
<Trans id="browse.datasets.description">
Explore datasets provided by the LINDAS Linked Data Service by
either filtering by categories or organisations or search
directly for specific keywords. Click on a dataset to see more
detailed information and start creating your own
visualizations.
</Trans>
</Text>
</>
)}
{dataset ? null : (
<Box mb={4}>
<SearchDatasetBox browseState={browseState} searchResult={data} />
Expand Down
6 changes: 5 additions & 1 deletion app/locales/de/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,14 @@ msgstr "Kategorien"
msgid "browse.dataset.create-visualization"
msgstr "Visualisierung erstellen"

#: app/configurator/components/select-dataset-step.tsx:123
#: app/configurator/components/select-dataset-step.tsx:129
msgid "browse.datasets.all-datasets"
msgstr "Alle Datensätze"

#: app/configurator/components/select-dataset-step.tsx:141
msgid "browse.datasets.description"
msgstr "Erkunden Sie die vom LINDAS Linked Data Service bereitgestellten Datensätze, indem Sie entweder nach Kategorien oder Organisationen filtern oder direkt nach bestimmten Stichworten suchen. Klicken Sie auf einen Datensatz, um detailliertere Informationen zu erhalten und Ihre eigenen Visualisierungen zu erstellen."

#: app/pages/v/[chartId].tsx:122
msgid "button.copy.visualization"
msgstr "Diese Visualisierung kopieren"
Expand Down
6 changes: 5 additions & 1 deletion app/locales/en/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,14 @@ msgstr "Categories"
msgid "browse.dataset.create-visualization"
msgstr "Create visualization"

#: app/configurator/components/select-dataset-step.tsx:123
#: app/configurator/components/select-dataset-step.tsx:129
msgid "browse.datasets.all-datasets"
msgstr "All Datasets"

#: app/configurator/components/select-dataset-step.tsx:141
msgid "browse.datasets.description"
msgstr "Explore datasets provided by the LINDAS Linked Data Service by either filtering by categories or organisations or search directly for specific keywords. Click on a dataset to see more detailed information and start creating your own visualizations."

#: app/pages/v/[chartId].tsx:122
msgid "button.copy.visualization"
msgstr "Copy This Visualization"
Expand Down
6 changes: 5 additions & 1 deletion app/locales/fr/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,14 @@ msgstr "Catégories"
msgid "browse.dataset.create-visualization"
msgstr "Créer une visualisation"

#: app/configurator/components/select-dataset-step.tsx:123
#: app/configurator/components/select-dataset-step.tsx:129
msgid "browse.datasets.all-datasets"
msgstr "Tout les jeux de données"

#: app/configurator/components/select-dataset-step.tsx:141
msgid "browse.datasets.description"
msgstr "Explorez les jeux de données liés fournis par LINDAS, en filtrant par catégories ou organisations, ou en recherchant par mots-clés. Cliquez sur un ensemble de données pour afficher des informations plus détaillées et commencer à créer vos propres visualisations. "

#: app/pages/v/[chartId].tsx:122
msgid "button.copy.visualization"
msgstr "Copier cette visualisation"
Expand Down
6 changes: 5 additions & 1 deletion app/locales/it/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,14 @@ msgstr "Categorie"
msgid "browse.dataset.create-visualization"
msgstr "Crea una visualizzazione"

#: app/configurator/components/select-dataset-step.tsx:123
#: app/configurator/components/select-dataset-step.tsx:129
msgid "browse.datasets.all-datasets"
msgstr "Tutti i set di dati"

#: app/configurator/components/select-dataset-step.tsx:141
msgid "browse.datasets.description"
msgstr "Esplora i set di dati forniti dal LINDAS Linked Data Service filtrando per categorie o organizzazioni oppure cercando direttamente per parole chiave specifiche. Clicca su un set di dati per vedere informazioni più dettagliate e iniziare a creare le tue visualizzazioni."

#: app/pages/v/[chartId].tsx:122
msgid "button.copy.visualization"
msgstr "Copia questa visualizzazione"
Expand Down
10 changes: 7 additions & 3 deletions app/themes/federal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ export const theme: Theme = {
secondaryActive: "#454545",
secondaryDisabled: "#a6a6a6",

secondaryButton: "#d8e8ef",
secondaryButtonHover: "#CCDFE7",

success: "#3c763d",
successHover: "#3c763d",
successActive: "#3c763d",
Expand Down Expand Up @@ -311,12 +314,13 @@ export const theme: Theme = {
},
secondary: {
variant: "buttons.primary",
bg: "secondary",
bg: "secondaryButton",
color: "primary",
":hover": {
bg: "secondaryHover",
bg: "secondaryButtonHover",
},
":active": {
bg: "secondaryHover",
bg: "secondaryButtonHover",
},
":disabled": {
cursor: "initial",
Expand Down