From 501eda92b8c33493dd009e2e599c0225d18c7140 Mon Sep 17 00:00:00 2001
From: Alejandro MG
Date: Mon, 16 Dec 2024 15:32:56 +0100
Subject: [PATCH] Moves the badge to the correct component
---
.../DeclarationSummary/SummaryElementItem.vue | 9 +++++++-
.../DeclarationSummary/SummaryElementList.vue | 19 +++++++++++++---
.../SummaryElementListItems.vue | 3 ++-
.../components/DeclarationSummary/index.vue | 22 ++++++++++++++++---
.../src/components/ElementStatusBadge.vue | 2 +-
frontend/src/views/InstructionPage/index.vue | 2 ++
.../views/ProducerFormPage/ElementCard.vue | 4 ----
frontend/src/views/VisaPage/index.vue | 2 ++
8 files changed, 50 insertions(+), 13 deletions(-)
diff --git a/frontend/src/components/DeclarationSummary/SummaryElementItem.vue b/frontend/src/components/DeclarationSummary/SummaryElementItem.vue
index 3ca9b99ca..71829c45f 100644
--- a/frontend/src/components/DeclarationSummary/SummaryElementItem.vue
+++ b/frontend/src/components/DeclarationSummary/SummaryElementItem.vue
@@ -10,6 +10,12 @@
+
+
@@ -38,13 +44,14 @@ import { getElementName } from "@/utils/elements"
import { useRootStore } from "@/stores/root"
import { storeToRefs } from "pinia"
import ElementCommentModal from "@/components/ElementCommentModal"
+import ElementStatusBadge from "@/components/ElementStatusBadge"
const { plantParts, units, preparations, loggedUser } = storeToRefs(useRootStore())
const isInstructor = computed(() => loggedUser.value?.globalRoles.some((x) => x.name === "InstructionRole"))
const model = defineModel()
-const props = defineProps({ objectType: { type: String } })
+const props = defineProps({ objectType: { type: String }, showElementAuthorization: { type: Boolean } })
const plantPartName = computed(() => plantParts.value?.find((x) => x.id === model.value.usedPart)?.name || "Aucune")
const unitName = computed(() => units.value?.find((x) => x.id === model.value.unit)?.name || "")
diff --git a/frontend/src/components/DeclarationSummary/SummaryElementList.vue b/frontend/src/components/DeclarationSummary/SummaryElementList.vue
index 50bc5138b..1aea1b4e2 100644
--- a/frontend/src/components/DeclarationSummary/SummaryElementList.vue
+++ b/frontend/src/components/DeclarationSummary/SummaryElementList.vue
@@ -5,13 +5,21 @@
-
+
-
+
@@ -20,5 +28,10 @@
import SummaryElementListTitle from "./SummaryElementListTitle"
import SummaryElementListItems from "./SummaryElementListItems"
-defineProps({ objectType: { type: String }, elements: { type: Array }, useAccordions: { type: Boolean } })
+defineProps({
+ objectType: { type: String },
+ elements: { type: Array },
+ useAccordions: { type: Boolean },
+ showElementAuthorization: { type: Boolean },
+})
diff --git a/frontend/src/components/DeclarationSummary/SummaryElementListItems.vue b/frontend/src/components/DeclarationSummary/SummaryElementListItems.vue
index 03f2ed746..0240f8e46 100644
--- a/frontend/src/components/DeclarationSummary/SummaryElementListItems.vue
+++ b/frontend/src/components/DeclarationSummary/SummaryElementListItems.vue
@@ -6,6 +6,7 @@
:key="`summary-${objectType}-${index}`"
v-model="elements[index]"
:objectType="objectType"
+ :showElementAuthorization="showElementAuthorization"
/>
@@ -13,5 +14,5 @@
diff --git a/frontend/src/components/DeclarationSummary/index.vue b/frontend/src/components/DeclarationSummary/index.vue
index 9f36eef65..c2fe7b6ed 100644
--- a/frontend/src/components/DeclarationSummary/index.vue
+++ b/frontend/src/components/DeclarationSummary/index.vue
@@ -27,38 +27,54 @@
-
+
-
+
Substances contenues dans la composition :
@@ -107,7 +123,7 @@ const router = useRouter()
const { units, populations, conditions, effects, galenicFormulations } = storeToRefs(useRootStore())
const payload = defineModel()
-defineProps({ readonly: Boolean, showArticle: Boolean, useAccordions: Boolean })
+defineProps({ readonly: Boolean, showArticle: Boolean, useAccordions: Boolean, showElementAuthorization: Boolean })
const unitInfo = computed(() => {
if (!payload.value.unitQuantity) return null
const unitMeasurement = units.value?.find?.((x) => x.id === payload.value.unitMeasurement)?.name || "-"
diff --git a/frontend/src/components/ElementStatusBadge.vue b/frontend/src/components/ElementStatusBadge.vue
index 3de2957e3..928a4ea93 100644
--- a/frontend/src/components/ElementStatusBadge.vue
+++ b/frontend/src/components/ElementStatusBadge.vue
@@ -1,6 +1,6 @@
-
+