Compare commits
10 Commits
719937d218
...
v0.0.30
| Author | SHA1 | Date | |
|---|---|---|---|
| 299ea84e87 | |||
| bb0b0092da | |||
| 33d21f6ae6 | |||
| 98ee62294d | |||
| 820386b87b | |||
| c17f7aa08a | |||
| 4a0d38d307 | |||
| e9948d6ac3 | |||
| 80d87b7c9b | |||
| a69556c554 |
@@ -16,30 +16,50 @@ jobs:
|
|||||||
token: ${{ secrets.RELEASE_TOKEN }}
|
token: ${{ secrets.RELEASE_TOKEN }}
|
||||||
persist-credentials: true
|
persist-credentials: true
|
||||||
|
|
||||||
- name: Create next tag v0.0.X
|
- name: Create next tag from config/version.yaml
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
# Skip if current commit already has a v0.0.* tag
|
# Skip if current commit already has a vX.Y.Z tag
|
||||||
if git tag --points-at HEAD | grep -qE '^v0\.0\.'; then
|
if git tag --points-at HEAD | grep -qE '^v[0-9]+\.[0-9]+\.[0-9]+$'; then
|
||||||
echo "Tag already exists on this commit. Skipping."
|
echo "Tag already exists on this commit. Skipping."
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
last_tag="$(git tag -l 'v0.0.*' --sort=-v:refname | head -n1 || true)"
|
changed_version=false
|
||||||
if [ -z "$last_tag" ]; then
|
if git diff --name-only "${{ gitea.event.before }}" "${{ gitea.event.after }}" | grep -q '^config/version\.yaml$'; then
|
||||||
next_tag="v0.0.1"
|
changed_version=true
|
||||||
else
|
|
||||||
patch="${last_tag##v0.0.}"
|
|
||||||
if ! [[ "$patch" =~ ^[0-9]+$ ]]; then
|
|
||||||
echo "Unexpected tag format: $last_tag" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
next_tag="v0.0.$((patch + 1))"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
git config user.name "gitea-actions"
|
read_version() {
|
||||||
git config user.email "gitea-actions@local"
|
awk -F': *' '/app\.version:/{print $2}' config/version.yaml | tr -d '[:space:]' | tr -d "'\""
|
||||||
git tag "$next_tag"
|
}
|
||||||
git push origin "$next_tag"
|
|
||||||
|
if $changed_version; then
|
||||||
|
version="$(read_version)"
|
||||||
|
if ! [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||||
|
echo "Invalid version in version.yaml: $version" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
last_tag="$(git tag -l 'v*' --sort=-v:refname | head -n1 || true)"
|
||||||
|
if [ -z "$last_tag" ]; then
|
||||||
|
version="0.1.0"
|
||||||
|
else
|
||||||
|
base="${last_tag#v}"
|
||||||
|
IFS='.' read -r major minor patch <<< "$base"
|
||||||
|
version="${major}.${minor}.$((patch + 1))"
|
||||||
|
fi
|
||||||
|
|
||||||
|
printf "parameters:\\n app.version: '%s'\\n" "$version" > config/version.yaml
|
||||||
|
git config user.name "gitea-actions"
|
||||||
|
git config user.email "gitea-actions@local"
|
||||||
|
git add config/version.yaml
|
||||||
|
git commit -m "chore: bump version to v$version" || true
|
||||||
|
git push origin develop || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
tag="v$version"
|
||||||
|
git tag "$tag"
|
||||||
|
git push origin "$tag"
|
||||||
|
|||||||
2
.idea/dataSources.xml
generated
2
.idea/dataSources.xml
generated
@@ -5,7 +5,7 @@
|
|||||||
<driver-ref>postgresql</driver-ref>
|
<driver-ref>postgresql</driver-ref>
|
||||||
<synchronize>true</synchronize>
|
<synchronize>true</synchronize>
|
||||||
<jdbc-driver>org.postgresql.Driver</jdbc-driver>
|
<jdbc-driver>org.postgresql.Driver</jdbc-driver>
|
||||||
<jdbc-url>jdbc:postgresql://localhost:5433/ferme</jdbc-url>
|
<jdbc-url>jdbc:postgresql://localhost:5432/ferme</jdbc-url>
|
||||||
<working-dir>$ProjectFileDir$</working-dir>
|
<working-dir>$ProjectFileDir$</working-dir>
|
||||||
</data-source>
|
</data-source>
|
||||||
<data-source source="LOCAL" name="Ferme recette" uuid="ae622167-c834-4e7b-87a5-c1721036f5dc">
|
<data-source source="LOCAL" name="Ferme recette" uuid="ae622167-c834-4e7b-87a5-c1721036f5dc">
|
||||||
|
|||||||
120
.idea/workspace.xml
generated
120
.idea/workspace.xml
generated
@@ -4,19 +4,8 @@
|
|||||||
<option name="autoReloadType" value="SELECTIVE" />
|
<option name="autoReloadType" value="SELECTIVE" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="7c107abe-5995-4428-8429-b146aaca8386" name="Changes" comment="feat : Ajout de la sélection des bovins étape 3 d'une réception (WIP)">
|
<list default="true" id="7c107abe-5995-4428-8429-b146aaca8386" name="Changes" comment="feat : update numéro de version">
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/dataSources.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/dataSources.xml" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/config/reference.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/reference.php" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/frontend/components/reception/reception-bovine-received.vue" beforeDir="false" afterPath="$PROJECT_DIR$/frontend/components/reception/reception-bovine-received.vue" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/frontend/components/reception/reception-form.vue" beforeDir="false" afterPath="$PROJECT_DIR$/frontend/components/reception/reception-form.vue" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/frontend/components/reception/reception-product-received.vue" beforeDir="false" afterPath="$PROJECT_DIR$/frontend/components/reception/reception-product-received.vue" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/frontend/components/ui/UiNumberInput.vue" beforeDir="false" afterPath="$PROJECT_DIR$/frontend/components/ui/UiNumberInput.vue" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/frontend/services/reception.ts" beforeDir="false" afterPath="$PROJECT_DIR$/frontend/services/reception.ts" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/Entity/Reception.php" beforeDir="false" afterPath="$PROJECT_DIR$/src/Entity/Reception.php" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/Repository/.gitignore" beforeDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/Repository/BovineTypeRepository.php" beforeDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/Repository/ReceptionBovineRepository.php" beforeDir="false" />
|
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
@@ -47,7 +36,7 @@
|
|||||||
<component name="Git.Settings">
|
<component name="Git.Settings">
|
||||||
<option name="RECENT_BRANCH_BY_REPOSITORY">
|
<option name="RECENT_BRANCH_BY_REPOSITORY">
|
||||||
<map>
|
<map>
|
||||||
<entry key="$PROJECT_DIR$" value="fix/makefile" />
|
<entry key="$PROJECT_DIR$" value="feat/256-reception-etape-3-bovin" />
|
||||||
</map>
|
</map>
|
||||||
</option>
|
</option>
|
||||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||||
@@ -235,7 +224,7 @@
|
|||||||
"RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager.252": "true",
|
"RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager.252": "true",
|
||||||
"RunOnceActivity.git.unshallow": "true",
|
"RunOnceActivity.git.unshallow": "true",
|
||||||
"RunOnceActivity.typescript.service.memoryLimit.init": "true",
|
"RunOnceActivity.typescript.service.memoryLimit.init": "true",
|
||||||
"git-widget-placeholder": "feat/256-reception-etape-3-bovin",
|
"git-widget-placeholder": "develop",
|
||||||
"last_opened_file_path": "/home/sroy/Documents/test/Ferme",
|
"last_opened_file_path": "/home/sroy/Documents/test/Ferme",
|
||||||
"node.js.detected.package.eslint": "true",
|
"node.js.detected.package.eslint": "true",
|
||||||
"node.js.detected.package.tslint": "true",
|
"node.js.detected.package.tslint": "true",
|
||||||
@@ -305,46 +294,6 @@
|
|||||||
<workItem from="1770195959162" duration="18915000" />
|
<workItem from="1770195959162" duration="18915000" />
|
||||||
<workItem from="1770274844804" duration="3940000" />
|
<workItem from="1770274844804" duration="3940000" />
|
||||||
</task>
|
</task>
|
||||||
<task id="LOCAL-00001" summary="feat : Ajout de pinia, création de la table weight et reception mise en place du système de step pour les receptions (WIP)">
|
|
||||||
<option name="closed" value="true" />
|
|
||||||
<created>1768237763998</created>
|
|
||||||
<option name="number" value="00001" />
|
|
||||||
<option name="presentableId" value="LOCAL-00001" />
|
|
||||||
<option name="project" value="LOCAL" />
|
|
||||||
<updated>1768237763998</updated>
|
|
||||||
</task>
|
|
||||||
<task id="LOCAL-00002" summary="feat : Ajout de zod, création d'un composant de chargement loading-dots.vue et finalisation du flow d'une reception">
|
|
||||||
<option name="closed" value="true" />
|
|
||||||
<created>1768316052474</created>
|
|
||||||
<option name="number" value="00002" />
|
|
||||||
<option name="presentableId" value="LOCAL-00002" />
|
|
||||||
<option name="project" value="LOCAL" />
|
|
||||||
<updated>1768316052474</updated>
|
|
||||||
</task>
|
|
||||||
<task id="LOCAL-00003" summary="feat : Ajout d'un composable pour la pesée qui sera réutilisable pour l'expédition, ajout de contrainte sur les entity de reception et weight pour plus de robustesse et correction de la class active des liens dans la nav">
|
|
||||||
<option name="closed" value="true" />
|
|
||||||
<created>1768316835575</created>
|
|
||||||
<option name="number" value="00003" />
|
|
||||||
<option name="presentableId" value="LOCAL-00003" />
|
|
||||||
<option name="project" value="LOCAL" />
|
|
||||||
<updated>1768316835575</updated>
|
|
||||||
</task>
|
|
||||||
<task id="LOCAL-00004" summary="feat : update du fichier AGENTS.md">
|
|
||||||
<option name="closed" value="true" />
|
|
||||||
<created>1768316965511</created>
|
|
||||||
<option name="number" value="00004" />
|
|
||||||
<option name="presentableId" value="LOCAL-00004" />
|
|
||||||
<option name="project" value="LOCAL" />
|
|
||||||
<updated>1768316965511</updated>
|
|
||||||
</task>
|
|
||||||
<task id="LOCAL-00005" summary="feat : update du fichier README.md et CHANGELOG.md">
|
|
||||||
<option name="closed" value="true" />
|
|
||||||
<created>1768317786187</created>
|
|
||||||
<option name="number" value="00005" />
|
|
||||||
<option name="presentableId" value="LOCAL-00005" />
|
|
||||||
<option name="project" value="LOCAL" />
|
|
||||||
<updated>1768317786187</updated>
|
|
||||||
</task>
|
|
||||||
<task id="LOCAL-00006" summary="fix : correction du useApi pour qu'il n'y ait plus de retry lors d'une erreur 500 par exemple">
|
<task id="LOCAL-00006" summary="fix : correction du useApi pour qu'il n'y ait plus de retry lors d'une erreur 500 par exemple">
|
||||||
<option name="closed" value="true" />
|
<option name="closed" value="true" />
|
||||||
<created>1768318875533</created>
|
<created>1768318875533</created>
|
||||||
@@ -697,7 +646,47 @@
|
|||||||
<option name="project" value="LOCAL" />
|
<option name="project" value="LOCAL" />
|
||||||
<updated>1770217875423</updated>
|
<updated>1770217875423</updated>
|
||||||
</task>
|
</task>
|
||||||
<option name="localTasksCounter" value="50" />
|
<task id="LOCAL-00050" summary="feat : Ajout de la sélection des bovins étape 3 d'une réception (WIP)">
|
||||||
|
<option name="closed" value="true" />
|
||||||
|
<created>1770283622425</created>
|
||||||
|
<option name="number" value="00050" />
|
||||||
|
<option name="presentableId" value="LOCAL-00050" />
|
||||||
|
<option name="project" value="LOCAL" />
|
||||||
|
<updated>1770283622425</updated>
|
||||||
|
</task>
|
||||||
|
<task id="LOCAL-00051" summary="feat : ajout du responsive sur la navbar et la page d'accueil">
|
||||||
|
<option name="closed" value="true" />
|
||||||
|
<created>1770308927948</created>
|
||||||
|
<option name="number" value="00051" />
|
||||||
|
<option name="presentableId" value="LOCAL-00051" />
|
||||||
|
<option name="project" value="LOCAL" />
|
||||||
|
<updated>1770308927948</updated>
|
||||||
|
</task>
|
||||||
|
<task id="LOCAL-00052" summary="fix : logo centré en mod mobile">
|
||||||
|
<option name="closed" value="true" />
|
||||||
|
<created>1770310504254</created>
|
||||||
|
<option name="number" value="00052" />
|
||||||
|
<option name="presentableId" value="LOCAL-00052" />
|
||||||
|
<option name="project" value="LOCAL" />
|
||||||
|
<updated>1770310504254</updated>
|
||||||
|
</task>
|
||||||
|
<task id="LOCAL-00053" summary="feat : ajout d'un numéro de version automatique via la CI">
|
||||||
|
<option name="closed" value="true" />
|
||||||
|
<created>1770369945257</created>
|
||||||
|
<option name="number" value="00053" />
|
||||||
|
<option name="presentableId" value="LOCAL-00053" />
|
||||||
|
<option name="project" value="LOCAL" />
|
||||||
|
<updated>1770369945257</updated>
|
||||||
|
</task>
|
||||||
|
<task id="LOCAL-00054" summary="feat : update numéro de version">
|
||||||
|
<option name="closed" value="true" />
|
||||||
|
<created>1770370216428</created>
|
||||||
|
<option name="number" value="00054" />
|
||||||
|
<option name="presentableId" value="LOCAL-00054" />
|
||||||
|
<option name="project" value="LOCAL" />
|
||||||
|
<updated>1770370216428</updated>
|
||||||
|
</task>
|
||||||
|
<option name="localTasksCounter" value="55" />
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
<component name="TypeScriptGeneratedFilesManager">
|
<component name="TypeScriptGeneratedFilesManager">
|
||||||
@@ -747,10 +736,6 @@
|
|||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
<component name="VcsManagerConfiguration">
|
<component name="VcsManagerConfiguration">
|
||||||
<MESSAGE value="fix : correction du path URI pour la création d'un poids dans une réception" />
|
|
||||||
<MESSAGE value="feat : Ajout du bundle Monolog pour la gestion des logs" />
|
|
||||||
<MESSAGE value="fix : affiche plus détail dans les logs en recette/prod" />
|
|
||||||
<MESSAGE value="fix : modification du script de déploiement pour corriger le problème d'écriture des logs de prod" />
|
|
||||||
<MESSAGE value="fix : doc de déploiement" />
|
<MESSAGE value="fix : doc de déploiement" />
|
||||||
<MESSAGE value="fix : doc et script de déploiement" />
|
<MESSAGE value="fix : doc et script de déploiement" />
|
||||||
<MESSAGE value="fix : gitea workflow" />
|
<MESSAGE value="fix : gitea workflow" />
|
||||||
@@ -772,18 +757,11 @@
|
|||||||
<MESSAGE value="feat : ajout de colonne pour les Supplier, Address. Modification du numéro de réception et ajout de fixtures" />
|
<MESSAGE value="feat : ajout de colonne pour les Supplier, Address. Modification du numéro de réception et ajout de fixtures" />
|
||||||
<MESSAGE value="feat : mise à jour du bon de réception" />
|
<MESSAGE value="feat : mise à jour du bon de réception" />
|
||||||
<MESSAGE value="feat : Ajout de la sélection des bovins étape 3 d'une réception (WIP)" />
|
<MESSAGE value="feat : Ajout de la sélection des bovins étape 3 d'une réception (WIP)" />
|
||||||
<option name="LAST_COMMIT_MESSAGE" value="feat : Ajout de la sélection des bovins étape 3 d'une réception (WIP)" />
|
<MESSAGE value="feat : ajout du responsive sur la navbar et la page d'accueil" />
|
||||||
</component>
|
<MESSAGE value="fix : logo centré en mod mobile" />
|
||||||
<component name="XDebuggerManager">
|
<MESSAGE value="feat : ajout d'un numéro de version automatique via la CI" />
|
||||||
<breakpoint-manager>
|
<MESSAGE value="feat : update numéro de version" />
|
||||||
<breakpoints>
|
<option name="LAST_COMMIT_MESSAGE" value="feat : update numéro de version" />
|
||||||
<line-breakpoint enabled="true" type="php">
|
|
||||||
<url>file://$PROJECT_DIR$/src/Entity/ReceptionPelletBuilding.php</url>
|
|
||||||
<line>6</line>
|
|
||||||
<option name="timeStamp" value="3" />
|
|
||||||
</line-breakpoint>
|
|
||||||
</breakpoints>
|
|
||||||
</breakpoint-manager>
|
|
||||||
</component>
|
</component>
|
||||||
<component name="XSLT-Support.FileAssociations.UIState">
|
<component name="XSLT-Support.FileAssociations.UIState">
|
||||||
<expand />
|
<expand />
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ Ajouter dans le fichier .env du frontend
|
|||||||
* Ajout du bundle malio/ednotif-bundle
|
* Ajout du bundle malio/ednotif-bundle
|
||||||
* Ajout de composant UI
|
* Ajout de composant UI
|
||||||
* Finalisation de la partie réception de marchandise
|
* Finalisation de la partie réception de marchandise
|
||||||
|
* [#267] Lister les réceptions en attente
|
||||||
|
* [#268] Lister les réceptions terminées
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,9 @@
|
|||||||
# https://symfony.com/doc/current/best_practices.html#use-parameters-for-application-configuration
|
# https://symfony.com/doc/current/best_practices.html#use-parameters-for-application-configuration
|
||||||
parameters:
|
parameters:
|
||||||
|
|
||||||
|
imports:
|
||||||
|
- { resource: version.yaml }
|
||||||
|
|
||||||
services:
|
services:
|
||||||
# default configuration for services in *this* file
|
# default configuration for services in *this* file
|
||||||
_defaults:
|
_defaults:
|
||||||
|
|||||||
2
config/version.yaml
Normal file
2
config/version.yaml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
parameters:
|
||||||
|
app.version: '0.0.30'
|
||||||
30
frontend/components/card-link.vue
Normal file
30
frontend/components/card-link.vue
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<NuxtLink :to="link">
|
||||||
|
<div class="w-[324px] h-[228px] border border-black rounded-md p-6 flex flex-col justify-between">
|
||||||
|
<div class="flex justify-between">
|
||||||
|
<div class="rounded-full w-[80px] h-[80px] bg-neutral-400 flex justify-center items-center">
|
||||||
|
<Icon :name="iconName" style="color: black" size="44" />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<Icon name="mdi:plus" style="color: black" size="44" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="uppercase font-bold">
|
||||||
|
<p class="text-3xl"> {{ label }} </p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</NuxtLink>
|
||||||
|
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
const props = defineProps<{
|
||||||
|
link: string
|
||||||
|
iconName: string
|
||||||
|
label: string
|
||||||
|
}>()
|
||||||
|
</script>
|
||||||
|
|
||||||
61
frontend/layouts/admin.vue
Normal file
61
frontend/layouts/admin.vue
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
<template>
|
||||||
|
<div class="min-h-screen text-neutral-900 grid grid-rows-[85px,1fr]">
|
||||||
|
<!-- HEADER -->
|
||||||
|
<header class="bg-primary-500 z-50 h-[85px]">
|
||||||
|
<div class="h-full w-full px-6 grid grid-cols-[auto,1fr,auto] items-center gap-8">
|
||||||
|
<NuxtLink to="/" class="grid place-items-center">
|
||||||
|
<span class="grid place-items-center bg-white text-xl font-bold uppercase text-primary-500 p-4">
|
||||||
|
LOGO
|
||||||
|
</span>
|
||||||
|
</NuxtLink>
|
||||||
|
|
||||||
|
<nav class="text-2xl font-bold uppercase text-white"></nav>
|
||||||
|
|
||||||
|
<NuxtLink
|
||||||
|
to="/"
|
||||||
|
class="text-xl font-bold uppercase text-white transition hover:opacity-80 justify-self-end"
|
||||||
|
>
|
||||||
|
Quitter le panel admin
|
||||||
|
</NuxtLink>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<div class="grid grid-cols-[16rem,1fr] h-[calc(100vh-85px)] min-h-0">
|
||||||
|
<aside class="bg-primary-500 text-white min-h-0 grid grid-rows-[auto,1fr,auto]">
|
||||||
|
<div class="p-4 font-semibold">Tableau de bord</div>
|
||||||
|
|
||||||
|
<div class="overflow-y-auto min-h-0 p-4 space-y-3">
|
||||||
|
<!-- Liste des liens à ajouter ci-dessous -->
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="p-4">
|
||||||
|
<button
|
||||||
|
@click="handleLogout"
|
||||||
|
class="w-full bg-red-600 hover:bg-red-700 py-2 rounded font-bold"
|
||||||
|
>
|
||||||
|
Déconnexion
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</aside>
|
||||||
|
|
||||||
|
<main class="min-h-0 overflow-auto px-12 py-12 ">
|
||||||
|
<div class="w-full ">
|
||||||
|
<slot />
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
|
||||||
|
const handleLogout = async () => {
|
||||||
|
try {
|
||||||
|
await auth.logout()
|
||||||
|
} finally {
|
||||||
|
await navigateTo('/login')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -1,15 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="min-h-screen bg-white text-neutral-900">
|
<div class="min-h-screen bg-white text-neutral-900">
|
||||||
<header class="w-full border-b border-neutral-200 bg-primary-500">
|
<header class="w-full border-b border-neutral-200 bg-primary-500">
|
||||||
<div class="flex w-full items-center px-6 py-4">
|
<div class="flex w-full items-center justify-center px-6 py-4">
|
||||||
<NuxtLink to="/" class="flex items-center gap-3">
|
<button
|
||||||
<span
|
type="button"
|
||||||
class="flex items-center justify-center bg-white text-xl font-bold uppercase text-primary-500 p-4"
|
class="inline-flex items-center justify-center text-3xl text-white md:hidden"
|
||||||
>
|
aria-label="Ouvrir le menu"
|
||||||
LOGO
|
@click="toggleMenu"
|
||||||
</span>
|
>
|
||||||
</NuxtLink>
|
<span aria-hidden="true" class="flex items-center"><Icon name="mdi:menu" size="44"/></span>
|
||||||
<nav class="mx-8 flex flex-1 gap-8 text-2xl font-bold uppercase text-white">
|
</button>
|
||||||
|
<nav class="ml-4 hidden items-center gap-8 text-2xl font-bold uppercase text-white md:flex">
|
||||||
<NuxtLink to="/" custom v-slot="{ href, navigate, isExactActive }">
|
<NuxtLink to="/" custom v-slot="{ href, navigate, isExactActive }">
|
||||||
<a
|
<a
|
||||||
:href="href"
|
:href="href"
|
||||||
@@ -19,26 +20,84 @@
|
|||||||
Accueil
|
Accueil
|
||||||
</a>
|
</a>
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
<NuxtLink to="/reception" custom v-slot="{ href, navigate, isActive }">
|
<NuxtLink to="/admin/dashboard" custom v-slot="{ href, navigate, isActive }">
|
||||||
<a
|
<a
|
||||||
:href="href"
|
:href="href"
|
||||||
@click="navigate"
|
@click="navigate"
|
||||||
:class="isReceptionActive ? 'opacity-100' : 'opacity-50'"
|
|
||||||
>
|
>
|
||||||
Reception
|
Admin
|
||||||
</a>
|
</a>
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
</nav>
|
</nav>
|
||||||
|
<NuxtLink to="/" class="flex flex-1 items-center justify-center gap-3">
|
||||||
|
<span
|
||||||
|
class="flex items-center justify-center bg-white text-xl font-bold uppercase text-primary-500 p-4"
|
||||||
|
>
|
||||||
|
LOGO
|
||||||
|
</span>
|
||||||
|
</NuxtLink>
|
||||||
|
<div class="w-[44px] md:hidden"></div>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
class="ml-auto text-xl font-bold uppercase text-white transition hover:opacity-80"
|
class="ml-auto hidden text-xl font-bold uppercase text-white transition hover:opacity-80 md:inline-flex"
|
||||||
@click="handleLogout"
|
@click="handleLogout"
|
||||||
>
|
>
|
||||||
Déconnexion
|
Déconnexion
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
<transition
|
||||||
|
enter-active-class="transition duration-200 ease-out"
|
||||||
|
enter-from-class="opacity-0"
|
||||||
|
enter-to-class="opacity-100"
|
||||||
|
leave-active-class="transition duration-150 ease-in"
|
||||||
|
leave-from-class="opacity-100"
|
||||||
|
leave-to-class="opacity-0"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
v-if="isMenuOpen"
|
||||||
|
class="fixed inset-0 z-40 bg-black/40 md:hidden"
|
||||||
|
@click="closeMenu"
|
||||||
|
/>
|
||||||
|
</transition>
|
||||||
|
<transition
|
||||||
|
enter-active-class="transition duration-200 ease-out"
|
||||||
|
enter-from-class="-translate-x-full"
|
||||||
|
enter-to-class="translate-x-0"
|
||||||
|
leave-active-class="transition duration-150 ease-in"
|
||||||
|
leave-from-class="translate-x-0"
|
||||||
|
leave-to-class="-translate-x-full"
|
||||||
|
>
|
||||||
|
<aside
|
||||||
|
v-if="isMenuOpen"
|
||||||
|
class="fixed left-0 top-0 z-50 h-full w-full bg-primary-600 px-6 pb-8 pt-6 text-white shadow-xl md:hidden"
|
||||||
|
role="dialog"
|
||||||
|
aria-modal="true"
|
||||||
|
>
|
||||||
|
<div class="flex items-center justify-between">
|
||||||
|
<span class="text-2xl font-bold uppercase">Menu</span>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="text-2xl"
|
||||||
|
aria-label="Fermer le menu"
|
||||||
|
@click="closeMenu"
|
||||||
|
>
|
||||||
|
<Icon name="mdi:close" size="44"/>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<nav class="mt-8 flex flex-col gap-6 text-xl font-bold uppercase">
|
||||||
|
<NuxtLink to="/" class="opacity-100" @click="closeMenu">Accueil</NuxtLink>
|
||||||
|
</nav>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="mt-5 text-xl font-bold uppercase"
|
||||||
|
@click="handleLogout"
|
||||||
|
>
|
||||||
|
Déconnexion
|
||||||
|
</button>
|
||||||
|
</aside>
|
||||||
|
</transition>
|
||||||
</header>
|
</header>
|
||||||
<main class="mx-auto w-full max-w-[1280px] px-6 pt-[85px] pb-0">
|
<main class="mx-auto w-full max-w-[1280px] pb-0">
|
||||||
<slot/>
|
<slot/>
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
@@ -49,12 +108,21 @@ import { useAuthStore } from '~/stores/auth'
|
|||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const auth = useAuthStore()
|
const auth = useAuthStore()
|
||||||
const isReceptionActive = computed(() => route.path.startsWith('/reception'))
|
const isMenuOpen = ref(false)
|
||||||
|
|
||||||
|
const closeMenu = () => {
|
||||||
|
isMenuOpen.value = false
|
||||||
|
}
|
||||||
|
|
||||||
|
const toggleMenu = () => {
|
||||||
|
isMenuOpen.value = !isMenuOpen.value
|
||||||
|
}
|
||||||
|
|
||||||
const handleLogout = async () => {
|
const handleLogout = async () => {
|
||||||
try {
|
try {
|
||||||
await auth.logout()
|
await auth.logout()
|
||||||
} finally {
|
} finally {
|
||||||
|
closeMenu()
|
||||||
await navigateTo('/login')
|
await navigateTo('/login')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,8 @@ export default defineNuxtConfig({
|
|||||||
'@nuxtjs/tailwindcss',
|
'@nuxtjs/tailwindcss',
|
||||||
'@pinia/nuxt',
|
'@pinia/nuxt',
|
||||||
'nuxt-toast',
|
'nuxt-toast',
|
||||||
'@nuxtjs/i18n'
|
'@nuxtjs/i18n',
|
||||||
|
'@nuxt/icon'
|
||||||
],
|
],
|
||||||
css: ['~/assets/css/main.css', '~/assets/css/toast.css'],
|
css: ['~/assets/css/main.css', '~/assets/css/toast.css'],
|
||||||
runtimeConfig: {
|
runtimeConfig: {
|
||||||
|
|||||||
77
frontend/package-lock.json
generated
77
frontend/package-lock.json
generated
@@ -7,6 +7,7 @@
|
|||||||
"name": "frontend",
|
"name": "frontend",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@nuxt/icon": "^2.2.1",
|
||||||
"@nuxtjs/i18n": "^10.2.1",
|
"@nuxtjs/i18n": "^10.2.1",
|
||||||
"@pinia/nuxt": "^0.11.3",
|
"@pinia/nuxt": "^0.11.3",
|
||||||
"izitoast": "^1.4.0",
|
"izitoast": "^1.4.0",
|
||||||
@@ -35,6 +36,19 @@
|
|||||||
"url": "https://github.com/sponsors/sindresorhus"
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@antfu/install-pkg": {
|
||||||
|
"version": "1.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@antfu/install-pkg/-/install-pkg-1.1.0.tgz",
|
||||||
|
"integrity": "sha512-MGQsmw10ZyI+EJo45CdSER4zEb+p31LpDAFp2Z3gkSd1yqVZGi0Ebx++YTEMonJy4oChEMLsxZ64j8FH6sSqtQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"package-manager-detector": "^1.3.0",
|
||||||
|
"tinyexec": "^1.0.1"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/antfu"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@babel/code-frame": {
|
"node_modules/@babel/code-frame": {
|
||||||
"version": "7.27.1",
|
"version": "7.27.1",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz",
|
||||||
@@ -1248,6 +1262,47 @@
|
|||||||
"url": "https://github.com/sponsors/nzakas"
|
"url": "https://github.com/sponsors/nzakas"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@iconify/collections": {
|
||||||
|
"version": "1.0.646",
|
||||||
|
"resolved": "https://registry.npmjs.org/@iconify/collections/-/collections-1.0.646.tgz",
|
||||||
|
"integrity": "sha512-zA5Gr1MJm1SI0TjOUl7wu4kvBWXQ6Uh8ALEtqQ5ucXyUxP2M8m2bk2hfVtGykSdMlDB+Xs2AHbJ9pQqayz9WGQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@iconify/types": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@iconify/types": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@iconify/types/-/types-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/@iconify/utils": {
|
||||||
|
"version": "3.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@iconify/utils/-/utils-3.1.0.tgz",
|
||||||
|
"integrity": "sha512-Zlzem1ZXhI1iHeeERabLNzBHdOa4VhQbqAcOQaMKuTuyZCpwKbC2R4Dd0Zo3g9EAc+Y4fiarO8HIHRAth7+skw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@antfu/install-pkg": "^1.1.0",
|
||||||
|
"@iconify/types": "^2.0.0",
|
||||||
|
"mlly": "^1.8.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@iconify/vue": {
|
||||||
|
"version": "5.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@iconify/vue/-/vue-5.0.0.tgz",
|
||||||
|
"integrity": "sha512-C+KuEWIF5nSBrobFJhT//JS87OZ++QDORB6f2q2Wm6fl2mueSTpFBeBsveK0KW9hWiZ4mNiPjsh6Zs4jjdROSg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@iconify/types": "^2.0.0"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/cyberalien"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"vue": ">=3"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@intlify/bundle-utils": {
|
"node_modules/@intlify/bundle-utils": {
|
||||||
"version": "11.0.3",
|
"version": "11.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/@intlify/bundle-utils/-/bundle-utils-11.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/@intlify/bundle-utils/-/bundle-utils-11.0.3.tgz",
|
||||||
@@ -2268,6 +2323,28 @@
|
|||||||
"devtools-wizard": "cli.mjs"
|
"devtools-wizard": "cli.mjs"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@nuxt/icon": {
|
||||||
|
"version": "2.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@nuxt/icon/-/icon-2.2.1.tgz",
|
||||||
|
"integrity": "sha512-GI840yYGuvHI0BGDQ63d6rAxGzG96jQcWrnaWIQKlyQo/7sx9PjXkSHckXUXyX1MCr9zY6U25Td6OatfY6Hklw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@iconify/collections": "^1.0.641",
|
||||||
|
"@iconify/types": "^2.0.0",
|
||||||
|
"@iconify/utils": "^3.1.0",
|
||||||
|
"@iconify/vue": "^5.0.0",
|
||||||
|
"@nuxt/devtools-kit": "^3.1.1",
|
||||||
|
"@nuxt/kit": "^4.2.2",
|
||||||
|
"consola": "^3.4.2",
|
||||||
|
"local-pkg": "^1.1.2",
|
||||||
|
"mlly": "^1.8.0",
|
||||||
|
"ohash": "^2.0.11",
|
||||||
|
"pathe": "^2.0.3",
|
||||||
|
"picomatch": "^4.0.3",
|
||||||
|
"std-env": "^3.10.0",
|
||||||
|
"tinyglobby": "^0.2.15"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@nuxt/kit": {
|
"node_modules/@nuxt/kit": {
|
||||||
"version": "4.2.2",
|
"version": "4.2.2",
|
||||||
"resolved": "https://registry.npmjs.org/@nuxt/kit/-/kit-4.2.2.tgz",
|
"resolved": "https://registry.npmjs.org/@nuxt/kit/-/kit-4.2.2.tgz",
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
"build:dist": "nuxt generate && rm -rf dist && cp -R .output/public dist"
|
"build:dist": "nuxt generate && rm -rf dist && cp -R .output/public dist"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@nuxt/icon": "^2.2.1",
|
||||||
"@nuxtjs/i18n": "^10.2.1",
|
"@nuxtjs/i18n": "^10.2.1",
|
||||||
"@pinia/nuxt": "^0.11.3",
|
"@pinia/nuxt": "^0.11.3",
|
||||||
"izitoast": "^1.4.0",
|
"izitoast": "^1.4.0",
|
||||||
|
|||||||
13
frontend/pages/admin/dashboard.vue
Normal file
13
frontend/pages/admin/dashboard.vue
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
definePageMeta({
|
||||||
|
layout: 'admin'
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<h1>test</h1>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -1,55 +1,15 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div class="flex flex-wrap justify-center mt-8 gap-8 mb-8 md:mb-0">
|
||||||
<h1 class="text-3xl font-bold">Liste des receptions</h1>
|
<card-link label="NOUVELLE RÉCEPTION" link="/reception" iconName="mdi:truck-outline" />
|
||||||
<div class="mt-6 border border-slate-200">
|
<card-link label="NOUVELLE EXPÉDITION" link="/" iconName="mdi:truck-fast-outline" />
|
||||||
<div class="grid grid-cols-6 gap-4 bg-slate-100 px-4 py-3 text-sm font-semibold uppercase tracking-wide">
|
<card-link label="PLAN DE SITE" link="/" iconName="mdi:warehouse" />
|
||||||
<div>ID</div>
|
<card-link label="RÉCEPTIONS EN ATTENTE" link="/reception/waiting-reception" iconName="mdi:truck-remove-outline" />
|
||||||
<div>Immatriculation</div>
|
<card-link label="EXPÉDITIONS EN ATTENTE" link="/" iconName="mdi:truck-cargo-container" />
|
||||||
<div>Pesée plein</div>
|
<card-link label="CASES" link="/" iconName="mdi:cube-outline" />
|
||||||
<div>Pesée vide</div>
|
<card-link label="RÉCEPTIONS FINIES" link="/reception/finish-reception" iconName="mdi:truck-check-outline" />
|
||||||
<div>Etape</div>
|
<card-link label="EXPÉDITIONS FINIES" link="/" iconName="mdi:truck-delivery-outline" />
|
||||||
<div>Date</div>
|
<card-link label="PASSEPORT DU BOVIN" link="/" iconName="mdi:cow" />
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
v-for="reception in receptionList"
|
|
||||||
:key="reception.id"
|
|
||||||
class="grid grid-cols-6 gap-4 px-4 py-3 text-sm hover:bg-slate-50 cursor-pointer border-t border-slate-200"
|
|
||||||
role="button"
|
|
||||||
tabindex="0"
|
|
||||||
@click="goToReception(reception.id)"
|
|
||||||
@keydown.enter="goToReception(reception.id)"
|
|
||||||
>
|
|
||||||
<div>{{ reception.id }}</div>
|
|
||||||
<div>{{ reception.licensePlate }}</div>
|
|
||||||
<div>{{ formatWeighing(reception, 'gross') }}</div>
|
|
||||||
<div>{{ formatWeighing(reception, 'tare') }}</div>
|
|
||||||
<div>{{ reception.currentStep }}</div>
|
|
||||||
<div>{{ reception.receptionDate }}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
|
||||||
import type {ReceptionData} from "~/services/dto/reception-data";
|
|
||||||
import {getReceptionList} from "~/services/reception";
|
|
||||||
|
|
||||||
const receptionList = ref<ReceptionData[]>()
|
|
||||||
const router = useRouter()
|
|
||||||
|
|
||||||
const goToReception = (id: number) => {
|
|
||||||
router.push(`/reception/${id}`)
|
|
||||||
}
|
|
||||||
|
|
||||||
const formatWeighing = (reception: ReceptionData, type: 'gross' | 'tare') => {
|
|
||||||
const entry = reception.weights?.find((weight) => weight.type === type)
|
|
||||||
if (!entry || entry.weight == null || entry.dsd == null) {
|
|
||||||
return '—'
|
|
||||||
}
|
|
||||||
return `${entry.weight} kg / ${entry.dsd} dsd`
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(async () => {
|
|
||||||
receptionList.value = await getReceptionList()
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
|
|||||||
53
frontend/pages/reception/finish-reception.vue
Normal file
53
frontend/pages/reception/finish-reception.vue
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
<template>
|
||||||
|
<div class="flex items-center justify-start gap-10">
|
||||||
|
<Icon @click="router.push('/')" name="gg:arrow-left-o" style="color: black" size="44" />
|
||||||
|
<h1 class="text-3xl font-bold uppercase">listes des réceptions finie</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="ps-20 " >
|
||||||
|
<div class="mt-6 border border-slate-200 mb-16 ">
|
||||||
|
<div class="grid grid-cols-6 gap-4 bg-slate-100 px-4 py-3 text-sm font-semibold uppercase tracking-wide">
|
||||||
|
<div>Numéro</div>
|
||||||
|
<div>Date</div>
|
||||||
|
<div>Fournisseur</div>
|
||||||
|
<div>Adresse</div>
|
||||||
|
<div>Type réception</div>
|
||||||
|
<div>Poids</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
v-for="reception in receptionList"
|
||||||
|
:key="reception.id"
|
||||||
|
class="grid grid-cols-6 gap-4 px-4 py-3 text-sm hover:bg-slate-50 cursor-pointer border-t border-slate-200"
|
||||||
|
role="button"
|
||||||
|
tabindex="0"
|
||||||
|
>
|
||||||
|
<div>{{ reception.identificationNumber}}</div>
|
||||||
|
<div>{{ reception.receptionDate}}</div>
|
||||||
|
<div>{{ reception.supplier?.name }}</div>
|
||||||
|
<div>{{ reception.address?.fullAddress }}</div>
|
||||||
|
<div>{{ reception.receptionType?.label }}</div>
|
||||||
|
<div>{{ formatWeighing(reception, 'gross') }} | {{ formatWeighing(reception, 'tare') }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import type {ReceptionData} from "~/services/dto/reception-data";
|
||||||
|
import {getReceptionList} from "~/services/reception";
|
||||||
|
|
||||||
|
const receptionList = ref<ReceptionData[]>()
|
||||||
|
const router = useRouter()
|
||||||
|
|
||||||
|
const formatWeighing = (reception: ReceptionData, type: 'gross' | 'tare') => {
|
||||||
|
const entry = reception.weights?.find((weight) => weight.type === type)
|
||||||
|
if (!entry || entry.weight == null || entry.dsd == null) {
|
||||||
|
return '—'
|
||||||
|
}
|
||||||
|
return `${entry.weight} kg`
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
receptionList.value = await getReceptionList(true)
|
||||||
|
})
|
||||||
|
</script>
|
||||||
51
frontend/pages/reception/waiting-reception.vue
Normal file
51
frontend/pages/reception/waiting-reception.vue
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
<template>
|
||||||
|
<div class="flex items-center justify-between ">
|
||||||
|
<div class="flex items-center gap-10">
|
||||||
|
<Icon @click="router.push('/')" name="gg:arrow-left-o" style="color: black" size="44" />
|
||||||
|
<h1 class="text-3xl font-bold uppercase">listes des réceptions en attente</h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="ps-20 " >
|
||||||
|
<div class="mt-6 border border-slate-200 mb-16 ">
|
||||||
|
<div class="grid grid-cols-5 gap-4 bg-slate-100 px-4 py-3 text-sm font-semibold uppercase tracking-wide">
|
||||||
|
<div>Fournisseur</div>
|
||||||
|
<div>Adresse</div>
|
||||||
|
<div>Type réception</div>
|
||||||
|
<div>Transporteur</div>
|
||||||
|
<div>Immatriculation</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
v-for="reception in receptionList"
|
||||||
|
:key="reception.id"
|
||||||
|
class="grid grid-cols-5 gap-4 px-4 py-3 text-sm hover:bg-slate-50 cursor-pointer border-t border-slate-200"
|
||||||
|
role="button"
|
||||||
|
tabindex="0"
|
||||||
|
@click="goToReception(reception.id)"
|
||||||
|
@keydown.enter="goToReception(reception.id)"
|
||||||
|
>
|
||||||
|
<div>{{ reception.supplier?.name }}</div>
|
||||||
|
<div>{{ reception.address?.fullAddress }}</div>
|
||||||
|
<div>{{ reception.receptionType?.label }}</div>
|
||||||
|
<div>{{ reception.carrier?.name }}</div>
|
||||||
|
<div>{{ reception.licensePlate }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import type {ReceptionData} from "~/services/dto/reception-data";
|
||||||
|
import {getReceptionList} from "~/services/reception";
|
||||||
|
|
||||||
|
const receptionList = ref<ReceptionData[]>()
|
||||||
|
const router = useRouter()
|
||||||
|
|
||||||
|
const goToReception = (id: number) => {
|
||||||
|
router.push(`/reception/${id}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
receptionList.value = await getReceptionList(false)
|
||||||
|
})
|
||||||
|
</script>
|
||||||
@@ -10,6 +10,7 @@ export async function getReceptionList(isValid: boolean|null = null) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export async function getReception(id: number) {
|
export async function getReception(id: number) {
|
||||||
const api = useApi()
|
const api = useApi()
|
||||||
return api.get<ReceptionData>(`receptions/${id}`, {}, {
|
return api.get<ReceptionData>(`receptions/${id}`, {}, {
|
||||||
|
|||||||
26
src/Dto/AppVersion.php
Normal file
26
src/Dto/AppVersion.php
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Dto;
|
||||||
|
|
||||||
|
use ApiPlatform\Metadata\ApiResource;
|
||||||
|
use ApiPlatform\Metadata\Get;
|
||||||
|
use App\State\AppVersionProvider;
|
||||||
|
use Symfony\Component\Serializer\Attribute\Groups;
|
||||||
|
|
||||||
|
#[ApiResource(
|
||||||
|
operations: [
|
||||||
|
new Get(
|
||||||
|
uriTemplate: '/version',
|
||||||
|
normalizationContext: ['groups' => ['version:read']],
|
||||||
|
provider: AppVersionProvider::class,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
security: "is_granted('ROLE_USER')",
|
||||||
|
)]
|
||||||
|
final class AppVersion
|
||||||
|
{
|
||||||
|
#[Groups(['version:read'])]
|
||||||
|
public string $version = '';
|
||||||
|
}
|
||||||
26
src/State/AppVersionProvider.php
Normal file
26
src/State/AppVersionProvider.php
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\State;
|
||||||
|
|
||||||
|
use ApiPlatform\Metadata\Operation;
|
||||||
|
use ApiPlatform\State\ProviderInterface;
|
||||||
|
use App\Dto\AppVersion;
|
||||||
|
use Symfony\Component\DependencyInjection\Attribute\Autowire;
|
||||||
|
|
||||||
|
final readonly class AppVersionProvider implements ProviderInterface
|
||||||
|
{
|
||||||
|
public function __construct(
|
||||||
|
#[Autowire('%app.version%')]
|
||||||
|
private string $version,
|
||||||
|
) {}
|
||||||
|
|
||||||
|
public function provide(Operation $operation, array $uriVariables = [], array $context = []): AppVersion
|
||||||
|
{
|
||||||
|
$dto = new AppVersion();
|
||||||
|
$dto->version = $this->version;
|
||||||
|
|
||||||
|
return $dto;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user