mirror of
https://github.com/coder/coder.git
synced 2026-09-22 05:05:20 +08:00
feat(site): show entity name in DeleteDialog (#9347)
This commit is contained in:
@@ -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) => {
|
||||
|
||||
@@ -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."
|
||||
},
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user