File tree Expand file tree Collapse file tree 10 files changed +87
-79
lines changed
tests/edito/pages-editor.spec.ts-snapshots Expand file tree Collapse file tree 10 files changed +87
-79
lines changed Original file line number Diff line number Diff line change 188188 .code {
189189 @apply p-1! font-mono! bg-gray-lower! text-sm! text-gray-medium! rounded!;
190190 }
191- meter .quality-score {
192- background : none;
193- border : 1px solid var (--color-gray-default );
194- border-radius : 8px ;
195- height : 10px ;
196- vertical-align : baseline;
197- }
198- meter .quality-score ::-webkit-meter-bar {
199- height : 10px ;
200- background : whiteSmoke;
201- border-radius : 8px ;
202- }
203- meter .quality-score ::-moz-meter-bar {
204- background : whiteSmoke;
205- border-radius : 8px ;
206- }
207- meter .quality-score ::-webkit-meter-suboptimum-value {
208- background-color : var (--color-gray-low );
209- }
210- meter .quality-score : -moz-meter-sub-optimum ::-moz-meter-bar {
211- background-color : var (--color-gray-low );
212- }
213- meter .quality-score ::-webkit-meter-optimum-value {
214- background-color : # 27A658 ;
215- }
216- meter .quality-score : -moz-meter-optimum ::-moz-meter-bar {
217- background-color : # 27A658 ;
218- }
219191
220192 /* Vue Sonner Toast custom colors */
221193 [data-sonner-toast ][data-type = "success" ] {
Original file line number Diff line number Diff line change 6060 </div >
6161 </div >
6262 <div class =" mx-0 -mb-1 flex flex-wrap items-center text-sm text-gray-medium" >
63- <div class =" hidden sm:flex text-gray-medium -ml-2.5 " >
63+ <div class =" hidden sm:flex text-gray-medium" >
6464 <DatasetQualityInline :quality =" dataset.quality" />
6565 </div >
6666 <RiSubtractLine
Original file line number Diff line number Diff line change 11<template >
2- <div class =" flex items-center" >
3- <Toggletip
4- :button-props =" { class: '-ml-2 mt-px', title: t('Qualité des métadonnées') }"
5- >
6- <template #toggletip >
7- <DatasetQualityTooltipContent :quality />
8- </template >
9- </Toggletip >
10- <div class =" text-sm text-gray-plain font-bold" >
11- {{ t('Qualité des métadonnées:') }}
12- </div >
13- </div >
14- <DatasetQualityScore
15- :score =" quality.score"
16- class =" w-full"
17- />
2+ <Toggletip
3+ :styled-button =" false"
4+ button-class =" flex flex-col gap-1 rounded-sm p-1.5 -m-1.5 border-transparent -outline-offset-2 hover:bg-gray-some transition-colors w-full text-left"
5+ :button-props =" { title: t('Qualité des métadonnées') }"
6+ >
7+ <span class =" flex items-center gap-1" >
8+ <RiInformationLine
9+ class =" size-5 shrink-0"
10+ aria-hidden =" true"
11+ />
12+ <span class =" text-sm text-gray-plain font-bold" >
13+ {{ t('Qualité des métadonnées:') }}
14+ </span >
15+ </span >
16+ <DatasetQualityScore
17+ :score =" quality.score"
18+ class =" w-full"
19+ />
20+ <template #toggletip >
21+ <DatasetQualityTooltipContent :quality />
22+ </template >
23+ </Toggletip >
1824 <template v-if =" ! hideWarnings " >
1925 <ul class =" list-none pl-0" >
2026 <DatasetQualityItemWarning
5460</template >
5561
5662<script setup lang="ts">
63+ import { RiInformationLine } from ' @remixicon/vue'
5764import type { Quality } from ' ../types/datasets'
5865import DatasetQualityItemWarning from ' ./DatasetQualityItemWarning.vue'
5966import DatasetQualityScore from ' ./DatasetQualityScore.vue'
Original file line number Diff line number Diff line change 11<template >
2- <div class =" m-0 flex flex-wrap items-center text-sm text-gray-medium" >
3- <div class =" fr-grid-row fr-grid-row--middle" >
4- <Toggletip
5- :button-props =" { class: 'relative z-2 ml-0.5', title: t('Qualité des métadonnées') }"
6- >
7- <RiInformationLine class =" size-4" />
8- <template #toggletip >
9- <DatasetQualityTooltipContent :quality />
10- </template >
11- </Toggletip >
12- <p class =" my-0 mr-1 text-gray-medium text-sm" >
13- {{ t('Métadonnées :') }}
14- </p >
15- <div class =" fr-grid-row fr-grid-row--middle fr-mr-1v" >
16- <DatasetQualityScore :score =" quality.score" />
17- </div >
18- </div >
2+ <div class =" m-0 text-sm text-gray-medium" >
3+ <Toggletip
4+ :styled-button =" false"
5+ button-class =" border-transparent -outline-offset-2 inline-flex items-center justify-center hover:bg-gray-lower transition-colors"
6+ :button-props =" { class: 'relative z-2 gap-1 rounded-sm px-1 -mx-1 group/quality', title: t('Qualité des métadonnées') }"
7+ >
8+ <RiInformationLine class =" size-3.5 shrink-0" />
9+ <span class =" text-gray-medium text-sm group-hover/quality:underline" >{{ t('Métadonnées :') }}</span >
10+ <DatasetQualityScore :score =" quality.score" />
11+ <template #toggletip >
12+ <DatasetQualityTooltipContent :quality />
13+ </template >
14+ </Toggletip >
1915 </div >
2016</template >
2117
Original file line number Diff line number Diff line change 11<template >
2- <meter
3- class =" quality-score"
4- :class =" props.class"
5- min =" 0"
6- low =" 0"
7- :high =" high"
8- :max =" quality_max_score"
9- :optimum =" quality_max_score"
2+ <ProgressBar
103 :value =" score"
4+ :max =" quality_max_score"
5+ :aria-label =" score >= high ? t('Bon') : t('À améliorer')"
6+ :bar-class =" score >= high ? 'bg-success-dark' : 'bg-gray-low'"
7+ :class =" props.class"
118 >
12- <template v-if =" score >= high " >
13- {{ t('Bon') }}
14- </template >
15- <template v-else >
16- {{ t('À améliorer') }}
17- </template >({{ calculatedScore }})
18- </meter >
9+ <span class =" sr-only" >
10+ <template v-if =" score >= high " >{{ t('Bon') }}</template >
11+ <template v-else >{{ t('À améliorer') }}</template >
12+ ({{ calculatedScore }})
13+ </span >
14+ </ProgressBar >
1915</template >
2016
2117<script setup lang="ts">
2218import { computed } from ' vue'
2319import { useTranslation } from ' ../composables/useTranslation'
20+ import ProgressBar from ' ./ProgressBar.vue'
2421
2522const props = withDefaults (defineProps <{
2623 score: number
Original file line number Diff line number Diff line change 1+ <template >
2+ <div
3+ role =" meter"
4+ :aria-valuenow =" value"
5+ aria-valuemin =" 0"
6+ :aria-valuemax =" max"
7+ class =" min-w-20 h-2.5 rounded-lg border border-gray-default bg-[#f5f5f5] overflow-hidden"
8+ >
9+ <div
10+ class =" h-full rounded-lg"
11+ :class =" barClass"
12+ :style =" { width: percentage + '%' }"
13+ />
14+ <slot />
15+ </div >
16+ </template >
17+
18+ <script setup lang="ts">
19+ import { computed } from ' vue'
20+
21+ const props = withDefaults (defineProps <{
22+ value: number
23+ max? : number
24+ barClass? : string
25+ }>(), {
26+ max: 1 ,
27+ barClass: ' ' ,
28+ })
29+
30+ const percentage = computed (() => Math .min (100 , Math .max (0 , (props .value / props .max ) * 100 )))
31+ </script >
Original file line number Diff line number Diff line change 1313 />
1414 <PopoverButton
1515 v-bind =" buttonProps"
16- class =" border-transparent -outline-offset-2 inline-flex items-center justify-center hover:bg-gray-some"
17- :class =" { 'w-8 h-8 rounded-full bg-transparent': styledButton }"
16+ :class =" [
17+ buttonClass ?? 'border-transparent -outline-offset-2 inline-flex items-center justify-center hover:bg-gray-some',
18+ { 'w-8 h-8 rounded-full bg-transparent': styledButton && !buttonClass },
19+ ]"
1820 >
1921 <slot >
2022 <RiInformationLine
@@ -57,6 +59,7 @@ import ValueWatcher from './ValueWatcher.vue'
5759
5860withDefaults (defineProps <{
5961 buttonProps? : object
62+ buttonClass? : string
6063 noMargin? : boolean
6164 styledButton? : boolean
6265}>(), {
Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ import DatasetQuality from './components/DatasetQuality.vue'
4949import DatasetQualityInline from './components/DatasetQualityInline.vue'
5050import DatasetQualityItem from './components/DatasetQualityItem.vue'
5151import DatasetQualityScore from './components/DatasetQualityScore.vue'
52+ import ProgressBar from './components/ProgressBar.vue'
5253import DatasetQualityTooltipContent from './components/DatasetQualityTooltipContent.vue'
5354import ExtraAccordion from './components/ExtraAccordion.vue'
5455import LabelTag from './components/DatasetLabelTag.vue'
@@ -285,6 +286,7 @@ export {
285286 PaddedContainer ,
286287 Pagination ,
287288 Placeholder ,
289+ ProgressBar ,
288290 PostCard ,
289291 RadioGroup ,
290292 RadioInput ,
You can’t perform that action at this time.
0 commit comments