Skip to content

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

chore: deprecate branch dashboard (#9023)

ecmadao95a20cfed348
diff --git a/frontend/src/components/Branch/BranchDetailView.vue b/frontend/src/components/Branch/BranchDetailView.vue
index 4846681ccd..df7faea804 100644
--- a/frontend/src/components/Branch/BranchDetailView.vue
+++ b/frontend/src/components/Branch/BranchDetailView.vue
@@ -600,7 +600,11 @@ const generateIssueName = (databaseNameList: string[]) => {
const deleteSchemaDesign = async () => {
await schemaDesignStore.deleteSchemaDesign(schemaDesign.value.name);
router.replace({
- name: "workspace.branch.dashboard",
+ name: "workspace.project.detail",
+ hash: "#branches",
+ params: {
+ projectSlug: projectV1Slug(project.value),
+ },
});
};
</script>
diff --git a/frontend/src/components/Breadcrumb.vue b/frontend/src/components/Breadcrumb.vue
index 59067697da..2ccad96c7b 100644
--- a/frontend/src/components/Breadcrumb.vue
+++ b/frontend/src/components/Breadcrumb.vue
@@ -79,7 +79,7 @@ import {
useProjectV1Store,
useDatabaseV1Store,
} from "@/store";
-import { RouteMapList, UNKNOWN_ID } from "@/types";
+import { RouteMapList } from "@/types";
import { Bookmark } from "@/types/proto/v1/bookmark_service";
import { TenantMode } from "@/types/proto/v1/project_service";
import { databaseV1Slug, idFromSlug, projectV1Slug } from "../utils";
@@ -218,18 +218,12 @@ export default defineComponent({
} else if (route.name === "workspace.branch.detail") {
list.push(
{
- name: project.uid === String(UNKNOWN_ID) ? "-" : project.title,
- path:
- project.uid === String(UNKNOWN_ID)
- ? undefined
- : `/project/${projectV1Slug(project)}`,
+ name: project.title,
+ path: `/project/${projectV1Slug(project)}`,
},
{
name: t("common.branches"),
- path:
- project.uid === String(UNKNOWN_ID)
- ? "/branches"
- : `/project/${projectV1Slug(project)}#branches`,
+ path: `/project/${projectV1Slug(project)}#branches`,
}
);
}
diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts
index f34863ea7e..177ed019f1 100644
--- a/frontend/src/router/index.ts
+++ b/frontend/src/router/index.ts
@@ -269,18 +269,6 @@ const routes: Array<RouteRecordRaw> = [
leftSidebar: true,
},
},
- {
- path: "branches",
- name: "workspace.branch.dashboard",
- meta: {
- title: () => t("common.branches"),
- },
- components: {
- content: () => import("../views/branch/BranchDashboard.vue"),
- leftSidebar: DashboardSidebar,
- },
- props: { content: true, leftSidebar: true },
- },
{
path: "/project/:projectSlug/branches/:branchName",
name: "workspace.branch.detail",
@@ -1228,7 +1216,6 @@ router.beforeEach((to, from, next) => {
to.name === "workspace.database" ||
to.name === "workspace.archive" ||
to.name === "workspace.issue" ||
- to.name === "workspace.branch.dashboard" ||
to.name === "workspace.environment" ||
to.name === "sql-editor.home" ||
to.name?.toString().startsWith("sheets") ||
diff --git a/frontend/src/types/common.ts b/frontend/src/types/common.ts
index 855a1e945f..ceed32ede6 100644
--- a/frontend/src/types/common.ts
+++ b/frontend/src/types/common.ts
@@ -61,7 +61,6 @@ export type RouterSlug = {
ssoName?: string;
// Resource names.
- projectName?: string;
databaseGroupName?: string;
schemaGroupName?: string;
changelistName?: string;
diff --git a/frontend/src/views/DashboardSidebar.vue b/frontend/src/views/DashboardSidebar.vue
index 6fdff87e87..1acf9ef812 100644
--- a/frontend/src/views/DashboardSidebar.vue
+++ b/frontend/src/views/DashboardSidebar.vue
@@ -39,13 +39,6 @@
<heroicons-outline:refresh class="w-5 h-5 mr-2" />
{{ $t("database.sync-schema.title") }}
</router-link>
- <router-link
- to="/branches"
- class="outline-item group flex items-center px-2 py-1.5 capitalize"
- >
- <GitBranch class="w-5 h-5 mr-2" />
- {{ $t("common.branches") }}
- </router-link>
<router-link
to="/slow-query"
class="outline-item group flex items-center px-2 py-1.5 capitalize"
@@ -91,7 +84,7 @@
<script lang="ts" setup>
import { useKBarHandler } from "@bytebase/vue-kbar";
-import { GitBranch, PencilRuler } from "lucide-vue-next";
+import { PencilRuler } from "lucide-vue-next";
import { computed } from "vue";
import BookmarkListSidePanel from "@/components/BookmarkListSidePanel.vue";
import BytebaseLogo from "@/components/BytebaseLogo.vue";
diff --git a/frontend/src/views/branch/BranchDashboard.vue b/frontend/src/views/branch/BranchDashboard.vue
deleted file mode 100644
index 15410c6685..0000000000
--- a/frontend/src/views/branch/BranchDashboard.vue
+++ /dev/null
@@ -1,102 +0,0 @@
-<template>
- <div class="space-y-3 pt-2 w-full overflow-x-auto">
- <div class="w-full px-4 flex flex-row justify-between items-center">
- <div>
- <ProjectSelect
- v-model:project="state.projectFilter"
- :include-all="true"
- />
- </div>
- <div class="flex flex-row justify-end items-center gap-x-2">
- <NInput
- v-model:value="state.searchKeyword"
- class="!w-36"
- clearable
- :placeholder="$t('common.filter-by-name')"
- />
- <NButton type="primary" @click="handleCreateBranch">
- <heroicons-solid:plus class="w-4 h-auto mr-0.5" />
- <span>{{ $t("database.new-branch") }}</span>
- </NButton>
- </div>
- </div>
-
- <BranchDataTable
- :branches="filteredBranches"
- :ready="ready"
- @click="handleBranchClick"
- />
- </div>
-</template>
-
-<script lang="ts" setup>
-import { orderBy } from "lodash-es";
-import { NButton, NInput } from "naive-ui";
-import { computed, reactive } from "vue";
-import { useRouter } from "vue-router";
-import BranchDataTable from "@/components/Branch/BranchDataTable.vue";
-import { ProjectSelect } from "@/components/v2";
-import { useProjectV1Store, useDatabaseV1Store } from "@/store";
-import { useSchemaDesignList } from "@/store/modules/schemaDesign";
-import { getProjectAndSchemaDesignSheetId } from "@/store/modules/v1/common";
-import { UNKNOWN_ID } from "@/types";
-import { SchemaDesign } from "@/types/proto/v1/schema_design_service";
-import { projectV1Slug } from "@/utils";
-
-interface LocalState {
- searchKeyword: string;
- projectFilter: string;
-}
-
-const router = useRouter();
-const { schemaDesignList, ready } = useSchemaDesignList();
-const projectStore = useProjectV1Store();
-const databaseStore = useDatabaseV1Store();
-const state = reactive<LocalState>({
- searchKeyword: "",
- projectFilter: String(UNKNOWN_ID),
-});
-
-const filteredBranches = computed(() => {
- return orderBy(schemaDesignList.value, "updateTime", "desc")
- .filter((branch) => {
- const [projectName] = getProjectAndSchemaDesignSheetId(branch.name);
- const project = projectStore.getProjectByName(`projects/${projectName}`);
- return (
- !state.projectFilter ||
- state.projectFilter === String(UNKNOWN_ID) ||
- project.uid === state.projectFilter
- );
- })
- .filter((branch) => {
- return state.searchKeyword
- ? branch.title.includes(state.searchKeyword)
- : true;
- });
-});
-
-const handleCreateBranch = () => {
- router.push({
- name: "workspace.branch.detail",
- params: {
- projectSlug: "-",
- branchName: "new",
- },
- });
-};
-
-const handleBranchClick = async (schemaDesign: SchemaDesign) => {
- const [_, sheetId] = getProjectAndSchemaDesignSheetId(schemaDesign.name);
- const baselineDatabase = databaseStore.getDatabaseByName(
- schemaDesign.baselineDatabase
- );
- console.log("handleBranchClick");
- router.push({
- name: "workspace.branch.detail",
- params: {
- projectSlug: projectV1Slug(baselineDatabase.projectEntity),
- branchName: sheetId,
- },
- });
-};
-</script>
diff --git a/frontend/src/views/branch/BranchDetail.vue b/frontend/src/views/branch/BranchDetail.vue
index 9ad1ce1dab..3f579a7582 100644
--- a/frontend/src/views/branch/BranchDetail.vue
+++ b/frontend/src/views/branch/BranchDetail.vue
@@ -16,9 +16,8 @@ import { useI18n } from "vue-i18n";
import { useRoute } from "vue-router";
import BranchCreateView from "@/components/Branch/BranchCreateView.vue";
import BranchDetailView from "@/components/Branch/BranchDetailView.vue";
-import { useProjectV1Store, useSheetV1Store } from "@/store";
+import { useProjectV1Store } from "@/store";
import { useSchemaDesignStore } from "@/store/modules/schemaDesign";
-import { getProjectAndSheetId } from "@/store/modules/v1/common";
import { idFromSlug } from "@/utils";
const props = defineProps({
@@ -34,7 +33,6 @@ const props = defineProps({
const { t } = useI18n();
const route = useRoute();
-const sheetStore = useSheetV1Store();
const projectStore = useProjectV1Store();
const schemaDesignStore = useSchemaDesignStore();
const branchFullName = ref<string>("");
@@ -60,15 +58,10 @@ watch(
// Prepare branch name from route params.
const sheetId = (props.branchName as string) || "";
- if (!sheetId) {
+ if (!sheetId || !project.value) {
return;
}
- const sheet = await sheetStore.getOrFetchSheetByUID(`${sheetId}`);
- if (sheet) {
- const [projectName] = getProjectAndSheetId(sheet.name);
- await projectStore.getOrFetchProjectByName(`projects/${projectName}`);
- branchFullName.value = `projects/${projectName}/schemaDesigns/${sheetId}`;
- }
+ branchFullName.value = `${project.value.name}/schemaDesigns/${sheetId}`;
},
{
immediate: true,