Skip to content

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

chore: remove part of db group in plan detail page (#14621)

boojack14755d00d904
diff --git a/frontend/src/components/Plan/components/DescriptionSection/DescriptionSection.vue b/frontend/src/components/Plan/components/DescriptionSection/DescriptionSection.vue
index 9dc115cc90..c7363538aa 100644
--- a/frontend/src/components/Plan/components/DescriptionSection/DescriptionSection.vue
+++ b/frontend/src/components/Plan/components/DescriptionSection/DescriptionSection.vue
@@ -104,14 +104,12 @@ const allowEdit = computed(() => {
if (isCreating.value) {
return true;
}
-
+ // Allowed if current user is the creator.
if (extractUserResourceName(plan.value.creator) === currentUser.value.email) {
- // Allowed if current user is the creator.
return true;
}
-
+ // Allowed if current has plan update permission in the project
if (hasProjectPermissionV2(plan.value.projectEntity, "bb.plans.update")) {
- // Allowed if current has plan update permission in the project
return true;
}
return false;
diff --git a/frontend/src/components/Plan/components/PlanCheckSection/PlanCheckSection.vue b/frontend/src/components/Plan/components/PlanCheckSection/PlanCheckSection.vue
index 1347c8f456..744a6bccc8 100644
--- a/frontend/src/components/Plan/components/PlanCheckSection/PlanCheckSection.vue
+++ b/frontend/src/components/Plan/components/PlanCheckSection/PlanCheckSection.vue
@@ -55,15 +55,10 @@ const allowRunChecks = computed(() => {
const planCheckRunList = computed(() => {
// If a spec is database change spec, show plan checks for the spec.
- if (
- selectedSpec.value &&
- selectedSpec.value.id !== String(EMPTY_ID) &&
- isDatabaseChangeSpec(selectedSpec.value)
- ) {
+ if (selectedSpec.value && isDatabaseChangeSpec(selectedSpec.value)) {
return planCheckRunListForSpec(plan.value, selectedSpec.value);
}
- // Otherwise, show plan checks for the plan.
- // TODO(steven): update plan check runs display for db group and deployment config.
+ // Otherwise, show all plan checks in the plan.
return plan.value.planCheckRunList;
});
</script>
diff --git a/frontend/src/components/Plan/components/PlanDataTable/PlanDataTable.vue b/frontend/src/components/Plan/components/PlanDataTable/PlanDataTable.vue
index af22025bce..4c14ed752e 100644
--- a/frontend/src/components/Plan/components/PlanDataTable/PlanDataTable.vue
+++ b/frontend/src/components/Plan/components/PlanDataTable/PlanDataTable.vue
@@ -1,23 +1,20 @@
<template>
- <div ref="tableRef">
- <NDataTable
- :columns="columnList"
- :data="planList"
- :striped="true"
- :bordered="true"
- :loading="loading"
- :row-key="(plan: ComposedPlan) => plan.name"
- :row-props="rowProps"
- class="plan-data-table"
- />
- </div>
+ <NDataTable
+ :columns="columnList"
+ :data="planList"
+ :striped="true"
+ :bordered="true"
+ :loading="loading"
+ :row-key="(plan: ComposedPlan) => plan.name"
+ :row-props="rowProps"
+ class="plan-data-table"
+ />
</template>
<script lang="tsx" setup>
-import { useElementSize } from "@vueuse/core";
import type { DataTableColumn } from "naive-ui";
import { NPerformantEllipsis, NDataTable } from "naive-ui";
-import { computed, ref } from "vue";
+import { computed } from "vue";
import { useI18n } from "vue-i18n";
import { useRouter } from "vue-router";
import { ProjectNameCell } from "@/components/v2/Model/DatabaseV1Table/cells";
@@ -32,6 +29,19 @@ import {
} from "@/utils";
import PlanCheckRunStatusIcon from "../PlanCheckRunStatusIcon.vue";
+const props = withDefaults(
+ defineProps<{
+ planList: ComposedPlan[];
+ loading?: boolean;
+ showProject: boolean;
+ }>(),
+ {
+ loading: true,
+ showProject: true,
+ }
+);
+
+const router = useRouter();
const { t } = useI18n();
const columnList = computed((): DataTableColumn<ComposedPlan>[] => {
@@ -82,8 +92,6 @@ const columnList = computed((): DataTableColumn<ComposedPlan>[] => {
key: "updateTime",
title: t("issue.table.updated"),
width: 150,
- resizable: true,
- hide: !showExtendedColumns.value,
render: (plan) =>
humanizeTs(getTimeForPbTimestamp(plan.updateTime, 0) / 1000),
},
@@ -91,26 +99,6 @@ const columnList = computed((): DataTableColumn<ComposedPlan>[] => {
return columns.filter((column) => !column.hide);
});
-const props = withDefaults(
- defineProps<{
- planList: ComposedPlan[];
- loading?: boolean;
- showProject: boolean;
- }>(),
- {
- loading: true,
- showProject: true,
- }
-);
-
-const router = useRouter();
-
-const tableRef = ref<HTMLDivElement>();
-const { width: tableWidth } = useElementSize(tableRef);
-const showExtendedColumns = computed(() => {
- return tableWidth.value > 800;
-});
-
const rowProps = (plan: ComposedPlan) => {
return {
style: "cursor: pointer;",
diff --git a/frontend/src/components/Plan/components/SpecListSection/SpecCard.vue b/frontend/src/components/Plan/components/SpecListSection/SpecCard.vue
index 71aeb019c5..4ab857d8f8 100644
--- a/frontend/src/components/Plan/components/SpecListSection/SpecCard.vue
+++ b/frontend/src/components/Plan/components/SpecListSection/SpecCard.vue
@@ -6,8 +6,10 @@
>
<NTooltip
v-if="
- planCheckStatus === PlanCheckRun_Result_Status.ERROR ||
- planCheckStatus === PlanCheckRun_Result_Status.WARNING
+ [
+ PlanCheckRun_Result_Status.WARNING,
+ PlanCheckRun_Result_Status.ERROR,
+ ].includes(planCheckStatus)
"
trigger="hover"
placement="top"
@@ -41,6 +43,7 @@
databaseForSpec(plan, spec).databaseName
}}</span>
</div>
+ <!-- Fallback to show the database group name if the spec is a grouping change spec in old plans. -->
<div
v-else-if="isGroupingChangeSpec(spec) && relatedDatabaseGroup"
class="flex items-center gap-2 truncate"
diff --git a/frontend/src/components/Plan/logic/plan.ts b/frontend/src/components/Plan/logic/plan.ts
index 7793eb6e60..0432b10aa6 100644
--- a/frontend/src/components/Plan/logic/plan.ts
+++ b/frontend/src/components/Plan/logic/plan.ts
@@ -1,8 +1,6 @@
-import { head } from "lodash-es";
import {
composeInstanceResourceForDatabase,
useDatabaseV1Store,
- useDBGroupStore,
useEnvironmentV1Store,
} from "@/store";
import {
@@ -80,20 +78,6 @@ export const databaseEngineForSpec = async (
return db.instanceResource.engine;
}
}
- if (extractDatabaseGroupName(target)) {
- const dbGroup = await useDBGroupStore().getOrFetchDBGroupByName(target);
- // Might be flaky: use the first database in the db group
- const dbName = head(dbGroup.matchedDatabases)?.name;
- if (dbName) {
- const db = await useDatabaseV1Store().getOrFetchDatabaseByName(
- dbName,
- true /* silent */
- );
- if (isValidDatabaseName(db.name)) {
- return db.instanceResource.engine;
- }
- }
- }
return Engine.ENGINE_UNSPECIFIED;
};