Skip to content

Commit

Permalink
chore(ui): improve breadcrumbs on namespace view (#7386)
Browse files Browse the repository at this point in the history
  • Loading branch information
MilosPaunovic authored Feb 13, 2025
1 parent b3e66d8 commit f57a463
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ui/src/components/layout/TopNavBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</router-link>
</el-breadcrumb-item>
</el-breadcrumb>
<h1 class="h5 fw-semibold m-0 d-inline-fle">
<h1 class="h5 fw-semibold m-0 d-inline-flex">
<slot name="title">
{{ title }}
</slot>
Expand Down
12 changes: 10 additions & 2 deletions ui/src/components/namespace/Namespace.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,23 @@
return this.user && this.user.hasAnyActionOnAnyNamespace(permission.FLOW, action.CREATE);
},
routeInfo() {
const parts = this.$route.params.id?.split(".") || [];
return {
title: this.$route.params.id || this.$t("namespaces"),
title: parts?.[parts.length - 1] || this.$t("namespaces"),
breadcrumb: [
{
label: this.$t("namespaces"),
link: {
name: "namespaces"
}
}
},
...parts.map((part, index) => ({
label: part,
link: {
name: "namespaces/update",
params: {id: parts.slice(0, index + 1).join(".")},
},
})),
]
};
},
Expand Down

0 comments on commit f57a463

Please sign in to comment.