diff --git a/ui/src/App.vue b/ui/src/App.vue index 1f6e7d094..51aeda7ff 100644 --- a/ui/src/App.vue +++ b/ui/src/App.vue @@ -37,12 +37,16 @@ const route = useRoute(); const router = useRouter(); const workflowsPage = computed(() => route.name === "workflow"); const hidden = computed(() => hiddenPaths(session.sections)); -const sectionLink = computed(() => ({ - workflow: "/workflows", - run: "/runs", - "controls-guard": "/controls/guards", - "controls-action-type": "/controls/action-types", -})[String(route.name)]); +const sectionLink = computed(() => + route.meta.nav === false && typeof route.meta.navPath === "string" + ? route.meta.navPath + : undefined, +); +const detailCrumb = computed(() => { + if (route.meta.nav !== false || !("id" in route.params) || !route.params.id) return ""; + const id = String(route.params.id); + return route.name === "run" ? id.slice(0, 8) : id; +}); // The redirect below must not run during the router's first navigation: route // is still the start location then, so a deep link would be replaced by the // landing page before it resolves. @@ -127,17 +131,9 @@ watch(() => accounts.status?.user, (user) => { -