Skip to content

Commit 2868c24

Browse files
authored
Revoit la fonctionnalité "Annoter l'audit" (#1110)
* update notes modal wording and add hint * rename and move report notes tab * update audit header actions positions * clean old css in AuditGenerationHeader * update e2e tests * update dropdown option in audits page + add copy audit link button to audit page dropdown * add copy audit link test to audit specs * fix typos * delete unused class * update editor minimum height in notes modal * update changelog
1 parent 2bd4f71 commit 2868c24

10 files changed

Lines changed: 149 additions & 187 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#### <span aria-hidden="true">⚙️</span> Autres changements
1010

11+
- Mise à jour du menu principal de la page "Audit" et de la modale des observations (anciennement "Notes") ([#1110](https://github.com/DISIC/Ara/pull/1110))
1112
- Modifie le thème visuel des blocs de code de l’éditeur pour assurer un bon contraste des couleurs ([#1124](https://github.com/DISIC/Ara/pull/1124))
1213

1314
#### <span aria-hidden="true">🐛</span> Corrections

confiture-web-app/src/components/account/dashboard/AuditRow.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,9 +311,9 @@ function copyStatementLink(uniqueId: string) {
311311
name: 'report',
312312
params: { uniqueId: audit.consultUniqueId }
313313
}"
314-
target="_blank "
315-
class="fr-btn fr-btn--tertiary-no-outline fr-btn--icon-left fr-icon-eye-line fr-m-0 no-external-icon"
316-
>Voir le rapport
314+
target="_blank"
315+
class="fr-btn fr-btn--tertiary-no-outline fr-m-0"
316+
>Consulter le rapport
317317
<span class="fr-sr-only"> {{ audit.procedureName }}</span>
318318
</RouterLink>
319319
</li>

confiture-web-app/src/components/audit/AuditGenerationHeader.vue

Lines changed: 68 additions & 131 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,18 @@ const csvExportSizeEstimation = computed(() => {
183183
return 502 + Object.keys(resultsStore.data ?? {}).length * 318;
184184
});
185185
186+
function copyAuditLink(uniqueId: string) {
187+
const url = `${window.location.origin}/audits/${uniqueId}/generation`;
188+
189+
navigator.clipboard.writeText(url).then(() => {
190+
notify(
191+
"success",
192+
undefined,
193+
"Le lien vers l’audit a bien été copié dans le presse-papier."
194+
);
195+
});
196+
}
197+
186198
const isDevMode = useDevMode();
187199
188200
const systemStore = useSystemStore();
@@ -231,7 +243,7 @@ onMounted(() => {
231243
</h1>
232244
<p class="fr-text--xl fr-mb-4w">{{ auditName }}</p>
233245

234-
<div ref="stickyIndicator" class="sticky-indicator fr-grid-row fr-mb-3w">
246+
<div ref="stickyIndicator" class="fr-grid-row fr-mb-3w sticky-indicator">
235247
<div
236248
v-if="!systemStore.isOnline"
237249
id="offlineAlert"
@@ -247,7 +259,7 @@ onMounted(() => {
247259
</div>
248260

249261
<div
250-
class="indicator-left-side fr-col-12 fr-col-sm-5 fr-col-md-3"
262+
class="fr-col-12 fr-col-sm-5 fr-col-md-3 indicator-left-side"
251263
:class="{ 'with-border': showLeftSideBorders }"
252264
>
253265
<AuditProgressBar
@@ -291,64 +303,25 @@ onMounted(() => {
291303
v-if="route.name === 'audit-generation-full'"
292304
class="audit-main-indicator"
293305
/>
294-
<ul class="top-actions fr-my-0 fr-p-0" role="list">
295-
<li class="fr-p-0 settings-item">
296-
<RouterLink
297-
class="fr-btn fr-btn--tertiary-no-outline fr-btn--icon-left fr-icon-settings-5-line"
298-
:to="{
299-
name: 'audit-settings',
300-
params: { uniqueId: editUniqueId }
301-
}"
302-
>
303-
Paramètres
304-
</RouterLink>
305-
</li>
306-
306+
<ul class="fr-my-0 fr-p-0 top-actions" role="list">
307307
<li class="fr-p-0">
308308
<Dropdown
309309
ref="optionsDropdownRef"
310-
title="Actions"
310+
title="Options"
311311
:disabled="isOffline"
312312
>
313313
<ul role="list" class="fr-p-0 fr-m-0 dropdown-list">
314-
<li class="dropdown-item notes-item mobile-dropdown-item">
314+
<li class="fr-hidden-lg dropdown-item">
315315
<button
316316
class="fr-btn fr-btn--tertiary-no-outline fr-btn--icon-left fr-icon-draft-line"
317317
:disabled="isOffline"
318318
@click="openNotesModal"
319319
>
320-
Annoter l’audit
321-
</button>
322-
</li>
323-
<li
324-
aria-hidden="true"
325-
class="dropdown-separator mobile-dropdown-item"
326-
/>
327-
<li class="dropdown-item">
328-
<button
329-
class="fr-btn fr-btn--tertiary-no-outline"
330-
@click="duplicateModal?.show()"
331-
>
332-
<CopyIcon class="fr-mr-2v" />
333-
Dupliquer l’audit
320+
Ajouter des observations
334321
</button>
335322
</li>
336-
<li class="fr-p-0 settings-item mobile-dropdown-item">
337-
<RouterLink
338-
class="fr-btn fr-btn--tertiary-no-outline fr-btn--icon-left fr-icon-settings-5-line"
339-
:to="{
340-
name: 'audit-settings',
341-
params: { uniqueId: editUniqueId }
342-
}"
343-
>
344-
Accéder aux paramètres
345-
</RouterLink>
346-
</li>
347-
<li
348-
aria-hidden="true"
349-
class="dropdown-separator mobile-dropdown-item"
350-
/>
351-
<li class="fr-p-0 report-item mobile-dropdown-item">
323+
<li aria-hidden="true" class="fr-hidden-lg dropdown-separator" />
324+
<li class="fr-p-0 dropdown-item">
352325
<component
353326
:is="isOffline ? 'button' : 'RouterLink'"
354327
class="fr-btn fr-btn--tertiary-no-outline fr-btn--icon-left"
@@ -362,10 +335,50 @@ onMounted(() => {
362335
:disabled="isOffline"
363336
>
364337
Consulter le rapport
365-
<span class="fr-sr-only">(Nouvelle fenêtre)</span>
338+
<span class="fr-sr-only">(nouvelle fenêtre)</span>
366339
</component>
367340
</li>
368341
<li aria-hidden="true" class="dropdown-separator" />
342+
<li class="fr-p-0 dropdown-item">
343+
<RouterLink
344+
class="fr-btn fr-btn--tertiary-no-outline fr-btn--icon-left fr-icon-settings-5-line"
345+
:to="{
346+
name: 'audit-settings',
347+
params: { uniqueId: editUniqueId }
348+
}"
349+
>
350+
Modifier les paramètres <span class="fr-hidden fr-unhidden-lg"
351+
>de l’audit</span
352+
>
353+
</RouterLink>
354+
</li>
355+
<li class="dropdown-item">
356+
<button
357+
class="fr-btn fr-btn--tertiary-no-outline"
358+
@click="duplicateModal?.show()"
359+
>
360+
<CopyIcon class="fr-mr-2v" />
361+
Dupliquer l’audit
362+
</button>
363+
</li>
364+
<li
365+
v-if="editUniqueId"
366+
class="dropdown-item dropdown-item--with-meta"
367+
>
368+
<button
369+
class="fr-btn fr-btn--tertiary-no-outline fr-btn--icon-left fr-icon-link fr-m-0"
370+
@click="copyAuditLink(editUniqueId)"
371+
>
372+
Copier le lien de l’audit
373+
<span class="fr-sr-only">
374+
{{ auditStore.currentAudit?.procedureName }}</span
375+
>
376+
<span class="fr-text--xs fr-text--regular dropdown-item-meta">
377+
Ce lien permet de modifier l’audit
378+
</span>
379+
</button>
380+
</li>
381+
<li aria-hidden="true" class="dropdown-separator" />
369382
<li class="dropdown-item">
370383
<a
371384
class="fr-btn fr-btn--tertiary-no-outline fr-btn--icon-left fr-icon-download-fill download-link"
@@ -378,7 +391,7 @@ onMounted(() => {
378391
</span>
379392
</a>
380393
</li>
381-
<li aria-hidden="true" class="dropdown-separator"></li>
394+
<li aria-hidden="true" class="dropdown-separator" />
382395
<li class="dropdown-item">
383396
<button
384397
class="fr-btn fr-btn--tertiary-no-outline fr-btn--icon-left fr-icon-delete-line fr-m-0 danger-button--secondary"
@@ -391,29 +404,13 @@ onMounted(() => {
391404
</Dropdown>
392405
</li>
393406

394-
<li class="fr-p-0 report-item">
395-
<component
396-
:is="isOffline ? 'button' : 'RouterLink'"
397-
class="fr-btn fr-btn--secondary fr-btn--icon-left"
398-
:to="{
399-
name: 'report',
400-
params: { uniqueId: auditStore.currentAudit?.consultUniqueId }
401-
}"
402-
target="_blank"
403-
:disabled="isOffline"
404-
>
405-
Consulter le rapport
406-
<span class="fr-sr-only">(Nouvelle fenêtre)</span>
407-
</component>
408-
</li>
409-
410-
<li class="fr-p-0 notes-item">
407+
<li class="fr-unhidden-lg fr-p-0 notes-desktop-link">
411408
<button
412409
class="fr-btn fr-btn--secondary fr-btn--icon-left fr-icon-draft-line"
413410
:disabled="isOffline"
414411
@click="openNotesModal"
415412
>
416-
Annoter l’audit
413+
Ajouter des observations
417414
</button>
418415
</li>
419416
</ul>
@@ -473,14 +470,6 @@ onMounted(() => {
473470
z-index: 3;
474471
}
475472
476-
.heading {
477-
align-items: center;
478-
display: flex;
479-
justify-content: space-between;
480-
gap: 1rem;
481-
flex-wrap: wrap;
482-
}
483-
484473
.top-actions {
485474
display: flex;
486475
align-items: center;
@@ -498,21 +487,8 @@ onMounted(() => {
498487
color: var(--text-mention-grey);
499488
}
500489
501-
.info {
502-
border: 1px solid var(--border-default-grey);
503-
min-height: 100%;
504-
}
505-
506-
.info-value {
507-
text-transform: capitalize;
508-
}
509-
510-
.info-label {
511-
color: var(--text-mention-grey);
512-
}
513-
514-
.info-sub-text {
515-
text-transform: none;
490+
.notes-desktop-link {
491+
display: none;
516492
}
517493
518494
.offline-alert {
@@ -529,9 +505,11 @@ onMounted(() => {
529505
background: var(--background-default-grey);
530506
min-height: 4rem;
531507
}
508+
532509
.audit-main-indicator {
533510
margin-left: 2rem;
534511
}
512+
535513
@media (width < 36rem) {
536514
.audit-main-indicator {
537515
margin-left: 0;
@@ -548,15 +526,6 @@ onMounted(() => {
548526
color: var(--text-default-success);
549527
}
550528
551-
.separator {
552-
width: 1px;
553-
background-color: var(--border-default-grey);
554-
}
555-
556-
.sticky-grid {
557-
flex: 1;
558-
}
559-
560529
.indicator-left-side {
561530
display: flex;
562531
align-items: center;
@@ -588,38 +557,6 @@ onMounted(() => {
588557
flex-grow: 1;
589558
}
590559
591-
/* Display / Hide items from the menu in the toolbar or in the dropdown */
592-
.mobile-dropdown-item {
593-
display: none;
594-
}
595-
596-
@media (width < 83rem) {
597-
.report-item.mobile-dropdown-item {
598-
display: block;
599-
}
600-
.report-item:not(.mobile-dropdown-item) {
601-
display: none;
602-
}
603-
}
604-
605-
@media (width < 64rem) {
606-
.settings-item.mobile-dropdown-item {
607-
display: block;
608-
}
609-
.settings-item:not(.mobile-dropdown-item) {
610-
display: none;
611-
}
612-
}
613-
614-
@media (width < 50rem) {
615-
.notes-item.mobile-dropdown-item {
616-
display: block;
617-
}
618-
.notes-item:not(.mobile-dropdown-item) {
619-
display: none;
620-
}
621-
}
622-
623560
.metrics {
624561
display: grid;
625562
grid-template-columns: repeat(v-bind("keyInfos.length"), 1fr);

confiture-web-app/src/components/audit/NotesModal.vue

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,20 +97,29 @@ function handleDeleteFile(file: AuditFile) {
9797
</button>
9898
<div class="title-container">
9999
<h1 id="notes-modal-title" class="fr-modal__title">
100-
Annotations de l’audit
100+
Observations
101101
</h1>
102102
<SaveIndicator :store-name="StoreName.AUDIT_STORE" />
103103
</div>
104+
<p class="fr-text--xs fr-m-0">
105+
Vos observations seront affichées dans le rapport d’audit.
106+
</p>
104107
</div>
105-
<p id="audit-notes" class="fr-label">
106-
Remarques et recommandations générales
108+
<p id="audit-notes" class="fr-label fr-mb-1w">
109+
Points à signaler ne concernant pas l’accessibilité du site
110+
audité
111+
<span class="fr-hint-text fr-mt-1v"
112+
>Exemple : temps de chargement excessif sur certaines pages,
113+
incohérences dans l'usage des couleurs, bug</span
114+
>
107115
</p>
108116
<TiptapEditor
109117
v-model="notes"
110118
class="fr-mb-4w"
111119
labelled-by="audit-notes"
112120
:disabled="isOffline"
113121
editor-size="lg"
122+
style="--tiptap-editor-height: 16.5rem"
114123
@update:model-value="handleNotesChange"
115124
/>
116125

@@ -138,24 +147,32 @@ function handleDeleteFile(file: AuditFile) {
138147
padding-left: 3rem;
139148
padding-right: 3rem;
140149
}
150+
141151
.sidebar-header {
142152
display: flex;
143153
flex-direction: row-reverse;
144154
flex-wrap: wrap;
145-
column-gap: 1rem;
146155
align-items: center;
156+
justify-content: start;
157+
gap: 0.5rem 1rem;
147158
margin: 2rem 0 1.5rem 0;
148-
padding: 0.75rem 0;
159+
padding-top: 0.75rem;
149160
position: sticky;
150161
top: 0;
151162
z-index: 9;
152163
background-color: var(--background-lifted-grey);
153164
}
165+
154166
.sidebar-header h1 {
155167
margin-bottom: 0;
156168
padding-right: 1rem;
157169
margin-right: 1rem;
158170
}
171+
172+
.sidebar-header p {
173+
color: var(--text-mention-grey);
174+
}
175+
159176
.title-container {
160177
flex-basis: 100%;
161178
flex-grow: 1;

0 commit comments

Comments
 (0)