Skip to content

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

Cleanup Breadcrumb, remove groupSlug logic

天舟6624aed2ddb5
diff --git a/frontend/src/components/Breadcrumb.vue b/frontend/src/components/Breadcrumb.vue
index dce62bcf9e..b5af769238 100644
--- a/frontend/src/components/Breadcrumb.vue
+++ b/frontend/src/components/Breadcrumb.vue
@@ -2,9 +2,29 @@
<nav class="flex" aria-label="Breadcrumb">
<div v-for="(item, index) in breadcrumbList" :key="index">
<div class="flex items-center space-x-2">
+ <router-link
+ v-if="index == 0"
+ to="/"
+ class="text-gray-400 hover:text-gray-500"
+ active-class="link"
+ exact-active-class="link"
+ >
+ <!-- Heroicon name: home -->
+ <svg
+ class="flex-shrink-0 h-5 w-5"
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 20 20"
+ fill="currentColor"
+ aria-hidden="true"
+ >
+ <path
+ d="M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z"
+ />
+ </svg>
+ <span class="sr-only">Home</span>
+ </router-link>
<svg
- v-if="index > 0"
- class="flex-shrink-0 h-5 w-5 text-gray-400"
+ class="ml-2 flex-shrink-0 h-5 w-5 text-gray-400"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20"
fill="currentColor"
@@ -94,8 +114,6 @@ export default {
currentRoute
);
const pipelineId = routeSlug.pipelineId;
- const groupSlug = routeSlug.groupSlug;
- const projectSlug = routeSlug.projectSlug;
const list: Array<BreadcrumbItem> = [];
if (pipelineId) {
list.push({
@@ -105,37 +123,13 @@ export default {
name: pipelineId,
path: "/pipeline/" + pipelineId,
});
- } else if (groupSlug) {
- list.push({
- name: groupSlug,
- path: "/" + groupSlug,
- });
- if (
- projectSlug &&
- currentRoute.name?.toString().startsWith("workspace.project")
- ) {
- list.push({
- name: projectSlug,
- path: "/" + groupSlug + "/" + projectSlug,
- });
- if (pipelineId) {
- list.push({
- name: "Pipeline",
- path: "/" + groupSlug + "/" + projectSlug + "/pipeline",
- });
- list.push({
- name: pipelineId,
- path:
- "/" + groupSlug + "/" + projectSlug + "/pipeline/" + pipelineId,
- });
- }
- }
- if (currentRoute.meta.displayName) {
- list.push({
- name: currentRoute.meta.displayName,
- path: currentRoute.path,
- });
- }
+ } else {
+ // if (currentRoute.meta.displayName) {
+ // list.push({
+ // name: currentRoute.meta.displayName,
+ // path: currentRoute.path,
+ // });
+ // }
}
return list;
});
diff --git a/frontend/src/store/modules/router.ts b/frontend/src/store/modules/router.ts
index 92df97edd9..9295efef87 100644
--- a/frontend/src/store/modules/router.ts
+++ b/frontend/src/store/modules/router.ts
@@ -20,60 +20,7 @@ const getters = {
pipelineId: pipelineComponents[1],
};
}
-
- // /<<group-slug>>/<<project-slug>>/pipeline/<<pipelineId>>
- // Total 7 elements, 1st element is always the fullpath
- //
- // case 1: "" or /
- // [
- // "/",
- // ]
- // case 2: <<group-slug>> or /<<group-slug>>/project
- // [
- // "<<fullpath>>",
- // "<<group-slug>>"
- // ]
- // case 3: /<<group-slug>>/<<project-slug>>
- // [
- // "<<fullpath>>",
- // "<<group-slug>>",
- // "/project/<<project-slug>>",
- // "<<project-slug>>",
- // "<<project-slug>>"
- // ]
- // case 4: /<<group-slug>>/<<project-slug>>/pipeline
- // [
- // "<<fullpath>>",
- // "<<group-slug>>",
- // "/project/<<project-slug>>",
- // "<<project-slug>>",
- // "<<project-slug>>"
- // ]
- // case 5: /<<group-slug>>/<<project-slug>>/pipeline/<<pipelineId>>
- // [
- // "<<fullpath>>",
- // "<<group-slug>>",
- // "/project/<<project-slug>>/pipeline/<<pipelineId>>",
- // "<<project-slug>>/pipeline/<<pipelineId",
- // "<<project-slug>>",
- // "/pipeline/<<pipelineId>>",
- // "<<pipelineId>>",
- // ]
- const pathComponents = currentRoute.path.match(
- "/([0-9a-zA-Z_]+)(/(([0-9a-zA-Z_]+)(/pipeline/([0-9a-zA-Z_]+)?)?)?)?"
- ) || [
- "/",
- undefined,
- undefined,
- undefined,
- undefined,
- undefined,
- undefined,
- ];
- return {
- groupSlug: pathComponents[1],
- projectSlug: pathComponents[4],
- };
+ return {};
},
};
diff --git a/frontend/src/types/bytebase.ts b/frontend/src/types/bytebase.ts
index a798d070bf..74ea1666cf 100644
--- a/frontend/src/types/bytebase.ts
+++ b/frontend/src/types/bytebase.ts
@@ -136,6 +136,4 @@ export interface RepositoryState {
// UI
export interface RouterSlug {
pipelineId?: PipelineId;
- groupSlug?: string;
- projectSlug?: string;
}