advisors-nav.ts 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // @ts-nocheck
  2. import { SHORTCUT_REFERENCE_GROUPS } from '../referenceGroups'
  3. import { RegistryDefinations } from '../types'
  4. /**
  5. * Contextual chords for jumping between Advisors sub-pages — `V + <letter>`.
  6. *
  7. * Active only while AdvisorsLayout is mounted (i.e. the user is somewhere
  8. * under `/project/<ref>/advisors/*`). Mirrors the database-nav / auth-nav
  9. * pattern: the leading `V` (adVisor) is layout-scoped so it doesn't burn a
  10. * global key. `A` is already in use by Auth.
  11. */
  12. export const ADVISORS_NAV_SHORTCUT_IDS = {
  13. NAV_ADVISORS_SECURITY: 'nav.advisors-security',
  14. NAV_ADVISORS_PERFORMANCE: 'nav.advisors-performance',
  15. NAV_ADVISORS_RULES: 'nav.advisors-rules',
  16. }
  17. export type AdvisorsNavShortcutId =
  18. (typeof ADVISORS_NAV_SHORTCUT_IDS)[keyof typeof ADVISORS_NAV_SHORTCUT_IDS]
  19. export const advisorsNavRegistry: RegistryDefinations<AdvisorsNavShortcutId> = {
  20. [ADVISORS_NAV_SHORTCUT_IDS.NAV_ADVISORS_SECURITY]: {
  21. id: ADVISORS_NAV_SHORTCUT_IDS.NAV_ADVISORS_SECURITY,
  22. label: 'Go to Security Advisor',
  23. sequence: ['V', 'S'],
  24. showInSettings: false,
  25. referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_ADVISORS,
  26. },
  27. [ADVISORS_NAV_SHORTCUT_IDS.NAV_ADVISORS_PERFORMANCE]: {
  28. id: ADVISORS_NAV_SHORTCUT_IDS.NAV_ADVISORS_PERFORMANCE,
  29. label: 'Go to Performance Advisor',
  30. sequence: ['V', 'P'],
  31. showInSettings: false,
  32. referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_ADVISORS,
  33. },
  34. [ADVISORS_NAV_SHORTCUT_IDS.NAV_ADVISORS_RULES]: {
  35. id: ADVISORS_NAV_SHORTCUT_IDS.NAV_ADVISORS_RULES,
  36. label: 'Go to Advisor Settings',
  37. sequence: ['V', 'R'],
  38. showInSettings: false,
  39. referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_ADVISORS,
  40. },
  41. }