Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ and this project adheres to

## [Unreleased]

### Fixed

- ♿(frontend) improve accessibility:
- ♿(frontend) improve share modal button accessibility #1626

## [3.10.0] - 2025-11-18

### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ test.describe('Document create member', () => {

// Validate
await page.getByRole('menuitem', { name: 'Administrator' }).click();
await page.getByRole('button', { name: 'Invite' }).click();
await page.getByRole('button', { name: /^Invite / }).click();

// Check invitation added
await expect(
Expand Down Expand Up @@ -135,7 +135,7 @@ test.describe('Document create member', () => {
(response) =>
response.url().includes('/invitations/') && response.status() === 201,
);
await page.getByRole('button', { name: 'Invite' }).click();
await page.getByRole('button', { name: /^Invite / }).click();

// Check invitation sent

Expand All @@ -154,7 +154,7 @@ test.describe('Document create member', () => {
response.url().includes('/invitations/') && response.status() === 400,
);

await page.getByRole('button', { name: 'Invite' }).click();
await page.getByRole('button', { name: /^Invite / }).click();
await expect(
page.getByText(`"${email}" is already invited to the document.`),
).toBeVisible();
Expand Down Expand Up @@ -191,7 +191,7 @@ test.describe('Document create member', () => {
response.url().includes('/invitations/') && response.status() === 201,
);

await page.getByRole('button', { name: 'Invite' }).click();
await page.getByRole('button', { name: /^Invite / }).click();

// Check invitation sent
const responseCreateInvitation = await responsePromiseCreateInvitation;
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/apps/e2e/__tests__/app-impress/utils-share.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const addNewMember = async (
// Choose a role
await page.getByLabel('doc-role-dropdown').click();
await page.getByRole('menuitem', { name: role }).click();
await page.getByRole('button', { name: 'Invite' }).click();
await page.getByRole('button', { name: /^Invite / }).click();

return users[index].email;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ export const DocShareAddMemberList = ({
afterInvite?.();
setIsLoading(false);
};
const inviteLabel =
selectedUsers.length === 1
? t('Invite {{name}}', {
name: selectedUsers[0].full_name || selectedUsers[0].email,
})
: t('Invite {{count}} members', { count: selectedUsers.length });

return (
<Box
Expand Down Expand Up @@ -143,7 +149,11 @@ export const DocShareAddMemberList = ({
currentRole={invitationRole}
onSelectRole={setInvitationRole}
/>
<Button onClick={() => void onInvite()} disabled={isLoading}>
<Button
onClick={() => void onInvite()}
disabled={isLoading}
aria-label={inviteLabel}
>
{t('Invite')}
</Button>
</Box>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Button } from '@openfun/cunningham-react';
import { useTranslation } from 'react-i18next';
import { css } from 'styled-components';

import { Box, Icon, Text } from '@/components';
Expand All @@ -10,6 +11,7 @@ type Props = {
onRemoveUser?: (user: User) => void;
};
export const DocShareAddMemberListItem = ({ user, onRemoveUser }: Props) => {
const { t } = useTranslation();
const { spacingsTokens, colorsTokens, fontSizesTokens } =
useCunninghamTheme();

Expand Down Expand Up @@ -42,6 +44,9 @@ export const DocShareAddMemberListItem = ({ user, onRemoveUser }: Props) => {
size="nano"
onClick={() => onRemoveUser?.(user)}
icon={<Icon $variation="600" $size="sm" iconName="close" />}
aria-label={t('Remove {{name}} from the invite list', {
name: user.full_name || user.email,
})}
/>
</Box>
);
Expand Down
Loading