Skip to content

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

chore: use branch data table in project branch panel (#8882)

boojack0984b91e2c70
diff --git a/frontend/src/components/Branch/BranchDataTable.vue b/frontend/src/components/Branch/BranchDataTable.vue
index bc12640c24..ec63ebae7f 100644
--- a/frontend/src/components/Branch/BranchDataTable.vue
+++ b/frontend/src/components/Branch/BranchDataTable.vue
@@ -1,5 +1,6 @@
<template>
<NDataTable
+ v-bind="$attrs"
:loading="isLoading"
:bordered="false"
:columns="dataTableColumns"
@@ -138,30 +139,35 @@ const dataTableRows = computed(() => {
});
const dataTableColumns = computed(() => {
- return [
- {
- title: t("common.branch"),
- key: "branchName",
- },
- {
- title: t("common.project"),
- key: "projectName",
- },
- {
- title: t("schema-designer.baseline-version"),
- key: "baselineVersion",
- render: (row: BranchRowData) => {
- return h(BranchBaseline, {
- branch: row.branch,
- showInstanceIcon: true,
- });
- },
- },
- {
- title: t("common.updated"),
- key: "updatedTimeStr",
+ const BRANCH_NAME_COLUMN = {
+ title: t("common.branch"),
+ key: "branchName",
+ };
+ const PROJECT_NAME_COLUMN = {
+ title: t("common.project"),
+ key: "projectName",
+ };
+ const BASELINE_VERSION_COLUMN = {
+ title: t("schema-designer.baseline-version"),
+ key: "baselineVersion",
+ render: (row: BranchRowData) => {
+ return h(BranchBaseline, {
+ branch: row.branch,
+ showInstanceIcon: true,
+ });
},
- ];
+ };
+ const UPDATED_TIME_COLUMN = {
+ title: t("common.updated"),
+ key: "updatedTimeStr",
+ };
+
+ return [
+ BRANCH_NAME_COLUMN,
+ !props.hideProjectColumn ? PROJECT_NAME_COLUMN : undefined,
+ BASELINE_VERSION_COLUMN,
+ UPDATED_TIME_COLUMN,
+ ].filter((column) => column);
});
const rowKey = (row: BranchRowData) => {
diff --git a/frontend/src/components/ProjectBranchesPanel.vue b/frontend/src/components/ProjectBranchesPanel.vue
index 0fb5ac61a5..0e3d31ddb7 100644
--- a/frontend/src/components/ProjectBranchesPanel.vue
+++ b/frontend/src/components/ProjectBranchesPanel.vue
@@ -16,7 +16,8 @@
</div>
</div>
- <BranchTable
+ <BranchDataTable
+ class="border"
:branches="filteredBranches"
:hide-project-column="true"
:ready="ready"
@@ -30,7 +31,7 @@ import { orderBy } from "lodash-es";
import { NButton, NInput } from "naive-ui";
import { computed, reactive } from "vue";
import { useRouter } from "vue-router";
-import BranchTable from "@/components/Branch/BranchTable.vue";
+import BranchDataTable from "@/components/Branch/BranchDataTable.vue";
import { useProjectV1Store } from "@/store";
import { useSchemaDesignList } from "@/store/modules/schemaDesign";
import {