Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: update `BBButtonConfirm` props (#14204)

boojackaeb95e8d39a6
diff --git a/frontend/src/bbkit/BBButtonConfirm.vue b/frontend/src/bbkit/BBButtonConfirm.vue
index 53e75467ff..e3280c1b40 100644
--- a/frontend/src/bbkit/BBButtonConfirm.vue
+++ b/frontend/src/bbkit/BBButtonConfirm.vue
@@ -2,7 +2,7 @@
<NButton
v-bind="$attrs"
class="text-sm"
- :text="type === 'text'"
+ :text="text"
:class="[!hideIcon && 'btn-icon']"
@click.prevent.stop="
() => {
@@ -15,15 +15,15 @@
"
>
<template v-if="!hideIcon">
- <heroicons-outline:trash v-if="style == 'DELETE'" class="w-4 h-4" />
- <heroicons-outline:archive v-if="style == 'ARCHIVE'" class="w-4 h-4" />
- <heroicons-outline:reply v-if="style == 'RESTORE'" class="w-4 h-4" />
+ <heroicons-outline:trash v-if="type == 'DELETE'" class="w-4 h-4" />
+ <heroicons-outline:archive v-if="type == 'ARCHIVE'" class="w-4 h-4" />
+ <heroicons-outline:reply v-if="type == 'RESTORE'" class="w-4 h-4" />
<heroicons-outline:minus-circle
- v-if="style == 'DISABLE'"
+ v-if="type == 'DISABLE'"
class="w-4 h-4"
/>
- <heroicons-outline:pencil v-if="style == 'EDIT'" class="w-4 h-4" />
- <heroicons-outline:duplicate v-if="style == 'CLONE'" class="w-4 h-4" />
+ <heroicons-outline:pencil v-if="type == 'EDIT'" class="w-4 h-4" />
+ <heroicons-outline:duplicate v-if="type == 'CLONE'" class="w-4 h-4" />
</template>
<span v-if="buttonText" :class="[!hideIcon && 'ml-1']">
{{ buttonText }}
@@ -32,7 +32,7 @@
<BBAlert
v-model:show="state.showModal"
:type="
- style == 'DELETE' || style == 'ARCHIVE' || style == 'DISABLE'
+ type == 'DELETE' || type == 'ARCHIVE' || type == 'DISABLE'
? 'warning'
: 'info'
"
@@ -56,12 +56,12 @@ import { NButton } from "naive-ui";
import { computed, reactive } from "vue";
import { useI18n } from "vue-i18n";
import BBAlert from "./BBAlert.vue";
-import type { BBButtonConfirmStyle } from "./types";
+import type { BBButtonConfirmType } from "./types";
const props = withDefaults(
defineProps<{
- type?: "text" | "default";
- style?: BBButtonConfirmStyle;
+ type?: BBButtonConfirmType;
+ text?: boolean;
buttonText?: string;
requireConfirm?: boolean;
okText?: string;
@@ -70,8 +70,8 @@ const props = withDefaults(
hideIcon?: boolean;
}>(),
{
- type: "text",
- style: "DELETE",
+ type: "DELETE",
+ text: true, // Default to display as a text button.
buttonText: "",
requireConfirm: false,
okText: "",
diff --git a/frontend/src/bbkit/types.ts b/frontend/src/bbkit/types.ts
index 008360224f..f91885c445 100644
--- a/frontend/src/bbkit/types.ts
+++ b/frontend/src/bbkit/types.ts
@@ -8,7 +8,7 @@ export type BBButtonType =
| "DANGER"
| "SUCCESS";
-export type BBButtonConfirmStyle =
+export type BBButtonConfirmType =
| "NORMAL"
| "DELETE"
| "ARCHIVE"
diff --git a/frontend/src/components/Branch/BranchDetailView.vue b/frontend/src/components/Branch/BranchDetailView.vue
index 75204b3d5f..c52892f879 100644
--- a/frontend/src/components/Branch/BranchDetailView.vue
+++ b/frontend/src/components/Branch/BranchDetailView.vue
@@ -96,7 +96,7 @@
<!-- Don't show delete button in view mode. -->
<div v-if="allowDelete">
<BBButtonConfirm
- :style="'DELETE'"
+ :type="'DELETE'"
:button-text="$t('database.delete-this-branch')"
:require-confirm="true"
@confirm="deleteBranch(false)"
diff --git a/frontend/src/components/EnvironmentForm/Form.vue b/frontend/src/components/EnvironmentForm/Form.vue
index ca1fc2da57..11c76d6835 100644
--- a/frontend/src/components/EnvironmentForm/Form.vue
+++ b/frontend/src/components/EnvironmentForm/Form.vue
@@ -103,7 +103,7 @@
<template v-if="state.environment.state === State.ACTIVE">
<BBButtonConfirm
v-if="allowArchive"
- :style="'ARCHIVE'"
+ :type="'ARCHIVE'"
:button-text="$t('environment.archive')"
:ok-text="$t('common.archive')"
:confirm-title="
@@ -117,7 +117,7 @@
<template v-else-if="state.environment.state === State.DELETED">
<BBButtonConfirm
v-if="allowRestore"
- :style="'RESTORE'"
+ :type="'RESTORE'"
:button-text="$t('environment.restore')"
:ok-text="$t('common.restore')"
:confirm-title="
diff --git a/frontend/src/components/Instance/InstanceArchiveRestoreButton.vue b/frontend/src/components/Instance/InstanceArchiveRestoreButton.vue
index 25c194d532..e8984a9c73 100644
--- a/frontend/src/components/Instance/InstanceArchiveRestoreButton.vue
+++ b/frontend/src/components/Instance/InstanceArchiveRestoreButton.vue
@@ -2,7 +2,7 @@
<template v-if="allowArchiveOrRestore">
<template v-if="instance.state === State.ACTIVE">
<BBButtonConfirm
- :style="'ARCHIVE'"
+ :type="'ARCHIVE'"
:button-text="$t('instance.archive-this-instance')"
:ok-text="$t('common.archive')"
:require-confirm="true"
@@ -26,7 +26,7 @@
</template>
<template v-else-if="instance.state === State.DELETED">
<BBButtonConfirm
- :style="'RESTORE'"
+ :type="'RESTORE'"
:button-text="$t('instance.restore-this-instance')"
:ok-text="$t('instance.restore')"
:require-confirm="true"
diff --git a/frontend/src/components/InstanceForm/DataSourceSection/DataSourceTabs.vue b/frontend/src/components/InstanceForm/DataSourceSection/DataSourceTabs.vue
index 92d36abfe2..2d9cf536df 100644
--- a/frontend/src/components/InstanceForm/DataSourceSection/DataSourceTabs.vue
+++ b/frontend/src/components/InstanceForm/DataSourceSection/DataSourceTabs.vue
@@ -15,7 +15,7 @@
<BBButtonConfirm
v-if="hasReadOnlyDataSource"
class="!ml-1"
- :style="'DELETE'"
+ :type="'DELETE'"
:disabled="!allowUpdate"
:require-confirm="!ds.pendingCreate"
:ok-text="$t('common.delete')"
diff --git a/frontend/src/components/Member/EditMemberRoleDrawer.vue b/frontend/src/components/Member/EditMemberRoleDrawer.vue
index 5a13cd8839..f4f8a57daa 100644
--- a/frontend/src/components/Member/EditMemberRoleDrawer.vue
+++ b/frontend/src/components/Member/EditMemberRoleDrawer.vue
@@ -38,7 +38,7 @@
<BBButtonConfirm
v-if="!isCreating"
ref="confirmRevokeAccessRef"
- :style="'DELETE'"
+ :type="'DELETE'"
:confirm-title="$t('settings.members.revoke-access-alert')"
:ok-text="$t('settings.members.revoke-access')"
:button-text="$t('settings.members.revoke-access')"
diff --git a/frontend/src/components/Project/ProjectArchiveRestoreButton.vue b/frontend/src/components/Project/ProjectArchiveRestoreButton.vue
index 06e3ca06bd..336ccd3360 100644
--- a/frontend/src/components/Project/ProjectArchiveRestoreButton.vue
+++ b/frontend/src/components/Project/ProjectArchiveRestoreButton.vue
@@ -2,7 +2,7 @@
<template v-if="allowArchiveOrRestore">
<template v-if="project.state === State.ACTIVE">
<BBButtonConfirm
- :style="'ARCHIVE'"
+ :type="'ARCHIVE'"
:button-text="$t('project.settings.archive.btn-text')"
:ok-text="$t('common.archive')"
:confirm-title="
@@ -23,7 +23,7 @@
</template>
<template v-else-if="project.state === State.DELETED">
<BBButtonConfirm
- :style="'RESTORE'"
+ :type="'RESTORE'"
:button-text="$t('project.settings.restore.btn-text')"
:ok-text="$t('common.restore')"
:confirm-title="
diff --git a/frontend/src/components/ProjectMember/ProjectMemberRolePanel/EditProjectRolePanel.vue b/frontend/src/components/ProjectMember/ProjectMemberRolePanel/EditProjectRolePanel.vue
index 954c50dd50..87463feb6a 100644
--- a/frontend/src/components/ProjectMember/ProjectMemberRolePanel/EditProjectRolePanel.vue
+++ b/frontend/src/components/ProjectMember/ProjectMemberRolePanel/EditProjectRolePanel.vue
@@ -89,7 +89,7 @@
<div>
<BBButtonConfirm
v-if="allowRemoveRole()"
- :style="'DELETE'"
+ :type="'DELETE'"
:button-text="$t('common.delete')"
:require-confirm="true"
@confirm="handleDeleteRole"
diff --git a/frontend/src/components/ProjectMember/ProjectMemberRolePanel/index.vue b/frontend/src/components/ProjectMember/ProjectMemberRolePanel/index.vue
index 77941f8d57..0c16cbaa5f 100644
--- a/frontend/src/components/ProjectMember/ProjectMemberRolePanel/index.vue
+++ b/frontend/src/components/ProjectMember/ProjectMemberRolePanel/index.vue
@@ -165,7 +165,7 @@
<div>
<BBButtonConfirm
:disabled="!allowRevokeMember"
- :style="'DELETE'"
+ :type="'DELETE'"
:confirm-title="$t('settings.members.revoke-access-alert')"
:ok-text="$t('settings.members.revoke-access')"
:button-text="$t('settings.members.revoke-access')"
diff --git a/frontend/src/components/ProjectWebhookForm.vue b/frontend/src/components/ProjectWebhookForm.vue
index d75f9a0f75..48af4915bf 100644
--- a/frontend/src/components/ProjectWebhookForm.vue
+++ b/frontend/src/components/ProjectWebhookForm.vue
@@ -150,7 +150,7 @@
>
<BBButtonConfirm
v-if="!create && allowEdit"
- :style="'DELETE'"
+ :type="'DELETE'"
:button-text="$t('project.webhook.deletion.btn-text')"
:ok-text="$t('common.delete')"
:confirm-title="
diff --git a/frontend/src/components/RepositoryPanel.vue b/frontend/src/components/RepositoryPanel.vue
index f47a95c4d6..37290de23c 100644
--- a/frontend/src/components/RepositoryPanel.vue
+++ b/frontend/src/components/RepositoryPanel.vue
@@ -49,7 +49,7 @@
>
<BBButtonConfirm
v-if="allowDelete"
- :style="'DELETE'"
+ :type="'DELETE'"
:button-text="$t('project.gitops-connector.delete')"
:require-confirm="true"
:ok-text="$t('common.delete')"
diff --git a/frontend/src/components/SQLReview/components/SQLReviewPolicyDataTable.vue b/frontend/src/components/SQLReview/components/SQLReviewPolicyDataTable.vue
index 651a01c8fa..98a2894fc5 100644
--- a/frontend/src/components/SQLReview/components/SQLReviewPolicyDataTable.vue
+++ b/frontend/src/components/SQLReview/components/SQLReviewPolicyDataTable.vue
@@ -131,8 +131,8 @@ const columns = computed(
</NButton>
{hasDeletePolicyPermission.value && (
<BBButtonConfirm
- type={"default"}
- style={"DELETE"}
+ text={false}
+ type={"DELETE"}
hideIcon={true}
buttonText={t("common.delete")}
okText={t("common.delete")}
diff --git a/frontend/src/components/SQLReview/components/SQLReviewPolicyTable.vue b/frontend/src/components/SQLReview/components/SQLReviewPolicyTable.vue
index 8b7e905807..7e5cd79a44 100644
--- a/frontend/src/components/SQLReview/components/SQLReviewPolicyTable.vue
+++ b/frontend/src/components/SQLReview/components/SQLReviewPolicyTable.vue
@@ -48,9 +48,9 @@
<BBButtonConfirm
v-if="hasDeletePolicyPermission"
- type="default"
+ :text="false"
:disabled="!hasUpdatePolicyPermission"
- :style="'DELETE'"
+ :type="'DELETE'"
:hide-icon="true"
:button-text="$t('common.delete')"
:ok-text="$t('common.delete')"
diff --git a/frontend/src/components/SSO/IdentityProviderCreateForm.vue b/frontend/src/components/SSO/IdentityProviderCreateForm.vue
index a8643e71ef..32da3c6e52 100644
--- a/frontend/src/components/SSO/IdentityProviderCreateForm.vue
+++ b/frontend/src/components/SSO/IdentityProviderCreateForm.vue
@@ -563,7 +563,7 @@
<template v-if="!isCreating">
<BBButtonConfirm
v-if="!isDeleted"
- :style="'ARCHIVE'"
+ :type="'ARCHIVE'"
:button-text="$t('settings.sso.archive')"
:ok-text="$t('common.archive')"
:confirm-title="$t('settings.sso.archive')"
@@ -573,7 +573,7 @@
/>
<BBButtonConfirm
v-else
- :style="'RESTORE'"
+ :type="'RESTORE'"
:button-text="$t('settings.sso.restore')"
:ok-text="$t('common.restore')"
:confirm-title="$t('settings.sso.restore')"
diff --git a/frontend/src/components/User/Settings/UserDataTable/cells/UserOperationsCell.vue b/frontend/src/components/User/Settings/UserDataTable/cells/UserOperationsCell.vue
index 011455c232..f89a987c45 100644
--- a/frontend/src/components/User/Settings/UserDataTable/cells/UserOperationsCell.vue
+++ b/frontend/src/components/User/Settings/UserDataTable/cells/UserOperationsCell.vue
@@ -13,7 +13,7 @@
</NButton>
<BBButtonConfirm
v-if="allowReactiveUser(user)"
- :style="'RESTORE'"
+ :type="'RESTORE'"
:require-confirm="true"
:ok-text="$t('settings.members.action.reactivate')"
:confirm-title="`${$t(
diff --git a/frontend/src/views/SettingWorkspaceSQLReviewDetail.vue b/frontend/src/views/SettingWorkspaceSQLReviewDetail.vue
index 52e5bf2f68..cee6c3321b 100644
--- a/frontend/src/views/SettingWorkspaceSQLReviewDetail.vue
+++ b/frontend/src/views/SettingWorkspaceSQLReviewDetail.vue
@@ -87,7 +87,7 @@
<BBButtonConfirm
class="!my-4"
:disabled="!hasPermission"
- :style="'DELETE'"
+ :type="'DELETE'"
:button-text="$t('sql-review.delete')"
:ok-text="$t('common.delete')"
:confirm-title="$t('common.delete') + ` '${reviewPolicy.name}'?`"
diff --git a/frontend/src/views/SettingWorkspaceVCSDetail.vue b/frontend/src/views/SettingWorkspaceVCSDetail.vue
index 6c754a0d3d..37afa9ebd5 100644
--- a/frontend/src/views/SettingWorkspaceVCSDetail.vue
+++ b/frontend/src/views/SettingWorkspaceVCSDetail.vue
@@ -5,7 +5,7 @@
<div class="pt-4 mt-2 flex border-t justify-between">
<template v-if="connectorList.length == 0">
<BBButtonConfirm
- :style="'DELETE'"
+ :type="'DELETE'"
:button-text="$t('gitops.setting.git-provider.delete')"
:ok-text="$t('common.delete')"
:confirm-title="