Compare commits

..

4 Commits

Author SHA1 Message Date
gitea-actions
dc5320b324 chore: bump version to v0.0.65
All checks were successful
Auto Tag Develop / tag (push) Successful in 4s
Build Release Artefact / build (push) Successful in 1m17s
2026-02-27 13:05:53 +00:00
09a641e5cf [#356] modification front page admin bovin (!37)
All checks were successful
Auto Tag Develop / tag (push) Successful in 5s
| Numéro du ticket | Titre du ticket |
|------------------|-----------------|
|   #356              |      modification front page admin bovin           |

## Description de la PR

## Modification du .env

## Check list

- [x] Pas de régression
- [ ] TU/TI/TF rédigée
- [x] TU/TI/TF OK
- [x] CHANGELOG modifié

Reviewed-on: #37
Reviewed-by: Autin <tristan@yuno.malio.fr>
Co-authored-by: sroy <sebastien@yuno.malio.fr>
Co-committed-by: sroy <sebastien@yuno.malio.fr>
2026-02-27 13:05:47 +00:00
gitea-actions
a0557b077b chore: bump version to v0.0.64
All checks were successful
Auto Tag Develop / tag (push) Successful in 4s
Build Release Artefact / build (push) Successful in 1m20s
2026-02-27 10:06:55 +00:00
2d2b38eae4 [#355] modification front de la page admin transporteur (!36)
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled
| Numéro du ticket | Titre du ticket |
|------------------|-----------------|
|       #355           |      modification front de la page admin transporteur           |

## Description de la PR

## Modification du .env

## Check list

- [x] Pas de régression
- [ ] TU/TI/TF rédigée
- [x] TU/TI/TF OK
- [x] CHANGELOG modifié

Reviewed-on: #36
Reviewed-by: Autin <tristan@yuno.malio.fr>
Co-authored-by: sroy <sebastien@yuno.malio.fr>
Co-committed-by: sroy <sebastien@yuno.malio.fr>
2026-02-27 10:06:49 +00:00
9 changed files with 77 additions and 56 deletions

View File

@@ -55,8 +55,7 @@ Ajouter dans le fichier .env du frontend
* [#332] Refonte écran réception terminée * [#332] Refonte écran réception terminée
* [#327] afficher/modifier écran expédition terminée * [#327] afficher/modifier écran expédition terminée
* [#352] modification front admin fournisseur * [#352] modification front admin fournisseur
* [#355] afficher/modifier écran expédition terminée
* [#356] front page admin bovin * [#356] front page admin bovin
### Changed ### Changed

View File

@@ -1,2 +1,2 @@
parameters: parameters:
app.version: '0.0.63' app.version: '0.0.65'

View File

@@ -18,14 +18,13 @@
<UiTextInput id="address-country" v-model="form.countryCode" label="Pays (code)" /> <UiTextInput id="address-country" v-model="form.countryCode" label="Pays (code)" />
</div> </div>
<div class="flex justify-center items-center"> <div class="flex justify-center items-center">
<button <UiButton
class="inline-flex items-center justify-center text-xl min-w-[194px] text-white uppercase bg-primary-500 h-[50px] px-8 rounded hover:opacity-80 gap-2" class="inline-flex items-center justify-center text-xl text-white uppercase bg-primary-500 h-[50px] rounded hover:opacity-80 justify-self-end"
type="submit" type="submit"
:disabled="isLoading" :disabled="isLoading"
> >
<Icon :name="props.address ? '' : 'mdi:plus'" size="28" /> Valider
{{ props.address? "Valider" : "Ajouter" }} </UiButton>
</button>
</div> </div>
</form> </form>
</template> </template>

View File

@@ -82,7 +82,10 @@
"list": "Impossible de récupérer la liste des camions." "list": "Impossible de récupérer la liste des camions."
}, },
"bovin": { "bovin": {
"list": "Impossible de récupérer la liste des races de bovins." "list": "Impossible de récupérer la liste des races de bovins.",
"fetch": "Impossible de récupérer le type bovin.",
"create": "Impossible de créer le type bovin.",
"update": "Impossible de mettre à jour le type bovin."
}, },
"carrier": { "carrier": {
"list": "Impossible de récupérer la liste des transporteurs.", "list": "Impossible de récupérer la liste des transporteurs.",
@@ -133,6 +136,10 @@
"update": "Transporteur mis à jour", "update": "Transporteur mis à jour",
"create": "Transporteur créé" "create": "Transporteur créé"
}, },
"bovin": {
"update": "Type bovin mis à jour avec succès.",
"create": "Type bovin créé avec succès."
},
"weight": { "weight": {
"update": "Pesée mis à jour" "update": "Pesée mis à jour"
} }

View File

@@ -22,9 +22,9 @@
<UiButton <UiButton
type="submit" type="submit"
:disabled="isLoading || isHydrating" :disabled="isLoading || isHydrating"
class="inline-flex items-center justify-center text-xl min-w-[194px] text-white uppercase bg-primary-500 h-[50px] px-8 rounded hover:opacity-80 gap-2 justify-self-end" class="inline-flex items-center justify-center text-xl min-w-[194px] text-white uppercase bg-primary-500 h-[50px] rounded hover:opacity-80 justify-self-end"
> >
{{ isEdit ? 'Valider' : 'Ajouter' }} Valider
</UiButton> </UiButton>
</div> </div>
</form> </form>
@@ -37,6 +37,8 @@ const router = useRouter()
const route = useRoute() const route = useRoute()
const isLoading = ref(false) const isLoading = ref(false)
const isHydrating = ref(false) const isHydrating = ref(false)
const idBovin = computed(() => resolveId(route.params.id))
const isEdit = computed(() => idBovin.value !== null)
function resolveId(param: unknown) { function resolveId(param: unknown) {
const idStr = Array.isArray(param) ? param[0] : param const idStr = Array.isArray(param) ? param[0] : param
@@ -45,9 +47,6 @@ function resolveId(param: unknown) {
return Number.isFinite(id) ? id : null return Number.isFinite(id) ? id : null
} }
const idBovin = computed(() => resolveId(route.params.id))
const isEdit = computed(() => idBovin.value !== null)
const form = reactive<BovinFormData>({ const form = reactive<BovinFormData>({
label: '', label: '',
code: '' code: ''
@@ -100,7 +99,6 @@ async function validate() {
} else { } else {
await createBovin(basePayload) await createBovin(basePayload)
} }
await navigate()
} finally { } finally {
isLoading.value = false isLoading.value = false
} }

View File

@@ -1,32 +1,41 @@
<template> <template>
<form @submit.prevent="validate"> <form @submit.prevent="validate">
<div class="flex items-center justify-between"> <div class="flex items-center justify-between relative">
<h1 class="text-3xl font-bold uppercase"> <div class="flex flex-row absolute -left-[60px]">
{{ route.params.id ? 'Modifier transporteur' : 'Ajout transporteur' }} <Icon
</h1> @click="router.push('/admin/carrier/carrier-list')"
name="gg:arrow-left-o"
size="40"
class="cursor-pointer text-primary-500"
/>
</div>
<h1 class="text-4xl text-primary-500 font-bold uppercase">
{{ route.params.id ? 'Modifications du transporteur' : 'Ajout d\'un transporteur' }}
</h1>
</div>
<UiButton <div class="grid grid-cols-2 items-start pt-7 mb-11 gap-x-[200px]">
type="submit" <UiTextInput
class="inline-flex items-center justify-center text-xl text-white uppercase bg-primary-500 h-[50px] px-8 rounded hover:opacity-80 gap-2 justify-self-end" label="Nom du transporteur"
> id="carrier-name"
Valider v-model="form.name"
</UiButton> />
</div>
<div class="grid grid-cols-2 items-start gap-y-8 gap-x-40 py-12"> <UiTextInput
<UiTextInput label="Code transporteur"
label = "nom du fournisseur"
id="carrier-name"
v-model="form.name"
/>
<UiTextInput
label = "code fournisseur"
id="code-id" id="code-id"
v-model="form.code" v-model="form.code"
/> />
</div> </div>
<div class="flex justify-center items-center">
<UiButton
type="submit"
class="inline-flex items-center justify-center text-xl min-w-[194px] text-white uppercase bg-primary-500 h-[50px] rounded hover:opacity-80 justify-self-end"
>
Valider
</UiButton>
</div>
</form> </form>
</template> </template>
@@ -92,11 +101,10 @@ async function validate() {
if(idCarrier.value){ if(idCarrier.value){
await updateCarrier(idCarrier.value, basePayload) await updateCarrier(idCarrier.value, basePayload)
navigate()
return return
}else{
await createCarrier(basePayload)
} }
await createCarrier(basePayload)
navigate()
} }
function navigate(){ function navigate(){

View File

@@ -1,25 +1,18 @@
<template> <template>
<div class="flex items-center justify-between "> <div class="flex items-center justify-between ">
<h1 class="text-3xl font-bold uppercase text-primary-500">listes des transporteurs</h1> <h1 class="text-4xl font-bold uppercase text-primary-500">listes des transporteurs</h1>
<NuxtLink
to="/admin/carrier"
class="inline-flex items-center justify-center text-xl text-white uppercase bg-primary-500 h-[50px] px-8 rounded hover:opacity-80 gap-2"
>
<Icon name="mdi:plus" size="28" />
Ajouter
</NuxtLink>
</div> </div>
<div class="mt-6 border border-slate-200 mb-16 "> <div class="mt-7 border border-slate-200 mb-11 ">
<div class="grid grid-cols-2 gap-4 bg-slate-100 px-4 py-3 text-sm font-semibold uppercase tracking-wide"> <div class="grid grid-cols-2 gap-4 text-primary-700 bg-slate-100 px-4 py-3 text-sm font-semibold uppercase tracking-wide">
<div>Label</div> <div>Label</div>
<div>Code</div> <div>Code</div>
</div> </div>
<div <div
v-for="carrier in carrierList" v-for="carrier in carrierList"
:key="carrier.id" :key="carrier.id"
class="grid grid-cols-2 gap-4 px-4 py-3 text-sm hover:bg-slate-50 cursor-pointer border-t border-slate-200" class="grid grid-cols-2 text-primary-700 gap-4 px-4 py-3 text-sm hover:bg-slate-50 cursor-pointer border-t border-slate-200"
role="button" role="button"
tabindex="0" tabindex="0"
@click="goToCarrier(carrier.id)" @click="goToCarrier(carrier.id)"
@@ -29,6 +22,15 @@
<div>{{ carrier.code }}</div> <div>{{ carrier.code }}</div>
</div> </div>
</div> </div>
<div class="flex justify-center items-center">
<NuxtLink
to="/admin/carrier"
class="inline-flex items-center justify-center text-xl text-white uppercase bg-primary-500 h-[50px] px-8 rounded hover:opacity-80 gap-2"
>
<Icon name="mdi:plus" size="28" />
Ajouter
</NuxtLink>
</div>
</template> </template>

View File

@@ -17,7 +17,7 @@
</div> </div>
<div class="flex items-center justify-center"> <div class="flex items-center justify-center">
<UiButton <UiButton
class="inline-flex items-center mb-[106px] justify-center text-xl text-white uppercase bg-primary-500 h-[50px] px-8 rounded hover:opacity-80 gap-2" class="inline-flex mb-28 items-center justify-center text-xl min-w-[194px] text-white uppercase bg-primary-500 h-[50px] rounded hover:opacity-80 justify-self-end"
type="submit" type="submit"
:disabled="isLoading || !auth.isAdmin" :disabled="isLoading || !auth.isAdmin"
> >
@@ -71,7 +71,7 @@
<div class="flex justify-center items-center"> <div class="flex justify-center items-center">
<UiButton <UiButton
type="button" type="button"
class="inline-flex items-center mb-16 justify-center text-xl text-white uppercase bg-primary-500 h-[50px] px-8 rounded hover:opacity-80 gap-2" class="inline-flex items-center justify-center text-xl gap-2 text-white uppercase bg-primary-500 h-[50px] rounded hover:opacity-80 justify-self-end"
:disabled="supplierId === null || !auth.isAdmin" :disabled="supplierId === null || !auth.isAdmin"
@click="goToAddAddress" @click="goToAddAddress"
> >

View File

@@ -24,19 +24,27 @@ export async function getBovineTypeList(): Promise<BovineTypeData[]> {
export async function getBovin(id: number): Promise<BovineTypeData> { export async function getBovin(id: number): Promise<BovineTypeData> {
const api = useApi() const api = useApi()
const response = await api.get<BovineTypeData>(`bovine_types/${id}`) const response = await api.get<BovineTypeData>(`bovine_types/${id}`, {}, {
toastErrorKey: 'errors.bovin.fetch'
})
return mapToBovineTypeData(response) return mapToBovineTypeData(response)
} }
export async function createBovin(payload: BovinPayload = {}): Promise<BovineTypeData> { export async function createBovin(payload: BovinPayload = {}): Promise<BovineTypeData> {
const api = useApi() const api = useApi()
const response = await api.post<BovineTypeData>('bovine_types', toBovineTypePayload(payload)) const response = await api.post<BovineTypeData>('bovine_types', toBovineTypePayload(payload), {
toastErrorKey: 'errors.bovin.create',
toastSuccessKey: 'success.bovin.create'
})
return mapToBovineTypeData(response) return mapToBovineTypeData(response)
} }
export async function updateBovin(id: number, payload: BovinPayload = {}): Promise<BovineTypeData> { export async function updateBovin(id: number, payload: BovinPayload = {}): Promise<BovineTypeData> {
const api = useApi() const api = useApi()
const response = await api.patch<BovineTypeData>(`bovine_types/${id}`, toBovineTypePayload(payload)) const response = await api.patch<BovineTypeData>(`bovine_types/${id}`, toBovineTypePayload(payload), {
toastErrorKey: 'errors.bovin.update',
toastSuccessKey: 'success.bovin.update'
})
return mapToBovineTypeData(response) return mapToBovineTypeData(response)
} }