Skip to content
Draft
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
5 changes: 5 additions & 0 deletions api/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ export type Dataset = {
end?: string
}
frequency?: string
conformsTo?: {
title?: string
version?: string
url?: string
}
customMetadata?: Record<string, string>

attachments?: {
Expand Down
34 changes: 32 additions & 2 deletions portal/app/components/dataset/dataset-metadata.vue
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,34 @@
{{ t('frequencyLabels.' + dataset.frequency) }}
</v-col>

<v-col
v-if="dataset.conformsTo && (dataset.conformsTo.title || dataset.conformsTo.url || dataset.conformsTo.version)"
v-bind="metadataColProps"
>
<div class="text-body-small text-medium-emphasis">{{ metadataLabel('conformsTo') }}</div>
<div class="d-flex align-center ga-2 flex-wrap">
<a
v-if="dataset.conformsTo.url"
:href="dataset.conformsTo.url"
rel="noopener"
target="_blank"
:title="(dataset.conformsTo.title || dataset.conformsTo.url) + ' - ' + t('newWindow')"
class="simple-link"
>
{{ dataset.conformsTo.title || dataset.conformsTo.url }}
</a>
<template v-else-if="dataset.conformsTo.title">
{{ dataset.conformsTo.title }}
</template>
<v-chip
v-if="dataset.conformsTo.version"
:text="dataset.conformsTo.version"
:prepend-icon="mdiLabel"
size="small"
/>
</div>
</v-col>

<!-- Modified or dataUpdatedAt -->
<v-col v-bind="metadataColProps">
<div class="text-body-small text-medium-emphasis">{{ metadataLabel('modified') }}</div>
Expand Down Expand Up @@ -254,7 +282,7 @@
<script setup lang="ts">
import type { Dataset } from '#api/types/index.ts'
import type { ActionButtons } from '#api/types/portal-config'
import { mdiCog, mdiMapMarker, mdiTableLarge } from '@mdi/js'
import { mdiCog, mdiLabel, mdiMapMarker, mdiTableLarge } from '@mdi/js'
import OwnerAvatar from '@data-fair/lib-vuetify/owner-avatar.vue'
import formatBytes from '@data-fair/lib-vue/format/bytes.js'

Expand Down Expand Up @@ -285,7 +313,7 @@ const customOwnerLabel = portalConfig.value.labelsOverrides?.owner

const shouldShowActionButton = (button: ActionButtons[number]) => metadataConfig.value.actionButtons?.includes(button)

type BaseMetadataSettings = Partial<Record<'keywords' | 'frequency' | 'temporal' | 'spatial' | 'modified' | 'creator',
type BaseMetadataSettings = Partial<Record<'keywords' | 'frequency' | 'temporal' | 'spatial' | 'modified' | 'creator' | 'conformsTo',
{ active?: boolean; title?: string }
>>

Expand Down Expand Up @@ -320,6 +348,7 @@ const metadataLabel = (key: keyof BaseMetadataSettings) => metadataSettings.data
threeTimesAYear: '3 times a year'
triennial: 'Every 3 years'
weekly: 'Every week'
conformsTo: 'Schema:'
keywords: 'Keywords:'
license: 'License:'
modified: 'Data last modified:'
Expand Down Expand Up @@ -366,6 +395,7 @@ const metadataLabel = (key: keyof BaseMetadataSettings) => metadataSettings.data
threeTimesAYear: '3 fois par an'
triennial: 'Tous les 3 ans'
weekly: 'Chaque semaine'
conformsTo: 'Schéma :'
keywords: 'Mots-clés :'
license: 'Licence :'
modified: 'Dernière mise à jour des données :'
Expand Down
Loading