diff --git a/src/frontend/apps/e2e/__tests__/app-impress/doc-export.spec.ts b/src/frontend/apps/e2e/__tests__/app-impress/doc-export.spec.ts index 0e37740f8..1217ca6b6 100644 --- a/src/frontend/apps/e2e/__tests__/app-impress/doc-export.spec.ts +++ b/src/frontend/apps/e2e/__tests__/app-impress/doc-export.spec.ts @@ -18,7 +18,7 @@ test.describe('Doc Export', () => { await createDoc(page, 'doc-editor', browserName, 1); await page .getByRole('button', { - name: 'download', + name: 'Export the document', }) .click(); @@ -71,7 +71,7 @@ test.describe('Doc Export', () => { await page .getByRole('button', { - name: 'download', + name: 'Export the document', exact: true, }) .click(); @@ -121,7 +121,7 @@ test.describe('Doc Export', () => { await page .getByRole('button', { - name: 'download', + name: 'Export the document', exact: true, }) .click(); @@ -189,7 +189,7 @@ test.describe('Doc Export', () => { await page .getByRole('button', { - name: 'download', + name: 'Export the document', }) .click(); @@ -266,7 +266,7 @@ test.describe('Doc Export', () => { await page .getByRole('button', { - name: 'download', + name: 'Export the document', }) .click(); @@ -316,7 +316,7 @@ test.describe('Doc Export', () => { await page .getByRole('button', { - name: 'download', + name: 'Export the document', exact: true, }) .click(); diff --git a/src/frontend/apps/e2e/__tests__/app-impress/doc-header.spec.ts b/src/frontend/apps/e2e/__tests__/app-impress/doc-header.spec.ts index e1869c3fa..a85a76c74 100644 --- a/src/frontend/apps/e2e/__tests__/app-impress/doc-header.spec.ts +++ b/src/frontend/apps/e2e/__tests__/app-impress/doc-header.spec.ts @@ -45,7 +45,9 @@ test.describe('Doc Header', () => { await expect(card.getByText('Owner ·')).toBeVisible(); await expect(page.getByRole('button', { name: 'Share' })).toBeVisible(); - await expect(page.getByRole('button', { name: 'download' })).toBeVisible(); + await expect( + page.getByRole('button', { name: 'Export the document' }), + ).toBeVisible(); await expect( page.getByRole('button', { name: 'Open the document options' }), ).toBeVisible(); @@ -116,7 +118,9 @@ test.describe('Doc Header', () => { await goToGridDoc(page); - await expect(page.getByRole('button', { name: 'download' })).toBeVisible(); + await expect( + page.getByRole('button', { name: 'Export the document' }), + ).toBeVisible(); await page.getByLabel('Open the document options').click(); @@ -139,7 +143,9 @@ test.describe('Doc Header', () => { const invitationRole = invitationCard.getByLabel('doc-role-dropdown'); await expect(invitationRole).toBeVisible(); - await invitationRole.click(); + await invitationCard + .getByRole('button', { name: 'Open the invitation options' }) + .click(); await page.getByRole('menuitem', { name: 'Remove access' }).click(); await expect(invitationCard).toBeHidden(); @@ -154,8 +160,13 @@ test.describe('Doc Header', () => { await roles.click(); await expect( - page.getByRole('menuitem', { name: 'Remove access' }), - ).toBeEnabled(); + memberCard.getByRole('button', { name: 'Open the member options' }), + ).toBeVisible(); + await memberCard + .getByRole('button', { name: 'Open the member options' }) + .click(); + + await expect(page.getByLabel('Delete')).toBeEnabled(); }); test('it checks the options available if editor', async ({ page }) => { @@ -186,7 +197,9 @@ test.describe('Doc Header', () => { await goToGridDoc(page); - await expect(page.getByRole('button', { name: 'download' })).toBeVisible(); + await expect( + page.getByRole('button', { name: 'Export the document' }), + ).toBeVisible(); await page.getByLabel('Open the document options').click(); await expect(page.getByLabel('Delete document')).toBeDisabled(); @@ -207,14 +220,16 @@ test.describe('Doc Header', () => { ).toBeVisible(); await expect(invitationCard.getByLabel('doc-role-text')).toBeVisible(); await expect( - invitationCard.getByRole('button', { name: 'more_horiz' }), + invitationCard.getByRole('button', { + name: 'Open the invitation options', + }), ).toBeHidden(); const memberCard = shareModal.getByLabel('List members card'); await expect(memberCard.getByText('test@accesses.test')).toBeVisible(); await expect(memberCard.getByLabel('doc-role-text')).toBeVisible(); await expect( - memberCard.getByRole('button', { name: 'more_horiz' }), + memberCard.getByRole('button', { name: 'Open the member options' }), ).toBeHidden(); }); @@ -246,7 +261,9 @@ test.describe('Doc Header', () => { await goToGridDoc(page); - await expect(page.getByRole('button', { name: 'download' })).toBeVisible(); + await expect( + page.getByRole('button', { name: 'Export the document' }), + ).toBeVisible(); await page.getByLabel('Open the document options').click(); await expect(page.getByLabel('Delete document')).toBeDisabled(); @@ -267,14 +284,16 @@ test.describe('Doc Header', () => { ).toBeVisible(); await expect(invitationCard.getByLabel('doc-role-text')).toBeVisible(); await expect( - invitationCard.getByRole('button', { name: 'more_horiz' }), + invitationCard.getByRole('button', { + name: 'Open the invitation options', + }), ).toBeHidden(); const memberCard = shareModal.getByLabel('List members card'); await expect(memberCard.getByText('test@accesses.test')).toBeVisible(); await expect(memberCard.getByLabel('doc-role-text')).toBeVisible(); await expect( - memberCard.getByRole('button', { name: 'more_horiz' }), + memberCard.getByRole('button', { name: 'Open the member options' }), ).toBeHidden(); }); diff --git a/src/frontend/apps/e2e/__tests__/app-impress/doc-member-list.spec.ts b/src/frontend/apps/e2e/__tests__/app-impress/doc-member-list.spec.ts index 4678082a8..9693f903c 100644 --- a/src/frontend/apps/e2e/__tests__/app-impress/doc-member-list.spec.ts +++ b/src/frontend/apps/e2e/__tests__/app-impress/doc-member-list.spec.ts @@ -184,9 +184,6 @@ test.describe('Document list members', () => { const emailMyself = `user@${browserName}.test`; const mySelf = list.getByTestId(`doc-share-member-row-${emailMyself}`); - const mySelfRole = mySelf.getByRole('button', { - name: 'doc-role-dropdown', - }); const userOwnerEmail = await addNewMember(page, 0, 'Owner'); const userOwner = list.getByTestId( @@ -201,20 +198,31 @@ test.describe('Document list members', () => { const userReader = list.getByTestId( `doc-share-member-row-${userReaderEmail}`, ); - const userReaderRole = userReader.getByRole('button', { - name: 'doc-role-dropdown', - }); await expect(mySelf).toBeVisible(); await expect(userOwner).toBeVisible(); await expect(userReader).toBeVisible(); - await userReaderRole.click(); - await page.getByRole('menuitem', { name: 'Remove access' }).click(); + await expect( + userOwner.getByRole('button', { + name: 'Open the member options', + }), + ).toBeVisible(); + + await userReader + .getByRole('button', { + name: 'Open the member options', + }) + .click(); + await page.getByLabel('Delete').click(); await expect(userReader).toBeHidden(); - await mySelfRole.click(); - await page.getByRole('menuitem', { name: 'Remove access' }).click(); + await mySelf + .getByRole('button', { + name: 'Open the member options', + }) + .click(); + await page.getByLabel('Delete').click(); await expect( page.getByText('Insufficient access rights to view the document.'), ).toBeVisible(); diff --git a/src/frontend/apps/impress/src/components/DropdownMenu.tsx b/src/frontend/apps/impress/src/components/DropdownMenu.tsx index fcbd9ebe4..6d3bd037d 100644 --- a/src/frontend/apps/impress/src/components/DropdownMenu.tsx +++ b/src/frontend/apps/impress/src/components/DropdownMenu.tsx @@ -1,5 +1,6 @@ import { HorizontalSeparator } from '@gouvfr-lasuite/ui-kit'; import { Fragment, PropsWithChildren, useRef, useState } from 'react'; +import { useTranslation } from 'react-i18next'; import { css } from 'styled-components'; import { Box, BoxButton, BoxProps, DropButton, Icon, Text } from '@/components'; @@ -45,6 +46,7 @@ export const DropdownMenu = ({ const { spacingsTokens, colorsTokens } = useCunninghamTheme(); const [isOpen, setIsOpen] = useState(false); const blockButtonRef = useRef(null); + const { t } = useTranslation(); const onOpenChange = (isOpen: boolean) => { setIsOpen(isOpen); @@ -162,6 +164,7 @@ export const DropdownMenu = ({ $direction="row" $align="center" $gap={spacingsTokens['base']} + aria-selected={option.isSelected ? true : undefined} > {option.icon && ( {(option.isSelected || selectedValues?.includes(option.value ?? '')) && ( - + )} {option.showSeparator && ( diff --git a/src/frontend/apps/impress/src/components/Icon.tsx b/src/frontend/apps/impress/src/components/Icon.tsx index c99d3f992..57444715d 100644 --- a/src/frontend/apps/impress/src/components/Icon.tsx +++ b/src/frontend/apps/impress/src/components/Icon.tsx @@ -14,6 +14,7 @@ export const Icon = ({ }: IconProps) => { return ( { setIsModalExportOpen(true); }} size={isSmallMobile ? 'small' : 'medium'} + aria-label={t('Export the document')} /> )} - + add_link} + icon={} > {t('Copy link')} diff --git a/src/frontend/apps/impress/src/features/docs/docs-grid/components/DocsGridActions.tsx b/src/frontend/apps/impress/src/features/docs/docs-grid/components/DocsGridActions.tsx index 8928a3ffc..f7f640461 100644 --- a/src/frontend/apps/impress/src/features/docs/docs-grid/components/DocsGridActions.tsx +++ b/src/frontend/apps/impress/src/features/docs/docs-grid/components/DocsGridActions.tsx @@ -5,7 +5,7 @@ import { } from '@openfun/cunningham-react'; import { useTranslation } from 'react-i18next'; -import { DropdownMenu, DropdownMenuOption, Icon } from '@/components'; +import { DropdownMenu, DropdownMenuOption, IconOptions } from '@/components'; import { Doc, KEY_LIST_DOC, @@ -93,10 +93,10 @@ export const DocsGridActions = ({ return ( <> - - + diff --git a/src/frontend/apps/impress/src/i18n/translations.json b/src/frontend/apps/impress/src/i18n/translations.json index 511f153c7..a01fc3b2b 100644 --- a/src/frontend/apps/impress/src/i18n/translations.json +++ b/src/frontend/apps/impress/src/i18n/translations.json @@ -61,6 +61,7 @@ "Beautify": "Verschönern", "Can't load this page, please check your internet connection.": "Diese Seite kann nicht geladen werden. Bitte überprüfen Sie Ihre Internetverbindung.", "Cancel": "Abbrechen", + "Checked": "Angehakt", "Close the modal": "Pop up schliessen", "Collaborate": "Zusammenarbeiten", "Collaborate and write in real time, without layout constraints.": "In Echtzeit und ohne Layout-Beschränkungen schreiben und zusammenarbeiten.", @@ -247,6 +248,7 @@ "Callout": "Destacado", "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.", "Cancel": "Cancelar", + "Checked": "Marcado", "Close the modal": "Cerrar modal", "Collaborate": "Colabora", "Collaborate and write in real time, without layout constraints.": "Colaborar y escribir en tiempo real, sin restricciones de diseño.", @@ -433,6 +435,7 @@ "Callout": "Alerte", "Can't load this page, please check your internet connection.": "Impossible de charger cette page, veuillez vérifier votre connexion Internet.", "Cancel": "Annuler", + "Checked": "Coché", "Close the modal": "Fermer la modale", "Collaborate": "Collaborer", "Collaborate and write in real time, without layout constraints.": "Collaborez et rédigez en temps réel, sans contrainte de mise en page.", @@ -648,6 +651,7 @@ "Beautify": "Filtro bellezza", "Can't load this page, please check your internet connection.": "Impossibile caricare questa pagina, controlla la tua connessione internet.", "Cancel": "Cancella", + "Checked": "Selezionato", "Collaborate": "Collabora", "Collaborate and write in real time, without layout constraints.": "Collaborare e scrivere in tempo reale, senza vincoli di layout.", "Collaborative writing, Simplified.": "Scrittura collaborativa, semplificata.", @@ -798,6 +802,7 @@ "Beautify": "Maak mooier", "Can't load this page, please check your internet connection.": "Kan deze pagina niet laden. Controleer je internetverbinding.", "Cancel": "Breek af", + "Checked": "Aangevinkt", "Close the modal": "Sluit het venster", "Collaborate": "Samenwerken", "Collaborate and write in real time, without layout constraints.": "Samenwerken en schrijven in realtime, zonder lay-out beperkingen.", @@ -963,6 +968,7 @@ "Anonymous": "Anonym", "Beautify": "Försköna", "Cancel": "Avbryt", + "Checked": "Markerad", "Close the modal": "Stäng fönstret", "Convert Markdown": "Konvertera Markdown", "Correct": "Korrekt", @@ -999,6 +1005,7 @@ "Banner image": "Afiş görseli", "Beautify": "Güzelleştir", "Cancel": "İptal", + "Checked": "İşaretli", "Collaborate": "İşbirliği Yapın", "Collaborate and write in real time, without layout constraints.": "Düzen kısıtlamaları olmadan gerçek zamanlı olarak işbirliği yapın ve yazın.", "Collaborative writing, Simplified.": "İş birliğiyle yazmak çok daha Kolay.", @@ -1086,6 +1093,7 @@ "Callout": "标注", "Can't load this page, please check your internet connection.": "无法加载此页面,请检查您的网络连接。", "Cancel": "取消", + "Checked": "已勾选", "Close the modal": "关闭对话框", "Collaborate": "协作", "Collaborate and write in real time, without layout constraints.": "实时协作和写入,不受布局限制。",