✨(frontend) improve accessibility of cdoc content with correct aria tags
added appropriate aria attributes and semantic tags to enhance accessibility Signed-off-by: Cyril <c.gromoff@gmail.com>
This commit is contained in:
@@ -145,12 +145,12 @@ export const ModalExport = ({ onClose, doc }: ModalExportProps) => {
|
||||
{t('Cancel')}
|
||||
</Button>
|
||||
<Button
|
||||
data-testid="doc-export-download-button"
|
||||
aria-label={t('Download')}
|
||||
color="primary"
|
||||
fullWidth
|
||||
onClick={() => void onSubmit()}
|
||||
disabled={isExporting}
|
||||
data-testid="modal-download-button"
|
||||
>
|
||||
{t('Download')}
|
||||
</Button>
|
||||
|
||||
@@ -105,7 +105,7 @@ const DocTitleInput = ({ doc }: DocTitleProps) => {
|
||||
}, [doc]);
|
||||
|
||||
return (
|
||||
<Tooltip content={t('Rename')} placement="top">
|
||||
<Tooltip content={t('Rename')} aria-hidden={true} placement="top">
|
||||
<Box
|
||||
as="span"
|
||||
role="textbox"
|
||||
@@ -114,7 +114,8 @@ const DocTitleInput = ({ doc }: DocTitleProps) => {
|
||||
defaultValue={titleDisplay || undefined}
|
||||
onKeyDownCapture={handleKeyDown}
|
||||
suppressContentEditableWarning={true}
|
||||
aria-label="doc title input"
|
||||
aria-label={`${t('Document title')}`}
|
||||
aria-multiline={false}
|
||||
onBlurCapture={(event) =>
|
||||
handleTitleSubmit(event.target.textContent || '')
|
||||
}
|
||||
|
||||
@@ -215,7 +215,7 @@ export const DocToolBox = ({ doc }: DocToolBoxProps) => {
|
||||
>
|
||||
<Button
|
||||
color="tertiary"
|
||||
aria-label="Share button"
|
||||
aria-label={t('Share button')}
|
||||
icon={
|
||||
<Icon iconName="group" $theme="primary" $variation="800" />
|
||||
}
|
||||
@@ -233,9 +233,15 @@ export const DocToolBox = ({ doc }: DocToolBoxProps) => {
|
||||
|
||||
{!isSmallMobile && ModalExport && (
|
||||
<Button
|
||||
data-testid="doc-open-modal-download-button"
|
||||
color="tertiary-text"
|
||||
icon={
|
||||
<Icon iconName="download" $theme="primary" $variation="800" />
|
||||
<Icon
|
||||
iconName="download"
|
||||
$theme="primary"
|
||||
$variation="800"
|
||||
aria-hidden={true}
|
||||
/>
|
||||
}
|
||||
onClick={() => {
|
||||
setIsModalExportOpen(true);
|
||||
|
||||
@@ -83,7 +83,7 @@ export const SimpleDocItem = ({
|
||||
<Box $justify="center" $overflow="auto">
|
||||
<Text
|
||||
aria-describedby="doc-title"
|
||||
aria-label={displayTitle}
|
||||
aria-label={doc.title || untitledDocument}
|
||||
$size="sm"
|
||||
$variation="1000"
|
||||
$weight="500"
|
||||
|
||||
@@ -102,7 +102,7 @@ export const DocRoleDropdown = ({
|
||||
|
||||
if (!canUpdate) {
|
||||
return (
|
||||
<Text aria-label="doc-role-text" $variation="600">
|
||||
<Text aria-label={t('Document role text')} $variation="600">
|
||||
{transRole(currentRole)}
|
||||
</Text>
|
||||
);
|
||||
|
||||
@@ -302,8 +302,11 @@
|
||||
"Document accessible to any connected person": "Dokument für jeden angemeldeten Benutzer zugänglich",
|
||||
"Document duplicated successfully!": "Dokument erfolgreich dupliziert!",
|
||||
"Document owner": "Besitzer des Dokuments",
|
||||
"Document title": "Dokumenttitel",
|
||||
"Document sections": "Dokumentabschnitte",
|
||||
"Docx": "Docx",
|
||||
"Download": "Herunterladen",
|
||||
"Download the document": "Dokument herunterladen",
|
||||
"Download anyway": "Trotzdem herunterladen",
|
||||
"Download your document in a .docx or .pdf format.": "Ihr Dokument als .docx- oder .pdf-Datei herunterladen.",
|
||||
"Duplicate": "Duplizieren",
|
||||
@@ -451,6 +454,7 @@
|
||||
"en": {
|
||||
"translation": {
|
||||
"Back to homepage": "Back to Docs homepage",
|
||||
"Document title": "Document title",
|
||||
"Search docs": "Search docs",
|
||||
"More options": "More options",
|
||||
"Pinned documents": "Pinned documents",
|
||||
@@ -527,8 +531,11 @@
|
||||
"Docs: Your new companion to collaborate on documents efficiently, intuitively, and securely.": "Docs: su nuevo compañero para colaborar en documentos de forma eficiente, intuitiva y segura.",
|
||||
"Document accessible to any connected person": "Documento accesible a cualquier persona conectada",
|
||||
"Document owner": "Propietario del documento",
|
||||
"Document title": "Título del documento",
|
||||
"Document sections": "Secciones del documento",
|
||||
"Docx": "Docx",
|
||||
"Download": "Descargar",
|
||||
"Download the document": "Descargar el documento",
|
||||
"Download anyway": "Descargar de todos modos",
|
||||
"Download your document in a .docx or .pdf format.": "Descargue su documento en formato .docx o .pdf.",
|
||||
"Editor": "Editor",
|
||||
@@ -726,10 +733,12 @@
|
||||
"Document duplicated successfully!": "Document dupliqué avec succès !",
|
||||
"Document emoji icon": "Émoticônes du document",
|
||||
"Document owner": "Propriétaire du document",
|
||||
"Document title": "Titre du document",
|
||||
"Document sections": "Sections du document",
|
||||
"Document visibility": "Visibilité du document",
|
||||
"Docx": "Docx",
|
||||
"Download": "Télécharger",
|
||||
"Download the document": "Télécharger le document",
|
||||
"Download anyway": "Télécharger malgré tout",
|
||||
"Download your document in a .docx or .pdf format.": "Téléchargez votre document au format .docx ou .pdf.",
|
||||
"Duplicate": "Dupliquer",
|
||||
@@ -1105,8 +1114,11 @@
|
||||
"Docs: Your new companion to collaborate on documents efficiently, intuitively, and securely.": "Docs: Je nieuwe metgezel om efficiënt, intuïtief en veilig samen te werken aan documenten.",
|
||||
"Document accessible to any connected person": "Document is toegankelijk voor ieder verbonden persoon",
|
||||
"Document owner": "Document eigenaar",
|
||||
"Document title": "Documenttitel",
|
||||
"Document sections": "Document secties",
|
||||
"Docx": "Docx",
|
||||
"Download": "Download",
|
||||
"Download the document": "Document downloaden",
|
||||
"Download anyway": "Download alsnog",
|
||||
"Download your document in a .docx or .pdf format.": "Download jouw document in .docx of .pdf formaat.",
|
||||
"Editor": "Bewerker",
|
||||
|
||||
Reference in New Issue
Block a user