From 3ccb0dccb3e12f56879033f869428f5db61fd5e7 Mon Sep 17 00:00:00 2001 From: BatLeDev Date: Wed, 16 Sep 2026 09:39:10 +0200 Subject: [PATCH 1/2] refactor(ui): use the lib composable to label a deleted department --- package.json | 4 +++- ui/src/components/catalog/catalog-card.vue | 3 +-- ui/src/composables/use-display-owner.ts | 27 ---------------------- 3 files changed, 4 insertions(+), 30 deletions(-) delete mode 100644 ui/src/composables/use-display-owner.ts diff --git a/package.json b/package.json index 6943622..91cdc84 100644 --- a/package.json +++ b/package.json @@ -64,6 +64,8 @@ "typescript": "^5.8.3" }, "relativeDependencies": { - "@data-fair/types-catalogs": "./types-catalogs" + "@data-fair/types-catalogs": "./types-catalogs", + "@data-fair/lib-vue": "../lib/packages/vue", + "@data-fair/lib-vuetify": "../lib/packages/vuetify" } } diff --git a/ui/src/components/catalog/catalog-card.vue b/ui/src/components/catalog/catalog-card.vue index 2f19689..7c82102 100644 --- a/ui/src/components/catalog/catalog-card.vue +++ b/ui/src/components/catalog/catalog-card.vue @@ -30,7 +30,7 @@ @@ -101,7 +101,6 @@ import ownerAvatar from '@data-fair/lib-vuetify/owner-avatar.vue' import { mdiPowerPlug } from '@mdi/js' const { t } = useI18n() -const { displayOwner } = useDisplayOwner() const { catalog, showOwner, plugin } = defineProps<{ catalog: CatalogsGetRes['results'][number] /** Registry artefact of this catalog's plugin — absent if it was removed from the registry. */ diff --git a/ui/src/composables/use-display-owner.ts b/ui/src/composables/use-display-owner.ts deleted file mode 100644 index f6f420b..0000000 --- a/ui/src/composables/use-display-owner.ts +++ /dev/null @@ -1,27 +0,0 @@ -// A department deleted in simple-directory keeps its id on the resources it owned, but not its name: -// the identity webhook removed it. Build the owner as it must be displayed (owner-avatar, labels). -import { useI18n } from 'vue-i18n' - -type Owner = { department?: string, departmentName?: string, [key: string]: unknown } - -// plain strings: the runtime-only vue-i18n build used in production cannot compile inline messages -const formerDepartment: Record = { - fr: 'Ancien département', - en: 'Former department' -} - -export const useDisplayOwner = () => { - const { locale } = useI18n() - - const departmentLabel = (department?: string, departmentName?: string) => { - if (!department) return undefined - return departmentName || `${formerDepartment[locale.value] ?? formerDepartment.en} - ${department}` - } - - const displayOwner = (owner: T): T => { - if (!owner.department || owner.departmentName) return owner - return { ...owner, departmentName: departmentLabel(owner.department) } - } - - return { displayOwner, departmentLabel } -} From cb4f015de865f2cc4cfb6273f889e32783b83470 Mon Sep 17 00:00:00 2001 From: BatLeDev Date: Wed, 16 Sep 2026 11:11:22 +0200 Subject: [PATCH 2/2] chore(deps): update lib-vue and lib-vuetify for the deleted department label --- package-lock.json | 18 +++++++++--------- ui/package.json | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index e15ba62..662b15e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -643,9 +643,9 @@ } }, "node_modules/@data-fair/lib-vue": { - "version": "1.30.1", - "resolved": "https://registry.npmjs.org/@data-fair/lib-vue/-/lib-vue-1.30.1.tgz", - "integrity": "sha512-ZGb9LRih5idfHDnIcA6J5pAuIBxVUvx+4bJiqidZIXbuAKt/pvtyM0lkgIW/1wfG5sY05AfeJvYr8890PZpjDQ==", + "version": "1.31.1", + "resolved": "https://registry.npmjs.org/@data-fair/lib-vue/-/lib-vue-1.31.1.tgz", + "integrity": "sha512-SD7jnWerCKZZM658nIvqPK6/efdBfVIA0wln7tRmQyFYdF2PZYTTREbauBT7j92fKDs4Nm7oXJJqeA4yMsoTsA==", "license": "MIT", "dependencies": { "@data-fair/lib-common-types": "^1.7.1", @@ -678,9 +678,9 @@ } }, "node_modules/@data-fair/lib-vuetify": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/@data-fair/lib-vuetify/-/lib-vuetify-2.4.3.tgz", - "integrity": "sha512-GqaiGZ4BxMi1hDo/uzGujYXl23qpp4R5OxMNmI//4380rOD83bvxQUb+12lQENscWMKYwx+3RfYNhDecDJk7Ag==", + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@data-fair/lib-vuetify/-/lib-vuetify-2.5.1.tgz", + "integrity": "sha512-efLqHNIC3B2DsgsRB4TzCuoIaVIC9tcucDEOLDiiWuvx1fHuHi08f0MxM7PjAv1eQmD5a8Dw1g7HJ9u1+1iIlg==", "license": "MIT", "dependencies": { "@data-fair/lib-common-types": "^1.10.4", @@ -688,7 +688,7 @@ "@vueuse/core": "^14.0.0" }, "peerDependencies": { - "@data-fair/lib-vue": "^1.15.0", + "@data-fair/lib-vue": "^1.31.1", "ofetch": "1", "vue-i18n": "10 || 11", "vuetify": "4" @@ -12072,8 +12072,8 @@ "@data-fair/frame": "^0.18.4", "@data-fair/lib-common-types": "^1.19.4", "@data-fair/lib-utils": "^1.8.0", - "@data-fair/lib-vue": "^1.27.1", - "@data-fair/lib-vuetify": "^2.3.0", + "@data-fair/lib-vue": "^1.31.1", + "@data-fair/lib-vuetify": "^2.5.1", "@data-fair/types-catalogs": "^0.7.1", "@intlify/unplugin-vue-i18n": "^11.0.7", "@koumoul/vjsf": "^4.5.3", diff --git a/ui/package.json b/ui/package.json index 9acd4db..a40df6d 100644 --- a/ui/package.json +++ b/ui/package.json @@ -20,8 +20,8 @@ "@data-fair/frame": "^0.18.4", "@data-fair/lib-common-types": "^1.19.4", "@data-fair/lib-utils": "^1.8.0", - "@data-fair/lib-vue": "^1.27.1", - "@data-fair/lib-vuetify": "^2.3.0", + "@data-fair/lib-vue": "^1.31.1", + "@data-fair/lib-vuetify": "^2.5.1", "@data-fair/types-catalogs": "^0.7.1", "@intlify/unplugin-vue-i18n": "^11.0.7", "@koumoul/vjsf": "^4.5.3",