@cnamts/synapse 0.0.4-alpha → 0.0.5-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/design-system-v3.d.ts +932 -224
- package/dist/design-system-v3.js +3374 -1502
- package/dist/design-system-v3.umd.cjs +6 -6
- package/dist/style.css +1 -1
- package/package.json +2 -1
- package/src/assets/tokens.scss +0 -1
- package/src/components/Alert/Accessibilite.mdx +14 -0
- package/src/components/Alert/Accessibilite.stories.ts +166 -0
- package/src/components/Alert/AccessibiliteItems.ts +152 -0
- package/src/components/Alert/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/BackBtn/Accessibilite.mdx +14 -0
- package/src/components/BackBtn/Accessibilite.stories.ts +166 -0
- package/src/components/BackBtn/AccessibiliteItems.ts +132 -0
- package/src/components/BackBtn/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/BackToTopBtn/Accessibilite.mdx +14 -0
- package/src/components/BackToTopBtn/Accessibilite.stories.ts +166 -0
- package/src/components/BackToTopBtn/AccessibiliteItems.ts +82 -0
- package/src/components/BackToTopBtn/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/CollapsibleList/Accessibilite.mdx +14 -0
- package/src/components/CollapsibleList/Accessibilite.stories.ts +166 -0
- package/src/components/CollapsibleList/AccessibiliteItems.ts +129 -0
- package/src/components/CollapsibleList/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/CopyBtn/Accessibilite.mdx +14 -0
- package/src/components/CopyBtn/Accessibilite.stories.ts +166 -0
- package/src/components/CopyBtn/AccessibiliteItems.ts +135 -0
- package/src/components/CopyBtn/config.ts +2 -0
- package/src/components/CopyBtn/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/Customs/SyBtnSelect/SyBtnSelect.mdx +44 -0
- package/src/components/Customs/SyBtnSelect/SyBtnSelect.stories.ts +606 -0
- package/src/components/Customs/SyBtnSelect/SyBtnSelect.vue +246 -0
- package/src/components/Customs/SyBtnSelect/tests/SyBtnSelect.spec.ts +168 -0
- package/src/components/Customs/SyInputSelect/SyInputSelect.mdx +40 -0
- package/src/components/Customs/{CustomInputSelect/CustomInputSelect.stories.ts → SyInputSelect/SyInputSelect.stories.ts} +29 -29
- package/src/components/Customs/{CustomInputSelect/CustomInputSelect.vue → SyInputSelect/SyInputSelect.vue} +10 -2
- package/src/components/Customs/SyInputSelect/tests/SyInputSelect.spec.ts +140 -0
- package/src/components/Customs/{CustomSelect/CustomSelect.mdx → SySelect/SySelect.mdx} +8 -8
- package/src/components/Customs/{CustomSelect/CustomSelect.stories.ts → SySelect/SySelect.stories.ts} +25 -25
- package/src/components/Customs/{CustomSelect/CustomSelect.vue → SySelect/SySelect.vue} +9 -5
- package/src/components/Customs/{CustomInputSelect/tests/CustomInputSelect.spec.ts → SySelect/tests/SySelect.spec.ts} +48 -71
- package/src/components/Customs/SyTextField/SyTextField.mdx +44 -0
- package/src/components/Customs/{CustomTextField/CustomTextField.stories.ts → SyTextField/SyTextField.stories.ts} +34 -34
- package/src/components/Customs/{CustomTextField/tests/CustomTextField.spec.ts → SyTextField/tests/SyTextField.spec.ts} +3 -3
- package/src/components/Customs/{CustomTextField/tests/__snapshots__/CustomTextField.spec.ts.snap → SyTextField/tests/__snapshots__/SyTextField.spec.ts.snap} +3 -5
- package/src/components/DialogBox/DialogBox.mdx +14 -0
- package/src/components/DialogBox/DialogBox.stories.ts +798 -0
- package/src/components/DialogBox/DialogBox.vue +181 -0
- package/src/components/DialogBox/config.ts +25 -0
- package/src/components/DialogBox/locales.ts +5 -0
- package/src/components/DialogBox/tests/DialogBox.spec.ts +329 -0
- package/src/components/DialogBox/tests/__snapshots__/DialogBox.spec.ts.snap +46 -0
- package/src/components/ErrorPage/ErrorPage.mdx +21 -0
- package/src/components/ErrorPage/ErrorPage.stories.ts +133 -0
- package/src/components/ErrorPage/ErrorPage.vue +93 -0
- package/src/components/ErrorPage/locales.ts +5 -0
- package/src/components/ErrorPage/tests/ErrorPage.spec.ts +40 -0
- package/src/components/ErrorPage/tests/__snapshots__/ErrorPage.spec.ts.snap +78 -0
- package/src/components/FooterBar/FooterBar.stories.ts +556 -8
- package/src/components/FooterBar/config.ts +2 -3
- package/src/components/FooterBar/tests/FooterBar.spec.ts +1 -1
- package/src/components/FooterBar/tests/FooterBarConfig.spec.ts +1 -1
- package/src/components/FooterBar/tests/__snapshots__/FooterBar.spec.ts.snap +2 -2
- package/src/components/FranceConnectBtn/Accessibilite.mdx +14 -0
- package/src/components/FranceConnectBtn/Accessibilite.stories.ts +194 -0
- package/src/components/FranceConnectBtn/AccessibiliteItems.ts +199 -0
- package/src/components/FranceConnectBtn/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/HeaderBar/HeaderBar.stories.ts +60 -2
- package/src/components/HeaderNavigationBar/HeaderNavigationBar.mdx +6 -6
- package/src/components/HeaderNavigationBar/tests/HeaderNavigationBar.spec.ts +1 -1
- package/src/components/HeaderToolbar/HeaderToolbar.vue +2 -2
- package/src/components/HeaderToolbar/tests/HeaderToolbar.spec.ts +36 -2
- package/src/components/LangBtn/Accessibilite.mdx +14 -0
- package/src/components/LangBtn/Accessibilite.stories.ts +166 -0
- package/src/components/LangBtn/AccessibiliteItems.ts +132 -0
- package/src/components/LangBtn/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/LangBtn/tests/LangBtn.spec.ts +1 -1
- package/src/components/LangBtn/tests/__snapshots__/LangBtn.spec.ts.snap +1 -1
- package/src/components/MaintenancePage/MaintenancePage.mdx +11 -0
- package/src/components/MaintenancePage/MaintenancePage.stories.ts +41 -0
- package/src/components/MaintenancePage/MaintenancePage.vue +25 -0
- package/src/components/MaintenancePage/assets/maintenance.svg +1 -0
- package/src/components/MaintenancePage/index.ts +3 -0
- package/src/components/MaintenancePage/locales.ts +5 -0
- package/src/components/MaintenancePage/tests/MaintenancePage.spec.ts +12 -0
- package/src/components/MaintenancePage/tests/__snapshots__/MaintenancePage.spec.ts.snap +3 -0
- package/src/components/NotFoundPage/NotFoundPage.mdx +19 -0
- package/src/components/NotFoundPage/NotFoundPage.stories.ts +76 -0
- package/src/components/NotFoundPage/NotFoundPage.vue +52 -0
- package/src/components/NotFoundPage/assets/not-found.svg +1 -0
- package/src/components/NotFoundPage/locales.ts +6 -0
- package/src/components/NotFoundPage/tests/NotFoundPage.spec.ts +38 -0
- package/src/components/NotFoundPage/tests/__snapshots__/NotFoundPage.spec.ts.snap +76 -0
- package/src/components/NotificationBar/Accessibilite.mdx +14 -0
- package/src/components/NotificationBar/Accessibilite.stories.ts +166 -0
- package/src/components/NotificationBar/AccessibiliteItems.ts +174 -0
- package/src/components/NotificationBar/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/NotificationBar/options.ts +1 -0
- package/src/components/PageContainer/Accessibilite.mdx +14 -0
- package/src/components/PageContainer/Accessibilite.stories.ts +166 -0
- package/src/components/PageContainer/AccessibiliteItems.ts +52 -0
- package/src/components/PageContainer/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/PhoneField/PhoneField.vue +5 -5
- package/src/components/PhoneField/tests/PhoneField.spec.ts +3 -3
- package/src/components/SkipLink/Accessibilite.mdx +14 -0
- package/src/components/SkipLink/Accessibilite.stories.ts +167 -0
- package/src/components/SkipLink/AccessibiliteItems.ts +77 -0
- package/src/components/SkipLink/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/SocialMediaLinks/SocialMediaLinks.mdx +17 -13
- package/src/components/SocialMediaLinks/SocialMediaLinks.stories.ts +2 -1
- package/src/components/SocialMediaLinks/tests/SocialMediaLinks.spec.ts +1 -1
- package/src/components/SocialMediaLinks/tests/__snapshots__/SocialMediaLinks.spec.ts.snap +2 -2
- package/src/components/SubHeader/SubHeader.vue +1 -1
- package/src/components/UserMenuBtn/UserMenuBtn.mdx +35 -0
- package/src/components/UserMenuBtn/UserMenuBtn.stories.ts +438 -0
- package/src/components/UserMenuBtn/UserMenuBtn.vue +105 -0
- package/src/components/UserMenuBtn/config.ts +24 -0
- package/src/components/UserMenuBtn/tests/UserMenuBtn.spec.ts +125 -0
- package/src/components/index.ts +12 -3
- package/src/composables/index.ts +8 -0
- package/src/composables/rules/tests/useFieldValidation.spec.ts +82 -0
- package/src/composables/rules/useFieldValidation.ts +53 -0
- package/src/designTokens/index.ts +2 -0
- package/src/designTokens/tokens/cnam/cnamDarkTheme.ts +5 -0
- package/src/designTokens/tokens/cnam/cnamLightTheme.ts +1 -0
- package/src/main.ts +2 -0
- package/src/stories/Fondamentaux/Arrondis.mdx +24 -0
- package/src/stories/{Guidelines → Fondamentaux}/Colors.mdx +1 -1
- package/src/stories/Fondamentaux/Conteneurs.mdx +7 -0
- package/src/stories/Fondamentaux/CustomisationEtThemes.mdx +7 -0
- package/src/stories/Fondamentaux/Elevations.mdx +14 -0
- package/src/stories/Fondamentaux/Espacements.mdx +29 -0
- package/src/stories/{Guidelines → Fondamentaux}/Introduction.mdx +1 -1
- package/src/stories/Fondamentaux/StylesTypographiques.mdx +33 -0
- package/src/stories/Fondamentaux/Typographie.mdx +58 -0
- package/src/stories/GuideDuDev/CommentUtiliserLesRules.mdx +132 -0
- package/src/stories/{Fondamentaux → Guidelines}/Accessibilite/Accessibilite.stories.ts +1 -1
- package/src/stories/{Fondamentaux → Guidelines}/EcoConception/Econception.stories.ts +2 -2
- package/src/components/Customs/CustomInputSelect/CustomInputSelect.mdx +0 -40
- package/src/components/Customs/CustomSelect/tests/CustomSelect.spec.ts +0 -236
- package/src/components/Customs/CustomTextField/CustomTextField.mdx +0 -44
- package/src/stories/Guidelines/CustomisationEtThemes.mdx +0 -3
- package/src/stories/Guidelines/Typo.mdx +0 -53
- /package/src/components/Customs/{CustomInputSelect → SyInputSelect}/config.ts +0 -0
- /package/src/components/Customs/{CustomTextField/CustomTextField.vue → SyTextField/SyTextField.vue} +0 -0
- /package/src/components/Customs/{CustomTextField → SyTextField}/types.d.ts +0 -0
- /package/src/stories/{Fondamentaux → Guidelines}/Accessibilite/Accessibilite.mdx +0 -0
- /package/src/stories/{Fondamentaux → Guidelines}/Accessibilite/AccessibiliteItems.ts +0 -0
- /package/src/stories/{Fondamentaux → Guidelines}/Accessibilite/constants/ExpertiseLevelEnum.ts +0 -0
- /package/src/stories/{Fondamentaux → Guidelines}/Accessibilite/constants/RGAALevelEnum.ts +0 -0
- /package/src/stories/{Fondamentaux → Guidelines}/EcoConception/EcoConception.mdx +0 -0
- /package/src/stories/{Fondamentaux → Guidelines}/EcoConception/ecoDesignItems.ts +0 -0
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { VExpansionPanels, VExpansionPanel, VExpansionPanelTitle, VExpansionPanelText, VDataTable, VIcon } from 'vuetify/components'
|
|
2
|
+
import type { StoryObj } from '@storybook/vue3'
|
|
3
|
+
import { AccessibiliteItemsIndeterminate, AccessibiliteItemsValidated } from './AccessibiliteItems'
|
|
4
|
+
import { mdiCheckboxMarkedCircle, mdiLink, mdiEye } from '@mdi/js'
|
|
5
|
+
|
|
6
|
+
const checkIcon = mdiCheckboxMarkedCircle
|
|
7
|
+
const iconEye = mdiEye
|
|
8
|
+
const linkICon = mdiLink
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
title: 'Composants/Boutons/LangBtn/Accessibilité',
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const AccessibilitePanel: StoryObj = {
|
|
15
|
+
|
|
16
|
+
render: () => {
|
|
17
|
+
return {
|
|
18
|
+
components: { VExpansionPanels, VExpansionPanel, VExpansionPanelTitle, VExpansionPanelText, VDataTable, VIcon },
|
|
19
|
+
|
|
20
|
+
setup() {
|
|
21
|
+
const icon = checkIcon
|
|
22
|
+
|
|
23
|
+
return { AccessibiliteItemsIndeterminate, AccessibiliteItemsValidated, icon, linkICon, iconEye }
|
|
24
|
+
},
|
|
25
|
+
template: `
|
|
26
|
+
<div class="accessibiliteItems" style="display:flex; max-width: none !important;">
|
|
27
|
+
<v-col cols="6">
|
|
28
|
+
<div style="display:flex; margin-bottom: 10px; justify-content: space-between; align-items: center;">
|
|
29
|
+
<h5>{{ AccessibiliteItemsIndeterminate.length }} critères à prendre en charge par le projet</h5>
|
|
30
|
+
<div style="display: flex; align-items: center;">
|
|
31
|
+
<v-btn variant="tonal" color="red" size="x-small" style="margin: 4px;font-size: 8px;"
|
|
32
|
+
rounded>Tanaguru
|
|
33
|
+
</v-btn>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<v-expansion-panels value="opened" multiple>
|
|
38
|
+
<v-expansion-panel v-for="(item, index) in AccessibiliteItemsIndeterminate" :key="index" style="background-color: rgba(42, 96, 158, 0.1); margin-bottom: 10px;">
|
|
39
|
+
<v-expansion-panel-title>
|
|
40
|
+
<VIcon :icon="iconEye" style="margin-right: 5px; color:#5778b7;"/>
|
|
41
|
+
{{ item.title }}
|
|
42
|
+
</v-expansion-panel-title>
|
|
43
|
+
<v-expansion-panel-text>
|
|
44
|
+
<v-expansion-panels>
|
|
45
|
+
<v-expansion-panel>
|
|
46
|
+
<v-expansion-panel-title
|
|
47
|
+
style="font-weight: bold; font-size: 13px; line-height: 16px;">
|
|
48
|
+
{{ item.subtitle }}
|
|
49
|
+
</v-expansion-panel-title>
|
|
50
|
+
<v-expansion-panel-text>
|
|
51
|
+
<div v-for="(value, i) in item.items" :key="i">
|
|
52
|
+
<p style="font-size: 13px;line-height: 16px;">
|
|
53
|
+
{{ value.precision }}
|
|
54
|
+
</p>
|
|
55
|
+
<div v-for="element in value.solution"
|
|
56
|
+
style="margin-top:15px; font-size: 13px;line-height: 16px;">
|
|
57
|
+
<p style="font-weight: bold;">Méthodologie du test : <a
|
|
58
|
+
href="value.link" target="blank">
|
|
59
|
+
<VIcon :icon="linkICon"/>
|
|
60
|
+
</a></p>
|
|
61
|
+
|
|
62
|
+
<p>{{ element.info1 }}</p>
|
|
63
|
+
<p>{{ element.info2 }}</p>
|
|
64
|
+
<p>{{ element.info3 }}</p>
|
|
65
|
+
|
|
66
|
+
</div>
|
|
67
|
+
<span style="display:flex; justify-content:center; margin-bottom:5px;">______</span>
|
|
68
|
+
</div>
|
|
69
|
+
</v-expansion-panel-text>
|
|
70
|
+
</v-expansion-panel>
|
|
71
|
+
</v-expansion-panels>
|
|
72
|
+
</v-expansion-panel-text>
|
|
73
|
+
</v-expansion-panel>
|
|
74
|
+
</v-expansion-panels>
|
|
75
|
+
</v-col>
|
|
76
|
+
<v-col cols="6">
|
|
77
|
+
<div style="display:flex; margin-bottom: 10px; justify-content: space-between; align-items: center;">
|
|
78
|
+
<h5>{{ AccessibiliteItemsValidated.length }} critères pris en charge par l'équipe Design System</h5>
|
|
79
|
+
<div style="display: flex; align-items: center;">
|
|
80
|
+
<v-btn variant="tonal" color="red" size="x-small" style="margin: 4px;font-size: 8px;"
|
|
81
|
+
rounded>Tanaguru
|
|
82
|
+
</v-btn>
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
<v-expansion-panels value="opened" multiple>
|
|
86
|
+
<v-expansion-panel
|
|
87
|
+
v-for="(item, index) in AccessibiliteItemsValidated"
|
|
88
|
+
:key="index" style="background-color: rgba(53,135,0,0.1); margin-bottom: 10px;">
|
|
89
|
+
<v-expansion-panel-title>
|
|
90
|
+
<VIcon color="green" :icon="icon" style="margin-right: 5px;"/>
|
|
91
|
+
{{ item.title }}
|
|
92
|
+
</v-expansion-panel-title>
|
|
93
|
+
<v-expansion-panel-text>
|
|
94
|
+
<v-expansion-panels>
|
|
95
|
+
<v-expansion-panel>
|
|
96
|
+
<v-expansion-panel-title style="font-weight: bold;font-size: 13px; line-height: 16px;">
|
|
97
|
+
{{ item.subtitle }}
|
|
98
|
+
</v-expansion-panel-title>
|
|
99
|
+
<v-expansion-panel-text>
|
|
100
|
+
<div v-for="(value, i) in item.items" :key="i">
|
|
101
|
+
<p style="font-size: 13px;line-height: 16px;">
|
|
102
|
+
{{ value.precision }}
|
|
103
|
+
</p>
|
|
104
|
+
<div v-for="element in value.solution"
|
|
105
|
+
style="margin-top:15px; font-size: 13px;line-height: 16px;">
|
|
106
|
+
<p style="font-weight: bold;">Méthodologie du test : <a
|
|
107
|
+
href="value.link" target="blank">
|
|
108
|
+
<VIcon :icon="linkICon"/>
|
|
109
|
+
</a></p>
|
|
110
|
+
<p>{{ element.info1 }}</p>
|
|
111
|
+
<p>{{ element.info2 }}</p>
|
|
112
|
+
<p>{{ element.info3 }}</p>
|
|
113
|
+
</div>
|
|
114
|
+
<span style="display:flex; justify-content:center; margin-bottom:5px;">______</span>
|
|
115
|
+
</div>
|
|
116
|
+
</v-expansion-panel-text>
|
|
117
|
+
</v-expansion-panel>
|
|
118
|
+
</v-expansion-panels>
|
|
119
|
+
</v-expansion-panel-text>
|
|
120
|
+
</v-expansion-panel>
|
|
121
|
+
</v-expansion-panels>
|
|
122
|
+
</v-col>
|
|
123
|
+
</div>
|
|
124
|
+
`,
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
tags: ['!dev'],
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export const Legende: StoryObj = {
|
|
131
|
+
args: {
|
|
132
|
+
icon: checkIcon,
|
|
133
|
+
},
|
|
134
|
+
render: (args) => {
|
|
135
|
+
return {
|
|
136
|
+
components: { VIcon },
|
|
137
|
+
setup() {
|
|
138
|
+
return { args }
|
|
139
|
+
},
|
|
140
|
+
template: `
|
|
141
|
+
<p style="color: grey;font-size: 11px; margin-bottom: 12px;">Date de conception: 20/11/2024</p>
|
|
142
|
+
<div>
|
|
143
|
+
<p>Le tableau ci-dessous liste nos recommandations suivant les <a target="blank" style="color:#0C41BD;" href="https://www.numerique.gouv.fr/publications/rgaa-accessibilite/#contenu">catégories du RGAA</a>.</p>
|
|
144
|
+
<p style="margin-bottom: 12px;font-weight:bold;">Pour rappel le composant seul ne garantie pas
|
|
145
|
+
l'accessibilité du site.</p>
|
|
146
|
+
<div style="font-size: 14px">
|
|
147
|
+
<p>Nous avons deux façons de relever les problèmes d'accessibilité des composants :</p>
|
|
148
|
+
<div>
|
|
149
|
+
<v-btn variant="tonal" color="grey" size="x-small" style="margin: 2px;font-size: 8px;" rounded>
|
|
150
|
+
Audit
|
|
151
|
+
</v-btn>
|
|
152
|
+
Problèmes relevés par le projet
|
|
153
|
+
</div>
|
|
154
|
+
<div>
|
|
155
|
+
<v-btn variant="tonal" color="red" size="x-small" style="margin: 2px;font-size: 8px;" rounded>
|
|
156
|
+
Tanaguru
|
|
157
|
+
</v-btn>
|
|
158
|
+
Problèmes relevés par Tanaguru
|
|
159
|
+
</div>
|
|
160
|
+
</div>
|
|
161
|
+
</div>
|
|
162
|
+
`,
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
tags: ['!dev'],
|
|
166
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { ExpertiseLevelEnum } from './constants/ExpertiseLevelEnum'
|
|
2
|
+
|
|
3
|
+
export const AccessibiliteItemsIndeterminate = [
|
|
4
|
+
{
|
|
5
|
+
title: 'Catégorie 1 : Images',
|
|
6
|
+
subtitle: '1.4 Pour chaque image utilisée comme CAPTCHA ou comme image-test, ayant une alternative textuelle, cette alternative permet-elle d’identifier la nature et la fonction de l’image ?',
|
|
7
|
+
items: [
|
|
8
|
+
{
|
|
9
|
+
|
|
10
|
+
precision: '1.4.1 Pour chaque image (balise <img>) utilisée comme CAPTCHA ou comme image-test, ayant une alternative textuelle, cette alternative est-elle pertinente ?',
|
|
11
|
+
link: 'https://accessibilite.numerique.gouv.fr/methode/criteres-et-tests/#1.4.1',
|
|
12
|
+
solution: [{
|
|
13
|
+
info1: '1. Retrouver dans le document les images structurées au moyen d’un élément <img> pourvues d’une alternative textuelle et utilisées comme CAPTCHA ou comme image-test',
|
|
14
|
+
info2: '2. Pour chaque image, vérifier que l’alternative textuelle est pertinente',
|
|
15
|
+
info3: '3. Si c’est le cas pour chaque image, le test est validé',
|
|
16
|
+
}],
|
|
17
|
+
expertise: ExpertiseLevelEnum.DEV,
|
|
18
|
+
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
|
|
22
|
+
precision: ' 1.4.6 Pour chaque image vectorielle (balise <svg>) utilisée comme CAPTCHA ou comme image-test, ayant une alternative textuelle, cette alternative est-elle pertinente ?',
|
|
23
|
+
link: 'https://accessibilite.numerique.gouv.fr/methode/criteres-et-tests/#1.4.6',
|
|
24
|
+
solution: [{
|
|
25
|
+
info1: '1. Retrouver dans le document les éléments <svg> pourvus d’une alternative textuelle et utilisés comme CAPTCHA ou comme image-test;',
|
|
26
|
+
info2: '2. Pour chaque élément <svg>, vérifier que l’alternative textuelle est pertinente',
|
|
27
|
+
info3: '3. Si c’est le cas pour chaque image, le test est validé',
|
|
28
|
+
}],
|
|
29
|
+
expertise: ExpertiseLevelEnum.DEV,
|
|
30
|
+
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
export const AccessibiliteItemsValidated = [
|
|
39
|
+
{
|
|
40
|
+
title: 'Catégorie 1 : Images',
|
|
41
|
+
subtitle: '1.2 Chaque image de décoration est-elle correctement ignorée par les technologies d’assistance ?',
|
|
42
|
+
items: [
|
|
43
|
+
{
|
|
44
|
+
|
|
45
|
+
precision: '1.2.4 Chaque image vectorielle (balise <svg>) de décoration, sans légende, vérifie-t-elle ces conditions ? '
|
|
46
|
+
+ ' La balise <svg> possède un attribut WAI-ARIA aria-hidden="true" ;'
|
|
47
|
+
+ ' La balise <svg> et ses enfants sont dépourvus d’alternative textuelle ;'
|
|
48
|
+
+ ' Les balises <title> et <desc> sont absentes ou vides ;'
|
|
49
|
+
+ ' La balise <svg> et ses enfants sont dépourvus d’attribut title.',
|
|
50
|
+
link: 'https://accessibilite.numerique.gouv.fr/methode/criteres-et-tests/#1.2.4',
|
|
51
|
+
solution: [{
|
|
52
|
+
info1: '1. Pour chaque image, vérifier que l’élément <svg> ne possède pas d’attributs aria-labelledby ou aria-label et qu’il :'
|
|
53
|
+
+ ' Possède un attribut WAI-ARIA aria-hidden="true" ;'
|
|
54
|
+
+ ' Et est dépourvu d’alternative textuelle (ainsi que ses éléments enfants) ;'
|
|
55
|
+
+ ' Et ne contient pas d’éléments <title> et <desc> à moins que vides de contenu ;'
|
|
56
|
+
+ ' Et est dépourvu d’attribut title (ainsi que ses éléments enfants).'
|
|
57
|
+
+ ' Le nom du composant est cohérent avec l’état de la fonctionnalité ou des contenus contrôlés (par exemple pour une fonctionnalité permettant d’afficher ou de masquer une zone de contenu).',
|
|
58
|
+
info2: '2. Sinon, vérifier la présence d’un composant d’interface accessible permettant d’accéder aux mêmes fonctionnalités',
|
|
59
|
+
info3: '3. Si c’est le cas pour chaque image, le test est validé.',
|
|
60
|
+
}],
|
|
61
|
+
expertise: ExpertiseLevelEnum.DESIGN,
|
|
62
|
+
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
],
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
title: 'Catégorie 3 : Couleurs',
|
|
69
|
+
subtitle: '3.2 Dans chaque page web, le contraste entre la couleur du texte et la couleur de son arrière-plan est-il suffisamment élevé?',
|
|
70
|
+
items: [
|
|
71
|
+
{
|
|
72
|
+
|
|
73
|
+
precision: '3.2.1 Dans chaque page web, le texte et le texte en image sans effet de graisse d’une taille restituée inférieure à 24px vérifient-ils une de ces conditions? Le rapport de contraste entre le texte et son arrière-plan est de 4.5:1, au moins; Un mécanisme permet à l’utilisateur d’afficher le texte avec un rapport de contraste de 4.5:1, au moins.',
|
|
74
|
+
link: 'https://accessibilite.numerique.gouv.fr/methode/criteres-et-tests/#3.2.1',
|
|
75
|
+
solution: [{
|
|
76
|
+
info1: '1. Retrouver dans le document les textes et les textes en image sans effet de graisse d’une taille restituée inférieure à 24px qui pourraient poser des problèmes de contraste ;',
|
|
77
|
+
info2: '2. Pour chacun de ces textes, vérifier que : Soit le rapport de contraste entre le texte et son arrière-plan est de 4.5:1, au moins; Soit un mécanisme permet à l’utilisateur d’afficher le texte avec un rapport de contraste de 4.5:1, au moins.',
|
|
78
|
+
info3: '3. Si c’est le cas pour chaque texte, le test est validé',
|
|
79
|
+
}],
|
|
80
|
+
expertise: ExpertiseLevelEnum.DESIGN,
|
|
81
|
+
|
|
82
|
+
},
|
|
83
|
+
|
|
84
|
+
],
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
title: 'Catégorie 7 : Scripts',
|
|
88
|
+
subtitle: '7.1 Chaque script est-il, si nécessaire, compatible avec les technologies d’assistance ?',
|
|
89
|
+
items: [
|
|
90
|
+
|
|
91
|
+
{
|
|
92
|
+
precision: ' 7.1.3 Chaque script qui génère ou contrôle un composant d’interface vérifie-t-il ces conditions : '
|
|
93
|
+
+ 'Le composant possède un nom pertinent ;'
|
|
94
|
+
+ 'Le nom accessible du composant contient au moins l’intitulé visible ;'
|
|
95
|
+
+ 'Le composant possède un rôle pertinent.',
|
|
96
|
+
|
|
97
|
+
link: 'https://accessibilite.numerique.gouv.fr/methode/criteres-et-tests/#7.1.3',
|
|
98
|
+
solution: [{
|
|
99
|
+
info1: '1. Pour chacun des composants d’interface ayant validé le test 7.1.1, vérifier que le composant d’interface possède : ',
|
|
100
|
+
info2: '2. Un nom pertinent (intitulé visible) et un rôle pertinent',
|
|
101
|
+
info3: '3. Si le composant d’interface possède un nom accessible, vérifier que ce nom est pertinent et contient au moins l’intitulé visible.',
|
|
102
|
+
}],
|
|
103
|
+
expertise: ExpertiseLevelEnum.DESIGN,
|
|
104
|
+
|
|
105
|
+
},
|
|
106
|
+
|
|
107
|
+
],
|
|
108
|
+
},
|
|
109
|
+
|
|
110
|
+
{
|
|
111
|
+
title: 'Catégorie 8 : Eléments Obligatoires',
|
|
112
|
+
subtitle: '8.9 Dans chaque page web, les balises ne doivent pas être utilisées uniquement à des fins de présentation',
|
|
113
|
+
items: [
|
|
114
|
+
|
|
115
|
+
{
|
|
116
|
+
precision: ' 8.9.1 Dans chaque page web les balises (à l’exception de <div>, <span> et <table>) ne doivent pas être utilisées uniquement à des fins de présentation. Cette règle est-elle respectée',
|
|
117
|
+
link: 'https://accessibilite.numerique.gouv.fr/methode/criteres-et-tests/#8.9.1',
|
|
118
|
+
solution: [{
|
|
119
|
+
info1: '1. Retrouver dans le document l’ensemble des éléments sémantiques utilisés à des fins de présentation ;',
|
|
120
|
+
info2: '2. Pour chacun de ces éléments, vérifier que :'
|
|
121
|
+
+ 'L’élément est pourvu d’un attribut role=“presentation” ;'
|
|
122
|
+
+ 'L’utilisation de cet élément à des fins de présentation reste justifée',
|
|
123
|
+
info3: '3. Si c’est le cas, le test est validé',
|
|
124
|
+
}],
|
|
125
|
+
expertise: ExpertiseLevelEnum.DESIGN,
|
|
126
|
+
|
|
127
|
+
},
|
|
128
|
+
|
|
129
|
+
],
|
|
130
|
+
},
|
|
131
|
+
|
|
132
|
+
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
|
-
exports[`LangBtn
|
|
3
|
+
exports[`LangBtn > renders correctly 1`] = `
|
|
4
4
|
"<div data-v-42678988="" id="lang-menu-id"><button data-v-42678988="" type="button" class="v-btn v-theme--light text-primary v-btn--density-default v-btn--size-default v-btn--variant-outlined vd-lang-btn" id="lang-menu-btn" aria-label="Choix de la langue. Actuellement Français" aria-haspopup="menu" aria-controls="lang-menu-id" aria-owns="lang-menu-id" aria-expanded="false"><span class="v-btn__overlay"></span><span class="v-btn__underlay"></span>
|
|
5
5
|
<!----><span class="v-btn__content" data-no-activator="">Français <i data-v-42678988="" class="M7,10L12,15L17,10H7Z mdi v-icon notranslate v-theme--light v-icon--size-default ml-1" aria-hidden="true"></i></span>
|
|
6
6
|
<!---->
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Controls, Canvas, Meta, Source } from "@storybook/blocks";
|
|
2
|
+
import * as MaintenancePageStories from "./MaintenancePage.stories";
|
|
3
|
+
|
|
4
|
+
<Meta of={MaintenancePageStories} />
|
|
5
|
+
|
|
6
|
+
# MaintenancePage
|
|
7
|
+
|
|
8
|
+
Le composant `MaintenancePage` permet d'afficher une page de maintenance.
|
|
9
|
+
Il est basé sur le composant `ErrorPage` du design system.
|
|
10
|
+
|
|
11
|
+
<Canvas of={MaintenancePageStories.Default} />
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
import MaintenancePage from './MaintenancePage.vue'
|
|
3
|
+
|
|
4
|
+
const meta: Meta = {
|
|
5
|
+
title: 'Templates/MaintenancePage',
|
|
6
|
+
component: MaintenancePage,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: 'fullscreen',
|
|
9
|
+
},
|
|
10
|
+
} satisfies Meta<typeof MaintenancePage>
|
|
11
|
+
|
|
12
|
+
export default meta
|
|
13
|
+
|
|
14
|
+
type Story = StoryObj<typeof MaintenancePage>
|
|
15
|
+
|
|
16
|
+
export const Default: Story = {
|
|
17
|
+
decorators: [
|
|
18
|
+
() => ({ template: '<div style="padding: 20px; background: rgb(231, 236, 245)"><story /></div>' }),
|
|
19
|
+
],
|
|
20
|
+
parameters: {
|
|
21
|
+
sourceCode: [
|
|
22
|
+
{
|
|
23
|
+
name: 'Template',
|
|
24
|
+
code: `
|
|
25
|
+
<template>
|
|
26
|
+
<div style="padding: 20px; background: rgb(231, 236, 245)">
|
|
27
|
+
<MaintenancePage />
|
|
28
|
+
</div>
|
|
29
|
+
</template>
|
|
30
|
+
`,
|
|
31
|
+
}, {
|
|
32
|
+
name: 'Script',
|
|
33
|
+
code: `
|
|
34
|
+
<script setup lang="ts">
|
|
35
|
+
import { MaintenancePage } from '@cnamts/synapse'
|
|
36
|
+
</script>
|
|
37
|
+
`,
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { locales } from './locales'
|
|
3
|
+
import ErrorPage from '../ErrorPage/ErrorPage.vue'
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<template>
|
|
7
|
+
<ErrorPage
|
|
8
|
+
:page-title="locales.pageTitle"
|
|
9
|
+
:message="locales.message"
|
|
10
|
+
no-btn
|
|
11
|
+
>
|
|
12
|
+
<template #illustration>
|
|
13
|
+
<img
|
|
14
|
+
src="./assets/maintenance.svg"
|
|
15
|
+
:alt="locales.pageTitle"
|
|
16
|
+
>
|
|
17
|
+
</template>
|
|
18
|
+
</ErrorPage>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<style lang="scss" scoped>
|
|
22
|
+
img {
|
|
23
|
+
max-height: 290px;
|
|
24
|
+
}
|
|
25
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 171 172"><path fill="#e7ecf5" fill-rule="evenodd" d="M170.98 85.88c-.67 23.17-21.93 38.99-39.79 53.75-15.66 12.94-33.5 21.47-53.71 23.52-23.03 2.34-49.9 5.4-65.83-11.4C-4.15 135.07-.9 108.28 4.2 85.88 8.22 68.22 23.74 57.72 36.11 44.5c13.13-14.02 22.4-33.9 41.37-36.9 20.81-3.3 40.79 7.79 56.95 21.32 17.98 15.05 37.24 33.52 36.55 56.97Z" clip-rule="evenodd"/><circle cx="123.87" cy="127.71" r="17.83" fill="#fff" stroke="#0c419a" stroke-width="2"/><circle cx="126.62" cy="126.25" r="15.08" fill="#fff" stroke="#0c419a" stroke-width="2"/><circle cx="126.95" cy="125.92" r="10.86" fill="#fff" stroke="#0c419a" stroke-width="2"/><path fill="#0c419a" d="M87.88 67.72c0-19.13 13.03-28.19 24.48-30.48 21.07-4.21 54.13 12.81 54.63 57.07.42 36.27-15.75 76.47-51.55 76.52-32.75.05-41.02-27.72-45.88-34.2-1.66-2.2-5.02-8.76-8.76-11.68-2.48-1.93-8.1-1.9-12.48-3.73-4.8-2-11.98-8.02-13.46-13.94l-5.19-22.54c2.4-1.93 3.9-2.06 6.65-1.78.97 2.54 3.37 10.22 6.49 20.6 3.74 12.47 13.61 11.83 22.37 9.4 8.75-2.44 10.7-13.46 9.73-19.46-.78-4.8-5.73-15.19-8.11-19.78 2.02-2.3 3.46-2.8 6.32-2.92 1.2 2.43 4.22 8.66 6.81 14.1 3.24 6.82 3.73 12.81 3.24 16.87-.48 4.05-4.37 12.32-6.32 13.62-2.43 1.78-1.93 3.73-2.1 6.8-.36 6.15 8.87 41.35 40.69 41.19 34.77-.19 45.7-47.56 45.4-69.07-.6-41.99-30.97-55.12-46.54-51.07-8.47 2.2-19.74 6.98-20.26 24.48-.46 15.12 12.9 31.98 21.23 41.52 1.42 1.63 2.7 3.04 3.73 4.2-.64 2.43-2.75 4.05-4.7 4.86a217.2 217.2 0 0 1-4.05-4.34c-12.78-14.09-22.37-28.9-22.37-46.24Z"/><path fill="#0c419a" d="M120.8 35.67c-3-.16-5.91.05-8.64.59a32.39 32.39 0 0 0-17.06 9.22c-4.85 5.12-8.22 12.45-8.22 22.24 0 17.7 9.78 32.75 22.63 46.91l.74-.67-.74.67c1.34 1.47 2.7 2.93 4.07 4.36l.47.5.63-.27c2.16-.88 4.54-2.68 5.29-5.52l.13-.52-.35-.4c-1.04-1.17-2.3-2.57-3.72-4.2l-.75.66.74-.66c-8.3-9.5-21.42-26.32-20.98-40.83.25-8.54 3.08-13.8 6.83-17.28 3.75-3.48 8.51-5.18 12.68-6.26 14.75-3.84 44.7 8.6 45.29 50.11.15 10.58-2.5 27.72-9.45 42.08-6.95 14.37-18.02 25.89-34.95 25.98-15.55.08-25.46-8.41-31.57-17.78a56.35 56.35 0 0 1-6.43-13.66c-1.3-4.08-1.76-7.46-1.7-8.7.1-1.6.03-2.84.2-3.75.16-.92.45-1.52 1.5-2.3l-.04.03a7.72 7.72 0 0 0 2.04-2.4 34.63 34.63 0 0 0 2.03-3.79c1.3-2.8 2.42-5.88 2.7-8.14.5-4.26-.02-10.43-3.34-17.42-2.59-5.44-5.6-11.67-6.81-14.11l-.3-.59-.64.03c-2.96.13-4.9.84-7.03 3.26l-.45.51.31.61c1.18 2.27 3 6 4.63 9.75 1.62 3.74 3.03 7.55 3.38 9.73.45 2.8.22 6.93-1.16 10.55-1.39 3.6-3.83 6.66-7.85 7.78-4.3 1.2-8.8 1.9-12.54.9-3.73-1.02-6.8-3.62-8.61-9.63-2.06-6.86-3.06-9.84-4.3-13.66l-2.19-6.94-.02-.06-.2-.56-.63-.08c-2.83-.28-4.84-.04-7.38 2l-.49.4 5.35 23.15v.01c.8 3.25 3.09 6.34 5.75 8.92a28.5 28.5 0 0 0 8.28 5.7c2.34.98 4.9 1.43 7.14 1.9 2.25.45 4.17.96 5.12 1.7 1.7 1.32 3.44 3.63 4.94 5.87 1.49 2.24 2.71 4.4 3.63 5.61 1.1 1.46 2.56 4.44 4.54 7.98a67.85 67.85 0 0 0 7.99 11.64c6.9 7.9 17.5 15.02 34.15 14.99 18.28-.03 31.63-10.37 40.22-25.18 8.59-14.8 12.54-34.06 12.33-52.35-.44-39.16-26.18-57.56-47.2-58.63Zm-.12 2c19.88 1.01 44.88 18.36 45.31 56.65.2 17.98-3.72 36.95-12.06 51.33-8.34 14.38-20.96 24.16-38.5 24.18-16.08.02-26-6.72-32.64-14.31a65.94 65.94 0 0 1-7.74-11.3c-1.96-3.49-3.35-6.41-4.69-8.2-.74-.98-2.03-3.2-3.57-5.52-1.53-2.3-3.33-4.74-5.37-6.34-1.54-1.2-3.67-1.62-5.95-2.09-2.28-.46-4.72-.91-6.76-1.77a27 27 0 0 1-7.67-5.3c-2.5-2.41-4.54-5.3-5.2-7.96l-5.03-21.8a6.11 6.11 0 0 1 4.78-1.28l6.26 19.88c1.94 6.47 5.67 9.8 10 10.97 4.33 1.18 9.15.34 13.6-.9 4.73-1.31 7.64-4.98 9.17-8.99 1.54-4 1.8-8.38 1.28-11.58-.43-2.62-1.88-6.4-3.53-10.2a160.61 160.61 0 0 0-4.34-9.16 5.98 5.98 0 0 1 4.51-2.08c1.3 2.64 4.02 8.25 6.49 13.43 3.16 6.65 3.61 12.46 3.15 16.32-.21 1.8-1.28 4.87-2.53 7.54a32.87 32.87 0 0 1-1.9 3.56 8.1 8.1 0 0 1-1.46 1.8l-.01.02-.02.01a5.54 5.54 0 0 0-2.3 3.55c-.22 1.27-.13 2.53-.2 4-.12 1.85.43 5.18 1.77 9.41a58.24 58.24 0 0 0 6.66 14.16c6.36 9.73 16.98 18.76 33.26 18.68 17.83-.1 29.6-12.36 36.74-27.1 7.13-14.75 9.8-32.05 9.65-42.98-.6-42.47-31.4-56.3-47.8-52.03-4.3 1.12-9.4 2.9-13.53 6.74-4.13 3.83-7.2 9.72-7.47 18.68-.47 15.41 12.52 31.85 20.92 41.53a20.25 20.25 0 0 1-3.57 3.35c-12.38-13.8-21.5-28.16-21.5-44.85 0-9.34 3.14-16.1 7.66-20.86a30.46 30.46 0 0 1 16-8.64c2.55-.5 5.29-.7 8.13-.55zm-5.41 73.07 2.52 2.84a6.6 6.6 0 0 1-3.32 3.44c-.92-.97-1.84-1.96-2.75-2.95 1.3-.98 2.49-2.1 3.55-3.33z" color="#000"/><path fill="#fff" stroke="#0c419a" stroke-width="2" d="m34.44 82.53.1.36a6.74 6.74 0 0 0-3.73 1.04C26.1 64.48 15.89 25.9 28.38 12.6c4.54-4.54 10.21-6.1 12.48-6.32l.81 3.56a22.53 22.53 0 0 0-12 6.81c-9.96 10.61 1.1 52.13 4.77 65.88Z"/><path fill="#fff" stroke="#0c419a" stroke-width="2" d="M37.94 18.27c18 11.03 28.86 42.16 33.4 52.7A6.49 6.49 0 0 0 68 72.59c-6.39-16.54-19.2-44.02-30.06-50.75C29.25 16.46 21.9 18.6 18 20.71c-.05-1.7-.35-2.44-1.3-3.4 6.65-2.44 14.1-3.74 21.24.96Z"/><path fill="#0c419a" stroke="#0c419a" stroke-width="2" d="M46.86 10c-2.47 0-4.7 1.3-5.84-1.61-.65-1.79.16-3.41 1.46-3.9 1.3-.48 2.43-.64 2.92-1.13a7.2 7.2 0 0 1 3.73-2.1c2.24-.38 4.54.48 5.51 2.91a4.28 4.28 0 0 1-2.76 5.84c-1.45.48-3.72 0-5.02 0Z"/><ellipse cx="52.51" cy="5.35" fill="#fff" stroke="#fff" stroke-width="2" rx="1.12" ry="2.28" transform="rotate(-13 52.51 5.35)"/><path fill="#0c419a" stroke="#0c419a" stroke-width="2" d="M10.7 17.3c2.47 0 5.74-1.94 6.98 1.46.64 1.78.11 3.7-1.18 4.18-1.3.48-2.44.65-2.92 1.13a7.2 7.2 0 0 1-3.73 2.11c-2.25.38-4.67-.44-5.51-2.92-.77-2.23-.26-4.37 1.83-5.47 1.78-.94 2.75-.49 4.53-.49Z"/><ellipse cx="6.47" cy="22.53" fill="#fff" stroke="#fff" stroke-width="2" rx="1.12" ry="2.28" transform="rotate(158 6.47 22.53)"/></svg>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
import { shallowMount } from '@vue/test-utils'
|
|
3
|
+
|
|
4
|
+
import MaintenancePage from '../'
|
|
5
|
+
|
|
6
|
+
describe('MaintenancePage', () => {
|
|
7
|
+
it('renders correctly', () => {
|
|
8
|
+
const wrapper = shallowMount(MaintenancePage)
|
|
9
|
+
|
|
10
|
+
expect(wrapper.html()).toMatchSnapshot()
|
|
11
|
+
})
|
|
12
|
+
})
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
+
|
|
3
|
+
exports[`MaintenancePage > renders correctly 1`] = `"<error-page-stub data-v-25a0ed68="" pagetitle="Maintenance en cours" message="L’application n’est pas disponible pour le moment, veuillez nous excuser pour la gêne occasionnée." codeerrortext="Code d'erreur : " btnlink="/" hidebtn="false" no-btn=""></error-page-stub>"`;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Controls, Canvas, Meta, Source } from "@storybook/blocks";
|
|
2
|
+
import * as NotFoundPageStories from "./NotFoundPage.stories";
|
|
3
|
+
|
|
4
|
+
<Meta of={NotFoundPageStories} />
|
|
5
|
+
|
|
6
|
+
# NotFoundPage
|
|
7
|
+
|
|
8
|
+
Le composant `NotFoundPage` permet d'afficher une page 404.
|
|
9
|
+
Il est basé sur le composant `ErrorPage` du design system.
|
|
10
|
+
|
|
11
|
+
<Canvas of={NotFoundPageStories.Default} />
|
|
12
|
+
|
|
13
|
+
## Code d'erreur
|
|
14
|
+
|
|
15
|
+
Si un code d'erreur est passé en paramètre `support_id`, le composant l'affiche dans le template.
|
|
16
|
+
|
|
17
|
+
Exemple : `https://www.example.fr?support_id=1234567890123456789`
|
|
18
|
+
|
|
19
|
+
<Canvas of={NotFoundPageStories.WithErrorCode} />
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
import NotFoundPage from './NotFoundPage.vue'
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Templates/NotFoundPage',
|
|
6
|
+
component: NotFoundPage,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: 'fullscreen',
|
|
9
|
+
},
|
|
10
|
+
} satisfies Meta<typeof NotFoundPage>
|
|
11
|
+
|
|
12
|
+
export default meta
|
|
13
|
+
|
|
14
|
+
type Story = StoryObj<typeof NotFoundPage>
|
|
15
|
+
|
|
16
|
+
export const Default: Story = {
|
|
17
|
+
parameters: {
|
|
18
|
+
query: {
|
|
19
|
+
support_id: '',
|
|
20
|
+
},
|
|
21
|
+
sourceCode: [
|
|
22
|
+
{
|
|
23
|
+
name: 'Template',
|
|
24
|
+
code: `
|
|
25
|
+
<template>
|
|
26
|
+
<div style="padding: 20px; background: rgb(231, 236, 245)">
|
|
27
|
+
<NotFoundPage />
|
|
28
|
+
</div>
|
|
29
|
+
</template>
|
|
30
|
+
`,
|
|
31
|
+
}, {
|
|
32
|
+
name: 'Script',
|
|
33
|
+
code: `
|
|
34
|
+
<script setup lang="ts">
|
|
35
|
+
import { NotFoundPage } from '@cnamts/synapse'
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
`,
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
decorators: [
|
|
43
|
+
() => ({ template: '<div style="padding: 20px; background: rgb(231, 236, 245)"><story /></div>' }),
|
|
44
|
+
],
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export const WithErrorCode: Story = {
|
|
48
|
+
parameters: {
|
|
49
|
+
query: {
|
|
50
|
+
support_id: '1234567890123456789',
|
|
51
|
+
},
|
|
52
|
+
sourceCode: [
|
|
53
|
+
{
|
|
54
|
+
name: 'Template',
|
|
55
|
+
code: `
|
|
56
|
+
<template>
|
|
57
|
+
<div style="padding: 20px; background: rgb(231, 236, 245)">
|
|
58
|
+
<NotFoundPage />
|
|
59
|
+
</div>
|
|
60
|
+
</template>
|
|
61
|
+
`,
|
|
62
|
+
}, {
|
|
63
|
+
name: 'Script',
|
|
64
|
+
code: `
|
|
65
|
+
<script setup lang="ts">
|
|
66
|
+
import { NotFoundPage } from '@cnamts/synapse'
|
|
67
|
+
</script>
|
|
68
|
+
|
|
69
|
+
`,
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
},
|
|
73
|
+
decorators: [
|
|
74
|
+
() => ({ template: '<div style="padding: 20px; background: rgb(231, 236, 245)"><story /></div>' }),
|
|
75
|
+
],
|
|
76
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { onMounted, ref } from 'vue'
|
|
3
|
+
import ErrorPage from '../ErrorPage/ErrorPage.vue'
|
|
4
|
+
import { locales } from './locales'
|
|
5
|
+
|
|
6
|
+
const SUPPORT_ID_PARAM_NAME = 'support_id'
|
|
7
|
+
const supportId = ref<string | undefined>()
|
|
8
|
+
|
|
9
|
+
onMounted(() => {
|
|
10
|
+
const params = new URLSearchParams(document.location.search)
|
|
11
|
+
let supportIdParam = params.get(SUPPORT_ID_PARAM_NAME)
|
|
12
|
+
|
|
13
|
+
if (!supportIdParam) {
|
|
14
|
+
return
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
supportId.value = supportIdParam.trim().match(/.{1,4}/g)?.join(' ')
|
|
18
|
+
})
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<ErrorPage
|
|
23
|
+
:code="locales.code"
|
|
24
|
+
:page-title="locales.pageTitle"
|
|
25
|
+
:message="locales.message"
|
|
26
|
+
>
|
|
27
|
+
<template
|
|
28
|
+
v-if="supportId"
|
|
29
|
+
#additional-content
|
|
30
|
+
>
|
|
31
|
+
<p class="mt-4">
|
|
32
|
+
{{ locales.supportIdMessage }}
|
|
33
|
+
|
|
34
|
+
<b>{{ supportId }}</b>
|
|
35
|
+
.
|
|
36
|
+
</p>
|
|
37
|
+
</template>
|
|
38
|
+
|
|
39
|
+
<template #illustration>
|
|
40
|
+
<img
|
|
41
|
+
src="./assets/not-found.svg"
|
|
42
|
+
:alt="locales.pageTitle"
|
|
43
|
+
>
|
|
44
|
+
</template>
|
|
45
|
+
</ErrorPage>
|
|
46
|
+
</template>
|
|
47
|
+
|
|
48
|
+
<style lang="scss" scoped>
|
|
49
|
+
img {
|
|
50
|
+
max-height: 290px;
|
|
51
|
+
}
|
|
52
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 175 185"><path fill="#e7ecf5" fill-rule="evenodd" d="M82.05 1.03c25.02 4.23 35.74 31.89 52.64 50.76 15.22 17 38.8 29.7 39.77 52.46.99 23.2-15.89 44.01-35.1 57.13-16.47 11.25-37.51 3.39-57.3 5.99-25.97 3.41-55.68 29.28-74.73 11.37-18.93-17.8 7.49-48.54 7.6-74.49.11-25.7-20.98-52.27-6.95-73.83C23 7.3 54.8-3.56 82.05 1.03Z" clip-rule="evenodd"/><path fill="#fff" d="M101.76 132.91 80.07 96.9l-6.74-11.21 3.21-4.8s32.94-.8 35.35 0l35.34 56.04-4.01 4.8h-36.15l-5.31-8.82Z"/><path fill="#0c419a" d="m101.76 132.91 5.3 8.83h-.4l-52.48-8.01 47.58-.82Z"/><path fill="#fff" d="M54.18 133.73h-.13V96.9h26.03l21.68 36.01-47.58.82ZM54.05 96.9v36.83l-19.28-9.6V88.9l19.28 8Z"/><path fill="#0c419a" d="m63.87 64.26 17.25-5.12 20.51-6.1s2.54 4.43 9.87 2.6c-5.53 1.83-20.28 6.68-26.74 8.62-8.04 2.4-20.89 0-20.89 0Z"/><path fill="#fff" d="M111.5 55.64c-7.34 1.83-9.87-2.6-9.87-2.6l-20.51 6.1c1.6-1.37 7.76-7.03 8.46-13.3.8-7.2 3.21-15.21 9.64-18.41 5.82-2.9 27.96-15.14 32.1-17.43-1.19.84-2.39 2.33-3.42 4.89a28.8 28.8 0 0 0-1.37 4.53c-3.21 14.41-2.4 31.23-12.05 35.23-1.07.44-2.06.77-2.97 1Z"/><path fill="#0c419a" d="M131.32 10c2.88-2.03 5.66-.19 5.66-.19L128 14.93l-.1-.04c1.03-2.56 2.23-4.06 3.42-4.9Z"/><path stroke="#0c419a" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2" d="m111.5 55.64 2.14-.7M111.5 55.65c-7.33 1.82-9.87-2.6-9.87-2.6l-20.51 6.09-17.25 5.12s12.85 2.4 20.89 0c6.46-1.94 21.2-6.79 26.74-8.61ZM111.5 55.65h.01M128 14.93l8.98-5.12s-2.78-1.84-5.66.19c-1.19.84-2.39 2.33-3.42 4.89a28.8 28.8 0 0 0-1.37 4.53c-3.21 14.41-2.4 31.23-12.05 35.23-1.07.45-2.06.77-2.97 1"/><path stroke="#0c419a" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2" d="M80.74 59.45s.14-.1.38-.31c1.6-1.37 7.76-7.03 8.46-13.3.8-7.2 3.21-15.21 9.64-18.41 5.82-2.9 27.96-15.14 32.1-17.43l.67-.37M97.61 33.03l20.08-10.4M96 40.24l20.9-10.41M62.08 88.9H34.77l19.28 8h26.1M101.79 132.91h-.03l-47.58.82h-.13V96.9M54.05 133.73l-19.28-9.6V88.9M76.54 80.89l34.54 56.04h26.52"/><g stroke="#0c419a" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path stroke="#0c419a" stroke-miterlimit="10" d="m54.06 133.7.12.03 52.49 8h36.55l4.01-4.8L111.9 80.9c-2.41-.8-35.35 0-35.35 0l-3.22 4.8 6.75 11.21 21.69 36.02 5.3 8.82"/><path d="M1-1h6.27" transform="rotate(81.49 -7.48 56.18) skewX(.05)"/><path d="M1-1h7.26" transform="rotate(48.66 -44.44 74.2) skewX(.16)"/><path d="M1-1h4.39" transform="matrix(.9 .45 -.45 .9 38.17 66.32)"/></g></svg>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
import { mount } from '@vue/test-utils'
|
|
3
|
+
|
|
4
|
+
import { vuetify } from '@tests/unit/setup'
|
|
5
|
+
import { locales } from '../locales'
|
|
6
|
+
import NotFoundPage from '../NotFoundPage.vue'
|
|
7
|
+
|
|
8
|
+
describe('NotFoundPage', () => {
|
|
9
|
+
it('renders correctly', () => {
|
|
10
|
+
const wrapper = mount(NotFoundPage, {
|
|
11
|
+
global: {
|
|
12
|
+
plugins: [vuetify],
|
|
13
|
+
},
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
expect(wrapper.text()).toContain(locales.code)
|
|
17
|
+
expect(wrapper.text()).toContain(locales.message)
|
|
18
|
+
expect(wrapper.html()).toMatchSnapshot()
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
it('display the support ID if provided in the url', async () => {
|
|
22
|
+
history.replaceState(
|
|
23
|
+
{},
|
|
24
|
+
'',
|
|
25
|
+
'/not-found?support_id=1234567890123456789',
|
|
26
|
+
)
|
|
27
|
+
const wrapper = mount(NotFoundPage, {
|
|
28
|
+
global: {
|
|
29
|
+
plugins: [vuetify],
|
|
30
|
+
},
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
await wrapper.vm.$nextTick()
|
|
34
|
+
|
|
35
|
+
expect(wrapper.text()).toContain('1234 5678 9012 3456 789')
|
|
36
|
+
expect(wrapper.html()).toMatchSnapshot()
|
|
37
|
+
})
|
|
38
|
+
})
|