feat(site): show entity name in DeleteDialog (#9347)

This commit is contained in:
Ammar Bandukwala
2023-08-25 22:16:30 +00:00
committed by GitHub
parent 7904d0b92f
commit 451ca042ce
3 changed files with 7 additions and 3 deletions
@@ -39,7 +39,7 @@ export const DeleteDialog: FC<PropsWithChildren<DeleteDialogProps>> = ({
<Maybe condition={info !== undefined}>
<p className={styles.warning}>{info}</p>
</Maybe>
<p>{t("deleteDialog.confirm", { entity })}</p>
<p>{t("deleteDialog.confirm", { entity, name })}</p>
<form
onSubmit={(e) => {
+1 -1
View File
@@ -16,7 +16,7 @@
"deleteDialog": {
"title": "Delete {{entity}}",
"intro": "Deleting this {{entity}} is irreversible!",
"confirm": "Are you sure you want to proceed? Type the name of this {{entity}} below to confirm.",
"confirm": "Are you sure you want to proceed? Type {{name}} below to confirm.",
"confirmLabel": "Name of {{entity}} to delete",
"incorrectName": "Incorrect {{entity}} name."
},
+5 -1
View File
@@ -72,7 +72,11 @@ const deleteUser = async (setupActionSpies: () => void) => {
// Check if the confirm message is displayed
const confirmDialog = await screen.findByRole("dialog")
expect(confirmDialog).toHaveTextContent(
t("deleteDialog.confirm", { ns: "common", entity: "user" }).toString(),
t("deleteDialog.confirm", {
ns: "common",
entity: "user",
name: MockUser2.username,
}).toString(),
)
// Confirm with text input