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: show deployment config tab for normal projects (#12627)
boojackb4b8be9782c0
diff --git a/frontend/src/components/AlterSchemaPrepForm/AlterSchemaPrepForm.vue b/frontend/src/components/AlterSchemaPrepForm/AlterSchemaPrepForm.vueindex 671b56188c..33158b7448 100644--- a/frontend/src/components/AlterSchemaPrepForm/AlterSchemaPrepForm.vue+++ b/frontend/src/components/AlterSchemaPrepForm/AlterSchemaPrepForm.vue@@ -9,23 +9,6 @@: $t("database.change-data")}}</span>- <i18n-t- v-if="isTenantProject"- class="text-sm textinfolabel"- tag="span"- keypath="deployment-config.pipeline-generated-from-deployment-config"- >- <template #deployment_config>- <router-link- :to="`/${selectedProject!.name}/settings`"- class="underline hover:bg-link-hover"- active-class=""- exact-active-class=""- >- {{ $t("common.deployment-config") }}- </router-link>- </template>- </i18n-t></div></template>@@ -33,152 +16,52 @@class="space-y-4 h-full w-[calc(100vw-8rem)] lg:w-[60rem] max-w-[calc(100vw-8rem)] overflow-x-auto"><div v-if="ready">- <!-- tenant mode project -->- <template v-if="isTenantProject">- <NTabs v-model:value="state.alterType">- <NTabPane :tab="$t('alter-schema.alter-db-group')" name="TENANT">- <div>- <ProjectTenantView- :label="state.label"- :database-list="selectableDatabaseList"- :environment-list="environmentList"- :project="selectedProject"- @dismiss="cancel"- />- <SchemalessDatabaseTable- v-if="isEditSchema"- mode="PROJECT"- :database-list="schemalessDatabaseList"- />- </div>- </NTabPane>- <NTabPane- :tab="$t('alter-schema.alter-multiple-db')"- name="MULTI_DB"- >- <div class="px-1 space-x-2 mb-4">- <NRadio- :checked="state.databaseSelectedTab === 'DATABASE'"- value="DATABASE"- name="database-tab"- @update:checked="state.databaseSelectedTab = 'DATABASE'"- >- {{ $t("common.database") }}- </NRadio>- <NRadio- :checked="state.databaseSelectedTab === 'DATABASE_GROUP'"- value="DATABASE_GROUP"- name="database-tab"- @update:checked="state.databaseSelectedTab = 'DATABASE_GROUP'"- >- <renderDatabaseGroupTabTitle />- </NRadio>- </div>- <div v-if="state.databaseSelectedTab === 'DATABASE'">- <ProjectStandardView- :project="selectedProject"- :database-list="selectableDatabaseList"- :environment-list="environmentList"- @select-databases="- (...dbUidList) =>- (state.selectedDatabaseUidList = new Set(dbUidList))- "- />- <SchemalessDatabaseTable- v-if="isEditSchema"- mode="PROJECT"- :database-list="schemalessDatabaseList"- />- </div>- <div v-else-if="state.databaseSelectedTab === 'DATABASE_GROUP'">- <DatabaseGroupDataTable- :database-group-list="filteredDatabaseGroupList"- :show-edit="false"- @update:selected-database-groups="- handleDatabaseGroupsSelectionChanged- "+ <NTabs v-model:value="state.databaseSelectedTab">+ <NTabPane :tab="$t('common.database')" name="DATABASE">+ <div class="space-y-3">+ <div class="w-full flex items-center space-x-2">+ <AdvancedSearch+ v-model:params="state.params"+ :autofocus="false"+ :placeholder="$t('database.filter-database')"+ :scope-options="scopeOptions"/>- </div>- </NTabPane>- <template #suffix>- <NInputGroup class="py-0.5">- <template v-if="state.alterType === 'TENANT'">- <NInputGroupLabel- :bordered="false"- style="--n-group-label-color: transparent"- >- Group by- </NInputGroupLabel>- <YAxisRadioGroup- v-model:label="state.label"- :database-list="filteredDatabaseList"- />- </template><DatabaseLabelFilter- v-if="- state.alterType === 'TENANT' ||- state.databaseSelectedTab === 'DATABASE'- "v-model:selected="state.selectedLabels":database-list="rawDatabaseList":placement="'left-start'"/>- <SearchBox- v-if="state.alterType === 'MULTI_DB'"- v-model:value="state.params.query"- :placeholder="$t('common.filter-by-name')"- />- </NInputGroup>- </template>- </NTabs>- </template>- <template v-else>- <NTabs v-model:value="state.databaseSelectedTab">- <NTabPane :tab="$t('common.database')" name="DATABASE">- <div class="space-y-3">- <div class="w-full flex items-center space-x-2">- <AdvancedSearch- v-model:params="state.params"- :autofocus="false"- :placeholder="$t('database.filter-database')"- :scope-options="scopeOptions"- />- <DatabaseLabelFilter- v-model:selected="state.selectedLabels"- :database-list="rawDatabaseList"- :placement="'left-start'"- />- </div>- <DatabaseV1Table- mode="ALL_SHORT"- :database-list="selectableDatabaseList"- @update:selected-databases="handleDatabasesSelectionChanged"- />- <SchemalessDatabaseTable- v-if="isEditSchema"- mode="ALL"- :database-list="schemalessDatabaseList"- />- </div>- </NTabPane>- <NTabPane :tab="renderDatabaseGroupTabTitle" name="DATABASE_GROUP">- <div class="space-y-3">- <AdvancedSearch- v-model:params="state.params"- :autofocus="false"- :placeholder="$t('database.filter-database-group')"- />- <DatabaseGroupDataTable- :database-group-list="filteredDatabaseGroupList"- :show-edit="false"- @update:selected-database-groups="- handleDatabaseGroupsSelectionChanged- "- /></div>- </NTabPane>- </NTabs>- </template>+ <DatabaseV1Table+ mode="ALL_SHORT"+ :show-sql-editor-button="false"+ :database-list="selectableDatabaseList"+ @update:selected-databases="handleDatabasesSelectionChanged"+ />+ <SchemalessDatabaseTable+ v-if="isEditSchema"+ mode="ALL"+ :database-list="schemalessDatabaseList"+ />+ </div>+ </NTabPane>+ <NTabPane :tab="renderDatabaseGroupTabTitle" name="DATABASE_GROUP">+ <div class="space-y-3">+ <AdvancedSearch+ v-model:params="state.params"+ :autofocus="false"+ :placeholder="$t('database.filter-database-group')"+ />+ <DatabaseGroupDataTable+ :database-group-list="filteredDatabaseGroupList"+ :show-edit="false"+ @update:selected-database-groups="+ handleDatabaseGroupsSelectionChanged+ "+ />+ </div>+ </NTabPane>+ </NTabs></div><divv-if="!ready"@@ -188,16 +71,10 @@</div></div>- <!-- Only show footer in project mode --><template #footer><div class="flex-1 flex items-center justify-between"><div>- <NTooltip- v-if="- flattenSelectedDatabaseUidList.length > 0 &&- state.alterType === 'MULTI_DB'- "- >+ <NTooltip v-if="flattenSelectedDatabaseUidList.length > 0"><template #trigger><div class="textinfolabel">{{@@ -224,15 +101,7 @@<NButton @click.prevent="cancel">{{ $t("common.cancel") }}</NButton>- <NButton- v-if="isTenantProject"- type="primary"- :disabled="!allowGenerateTenant"- @click.prevent="generateTenant"- >- {{ $t("common.next") }}- </NButton>- <NTooltip v-else :disabled="flattenSelectedProjectList.length <= 1">+ <NTooltip :disabled="flattenSelectedProjectList.length <= 1"><template #trigger><NButtontype="primary"@@ -260,7 +129,7 @@<SchemaEditorModalv-if="state.showSchemaEditorModal":database-id-list="schemaEditorContext.databaseIdList"- :alter-type="state.alterType"+ :alter-type="'MULTI_DB'":plan-only="state.planOnly"@close="state.showSchemaEditorModal = false"/>@@ -268,17 +137,9 @@<script lang="ts" setup>import { head, uniqBy } from "lodash-es";-import {- NButton,- NTabs,- NTabPane,- NRadio,- NInputGroup,- NInputGroupLabel,- NCheckbox,-} from "naive-ui";+import { NButton, NTabs, NTabPane, NCheckbox, NTooltip } from "naive-ui";import type { PropType } from "vue";-import { computed, reactive, ref, watch, watchEffect, h } from "vue";+import { computed, reactive, ref, watchEffect, h } from "vue";import { useI18n } from "vue-i18n";import { useRouter } from "vue-router";import { DatabaseGroupDataTable } from "@/components/DatabaseGroup";@@ -293,7 +154,6 @@ import {useCurrentUserV1,useSearchDatabaseV1List,useDatabaseV1Store,- useEnvironmentV1List,useProjectV1Store,useDBGroupStore,usePageMode,@@ -301,7 +161,6 @@ import {import type { ComposedDatabase, FeatureType } from "@/types";import { UNKNOWN_ID, DEFAULT_PROJECT_V1_NAME } from "@/types";import { State } from "@/types/proto/v1/common";-import { TenantMode } from "@/types/proto/v1/project_service";import type { SearchParams } from "@/utils";import {allowUsingSchemaEditor,@@ -317,14 +176,11 @@ import { generateDatabaseGroupIssueRoute } from "@/utils/databaseGroup/issue";import AdvancedSearch from "../AdvancedSearch";import { useCommonSearchScopeOptions } from "../AdvancedSearch/useCommonSearchScopeOptions";import { DatabaseLabelFilter, DrawerContent } from "../v2";-import ProjectStandardView from "./ProjectStandardView.vue";-import ProjectTenantView from "./ProjectTenantView.vue";import SchemaEditorModal from "./SchemaEditorModal.vue";import SchemalessDatabaseTable from "./SchemalessDatabaseTable.vue";type LocalState = {label: string;- alterType: "MULTI_DB" | "TENANT";databaseSelectedTab: "DATABASE" | "DATABASE_GROUP";showSchemaLessDatabaseList: boolean;selectedLabels: { key: string; value: string }[];@@ -376,7 +232,6 @@ const schemaEditorContext = ref<{});const state = reactive<LocalState>({- alterType: "MULTI_DB",selectedDatabaseUidList: new Set<string>(),label: "environment",databaseSelectedTab: "DATABASE",@@ -442,28 +297,6 @@ const isEditSchema = computed((): boolean => {return props.type === "bb.issue.database.schema.update";});-const isTenantProject = computed((): boolean => {- return (- !!props.projectId &&- selectedProject.value?.tenantMode === TenantMode.TENANT_MODE_ENABLED- );-});--watch(- () => isTenantProject.value,- (isTenant) => {- if (isTenant) {- // For tenant mode projects, alter multiple db via DeploymentConfig- // is the default suggested way.- state.alterType = "TENANT";- state.databaseSelectedTab = "DATABASE_GROUP";- }- },- { immediate: true }-);--const environmentList = useEnvironmentV1List(false /* !showDeleted */);-const { ready } = useSearchDatabaseV1List(computed(() => {const filters = ["instance = instances/-"];@@ -678,20 +511,6 @@ const generateMultiDb = async () => {});};-const allowGenerateTenant = computed(() => {- if (!isTenantProject.value) {- return false;- }- if (state.alterType === "MULTI_DB") {- if (state.databaseSelectedTab === "DATABASE") {- return flattenSelectedDatabaseUidList.value.length > 0;- }- return !!state.selectedDatabaseGroupName;- }-- return true;-});-const handleDatabasesSelectionChanged = (selectedDatabaseNameList: Set<string>) => {@@ -714,85 +533,6 @@ const handleDatabaseGroupsSelectionChanged = (state.selectedDatabaseGroupName = databaseGroupName;};-const generateTenant = async () => {- if (- state.databaseSelectedTab === "DATABASE_GROUP" &&- state.selectedDatabaseGroupName- ) {- previewDatabaseGroupIssue();- return;- }-- if (!hasFeature("bb.feature.multi-tenancy")) {- featureModalContext.value.feature = "bb.feature.multi-tenancy";- return;- }-- if (!selectedProject.value) return;- if (selectedProject.value.uid === String(UNKNOWN_ID)) return;-- const query: Record<string, any> = {- template: props.type,- batch: "1",- };- if (state.alterType === "TENANT") {- const databaseList = databaseV1Store.databaseListByProject(- selectedProject.value.name- );- if (isEditSchema.value && allowUsingSchemaEditor(databaseList)) {- schemaEditorContext.value.databaseIdList = databaseList- .filter((database) => database.syncState === State.ACTIVE)- .map((database) => database.uid);- state.showSchemaEditorModal = true;- return;- }- // In tenant deploy pipeline, we use project name instead of database name- // if more than one databases are to be deployed.- const name =- databaseList.length > 1- ? selectedProject.value.title- : databaseList[0].databaseName;- query.name = generateIssueName(props.type, [name], false);- query.databaseName = "";- } else {- const databaseList: ComposedDatabase[] = [];- for (const databaseId of flattenSelectedDatabaseUidList.value) {- const database = databaseV1Store.getDatabaseByUID(databaseId);- if (database.syncState === State.ACTIVE) {- databaseList.push(database);- }- }- if (isEditSchema.value && allowUsingSchemaEditor(databaseList)) {- schemaEditorContext.value.databaseIdList = [- ...flattenSelectedDatabaseUidList.value,- ];- state.showSchemaEditorModal = true;- return;- }-- query.name = generateIssueName(- props.type,- databaseList.map((database) => database.databaseName),- false- );- query.databaseList = databaseList.map((db) => db.name).join(",");- }-- emit("dismiss");-- router.push({- name: state.planOnly- ? PROJECT_V1_ROUTE_PLAN_DETAIL- : PROJECT_V1_ROUTE_ISSUE_DETAIL,- params: {- projectId: extractProjectResourceName(selectedProject.value.name),- issueSlug: "create",- planSlug: "create",- },- query,- });-};-const cancel = () => {emit("dismiss");};diff --git a/frontend/src/components/AlterSchemaPrepForm/SchemaEditorModal.vue b/frontend/src/components/AlterSchemaPrepForm/SchemaEditorModal.vueindex 999638eeca..86743ad56d 100644--- a/frontend/src/components/AlterSchemaPrepForm/SchemaEditorModal.vue+++ b/frontend/src/components/AlterSchemaPrepForm/SchemaEditorModal.vue@@ -181,7 +181,7 @@ const props = defineProps({required: true,},alterType: {- type: String as PropType<"TENANT" | "MULTI_DB" | "SINGLE_DB">,+ type: String as PropType<"MULTI_DB" | "SINGLE_DB">,required: true,},newWindow: {@@ -440,11 +440,7 @@ const handlePreviewIssue = async () => {query.databaseList = databaseList.value.map((db) => db.name).join(",");}}- if (props.alterType !== "TENANT") {- // If we are not using tenant deployment config pipeline- // we need to pass the databaseList explicitly.- query.databaseList = databaseList.value.map((db) => db.name).join(",");- }+ query.databaseList = databaseList.value.map((db) => db.name).join(",");if (state.selectedTab === "raw-sql") {query.sql = state.editStatement;diff --git a/frontend/src/components/IssueV1/components/TaskListSection/TaskCard.vue b/frontend/src/components/IssueV1/components/TaskListSection/TaskCard.vueindex ec594b3905..d0c50e52b9 100644--- a/frontend/src/components/IssueV1/components/TaskListSection/TaskCard.vue+++ b/frontend/src/components/IssueV1/components/TaskListSection/TaskCard.vue@@ -57,7 +57,7 @@import { computed } from "vue";import { useI18n } from "vue-i18n";import { InstanceV1Name } from "@/components/v2";-import { TenantMode, Workflow } from "@/types/proto/v1/project_service";+import { Workflow } from "@/types/proto/v1/project_service";import type { Task } from "@/types/proto/v1/rollout_service";import { Task_Type, task_StatusToJSON } from "@/types/proto/v1/rollout_service";import { extractSchemaVersionFromTask } from "@/utils";@@ -101,7 +101,6 @@ const schemaVersion = computed(() => {// show the schema version for a task if// the project is standard mode and VCS workflowif (isCreating.value) return "";- if (project.value.tenantMode === TenantMode.TENANT_MODE_ENABLED) return "";if (project.value.workflow === Workflow.UI) return "";return extractSchemaVersionFromTask(props.task);@@ -109,7 +108,6 @@ const schemaVersion = computed(() => {const taskClass = computed(() => {const { task } = props;-const classes: string[] = [];if (selected.value) classes.push("selected");if (active.value) classes.push("active");diff --git a/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunSection.vue b/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunSection.vueindex cc44d47487..f9129165cb 100644--- a/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunSection.vue+++ b/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunSection.vue@@ -19,7 +19,7 @@ import TaskRunTable from "./TaskRunTable.vue";type ViewMode = "SINGLE" | "MERGED";-const { issue, selectedTask, isGhostMode, isTenantMode } = useIssueContext();+const { issue, selectedTask, isGhostMode } = useIssueContext();/*** MERGED mode: merge all tasks' activities into one table@@ -27,7 +27,6 @@ const { issue, selectedTask, isGhostMode, isTenantMode } = useIssueContext();*/const mode = computed((): ViewMode => {if (isGhostMode.value) return "MERGED";- if (isTenantMode.value) return "SINGLE";return "SINGLE";});diff --git a/frontend/src/components/IssueV1/logic/base.ts b/frontend/src/components/IssueV1/logic/base.tsindex cf989101b2..68091cf92a 100644--- a/frontend/src/components/IssueV1/logic/base.ts+++ b/frontend/src/components/IssueV1/logic/base.ts@@ -5,14 +5,8 @@ import { computed } from "vue";import { useRoute, useRouter } from "vue-router";import { PROJECT_V1_ROUTE_ISSUE_DETAIL } from "@/router/dashboard/projectV1";import { useUIStateStore } from "@/store";-import {- EMPTY_ID,- emptyStage,- emptyTask,- TaskTypeListWithStatement,-} from "@/types";+import { EMPTY_ID, emptyStage, emptyTask } from "@/types";import type { Plan_Spec } from "@/types/proto/v1/plan_service";-import { TenantMode } from "@/types/proto/v1/project_service";import { Task_Type, Stage, Task } from "@/types/proto/v1/rollout_service";import { emptyPlanSpec } from "@/types/v1/issue/plan";import {@@ -51,7 +45,6 @@ export const useBaseIssueContext = (const plan = computed(() => issue.value.planEntity);const rollout = computed(() => issue.value.rolloutEntity);- const project = computed(() => issue.value.projectEntity);const specs = computed(() => flattenSpecList(plan.value));const activeStage = computed((): Stage => {@@ -190,21 +183,6 @@ export const useBaseIssueContext = (].includes(task.type);});});- const isTenantMode = computed((): boolean => {- // To sync databases schema in tenant mode, we use normal project logic to create issue.- if (isCreating.value && route.query.batch !== "1") return false;- if (project.value.tenantMode !== TenantMode.TENANT_MODE_ENABLED)- return false;-- // We support single database migration in tenant mode projects.- // So a pipeline should be tenant mode when it contains more- // than one tasks.- return (- flattenTaskV1List(rollout.value).filter((task) =>- TaskTypeListWithStatement.includes(task.type)- ).length > 1- );- });const isLegacyIssue = computed(() => {return !issue.value.plan && !issue.value.planEntity;});@@ -216,7 +194,6 @@ export const useBaseIssueContext = (return {phase,isGhostMode,- isTenantMode,isLegacyIssue,events,releaserCandidates,diff --git a/frontend/src/components/IssueV1/logic/context.ts b/frontend/src/components/IssueV1/logic/context.tsindex 336620642c..eca0107eb6 100644--- a/frontend/src/components/IssueV1/logic/context.ts+++ b/frontend/src/components/IssueV1/logic/context.ts@@ -47,7 +47,6 @@ export type IssueContext = {issue: Ref<ComposedIssue>;phase: Ref<IssuePhase>;isGhostMode: Ref<boolean>;- isTenantMode: Ref<boolean>;isLegacyIssue: Ref<boolean>;releaserCandidates: Ref<User[]>;diff --git a/frontend/src/components/IssueV1/logic/rollout.ts b/frontend/src/components/IssueV1/logic/rollout.tsindex 1d7b5a8e8e..103842e23f 100644--- a/frontend/src/components/IssueV1/logic/rollout.ts+++ b/frontend/src/components/IssueV1/logic/rollout.ts@@ -2,7 +2,6 @@ import { t } from "@/plugins/i18n";import type { ComposedIssue } from "@/types";import type { User } from "@/types/proto/v1/auth_service";import { IssueStatus, Issue_Type } from "@/types/proto/v1/issue_service";-import { TenantMode } from "@/types/proto/v1/project_service";import type { Task } from "@/types/proto/v1/rollout_service";import {Task_Status,@@ -13,7 +12,6 @@ import {extractDatabaseGroupName,extractDeploymentConfigName,extractUserResourceName,- flattenTaskV1List,hasProjectPermissionV2,} from "@/utils";import { planCheckRunSummaryForTask, specForTask } from ".";@@ -72,21 +70,7 @@ export const allowUserToEditStatementForTask = (if (task.type === Task_Type.DATABASE_CREATE) {// For standard mode projects, we are not allowed to edit the database// creation SQL statement.- if (issue.projectEntity.tenantMode !== TenantMode.TENANT_MODE_ENABLED) {- denyReasons.push("Cannot edit database creation statement");- }-- // We allow to edit create database statement for tenant project to give users a- // chance to edit the dumped schema from its peer databases, because the dumped schema- // may not be perfectly correct.- // So we fallthrough to the common checkpoints.- }-- if (issue.projectEntity.tenantMode === TenantMode.TENANT_MODE_ENABLED) {- const tasks = flattenTaskV1List(issue.rolloutEntity);- if (!tasks.every((task) => isTaskEditable(issue, task).length === 0)) {- denyReasons.push("Some of the tasks are not editable in batch mode");- }+ denyReasons.push("Cannot edit database creation statement");}// if not creating, we are allowed to edit sql statement only when:diff --git a/frontend/src/components/Project/useProjectSidebar.ts b/frontend/src/components/Project/useProjectSidebar.tsindex 8d64b9b3a3..3b05029e28 100644--- a/frontend/src/components/Project/useProjectSidebar.ts+++ b/frontend/src/components/Project/useProjectSidebar.ts@@ -41,7 +41,6 @@ import { useCurrentUserV1 } from "@/store";import type { ComposedProject } from "@/types";import { DEFAULT_PROJECT_V1_NAME } from "@/types";import type { ProjectPermission } from "@/types";-import { TenantMode } from "@/types/proto/v1/project_service";import { hasProjectPermissionV2 } from "@/utils";interface ProjectSidebarItem extends SidebarItem {@@ -59,10 +58,6 @@ export const useProjectSidebar = (project: Ref<ComposedProject>) => {return project.value.name === DEFAULT_PROJECT_V1_NAME;});- const isTenantProject = computed((): boolean => {- return project.value.tenantMode === TenantMode.TENANT_MODE_ENABLED;- });-const getFlattenProjectV1Routes = (routes: RouteRecordRaw[],permissions: ProjectPermission[] = []@@ -145,7 +140,6 @@ export const useProjectSidebar = (project: Ref<ComposedProject>) => {title: t("common.deployment-config"),path: PROJECT_V1_ROUTE_DEPLOYMENT_CONFIG,type: "div",- hide: !isTenantProject.value,},{title: t("common.change-history"),diff --git a/frontend/src/components/ProjectDatabasesPanel.vue b/frontend/src/components/ProjectDatabasesPanel.vueindex ae99471869..34298d8f24 100644--- a/frontend/src/components/ProjectDatabasesPanel.vue+++ b/frontend/src/components/ProjectDatabasesPanel.vue@@ -16,14 +16,12 @@:placement="'left-start'"/></div>-<div class="space-y-2"><DatabaseOperationsv-if="showDatabaseOperations":project-uid="project.uid":databases="selectedDatabases"/>-<DatabaseV1Tablemode="PROJECT":database-list="filteredDatabaseList"diff --git a/frontend/src/components/ProjectDeploymentConfigPanel.vue b/frontend/src/components/ProjectDeploymentConfigPanel.vueindex 5eb2cba5a0..31fec84f62 100644--- a/frontend/src/components/ProjectDeploymentConfigPanel.vue+++ b/frontend/src/components/ProjectDeploymentConfigPanel.vue@@ -1,7 +1,7 @@<template>- <div class="w-full space-y-6">+ <div v-if="state.ready" class="w-full space-y-6"><DeploymentMatrix- v-if="state.ready && state.deployment"+ v-if="state.deployment"class="w-full !px-0 overflow-x-auto":project="project":deployment="state.deployment"@@ -15,66 +15,56 @@{{ $t("common.deployment-config") }}</div>- <template v-if="state.ready">- <BBAttention- v-if="state.deployment === undefined"- type="warning"- :title="$t('common.deployment-config')"- :description="- $t('deployment-config.this-is-example-deployment-config')- "- >- </BBAttention>-- <div v-else>- <DeploymentConfigTool- v-if="state.deployment.schedule"- :schedule="state.deployment.schedule"- :allow-edit="allowEdit"- :database-list="databaseList"- />- <div class="pt-4 border-t flex justify-between items-center">- <div class="flex items-center space-x-2">- <NButton v-if="allowEdit" @click="addStage">- {{ $t("deployment-config.add-stage") }}- </NButton>- </div>- <div v-if="allowEdit" class="flex items-center space-x-2">- <NButton- v-if="isDeploymentConfigDirty"- @click="revertDeploymentConfig"- >- {{ $t("common.revert") }}- </NButton>- <NPopover- v-if="allowEdit"- :disabled="!state.error"- trigger="hover"- >- <template #trigger>- <NButton- type="primary"- :disabled="!allowUpdateDeploymentConfig"- @click="updateDeploymentConfig"- >- {{ $t("common.update") }}- </NButton>- </template>-- <span v-if="state.error" class="text-error">- {{ $t(state.error) }}- </span>- </NPopover>- </div>+ <BBAttention+ v-if="state.deployment === undefined"+ type="warning"+ :title="$t('common.deployment-config')"+ :description="$t('deployment-config.this-is-example-deployment-config')"+ >+ </BBAttention>+ <div v-else>+ <DeploymentConfigTool+ v-if="state.deployment.schedule"+ :schedule="state.deployment.schedule"+ :allow-edit="allowEdit"+ :database-list="databaseList"+ />+ <div class="pt-4 border-t flex justify-between items-center">+ <div class="flex items-center space-x-2">+ <NButton v-if="allowEdit" @click="addStage">+ {{ $t("deployment-config.add-stage") }}+ </NButton>+ </div>+ <div v-if="allowEdit" class="flex items-center space-x-2">+ <NButton+ v-if="isDeploymentConfigDirty"+ @click="revertDeploymentConfig"+ >+ {{ $t("common.revert") }}+ </NButton>+ <NPopover v-if="allowEdit" :disabled="!state.error" trigger="hover">+ <template #trigger>+ <NButton+ type="primary"+ :disabled="!allowUpdateDeploymentConfig"+ @click="updateDeploymentConfig"+ >+ {{ $t("common.update") }}+ </NButton>+ </template>++ <span v-if="state.error" class="text-error">+ {{ $t(state.error) }}+ </span>+ </NPopover></div></div>- </template>-- <div v-else class="flex justify-center items-center py-10">- <BBSpin /></div></div></div>+ <div v-else class="flex justify-center items-center py-10">+ <BBSpin />+ </div></template><script lang="ts" setup>@@ -123,9 +113,9 @@ const props = defineProps({},});-const deploymentConfigV1Store = useDeploymentConfigV1Store();const { t } = useI18n();const dialog = useDialog();+const deploymentConfigV1Store = useDeploymentConfigV1Store();const state = reactive<LocalState>({ready: false,diff --git a/frontend/src/layouts/ProjectV1Layout.vue b/frontend/src/layouts/ProjectV1Layout.vueindex 548d4dd412..d7d60cb3e8 100644--- a/frontend/src/layouts/ProjectV1Layout.vue+++ b/frontend/src/layouts/ProjectV1Layout.vue@@ -36,7 +36,6 @@ import NoPermissionPlaceholder from "@/components/misc/NoPermissionPlaceholder.vimport {PROJECT_V1_ROUTE_DATABASES,PROJECT_V1_ROUTE_DATABASE_GROUPS,- PROJECT_V1_ROUTE_DEPLOYMENT_CONFIG,} from "@/router/dashboard/projectV1";import { useProjectV1Store, useCurrentUserV1, usePageMode } from "@/store";import { projectNamePrefix } from "@/store/modules/v1/common";@@ -46,7 +45,6 @@ import {QuickActionProjectPermissionMap,} from "@/types";import { State } from "@/types/proto/v1/common";-import { TenantMode } from "@/types/proto/v1/project_service";import { hasProjectPermissionV2 } from "@/utils";const props = defineProps<{@@ -131,20 +129,6 @@ const quickActionListForDatabaseGroup = computed((): QuickActionType[] => {];});-const quickActionListForDeploymentConfig = computed((): QuickActionType[] => {- if (project.value.tenantMode !== TenantMode.TENANT_MODE_ENABLED) {- return [];- }- if (project.value.state !== State.ACTIVE) {- return [];- }-- return [- "quickaction.bb.database.schema.update",- "quickaction.bb.database.data.update",- ];-});-const quickActionListForDatabase = computed((): QuickActionType[] => {if (project.value.state !== State.ACTIVE) {return [];@@ -164,8 +148,6 @@ const quickActionList = computed(() => {return getQuickActionList(quickActionListForDatabase.value);case PROJECT_V1_ROUTE_DATABASE_GROUPS:return getQuickActionList(quickActionListForDatabaseGroup.value);- case PROJECT_V1_ROUTE_DEPLOYMENT_CONFIG:- return getQuickActionList(quickActionListForDeploymentConfig.value);}return [];});diff --git a/frontend/src/store/modules/dbGroup.ts b/frontend/src/store/modules/dbGroup.tsindex c61eed5d15..fbbb732ee9 100644--- a/frontend/src/store/modules/dbGroup.ts+++ b/frontend/src/store/modules/dbGroup.ts@@ -19,10 +19,7 @@ import type {import { ParsedExpr } from "@/types/proto/google/api/expr/v1alpha1/syntax";import { Expr } from "@/types/proto/google/type/expr";import type { DatabaseGroup } from "@/types/proto/v1/project_service";-import {- DatabaseGroupView,- TenantMode,-} from "@/types/proto/v1/project_service";+import { DatabaseGroupView } from "@/types/proto/v1/project_service";import {batchConvertParsedExprToCELString,batchConvertCELStringToParsedExpr,@@ -319,10 +316,6 @@ export const useDatabaseInGroupFilter = (const databaseGroups = computedAsync(async () => {- if (unref(project).tenantMode !== TenantMode.TENANT_MODE_ENABLED) {- return [];- }-const response = await projectServiceClient.listDatabaseGroups({parent: unref(project).name,});diff --git a/frontend/src/views/project/ProjectDeploymentConfigPanel.vue b/frontend/src/views/project/ProjectDeploymentConfigPanel.vueindex c1e1bf1a2c..6077bf595d 100644--- a/frontend/src/views/project/ProjectDeploymentConfigPanel.vue+++ b/frontend/src/views/project/ProjectDeploymentConfigPanel.vue@@ -1,6 +1,5 @@<template><ProjectDeploymentConfigPanel- v-if="isTenantProject"id="deployment-config":project="project":database-list="databaseV1List"@@ -14,7 +13,6 @@ import ProjectDeploymentConfigPanel from "@/components/ProjectDeploymentConfigPaimport { useProjectV1Store } from "@/store";import { useDatabaseV1Store } from "@/store";import { projectNamePrefix } from "@/store/modules/v1/common";-import { TenantMode } from "@/types/proto/v1/project_service";import { sortDatabaseV1List } from "@/utils";const props = defineProps<{@@ -30,10 +28,6 @@ const project = computed(() => {);});-const isTenantProject = computed(() => {- return project.value.tenantMode === TenantMode.TENANT_MODE_ENABLED;-});-const databaseV1List = computed(() => {const list = useDatabaseV1Store().databaseListByProject(project.value.name);return sortDatabaseV1List(list);