Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
fix: breadcrumb from route title (#4590)
Liu Ji2b52c3b5e91b
diff --git a/frontend/src/components/Breadcrumb.vue b/frontend/src/components/Breadcrumb.vueindex d85a57d3c8..d2a7553fbc 100644--- a/frontend/src/components/Breadcrumb.vue+++ b/frontend/src/components/Breadcrumb.vue@@ -97,7 +97,7 @@ export default defineComponent({const currentUser = useCurrentUser();const projectStore = useProjectStore();- const title = useTitle(null, { observe: true });+ const documentTitle = useTitle(null, { observe: true });const routeHelpNameMapList = ref<RouteMapList>([]);const helpName = computed(@@ -194,14 +194,26 @@ export default defineComponent({path: "/setting/sql-review",});}- const { overrideBreadcrumb } = currentRoute.value.meta;- if (title.value) {- const route = currentRoute.value;+ const route = currentRoute.value;+ const {+ title: routeTitle,+ overrideTitle,+ overrideBreadcrumb,+ } = route.meta;++ // Dynamic title priorities+ // 1. documentTitle - if (overrideTitle === true)+ // 2. routeTitle - if (routeTitle !== undefined)+ // 3. nothing - otherwise+ const title = overrideTitle+ ? documentTitle.value ?? ""+ : routeTitle?.(route) ?? "";+ if (title) {if (overrideBreadcrumb && overrideBreadcrumb(route)) {list.length = 0; // empty the array}list.push({- name: title.value,+ name: title,// Set empty path for the current route to make the link not clickable.// We do this because clicking the current route path won't trigger reload and would// confuse user since UI won't change while we may have cleared all query parameters.diff --git a/frontend/src/shims-vue-router.d.ts b/frontend/src/shims-vue-router.d.tsindex 47e02493d3..7e6198857c 100644--- a/frontend/src/shims-vue-router.d.ts+++ b/frontend/src/shims-vue-router.d.ts@@ -4,10 +4,12 @@ export {};declare module "vue-router" {interface RouteMeta {+ allowBookmark?: boolean;title?: (route: RouteLocationNormalized) => string;quickActionListByRole?: (route: RouteLocationNormalized) => Map<RoleType, QuickActionType[]>;overrideBreadcrumb?: (route: RouteLocationNormalized) => boolean;+ overrideTitle?: boolean;}}