From 2408ccab67966e0704517a507535b00767f20e14 Mon Sep 17 00:00:00 2001 From: tristan Date: Wed, 18 Mar 2026 10:38:11 +0100 Subject: [PATCH] =?UTF-8?q?fix=20:=20on=20ne=20p=C3=A8se=20plus=20automati?= =?UTF-8?q?quement=20+=20fix=20message=20de=20cr=C3=A9ation=20r=C3=A9cepti?= =?UTF-8?q?on?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/workspace.xml | 86 ++++++++++--------- .../components/reception/reception-weight.vue | 12 +-- .../components/shipment/shipment-loading.vue | 2 +- .../components/shipment/shipment-weight.vue | 14 +-- frontend/composables/useWeighing.ts | 8 +- frontend/i18n/locales/fr.json | 2 + frontend/layouts/default.vue | 3 +- frontend/services/reception.ts | 1 + frontend/services/shipment.ts | 2 + 9 files changed, 63 insertions(+), 67 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 561671b..75b83ee 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -4,13 +4,17 @@ - @@ -792,7 +797,8 @@ - diff --git a/frontend/components/reception/reception-weight.vue b/frontend/components/reception/reception-weight.vue index b5e9c32..20f2978 100644 --- a/frontend/components/reception/reception-weight.vue +++ b/frontend/components/reception/reception-weight.vue @@ -5,11 +5,11 @@

Pont-bascule connecté

-
+
{{ displayWeight }} kg @@ -36,7 +36,7 @@ diff --git a/frontend/components/shipment/shipment-loading.vue b/frontend/components/shipment/shipment-loading.vue index bdd8595..078e049 100644 --- a/frontend/components/shipment/shipment-loading.vue +++ b/frontend/components/shipment/shipment-loading.vue @@ -1,5 +1,5 @@ diff --git a/frontend/composables/useWeighing.ts b/frontend/composables/useWeighing.ts index f18cd95..4d3dc8b 100644 --- a/frontend/composables/useWeighing.ts +++ b/frontend/composables/useWeighing.ts @@ -27,9 +27,7 @@ export const useWeighing = ({ const displayWeight = computed(() => weightData.value?.weight ?? currentWeightEntry.value?.weight ?? null) const displayDsd = computed(() => weightData.value?.dsd ?? currentWeightEntry.value?.dsd ?? '-') const title = computed(() => (mode === 'gross' ? 'Pesée à plein' : 'Pesée à vide')) - const showLoadingBox = computed( - () => isFetching.value || (displayWeight.value === null && currentWeightEntry.value === null) - ) + const showLoadingBox = computed(() => isFetching.value) const fetchWeight = async () => { isFetching.value = true @@ -111,9 +109,7 @@ export const useWeighingShipment = ({ const displayWeight = computed(() => weightData.value?.weight ?? currentWeightEntry.value?.weight ?? null) const displayDsd = computed(() => weightData.value?.dsd ?? currentWeightEntry.value?.dsd ?? '-') const title = computed(() => (modeShipment === 'gross' ? 'Pesée à vide' : 'Pesée à plein')) - const showLoadingBox = computed( - () => isFetching.value || (displayWeight.value === null && currentWeightEntry.value === null) - ) + const showLoadingBox = computed(() => isFetching.value) const fetchWeight = async () => { isFetching.value = true diff --git a/frontend/i18n/locales/fr.json b/frontend/i18n/locales/fr.json index 91dbc6a..cb6ac2d 100644 --- a/frontend/i18n/locales/fr.json +++ b/frontend/i18n/locales/fr.json @@ -109,9 +109,11 @@ }, "success": { "reception": { + "create": "Réception créée avec succès", "update": "Réception mise à jour avec succès." }, "shipment": { + "create": "Éxpedition créée avec succès", "update": "Éxpedition mise à jour avec succès." }, "supplier": { diff --git a/frontend/layouts/default.vue b/frontend/layouts/default.vue index d0df6cf..0b3ebf0 100644 --- a/frontend/layouts/default.vue +++ b/frontend/layouts/default.vue @@ -134,7 +134,8 @@ class="inline-flex items-center py-2 -my-2 text-xl leading-none transition hover:opacity-80" aria-haspopup="true" > - {{ userDisplayName }} + + {{ userDisplayName }} diff --git a/frontend/services/reception.ts b/frontend/services/reception.ts index 68d75d7..09a27e8 100644 --- a/frontend/services/reception.ts +++ b/frontend/services/reception.ts @@ -21,6 +21,7 @@ export async function getReception(id: number) { export async function createReception(payload: ReceptionPayload = {}) { const api = useApi() return api.post('receptions', payload, { + toastSuccessKey: 'success.reception.create', toastErrorKey: 'errors.reception.create' }) } diff --git a/frontend/services/shipment.ts b/frontend/services/shipment.ts index d701048..d273102 100644 --- a/frontend/services/shipment.ts +++ b/frontend/services/shipment.ts @@ -18,8 +18,10 @@ export async function getShipment(id: number) { } export async function createShipment(payload: ShipmentPayload = {}) { + console.log('test') const api = useApi() return api.post('shipments', payload, { + toastSuccessKey: 'success.shipment.create', toastErrorKey: 'errors.shipment.create' }) }