Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Manage form access a11y improvements #4472

Merged
merged 6 commits into from
Oct 29, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -129,18 +129,20 @@ export const ManageUsers = () => {
</label>
<p className="pb-3">{t("mustBeAGovernmentAddress")}</p>

{errors.length > 0 && (
<div className="my-2 flex flex-wrap gap-2">
{errors.map((error, index) => (
<div
className="rounded-md border border-red-700 bg-red-100 px-2 text-red-700"
key={`error-${index}`}
>
{error}
</div>
))}
</div>
)}
<div role="alert">
{errors.length > 0 && (
<div className="my-2 flex flex-wrap gap-2">
{errors.map((error, index) => (
<div
className="rounded-md border border-red-700 bg-red-100 px-2 text-red-700"
key={`error-${index}`}
>
{error}
</div>
))}
</div>
)}
</div>

<div className="flex flex-wrap gap-2 border border-black p-2">
{emailList.map((email, index) => {
Expand Down Expand Up @@ -201,7 +203,9 @@ export const ManageUsers = () => {
)}
key={user.email}
>
<div className="grow">{user.email}</div>
<div className="grow" id={user.email}>
{user.email}
</div>
<UserActions
user={user}
isInvitation={hasOwnProperty(user, "expired")}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const UserActions = ({
<div className="flex flex-row gap-1">
<span>{user.expired ? t("expired") : t("invited")}</span>
<div className="inline-block">
<Tooltip.Simple text={t("resend")} side="top">
<Tooltip.Simple text={t("resend", { email: user.email })} side="top">
<button onClick={() => handleResendInvitation(user.email)}>
<RefreshIcon
title={t("resend")}
Expand All @@ -61,7 +61,7 @@ export const UserActions = ({
</button>
</Tooltip.Simple>
</div>
<Tooltip.Simple text={t("deleteInvitation")} side="top">
<Tooltip.Simple text={t("deleteInvitation", { email: user.email })} side="top">
<ConfirmAction
buttonLabel={t("delete")}
confirmString=""
Expand All @@ -83,7 +83,7 @@ export const UserActions = ({
{disableRow ? (
<span></span>
) : (
<Tooltip.Simple text={t("remove")} side="top">
<Tooltip.Simple text={t("remove", { email: user.email })} side="top">
<ConfirmAction
callback={() => handleRemoveUser(user.id)}
confirmString={t("areYouSure")}
Expand Down
6 changes: 3 additions & 3 deletions i18n/translations/en/manage-form-access.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"cancel": "Cancel",
"confirmError": "Something went wrong",
"delete": "Delete",
"deleteInvitation": "Delete invitation",
"deleteInvitation": "Delete invitation for {{email}}",
"downloadForm": "Download form",
"emailAlreadyInList": "{{email}} was already added",
"emailDomainMismatch": "{{email}} does not appear to be from your organization. You can only add collaborators with the same email domain.",
Expand All @@ -28,8 +28,8 @@
"next": "Continue",
"optionalMessage": "Message (optional)",
"peopleWithAccess": "People with access",
"remove": "Remove",
"resend": "Re-send",
"remove": "Remove invitation for {{email}}",
"resend": "Re-send invitation to {{email}}",
"templateNotFound": "Template not found {{templateId}}",
"userAlreadyHasAccess": "{{email}} already has access",
"userNotFound": "User not found"
Expand Down
6 changes: 3 additions & 3 deletions i18n/translations/fr/manage-form-access.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"cancel": "Annuler",
"confirmError": "Quelque chose a mal tourné",
"delete": "Supprimer",
"deleteInvitation": "Supprimer l'invitation",
"deleteInvitation": "Delete invitation for {{email}}",
"downloadForm": "Télécharger le formulaire",
"emailAlreadyInList": "{{email}} a déjà été ajouté",
"emailDomainMismatch": "{{email}} ne semble pas appartenir à votre organisation. Vous ne pouvez ajouter des collaborateurs qu'avec le même domaine d'adresse courriel.",
Expand All @@ -28,8 +28,8 @@
"next": "Continuer",
"optionalMessage": "Message (optionnel)",
"peopleWithAccess": "Personnes ayant accès",
"remove": "Supprimer",
"resend": "Renvoyer",
"remove": "Supprimer l'invitation pour {{email}}",
"resend": "Renvoyer l'invitation pour {{email}}",
"templateNotFound": "Gabarit non trouvé {{templateId}}",
"userAlreadyHasAccess": "{{email}} a déjà accès",
"userNotFound": "User not found"
Expand Down
Loading