Skip to content

Commit f10be08

Browse files
bellangerqhissalht
andauthored
Corrige les tickets d'accessibilité suite au contre audit (#478)
* fix fieldset/legend structure closes #469 * replace @vueuse/head with @unhead/vue and fix dynamic title on generation page * add topic number, criterium number and status to transverse switch label * add current tab name to page title on step 3 * indicate active tab in markup on report page * indicate active tab in markup on results and step 3 pages * indicate active tab in markup on results and step 3 pages (2) * Update confiture-web-app/src/pages/consult/ReportPage.vue Co-authored-by: Adrien Boutigny <adrien@slash-tmp.dev> * Update confiture-web-app/src/pages/consult/ReportPage.vue Co-authored-by: Adrien Boutigny <adrien@slash-tmp.dev> * Update confiture-web-app/src/pages/consult/ReportPage.vue Co-authored-by: Adrien Boutigny <adrien@slash-tmp.dev> * update changelog --------- Co-authored-by: Adrien Boutigny <adrien@slash-tmp.dev>
1 parent 06c84ad commit f10be08

14 files changed

Lines changed: 214 additions & 113 deletions

File tree

confiture-web-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"@gouvfr/dsfr": "1.9.0",
1616
"@sentry/tracing": "^7.37.2",
1717
"@sentry/vue": "^7.37.2",
18-
"@vueuse/head": "^1.0.22",
18+
"@unhead/vue": "^1.5.3",
1919
"chart.js": "^4.1.0",
2020
"dompurify": "^2.4.1",
2121
"ky": "^0.33.0",

confiture-web-app/src/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script setup lang="ts">
22
import { provide, ref, watch } from "vue";
33
import { useRoute } from "vue-router";
4-
import { useHead } from "@vueuse/head";
4+
import { useHead } from "@unhead/vue";
55
66
import Breadcrumb, { BreadcrumbLink } from "./components/Breadcrumb.vue";
77
import ToastNotification from "./components/ToastNotification.vue";

confiture-web-app/src/assets/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
Tous les changements notables de Ara sont documentés ici avec leur date, leur catégorie (nouvelle fonctionnalité, correction de bug ou autre changement) et leur pull request (PR) associée.
44

5+
## 08/09/2023
6+
7+
### Corrections 🐛
8+
9+
- Corrige les problèmes d’accessibilité suite au contre-audit ([#478](https://github.com/DISIC/Ara/pull/478))
10+
511
## 06/09/2023
612

713
### Corrections 🐛

confiture-web-app/src/components/AuditGeneralInformationsForm.vue

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -164,27 +164,26 @@ const route = useRoute();
164164
:key="i"
165165
class="fr-mt-4w fr-p-4w page-card"
166166
>
167-
<div class="fr-mb-2w page-header">
168-
<legend>
169-
<h3 class="fr-h6 fr-mb-0">Page {{ i + 1 }}</h3>
170-
</legend>
171-
172-
<button
173-
class="fr-btn fr-btn--tertiary-no-outline"
174-
type="button"
175-
:disabled="pages.length === 1"
176-
@click="deletePage(i)"
177-
>
178-
Supprimer
179-
<span class="sr-only">la page {{ i + 1 }}</span>
180-
</button>
181-
</div>
167+
<legend class="page-legend">
168+
<h3 class="fr-h6 fr-mb-0">Page {{ i + 1 }}</h3>
169+
</legend>
170+
171+
<button
172+
class="fr-btn fr-btn--tertiary-no-outline page-delete-button"
173+
type="button"
174+
:disabled="pages.length === 1"
175+
@click="deletePage(i)"
176+
>
177+
Supprimer
178+
<span class="sr-only">la page {{ i + 1 }}</span>
179+
</button>
182180

183181
<DsfrField
184182
:id="`page-name-${i + 1}`"
185183
ref="pageNameFieldRefs"
186184
v-model="page.name"
187185
label="Nom de la page"
186+
class="fr-mt-2w page-field"
188187
/>
189188

190189
<DsfrField
@@ -193,6 +192,7 @@ const route = useRoute();
193192
label="URL de la page"
194193
type="url"
195194
required
195+
class="page-field"
196196
>
197197
<template #hint>
198198
L’URL de la page doit commencer par <code>https://</code>
@@ -304,14 +304,21 @@ const route = useRoute();
304304
305305
.page-card {
306306
border: 1px solid var(--border-default-grey);
307+
display: grid;
308+
grid-template-columns: auto auto;
309+
align-items: center;
307310
}
308311
309-
.page-header {
310-
display: flex;
311-
align-items: center;
312-
justify-content: space-between;
313-
gap: 1rem;
314-
flex-wrap: wrap;
312+
.page-legend {
313+
float: left;
314+
}
315+
316+
.page-delete-button {
317+
justify-self: end;
318+
}
319+
320+
.page-field {
321+
grid-column: 1 / -1;
315322
}
316323
317324
.auditor-fields {

confiture-web-app/src/components/AuditGenerationCriterium.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import CriteriumTestsAccordion from "./CriteriumTestsAccordion.vue";
1818
import { useResultsStore, useFiltersStore } from "../store";
1919
import { useNotifications } from "../composables/useNotifications";
2020
import RadioGroup, { RadioColor } from "./RadioGroup.vue";
21-
import { captureWithPayloads } from "../utils";
21+
import { captureWithPayloads, formatStatus } from "../utils";
2222
import { useIsOffline } from "../composables/useIsOffline";
2323
2424
const store = useResultsStore();
@@ -265,7 +265,11 @@ const isOffline = useIsOffline();
265265
class="fr-toggle__label fr-pr-2w"
266266
:for="`applicable-all-pages-${uniqueId}`"
267267
>
268-
Sur toutes les pages
268+
<span class="sr-only">
269+
Appliquer le statut {{ formatStatus(result.status) }} pour le
270+
critère {{ topicNumber }}.{{ criterium.number }}
271+
</span>
272+
&nbsp;Sur toutes les pages
269273
</label>
270274
</div>
271275
</div>

confiture-web-app/src/components/AuditGenerationFilters.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { computed, watch, nextTick } from "vue";
33
import { ref } from "vue";
44
import { useFiltersStore, useResultsStore } from "../store";
5+
import { pluralize } from "../utils";
56
67
defineProps<{
78
topics: { title: string; number: number; value: number }[];
@@ -116,7 +117,8 @@ watch(
116117

117118
<div role="alert" aria-live="polite">
118119
<p v-if="filterStore.search" class="fr-mt-2w fr-mb-1w">
119-
{{ resultsCount }} {{ resultsCount !== 1 ? "résultats" : "résultat" }}
120+
{{ resultsCount }}
121+
{{ pluralize("résultat", "résultats", resultsCount) }}
120122
</p>
121123
<!-- FIXME: can't change color on dismissable tags. "fr-tag--blue-france" -->
122124
</div>

confiture-web-app/src/components/PageMeta.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { defineComponent } from "vue";
2-
import { useHead } from "@vueuse/head";
2+
import { useHead } from "@unhead/vue";
33

44
const PageMeta = defineComponent({
55
name: "PageMeta",
@@ -21,7 +21,7 @@ const PageMeta = defineComponent({
2121
* If no props are provided, defaults are used.
2222
*/
2323
useHead({
24-
title: props.title,
24+
title: () => props.title ?? "",
2525
meta: [
2626
{ name: "description", content: props.description },
2727
{ name: "og:title", content: props.title },

confiture-web-app/src/components/ResultDetailsCard.vue

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
<script lang="ts" setup>
2+
import { ref } from "vue";
3+
24
import { slugify } from "../utils";
35
46
defineProps<{
57
title: string;
68
tableData: string[][];
79
}>();
10+
11+
const currentDisplay = ref("chart");
12+
13+
function updateCurrentDisplay(display: string) {
14+
currentDisplay.value = display;
15+
}
816
</script>
917

1018
<template>
@@ -19,44 +27,54 @@ defineProps<{
1927
>
2028
<li role="presentation">
2129
<button
22-
:id="`tabpanel-table-${slugify(title)}`"
30+
:id="`tabpanel-chart-${slugify(title)}`"
2331
class="fr-tabs__tab"
2432
tabindex="0"
2533
role="tab"
2634
aria-selected="true"
27-
:aria-controls="`tabpanel-table-${slugify(title)}-panel`"
35+
:aria-controls="`tabpanel-chart-${slugify(title)}-panel`"
2836
>
2937
Graphique
38+
<span v-if="currentDisplay === 'chart'" class="sr-only"
39+
>&nbsp;Actif</span
40+
>
3041
</button>
3142
</li>
3243
<li role="presentation">
3344
<button
34-
:id="`tabpanel-chart-${slugify(title)}`"
45+
:id="`tabpanel-table-${slugify(title)}`"
3546
class="fr-tabs__tab"
3647
tabindex="-1"
3748
role="tab"
3849
aria-selected="false"
39-
:aria-controls="`tabpanel-chart-${slugify(title)}-panel`"
50+
:aria-controls="`tabpanel-table-${slugify(title)}-panel`"
4051
>
4152
Tableau
53+
<span v-if="currentDisplay === 'table'" class="sr-only"
54+
>&nbsp;Actif</span
55+
>
4256
</button>
4357
</li>
4458
</ul>
4559
<div
46-
:id="`tabpanel-table-${slugify(title)}-panel`"
47-
class="fr-tabs__panel fr-tabs__panel--selected"
60+
:id="`tabpanel-chart-${slugify(title)}-panel`"
61+
class="fr-tabs__panel"
62+
:class="{ 'fr-tabs__panel--selected': currentDisplay === 'chart' }"
4863
role="tabpanel"
49-
:aria-labelledby="`tabpanel-table-${slugify(title)}`"
64+
:aria-labelledby="`tabpanel-chart-${slugify(title)}`"
5065
tabindex="0"
66+
v-on="{ 'dsfr.disclose': () => updateCurrentDisplay('chart') }"
5167
>
5268
<slot />
5369
</div>
5470
<div
55-
:id="`tabpanel-chart-${slugify(title)}-panel`"
71+
:id="`tabpanel-table-${slugify(title)}-panel`"
5672
class="fr-tabs__panel"
73+
:class="{ 'fr-tabs__panel--selected': currentDisplay === 'table' }"
5774
role="tabpanel"
58-
:aria-labelledby="`tabpanel-chart-${slugify(title)}`"
75+
:aria-labelledby="`tabpanel-table-${slugify(title)}`"
5976
tabindex="0"
77+
v-on="{ 'dsfr.disclose': () => updateCurrentDisplay('table') }"
6078
>
6179
<div class="fr-table fr-table--no-caption fr-mb-0">
6280
<table>

confiture-web-app/src/components/TestEnvironmentSelection/TestEnvironmentSelection.vue

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -280,22 +280,22 @@ function combineEnvironments(
280280
:key="i"
281281
class="fr-fieldset fr-m-0 fr-p-0 fr-mt-4w fr-p-4w env-card"
282282
>
283-
<div class="fr-mb-2w env-header">
284-
<legend>
285-
<h3 class="fr-h6 fr-mb-0">Environnement {{ i + 1 }}</h3>
286-
</legend>
287-
<button
288-
class="fr-btn fr-btn--tertiary-no-outline"
289-
type="button"
290-
:disabled="customEnvironments.length === 1"
291-
@click="deleteEnvironment(i)"
292-
>
293-
Supprimer
294-
</button>
295-
</div>
296-
<div class="fr-form-group">
283+
<legend class="env-legend">
284+
<h3 class="fr-h6 fr-mb-0">Environnement {{ i + 1 }}</h3>
285+
</legend>
286+
<button
287+
class="fr-btn fr-btn--tertiary-no-outline env-delete-button"
288+
type="button"
289+
:disabled="customEnvironments.length === 1"
290+
@click="deleteEnvironment(i)"
291+
>
292+
Supprimer
293+
</button>
294+
<div class="fr-form-group env-form">
297295
<fieldset class="fr-fieldset fr-fieldset--inline">
298-
<legend class="fr-fieldset__legend fr-text--regular">Support</legend>
296+
<legend class="fr-fieldset__legend fr-text--regular fr-mt-2w">
297+
Support
298+
</legend>
299299
<div class="fr-fieldset__content">
300300
<div class="fr-radio-group">
301301
<input
@@ -438,15 +438,21 @@ function combineEnvironments(
438438
439439
.env-card {
440440
border: 1px solid var(--border-default-grey);
441-
display: block;
441+
display: grid;
442+
grid-template-columns: auto auto;
443+
align-items: center;
442444
}
443445
444-
.env-header {
445-
display: flex;
446-
align-items: center;
447-
justify-content: space-between;
448-
gap: 1rem;
449-
flex-wrap: wrap;
446+
.env-legend {
447+
float: left;
448+
}
449+
450+
.env-delete-button {
451+
justify-self: end;
452+
}
453+
454+
.env-card > *:not(.env-legend, .env-delete-button) {
455+
grid-column: 1 / -1;
450456
}
451457
452458
@media (max-width: 992px) {

confiture-web-app/src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { createApp } from "vue";
22
import { createPinia } from "pinia";
33
import { marked } from "marked";
4-
import { createHead } from "@vueuse/head";
4+
import { createHead } from "@unhead/vue";
55
// @ts-expect-error vue-matomo does not have any sort of typescript support :'(
66
import Matomo from "vue-matomo";
77

0 commit comments

Comments
 (0)