@@ -3,7 +3,11 @@ import { SERVER_MODE, URLS as COMMON_URLS } from '@devtron-labs/devtron-fe-commo
33import { NAVIGATION_LIST } from '@Components/Navigation/constants'
44import { URLS } from '@Config/routes'
55
6- import { DEVTRON_APPLICATIONS_COMMAND_GROUP_ID , RECENT_NAVIGATION_ITEM_ID_PREFIX } from './constants'
6+ import {
7+ DEVTRON_APPLICATIONS_COMMAND_GROUP_ID ,
8+ NAV_SUB_ITEMS_ICON_MAPPING ,
9+ RECENT_NAVIGATION_ITEM_ID_PREFIX ,
10+ } from './constants'
711import { CommandBarActionIdType , CommandBarBackdropProps , CommandBarGroupType , CommandBarItemType } from './types'
812
913export const sanitizeItemId = ( item : CommandBarItemType ) =>
@@ -30,6 +34,7 @@ const getAppManagementAdditionalNavItems = (
3034 icon : 'ic-devtron-app' ,
3135 iconColor : 'none' ,
3236 href : URLS . DEVTRON_APP_LIST ,
37+ keywords : [ ] ,
3338 } satisfies CommandBarGroupType [ 'items' ] [ number ] ,
3439 ]
3540 : [ ] ) ,
@@ -39,6 +44,7 @@ const getAppManagementAdditionalNavItems = (
3944 icon : 'ic-helm-app' ,
4045 iconColor : 'none' ,
4146 href : URLS . HELM_APP_LIST ,
47+ keywords : [ ] ,
4248 } ,
4349 ...( window . _env_ ?. ENABLE_EXTERNAL_ARGO_CD && isSuperAdmin
4450 ? [
@@ -48,6 +54,7 @@ const getAppManagementAdditionalNavItems = (
4854 icon : 'ic-argocd-app' ,
4955 iconColor : 'none' ,
5056 href : URLS . ARGO_APP_LIST ,
57+ keywords : [ ] ,
5158 } satisfies CommandBarGroupType [ 'items' ] [ number ] ,
5259 ]
5360 : [ ] ) ,
@@ -59,6 +66,7 @@ const getAppManagementAdditionalNavItems = (
5966 icon : 'ic-fluxcd-app' ,
6067 iconColor : 'none' ,
6168 href : URLS . FLUX_APP_LIST ,
69+ keywords : [ ] ,
6270 } satisfies CommandBarGroupType [ 'items' ] [ number ] ,
6371 ]
6472 : [ ] ) ,
@@ -70,15 +78,16 @@ export const getNavigationGroups = (serverMode: SERVER_MODE, isSuperAdmin: boole
7078 const additionalItems = isAppManagementBlock ? getAppManagementAdditionalNavItems ( serverMode , isSuperAdmin ) : [ ]
7179
7280 const parsedItems = group . items . flatMap < CommandBarGroupType [ 'items' ] [ number ] > (
73- ( { hasSubMenu, subItems, title, href, id, icon } ) => {
81+ ( { hasSubMenu, subItems, title, href, id, icon, keywords } ) => {
7482 if ( hasSubMenu && subItems ?. length ) {
7583 return subItems . map < CommandBarGroupType [ 'items' ] [ number ] > ( ( subItem ) => ( {
7684 title : `${ title } / ${ subItem . title } ` ,
7785 id : subItem . id ,
7886 // Since icon is not present for some subItems, using from group
79- icon : group . icon ,
87+ icon : NAV_SUB_ITEMS_ICON_MAPPING [ id ] || group . icon ,
8088 // TODO: No href present for some subItems
8189 href : subItem . href ?? null ,
90+ keywords : subItem . keywords || [ ] ,
8291 } ) )
8392 }
8493
@@ -88,6 +97,7 @@ export const getNavigationGroups = (serverMode: SERVER_MODE, isSuperAdmin: boole
8897 icon : icon || 'ic-arrow-right' ,
8998 // TODO: No href present for some items
9099 href : href ?? null ,
100+ keywords : keywords || [ ] ,
91101 }
92102 } ,
93103 )
@@ -114,6 +124,7 @@ export const parseAppListToNavItems = (appList: CommandBarBackdropProps['appList
114124 icon : 'ic-devtron-app' ,
115125 iconColor : 'none' ,
116126 href : `${ COMMON_URLS . APPLICATION_MANAGEMENT_APP } /${ app . id } /${ URLS . APP_OVERVIEW } ` ,
127+ keywords : [ ] ,
117128 } ) ) ,
118129 } ,
119130 ]
0 commit comments