Skip to content

Commit 8edc540

Browse files
committed
✨(frontend) make delete buttons nvda-accessible; add close to title aria-label
add aria-labels and include close button in title prop so NVDA announces actions Signed-off-by: Cyril <[email protected]>
1 parent 0cf8b9d commit 8edc540

File tree

7 files changed

+96
-17
lines changed

7 files changed

+96
-17
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ and this project adheres to
1717
- #1262
1818
- #1244
1919
- #1270
20+
- #1281
2021

2122
### Fixed
2223

src/frontend/apps/impress/src/features/docs/doc-export/components/ModalExport.tsx

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ export const ModalExport = ({ onClose, doc }: ModalExportProps) => {
131131
isOpen
132132
closeOnClickOutside
133133
onClose={() => onClose()}
134+
hideCloseButton
134135
rightActions={
135136
<>
136137
<Button
@@ -155,9 +156,32 @@ export const ModalExport = ({ onClose, doc }: ModalExportProps) => {
155156
}
156157
size={ModalSize.MEDIUM}
157158
title={
158-
<Text $size="h6" $variation="1000" $align="flex-start">
159-
{t('Download')}
160-
</Text>
159+
<Box
160+
$direction="row"
161+
$justify="space-between"
162+
$align="center"
163+
$width="100%"
164+
>
165+
<Text $size="h6" $variation="1000" $align="flex-start">
166+
{t('Download')}
167+
</Text>
168+
<Button
169+
aria-label={t('Close the download modal')}
170+
size="small"
171+
color="primary-text"
172+
onClick={() => onClose()}
173+
disabled={isExporting}
174+
icon={
175+
<Box
176+
as="span"
177+
aria-hidden="true"
178+
className="material-icons-filled"
179+
>
180+
close
181+
</Box>
182+
}
183+
/>
184+
</Box>
161185
}
162186
>
163187
<Box

src/frontend/apps/impress/src/features/docs/doc-management/components/ModalRemoveDoc.tsx

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { usePathname } from 'next/navigation';
99
import { useRouter } from 'next/router';
1010
import { Trans, useTranslation } from 'react-i18next';
1111

12-
import { Box, Text, TextErrors } from '@/components';
12+
import { Box, Icon, Text, TextErrors } from '@/components';
1313

1414
import { useRemoveDoc } from '../api/useRemoveDoc';
1515
import { Doc } from '../types';
@@ -53,11 +53,12 @@ export const ModalRemoveDoc = ({
5353
<Modal
5454
isOpen
5555
closeOnClickOutside
56+
hideCloseButton
5657
onClose={() => onClose()}
5758
rightActions={
5859
<>
5960
<Button
60-
aria-label={t('Close the modal')}
61+
aria-label={t('Close the delete modal')}
6162
color="secondary"
6263
fullWidth
6364
onClick={() => onClose()}
@@ -80,15 +81,29 @@ export const ModalRemoveDoc = ({
8081
}
8182
size={ModalSize.MEDIUM}
8283
title={
83-
<Text
84-
$size="h6"
85-
as="h6"
86-
$margin={{ all: '0' }}
87-
$align="flex-start"
88-
$variation="1000"
84+
<Box
85+
$direction="row"
86+
$justify="space-between"
87+
$align="center"
88+
$width="100%"
8989
>
90-
{t('Delete a doc')}
91-
</Text>
90+
<Text
91+
$size="h6"
92+
as="h6"
93+
$margin={{ all: '0' }}
94+
$align="flex-start"
95+
$variation="1000"
96+
>
97+
{t('Delete a doc')}
98+
</Text>
99+
<Button
100+
aria-label={t('Close the delete modal')}
101+
size="small"
102+
color="primary-text"
103+
onClick={() => onClose()}
104+
icon={<Icon iconName="close" />}
105+
/>
106+
</Box>
92107
}
93108
>
94109
<Box

src/frontend/apps/impress/src/features/docs/doc-share/components/DocShareAccessRequest.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ const DocShareAccessRequestItem = ({ doc, accessRequest }: Props) => {
100100
docId: doc.id,
101101
})
102102
}
103+
aria-label={t('Close the access request modal')}
103104
>
104105
<Icon iconName="close" $variation="600" $size="16px" />
105106
</BoxButton>

src/frontend/apps/impress/src/features/docs/doc-share/components/DocShareModal.tsx

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Modal, ModalSize } from '@openfun/cunningham-react';
1+
import { Button, Modal, ModalSize } from '@openfun/cunningham-react';
22
import { useMemo, useRef, useState } from 'react';
33
import { useTranslation } from 'react-i18next';
44
import { createGlobalStyle, css } from 'styled-components';
@@ -137,12 +137,29 @@ export const DocShareModal = ({ doc, onClose, isRootDoc = true }: Props) => {
137137
aria-label={t('Share modal')}
138138
size={isDesktop ? ModalSize.LARGE : ModalSize.FULL}
139139
onClose={onClose}
140-
title={<Box $align="flex-start">{t('Share the document')}</Box>}
140+
title={
141+
<Box $direction="row" $justify="space-between" $align="center">
142+
<Box $align="flex-start">{t('Share the document')}</Box>
143+
<Button
144+
aria-label={t('Close the modal')}
145+
size="small"
146+
color="primary-text"
147+
onClick={onClose}
148+
icon={
149+
<Box aria-hidden="true" className="material-icons-filled">
150+
close
151+
</Box>
152+
}
153+
/>
154+
</Box>
155+
}
156+
hideCloseButton
141157
>
142158
<ShareModalStyle />
143159
<Box
144160
aria-label={t('Share modal')}
145-
$height={canViewAccesses ? modalContentHeight : 'auto'}
161+
$height="auto"
162+
$maxHeight={canViewAccesses ? modalContentHeight : 'none'}
146163
$overflow="hidden"
147164
className="--docs--doc-share-modal noPadding "
148165
$justify="space-between"

src/frontend/apps/impress/src/features/docs/doc-versioning/components/ModalSelectVersion.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ export const ModalSelectVersion = ({
118118
onClick={onClose}
119119
size="nano"
120120
color="primary-text"
121+
aria-label={t('Close the version history modal')}
121122
icon={<Icon iconName="close" />}
122123
/>
123124
</Box>

src/frontend/apps/impress/src/i18n/translations.json

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,9 @@
186186
"Can't load this page, please check your internet connection.": "Diese Seite kann nicht geladen werden. Bitte überprüfen Sie Ihre Internetverbindung.",
187187
"Cancel": "Abbrechen",
188188
"Close the modal": "Pop-up schließen",
189+
"Close the access request modal": "Zugriffsanfrage-Modal schließen",
190+
"Close the delete modal": "Lösch-Modal schließen",
191+
"Close the version history modal": "Versionsverlauf-Modal schließen",
189192
"Collaborate": "Zusammenarbeiten",
190193
"Collaborate and write in real time, without layout constraints.": "In Echtzeit und ohne Layout-Beschränkungen schreiben und zusammenarbeiten.",
191194
"Collaborative writing, Simplified.": "Kollaboratives Schreiben, vereinfacht.",
@@ -375,6 +378,9 @@
375378
"Search docs": "Search docs",
376379
"More options": "More options",
377380
"Pinned documents": "Pinned documents",
381+
"Close the access request modal": "Close the access request modal",
382+
"Close the delete modal": "Close the delete modal",
383+
"Close the version history modal": "Close the version history modal",
378384
"Open actions menu for document: {{title}}": "Open actions menu for document: {{title}}",
379385
"Open the menu of actions for the document: {{title}}": "Open the menu of actions for the document: {{title}}",
380386
"Share with {{count}} users_one": "Share with {{count}} user",
@@ -413,6 +419,9 @@
413419
"Can't load this page, please check your internet connection.": "No se puede cargar esta página, por favor compruebe su conexión a Internet.",
414420
"Cancel": "Cancelar",
415421
"Close the modal": "Cerrar modal",
422+
"Close the access request modal": "Cerrar modal de solicitud de acceso",
423+
"Close the delete modal": "Cerrar modal de eliminación",
424+
"Close the version history modal": "Cerrar modal de historial de versiones",
416425
"Collaborate": "Colabora",
417426
"Collaborate and write in real time, without layout constraints.": "Colaborar y escribir en tiempo real, sin restricciones de diseño.",
418427
"Collaborative writing, Simplified.": "Escritura colaborativa, más sencilla.",
@@ -605,6 +614,10 @@
605614
"Can't load this page, please check your internet connection.": "Impossible de charger cette page, veuillez vérifier votre connexion Internet.",
606615
"Cancel": "Annuler",
607616
"Close the modal": "Fermer la modale",
617+
"Close the access request modal": "Fermer la modale de demande d'accès",
618+
"Close the delete modal": "Fermer la modale de suppression",
619+
"Close the download modal": "Fermer la modale de téléchargement",
620+
"Close the version history modal": "Fermer la modale d'historique des versions",
608621
"Collaborate": "Collaborer",
609622
"Collaborate and write in real time, without layout constraints.": "Collaborez et rédigez en temps réel, sans contrainte de mise en page.",
610623
"Collaborative writing, Simplified.": "L'écriture collaborative simplifiée.",
@@ -769,6 +782,10 @@
769782
"Summarize": "Résumer",
770783
"Summary": "Sommaire",
771784
"Template": "Modèle",
785+
"Document template": "Modèle de document",
786+
"File format": "Format de fichier",
787+
"Choose a template to apply to your document before download": "Choisissez un modèle à appliquer à votre document avant le téléchargement",
788+
"Choose the file format for your download": "Choisissez le format de fichier pour votre téléchargement",
772789
"The antivirus has detected an anomaly in your file.": "L'antivirus a détecté une anomalie dans votre fichier.",
773790
"The document has been deleted.": "Le document a bien été supprimé.",
774791
"The document visibility has been updated.": "La visibilité du document a été mise à jour.",
@@ -983,6 +1000,9 @@
9831000
"Can't load this page, please check your internet connection.": "Kan deze pagina niet laden. Controleer je internetverbinding.",
9841001
"Cancel": "Breek af",
9851002
"Close the modal": "Sluit het venster",
1003+
"Close the access request modal": "Sluit het toegangsverzoek venster",
1004+
"Close the delete modal": "Sluit het verwijder venster",
1005+
"Close the version history modal": "Sluit het versiehistorie venster",
9861006
"Collaborate": "Samenwerken",
9871007
"Collaborate and write in real time, without layout constraints.": "Samenwerken en schrijven in realtime, zonder lay-out beperkingen.",
9881008
"Collaborative writing, Simplified.": "Vereenvoudigd samenwerkend",
@@ -1110,7 +1130,7 @@
11101130
"Start Writing": "Begin met schrijven",
11111131
"Summarize": "Vat samen",
11121132
"Summary": "Samenvatting",
1113-
"Template": "Template",
1133+
"Template": "Sjabloon",
11141134
"The document has been deleted.": "Het document is verwijderd",
11151135
"The document visibility has been updated.": "De zichtbaarheid van het document is bijgewerkt",
11161136
"The export failed": "Het exporteren is mislukt",

0 commit comments

Comments
 (0)