From 7547c2ca8331f548b0b8b66294f821132562d810 Mon Sep 17 00:00:00 2001 From: tristan Date: Wed, 24 Jun 2026 17:47:11 +0200 Subject: [PATCH] =?UTF-8?q?feat=20:=20refonte=20des=20blocs=20adresse=20?= =?UTF-8?q?=E2=80=94=204=20colonnes,=20titre=20noir,=20separateurs=20(ERP-?= =?UTF-8?q?196)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/i18n/locales/fr.json | 2 + .../components/ClientAddressBlock.vue | 384 +++++++++--------- .../components/SupplierAddressBlock.vue | 345 ++++++++-------- .../commercial/pages/clients/[id]/edit.vue | 1 + .../commercial/pages/clients/[id]/index.vue | 1 + .../modules/commercial/pages/clients/new.vue | 1 + .../commercial/pages/suppliers/[id]/edit.vue | 1 + .../commercial/pages/suppliers/[id]/index.vue | 1 + .../commercial/pages/suppliers/new.vue | 1 + .../components/ProviderAddressBlock.vue | 251 ++++++------ .../__tests__/ProviderAddressBlock.spec.ts | 1 + .../technique/pages/providers/[id]/edit.vue | 2 + .../technique/pages/providers/[id]/index.vue | 2 + .../modules/technique/pages/providers/new.vue | 2 + .../components/CarrierAddressBlock.vue | 206 +++++----- .../__tests__/CarrierAddressBlock.spec.ts | 1 + .../transport/pages/carriers/[id]/edit.vue | 2 + .../transport/pages/carriers/[id]/index.vue | 2 + .../modules/transport/pages/carriers/new.vue | 2 + 19 files changed, 639 insertions(+), 569 deletions(-) diff --git a/frontend/i18n/locales/fr.json b/frontend/i18n/locales/fr.json index 4fe39f8..76560f1 100644 --- a/frontend/i18n/locales/fr.json +++ b/frontend/i18n/locales/fr.json @@ -453,6 +453,7 @@ "add": "Nouveau contact" }, "address": { + "title": "Adresse {n}", "sites": "Sites", "contacts": "Contact(s) rattaché(s)", "country": "Pays", @@ -629,6 +630,7 @@ "uploadFailed": "Le téléversement de la décharge a échoué." }, "address": { + "title": "Adresse", "country": "Pays", "postalCode": "Code postal", "city": "Ville", diff --git a/frontend/modules/commercial/components/ClientAddressBlock.vue b/frontend/modules/commercial/components/ClientAddressBlock.vue index 8e5886a..2642266 100644 --- a/frontend/modules/commercial/components/ClientAddressBlock.vue +++ b/frontend/modules/commercial/components/ClientAddressBlock.vue @@ -1,203 +1,211 @@ @@ -230,6 +238,8 @@ const props = defineProps<{ /** Pays disponibles (France par defaut). */ countryOptions: RefOption[] removable?: boolean + /** Dernier bloc de la liste : supprime le filet de separation bas. */ + last?: boolean readonly?: boolean /** Bloc desactive (champs grises, consultation — distinct de readonly). */ disabled?: boolean diff --git a/frontend/modules/commercial/components/SupplierAddressBlock.vue b/frontend/modules/commercial/components/SupplierAddressBlock.vue index 0e0ce64..a6a2371 100644 --- a/frontend/modules/commercial/components/SupplierAddressBlock.vue +++ b/frontend/modules/commercial/components/SupplierAddressBlock.vue @@ -1,189 +1,198 @@ @@ -210,6 +219,8 @@ const props = defineProps<{ /** Pays disponibles (France par defaut). */ countryOptions: RefOption[] removable?: boolean + /** Dernier bloc de la liste : supprime le filet de separation bas. */ + last?: boolean readonly?: boolean /** Bloc desactive (champs grises, consultation — distinct de readonly). */ disabled?: boolean diff --git a/frontend/modules/commercial/pages/clients/[id]/edit.vue b/frontend/modules/commercial/pages/clients/[id]/edit.vue index 1dd766e..b75b2b0 100644 --- a/frontend/modules/commercial/pages/clients/[id]/edit.vue +++ b/frontend/modules/commercial/pages/clients/[id]/edit.vue @@ -211,6 +211,7 @@ :key="address.id ?? `new-${index}`" :model-value="address" :title="t('commercial.clients.form.address.title', { n: index + 1 })" + :last="index === addresses.length - 1" :category-options="addressCategoryOptions" :site-options="siteOptions" :contact-options="contactOptions" diff --git a/frontend/modules/commercial/pages/clients/[id]/index.vue b/frontend/modules/commercial/pages/clients/[id]/index.vue index 72dacdb..d43f793 100644 --- a/frontend/modules/commercial/pages/clients/[id]/index.vue +++ b/frontend/modules/commercial/pages/clients/[id]/index.vue @@ -171,6 +171,7 @@ :key="view.draft.id ?? index" :model-value="view.draft" :title="t('commercial.clients.form.address.title', { n: index + 1 })" + :last="index === addressViews.length - 1" :category-options="view.categoryOptions" :site-options="allSiteOptions" :contact-options="contactOptions" diff --git a/frontend/modules/commercial/pages/clients/new.vue b/frontend/modules/commercial/pages/clients/new.vue index 42349e0..53489c2 100644 --- a/frontend/modules/commercial/pages/clients/new.vue +++ b/frontend/modules/commercial/pages/clients/new.vue @@ -210,6 +210,7 @@ :key="index" :model-value="address" :title="t('commercial.clients.form.address.title', { n: index + 1 })" + :last="index === addresses.length - 1" :category-options="addressCategoryOptions" :site-options="referentials.sites.value" :contact-options="contactOptions" diff --git a/frontend/modules/commercial/pages/suppliers/[id]/edit.vue b/frontend/modules/commercial/pages/suppliers/[id]/edit.vue index 0355031..f6e0927 100644 --- a/frontend/modules/commercial/pages/suppliers/[id]/edit.vue +++ b/frontend/modules/commercial/pages/suppliers/[id]/edit.vue @@ -180,6 +180,7 @@ :key="address.id ?? `new-${index}`" :model-value="address" :title="t('commercial.suppliers.form.address.title', { n: index + 1 })" + :last="index === addresses.length - 1" :category-options="mainCategoryOptions" :site-options="siteOptions" :contact-options="contactOptions" diff --git a/frontend/modules/commercial/pages/suppliers/[id]/index.vue b/frontend/modules/commercial/pages/suppliers/[id]/index.vue index c431cf2..6c43a33 100644 --- a/frontend/modules/commercial/pages/suppliers/[id]/index.vue +++ b/frontend/modules/commercial/pages/suppliers/[id]/index.vue @@ -152,6 +152,7 @@ :key="view.draft.id ?? index" :model-value="view.draft" :title="t('commercial.suppliers.form.address.title', { n: index + 1 })" + :last="index === addressViews.length - 1" :category-options="view.categoryOptions" :site-options="allSiteOptions" :contact-options="contactOptions" diff --git a/frontend/modules/commercial/pages/suppliers/new.vue b/frontend/modules/commercial/pages/suppliers/new.vue index c0249be..40c63dd 100644 --- a/frontend/modules/commercial/pages/suppliers/new.vue +++ b/frontend/modules/commercial/pages/suppliers/new.vue @@ -178,6 +178,7 @@ :key="index" :model-value="address" :title="t('commercial.suppliers.form.address.title', { n: index + 1 })" + :last="index === addresses.length - 1" :category-options="referentials.categories.value" :site-options="referentials.sites.value" :contact-options="contactOptions" diff --git a/frontend/modules/technique/components/ProviderAddressBlock.vue b/frontend/modules/technique/components/ProviderAddressBlock.vue index cf1b61c..24faeef 100644 --- a/frontend/modules/technique/components/ProviderAddressBlock.vue +++ b/frontend/modules/technique/components/ProviderAddressBlock.vue @@ -1,131 +1,140 @@ @@ -143,6 +152,8 @@ const POSTAL_CODE_MASK = '#####' const props = defineProps<{ /** Brouillon de l'adresse (v-model). */ modelValue: ProviderAddressFormDraft + /** Titre du bloc (ex: « Adresse 1 »). */ + title: string /** Sites Starseed disponibles. */ siteOptions: RefOption[] /** Contacts deja saisis, rattachables a l'adresse. */ @@ -150,6 +161,8 @@ const props = defineProps<{ /** Pays disponibles (France par defaut). */ countryOptions: RefOption[] removable?: boolean + /** Dernier bloc de la liste : supprime le filet de separation bas. */ + last?: boolean readonly?: boolean /** Bloc desactive (champs grises, consultation — distinct de readonly). */ disabled?: boolean diff --git a/frontend/modules/technique/components/__tests__/ProviderAddressBlock.spec.ts b/frontend/modules/technique/components/__tests__/ProviderAddressBlock.spec.ts index 9189305..f2a98b9 100644 --- a/frontend/modules/technique/components/__tests__/ProviderAddressBlock.spec.ts +++ b/frontend/modules/technique/components/__tests__/ProviderAddressBlock.spec.ts @@ -46,6 +46,7 @@ function mountBlock(overrides: Record = {}, errors?: Record -
- - - - - - - - - - - -