Skip to content

Commit a94993a

Browse files
authored
Add confirmType 'danger' to destructive dialogs (#7943)
1 parent 904a55e commit a94993a

File tree

8 files changed

+13
-0
lines changed

8 files changed

+13
-0
lines changed

ui/console-src/modules/contents/attachments/components/AttachmentPoliciesModal.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ const handleDelete = async (policy: Policy) => {
7676
description: t(
7777
"core.attachment.policies_modal.operations.delete.description"
7878
),
79+
confirmType: "danger",
7980
confirmText: t("core.common.buttons.confirm"),
8081
cancelText: t("core.common.buttons.cancel"),
8182
onConfirm: async () => {

ui/console-src/modules/contents/pages/SinglePageSnapshots.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ function handleCleanup() {
8282
description: t("core.page_snapshots.operations.cleanup.description"),
8383
confirmText: t("core.common.buttons.confirm"),
8484
cancelText: t("core.common.buttons.cancel"),
85+
confirmType: "danger",
8586
async onConfirm() {
8687
const { releaseSnapshot, baseSnapshot, headSnapshot } =
8788
singlePage.value?.spec || {};

ui/console-src/modules/contents/pages/components/SnapshotListItem.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ function handleDelete() {
5151
description: t("core.page_snapshots.operations.delete.description"),
5252
confirmText: t("core.common.buttons.confirm"),
5353
cancelText: t("core.common.buttons.cancel"),
54+
confirmType: "danger",
5455
async onConfirm() {
5556
await consoleApiClient.content.singlePage.deleteSinglePageContent({
5657
name: props.singlePage?.metadata.name as string,

ui/console-src/modules/contents/posts/PostSnapshots.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ function handleCleanup() {
8181
description: t("core.post_snapshots.operations.cleanup.description"),
8282
confirmText: t("core.common.buttons.confirm"),
8383
cancelText: t("core.common.buttons.cancel"),
84+
confirmType: "danger",
8485
async onConfirm() {
8586
const { releaseSnapshot, baseSnapshot, headSnapshot } =
8687
post.value?.spec || {};

ui/console-src/modules/contents/posts/components/SnapshotListItem.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ function handleDelete() {
4949
description: t("core.post_snapshots.operations.delete.description"),
5050
confirmText: t("core.common.buttons.confirm"),
5151
cancelText: t("core.common.buttons.cancel"),
52+
confirmType: "danger",
5253
async onConfirm() {
5354
await consoleApiClient.content.post.deletePostContent({
5455
name: props.post?.metadata.name as string,

ui/console-src/modules/interface/themes/components/operation/UninstallOperationItem.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const handleUninstall = async (deleteExtensions?: boolean) => {
2525
description: t("core.common.dialog.descriptions.cannot_be_recovered"),
2626
confirmText: t("core.common.buttons.confirm"),
2727
cancelText: t("core.common.buttons.cancel"),
28+
confirmType: "danger",
2829
onConfirm: async () => {
2930
try {
3031
await coreApiClient.theme.theme.deleteTheme({

ui/uc-src/modules/profile/components/PersonalAccessTokenListItem.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ function handleDelete() {
3030
Dialog.warning({
3131
title: t("core.uc_profile.pat.operations.delete.title"),
3232
description: t("core.uc_profile.pat.operations.delete.description"),
33+
confirmType: "danger",
34+
confirmText: t("core.common.buttons.confirm"),
35+
cancelText: t("core.common.buttons.cancel"),
3336
async onConfirm() {
3437
await ucApiClient.security.personalAccessToken.deletePat({
3538
name: props.token.metadata.name,
@@ -45,6 +48,9 @@ function handleRevoke() {
4548
Dialog.warning({
4649
title: t("core.uc_profile.pat.operations.revoke.title"),
4750
description: t("core.uc_profile.pat.operations.revoke.description"),
51+
confirmType: "danger",
52+
confirmText: t("core.common.buttons.confirm"),
53+
cancelText: t("core.common.buttons.cancel"),
4854
async onConfirm() {
4955
await ucApiClient.security.personalAccessToken.revokePat({
5056
name: props.token.metadata.name,

ui/uc-src/modules/profile/tabs/Detail.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ const handleUnbindAuth = (authProvider: ListedAuthProvider) => {
4747
}),
4848
confirmText: t("core.common.buttons.confirm"),
4949
cancelText: t("core.common.buttons.cancel"),
50+
confirmType: "danger",
5051
onConfirm: async () => {
5152
await axios.put(`${authProvider.unbindingUrl}`, {
5253
withCredentials: true,

0 commit comments

Comments
 (0)