diff --git a/opendata.swiss/ui/app/app.vue b/opendata.swiss/ui/app/app.vue index 5ebc5fa..bc1cf89 100644 --- a/opendata.swiss/ui/app/app.vue +++ b/opendata.swiss/ui/app/app.vue @@ -35,10 +35,24 @@ import OdsBottomFooter from '@/components/footer/OdsBottomFooter.vue' import OdsFooter from './components/footer/OdsFooter.vue'; import type { OdsNavTabItem } from './components/headers/model/ods-nav-tab-item'; import { APP_NAVIGATION_ITEMS } from './constants/navigation-items'; +import { useI18n } from 'vue-i18n'; +import { useLocale as piveauLocale } from '@piveau/sdk-vue' ; + const navigationItems = ref(APP_NAVIGATION_ITEMS); const isMobileMenuOpen = ref(false); +const { locale } = useI18n(); + +const { setLocale, currentLocale} = piveauLocale(); + +watch(locale, (newLocale) => { + if (newLocale !== (currentLocale as Ref).value) { + setLocale(newLocale) // set the piveau locale + } +}, { immediate: true } +) + useHead({ bodyAttrs: { class: 'body--ods-brand' diff --git a/opendata.swiss/ui/app/components/LanguageSelector.vue b/opendata.swiss/ui/app/components/LanguageSelector.vue index df567e7..51c8795 100644 --- a/opendata.swiss/ui/app/components/LanguageSelector.vue +++ b/opendata.swiss/ui/app/components/LanguageSelector.vue @@ -24,13 +24,10 @@ import Select from './OdsSelect.vue' import { ref, computed } from 'vue' import { useI18n } from 'vue-i18n' -import { useLocale as piveauLocale } from '@piveau/sdk-vue' ; const switchLocalePath = useSwitchLocalePath() const { locale, locales } = useI18n() -const { setLocale, currentLocale } = piveauLocale(); - // Props defineProps({ type: { @@ -48,21 +45,11 @@ const selectedLocale = ref(locale.value) // Handle language switching watch(selectedLocale, (newLocale) => { if (newLocale !== locale.value) { - setLocale(newLocale) // set the piveau locale const newPath = switchLocalePath(newLocale) navigateTo(newPath) } }) -onMounted(() => { - const appLocale = locale.value - const piveauLocale = (currentLocale as Ref).value - if (appLocale !== piveauLocale) { - // this is needed to set the piveau locale on startup - setLocale(appLocale) - } -}) - const { progress } = useLoadingIndicator() diff --git a/opendata.swiss/ui/app/components/OdsRelativeDateToggle.vue b/opendata.swiss/ui/app/components/OdsRelativeDateToggle.vue new file mode 100644 index 0000000..c0f2864 --- /dev/null +++ b/opendata.swiss/ui/app/components/OdsRelativeDateToggle.vue @@ -0,0 +1,48 @@ + + + + + + diff --git a/opendata.swiss/ui/app/components/dataset-detail/OdsDatasetCatalogPanel.vue b/opendata.swiss/ui/app/components/dataset-detail/OdsDatasetCatalogPanel.vue index 5f6c2d3..6ae2b90 100644 --- a/opendata.swiss/ui/app/components/dataset-detail/OdsDatasetCatalogPanel.vue +++ b/opendata.swiss/ui/app/components/dataset-detail/OdsDatasetCatalogPanel.vue @@ -1,121 +1,61 @@ diff --git a/opendata.swiss/ui/app/components/dataset-detail/OdsDistributionListItem.vue b/opendata.swiss/ui/app/components/dataset-detail/OdsDistributionListItem.vue index 3e2a373..acfd561 100644 --- a/opendata.swiss/ui/app/components/dataset-detail/OdsDistributionListItem.vue +++ b/opendata.swiss/ui/app/components/dataset-detail/OdsDistributionListItem.vue @@ -1,30 +1,29 @@ @@ -32,34 +31,18 @@ import SvgIcon from '../SvgIcon.vue'; import OdsButton from '../OdsButton.vue'; import { useI18n } from 'vue-i18n'; +import type { DcatApChV2DistributionAdapter } from './model/dcat-ap-ch-v2-distribution-adapter'; +import OdsRelativeDateToggle from '../OdsRelativeDateToggle.vue'; -const { t } = useI18n(); +const { t } = useI18n(); const props = defineProps({ - item: { - type: Object as PropType, - required: true - }, - datasetId: { - type: String, + distribution: { + type: Object as PropType, required: true } }) -export interface DistributionListItem { - id: string, - title: string, - description: string, - format: string, - modified: string, - created: string, - issued: string, - accessUrls: string[], - downloadUrls: string[], - languages: string[], - byteSize: string -} - @@ -73,4 +56,20 @@ export interface DistributionListItem { text-decoration: none; } +.no-overvlow { + overflow-x: hidden; + flex-grow: 1; +} + +.download-item__title { + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; +} + +.footer { + display: flex; + justify-content: space-between; + align-items: baseline; +} diff --git a/opendata.swiss/ui/app/components/dataset-detail/OdsDownloadsList.vue b/opendata.swiss/ui/app/components/dataset-detail/OdsDownloadsList.vue deleted file mode 100644 index b2e550d..0000000 --- a/opendata.swiss/ui/app/components/dataset-detail/OdsDownloadsList.vue +++ /dev/null @@ -1,28 +0,0 @@ - - - diff --git a/opendata.swiss/ui/app/components/dataset-detail/OdsKeywordTag.vue b/opendata.swiss/ui/app/components/dataset-detail/OdsKeywordTag.vue index 7eecc12..8dac3d3 100644 --- a/opendata.swiss/ui/app/components/dataset-detail/OdsKeywordTag.vue +++ b/opendata.swiss/ui/app/components/dataset-detail/OdsKeywordTag.vue @@ -1,7 +1,7 @@ @@ -9,8 +9,14 @@ import OdsTagItem from "~/components/OdsTagItem.vue"; -const props = defineProps<{ - link: string - label: string -}>() +const props = defineProps({ + link: { + type: String, + required: true + }, + label: { + type: String, + required: true + } +}) diff --git a/opendata.swiss/ui/app/components/dataset-detail/OdsMetadataDownloadList.vue b/opendata.swiss/ui/app/components/dataset-detail/OdsMetadataDownloadList.vue new file mode 100644 index 0000000..af9941c --- /dev/null +++ b/opendata.swiss/ui/app/components/dataset-detail/OdsMetadataDownloadList.vue @@ -0,0 +1,49 @@ + + + + + diff --git a/opendata.swiss/ui/app/components/dataset-detail/OdsTagList.vue b/opendata.swiss/ui/app/components/dataset-detail/OdsTagList.vue index c838e03..53caad8 100644 --- a/opendata.swiss/ui/app/components/dataset-detail/OdsTagList.vue +++ b/opendata.swiss/ui/app/components/dataset-detail/OdsTagList.vue @@ -1,6 +1,6 @@