diff --git a/.env.example b/.env.example new file mode 100644 index 000000000..8cfb997e5 --- /dev/null +++ b/.env.example @@ -0,0 +1,2 @@ +# You can get the Accent API key from Accent platform +ACCENT_API_KEY=123 diff --git a/.gitignore b/.gitignore index 9208f82d4..db122ff0e 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ node_modules /app/dist .now +.env .env*.local __diff_output__ diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e05f9b32..3ebe03f69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,8 @@ You can also check the - Single chart titles are now correctly displayed in user profile - Renaming of charts through user profile now works correctly - Manually entering dates in date pickers works correctly again + - Improved scrolling behavior in the chart tabs + - Aligned editor and layouting page layouts # [4.7.4] - 2024-07-23 diff --git a/README.md b/README.md index 8cc7987f4..dc31ae538 100644 --- a/README.md +++ b/README.md @@ -366,3 +366,8 @@ goes: In the future, we might want to integrate further Accent so that it opens pull requests. + +> ℹ️ To automatically authenticate with Accent, you can set the `ACCENT_API_KEY` +> environment variable in your `.env` file in the root of the project. You can +> find the API key in the Accent web UI. Otherwise, you can add the key inline +> when running the command, e.g. `ACCENT_API_KEY=your_key yarn locales:push`. diff --git a/app/components/chart-published.tsx b/app/components/chart-published.tsx index d01a75a50..bfa429e0f 100644 --- a/app/components/chart-published.tsx +++ b/app/components/chart-published.tsx @@ -169,7 +169,7 @@ export const ChartPublished = (props: ChartPublishedProps) => { )} - + { - const { data } = props; +const TabsFixed = ({ data }: { data: TabDatum[] }) => { const [, dispatch] = useConfiguratorState(isPublished); - return ( { ); }; -const NextStepButton = (props: React.PropsWithChildren<{}>) => { - const { children } = props; - const locale = useLocale(); - const [state, dispatch] = useConfiguratorState(hasChartConfigs); - const chartConfig = getChartConfig(state); - const componentIris = extractChartConfigComponentIris({ chartConfig }); - const [{ data: components }] = useDataCubesComponentsQuery({ - variables: { - sourceType: state.dataSource.type, - sourceUrl: state.dataSource.url, - locale, - cubeFilters: chartConfig.cubes.map((cube) => ({ - iri: cube.iri, - componentIris, - filters: cube.filters, - joinBy: cube.joinBy, - loadValues: true, - })), - }, - }); - const handleClick = useEvent(() => { - if (components?.dataCubesComponents) { - dispatch({ - type: "STEP_NEXT", - dataCubesComponents: components.dataCubesComponents, - }); - } - }); - - return ( - - ); -}; - -const LayoutChartButton = () => { - return ( - - Proceed to layout options - - ); -}; - -export const SaveDraftButton = ({ - chartId, -}: { - chartId: string | undefined; -}) => { - const { data: config, invalidate: invalidateConfig } = useUserConfig(chartId); - const session = useSession(); - const client = useClient(); - - const [state, dispatch] = useConfiguratorState(); - - const [snack, enqueueSnackbar, dismissSnack] = useLocalSnack(); - const [debouncedSnack] = useDebounce(snack, 500); - const { asPath, replace } = useRouter(); - - const createConfigMut = useMutate(createConfig); - const updatePublishedStateMut = useMutate(updateConfig); - const loggedInId = session.data?.user.id; - - const handleClick = useEventCallback(async () => { - try { - if (config?.user_id && loggedInId) { - const updated = await updatePublishedStateMut.mutate({ - data: state, - published_state: PUBLISHED_STATE.DRAFT, - key: config.key, - }); - - if (updated) { - if (asPath !== `/create/${updated.key}`) { - replace(`/create/new?edit=${updated.key}`); - } - } else { - throw new Error("Could not update draft"); - } - } else if (state) { - const saved = await createConfigMut.mutate({ - data: state, - user_id: loggedInId, - published_state: PUBLISHED_STATE.DRAFT, - }); - if (saved) { - const config = await initChartStateFromChartEdit( - client, - saved.key, - state.state - ); - - if (!config) { - return; - } - - dispatch({ type: "INITIALIZED", value: config }); - saveChartLocally(saved.key, config); - replace(`/create/${saved.key}`, undefined, { - shallow: true, - }); - } else { - throw new Error("Could not save draft"); - } - } - - enqueueSnackbar({ - message: ( - <> - {replaceLinks( - t({ - id: "button.save-draft.saved", - message: "Draft saved in [My visualisations](/profile)", - }), - (label, href) => { - return ( -
- {label} -
- ); - } - )} - - ), - variant: "success", - }); - - invalidateConfig(); - } catch (e) { - console.log( - `Error while saving draft: ${e instanceof Error ? e.message : e}` - ); - enqueueSnackbar({ - message: t({ - id: "button.save-draft.error", - message: "Could not save draft", - }), - variant: "error", - }); - } - - setTimeout(() => { - updatePublishedStateMut.reset(); - createConfigMut.reset(); - }, 2000); - }); - - const hasUpdated = !!(updatePublishedStateMut.data || createConfigMut.data); - const [debouncedHasUpdated] = useDebounce(hasUpdated, 300); - - if (!loggedInId) { - return null; - } - - return ( - dismissSnack()} - > - - - ); -}; - -export const PublishChartButton = ({ - chartId, -}: { - chartId: string | undefined; -}) => { - const session = useSession(); - const { data: config } = useUserConfig(chartId); - const editingPublishedChart = - session.data?.user.id && - config?.user_id === session.data.user.id && - config.published_state === "PUBLISHED"; - - return ( - - {editingPublishedChart ? ( - - -
- -
-
- Update this visualization -
- ) : ( - Publish - )} -
- ); -}; - -type TabsInnerProps = { - data: TabDatum[]; - addable: boolean; - editable: boolean; - draggable: boolean; - onChartAdd?: (e: React.MouseEvent) => void; - onChartEdit?: (e: React.MouseEvent, key: string) => void; - onChartSwitch?: (key: string) => void; -}; - /** * The Tabs component clones its children adding extra properties, expecting that we use Tab components. * Since we either use a Draggable or a div, we must not forward directly the properties. @@ -612,24 +351,11 @@ const useTabsInnerStyles = makeStyles((theme) => ({ root: { display: "flex", alignItems: "center", - justifyContent: "space-between", gap: 1, }, tab: { zIndex: 1, maxWidth: "auto", - "&:first-child": { - // We need to add a negative margin to the first tab so that its left margin - // goes "under" the border of the tab list. - marginLeft: -1, - }, - }, - // :last-child does not work when the tabs are not scrollable - // MUI seems to add an empty element at the end, thus we cannot use :last-child - lastTab: { - // We need to add a negative margin to the last tab so that its right margin - // goes "under" the border of the tab list. - marginRight: -1, }, tabList: { top: 1, @@ -644,30 +370,34 @@ const useTabsInnerStyles = makeStyles((theme) => ({ [`& .${tabClasses.root}`]: { maxWidth: "max-content", }, - - "&:before, &:after": { - top: 1, - content: '""', - bottom: 1, - position: "absolute", - width: "var(--cut-off-width)", - zIndex: 10, + }, + scrollButton: { + display: "flex", + justifyContent: "center", + alignItems: "center", + width: "2.5rem", + minWidth: "2.5rem", + padding: 0, + minHeight: 0, + color: theme.palette.text.primary, + "&:hover": { + backgroundColor: "transparent", }, - "&:before": { - borderBottom: 0, - left: 0, - right: "auto", - backgroundImage: "linear-gradient(to left, transparent, var(--bg))", - }, - "&:after": { - left: "auto", - right: 0, - backgroundImage: "linear-gradient(to right, transparent, var(--bg))", + "& > svg": { + pointerEvents: "none", }, }, })); -const TabsInner = (props: TabsInnerProps) => { +const TabsInner = (props: { + data: TabDatum[]; + addable: boolean; + editable: boolean; + draggable: boolean; + onChartAdd?: (e: React.MouseEvent) => void; + onChartEdit?: (e: React.MouseEvent, key: string) => void; + onChartSwitch?: (key: string) => void; +}) => { const classes = useTabsInnerStyles(); const { data, @@ -678,13 +408,8 @@ const TabsInner = (props: TabsInnerProps) => { onChartAdd, onChartSwitch, } = props; - const [state, dispatch] = useConfiguratorState(hasChartConfigs); - - const { asPath } = useRouter(); - const chartId = getRouterChartId(asPath); - + const [_, dispatch] = useConfiguratorState(hasChartConfigs); const activeTabIndex = data.findIndex((x) => x.active); - return (
@@ -706,8 +431,23 @@ const TabsInner = (props: TabsInnerProps) => { ( + + )} > {data.map((d, i) => ( @@ -731,14 +471,11 @@ const TabsInner = (props: TabsInnerProps) => { classes.tab, // We need to add the "selected" class ourselves since we are wrapping // the tabs by Draggable. - i === activeTabIndex ? "Mui-selected" : "", - i === data.length - 1 ? classes.lastTab : "" + i === activeTabIndex ? "Mui-selected" : "" )} sx={{ px: 0, - flexShrink: 1, minWidth: d.label ? 180 : 0, - flexBasis: "100%", }} label={ { - {addable && ( - } onClick={onChartAdd} - label={} - /> + sx={{ minWidth: "fit-content", ml: "0.5rem", px: 3 }} + > + Add chart + )} - - - {isConfiguring(state) ? : null} - {editable && - isConfiguring(state) && - (enableLayouting(state) ? ( - - ) : ( - - ))} -
); }; @@ -876,7 +594,7 @@ export const useIconStyles = makeStyles< }, })); -type TabContentProps = { +const TabContent = (props: { iconName: IconName; chartKey: string; editable?: boolean; @@ -889,9 +607,7 @@ type TabContentProps = { activeChartKey: string ) => void; onSwitchClick?: () => void; -}; - -const TabContent = (props: TabContentProps) => { +}) => { const { iconName, chartKey, @@ -904,7 +620,6 @@ const TabContent = (props: TabContentProps) => { onSwitchClick, } = props; const classes = useIconStyles({ active, dragging }); - return ( - {label ? ( )} - {draggable && } ); diff --git a/app/components/dashboard-interactive-filters.tsx b/app/components/dashboard-interactive-filters.tsx index 42a0a3df0..6e1ab5758 100644 --- a/app/components/dashboard-interactive-filters.tsx +++ b/app/components/dashboard-interactive-filters.tsx @@ -30,6 +30,7 @@ import { import { isTemporalDimension } from "@/domain/data"; import { useDataCubesComponentsQuery } from "@/graphql/hooks"; import { TimeUnit } from "@/graphql/query-hooks"; +import { useTimeout } from "@/hooks/use-timeout"; import { useLocale } from "@/locales/use-locale"; import { setDataFilter, @@ -39,26 +40,28 @@ import { useTransitionStore } from "@/stores/transition"; import { assert } from "@/utils/assert"; import useEvent from "@/utils/use-event"; -import { useTimeout } from "../hooks/use-timeout"; - export const DashboardInteractiveFilters = (props: BoxProps) => { + const { sx, ...rest } = props; const [state] = useConfiguratorState(hasChartConfigs); const { dashboardFilters } = state; - return ( - - {dashboardFilters?.timeRange.active ? ( + const { timeRange, dataFilters } = dashboardFilters ?? { + timeRange: undefined, + dataFilters: undefined, + }; + const show = !!(timeRange?.active || dataFilters?.componentIris.length); + return show ? ( + + {timeRange?.active ? ( ) : null} - {dashboardFilters?.dataFilters.componentIris.length ? ( - + {dataFilters?.componentIris.length ? ( + ) : null} - ); + ) : null; }; const useTimeRangeRangeStyles = makeStyles((theme: Theme) => ({ diff --git a/app/components/tabs.tsx b/app/components/tabs.tsx index fc3032d99..6ba0bee02 100644 --- a/app/components/tabs.tsx +++ b/app/components/tabs.tsx @@ -3,10 +3,15 @@ import { styled, Tab, TabProps, tabsClasses } from "@mui/material"; export const VisualizeTabList = styled(TabList)(({ theme }) => { return { - position: "relative", + border: "none !important", [`& .${tabsClasses.indicator}`]: { display: "none", }, + [`& .${tabsClasses.scrollButtons}`]: { + display: "flex", + justifyContent: "center", + alignItems: "center", + }, // Use before so that bottom border of tabs can go "over" the tab list // bottom border @@ -32,7 +37,6 @@ export const VisualizeTab = styled(Tab)(({ theme }) => { position: "relative", top: 0, zIndex: 1, - borderBottom: `1px solid ${theme.palette.divider}`, "&.Mui-selected": { borderBottomColor: theme.palette.background.paper, }, diff --git a/app/configurator/components/configurator.tsx b/app/configurator/components/configurator.tsx index e547a917d..4c90cc935 100644 --- a/app/configurator/components/configurator.tsx +++ b/app/configurator/components/configurator.tsx @@ -1,26 +1,40 @@ -import { Trans } from "@lingui/macro"; -import { Box, SxProps, Typography } from "@mui/material"; +import { t, Trans } from "@lingui/macro"; +import { + Box, + Grow, + SxProps, + Tooltip, + Typography, + useEventCallback, +} from "@mui/material"; import Button, { ButtonProps } from "@mui/material/Button"; +import { PUBLISHED_STATE } from "@prisma/client"; +import { useSession } from "next-auth/react"; +import NextLink from "next/link"; import { useRouter } from "next/router"; import React, { useEffect, useMemo } from "react"; +import { useClient } from "urql"; +import { useDebounce } from "use-debounce"; import { SelectDatasetStep } from "@/browser/select-dataset-step"; import { META } from "@/charts"; +import { extractChartConfigComponentIris } from "@/charts/shared/chart-helpers"; import { ChartPreview } from "@/components/chart-preview"; -import { - PublishChartButton, - SaveDraftButton, -} from "@/components/chart-selection-tabs"; import { HEADER_HEIGHT } from "@/components/header-constants"; import { Loading } from "@/components/hint"; import { - MetadataPanelStoreContext, createMetadataPanelStore, + MetadataPanelStoreContext, } from "@/components/metadata-panel-store"; +import { useLocalSnack } from "@/components/use-local-snack"; import { ConfiguratorState, + enableLayouting, getChartConfig, + hasChartConfigs, + initChartStateFromChartEdit, isConfiguring, + saveChartLocally, useConfiguratorState, } from "@/configurator"; import { @@ -43,6 +57,9 @@ import { } from "@/configurator/components/layout"; import { LayoutConfigurator } from "@/configurator/components/layout-configurator"; import { ChartConfiguratorTable } from "@/configurator/table/table-chart-configurator"; +import { useUserConfig } from "@/domain/user-configs"; +import { useDataCubesComponentsQuery } from "@/graphql/hooks"; +import { Icon } from "@/icons"; import SvgIcChevronLeft from "@/icons/components/IcChevronLeft"; import { useLocale } from "@/locales/use-locale"; import { useDataSourceStore } from "@/stores/data-source"; @@ -50,8 +67,11 @@ import { InteractiveFiltersChartProvider, InteractiveFiltersProvider, } from "@/stores/interactive-filters"; +import { createConfig, updateConfig } from "@/utils/chart-config/api"; import { getRouterChartId } from "@/utils/router/helpers"; +import { replaceLinks } from "@/utils/ui-strings"; import useEvent from "@/utils/use-event"; +import { useMutate } from "@/utils/use-fetch-data"; const BackContainer = (props: React.PropsWithChildren<{ sx?: SxProps }>) => { const { children, sx } = props; @@ -59,10 +79,10 @@ const BackContainer = (props: React.PropsWithChildren<{ sx?: SxProps }>) => { return ( @@ -141,6 +161,227 @@ const BackToMainButton = (props: BackToMainButtonProps) => { ); }; +const NextStepButton = (props: React.PropsWithChildren<{}>) => { + const { children } = props; + const locale = useLocale(); + const [state, dispatch] = useConfiguratorState(hasChartConfigs); + const chartConfig = getChartConfig(state); + const componentIris = extractChartConfigComponentIris({ chartConfig }); + const [{ data: components }] = useDataCubesComponentsQuery({ + variables: { + sourceType: state.dataSource.type, + sourceUrl: state.dataSource.url, + locale, + cubeFilters: chartConfig.cubes.map((cube) => ({ + iri: cube.iri, + componentIris, + filters: cube.filters, + joinBy: cube.joinBy, + loadValues: true, + })), + }, + }); + + const handleClick = useEvent(() => { + if (components?.dataCubesComponents) { + dispatch({ + type: "STEP_NEXT", + dataCubesComponents: components.dataCubesComponents, + }); + } + }); + + return ( + + ); +}; + +export const SaveDraftButton = ({ + chartId, +}: { + chartId: string | undefined; +}) => { + const { data: config, invalidate: invalidateConfig } = useUserConfig(chartId); + const session = useSession(); + const client = useClient(); + + const [state, dispatch] = useConfiguratorState(); + + const [snack, enqueueSnackbar, dismissSnack] = useLocalSnack(); + const [debouncedSnack] = useDebounce(snack, 500); + const { asPath, replace } = useRouter(); + + const createConfigMut = useMutate(createConfig); + const updatePublishedStateMut = useMutate(updateConfig); + const loggedInId = session.data?.user.id; + + const handleClick = useEventCallback(async () => { + try { + if (config?.user_id && loggedInId) { + const updated = await updatePublishedStateMut.mutate({ + data: state, + published_state: PUBLISHED_STATE.DRAFT, + key: config.key, + }); + + if (updated) { + if (asPath !== `/create/${updated.key}`) { + replace(`/create/new?edit=${updated.key}`); + } + } else { + throw new Error("Could not update draft"); + } + } else if (state) { + const saved = await createConfigMut.mutate({ + data: state, + user_id: loggedInId, + published_state: PUBLISHED_STATE.DRAFT, + }); + if (saved) { + const config = await initChartStateFromChartEdit( + client, + saved.key, + state.state + ); + + if (!config) { + return; + } + + dispatch({ type: "INITIALIZED", value: config }); + saveChartLocally(saved.key, config); + replace(`/create/${saved.key}`, undefined, { + shallow: true, + }); + } else { + throw new Error("Could not save draft"); + } + } + + enqueueSnackbar({ + message: ( + <> + {replaceLinks( + t({ + id: "button.save-draft.saved", + message: "Draft saved in [My visualisations](/profile)", + }), + (label, href) => { + return ( +
+ {label} +
+ ); + } + )} + + ), + variant: "success", + }); + + invalidateConfig(); + } catch (e) { + console.log( + `Error while saving draft: ${e instanceof Error ? e.message : e}` + ); + enqueueSnackbar({ + message: t({ + id: "button.save-draft.error", + message: "Could not save draft", + }), + variant: "error", + }); + } + + setTimeout(() => { + updatePublishedStateMut.reset(); + createConfigMut.reset(); + }, 2000); + }); + + const hasUpdated = !!(updatePublishedStateMut.data || createConfigMut.data); + const [debouncedHasUpdated] = useDebounce(hasUpdated, 300); + + if (!loggedInId) { + return null; + } + + return ( + dismissSnack()} + > + + + ); +}; + +const LayoutChartButton = () => { + return ( + + Proceed to layout options + + ); +}; + +const PublishChartButton = ({ chartId }: { chartId: string | undefined }) => { + const session = useSession(); + const { data: config } = useUserConfig(chartId); + const editingPublishedChart = + session.data?.user.id && + config?.user_id === session.data.user.id && + config.published_state === "PUBLISHED"; + + return ( + + {editingPublishedChart ? ( + + +
+ +
+
+ Update this visualization +
+ ) : ( + Publish + )} +
+ ); +}; + const ConfigureChartStep = () => { const [state, dispatch] = useConfiguratorState(); const configuring = isConfiguring(state); @@ -172,9 +413,37 @@ const ConfigureChartStep = () => { return null; } + const chartId = getRouterChartId(router.asPath); + return ( - + t.palette.muted.main }}> + + + + + Back to preview + + + + + + {enableLayouting(state) ? ( + + ) : ( + + )} + + { flexDirection: "column", }} > - - - Back to preview - - {chartConfig.chartType === "table" ? ( ) : ( diff --git a/app/configurator/components/layout.tsx b/app/configurator/components/layout.tsx index 8c9a54a08..6fb0e14d9 100644 --- a/app/configurator/components/layout.tsx +++ b/app/configurator/components/layout.tsx @@ -43,6 +43,7 @@ const useStyles = makeStyles((theme) => ({ panelHeaderLayout: { gridArea: "header", background: theme.palette.background.paper, + minHeight: 96, }, LMRPanelHeaderLayout: { width: "100%", @@ -63,6 +64,8 @@ const useStyles = makeStyles((theme) => ({ }, RPanelHeaderWrapper: { gridArea: "right", + display: "flex", + alignItems: "center", padding: theme.spacing(5), }, LPanelBodyWrapper: { diff --git a/app/locales/de/messages.po b/app/locales/de/messages.po index 6d20dc6de..fdc090b06 100644 --- a/app/locales/de/messages.po +++ b/app/locales/de/messages.po @@ -30,7 +30,6 @@ msgstr "Kein Ergebnis" msgid "annotation.add.description" msgstr "[ Ohne Beschreibung ]" -#: app/components/rename-dialog.tsx #: app/configurator/components/annotators.tsx #: app/login/components/profile-tables.tsx msgid "annotation.add.title" @@ -107,7 +106,7 @@ msgstr "Kopieren" msgid "button.hint.copied" msgstr "Kopiert!" -#: app/components/chart-selection-tabs.tsx +#: app/configurator/components/configurator.tsx msgid "button.layout" msgstr "Weiter zu den Layout-Optionen" @@ -115,32 +114,32 @@ msgstr "Weiter zu den Layout-Optionen" msgid "button.new.visualization" msgstr "Neue Visualisierung erstellen" -#: app/components/chart-selection-tabs.tsx +#: app/configurator/components/configurator.tsx msgid "button.publish" msgstr "Veröffentlichen" -#: app/components/chart-selection-tabs.tsx +#: app/configurator/components/configurator.tsx msgid "button.save-draft" msgstr "Entwurf speichern" -#: app/components/chart-selection-tabs.tsx +#: app/configurator/components/configurator.tsx msgid "button.save-draft.error" msgstr "Entwurf konnte nicht gespeichert werden" -#: app/components/chart-selection-tabs.tsx +#: app/configurator/components/configurator.tsx msgid "button.save-draft.saved" -msgstr "Entwurf gespeichert in [Meine veröffentlichten Visualisierungen](/profile)" +msgstr "Entwurf gespeichert in [Meine Visualisierungen](/profile)" #: app/components/chart-shared.tsx #: app/components/publish-actions.tsx msgid "button.share" msgstr "Teilen" -#: app/components/chart-selection-tabs.tsx +#: app/configurator/components/configurator.tsx msgid "button.update" msgstr "Diese Visualisierung aktualisieren" -#: app/components/chart-selection-tabs.tsx +#: app/configurator/components/configurator.tsx msgid "button.update.warning" msgstr "Denken Sie daran, dass sich die Aktualisierung dieser Visualisierung auf alle Stellen auswirkt, an denen sie bereits eingebettet ist!" @@ -181,6 +180,10 @@ msgstr "SPARQL-Abfrage" msgid "chart-controls.table-view" msgstr "Tabellenansicht" +#: app/components/chart-selection-tabs.tsx +msgid "chart-selection-tabs.add-chart" +msgstr "" + #: app/components/chart-selection-tabs.tsx msgid "chart-selection-tabs.add-chart-different-dataset.button" msgstr "Datensatz auswählen" @@ -199,7 +202,7 @@ msgstr "Hinzufügen" #: app/configurator/components/add-dataset-dialog.tsx msgid "chart.datasets.add-dataset-dialog.description" -msgstr "Sie können nur Datensätze kombinieren, die Dimensionen mit derselben Einheit und Auflösung teilen. Standardmäßig werden Dimensionen ausgewählt, die zum aktuellen Diagramm passen." +msgstr "Sie können nur Datensätze kombinieren, die Dimensionen mit derselben Einheit und Auflösung teilen. Standardmässig werden Dimensionen ausgewählt, die zum aktuellen Diagramm passen." #: app/configurator/components/add-dataset-dialog.tsx msgid "chart.datasets.add-dataset-dialog.title" @@ -700,7 +703,7 @@ msgstr "Suche zurücksetzen" #: app/charts/chart-config-ui-options.ts msgid "controls.section.animation.disabled-by-sorting" -msgstr "Die Animation ist bei der Sortierung nach Gesamtgröße deaktiviert." +msgstr "Die Animation ist bei der Sortierung nach Gesamtgrösse deaktiviert." #: app/configurator/components/chart-options-selector.tsx msgid "controls.section.animation.duration" @@ -740,7 +743,7 @@ msgstr "Kontinuierlich" #: app/configurator/components/chart-options-selector.tsx msgid "controls.section.animation.type.explanation" -msgstr "Verwenden Sie den Typ Abgestuft, um die Animation in festen Abständen zwischen Datenpunkten springen zu lassen. Dieser Modus ist nützlich, wenn Sie Daten mit einer Zeitdimension mit einer ungleichmäßigen Verteilung der Daten animieren möchten." +msgstr "Verwenden Sie den Typ Abgestuft, um die Animation in festen Abständen zwischen Datenpunkten springen zu lassen. Dieser Modus ist nützlich, wenn Sie Daten mit einer Zeitdimension mit einer ungleichmässigen Verteilung der Daten animieren möchten." #: app/configurator/components/chart-options-selector.tsx msgid "controls.section.animation.type.stepped" @@ -990,7 +993,7 @@ msgstr "Kleinste zuerst" #: app/charts/chart-config-ui-options.ts msgid "controls.sorting.byTotalSize.disabled-by-animation" -msgstr "Die Sortierung nach Gesamtgröße ist während der Animation deaktiviert." +msgstr "Die Sortierung nach Gesamtgrösse ist während der Animation deaktiviert." #: app/configurator/components/field-i18n.ts msgid "controls.sorting.byTotalSize.largestBottom" @@ -1084,7 +1087,7 @@ msgstr "Einige Daten in diesem Datensatz fehlen und wurden interpoliert, um die #: app/browser/dataset-browse.tsx msgid "dataset.includeDrafts" -msgstr "Entwürfe einschließen" +msgstr "Entwürfe einschliessen" #: app/components/dataset-metadata.tsx msgid "dataset.metadata.date.created" @@ -1184,11 +1187,11 @@ msgstr "{0} angezeigt in dieser Ansicht" #: app/configurator/components/add-dataset-dialog.tsx msgid "dataset.search.preview.new-dimension" -msgstr "Neue" +msgstr "Neu" #: app/configurator/components/add-dataset-dialog.tsx msgid "dataset.search.preview.title" -msgstr "Überprüfen Sie die verfügbaren Abmessungen" +msgstr "Überprüfen Sie die verfügbaren Dimensionen" #: app/configurator/components/add-dataset-dialog.tsx msgid "dataset.search.search-options.more-2-options-selected" @@ -1362,7 +1365,7 @@ msgstr "Vorschau" #: app/login/components/profile-tables.tsx msgid "login.chart.rename" -msgstr "Umbenennen" +msgstr "" #: app/login/components/profile-tables.tsx msgid "login.chart.share" @@ -1370,7 +1373,7 @@ msgstr "Teilen" #: app/login/components/profile-tables.tsx msgid "login.chart.view" -msgstr "Vorschau" +msgstr "" #: app/login/components/profile-tables.tsx msgid "login.create-chart" @@ -1390,19 +1393,19 @@ msgstr "Denken Sie daran, dass das Entfernen dieser Visualisierung sich auf alle #: app/login/components/profile-content-tabs.tsx msgid "login.profile.home" -msgstr "Übersicht" +msgstr "Empfang" #: app/login/components/profile-content-tabs.tsx #: app/login/components/profile-content-tabs.tsx #: app/login/components/profile-content-tabs.tsx msgid "login.profile.my-drafts" -msgstr "Entwürfe" +msgstr "Meine Entwürfe" #: app/login/components/profile-content-tabs.tsx #: app/login/components/profile-content-tabs.tsx #: app/login/components/profile-content-tabs.tsx msgid "login.profile.my-published-visualizations" -msgstr "Meine veröffentlichten Visualisierungen" +msgstr "Meine Visualisierungen" #: app/login/components/profile-tables.tsx msgid "login.profile.my-visualizations.chart-actions" diff --git a/app/locales/en/messages.po b/app/locales/en/messages.po index 537244536..6b87bd522 100644 --- a/app/locales/en/messages.po +++ b/app/locales/en/messages.po @@ -30,7 +30,6 @@ msgstr "No results" msgid "annotation.add.description" msgstr "[ No Description ]" -#: app/components/rename-dialog.tsx #: app/configurator/components/annotators.tsx #: app/login/components/profile-tables.tsx msgid "annotation.add.title" @@ -107,7 +106,7 @@ msgstr "Click to copy" msgid "button.hint.copied" msgstr "Copied!" -#: app/components/chart-selection-tabs.tsx +#: app/configurator/components/configurator.tsx msgid "button.layout" msgstr "Proceed to layout options" @@ -115,19 +114,19 @@ msgstr "Proceed to layout options" msgid "button.new.visualization" msgstr "Create New Visualization" -#: app/components/chart-selection-tabs.tsx +#: app/configurator/components/configurator.tsx msgid "button.publish" msgstr "Publish" -#: app/components/chart-selection-tabs.tsx +#: app/configurator/components/configurator.tsx msgid "button.save-draft" msgstr "Save draft" -#: app/components/chart-selection-tabs.tsx +#: app/configurator/components/configurator.tsx msgid "button.save-draft.error" msgstr "Could not save draft" -#: app/components/chart-selection-tabs.tsx +#: app/configurator/components/configurator.tsx msgid "button.save-draft.saved" msgstr "Draft saved in [My visualisations](/profile)" @@ -136,11 +135,11 @@ msgstr "Draft saved in [My visualisations](/profile)" msgid "button.share" msgstr "Share" -#: app/components/chart-selection-tabs.tsx +#: app/configurator/components/configurator.tsx msgid "button.update" msgstr "Update this visualization" -#: app/components/chart-selection-tabs.tsx +#: app/configurator/components/configurator.tsx msgid "button.update.warning" msgstr "Keep in mind that updating this visualization will affect all the places where it might be already embedded!" @@ -181,6 +180,10 @@ msgstr "SPARQL query" msgid "chart-controls.table-view" msgstr "Table view" +#: app/components/chart-selection-tabs.tsx +msgid "chart-selection-tabs.add-chart" +msgstr "Add chart" + #: app/components/chart-selection-tabs.tsx msgid "chart-selection-tabs.add-chart-different-dataset.button" msgstr "Select dataset" @@ -1396,7 +1399,7 @@ msgstr "Home" #: app/login/components/profile-content-tabs.tsx #: app/login/components/profile-content-tabs.tsx msgid "login.profile.my-drafts" -msgstr "My draft visualisations" +msgstr "My drafts" #: app/login/components/profile-content-tabs.tsx #: app/login/components/profile-content-tabs.tsx @@ -1541,7 +1544,7 @@ msgstr "Year" #: app/components/chart-footnotes.tsx msgid "typography.colon" -msgstr ": " +msgstr ":" #: app/components/confirmation-dialog.tsx msgid "yes" diff --git a/app/locales/fr/messages.po b/app/locales/fr/messages.po index 402f4f3fa..1851ebe52 100644 --- a/app/locales/fr/messages.po +++ b/app/locales/fr/messages.po @@ -30,7 +30,6 @@ msgstr "Aucun résultat" msgid "annotation.add.description" msgstr "[ Pas de description ]" -#: app/components/rename-dialog.tsx #: app/configurator/components/annotators.tsx #: app/login/components/profile-tables.tsx msgid "annotation.add.title" @@ -107,7 +106,7 @@ msgstr "Cliquer pour copier" msgid "button.hint.copied" msgstr "Copié!" -#: app/components/chart-selection-tabs.tsx +#: app/configurator/components/configurator.tsx msgid "button.layout" msgstr "Passer aux options de présentation" @@ -115,19 +114,19 @@ msgstr "Passer aux options de présentation" msgid "button.new.visualization" msgstr "Créer une nouvelle visualisation" -#: app/components/chart-selection-tabs.tsx +#: app/configurator/components/configurator.tsx msgid "button.publish" msgstr "Publier" -#: app/components/chart-selection-tabs.tsx +#: app/configurator/components/configurator.tsx msgid "button.save-draft" msgstr "Sauver le brouillon" -#: app/components/chart-selection-tabs.tsx +#: app/configurator/components/configurator.tsx msgid "button.save-draft.error" msgstr "Impossible d'enregistrer le brouillon" -#: app/components/chart-selection-tabs.tsx +#: app/configurator/components/configurator.tsx msgid "button.save-draft.saved" msgstr "Brouillon enregistré dans [Mes visualisations](/profile)" @@ -136,17 +135,17 @@ msgstr "Brouillon enregistré dans [Mes visualisations](/profile)" msgid "button.share" msgstr "Partager" -#: app/components/chart-selection-tabs.tsx +#: app/configurator/components/configurator.tsx msgid "button.update" msgstr "Actualiser cette visualisation" -#: app/components/chart-selection-tabs.tsx +#: app/configurator/components/configurator.tsx msgid "button.update.warning" msgstr "Gardez à l'esprit que la mise à jour de cette visualisation affectera tous les endroits où elle est déjà intégrée !" #: app/components/chart-shared.tsx msgid "chart-controls.chart-view" -msgstr "Vue graphique" +msgstr "Vue en graphique" #: app/components/chart-shared.tsx msgid "chart-controls.copy-and-edit" @@ -179,7 +178,11 @@ msgstr "Requête SPARQL" #: app/components/chart-shared.tsx msgid "chart-controls.table-view" -msgstr "Vue du tableau" +msgstr "Vue en tableau" + +#: app/components/chart-selection-tabs.tsx +msgid "chart-selection-tabs.add-chart" +msgstr "" #: app/components/chart-selection-tabs.tsx msgid "chart-selection-tabs.add-chart-different-dataset.button" @@ -829,7 +832,7 @@ msgstr "Afficher l'erreur type" #: app/configurator/components/chart-options-selector.tsx msgid "controls.section.show-standard-error.explanation" -msgstr "Montrer les incertitudes qui s'étendent à partir des points de données pour représenter les erreurs standard" +msgstr "Montrer les incertitudes via des barres d'erreur" #: app/configurator/components/chart-options-selector.tsx msgid "controls.section.sorting" diff --git a/app/locales/it/messages.po b/app/locales/it/messages.po index 8d9b6d8d1..711d7b1cb 100644 --- a/app/locales/it/messages.po +++ b/app/locales/it/messages.po @@ -30,7 +30,6 @@ msgstr "Nessun risultato" msgid "annotation.add.description" msgstr "[ Nessuna descrizione ]" -#: app/components/rename-dialog.tsx #: app/configurator/components/annotators.tsx #: app/login/components/profile-tables.tsx msgid "annotation.add.title" @@ -107,7 +106,7 @@ msgstr "Clicca per copiare" msgid "button.hint.copied" msgstr "Copiato!" -#: app/components/chart-selection-tabs.tsx +#: app/configurator/components/configurator.tsx msgid "button.layout" msgstr "Procedi alle opzioni di layout" @@ -115,19 +114,19 @@ msgstr "Procedi alle opzioni di layout" msgid "button.new.visualization" msgstr "Crea una nuova visualizzazione" -#: app/components/chart-selection-tabs.tsx +#: app/configurator/components/configurator.tsx msgid "button.publish" msgstr "Pubblicare" -#: app/components/chart-selection-tabs.tsx +#: app/configurator/components/configurator.tsx msgid "button.save-draft" msgstr "Salva la bozza" -#: app/components/chart-selection-tabs.tsx +#: app/configurator/components/configurator.tsx msgid "button.save-draft.error" msgstr "Impossibile salvare la bozza" -#: app/components/chart-selection-tabs.tsx +#: app/configurator/components/configurator.tsx msgid "button.save-draft.saved" msgstr "Bozza salvata nelle [visualizzazioni](/profile)" @@ -136,11 +135,11 @@ msgstr "Bozza salvata nelle [visualizzazioni](/profile)" msgid "button.share" msgstr "Condividi" -#: app/components/chart-selection-tabs.tsx +#: app/configurator/components/configurator.tsx msgid "button.update" msgstr "Aggiornare questa visualizzazione" -#: app/components/chart-selection-tabs.tsx +#: app/configurator/components/configurator.tsx msgid "button.update.warning" msgstr "Tenete presente che l'aggiornamento di questa visualizzazione avrà effetto su tutti i luoghi in cui potrebbe essere già incorporata!" @@ -181,6 +180,10 @@ msgstr "SPARQL query" msgid "chart-controls.table-view" msgstr "Visualizzazione tabella" +#: app/components/chart-selection-tabs.tsx +msgid "chart-selection-tabs.add-chart" +msgstr "" + #: app/components/chart-selection-tabs.tsx msgid "chart-selection-tabs.add-chart-different-dataset.button" msgstr "Seleziona il set di dati" @@ -1402,7 +1405,7 @@ msgstr "Le mie bozze" #: app/login/components/profile-content-tabs.tsx #: app/login/components/profile-content-tabs.tsx msgid "login.profile.my-published-visualizations" -msgstr "" +msgstr "Le mie visualizzazioni" #: app/login/components/profile-tables.tsx msgid "login.profile.my-visualizations.chart-actions" diff --git a/package.json b/package.json index 25ab45208..a7e80af58 100644 --- a/package.json +++ b/package.json @@ -25,8 +25,8 @@ "lint": "eslint app -c .eslintrc.json", "locales:extract": "NODE_ENV=development lingui extract --clean; ./scripts/strip-locale-line-numbers.sh", "locales:compile": "lingui compile --verbose", - "locales:push": "accent sync --add-translations", - "locales:pull": "accent export; yarn locales:extract # putting back file location comments", + "locales:push": "dotenv -- accent sync --add-translations", + "locales:pull": "dotenv -- accent export; yarn locales:extract # putting back file location comments", "locales:browse": "open 'https://accent.interactivethings.io/app/projects/584e1dfa-ff1f-4b26-8cac-07004c465134'", "graphql:codegen": "graphql-codegen --config codegen.yml", "graphql:codegen:dev": "graphql-codegen --config codegen.yml --watch",