Skip to content

Commit

Permalink
Merge pull request #1414 from betagouv/1413-console-warning
Browse files Browse the repository at this point in the history
Traitement du warning console : ajout d'un DsfrAccordionGroup dans SummaryElementList
  • Loading branch information
pletelli authored Dec 27, 2024
2 parents ae38f27 + 0d48595 commit 211c36a
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions frontend/src/components/DeclarationSummary/SummaryElementList.vue
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
<template>
<div v-if="elements.length">
<!-- Affichage avec les accordéons : les ingrédients sont cachés à l'intérieur -->
<DsfrAccordion v-if="useAccordions">
<template v-slot:title>
<SummaryElementListTitle :objectType="objectType" :elementCount="`${elements.length}`" />
</template>
<SummaryElementListItems
:showElementAuthorization="showElementAuthorization"
:objectType="objectType"
:elements="elements"
/>
</DsfrAccordion>

<DsfrAccordionsGroup v-if="useAccordions" v-model="activeAccordion">
<DsfrAccordion>
<template v-slot:title>
<SummaryElementListTitle :objectType="objectType" :elementCount="`${elements.length}`" />
</template>
<SummaryElementListItems
:showElementAuthorization="showElementAuthorization"
:objectType="objectType"
:elements="elements"
/>
</DsfrAccordion>
</DsfrAccordionsGroup>
<!-- Affichage sans les accordéons, tous les ingrédients sont affichés -->
<div v-else>
<SummaryElementListTitle class="mt-6 mb-3" :objectType="objectType" />
Expand All @@ -25,6 +26,7 @@
</template>

<script setup>
import { ref } from "vue"
import SummaryElementListTitle from "./SummaryElementListTitle"
import SummaryElementListItems from "./SummaryElementListItems"
Expand All @@ -34,4 +36,6 @@ defineProps({
useAccordions: { type: Boolean },
showElementAuthorization: { type: Boolean },
})
const activeAccordion = ref()
</script>

0 comments on commit 211c36a

Please sign in to comment.