diff --git a/components/Pages/EditoHeader.vue b/components/Pages/EditoHeader.vue index 81a21f4a..d5bd78b4 100644 --- a/components/Pages/EditoHeader.vue +++ b/components/Pages/EditoHeader.vue @@ -10,6 +10,7 @@ {{ title }} @@ -34,6 +35,7 @@
import { RiInformation2Line, RiSearchLine } from '@remixicon/vue' -const props = defineProps<{ +const props = withDefaults(defineProps<{ color: 'primary' | 'green' | 'purple' title: string subtitle: string placeholder: string searchUrl: string - linkLabel: string - linkUrl: string -}>() + linkLabel?: string + linkUrl?: string + defaultQuery?: string +}>(), { + linkLabel: '', + linkUrl: '', + defaultQuery: '', +}) const id = useId() diff --git a/datagouv-components/src/components/DataserviceCard.vue b/datagouv-components/src/components/DataserviceCard.vue index d7e5948e..fba6cc2b 100644 --- a/datagouv-components/src/components/DataserviceCard.vue +++ b/datagouv-components/src/components/DataserviceCard.vue @@ -1,10 +1,10 @@ @@ -139,6 +175,15 @@ import type { Dataservice } from '../types/dataservices' import { useTranslation } from '../composables/useTranslation' import OrganizationNameWithCertificate from './OrganizationNameWithCertificate.vue' import AppLink from './AppLink.vue' +import OrganizationLogo from './OrganizationLogo.vue' +import Avatar from './Avatar.vue' +import Placeholder from './Placeholder.vue' + +type TagIntoBadge = { + name: string + value: string + color: string +} type Props = { dataservice: Dataservice @@ -155,6 +200,7 @@ type Props = { */ organizationUrl?: RouteLocationRaw showDescription?: boolean + tagIntoBadge?: TagIntoBadge[] } const props = withDefaults(defineProps(), { @@ -178,6 +224,12 @@ const description = ref('') watchEffect(async () => { description.value = await removeMarkdown(props.dataservice.description) }) + +const matchingBadges = computed(() => { + if (!props.tagIntoBadge || !props.dataservice.tags) return [] + const dataserviceTags = new Set(props.dataservice.tags) + return props.tagIntoBadge.filter(badge => dataserviceTags.has(badge.value)) +}) diff --git a/datagouv-components/src/components/ReuseCard.vue b/datagouv-components/src/components/ReuseCard.vue index 913bfe44..fa79f6a5 100644 --- a/datagouv-components/src/components/ReuseCard.vue +++ b/datagouv-components/src/components/ReuseCard.vue @@ -1,5 +1,127 @@