@@ -149,6 +149,8 @@ const NavigationRoutes = ({ reloadVersionConfig }: Readonly<NavigationRoutesType
149
149
const showCloseButtonAfterGettingStartedClicked = ( ) => {
150
150
setHelpGettingStartedClicked ( true )
151
151
}
152
+ // We use this to determine if we can show resource recommender, since we do not allow users to feed prometheus url if grafana module is not installed
153
+ const [ isGrafanaModuleInstalled , setIsGrafanaModuleInstalled ] = useState ( false )
152
154
const [ environmentId , setEnvironmentId ] = useState ( null )
153
155
const contextValue = useMemo ( ( ) => ( { environmentId, setEnvironmentId } ) , [ environmentId ] )
154
156
@@ -387,17 +389,21 @@ const NavigationRoutes = ({ reloadVersionConfig }: Readonly<NavigationRoutesType
387
389
}
388
390
}
389
391
392
+ const getGrafanaModuleStatus = ( ) => getModuleInfo ( ModuleNameMap . GRAFANA )
393
+
390
394
const handleFetchInitialData = async ( ) => {
391
395
try {
392
- const [ serverModeResponse , environmentDataResponse ] = await Promise . all ( [
396
+ const [ serverModeResponse , environmentDataResponse , grafanaModuleStatus ] = await Promise . all ( [
393
397
getServerMode ( ) ,
394
398
getEnvironmentDataValues ( ) ,
399
+ getGrafanaModuleStatus ( ) ,
395
400
getCurrentServerInfo ( ) ,
396
401
handleFetchUserPreferences ( ) ,
397
402
] )
398
403
399
404
await getInit ( serverModeResponse )
400
405
406
+ setIsGrafanaModuleInstalled ( grafanaModuleStatus ?. result ?. status === ModuleStatus . INSTALLED )
401
407
setEnvironmentDataState ( {
402
408
isAirgapped : environmentDataResponse . isAirGapEnvironment ,
403
409
isManifestScanningEnabled : environmentDataResponse . isManifestScanningEnabled ,
@@ -663,7 +669,8 @@ const NavigationRoutes = ({ reloadVersionConfig }: Readonly<NavigationRoutesType
663
669
setSidePanelConfig,
664
670
isEnterprise : currentServerInfo ?. serverInfo ?. installationType === InstallationType . ENTERPRISE ,
665
671
isFELibAvailable : ! ! isFELibAvailable ,
666
- isResourceRecommendationEnabled : environmentDataState . isResourceRecommendationEnabled ,
672
+ isResourceRecommendationEnabled :
673
+ isGrafanaModuleInstalled && environmentDataState . isResourceRecommendationEnabled ,
667
674
} }
668
675
>
669
676
< ConfirmationModalProvider >
0 commit comments