|
| 1 | +import { customEnv, Never } from 'src' |
| 2 | + |
| 3 | +import { IconsProps } from '@Shared/Components' |
| 4 | + |
| 5 | +export type NavigationItemID = |
| 6 | + | 'application-management-overview' |
| 7 | + | 'application-management-devtron-applications' |
| 8 | + | 'application-management-application-groups' |
| 9 | + | 'application-management-bulk-edit' |
| 10 | + | 'application-management-application-templates' |
| 11 | + | 'application-management-projects' |
| 12 | + | 'application-management-configurations' |
| 13 | + | 'application-management-policies' |
| 14 | + | 'infrastructure-management-overview' |
| 15 | + | 'infrastructure-management-applications' |
| 16 | + | 'infrastructure-management-chart-store' |
| 17 | + | 'infrastructure-management-resource-browser' |
| 18 | + | 'infrastructure-management-resource-watcher' |
| 19 | + | 'infrastructure-management-catalog-framework' |
| 20 | + | 'software-release-management-overview' |
| 21 | + | 'software-release-management-release-hub' |
| 22 | + | 'software-release-management-tenants' |
| 23 | + | 'cost-visibility-overview' |
| 24 | + | 'cost-visibility-cost-breakdown' |
| 25 | + | 'cost-visibility-configurations' |
| 26 | + | 'security-center-overview' |
| 27 | + | 'security-center-security-vulnerabilities' |
| 28 | + | 'security-center-security-enablement' |
| 29 | + | 'security-center-security-policy' |
| 30 | + | 'automation-and-enablement-jobs' |
| 31 | + | 'automation-and-enablement-alerting' |
| 32 | + | 'automation-and-enablement-incident-response' |
| 33 | + | 'automation-and-enablement-api-portal' |
| 34 | + | 'automation-and-enablement-runbook-automation' |
| 35 | + | 'global-configuration-sso-login-services' |
| 36 | + | 'global-configuration-host-urls' |
| 37 | + | 'global-configuration-external-links' |
| 38 | + | 'global-configuration-chart-repository' |
| 39 | + | 'global-configuration-cluster-and-environments' |
| 40 | + | 'global-configuration-container-oci-registry' |
| 41 | + | 'global-configuration-authorization' |
| 42 | + | 'data-protection-overview' |
| 43 | + | 'data-protection-backup-and-schedule' |
| 44 | + | 'data-protection-restores' |
| 45 | + | 'data-protection-backup-repositories' |
| 46 | + | 'data-protection-backup-locations' |
| 47 | + | 'data-protection-history-and-logs' |
| 48 | + |
| 49 | +export type NavigationSubMenuItemID = |
| 50 | + | 'application-management-configurations-gitops' |
| 51 | + | 'application-management-configurations-git-accounts' |
| 52 | + | 'application-management-configurations-deployment-charts' |
| 53 | + | 'application-management-configurations-notifications' |
| 54 | + | 'application-management-configurations-catalog-frameworks' |
| 55 | + | 'application-management-configurations-scoped-variables' |
| 56 | + | 'application-management-configurations-build-infra' |
| 57 | + | 'application-management-policies-deployment-window' |
| 58 | + | 'application-management-policies-approval-policy' |
| 59 | + | 'application-management-policies-plugin-policy' |
| 60 | + | 'application-management-policies-pull-image-digest' |
| 61 | + | 'application-management-policies-tag-policy' |
| 62 | + | 'application-management-policies-filter-conditions' |
| 63 | + | 'application-management-policies-image-promotion' |
| 64 | + | 'application-management-policies-lock-deployment-configuration' |
| 65 | + | 'cost-visibility-cost-breakdown-clusters' |
| 66 | + | 'cost-visibility-cost-breakdown-environments' |
| 67 | + | 'cost-visibility-cost-breakdown-projects' |
| 68 | + | 'cost-visibility-cost-breakdown-applications' |
| 69 | + | 'global-configuration-authorization-user-permissions' |
| 70 | + | 'global-configuration-authorization-permission-groups' |
| 71 | + | 'global-configuration-authorization-api-tokens' |
| 72 | + |
| 73 | +export type NavigationRootItemID = |
| 74 | + | 'application-management' |
| 75 | + | 'infrastructure-management' |
| 76 | + | 'software-release-management' |
| 77 | + | 'cost-visibility' |
| 78 | + | 'security-center' |
| 79 | + | 'automation-and-enablement' |
| 80 | + | 'data-protection-management' |
| 81 | + | 'global-configuration' |
| 82 | + |
| 83 | +export type CommonNavigationItemType = { |
| 84 | + title: string |
| 85 | + dataTestId: string |
| 86 | + icon: IconsProps['name'] |
| 87 | + href: string |
| 88 | + disabled?: boolean |
| 89 | + keywords?: string[] |
| 90 | + forceHideEnvKey?: keyof customEnv |
| 91 | + hideNav?: boolean |
| 92 | + isAvailableInEA?: boolean |
| 93 | +} |
| 94 | + |
| 95 | +export type NavigationItemType = Pick< |
| 96 | + CommonNavigationItemType, |
| 97 | + 'dataTestId' | 'title' | 'disabled' | 'keywords' | 'hideNav' | 'forceHideEnvKey' | 'isAvailableInEA' |
| 98 | +> & { |
| 99 | + id: NavigationItemID |
| 100 | +} & ( |
| 101 | + | (Pick<CommonNavigationItemType, 'icon' | 'href'> & { |
| 102 | + hasSubMenu?: false |
| 103 | + subItems?: never |
| 104 | + }) |
| 105 | + | (Never<Pick<CommonNavigationItemType, 'icon' | 'href'>> & { |
| 106 | + hasSubMenu: true |
| 107 | + subItems: (Omit<CommonNavigationItemType, 'icon' | 'isAvailableInEA'> & { id: NavigationSubMenuItemID })[] |
| 108 | + }) |
| 109 | + ) |
| 110 | + |
| 111 | +export interface NavigationGroupType |
| 112 | + extends Pick<CommonNavigationItemType, 'title' | 'icon' | 'hideNav' | 'forceHideEnvKey' | 'isAvailableInEA'> { |
| 113 | + id: NavigationRootItemID |
| 114 | + items: NavigationItemType[] |
| 115 | + disabled?: boolean |
| 116 | +} |
0 commit comments