From 59458d832497c003c8b02fc01d9bfb2287b7da3b Mon Sep 17 00:00:00 2001 From: Nicolas Kempf Le Stanc Date: Fri, 11 Apr 2025 17:13:35 +0200 Subject: [PATCH 01/11] feat: add reuse search page --- components/Organization/ListPage.vue | 6 +- components/Reuses/ListPage.vue | 173 ++++++++++++++++++++ datagouv-components/src/functions/reuses.ts | 15 +- i18n/locales/en-US.json | 8 +- i18n/locales/es-ES.json | 8 +- i18n/locales/fr-FR.json | 6 +- pages/reuses/index.vue | 79 +++++++++ 7 files changed, 277 insertions(+), 18 deletions(-) create mode 100644 components/Reuses/ListPage.vue create mode 100644 pages/reuses/index.vue diff --git a/components/Organization/ListPage.vue b/components/Organization/ListPage.vue index 94057319..16ccc225 100644 --- a/components/Organization/ListPage.vue +++ b/components/Organization/ListPage.vue @@ -127,11 +127,7 @@ const qDebounced = debouncedRef(q, config.public.searchAutocompleteDebounce) const sort = ref(props.sort ?? '') const sortParam = computed(() => sort.value ? sort.value : undefined) -watch([sort, qDebounced], async ([_newSort, newQ], [_oldSort, oldQ]) => { - if (newQ !== oldQ) { - sort.value = '' - } - +watch([sort, qDebounced], async ([_newSort, newQ]) => { emit('change', newQ, sortParam.value, 1) document.children[0].scrollIntoView({ behavior: 'smooth', block: 'start' }) diff --git a/components/Reuses/ListPage.vue b/components/Reuses/ListPage.vue new file mode 100644 index 00000000..54e552bf --- /dev/null +++ b/components/Reuses/ListPage.vue @@ -0,0 +1,173 @@ + + + diff --git a/datagouv-components/src/functions/reuses.ts b/datagouv-components/src/functions/reuses.ts index 3f04ce1a..59dace99 100644 --- a/datagouv-components/src/functions/reuses.ts +++ b/datagouv-components/src/functions/reuses.ts @@ -2,17 +2,16 @@ import { ofetch } from 'ofetch' import { useComponentsConfig } from '../config' import type { ReuseType } from '../types/reuses' -let reuseTypesRequest: Array | null = null +let reuseTypesRequest: Promise> | null = null export async function fetchReuseTypes() { - if (reuseTypesRequest) { - return reuseTypesRequest + if (!reuseTypesRequest) { + const config = useComponentsConfig() + reuseTypesRequest = ofetch>('api/1/reuses/types/', { + baseURL: config.apiBase, + }) } - const config = useComponentsConfig() - reuseTypesRequest = await ofetch>('api/1/reuses/types/', { - baseURL: config.apiBase, - }) - return reuseTypesRequest + return await reuseTypesRequest } export function getType(types: Array, id: string): string { diff --git a/i18n/locales/en-US.json b/i18n/locales/en-US.json index 1174ac99..7a51d7ad 100644 --- a/i18n/locales/en-US.json +++ b/i18n/locales/en-US.json @@ -1034,5 +1034,9 @@ "Cancel reorder": "Cancel reorder", "Move up": "Move up", "Move down": "Move down", - "See public page": "See public page" -} + "See public page": "See public page", + "Cannot reorder dataset\\'s files when there is more than {max} files": "Cannot reorder dataset\\'s files when there is more than {max} files", + "Search among {count} reuses on {site}": "Search among {count} reuses on {site}", + "All": "All", + "Support": "Support" +} \ No newline at end of file diff --git a/i18n/locales/es-ES.json b/i18n/locales/es-ES.json index 7498cef1..bef97342 100644 --- a/i18n/locales/es-ES.json +++ b/i18n/locales/es-ES.json @@ -1033,5 +1033,9 @@ "Cancel reorder": "Cancel reorder", "Move up": "Move up", "Move down": "Move down", - "See public page": "See public page" -} + "See public page": "See public page", + "Cannot reorder dataset\\'s files when there is more than {max} files": "Cannot reorder dataset\\'s files when there is more than {max} files", + "Search among {count} reuses on {site}": "Search among {count} reuses on {site}", + "All": "All", + "Support": "Support" +} \ No newline at end of file diff --git a/i18n/locales/fr-FR.json b/i18n/locales/fr-FR.json index 1238d4ce..ce2d8300 100644 --- a/i18n/locales/fr-FR.json +++ b/i18n/locales/fr-FR.json @@ -1042,5 +1042,9 @@ "Cancel reorder": "Annuler le changement d'ordre", "Move up": "Déplacer vers le haut", "Move down": "Déplacer vers le bas", - "See public page": "Voir la page publique" + "See public page": "Voir la page publique", + "Cannot reorder dataset\\'s files when there is more than {max} files": "Cannot reorder dataset\\'s files when there is more than {max} files", + "Search among {count} reuses on {site}": "Rechercher parmi les {count} réutilisations sur {site}", + "All": "Tout", + "Support": "Support" } diff --git a/pages/reuses/index.vue b/pages/reuses/index.vue new file mode 100644 index 00000000..25ff4cd2 --- /dev/null +++ b/pages/reuses/index.vue @@ -0,0 +1,79 @@ + + + From f6aaa26163fdccc54ac793dc1135c8fc9ade0566 Mon Sep 17 00:00:00 2001 From: Nicolas Kempf Le Stanc Date: Tue, 22 Apr 2025 15:33:11 +0200 Subject: [PATCH 02/11] feat: wip --- components/BrandedButton/EditButton.vue | 3 +- .../src/components/OwnerTypeIcon.vue | 2 +- .../src/components/ReuseCard.vue | 40 +----- .../src/components/ReuseDetails.vue | 45 ++++++ i18n/locales/en-US.json | 5 +- i18n/locales/es-ES.json | 5 +- i18n/locales/fr-FR.json | 3 +- pages/reuses/[rid].vue | 128 ++++++++++++++++++ pages/reuses/[rid]/index.vue | 25 ++++ 9 files changed, 215 insertions(+), 41 deletions(-) create mode 100644 datagouv-components/src/components/ReuseDetails.vue create mode 100644 pages/reuses/[rid].vue create mode 100644 pages/reuses/[rid]/index.vue diff --git a/components/BrandedButton/EditButton.vue b/components/BrandedButton/EditButton.vue index de8f6d1c..768ee22e 100644 --- a/components/BrandedButton/EditButton.vue +++ b/components/BrandedButton/EditButton.vue @@ -14,7 +14,7 @@ import { BrandedButton } from '@datagouv/components-next' import { RiEdit2Line } from '@remixicon/vue' const props = defineProps<{ - type: 'organizations' | 'posts' + type: 'organizations' | 'posts' | 'reuses' id: string }>() @@ -26,6 +26,7 @@ const link = computed(() => { case 'organizations': return `${base}profile` case 'posts': + case 'reuses': return base default: return throwOnNever(props.type as never, t('No other type defined')) diff --git a/datagouv-components/src/components/OwnerTypeIcon.vue b/datagouv-components/src/components/OwnerTypeIcon.vue index 35583e32..51aad7e3 100644 --- a/datagouv-components/src/components/OwnerTypeIcon.vue +++ b/datagouv-components/src/components/OwnerTypeIcon.vue @@ -2,7 +2,7 @@ diff --git a/datagouv-components/src/components/ReuseCard.vue b/datagouv-components/src/components/ReuseCard.vue index 5c6633ef..4bd1001e 100644 --- a/datagouv-components/src/components/ReuseCard.vue +++ b/datagouv-components/src/components/ReuseCard.vue @@ -14,7 +14,7 @@

{{ ownerName }} - - {{ t('published {date}', { date: formatRelativeIfRecentDate(reuse.created_at, { dateStyle: 'medium' }) }) }} + + {{ t('published {date}', { date: formatRelativeIfRecentDate(reuse.created_at, { dateStyle: 'medium' }) }) }}

-
-

- {{ reuseType }} -

-
+ @@ -99,17 +73,16 @@ diff --git a/datagouv-components/src/components/ReuseDetails.vue b/datagouv-components/src/components/ReuseDetails.vue new file mode 100644 index 00000000..4c60795f --- /dev/null +++ b/datagouv-components/src/components/ReuseDetails.vue @@ -0,0 +1,45 @@ + + + diff --git a/i18n/locales/en-US.json b/i18n/locales/en-US.json index 7a51d7ad..7ec1502a 100644 --- a/i18n/locales/en-US.json +++ b/i18n/locales/en-US.json @@ -1038,5 +1038,6 @@ "Cannot reorder dataset\\'s files when there is more than {max} files": "Cannot reorder dataset\\'s files when there is more than {max} files", "Search among {count} reuses on {site}": "Search among {count} reuses on {site}", "All": "All", - "Support": "Support" -} \ No newline at end of file + "Support": "Support", + "{n}%": "{n}%" +} diff --git a/i18n/locales/es-ES.json b/i18n/locales/es-ES.json index bef97342..ba3dffb4 100644 --- a/i18n/locales/es-ES.json +++ b/i18n/locales/es-ES.json @@ -1037,5 +1037,6 @@ "Cannot reorder dataset\\'s files when there is more than {max} files": "Cannot reorder dataset\\'s files when there is more than {max} files", "Search among {count} reuses on {site}": "Search among {count} reuses on {site}", "All": "All", - "Support": "Support" -} \ No newline at end of file + "Support": "Support", + "{n}%": "{n}%" +} diff --git a/i18n/locales/fr-FR.json b/i18n/locales/fr-FR.json index ce2d8300..7ba1f683 100644 --- a/i18n/locales/fr-FR.json +++ b/i18n/locales/fr-FR.json @@ -1046,5 +1046,6 @@ "Cannot reorder dataset\\'s files when there is more than {max} files": "Cannot reorder dataset\\'s files when there is more than {max} files", "Search among {count} reuses on {site}": "Rechercher parmi les {count} réutilisations sur {site}", "All": "Tout", - "Support": "Support" + "Support": "Support", + "{n}%": "{n}%" } diff --git a/pages/reuses/[rid].vue b/pages/reuses/[rid].vue new file mode 100644 index 00000000..0fadba38 --- /dev/null +++ b/pages/reuses/[rid].vue @@ -0,0 +1,128 @@ + + + + diff --git a/pages/reuses/[rid]/index.vue b/pages/reuses/[rid]/index.vue new file mode 100644 index 00000000..38368b04 --- /dev/null +++ b/pages/reuses/[rid]/index.vue @@ -0,0 +1,25 @@ + + + From 6d053ecae207a6e4b4d6c9325c19b81416bf76dd Mon Sep 17 00:00:00 2001 From: Nicolas Kempf Le Stanc Date: Thu, 24 Apr 2025 10:38:51 +0200 Subject: [PATCH 03/11] feat: wip --- components/Datasets/DatasetsMetrics.vue | 2 +- datagouv-components/assets/main.css | 32 +++ .../src/components/DatasetCard.vue | 10 +- .../OrganizationNameWithCertificate.vue | 2 +- .../src/components/ReuseDetails.vue | 2 +- .../src/components/StatBox.vue | 40 ++-- .../src/composables/useReuseType.ts | 2 +- datagouv-components/src/functions/reuses.ts | 5 + datagouv-components/src/main.ts | 2 + i18n/locales/en-US.json | 5 +- i18n/locales/es-ES.json | 5 +- i18n/locales/fr-FR.json | 5 +- pages/reuses/[rid].vue | 2 +- pages/reuses/[rid]/index.vue | 211 ++++++++++++++++-- pages/reuses/index.vue | 4 +- utils/reuses.ts | 36 +++ 16 files changed, 316 insertions(+), 49 deletions(-) diff --git a/components/Datasets/DatasetsMetrics.vue b/components/Datasets/DatasetsMetrics.vue index 8fc73f3a..05b6d727 100644 --- a/components/Datasets/DatasetsMetrics.vue +++ b/components/Datasets/DatasetsMetrics.vue @@ -82,7 +82,7 @@ diff --git a/pages/reuses/index.vue b/pages/reuses/index.vue index 25ff4cd2..9b2790de 100644 --- a/pages/reuses/index.vue +++ b/pages/reuses/index.vue @@ -15,7 +15,7 @@ v-if="reuses" :link="getLink" :reuses - :q + :q="(q as string)" :sort :status :topic @@ -66,7 +66,7 @@ const { data: topics } = await useAPI>('/api/1/reuses/topics/' const { data: reuses, status } = await useAPI>(`/api/2/reuses/search/`, { headers: { - 'X-Fields': 'data{archived,deleted,featured,id,owner,organization,metrics,created_at,last_modified,title,slug,page,description,type,url,image,image_thumbnail},page,page_size,total', + 'X-Fields': reusesXFields, }, params: { q, diff --git a/utils/reuses.ts b/utils/reuses.ts index aff16dea..2742efd8 100644 --- a/utils/reuses.ts +++ b/utils/reuses.ts @@ -1,6 +1,8 @@ import type { Dataset, DatasetV2, Reuse, ReuseType } from '@datagouv/components-next' import type { DatasetSuggest, NewReuseForApi, ReuseForm, ReuseTopic } from '~/types/types' +export const reusesXFields = 'data{archived,deleted,featured,id,owner,organization,metrics,created_at,last_modified,title,slug,page,description,type,url,image,image_thumbnail},page,page_size,total' + export function getReuseAdminUrl(reuse: Reuse): string { return `/beta/admin/reuses/${reuse.id}` } @@ -33,3 +35,37 @@ export function toApi(form: ReuseForm, overrides: { datasets?: Array t.text), } } + +export async function getReuseMetrics(rid: string) { + // Fetching last 12 months + const response = await fetch(`https://metric-api.data.gouv.fr/api/reuses/data/?reuse_id__exact=${rid}&metric_month__sort=desc&page_size=12`) + const page = await response.json() + + const reuseViews: Record = {} + + for (const { metric_month, monthly_visit } of page.data) { + reuseViews[metric_month] = monthly_visit + } + // Fetching totals + const totalResponse = await fetch(`https://metric-api.data.gouv.fr/api/reuses_total/data/?reuse_id__exact=${rid}`) + const totalPage = await totalResponse.json() + + let reuseViewsTotal = 0 + if (page.data[0]) { + reuseViewsTotal = totalPage.data[0].visit + } + return { + reuseViews, + reuseViewsTotal, + } +} + +export function createReuseMetricsUrl(reuseViews: Record) { + let data = 'month,visit\n' + + for (const month in reuseViews) { + data += `${month},${reuseViews[month]}\n` + } + + return URL.createObjectURL(new Blob([data], { type: 'text/csv' })) +} From f1a8870adc738b0d5dc41732c828a9b3f1496479 Mon Sep 17 00:00:00 2001 From: Nicolas Kempf Le Stanc Date: Thu, 24 Apr 2025 14:04:40 +0200 Subject: [PATCH 04/11] fix: type --- datagouv-components/src/functions/reuses.ts | 5 ++--- pages/reuses/[rid]/index.vue | 10 ++++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/datagouv-components/src/functions/reuses.ts b/datagouv-components/src/functions/reuses.ts index ec366611..c37b2058 100644 --- a/datagouv-components/src/functions/reuses.ts +++ b/datagouv-components/src/functions/reuses.ts @@ -1,5 +1,4 @@ import { ofetch } from 'ofetch' -import { useI18n } from 'vue-i18n' import { useComponentsConfig } from '../config' import type { ReuseType } from '../types/reuses' @@ -8,11 +7,10 @@ let reuseTypesRequest: Promise> | null = null export async function fetchReuseTypes() { if (!reuseTypesRequest) { const config = useComponentsConfig() - const { locale } = useI18n() reuseTypesRequest = ofetch>('api/1/reuses/types/', { baseURL: config.apiBase, params: { - lang: locale, + lang: config.i18n?.global.locale, }, }) } @@ -20,6 +18,7 @@ export async function fetchReuseTypes() { } export function getType(types: Array, id: string): string { + console.log(types, id) const type = types.find(t => t.id === id) return type ? type.label : '' } diff --git a/pages/reuses/[rid]/index.vue b/pages/reuses/[rid]/index.vue index 5685418f..6416a9a0 100644 --- a/pages/reuses/[rid]/index.vue +++ b/pages/reuses/[rid]/index.vue @@ -25,7 +25,7 @@ {{ $t('Type') }}
- {{ type.label }} + {{ label }}
@@ -40,6 +40,12 @@ > {{ tag }} + + {{ $t('No tags set') }} +
@@ -161,7 +167,7 @@ const props = defineProps<{ const route = useRoute() const page = ref(parseInt(route.query.page as LocationQueryValue ?? '1', 10)) -const type = useReuseType(props.reuse.type) +const { label } = useReuseType(props.reuse.type) const { data: relatedReuses, status } = await useAPI>(`/api/2/reuses/search/`, { headers: { From f6b314e059450d7131ec8f9df3f0f6e78453322e Mon Sep 17 00:00:00 2001 From: Nicolas Kempf Le Stanc Date: Thu, 24 Apr 2025 16:11:36 +0200 Subject: [PATCH 05/11] feat: follow button wip --- components/FollowButton.vue | 59 ++++++++++++++++ datagouv-components/src/functions/reuses.ts | 14 ++-- datagouv-components/src/main.ts | 3 +- datagouv-components/src/types/reuses.ts | 77 +++++++++++---------- i18n/locales/en-US.json | 4 +- i18n/locales/es-ES.json | 4 +- i18n/locales/fr-FR.json | 4 +- pages/reuses/[rid].vue | 11 ++- pages/reuses/[rid]/discussions.vue | 6 ++ pages/reuses/[rid]/index.vue | 46 ++++-------- types/types.d.ts | 5 -- 11 files changed, 151 insertions(+), 82 deletions(-) create mode 100644 components/FollowButton.vue create mode 100644 pages/reuses/[rid]/discussions.vue diff --git a/components/FollowButton.vue b/components/FollowButton.vue new file mode 100644 index 00000000..2640a0e9 --- /dev/null +++ b/components/FollowButton.vue @@ -0,0 +1,59 @@ + + + diff --git a/datagouv-components/src/functions/reuses.ts b/datagouv-components/src/functions/reuses.ts index c37b2058..22481acd 100644 --- a/datagouv-components/src/functions/reuses.ts +++ b/datagouv-components/src/functions/reuses.ts @@ -1,24 +1,28 @@ import { ofetch } from 'ofetch' +import { useI18n } from 'vue-i18n' import { useComponentsConfig } from '../config' -import type { ReuseType } from '../types/reuses' +import type { ReuseTopic, ReuseType } from '../types/reuses' let reuseTypesRequest: Promise> | null = null export async function fetchReuseTypes() { if (!reuseTypesRequest) { const config = useComponentsConfig() + const { locale } = useI18n() reuseTypesRequest = ofetch>('api/1/reuses/types/', { baseURL: config.apiBase, - params: { - lang: config.i18n?.global.locale, - }, + query: { lang: locale.value }, }) } return await reuseTypesRequest } export function getType(types: Array, id: string): string { - console.log(types, id) const type = types.find(t => t.id === id) return type ? type.label : '' } + +export function getTopic(topics: Array, id: string): string { + const topic = topics.find(t => t.id === id) + return topic ? topic.label : '' +} diff --git a/datagouv-components/src/main.ts b/datagouv-components/src/main.ts index 0af80a64..f5b85448 100644 --- a/datagouv-components/src/main.ts +++ b/datagouv-components/src/main.ts @@ -8,7 +8,7 @@ import type { Harvest } from './types/harvest' import type { License } from './types/licenses' import type { Member, MemberRole, NewOrganization, Organization } from './types/organizations' import type { Owned, OwnedWithId } from './types/owned' -import type { NewReuse, Reuse, ReuseType } from './types/reuses' +import type { NewReuse, Reuse, ReuseTopic, ReuseType } from './types/reuses' import type { TopicV2 } from './types/topics' import type { CommunityResource, FileResourceFileType, RemoteResourceFileType, ResourceFileType, ResourceType, Resource } from './types/resources' import type { Weight, WellType } from './types/ui' @@ -86,6 +86,7 @@ export type { ResourceFileType, ResourceType, Reuse, + ReuseTopic, ReuseType, TopicV2, User, diff --git a/datagouv-components/src/types/reuses.ts b/datagouv-components/src/types/reuses.ts index 41bac645..86398e13 100644 --- a/datagouv-components/src/types/reuses.ts +++ b/datagouv-components/src/types/reuses.ts @@ -1,44 +1,49 @@ -import type { Owned, OwnedWithId } from "./owned"; -import type { Dataset } from "./datasets"; -import { Badges } from "./badges"; +import type { Owned, OwnedWithId } from './owned' +import type { Dataset } from './datasets' +import type { Badges } from './badges' export type BaseReuse = Owned & { - title: string; - description: string; - tags: Array | null; - datasets: Array; - topic: string; - type: string; - url: string; - private: boolean; -}; + title: string + description: string + tags: Array | null + datasets: Array + topic: string + type: string + url: string + private: boolean +} -export type NewReuse = Omit & OwnedWithId; +export type NewReuse = Omit & OwnedWithId export type Reuse = BaseReuse & { - badges: Badges; - created_at: string; - datasets: Array; - archived: string | null; - deleted: string | null; - extras: Record; - featured: boolean; - id: string; - image: string | null; - image_thumbnail: string | null; - last_modified: string; + badges: Badges + created_at: string + datasets: Array + archived: string | null + deleted: string | null + extras: Record + featured: boolean + id: string + image: string | null + image_thumbnail: string | null + last_modified: string metrics: { - datasets: number; - discussions: number; - followers: number; - views: number; - }; - slug: string; - page: string; - uri: string; -}; + datasets: number + discussions: number + followers: number + views: number + } + slug: string + page: string + uri: string +} export type ReuseType = { - id: string, - label: string, -}; + id: string + label: string +} + +export type ReuseTopic = { + id: string + label: string +} diff --git a/i18n/locales/en-US.json b/i18n/locales/en-US.json index bae7fbc8..74de5120 100644 --- a/i18n/locales/en-US.json +++ b/i18n/locales/en-US.json @@ -1042,5 +1042,7 @@ "{n}%": "{n}%", "{n} associated datasets": "no associated datasets | {n} associated dataset | {n} associated datasets", "{n} reuses from the same creator": "{n} reuses from the same creator | {n} reuse from the same creator | {n} reuses from the same creator", - "Download the statistics as CSV": "Download the statistics as CSV" + "Download the statistics as CSV": "Download the statistics as CSV", + "Topic": "Topic", + "No tags set": "No tags set" } diff --git a/i18n/locales/es-ES.json b/i18n/locales/es-ES.json index ef447aa8..6e789264 100644 --- a/i18n/locales/es-ES.json +++ b/i18n/locales/es-ES.json @@ -1041,5 +1041,7 @@ "{n}%": "{n}%", "{n} associated datasets": "no associated datasets | {n} associated dataset | {n} associated datasets", "{n} reuses from the same creator": "{n} reuses from the same creator | {n} reuse from the same creator | {n} reuses from the same creator", - "Download the statistics as CSV": "Download the statistics as CSV" + "Download the statistics as CSV": "Download the statistics as CSV", + "Topic": "Topic", + "No tags set": "No tags set" } diff --git a/i18n/locales/fr-FR.json b/i18n/locales/fr-FR.json index d16d4cac..db72ee5a 100644 --- a/i18n/locales/fr-FR.json +++ b/i18n/locales/fr-FR.json @@ -1072,5 +1072,7 @@ "{n}%": "{n}%", "{n} associated datasets": "aucun jeu de données associé | {n} jeu de données associé | {n} jeux de données associés", "{n} reuses from the same creator": "{n} réutilisations du même créateur | {n} réutilisation du même créateur | {n} réutilisations du même créateur", - "Download the statistics as CSV": "Télécharger les statistiques au format CSV" + "Download the statistics as CSV": "Télécharger les statistiques au format CSV", + "Topic": "Thématique", + "No tags set": "Aucun mot clé" } diff --git a/pages/reuses/[rid].vue b/pages/reuses/[rid].vue index 265717b3..3b34f69e 100644 --- a/pages/reuses/[rid].vue +++ b/pages/reuses/[rid].vue @@ -20,8 +20,17 @@ {{ reuse.title }} -
+
+ + + {{ $t('See the reuse') }} + diff --git a/pages/reuses/[rid]/discussions.vue b/pages/reuses/[rid]/discussions.vue new file mode 100644 index 00000000..6b28f7cf --- /dev/null +++ b/pages/reuses/[rid]/discussions.vue @@ -0,0 +1,6 @@ + + + diff --git a/pages/reuses/[rid]/index.vue b/pages/reuses/[rid]/index.vue index 6416a9a0..9be3f8c7 100644 --- a/pages/reuses/[rid]/index.vue +++ b/pages/reuses/[rid]/index.vue @@ -17,7 +17,7 @@ {{ $t('Topic') }}
- {{ reuse.topic }} + {{ topic }}
@@ -130,57 +130,52 @@ class="min-h-32" >

- {{ $t('{n} reuses from the same creator', { n: relatedReuses.total }) }} + {{ $t('{n} reuses from the same creator', { n: relatedReuses.length }) }}

-
diff --git a/types/types.d.ts b/types/types.d.ts index ea840366..e500c4ac 100644 --- a/types/types.d.ts +++ b/types/types.d.ts @@ -183,11 +183,6 @@ export type NewReuseForApi = { tags: Array } -export type ReuseTopic = { - id: string - label: string -} - export type DataserviceForm = { owned: Owned | null title: string From f23d4f25365e0c7dc2f53b773a94c9442b8ea82e Mon Sep 17 00:00:00 2001 From: Nicolas Kempf Le Stanc Date: Fri, 25 Apr 2025 09:32:26 +0200 Subject: [PATCH 06/11] fix: i18n and api path --- i18n/locales/fr-FR.json | 1 - pages/reuses/[rid].vue | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/i18n/locales/fr-FR.json b/i18n/locales/fr-FR.json index 04081e78..52524d39 100644 --- a/i18n/locales/fr-FR.json +++ b/i18n/locales/fr-FR.json @@ -1069,7 +1069,6 @@ "Support": "Support", "Search among {count} reuses on {site}": "Rechercher parmi les {count} réutilisations sur {site}", "All": "Tout", - "Support": "Support", "{n}%": "{n}%", "{n} associated datasets": "aucun jeu de données associé | {n} jeu de données associé | {n} jeux de données associés", "{n} reuses from the same creator": "{n} réutilisations du même créateur | {n} réutilisation du même créateur | {n} réutilisations du même créateur", diff --git a/pages/reuses/[rid].vue b/pages/reuses/[rid].vue index 3b34f69e..3861aa89 100644 --- a/pages/reuses/[rid].vue +++ b/pages/reuses/[rid].vue @@ -21,7 +21,7 @@
- + Date: Fri, 25 Apr 2025 11:51:58 +0200 Subject: [PATCH 07/11] feat: add discussions --- components/Breadcrumb/Breadcrumb.vue | 2 +- components/Divider.vue | 13 ++++++++++++- pages/reuses/[rid].vue | 16 +++++++++++----- pages/reuses/[rid]/discussions.vue | 10 +++++++++- 4 files changed, 33 insertions(+), 8 deletions(-) diff --git a/components/Breadcrumb/Breadcrumb.vue b/components/Breadcrumb/Breadcrumb.vue index d18ccb63..994f9797 100644 --- a/components/Breadcrumb/Breadcrumb.vue +++ b/components/Breadcrumb/Breadcrumb.vue @@ -2,7 +2,7 @@