Skip to content

Commit

Permalink
feat: disable workshop links in breadcrumbs
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohamed-Hacene committed Dec 20, 2024
1 parent 1dff57d commit bd30973
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion frontend/src/lib/components/Breadcrumbs/Breadcrumbs.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@
let crumbs: Array<{ label: string; href: string; icon?: string }> = [];
const disableWorkhopLink = [
'workshop1',
'workshop2',
'workshop3',
'workshop4',
'workshop5',
] // Disable workshops links in breadcrumb
$: {
// Remove zero-length tokens.
const tokens = $page.url.pathname.split('/').filter((t) => t !== '');
Expand All @@ -35,7 +43,8 @@
label: $page.data.label || t,
href:
Object.keys(listViewFields).includes(tokens[0]) &&
!listViewFields[tokens[0]].breadcrumb_link_disabled
!listViewFields[tokens[0]].breadcrumb_link_disabled &&
!disableWorkhopLink.includes(t) // Disable workshops links in breadcrumb
? tokenPath
: null
};
Expand Down

0 comments on commit bd30973

Please sign in to comment.