diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 0de7a62..bf45fba 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -4,11 +4,10 @@ - + - - + @@ -31,16 +30,16 @@ - + - + @@ -231,8 +230,8 @@ "RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager.252": "true", "RunOnceActivity.git.unshallow": "true", "RunOnceActivity.typescript.service.memoryLimit.init": "true", - "git-widget-placeholder": "feat/278-plan-du-site", - "last_opened_file_path": "//wsl.localhost/Ubuntu-24.04/home/m-tristan/workspace/Ferme", + "git-widget-placeholder": "feat/352-modification-front-admin-fournisseur", + "last_opened_file_path": "/home/sroy/Documents/test/Ferme/frontend/components/commun", "node.js.detected.package.eslint": "true", "node.js.detected.package.tslint": "true", "node.js.selected.package.eslint": "(autodetect)", @@ -256,6 +255,7 @@ }]]> + @@ -311,110 +311,6 @@ - - - 1768318921478 - - - - 1768318921478 - - - - 1768498751836 - - - - 1768498751836 - - - - 1768555180530 - - - - 1768555180530 - - - - 1768832208350 - - - - 1768832208350 - - - - 1768832516587 - - - - 1768832516587 - - - - 1768940104944 - - - - 1768940104944 - - - - 1769005220331 - - - - 1769005220331 - - - - 1769008700008 - - - - 1769008700008 - - - - 1769014602062 - - - - 1769014602062 - - - - 1769019284586 - - - - 1769019284586 - - - - 1769021756823 - - - - 1769021756823 - - - - 1769021818384 - - - - 1769021818384 - - - - 1769022071620 - - - - 1769022071620 - 1769024603812 @@ -703,7 +599,111 @@ 1770969471135 - + + + 1772094268366 + + + + 1772094268366 + + + + 1772111964268 + + + + 1772111964268 + + + + 1772112729501 + + + + 1772112729502 + + + + 1772112812677 + + + + 1772112812677 + + + + 1772177400063 + + + + 1772177400063 + + + + 1772177614438 + + + + 1772177614438 + + + + 1772178540489 + + + + 1772178540489 + + + + 1772180053740 + + + + 1772180053740 + + + + 1772180581178 + + + + 1772180581178 + + + + 1772180684250 + + + + 1772180684250 + + + + 1772180972984 + + + + 1772180972984 + + + + 1772182545592 + + + + 1772182545592 + + + + 1772182707441 + + + + 1772182707441 + + @@ -753,16 +753,6 @@ - - - - - - - - - - @@ -778,7 +768,17 @@ - + + + + + + + + + + + @@ -793,10 +793,6 @@ 6 - - file://$PROJECT_DIR$/frontend/services/dto/shipment-data.ts - - file://$PROJECT_DIR$/frontend/layouts/default.vue 72 @@ -817,4 +813,4 @@ - + \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 07c5efc..222a318 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,6 +54,7 @@ Ajouter dans le fichier .env du frontend * [#334] Correctifs * [#332] Refonte écran réception terminée * [#327] afficher/modifier écran expédition terminée +* [#352] modification front admin fournisseur ### Changed diff --git a/frontend/components/address.vue b/frontend/components/address.vue index cb6e64b..2c7c839 100644 --- a/frontend/components/address.vue +++ b/frontend/components/address.vue @@ -1,23 +1,15 @@ - - - - {{ props.address ? "Modification d'une adresse" : "Ajout d'une adresse" }} - + + + - - - - {{ props.address? "Valider" : "Ajouter" }} - + + {{ props.address ? "Modification d'une adresse" : "Ajout d'une adresse" }} + - + @@ -25,6 +17,16 @@ + + + + {{ props.address? "Valider" : "Ajouter" }} + + @@ -53,6 +55,20 @@ const emptyForm = (): AddressPayload => ({ const form = reactive(emptyForm()) +const backPath = computed(() => { + if (props.type === "customer") { + const customerId = Number(route.query.customerId) + return Number.isFinite(customerId) && customerId > 0 + ? `/admin/customer/${customerId}` + : "/admin/customer/customer-list" + } + + const supplierId = Number(route.query.supplierId) + return Number.isFinite(supplierId) && supplierId > 0 + ? `/admin/supplier/${supplierId}` + : "/admin/supplier/supplier-list" +}) + const hydrateForm = (address?: AddressPayload | null) => { const data = address ?? emptyForm() form.label = data.label ?? "" @@ -76,6 +92,10 @@ const validateForm = () => { emit("validate", {...form}) } +const goBack = () => { + router.push(backPath.value) +} + const emit = defineEmits<{ (event: 'validate', form: AddressPayload): void }>() diff --git a/frontend/components/ui/UiButton.vue b/frontend/components/ui/UiButton.vue index 429e00e..c694bca 100644 --- a/frontend/components/ui/UiButton.vue +++ b/frontend/components/ui/UiButton.vue @@ -3,7 +3,7 @@ :is="'button'" :type="type" :disabled="isDisabled" - class="inline-flex items-center justify-center rounded-md" + class="inline-flex min-w-[194px] items-center justify-center rounded-md" :class="[ isDisabled ? 'cursor-not-allowed opacity-60' : 'cursor-pointer', buttonClass diff --git a/frontend/components/ui/UiTextInput.vue b/frontend/components/ui/UiTextInput.vue index 0926631..d00503b 100644 --- a/frontend/components/ui/UiTextInput.vue +++ b/frontend/components/ui/UiTextInput.vue @@ -3,7 +3,7 @@ {{ label }} @@ -16,7 +16,7 @@ :maxlength="maxlength" :disabled="disabled" v-bind="attrs" - class="border-b border-black text-xl py-[6px] bg-transparent text-primary-500" + class="border-b border-black text-xl py-[6px] bg-transparent text-primary-700" :class="[ isEmpty ? 'text-neutral-400' : 'text-black', disabled ? 'cursor-not-allowed' : 'cursor-text', diff --git a/frontend/pages/admin/supplier/[[id]].vue b/frontend/pages/admin/supplier/[[id]].vue index 8c7d654..db1046c 100644 --- a/frontend/pages/admin/supplier/[[id]].vue +++ b/frontend/pages/admin/supplier/[[id]].vue @@ -1,12 +1,23 @@ - - + + + + + + {{ supplierId ? "Modifications du fournisseur" : "Ajout d'un fournisseur" }} + + + + + + + @@ -15,35 +26,19 @@ - - - - + + Adresses fournisseur - - - - Adresses fournisseur - - - Ajouter - - - + - - Libellé - Rue - Complément - Code postal - Ville - Pays + + Libellé + Rue + Complément + Code postal + Ville + Pays @@ -58,21 +53,32 @@ - {{ address.label || "—" }} - {{ address.street || "—" }} - {{ address.street2 || "—" }} - {{ address.postalCode || "—" }} - {{ address.city || "—" }} - {{ address.countryCode || "—" }} + {{ address.label || "—" }} + {{ address.street || "—" }} + {{ address.street2 || "—" }} + {{ address.postalCode || "—" }} + {{ address.city || "—" }} + {{ address.countryCode || "—" }} + + + + Ajouter + + diff --git a/frontend/pages/admin/supplier/supplier-list.vue b/frontend/pages/admin/supplier/supplier-list.vue index 8f3a8fe..8b6a592 100644 --- a/frontend/pages/admin/supplier/supplier-list.vue +++ b/frontend/pages/admin/supplier/supplier-list.vue @@ -1,21 +1,12 @@ - Liste des fournisseurs - - - Ajouter - + Liste des fournisseurs - + Nom Mail @@ -33,7 +24,7 @@ {{ supplier.name }} @@ -49,7 +40,7 @@ @@ -67,7 +58,7 @@ {{ supplier.name }} @@ -80,9 +71,20 @@ - + Accès réservé aux administrateurs. + + + + Ajouter + +