Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
chore: clear code (#19099)
ecmadaobddce75c4297
diff --git a/frontend/src/components/CustomApproval/Settings/components/common/utils.ts b/frontend/src/components/CustomApproval/Settings/components/common/utils.tsindex 5243e9f95b..acb94a90b5 100644--- a/frontend/src/components/CustomApproval/Settings/components/common/utils.ts+++ b/frontend/src/components/CustomApproval/Settings/components/common/utils.ts@@ -3,7 +3,7 @@ import type { ResourceSelectOption } from "@/components/v2/Select/RemoteResourceimport { type Factor, SQLTypeList } from "@/plugins/cel";import { t } from "@/plugins/i18n";import { useRoleStore } from "@/store";-import { PRESET_WORKSPACE_ROLES, PresetRiskLevelList } from "@/types";+import { PRESET_WORKSPACE_ROLES } from "@/types";import { Engine, RiskLevel } from "@/types/proto-es/v1/common_pb";import { WorkspaceApprovalSetting_Rule_Source } from "@/types/proto-es/v1/setting_service_pb";import {@@ -15,7 +15,6 @@ import {supportedEngineV1List,} from "@/utils";import {- CEL_ATTRIBUTE_LEVEL,CEL_ATTRIBUTE_REQUEST_EXPIRATION_DAYS,CEL_ATTRIBUTE_REQUEST_ROLE,CEL_ATTRIBUTE_RESOURCE_DATABASE_NAME,@@ -74,15 +73,6 @@ const getDBEndingOptions = () => {}));};-const getLevelOptions = () => {- return PresetRiskLevelList.map<ResourceSelectOption<unknown>>(- ({ level }) => ({- label: levelText(level),- value: RiskLevel[level],- })- );-};-const getRiskLevelOptions = () => {// Risk level values as strings for CEL conditions (e.g., risk_level == "HIGH")const levels = [@@ -208,9 +198,6 @@ export const getApprovalOptionConfigMap = (case CEL_ATTRIBUTE_RESOURCE_DB_ENGINE:options = getDBEndingOptions();break;- case CEL_ATTRIBUTE_LEVEL:- options = getLevelOptions();- break;case CEL_ATTRIBUTE_STATEMENT_SQL_TYPE:options = getSQLTypeOptions(source);break;diff --git a/frontend/src/components/FeatureGuard/FeatureAttention.vue b/frontend/src/components/FeatureGuard/FeatureAttention.vueindex 65cf71520e..595694da9e 100644--- a/frontend/src/components/FeatureGuard/FeatureAttention.vue+++ b/frontend/src/components/FeatureGuard/FeatureAttention.vue@@ -182,6 +182,6 @@ const onClick = () => {state.showInstanceAssignmentDrawer = true;return;}- router.push(autoSubscriptionRoute(router));+ router.push(autoSubscriptionRoute());};</script>diff --git a/frontend/src/components/FeatureGuard/FeatureBadge.vue b/frontend/src/components/FeatureGuard/FeatureBadge.vueindex 876eb69904..0655207968 100644--- a/frontend/src/components/FeatureGuard/FeatureBadge.vue+++ b/frontend/src/components/FeatureGuard/FeatureBadge.vue@@ -27,7 +27,7 @@<template #trigger><router-linkv-if="clickable"- :to="autoSubscriptionRoute($router)"+ :to="autoSubscriptionRoute()"exact-active-class=""><SparklesIcon class="w-5 h-5" />diff --git a/frontend/src/components/FeatureGuard/FeatureModal.vue b/frontend/src/components/FeatureGuard/FeatureModal.vueindex 56c11f4cad..ed69761ed6 100644--- a/frontend/src/components/FeatureGuard/FeatureModal.vue+++ b/frontend/src/components/FeatureGuard/FeatureModal.vue@@ -1,6 +1,6 @@<template><BBModal v-if="open && feature" :title="title" @close="$emit('cancel')">- <div class="min-w-0 md:min-w-[400px] max-w-4xl mb-2">+ <div class="min-w-0 md:min-w-100 max-w-4xl mb-2"><div class="flex items-start gap-x-2 mt-3"><div class="flex items-center"><heroicons-solid:lock-closed@@ -166,7 +166,7 @@ const ok = () => {if (instanceMissingLicense.value) {state.showInstanceAssignmentDrawer = true;} else {- router.push(autoSubscriptionRoute(router));+ router.push(autoSubscriptionRoute());}emit("cancel");};diff --git a/frontend/src/components/IAMRemindModal.vue b/frontend/src/components/IAMRemindModal.vueindex 92e7dd132e..cfce3f37da 100644--- a/frontend/src/components/IAMRemindModal.vue+++ b/frontend/src/components/IAMRemindModal.vue@@ -168,7 +168,7 @@ const onClose = () => {const onClick = () => {state.showModal = false;router.push({- ...autoProjectRoute(router, project.value),+ ...autoProjectRoute(project.value),});};</script>diff --git a/frontend/src/components/InstanceForm/Form.vue b/frontend/src/components/InstanceForm/Form.vueindex dcec09bc44..51b88a0a47 100644--- a/frontend/src/components/InstanceForm/Form.vue+++ b/frontend/src/components/InstanceForm/Form.vue@@ -1,6 +1,6 @@<template><div class="flex flex-col gap-y-6 pb-2">- <div class="max-w-[850px]">+ <div class="max-w-212.5"><InstanceEngineRadioGridv-if="isCreating":engine="basicInfo.engine"@@ -49,7 +49,7 @@<label for="activation" class="textlabel block">{{ $t("subscription.instance-assignment.assign-license") }}(<router-link- :to="autoSubscriptionRoute($router)"+ :to="autoSubscriptionRoute()"class="accent-link">{{@@ -59,7 +59,7 @@}}</router-link>)</label>- <div class="h-[34px] flex flex-row items-center mt-1">+ <div class="h-8.5 flex flex-row items-center mt-1"><NSwitch:value="basicInfo.activation":disabled="!basicInfo.activation && availableLicenseCount === 0"@@ -305,7 +305,7 @@:allow-input="onlyAllowNumber"/></div>- <div class="h-[34px] flex flex-row items-center self-end">+ <div class="h-8.5 flex flex-row items-center self-end"><MiniActionButton:disabled="!allowEdit"@click.stop="removeDSAdditionalAddress(index)"diff --git a/frontend/src/components/ProfilePreview.vue b/frontend/src/components/ProfilePreview.vueindex 7235931445..15ce866353 100644--- a/frontend/src/components/ProfilePreview.vue+++ b/frontend/src/components/ProfilePreview.vue@@ -19,9 +19,8 @@<script setup lang="ts">import { computed } from "vue";-import { useRouter } from "vue-router";+import { SETTING_ROUTE_PROFILE } from "@/router/dashboard/workspaceSetting";import { useCurrentUserV1 } from "@/store";-import { autoProfileLink } from "@/utils";const props = withDefaults(defineProps<{@@ -36,13 +35,14 @@ defineEmits<{(event: "click"): void;}>();-const router = useRouter();const currentUserV1 = useCurrentUserV1();const bindings = computed(() => {if (!props.link) return {};return {- to: autoProfileLink(router),+ to: {+ name: SETTING_ROUTE_PROFILE,+ },};});</script>diff --git a/frontend/src/components/SchemaEditorLite/types.ts b/frontend/src/components/SchemaEditorLite/types.tsindex 36fc2cb311..2f1f466f7a 100644--- a/frontend/src/components/SchemaEditorLite/types.ts+++ b/frontend/src/components/SchemaEditorLite/types.ts@@ -23,7 +23,7 @@ export type CommonTabContext = {};// Tab context for editing database.-export type DatabaseTabContext = CommonTabContext & {+type DatabaseTabContext = CommonTabContext & {type: "database";database: Database;metadata: {diff --git a/frontend/src/components/SchemaEditorLite/utils/columnDefaultValue.ts b/frontend/src/components/SchemaEditorLite/utils/columnDefaultValue.tsindex 1424bc3e16..5347a8a6b7 100644--- a/frontend/src/components/SchemaEditorLite/utils/columnDefaultValue.ts+++ b/frontend/src/components/SchemaEditorLite/utils/columnDefaultValue.ts@@ -1,10 +1,9 @@import type { ColumnMetadata } from "@/types/proto-es/v1/database_service_pb";-import type { ColumnDefaultValue } from "@/types/v1/schemaEditor";export type DefaultValue = Pick<ColumnMetadata, "hasDefault" | "default">;export const getColumnDefaultValuePlaceholder = (- column: ColumnDefaultValue+ column: DefaultValue): string => {if (!column.hasDefault) {return "No default";diff --git a/frontend/src/components/SensitiveData/MaskingExceptionUserTable.vue b/frontend/src/components/SensitiveData/MaskingExceptionUserTable.vueindex 8d18e61bf2..f8a0acd384 100644--- a/frontend/src/components/SensitiveData/MaskingExceptionUserTable.vue+++ b/frontend/src/components/SensitiveData/MaskingExceptionUserTable.vue@@ -131,7 +131,7 @@ const getDatabaseAccessResource = (access: AccessUser): VNodeChild => {query.table = access.databaseResource.table;}router.push({- ...autoDatabaseRoute(router, database),+ ...autoDatabaseRoute(database),query,});}}diff --git a/frontend/src/components/SensitiveData/components/SensitiveColumnTable.vue b/frontend/src/components/SensitiveData/components/SensitiveColumnTable.vueindex b00a9d4872..bb3a29b803 100644--- a/frontend/src/components/SensitiveData/components/SensitiveColumnTable.vue+++ b/frontend/src/components/SensitiveData/components/SensitiveColumnTable.vue@@ -16,7 +16,7 @@ import { TrashIcon } from "lucide-vue-next";import { type DataTableColumn, NDataTable, NPopconfirm } from "naive-ui";import { computed, h, withModifiers } from "vue";import { useI18n } from "vue-i18n";-import { RouterLink, useRouter } from "vue-router";+import { RouterLink } from "vue-router";import ClassificationCell from "@/components/ColumnDataTable/ClassificationCell.vue";import SemanticTypeCell from "@/components/ColumnDataTable/SemanticTypeCell.vue";import type {@@ -58,7 +58,6 @@ const emit = defineEmits<{}>();const { t } = useI18n();-const router = useRouter();const settingStore = useSettingV1Store();const dbCatalogStore = useDatabaseCatalogV1Store();@@ -98,7 +97,7 @@ const dataTableColumns = computed(() => {<div><RouterLinkto={{- ...autoDatabaseRoute(router, props.database),+ ...autoDatabaseRoute(props.database),query: {schema: item.schema,table: item.table,diff --git a/frontend/src/components/TransferOutDatabaseForm/TransferOutDatabaseForm.vue b/frontend/src/components/TransferOutDatabaseForm/TransferOutDatabaseForm.vueindex b995df2a6b..00388df79f 100644--- a/frontend/src/components/TransferOutDatabaseForm/TransferOutDatabaseForm.vue+++ b/frontend/src/components/TransferOutDatabaseForm/TransferOutDatabaseForm.vue@@ -207,7 +207,7 @@ const doTransfer = async () => {});router.push({- ...autoProjectRoute(router, target),+ ...autoProjectRoute(target),});}diff --git a/frontend/src/components/misc/Version.vue b/frontend/src/components/misc/Version.vueindex 41a4a1c06d..d324377a6d 100644--- a/frontend/src/components/misc/Version.vue+++ b/frontend/src/components/misc/Version.vue@@ -17,7 +17,7 @@</RequireEnterpriseButton><router-linkv-if="subscriptionViewMode === 'LINK'"- :to="autoSubscriptionRoute($router)"+ :to="autoSubscriptionRoute()"exact-active-class="">{{ $t(readableCurrentPlan) }}diff --git a/frontend/src/components/v2/Model/DatabaseV1Name.vue b/frontend/src/components/v2/Model/DatabaseV1Name.vueindex cd6129718c..f17162c248 100644--- a/frontend/src/components/v2/Model/DatabaseV1Name.vue+++ b/frontend/src/components/v2/Model/DatabaseV1Name.vue@@ -21,7 +21,6 @@<script lang="ts" setup>import { NEllipsis } from "naive-ui";import { computed } from "vue";-import { useRouter } from "vue-router";import { State } from "@/types/proto-es/v1/common_pb";import type { Database } from "@/types/proto-es/v1/database_service_pb";import { autoDatabaseRoute, extractDatabaseResourceName } from "@/utils";@@ -43,7 +42,6 @@ const props = withDefaults(});-const router = useRouter();const shouldShowLink = computed(() => {return props.link && props.database.state === State.ACTIVE;});@@ -51,7 +49,7 @@ const shouldShowLink = computed(() => {const bindings = computed(() => {if (shouldShowLink.value) {return {- to: autoDatabaseRoute(router, props.database),+ to: autoDatabaseRoute(props.database),activeClass: "",exactActiveClass: "",onClick: (e: MouseEvent) => {diff --git a/frontend/src/components/v2/Model/DatabaseV1Table/PagedDatabaseTable.vue b/frontend/src/components/v2/Model/DatabaseV1Table/PagedDatabaseTable.vueindex 5b24e6352b..f973119ebd 100644--- a/frontend/src/components/v2/Model/DatabaseV1Table/PagedDatabaseTable.vue+++ b/frontend/src/components/v2/Model/DatabaseV1Table/PagedDatabaseTable.vue@@ -93,7 +93,7 @@ const handleDatabaseClick = (event: MouseEvent, database: Database) => {if (props.customClick) {emit("row-click", event, database);} else {- const url = router.resolve(autoDatabaseRoute(router, database)).fullPath;+ const url = router.resolve(autoDatabaseRoute(database)).fullPath;if (event.ctrlKey || event.metaKey) {window.open(url, "_blank");} else {diff --git a/frontend/src/components/v2/Model/EnvironmentV1Name.vue b/frontend/src/components/v2/Model/EnvironmentV1Name.vueindex 8428315a0c..553afb0dba 100644--- a/frontend/src/components/v2/Model/EnvironmentV1Name.vue+++ b/frontend/src/components/v2/Model/EnvironmentV1Name.vue@@ -36,11 +36,14 @@<script lang="ts" setup>import { computed } from "vue";-import { useRouter } from "vue-router";-import { NULL_ENVIRONMENT_NAME, UNKNOWN_ENVIRONMENT_NAME } from "@/types";+import {+ formatEnvironmentName,+ NULL_ENVIRONMENT_NAME,+ UNKNOWN_ENVIRONMENT_NAME,+} from "@/types";import type { Environment } from "@/types/v1/environment";import type { VueClass } from "@/utils";-import { autoEnvironmentRoute, hexToRgb } from "@/utils";+import { hexToRgb } from "@/utils";import HighlightLabelText from "./HighlightLabelText.vue";import ProductionEnvironmentV1Icon from "./ProductionEnvironmentV1Icon.vue";@@ -75,8 +78,6 @@ const props = withDefaults(});-const router = useRouter();-const isUnknown = computed(() =>props.environment.name === UNKNOWN_ENVIRONMENT_NAME ||@@ -89,7 +90,7 @@ const bindings = computed(() => {if (isLink.value) {return {to: {- ...autoEnvironmentRoute(router, props.environment),+ path: `/${formatEnvironmentName(props.environment.id)}`,},activeClass: "",exactActiveClass: "",diff --git a/frontend/src/components/v2/Model/Instance/InstanceV1Name.vue b/frontend/src/components/v2/Model/Instance/InstanceV1Name.vueindex c6334d24b8..2bca93bb10 100644--- a/frontend/src/components/v2/Model/Instance/InstanceV1Name.vue+++ b/frontend/src/components/v2/Model/Instance/InstanceV1Name.vue@@ -35,14 +35,14 @@<script lang="ts" setup>import { NEllipsis, NTag } from "naive-ui";import { computed } from "vue";-import { useRouter } from "vue-router";+import { INSTANCE_ROUTE_DETAIL } from "@/router/dashboard/instance";import { State } from "@/types/proto-es/v1/common_pb";import type {Instance,InstanceResource,} from "@/types/proto-es/v1/instance_service_pb";import {- autoInstanceRoute,+ extractInstanceResourceName,hasWorkspacePermissionV2,instanceV1Name,} from "@/utils";@@ -72,7 +72,6 @@ const props = withDefaults(keyword: "",});-const router = useRouter();const isArchived = computed(() => {return "state" in props.instance && props.instance.state === State.DELETED;@@ -81,7 +80,12 @@ const isArchived = computed(() => {const bindings = computed(() => {if (props.link) {return {- to: autoInstanceRoute(router, props.instance),+ to: {+ name: INSTANCE_ROUTE_DETAIL,+ params: {+ instanceId: extractInstanceResourceName(props.instance.name),+ },+ },activeClass: "",exactActiveClass: "",onClick: (e: MouseEvent) => {diff --git a/frontend/src/components/v2/Model/ProjectV1Name.vue b/frontend/src/components/v2/Model/ProjectV1Name.vueindex 6545d209ca..23b2704088 100644--- a/frontend/src/components/v2/Model/ProjectV1Name.vue+++ b/frontend/src/components/v2/Model/ProjectV1Name.vue@@ -14,7 +14,6 @@<script lang="ts" setup>import { NPerformantEllipsis } from "naive-ui";import { computed } from "vue";-import { useRouter } from "vue-router";import type { Project } from "@/types/proto-es/v1/project_service_pb";import { autoProjectRoute, projectV1Name } from "@/utils";import HighlightLabelText from "./HighlightLabelText.vue";@@ -36,12 +35,11 @@ const props = withDefaults(keyword: "",});-const router = useRouter();const bindings = computed(() => {if (props.link) {return {- to: autoProjectRoute(router, props.project),+ to: autoProjectRoute(props.project),activeClass: "",exactActiveClass: "",onClick: (e: MouseEvent) => {diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.jsonindex b9b32c5ab8..c5bd4ecc12 100644--- a/frontend/src/locales/en-US.json+++ b/frontend/src/locales/en-US.json@@ -1089,17 +1089,6 @@"task-run": {"logs": "Logs","session": "Session",- "task-run-log": {- "entry-type": {- "command-execute": "Command execute",- "schema-dump": "Schema dump",- "transaction-control": "Transaction control",- "database-sync": "Database sync",- "prior-backup": "Prior backup",- "retry-info": "Retry information",- "compute-diff": "Compute diff"- }- },"task-run-session": {"blocking-sessions": {"self": "Blocking sessions",@@ -2644,13 +2633,6 @@"rejected-by": "Rejected by","and-n-other-users": "{names} and 1 other user | {names} and {count} other users","self-approval-not-allowed": "Self-approval is not allowed in this project. So you cannot approve your own issue."- },- "approval-flow-builtin": {- "project-owner": "The system defines the approval process and only needs the project Owner to approve it.",- "workspace-dba": "The system defines the approval process and only needs DBA approval.",- "workspace-admin": "The system defines the approval process and only needs Administrator approval.",- "project-owner-workspace-dba": "The system defines the approval process, first the project Owner approves, then the DBA approves.",- "project-owner-workspace-dba-workspace-admin": "The system defines the approval process, first the project Owner approves, then the DBA approves, and finally the Administrator approves."}},"schema-template": {diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.jsonindex 45ac46f1c7..da7955faf6 100644--- a/frontend/src/locales/es-ES.json+++ b/frontend/src/locales/es-ES.json@@ -1089,17 +1089,6 @@"task-run": {"logs": "Registros","session": "Sesión",- "task-run-log": {- "entry-type": {- "command-execute": "ejecutar comando",- "schema-dump": "Volcado de esquema",- "transaction-control": "Control de transacciones",- "database-sync": "Sincronización de base de datos",- "prior-backup": "Copia de seguridad previa",- "retry-info": "Reintento de información",- "compute-diff": "Calcular diff"- }- },"task-run-session": {"blocking-sessions": {"self": "Sesiones de bloqueo",@@ -2644,13 +2633,6 @@"rejected-by": "Rechazado por","and-n-other-users": "{names} y {count} otros usuarios","self-approval-not-allowed": "No se permite la autoaprobación para este proyecto. No puedes aprobarlo como creador."- },- "approval-flow-builtin": {- "project-owner": "El sistema define el proceso de aprobación y solo necesita la aprobación del dueño del proyecto.",- "workspace-dba": "El sistema define el proceso de aprobación y solo necesita la aprobación del DBA.",- "workspace-admin": "El sistema define el proceso de aprobación y solo necesita la aprobación del administrador.",- "project-owner-workspace-dba": "El sistema define el proceso de aprobación, primero aprueba el dueño del proyecto, luego el DBA lo aprueba.",- "project-owner-workspace-dba-workspace-admin": "El sistema define el proceso de aprobación, primero aprueba el dueño del proyecto, luego el DBA lo aprueba y finalmente el administrador lo aprueba."}},"schema-template": {diff --git a/frontend/src/locales/ja-JP.json b/frontend/src/locales/ja-JP.jsonindex cfc5f405f9..2c29332feb 100644--- a/frontend/src/locales/ja-JP.json+++ b/frontend/src/locales/ja-JP.json@@ -1089,17 +1089,6 @@"task-run": {"logs": "ログ","session": "セッション",- "task-run-log": {- "entry-type": {- "command-execute": "コマンド実行",- "schema-dump": "スキーマダンプ",- "transaction-control": "トランザクション制御",- "database-sync": "データベースの同期",- "prior-backup": "事前のバックアップ",- "retry-info": "情報を再試行します",- "compute-diff": "Diffを計算します"- }- },"task-run-session": {"blocking-sessions": {"self": "セッションのブロック",@@ -2644,13 +2633,6 @@"rejected-by": "拒否された","and-n-other-users": "{names} と他の {count} 人のユーザー","self-approval-not-allowed": "このプロジェクトでは自己承認は許可されていません。作成者として承認することはできません。"- },- "approval-flow-builtin": {- "project-owner": "システム定義のプロセス。プロジェクト所有者の承認のみが必要です。",- "workspace-dba": "システム定義のプロセス。 DBA の承認のみが必要です。",- "workspace-admin": "システム定義のプロセス。管理者の承認のみが必要です。",- "project-owner-workspace-dba": "システム定義のプロセス。承認は最初にプロジェクト所有者によって行われ、次に DBA によって行われます。",- "project-owner-workspace-dba-workspace-admin": "システム定義のプロセス。承認は、最初にプロジェクト所有者によって行われ、次に DBA、最後に管理者によって行われます。"}},"schema-template": {diff --git a/frontend/src/locales/vi-VN.json b/frontend/src/locales/vi-VN.jsonindex c1bbd9737f..8e46240db7 100644--- a/frontend/src/locales/vi-VN.json+++ b/frontend/src/locales/vi-VN.json@@ -1089,17 +1089,6 @@"task-run": {"logs": "Nhật ký","session": "Phiên",- "task-run-log": {- "entry-type": {- "command-execute": "Thực thi lệnh",- "schema-dump": "Kết xuất lược đồ",- "transaction-control": "Kiểm soát giao dịch",- "database-sync": "Đồng bộ cơ sở dữ liệu",- "prior-backup": "Sao lưu trước",- "retry-info": "Thông tin thử lại",- "compute-diff": "Tính toán khác"- }- },"task-run-session": {"blocking-sessions": {"self": "Phiên chặn",@@ -2644,13 +2633,6 @@"rejected-by": "Bị từ chối bởi","and-n-other-users": "{names} và {count} người dùng khác","self-approval-not-allowed": "Không được phép tự phê duyệt cho dự án này. Bạn không thể phê duyệt với tư cách là người sáng tạo."- },- "approval-flow-builtin": {- "project-owner": "Hệ thống xác định quy trình phê duyệt và chỉ cần Chủ sở hữu dự án phê duyệt.",- "workspace-dba": "Hệ thống xác định quy trình phê duyệt và chỉ cần DBA phê duyệt.",- "workspace-admin": "Hệ thống xác định quy trình phê duyệt và chỉ cần Quản trị viên phê duyệt.",- "project-owner-workspace-dba": "Hệ thống xác định quy trình phê duyệt, đầu tiên là Chủ sở hữu dự án phê duyệt, sau đó là DBA phê duyệt.",- "project-owner-workspace-dba-workspace-admin": "Hệ thống xác định quy trình phê duyệt, đầu tiên là Chủ sở hữu dự án phê duyệt, sau đó là DBA phê duyệt, và cuối cùng là Quản trị viên phê duyệt."}},"schema-template": {diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.jsonindex 57701d1e2e..d4b8fcd989 100644--- a/frontend/src/locales/zh-CN.json+++ b/frontend/src/locales/zh-CN.json@@ -1089,17 +1089,6 @@"task-run": {"logs": "日志","session": "会话",- "task-run-log": {- "entry-type": {- "command-execute": "执行指令",- "schema-dump": "导出 schema",- "transaction-control": "事务控制",- "database-sync": "数据库同步",- "prior-backup": "数据预备份",- "retry-info": "重试信息",- "compute-diff": "计算差异"- }- },"task-run-session": {"blocking-sessions": {"self": "阻塞会话",@@ -2644,13 +2633,6 @@"rejected-by": "被拒绝","and-n-other-users": "{names} 和另外 {count} 位用户","self-approval-not-allowed": "此项目不允许工单创建者审批。您无法以创建者身份批准。"- },- "approval-flow-builtin": {- "project-owner": "系统定义的流程。只需要项目所有者审批。",- "workspace-dba": "系统定义的流程。只需要 DBA 审批。",- "workspace-admin": "系统定义的流程。只需要管理员审批。",- "project-owner-workspace-dba": "系统定义的流程。先由项目所有者审批,再由 DBA 审批。",- "project-owner-workspace-dba-workspace-admin": "系统定义的流程。先由项目所有者审批,再由 DBA 审批,最后由管理员审批。"}},"schema-template": {diff --git a/frontend/src/plugins/cel/types/factor.ts b/frontend/src/plugins/cel/types/factor.tsindex 4b5aa83d7d..fb1358c326 100644--- a/frontend/src/plugins/cel/types/factor.ts+++ b/frontend/src/plugins/cel/types/factor.ts@@ -1,5 +1,4 @@import {- CEL_ATTRIBUTE_LEVEL,CEL_ATTRIBUTE_REQUEST_EXPIRATION_DAYS,CEL_ATTRIBUTE_REQUEST_ROLE,CEL_ATTRIBUTE_REQUEST_TIME,@@ -14,7 +13,6 @@ import {CEL_ATTRIBUTE_RESOURCE_SCHEMA_NAME,CEL_ATTRIBUTE_RESOURCE_TABLE_NAME,CEL_ATTRIBUTE_RISK_LEVEL,- CEL_ATTRIBUTE_SOURCE,CEL_ATTRIBUTE_STATEMENT_AFFECTED_ROWS,CEL_ATTRIBUTE_STATEMENT_SQL_TYPE,CEL_ATTRIBUTE_STATEMENT_TABLE_ROWS,@@ -33,8 +31,6 @@ export type NumberFactor = (typeof NumberFactorList)[number];export const StringFactorList = [// Risk related factors- CEL_ATTRIBUTE_LEVEL,- CEL_ATTRIBUTE_SOURCE,CEL_ATTRIBUTE_RISK_LEVEL,CEL_ATTRIBUTE_RESOURCE_ENVIRONMENT_ID,CEL_ATTRIBUTE_RESOURCE_PROJECT_ID,@@ -62,17 +58,7 @@ export type StringFactor = (typeof StringFactorList)[number];export const TimestampFactorList = [CEL_ATTRIBUTE_REQUEST_TIME] as const;export type TimestampFactor = (typeof TimestampFactorList)[number];-export const HighLevelFactorList = [- CEL_ATTRIBUTE_LEVEL,- CEL_ATTRIBUTE_SOURCE,-] as const;-export type HighLevelFactor = (typeof HighLevelFactorList)[number];--export type Factor =- | NumberFactor- | StringFactor- | TimestampFactor- | HighLevelFactor;+export type Factor = NumberFactor | StringFactor | TimestampFactor;export const isNumberFactor = (factor: string): factor is NumberFactor => {return NumberFactorList.includes(factor as NumberFactor);@@ -87,9 +73,3 @@ export const isTimestampFactor = (): factor is TimestampFactor => {return TimestampFactorList.includes(factor as TimestampFactor);};--export const isHighLevelFactor = (- factor: string-): factor is HighLevelFactor => {- return HighLevelFactorList.includes(factor as HighLevelFactor);-};diff --git a/frontend/src/plugins/cel/types/operator.ts b/frontend/src/plugins/cel/types/operator.tsindex c9ade5a1c2..168abcd6c2 100644--- a/frontend/src/plugins/cel/types/operator.ts+++ b/frontend/src/plugins/cel/types/operator.ts@@ -1,6 +1,5 @@import { uniq } from "lodash-es";import {- CEL_ATTRIBUTE_LEVEL,CEL_ATTRIBUTE_REQUEST_EXPIRATION_DAYS,CEL_ATTRIBUTE_REQUEST_ROLE,CEL_ATTRIBUTE_REQUEST_TIME,@@ -15,7 +14,6 @@ import {CEL_ATTRIBUTE_RESOURCE_SCHEMA_NAME,CEL_ATTRIBUTE_RESOURCE_TABLE_NAME,CEL_ATTRIBUTE_RISK_LEVEL,- CEL_ATTRIBUTE_SOURCE,CEL_ATTRIBUTE_STATEMENT_AFFECTED_ROWS,CEL_ATTRIBUTE_STATEMENT_SQL_TYPE,CEL_ATTRIBUTE_STATEMENT_TABLE_ROWS,@@ -87,14 +85,6 @@ const OperatorList: Record<Factor, Operator[]> = {...CompareOperatorList,]),- [CEL_ATTRIBUTE_LEVEL]: uniq([- ...EqualityOperatorList,- ...CollectionOperatorList,- ]),- [CEL_ATTRIBUTE_SOURCE]: uniq([- ...EqualityOperatorList,- ...CollectionOperatorList,- ]),[CEL_ATTRIBUTE_RISK_LEVEL]: uniq([...EqualityOperatorList,...CollectionOperatorList,diff --git a/frontend/src/plugins/silent-request.ts b/frontend/src/plugins/silent-request.tsdeleted file mode 100644index 88a0c61620..0000000000--- a/frontend/src/plugins/silent-request.ts+++ /dev/null@@ -1,21 +0,0 @@-const state = {- silent: false,-};--export const isSilent = () => {- return state.silent;-};--// Requests wrapped in useSilentRequest won't be intercepted by our global-// error handling (pushNotifications)-export const useSilentRequest = async <T>(fn: () => Promise<T>): Promise<T> => {- state.silent = true;- try {- const result = await fn();- state.silent = false;- return result;- } catch (err) {- state.silent = false;- throw err;- }-};diff --git a/frontend/src/store/modules/command.ts b/frontend/src/store/modules/command.tsdeleted file mode 100644index 0f273ebcfb..0000000000--- a/frontend/src/store/modules/command.ts+++ /dev/null@@ -1,70 +0,0 @@-import { defineStore } from "pinia";-import { onMounted, onUnmounted } from "vue";-import type {- Command,- CommandId,- CommandRegisterId,- CommandState,-} from "@/types";--export const useCommandStore = defineStore("command", {- state: (): CommandState => ({- commandListById: new Map(),- }),- actions: {- registerCommand(command: Command) {- const list = this.commandListById.get(command.id);- if (list) {- const index = list.findIndex(- (item) => item.registerId === command.registerId- );- if (index > -1) {- throw new Error(- `'${command.registerId}' has already registered command '${command.id}', this is likely a programming error.`- );- }- list.push(command);- } else {- this.commandListById.set(command.id, [command]);- }- return command;- },-- unregisterCommand({- id,- registerId,- }: {- id: CommandId;- registerId: CommandRegisterId;- }) {- const list = this.commandListById.get(id);- if (list) {- const index = list.findIndex((item) => item.registerId === registerId);- if (index >= 0) {- list.splice(index, 1);- return;- }- }- throw new Error(- `'${registerId}' attempts to unregister command '${id}' which is not registered before, this is likely a programming error.`- );- },-- dispatchCommand(commandId: CommandId) {- const list = this.commandListById.get(commandId);- list?.forEach((cmd: Command) => {- cmd.run();- });- },- },-});--export const useRegisterCommand = (command: Command) => {- const store = useCommandStore();- onMounted(() => {- store.registerCommand(command);- });- onUnmounted(() => {- store.unregisterCommand(command);- });-};diff --git a/frontend/src/store/modules/index.ts b/frontend/src/store/modules/index.tsindex 83c379f386..fe1c3863bb 100644--- a/frontend/src/store/modules/index.ts+++ b/frontend/src/store/modules/index.ts@@ -1,5 +1,4 @@export * from "./v1/auth";-export * from "./command";export * from "./help";export * from "./notification";export * from "./router";diff --git a/frontend/src/store/modules/notification.ts b/frontend/src/store/modules/notification.tsindex fcf43a2a08..55e40b64e6 100644--- a/frontend/src/store/modules/notification.ts+++ b/frontend/src/store/modules/notification.ts@@ -4,9 +4,12 @@ import type {Notification,NotificationCreate,NotificationFilter,- NotificationState,} from "@/types";+interface NotificationState {+ notificationByModule: Map<string, Notification[]>;+}+export const useNotificationStore = defineStore("notification", {state: (): NotificationState => ({notificationByModule: new Map(),diff --git a/frontend/src/store/modules/release.ts b/frontend/src/store/modules/release.tsindex 832e5cfbb5..df411c15a1 100644--- a/frontend/src/store/modules/release.ts+++ b/frontend/src/store/modules/release.ts@@ -4,7 +4,7 @@ import { defineStore } from "pinia";import { computed, reactive, ref, unref, watch } from "vue";import { releaseServiceClientConnect } from "@/connect";import { silentContextKey } from "@/connect/context-key";-import type { MaybeRef, Pagination } from "@/types";+import type { MaybeRef } from "@/types";import { isValidReleaseName, unknownRelease } from "@/types";import { State } from "@/types/proto-es/v1/common_pb";import type { Release } from "@/types/proto-es/v1/release_service_pb";@@ -26,7 +26,10 @@ export const useReleaseStore = defineStore("release", () => {const fetchReleasesByProject = async (project: string,- pagination?: Pagination,+ pagination?: {+ pageSize?: number;+ pageToken?: string;+ },showDeleted?: boolean,filter?: string) => {diff --git a/frontend/src/store/modules/revision.ts b/frontend/src/store/modules/revision.tsindex 1c16ab7932..c00e161f99 100644--- a/frontend/src/store/modules/revision.ts+++ b/frontend/src/store/modules/revision.ts@@ -2,7 +2,6 @@ import { create } from "@bufbuild/protobuf";import { defineStore } from "pinia";import { computed, reactive } from "vue";import { revisionServiceClientConnect } from "@/connect";-import type { Pagination } from "@/types";import type { Revision } from "@/types/proto-es/v1/revision_service_pb";import {DeleteRevisionRequestSchema,@@ -20,7 +19,10 @@ export const useRevisionStore = defineStore("revision", () => {const fetchRevisionsByDatabase = async (database: string,- pagination?: Pagination+ pagination?: {+ pageSize?: number;+ pageToken?: string;+ }) => {const request = create(ListRevisionsRequestSchema, {parent: database,diff --git a/frontend/src/store/modules/v1/actuator.ts b/frontend/src/store/modules/v1/actuator.tsindex e6e0a66dac..28ae46faca 100644--- a/frontend/src/store/modules/v1/actuator.ts+++ b/frontend/src/store/modules/v1/actuator.ts@@ -3,7 +3,6 @@ import { defineStore } from "pinia";import semver from "semver";import { computed, ref } from "vue";import { actuatorServiceClientConnect } from "@/connect";-import { useSilentRequest } from "@/plugins/silent-request";import {type AppFeatures,type AppProfile,@@ -185,15 +184,13 @@ export const useActuatorV1Store = defineStore("actuator_v1", () => {const fetchLatestRelease = async (): Promise<Release | undefined> => {try {- const releaseList = await useSilentRequest(async () => {- const response = await fetch(- `${GITHUB_API_LIST_BYTEBASE_RELEASE}?per_page=1`- );- if (!response.ok) {- throw new Error(`HTTP error! status: ${response.status}`);- }- return response.json() as Promise<Release[]>;- });+ const response = await fetch(+ `${GITHUB_API_LIST_BYTEBASE_RELEASE}?per_page=1`+ );+ if (!response.ok) {+ throw new Error(`HTTP error! status: ${response.status}`);+ }+ const releaseList = (await response.json()) as Release[];return releaseList[0];} catch {return;diff --git a/frontend/src/types/approvalFlow.ts b/frontend/src/types/approvalFlow.tsdeleted file mode 100644index bdd3e0edbb..0000000000--- a/frontend/src/types/approvalFlow.ts+++ /dev/null@@ -1,83 +0,0 @@-import { t } from "@/plugins/i18n";-import { displayRoleTitle } from "@/utils/role";-import { PresetRoleType } from "./iam";--export type BuiltinApprovalFlow = {- id: string;- title: string;- description: string;- roles: string[];- readonly: true;-};--type BuiltinApprovalFlowDefinition = {- id: string;- description: string;- roles: string[];-};--// Built-in approval flow definitions-// Titles and descriptions use i18n keys for localization-const BUILTIN_FLOW_DEFINITIONS: readonly BuiltinApprovalFlowDefinition[] = [- {- id: "bb.project-owner",- description: t("custom-approval.approval-flow-builtin.project-owner"),- roles: [PresetRoleType.PROJECT_OWNER],- },- {- id: "bb.workspace-dba",- description: t("custom-approval.approval-flow-builtin.workspace-dba"),-- roles: [PresetRoleType.WORKSPACE_DBA],- },- {- id: "bb.workspace-admin",- description: t("custom-approval.approval-flow-builtin.workspace-admin"),-- roles: [PresetRoleType.WORKSPACE_ADMIN],- },- {- id: "bb.project-owner-workspace-dba",- description: t(- "custom-approval.approval-flow-builtin.project-owner-workspace-dba"- ),- roles: [PresetRoleType.PROJECT_OWNER, PresetRoleType.WORKSPACE_DBA],- },- {- id: "bb.project-owner-workspace-dba-workspace-admin",- description: t(- "custom-approval.approval-flow-builtin.project-owner-workspace-dba-workspace-admin"- ),- roles: [- PresetRoleType.PROJECT_OWNER,- PresetRoleType.WORKSPACE_DBA,- PresetRoleType.WORKSPACE_ADMIN,- ],- },-] as const;--// Generate title from roles (e.g., "Project Owner -> Workspace DBA")-const generateTitle = (roles: string[]): string => {- return roles.map((role) => displayRoleTitle(role)).join(" -> ");-};--// Built-in approval flow templates-// These are materialized into the database only when actually used by rules-export const BUILTIN_APPROVAL_FLOWS: readonly BuiltinApprovalFlow[] =- BUILTIN_FLOW_DEFINITIONS.map((def) => ({- id: def.id,- title: generateTitle(def.roles),- description: def.description,- roles: def.roles,- readonly: true as const,- }));--export const BUILTIN_FLOW_ID_PREFIX = "bb.";--export const isBuiltinFlowId = (id: string): boolean => {- return id.startsWith(BUILTIN_FLOW_ID_PREFIX);-};--export const getBuiltinFlow = (id: string): BuiltinApprovalFlow | undefined => {- return BUILTIN_APPROVAL_FLOWS.find((flow) => flow.id === id);-};diff --git a/frontend/src/types/common.ts b/frontend/src/types/common.tsindex b3ff8f2a34..598beae058 100644--- a/frontend/src/types/common.ts+++ b/frontend/src/types/common.ts@@ -1,7 +1,3 @@-import { UNKNOWN_ID } from "./const";-import type { CommandId, CommandRegisterId } from "./id";-import type { SQLReviewPolicy } from "./sqlReview";-// System bot idexport const SYSTEM_BOT_ID = 1;// System bot email@@ -13,38 +9,3 @@ export const DEBOUNCE_SEARCH_DELAY = 300;// Link to inquire enterprise planexport const ENTERPRISE_INQUIRE_LINK ="https://www.bytebase.com/contact-us?source=console";--// Quick Action Type-export type Command = {- id: CommandId;- registerId: CommandRegisterId;- run: () => void;-};--export type ResourceType = "SQL_REVIEW";--interface ResourceMaker {- (type: "SQL_REVIEW"): SQLReviewPolicy;-}--const makeUnknown = (type: ResourceType) => {- const UNKNOWN_SQL_REVIEW_POLICY: SQLReviewPolicy = {- id: `${UNKNOWN_ID}`,- enforce: false,- name: "",- ruleList: [],- resources: [],- };-- switch (type) {- case "SQL_REVIEW":- return UNKNOWN_SQL_REVIEW_POLICY;- }-};--export const unknown = makeUnknown as ResourceMaker;--export interface Pagination {- pageSize?: number;- pageToken?: string;-}diff --git a/frontend/src/types/iam/permission.ts b/frontend/src/types/iam/permission.tsindex 71500a8151..7b9e9fe98c 100644--- a/frontend/src/types/iam/permission.ts+++ b/frontend/src/types/iam/permission.ts@@ -1,9 +1,8 @@-import type { PickLiteral } from "../utils";import type { Permission } from "./permission-generated";export type { Permission };-export type QueryPermission = PickLiteral<+export type QueryPermission = Extract<Permission,| "bb.sql.select"| "bb.sql.info"diff --git a/frontend/src/types/id.ts b/frontend/src/types/id.tsindex b469b9cb80..7c5941064d 100644--- a/frontend/src/types/id.ts+++ b/frontend/src/types/id.ts@@ -3,7 +3,3 @@ export type ResourceId = string;// IdType includes auto incremental int in database and resource id.export type IdType = number | ResourceId;--export type CommandId = string;--export type CommandRegisterId = string;diff --git a/frontend/src/types/index.ts b/frontend/src/types/index.tsindex f13e541d25..67720c82ba 100644--- a/frontend/src/types/index.ts+++ b/frontend/src/types/index.ts@@ -1,6 +1,5 @@export * from "./actuator";export * from "./appProfile";-export * from "./approvalFlow";export * from "./auditLog";export * from "./common";export * from "./const";@@ -16,14 +15,11 @@ export * from "./notification";export * from "./oauth";export * from "./plan";export * from "./release";-export * from "./risk";export * from "./rollout";export * from "./semanticTypes";export * from "./setting";-export * from "./sheet";export * from "./sqlEditor";export * from "./sqlReview";-export * from "./store";export * from "./utils";export * from "./workspaceApprovalSetting";diff --git a/frontend/src/types/plan.ts b/frontend/src/types/plan.tsindex 52c1b43096..418e456fe3 100644--- a/frontend/src/types/plan.ts+++ b/frontend/src/types/plan.ts@@ -46,10 +46,7 @@ typedPlanData.instanceFeatures.forEach((feature) => {});// Helper function to check if a plan has a feature-export const planHasFeature = (- plan: PlanType,- feature: PlanFeature-): boolean => {+const planHasFeature = (plan: PlanType, feature: PlanFeature): boolean => {const planFeatures = planFeatureMatrix.get(plan);return planFeatures?.has(feature) ?? false;};diff --git a/frontend/src/types/risk.ts b/frontend/src/types/risk.tsdeleted file mode 100644index e354248e52..0000000000--- a/frontend/src/types/risk.ts+++ /dev/null@@ -1,15 +0,0 @@-import { RiskLevel } from "./proto-es/v1/common_pb";--export const PresetRiskLevel = {- HIGH: RiskLevel.HIGH,- MODERATE: RiskLevel.MODERATE,- LOW: RiskLevel.LOW,-};--export const PresetRiskLevelList = [- { name: "HIGH", level: PresetRiskLevel.HIGH },- { name: "MODERATE", level: PresetRiskLevel.MODERATE },- { name: "LOW", level: PresetRiskLevel.LOW },-];--export const DEFAULT_RISK_LEVEL = RiskLevel.RISK_LEVEL_UNSPECIFIED;diff --git a/frontend/src/types/sheet.ts b/frontend/src/types/sheet.tsdeleted file mode 100644index 8b39459297..0000000000--- a/frontend/src/types/sheet.ts+++ /dev/null@@ -1,9 +0,0 @@-import type { VNode } from "vue";-import type { Worksheet_Visibility } from "@/types/proto-es/v1/worksheet_service_pb";--export type AccessOption = {- label: string;- description: string;- value: Worksheet_Visibility;- icon: VNode;-};diff --git a/frontend/src/types/sqlEditor/tree.ts b/frontend/src/types/sqlEditor/tree.tsindex e9d894c147..d47cecf765 100644--- a/frontend/src/types/sqlEditor/tree.ts+++ b/frontend/src/types/sqlEditor/tree.ts@@ -1,5 +1,4 @@import type { TreeOption } from "naive-ui";-import { t } from "@/plugins/i18n";import type { Database } from "../proto-es/v1/database_service_pb";import type { InstanceResource } from "../proto-es/v1/instance_service_pb";import type { Environment } from "../v1/environment";@@ -22,7 +21,7 @@ export type SQLEditorTreeNodeType =| "database"| "label";-export type LabelTarget = {+type LabelTarget = {key: string;value: string;};@@ -41,7 +40,7 @@ export type SQLEditorTreeNodeTarget<export type SQLEditorTreeState = "UNSET" | "LOADING" | "READY";-export type SQLEditorTreeNodeMeta<+type SQLEditorTreeNodeMeta<T extends SQLEditorTreeNodeType = SQLEditorTreeNodeType,> = {type: T;@@ -56,19 +55,6 @@ export type SQLEditorTreeNode<children?: SQLEditorTreeNode[];};-export const isValidSQLEditorTreeFactor = (- str: string-): str is SQLEditorTreeFactor => {- if (str === "instance") return true;- if (str === "environment") return true;- if (str.match(/^label:.+$/)) return true;- return false;-};--export const ConnectableTreeNodeTypes: readonly SQLEditorTreeNodeType[] = [- "database",-] as const;-export const LeafTreeNodeTypes: readonly SQLEditorTreeNodeType[] = ["database",] as const;@@ -79,21 +65,6 @@ export const extractSQLEditorLabelFactor = (factor: string) => {return matches[1] ?? "";};-export const readableSQLEditorTreeFactor = (- factor: SQLEditorTreeFactor,- labelPrefix: string | undefined = ""-) => {- if (factor === "environment") {- return t("common.environment");- }- if (factor === "instance") {- return t("common.instance");- }- const label = extractSQLEditorLabelFactor(factor);-- return `${labelPrefix}${label}`;-};-export const isConnectableSQLEditorTreeNode = (node: SQLEditorTreeNode): boolean => {diff --git a/frontend/src/types/store.ts b/frontend/src/types/store.tsdeleted file mode 100644index c2eb4dbf0a..0000000000--- a/frontend/src/types/store.ts+++ /dev/null@@ -1,11 +0,0 @@-import type { Command } from "./common";-import type { CommandId } from "./id";-import type { Notification } from "./notification";--export interface NotificationState {- notificationByModule: Map<string, Notification[]>;-}--export interface CommandState {- commandListById: Map<CommandId, Command[]>;-}diff --git a/frontend/src/types/utils.ts b/frontend/src/types/utils.tsindex 0c8b5366cf..527e46a71a 100644--- a/frontend/src/types/utils.ts+++ b/frontend/src/types/utils.ts@@ -6,5 +6,3 @@ export type ValidatedMessage = {type: "warning" | "error";message: string;};--export type PickLiteral<A, B extends A> = B;diff --git a/frontend/src/types/v1/index.ts b/frontend/src/types/v1/index.tsindex 5b554bf77d..74ae4acde2 100644--- a/frontend/src/types/v1/index.ts+++ b/frontend/src/types/v1/index.ts@@ -4,7 +4,6 @@ export * from "./database";export * from "./dataSource";export * from "./project";export * from "./projectWebhook";-export * from "./role";export * from "./user";export * from "./sql";export * from "./webTerminal";diff --git a/frontend/src/types/v1/issue/rollout.ts b/frontend/src/types/v1/issue/rollout.tsindex 0dbdce0d9c..e2202519e2 100644--- a/frontend/src/types/v1/issue/rollout.ts+++ b/frontend/src/types/v1/issue/rollout.ts@@ -2,7 +2,6 @@ import { create } from "@bufbuild/protobuf";import { UNKNOWN_ID } from "@/types/const";import {StageSchema,- Task_Type,TaskSchema,} from "@/types/proto-es/v1/rollout_service_pb";import { UNKNOWN_ROLLOUT_NAME } from "@/types/rollout";@@ -24,11 +23,3 @@ export const unknownTask = () => {name: UNKNOWN_TASK_NAME,});};--export const TaskTypeListWithStatement: Task_Type[] = [- Task_Type.GENERAL,- Task_Type.DATABASE_CREATE,- Task_Type.DATABASE_MIGRATE,-- Task_Type.DATABASE_EXPORT,-];diff --git a/frontend/src/types/v1/role.ts b/frontend/src/types/v1/role.tsdeleted file mode 100644index 3ad74b1130..0000000000--- a/frontend/src/types/v1/role.ts+++ /dev/null@@ -1,8 +0,0 @@-import { PresetRoleType } from "../iam";--export const IssueReleaserRoleType = {- WORKSPACE_ADMIN: PresetRoleType.WORKSPACE_ADMIN,- WORKSPACE_DBA: PresetRoleType.WORKSPACE_DBA,- PROJECT_OWNER: PresetRoleType.PROJECT_OWNER,- PROJECT_RELEASER: PresetRoleType.PROJECT_RELEASER,-};diff --git a/frontend/src/types/v1/schemaEditor/atomType.ts b/frontend/src/types/v1/schemaEditor/atomType.tsdeleted file mode 100644index 04f0662a9a..0000000000--- a/frontend/src/types/v1/schemaEditor/atomType.ts+++ /dev/null@@ -1,51 +0,0 @@-type Status = "normal" | "created" | "dropped";--export interface ColumnDefaultValue {- hasDefault: boolean;- default?: string;-}-export interface Column extends ColumnDefaultValue {- id: string;- name: string;- type: string;- nullable: boolean;- comment: string;- status: Status;-}--export interface PrimaryKey {- name: string;- columnIdList: string[];-}--export interface ForeignKey {- // Should be an unique name.- name: string;- tableId: string;- columnIdList: string[];- referencedSchemaId: string;- referencedTableId: string;- referencedColumnIdList: string[];-}--export interface Table {- id: string;- name: string;- engine: string;- collation: string;- rowCount: bigint;- dataSize: bigint;- comment: string;- columnList: Column[];- primaryKey: PrimaryKey;- foreignKeyList: ForeignKey[];- status: Status;-}--export interface Schema {- id: string;- // It should be an empty string for MySQL/TiDB.- name: string;- tableList: Table[];- status: Status;-}diff --git a/frontend/src/types/v1/schemaEditor/index.ts b/frontend/src/types/v1/schemaEditor/index.tsdeleted file mode 100644index 74fdda058e..0000000000--- a/frontend/src/types/v1/schemaEditor/index.ts+++ /dev/null@@ -1,2 +0,0 @@-export * from "./atomType";-export * from "./state";diff --git a/frontend/src/types/v1/schemaEditor/state.ts b/frontend/src/types/v1/schemaEditor/state.tsdeleted file mode 100644index f527f12a23..0000000000--- a/frontend/src/types/v1/schemaEditor/state.ts+++ /dev/null@@ -1,36 +0,0 @@-import type { Database } from "@/types/proto-es/v1/database_service_pb";-import type { Schema } from "./atomType";--export enum SchemaEditorTabType {- TabForDatabase = "database",- TabForTable = "table",-}--// Tab context for editing database.-export interface DatabaseTabContext {- id: string;- type: SchemaEditorTabType.TabForDatabase;- // Parent could be a database.- parentName: string;- selectedSchemaId?: string;-}--// Tab context for editing table.-export interface TableTabContext {- id: string;- type: SchemaEditorTabType.TabForTable;- // Parent could be a database.- parentName: string;- schemaId: string;- tableId: string;-}--export type TabContext = {- name?: string;-} & (DatabaseTabContext | TableTabContext);--export interface DatabaseSchema {- database: Database;- schemaList: Schema[];- originSchemaList: Schema[];-}diff --git a/frontend/src/types/v1/webTerminal.ts b/frontend/src/types/v1/webTerminal.tsindex 89eca600f8..2d226365d7 100644--- a/frontend/src/types/v1/webTerminal.ts+++ b/frontend/src/types/v1/webTerminal.ts@@ -26,14 +26,14 @@ export type WebTerminalQueryItemV1 = {status: "IDLE" | "RUNNING" | "FINISHED";};-export type QueryTimer = {+type QueryTimer = {start(): void;stop(): void;elapsedMS: ComputedRef<number>;expired: ComputedRef<boolean>;};-export type QueryEvents = Emittery<{+type QueryEvents = Emittery<{query: SQLEditorQueryParams;result: SQLResultSetV1;}>;diff --git a/frontend/src/utils/auto-route.ts b/frontend/src/utils/auto-route.tsindex d230b615ee..5b93936f1b 100644--- a/frontend/src/utils/auto-route.ts+++ b/frontend/src/utils/auto-route.ts@@ -1,35 +1,18 @@import { type Router } from "vue-router";-import { INSTANCE_ROUTE_DETAIL } from "@/router/dashboard/instance";import {PROJECT_V1_ROUTE_DATABASE_DETAIL,PROJECT_V1_ROUTE_DATABASES,} from "@/router/dashboard/projectV1";-import {- SETTING_ROUTE_PROFILE,- SETTING_ROUTE_WORKSPACE_SUBSCRIPTION,-} from "@/router/dashboard/workspaceSetting";+import { SETTING_ROUTE_WORKSPACE_SUBSCRIPTION } from "@/router/dashboard/workspaceSetting";import type { Database } from "@/types/proto-es/v1/database_service_pb";-import type {- Instance,- InstanceResource,-} from "@/types/proto-es/v1/instance_service_pb";import type { Project } from "@/types/proto-es/v1/project_service_pb";-import type { User } from "@/types/proto-es/v1/user_service_pb";-import {- type Environment,- formatEnvironmentName,-} from "@/types/v1/environment";-import {- extractDatabaseResourceName,- extractInstanceResourceName,- extractProjectResourceName,-} from "./v1";+import { extractDatabaseResourceName, extractProjectResourceName } from "./v1";export const isSQLEditorRoute = (router: Router) => {return router.currentRoute.value.name?.toString().startsWith("sql-editor");};-export const autoDatabaseRoute = (_: Router, database: Database) => {+export const autoDatabaseRoute = (database: Database) => {const name = PROJECT_V1_ROUTE_DATABASE_DETAIL;const projectId = extractProjectResourceName(database.project);@@ -45,19 +28,7 @@ export const autoDatabaseRoute = (_: Router, database: Database) => {};};-export const autoInstanceRoute = (- _: Router,- instance: Instance | InstanceResource-) => {- return {- name: INSTANCE_ROUTE_DETAIL,- params: {- instanceId: extractInstanceResourceName(instance.name),- },- };-};--export const autoProjectRoute = (_: Router, project: Project) => {+export const autoProjectRoute = (project: Project) => {return {name: PROJECT_V1_ROUTE_DATABASES,params: {@@ -66,23 +37,6 @@ export const autoProjectRoute = (_: Router, project: Project) => {};};-export const autoEnvironmentRoute = (_: Router, environment: Environment) => {- return {- path: `/${formatEnvironmentName(environment.id)}`,- };-};--export const autoSubscriptionRoute = (_: Router) => {+export const autoSubscriptionRoute = () => {return { name: SETTING_ROUTE_WORKSPACE_SUBSCRIPTION };};--export const autoProfileLink = (_: Router, user?: User) => {- if (user) {- return {- path: `/users/${user.email}`,- };- }- return {- name: SETTING_ROUTE_PROFILE,- };-};diff --git a/frontend/src/utils/cel-attributes.ts b/frontend/src/utils/cel-attributes.tsindex 2eec11617b..517057e859 100644--- a/frontend/src/utils/cel-attributes.ts+++ b/frontend/src/utils/cel-attributes.ts@@ -26,7 +26,3 @@ export const CEL_ATTRIBUTE_REQUEST_TIME = "request.time";// CEL attribute names for risk scope.export const CEL_ATTRIBUTE_RISK_LEVEL = "risk.level";--// CEL attribute names for approval scope (deprecated, kept for backward compatibility).-export const CEL_ATTRIBUTE_LEVEL = "level";-export const CEL_ATTRIBUTE_SOURCE = "source";diff --git a/frontend/src/utils/index.ts b/frontend/src/utils/index.tsindex fba8db2159..c7fb6320ca 100644--- a/frontend/src/utils/index.ts+++ b/frontend/src/utils/index.ts@@ -19,7 +19,6 @@ export * from "./TinyTimer";export * from "./sheet";export * from "./naive-ui";export * from "./useDashboardSidebar";-export * from "./release";export * from "./v1";export * from "./iam";diff --git a/frontend/src/utils/issue/cel.ts b/frontend/src/utils/issue/cel.tsindex 52c1297e85..932cab8e63 100644--- a/frontend/src/utils/issue/cel.ts+++ b/frontend/src/utils/issue/cel.ts@@ -149,7 +149,7 @@ export const buildConditionExpr = ({});};-export const stringifyDatabaseResources = (resources: DatabaseResource[]) => {+const stringifyDatabaseResources = (resources: DatabaseResource[]) => {const conditionList: DatabaseResourceCondition[] = [];for (const resource of resources) {diff --git a/frontend/src/utils/issue/index.ts b/frontend/src/utils/issue/index.tsdeleted file mode 100644index e69de29bb2..0000000000diff --git a/frontend/src/utils/release.ts b/frontend/src/utils/release.tsdeleted file mode 100644index 6471df2bcf..0000000000--- a/frontend/src/utils/release.ts+++ /dev/null@@ -1,5 +0,0 @@-import type { Release_File } from "@/types/proto-es/v1/release_service_pb";--export const getReleaseFileStatement = (file: Release_File) => {- return new TextDecoder().decode(file.statement);-};diff --git a/frontend/src/utils/slug.ts b/frontend/src/utils/slug.tsindex 386c349b69..cfbb796752 100644--- a/frontend/src/utils/slug.ts+++ b/frontend/src/utils/slug.ts@@ -3,21 +3,6 @@ import {reviewConfigNamePrefix,} from "@/store/modules/v1/common";import type { SQLReviewPolicy } from "../types";-import type { IdType } from "../types/id";--export const indexOrUIDFromSlug = (slug: string): number => {- const parts = slug.split("-");- const indexOrUID = parseInt(parts[parts.length - 1], 10);- if (Number.isNaN(indexOrUID) || indexOrUID < 0) {- return -1;- }- return indexOrUID;-};--export function uidFromSlug(slug: string): IdType {- const parts = slug.split("-");- return parseInt(parts[parts.length - 1]);-}export const idFromSlug = (slug: string): string => {const parts = slug.split("-");diff --git a/frontend/src/utils/sso.ts b/frontend/src/utils/sso.tsindex 5a7db1131d..4de105ad96 100644--- a/frontend/src/utils/sso.ts+++ b/frontend/src/utils/sso.ts@@ -2,7 +2,6 @@ import type { OAuthState } from "@/types";import type { IdentityProvider } from "@/types/proto-es/v1/idp_service_pb";import { IdentityProviderType } from "@/types/proto-es/v1/idp_service_pb";-export const SSOConfigSessionKey = "sso-config";const OAUTH_STATE_PREFIX = "oauth_state_";const OAUTH_STATE_TTL = 10 * 60 * 1000; // 10 minutes in millisecondsdiff --git a/frontend/src/utils/util.ts b/frontend/src/utils/util.tsindex 23f8eb42c8..4ad795a38b 100644--- a/frontend/src/utils/util.ts+++ b/frontend/src/utils/util.ts@@ -96,23 +96,6 @@ export function bytesToString(size: number): string {return round(size, 2) + " " + unitList[i];}-export function nanosecondsToString(nanoseconds: number): string {- // dayjs.duration() takes the length of time in milliseconds.- return dayjs.duration(nanoseconds / 1000000).humanize();-}--export function timezoneString(zoneName: string, offset: number): string {- let sign = "+";- if (offset < 0) {- sign = "-";- }- const hour = Math.abs(offset) / 3600;- const minutes = Math.abs(offset) & (3600 / 60);- return `${zoneName}${sign}${String(hour).padStart(2, "0")}:${String(- minutes- ).padStart(2, "0")}`;-}-export function urlfy(str: string): string {let result = str.trim();if (result.search(/^http[s]?:\/\//) == -1) {@@ -121,18 +104,6 @@ export function urlfy(str: string): string {return result;}-export function isUrl(str: string): boolean {- let url;-- try {- url = new URL(str);- } catch {- return false;- }-- return url.protocol === "http:" || url.protocol === "https:";-}-// Performs inline swap, also handles negative index (counting from the end)// arraySwap([1, 2, 3, 4], 1, 2) => [1, 3, 2, 4]// arraySwap([1, 2, 3, 4], -1, -2) => [1, 2, 4, 3]@@ -308,10 +279,6 @@ export function emitStorageChangedEvent() {iframeEl.remove();}-export function removeElementBySelector(selector: string) {- document.body.querySelectorAll(selector).forEach((e) => e.remove());-}-type CompareFunc = "gt" | "lt" | "eq" | "neq" | "gte" | "lte";// semverCompare compares version string v1 is greater than v2.// It should be used to handle the database pseudo semantic version likes "8.0.29-0ubuntu0.20.04.3".@@ -329,12 +296,6 @@ export function semverCompare(return semver[method](formattedV1, formattedV2);}-export function clearObject(obj: Record<string, unknown>) {- const keys = Object.keys(obj);- keys.forEach((key) => delete obj[key]);- return obj;-}-const MODIFIERS = ["cmd","ctrl",@@ -344,9 +305,9 @@ const MODIFIERS = ["opt_or_alt","shift",] as const;-export type ModifierKey = (typeof MODIFIERS)[number];+type ModifierKey = (typeof MODIFIERS)[number];-export const modifierKeyText = (mod: ModifierKey) => {+const modifierKeyText = (mod: ModifierKey) => {const isMac = navigator.userAgent.search("Mac") !== -1;if (mod === "cmd" || (mod === "cmd_or_ctrl" && isMac)) {return "⌘"; // U+2318diff --git a/frontend/src/utils/v1/database.ts b/frontend/src/utils/v1/database.tsindex 04cb22c1c1..c809d9af1a 100644--- a/frontend/src/utils/v1/database.ts+++ b/frontend/src/utils/v1/database.ts@@ -26,7 +26,7 @@ export const databaseV1Url = (db: Database) => {return databaseV1UrlWithProject(db.project, db.name);};-export const databaseV1UrlWithProject = (project: string, database: string) => {+const databaseV1UrlWithProject = (project: string, database: string) => {const projectId = extractProjectResourceName(project);const { databaseName, instanceName } = extractDatabaseResourceName(database);diff --git a/frontend/src/utils/v1/instance.ts b/frontend/src/utils/v1/instance.tsindex c91cedf19d..1f20a0f663 100644--- a/frontend/src/utils/v1/instance.ts+++ b/frontend/src/utils/v1/instance.ts@@ -253,13 +253,6 @@ export const instanceV1AllowsReorderColumns = (return [Engine.MYSQL, Engine.TIDB].includes(engine);};-export const instanceV1SupportsTablePartition = (- instanceOrEngine: Instance | InstanceResource | Engine-) => {- const engine = engineOfInstanceV1(instanceOrEngine);- return [Engine.MYSQL, Engine.TIDB].includes(engine);-};-export const instanceV1SupportsExternalTable = (instanceOrEngine: Instance | InstanceResource | Engine) => {@@ -472,16 +465,6 @@ export const getDefaultTransactionMode = (): boolean => {return true;};-// Engines that support prior backup rollback (restore from backup)-// These engines support GenerateRestoreSQL for DML rollback via backup restore-export const instanceV1SupportsPriorBackupRollback = (- engine: Engine-): boolean => {- return [Engine.MYSQL, Engine.POSTGRES, Engine.MSSQL, Engine.ORACLE].includes(- engine- );-};-// Engines that support schema diff rollback (generate reverse DDL via schema comparison)// These engines have RegisterGenerateMigration implemented in backendexport const instanceV1SupportsSchemaRollback = (engine: Engine): boolean => {diff --git a/frontend/src/utils/v1/issue/issue.ts b/frontend/src/utils/v1/issue/issue.tsindex 345202a8e4..501e4c0115 100644--- a/frontend/src/utils/v1/issue/issue.ts+++ b/frontend/src/utils/v1/issue/issue.ts@@ -20,7 +20,7 @@ import {import type { Plan } from "@/types/proto-es/v1/plan_service_pb";import type { Project } from "@/types/proto-es/v1/project_service_pb";import type { Rollout, Task } from "@/types/proto-es/v1/rollout_service_pb";-import { Task_Status, Task_Type } from "@/types/proto-es/v1/rollout_service_pb";+import { Task_Status } from "@/types/proto-es/v1/rollout_service_pb";import { extractDatabaseResourceName, extractProjectResourceName } from "..";export const extractIssueUID = (name: string) => {@@ -45,23 +45,6 @@ export const flattenTaskV1List = (rollout: Rollout | undefined) => {return rollout?.stages.flatMap((stage) => stage.tasks) || [];};-const DATABASE_RELATED_TASK_TYPE_LIST = [- Task_Type.DATABASE_CREATE,- Task_Type.DATABASE_MIGRATE,-];--export const isDatabaseChangeRelatedIssue = (- issue: Issue,- rollout: Rollout | undefined-): boolean => {- return (- Boolean(issue.plan) &&- flattenTaskV1List(rollout).some((task) => {- return DATABASE_RELATED_TASK_TYPE_LIST.includes(task.type);- })- );-};-export const isGrantRequestIssue = (issue: Issue): boolean => {return issue.type === Issue_Type.GRANT_REQUEST;};diff --git a/frontend/src/utils/v1/issue/plan.ts b/frontend/src/utils/v1/issue/plan.tsindex 8f0c2dd2c0..bc60216a9a 100644--- a/frontend/src/utils/v1/issue/plan.ts+++ b/frontend/src/utils/v1/issue/plan.ts@@ -31,7 +31,7 @@ export const extractPlanCheckRunUID = (name: string) => {return matches?.[1] ?? "";};-export const extractSpecId = (name: string) => {+const extractSpecId = (name: string) => {const pattern = /(?:^|\/)specs\/([^/]+)(?:$|\/)/;const matches = name.match(pattern);return matches?.[1] ?? "";diff --git a/frontend/src/utils/v1/issue/rollout.ts b/frontend/src/utils/v1/issue/rollout.tsindex 7b47ac161e..aaa0dde022 100644--- a/frontend/src/utils/v1/issue/rollout.ts+++ b/frontend/src/utils/v1/issue/rollout.ts@@ -1,15 +1,7 @@-import { last } from "lodash-es";import { useI18n } from "vue-i18n";import { TASK_STATUS_FILTERS } from "@/components/Plan/constants/task";import { useDatabaseV1Store } from "@/store";-import {- isValidDatabaseName,- UNKNOWN_ID,- UNKNOWN_TASK_NAME,- unknownDatabase,- unknownStage,- unknownTask,-} from "@/types";+import { isValidDatabaseName, UNKNOWN_ID, unknownDatabase } from "@/types";import type { Plan } from "@/types/proto-es/v1/plan_service_pb";import type { Project } from "@/types/proto-es/v1/project_service_pb";import {@@ -22,7 +14,6 @@ import {} from "@/types/proto-es/v1/rollout_service_pb";import {extractCoreDatabaseInfoFromDatabaseCreateTask,- flattenTaskV1List,mockDatabase,} from "./issue";@@ -46,14 +37,6 @@ export const extractStageUID = (name: string) => {return matches?.[1] ?? "";};-export const isValidStageName = (name: string | undefined) => {- if (!name) {- return false;- }- const stageUID = extractStageUID(name);- return stageUID && stageUID !== String(UNKNOWN_ID);-};-export const extractTaskUID = (name: string) => {const pattern = /(?:^|\/)tasks\/([^/]+)(?:$|\/)/;const matches = name.match(pattern);@@ -98,15 +81,6 @@ export const extractTaskNameFromTaskRunName = (taskRunName: string): string => {return taskRunName.substring(0, idx);};-export const stageV1Slug = (stage: Stage): string => {- // Stage UID is now the environment ID- return extractStageUID(stage.name);-};--export const taskV1Slug = (task: Task): string => {- return extractTaskUID(task.name);-};-/*** Extracts the stage resource name from a task resource name.* Task name format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}@@ -118,92 +92,6 @@ export const extractStageNameFromTaskName = (taskName: string): string => {return matches?.[1] ?? "";};-export const activeTaskInTaskList = (tasks: Task[]): Task => {- // Focus on the running task first.- const runningTask = tasks.find((task) => task.status === Task_Status.RUNNING);- if (runningTask) {- return runningTask;- }-- const maybeActiveTask = tasks.find(- (task) =>- task.status === Task_Status.NOT_STARTED ||- task.status === Task_Status.PENDING ||- // "FAILED" is also a transient task status, which requires user- // to take further action (e.g. Skip, Retry)- task.status === Task_Status.FAILED ||- // "CANCELED" tasks can be "RESTART"ed- // So it should be an "active" task- task.status === Task_Status.CANCELED ||- task.status === Task_Status.STATUS_UNSPECIFIED // compatibility for preview phase- );- if (maybeActiveTask) {- return maybeActiveTask;- }-- // fallback- return last(tasks) ?? unknownTask();-};--export const activeTaskInStageV1 = (stage: Stage): Task => {- return activeTaskInTaskList(stage.tasks);-};--export const activeTaskInRollout = (rollout: Rollout | undefined): Task => {- if (!rollout) {- return unknownTask();- }- return activeTaskInTaskList(flattenTaskV1List(rollout));-};--export const activeStageInRollout = (rollout: Rollout | undefined): Stage => {- const activeTask = activeTaskInRollout(rollout);- if (activeTask.name !== UNKNOWN_TASK_NAME) {- const stage = rollout?.stages.find((stage) =>- stage.tasks.includes(activeTask)- );- if (stage) {- return stage;- }- }- return unknownStage();-};--export const findTaskByName = (- rollout: Rollout | undefined,- name: string-): Task => {- // Use task ID for comparison to handle legacy data with malformed stage IDs.- const targetTaskUID = extractTaskUID(name);- if (!targetTaskUID) {- return unknownTask();- }- for (const stage of rollout?.stages ?? []) {- for (const task of stage.tasks) {- if (extractTaskUID(task.name) === targetTaskUID) {- return task;- }- }- }- return unknownTask();-};--export const findStageByName = (- rollout: Rollout | undefined,- name: string-): Stage => {- // Use stage ID for comparison to handle legacy data with malformed stage IDs.- const targetStageUID = extractStageUID(name);- if (!targetStageUID) {- return unknownStage();- }- return (- (rollout?.stages ?? []).find(- (s) => extractStageUID(s.name) === targetStageUID- ) ?? unknownStage()- );-};-export const sheetNameOfTaskV1 = (task: Task): string => {if (task.payload?.case === "databaseCreate") {return task.payload.value.sheet ?? "";@@ -221,20 +109,6 @@ export const sheetNameOfTaskV1 = (task: Task): string => {return "";};-export const setSheetNameForTask = (task: Task, sheetName: string) => {- if (task.payload?.case === "databaseCreate") {- task.payload.value.sheet = sheetName;- } else if (task.payload?.case === "databaseUpdate") {- // Task.DatabaseUpdate now uses oneof source { sheet | release }- task.payload.value.source = {- case: "sheet",- value: sheetName,- };- } else if (task.payload?.case === "databaseDataExport") {- task.payload.value.sheet = sheetName;- }-};-export const releaseNameOfTaskV1 = (task: Task): string => {if (task.payload?.case === "databaseUpdate") {// Task.DatabaseUpdate now uses oneof source { sheet | release }diff --git a/frontend/src/utils/v1/sheet.ts b/frontend/src/utils/v1/sheet.tsindex 8a78ea6be8..8d5e7f0c33 100644--- a/frontend/src/utils/v1/sheet.ts+++ b/frontend/src/utils/v1/sheet.ts@@ -7,10 +7,6 @@ export const extractSheetUID = (name: string) => {return matches?.[1] ?? "-1";};-export const isLocalSheet = (name: string) => {- return extractSheetUID(name).startsWith("-");-};-export const setSheetStatement = (sheet: Sheet | Worksheet,statement: stringdiff --git a/frontend/src/utils/v1/sql.ts b/frontend/src/utils/v1/sql.tsindex 63158e8d6a..49e8bde091 100644--- a/frontend/src/utils/v1/sql.ts+++ b/frontend/src/utils/v1/sql.ts@@ -145,7 +145,7 @@ const escapeMongoDBCollectionName = (name: string) => {.replace(/'/g, "\\u0027");};-export const wrapSQLIdentifier = (id: string, engine: Engine) => {+const wrapSQLIdentifier = (id: string, engine: Engine) => {if (engine === Engine.MSSQL) {return `[${id}]`;}@@ -167,7 +167,7 @@ export const wrapSQLIdentifier = (id: string, engine: Engine) => {return "`" + id + "`";};-export const generateSchemaAndTableNameInSQL = (+const generateSchemaAndTableNameInSQL = (engine: Engine,schema: string,tableOrView: stringdiff --git a/frontend/src/utils/v1/taskRunLog.ts b/frontend/src/utils/v1/taskRunLog.tsdeleted file mode 100644index 4160afa7f2..0000000000--- a/frontend/src/utils/v1/taskRunLog.ts+++ /dev/null@@ -1,31 +0,0 @@-import { t } from "@/plugins/i18n";-import { TaskRunLogEntry_Type } from "@/types/proto-es/v1/rollout_service_pb";--export const displayTaskRunLogEntryType = (type: TaskRunLogEntry_Type) => {- if (type === TaskRunLogEntry_Type.COMMAND_EXECUTE) {- return t("issue.task-run.task-run-log.entry-type.command-execute");- }- if (type === TaskRunLogEntry_Type.SCHEMA_DUMP) {- return t("issue.task-run.task-run-log.entry-type.schema-dump");- }- if (type === TaskRunLogEntry_Type.TRANSACTION_CONTROL) {- return t("issue.task-run.task-run-log.entry-type.transaction-control");- }- if (type === TaskRunLogEntry_Type.DATABASE_SYNC) {- return t("issue.task-run.task-run-log.entry-type.database-sync");- }- if (type === TaskRunLogEntry_Type.PRIOR_BACKUP) {- return t("issue.task-run.task-run-log.entry-type.prior-backup");- }- if (type === TaskRunLogEntry_Type.COMPUTE_DIFF) {- return t("issue.task-run.task-run-log.entry-type.compute-diff");- }- if (type === TaskRunLogEntry_Type.RETRY_INFO) {- return t("issue.task-run.task-run-log.entry-type.retry-info");- }-- console.warn(- `[displayTaskRunLogEntryType] should never reach this line: type=${TaskRunLogEntry_Type[type]}`- );- return "";-};diff --git a/frontend/src/utils/workspaceApprovalSetting.ts b/frontend/src/utils/workspaceApprovalSetting.tsindex 582c770ce7..02b7da2746 100644--- a/frontend/src/utils/workspaceApprovalSetting.ts+++ b/frontend/src/utils/workspaceApprovalSetting.ts@@ -15,10 +15,6 @@ import {import { batchConvertCELStringToParsedExpr } from "@/utils";import { displayRoleTitle } from "./role";-export const approvalNodeRoleText = (role: string) => {- return displayRoleTitle(role);-};-// Convert proto WorkspaceApprovalSetting to local formatexport const resolveLocalApprovalConfig = async (config: WorkspaceApprovalSettingdiff --git a/frontend/src/views/SettingWorkspaceSQLReviewDetail.vue b/frontend/src/views/SettingWorkspaceSQLReviewDetail.vueindex 174d254759..5ae0b64086 100644--- a/frontend/src/views/SettingWorkspaceSQLReviewDetail.vue+++ b/frontend/src/views/SettingWorkspaceSQLReviewDetail.vue@@ -198,7 +198,6 @@ import {convertRuleMapToPolicyRuleList,getRuleMapByEngine,UNKNOWN_ID,- unknown,} from "@/types";import type { Engine } from "@/types/proto-es/v1/common_pb";import { SQLReviewRule_Type } from "@/types/proto-es/v1/review_config_service_pb";@@ -269,7 +268,13 @@ onMounted(() => {const reviewPolicy = computed(() => {return (- store.getReviewPolicyByName(sqlReviewName.value) ?? unknown("SQL_REVIEW")+ store.getReviewPolicyByName(sqlReviewName.value) ?? {+ id: `${UNKNOWN_ID}`,+ enforce: false,+ name: "",+ ruleList: [],+ resources: [],+ });});diff --git a/frontend/src/views/sql-editor/EditorCommon/SharePopover.vue b/frontend/src/views/sql-editor/EditorCommon/SharePopover.vueindex d91ef079dd..a992c5e1e5 100644--- a/frontend/src/views/sql-editor/EditorCommon/SharePopover.vue+++ b/frontend/src/views/sql-editor/EditorCommon/SharePopover.vue@@ -87,7 +87,7 @@import { useClipboard } from "@vueuse/core";import { LockKeyholeIcon, UsersIcon } from "lucide-vue-next";import { NInput, NInputGroup, NInputGroupLabel, NPopover } from "naive-ui";-import { computed, h, onMounted, ref } from "vue";+import { computed, h, onMounted, ref, type VNode } from "vue";import { useI18n } from "vue-i18n";import { useRouter } from "vue-router";import { CopyButton } from "@/components/v2";@@ -99,13 +99,19 @@ import {useSQLEditorTabStore,useWorkSheetStore,} from "@/store";-import type { AccessOption } from "@/types";import {type Worksheet,Worksheet_Visibility,} from "@/types/proto-es/v1/worksheet_service_pb";import { extractProjectResourceName, extractWorksheetUID } from "@/utils";+type AccessOption = {+ label: string;+ description: string;+ value: Worksheet_Visibility;+ icon: VNode;+};+const props = defineProps<{worksheet?: Worksheet;}>();