-
Notifications
You must be signed in to change notification settings - Fork 252
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
extra links palette and kbr shortcuts (#1254)
- Loading branch information
Showing
4 changed files
with
56 additions
and
65 deletions.
There are no files selected for viewing
88 changes: 27 additions & 61 deletions
88
frontend/src/lib/components/CommandPalette/paletteData.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,35 @@ | ||
import * as m from '$paraglide/messages'; | ||
import { navData } from '../SideBar/navData'; | ||
|
||
export interface NavigationLink { | ||
label: string; | ||
href: string; | ||
} | ||
const flattenNavData = (navData) => { | ||
const result = []; | ||
|
||
export const navigationLinks: NavigationLink[] = [ | ||
{ | ||
label: 'analytics', | ||
href: '/' | ||
}, | ||
{ | ||
label: 'myAssignments', | ||
href: '/my-assignments' | ||
}, | ||
{ | ||
label: 'domains', | ||
href: '/folders' | ||
}, | ||
{ | ||
label: 'assets', | ||
href: '/assets' | ||
}, | ||
{ | ||
label: 'complianceAssessments', | ||
href: '/compliance-assessments' | ||
}, | ||
{ | ||
label: 'riskAssessments', | ||
href: '/risk-assessments' | ||
}, | ||
{ | ||
label: 'riskScenarios', | ||
href: '/risk-scenarios' | ||
}, | ||
{ | ||
label: 'ebiosRM', | ||
href: '/ebios-rm' | ||
}, | ||
{ | ||
label: 'actionPlan', | ||
href: '/applied-controls' | ||
}, | ||
{ | ||
label: 'evidences', | ||
href: '/evidences' | ||
}, | ||
{ | ||
label: 'xRays', | ||
href: '/x-rays' | ||
}, | ||
{ | ||
label: 'tpSolutions', | ||
href: '/solutions' | ||
}, | ||
{ | ||
label: 'libraries', | ||
href: '/libraries' | ||
}, | ||
{ | ||
label: 'myProfile', | ||
href: '/my-profile' | ||
}, | ||
{ | ||
label: 'settings', | ||
href: '/settings' | ||
// Handle potentially incomplete/malformed data | ||
if (!navData?.items) return result; | ||
|
||
for (const section of navData.items) { | ||
if (!section.items) continue; | ||
|
||
for (const item of section.items) { | ||
if (item.name && item.href) { | ||
result.push({ | ||
label: item.name, | ||
href: item.href | ||
}); | ||
} | ||
} | ||
} | ||
]; | ||
|
||
return result; | ||
}; | ||
export let navigationLinks: NavigationLink[] = flattenNavData(navData); | ||
navigationLinks.push({ | ||
label: 'myProfile', | ||
href: '/my-profile' | ||
}); | ||
|
||
// wre can use the same trick later on for dynamic actions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters