Skip to content

Commit 451ca04

Browse files
authored
feat(site): show entity name in DeleteDialog (#9347)
1 parent 7904d0b commit 451ca04

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

site/src/components/Dialogs/DeleteDialog/DeleteDialog.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const DeleteDialog: FC<PropsWithChildren<DeleteDialogProps>> = ({
3939
<Maybe condition={info !== undefined}>
4040
<p className={styles.warning}>{info}</p>
4141
</Maybe>
42-
<p>{t("deleteDialog.confirm", { entity })}</p>
42+
<p>{t("deleteDialog.confirm", { entity, name })}</p>
4343

4444
<form
4545
onSubmit={(e) => {

site/src/i18n/en/common.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"deleteDialog": {
1717
"title": "Delete {{entity}}",
1818
"intro": "Deleting this {{entity}} is irreversible!",
19-
"confirm": "Are you sure you want to proceed? Type the name of this {{entity}} below to confirm.",
19+
"confirm": "Are you sure you want to proceed? Type {{name}} below to confirm.",
2020
"confirmLabel": "Name of {{entity}} to delete",
2121
"incorrectName": "Incorrect {{entity}} name."
2222
},

site/src/pages/UsersPage/UsersPage.test.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,11 @@ const deleteUser = async (setupActionSpies: () => void) => {
7272
// Check if the confirm message is displayed
7373
const confirmDialog = await screen.findByRole("dialog")
7474
expect(confirmDialog).toHaveTextContent(
75-
t("deleteDialog.confirm", { ns: "common", entity: "user" }).toString(),
75+
t("deleteDialog.confirm", {
76+
ns: "common",
77+
entity: "user",
78+
name: MockUser2.username,
79+
}).toString(),
7680
)
7781

7882
// Confirm with text input

0 commit comments

Comments
 (0)