@@ -26,6 +26,7 @@ import {
2626 AppThemeType ,
2727 BaseConfirmationModal ,
2828 ConfirmationModalProvider ,
29+ CostVisibilityRenderProviderProps ,
2930 DEVTRON_BASE_MAIN_ID ,
3031 DevtronLicenseInfo ,
3132 DevtronProgressing ,
@@ -67,6 +68,7 @@ import {
6768import { Navigation } from '@Components/Navigation'
6869import AppConfig from '@Pages/Applications/DevtronApps/Details/AppConfigurations/AppConfig'
6970import { getUserRole } from '@Pages/GlobalConfigurations/Authorization/authorization.service'
71+ import EditClusterDrawerContent from '@Pages/GlobalConfigurations/ClustersAndEnvironments/EditClusterDrawerContent'
7072import { OffendingPipelineModalAppView } from '@Pages/GlobalConfigurations/PluginPolicy/OffendingPipelineModal'
7173import { Configurations } from '@Pages/Releases/Detail'
7274import { ApplicationManagementConfigurationsRouter } from '@PagesDevtron2.0/ApplicationManagement'
@@ -131,6 +133,8 @@ const ViewIsPipelineRBACConfigured: FunctionComponent<{
131133const LicenseInfoDialog = importComponentFromFELibrary ( 'LicenseInfoDialog' , null , 'function' )
132134const AIResponseWidget = importComponentFromFELibrary ( 'AIResponseWidget' , null , 'function' )
133135const EnterpriseRouter = importComponentFromFELibrary ( 'EnterpriseRouter' , null , 'function' )
136+ const CostVisibilityRenderProvider : FunctionComponent < CostVisibilityRenderProviderProps > | null =
137+ importComponentFromFELibrary ( 'CostVisibilityRenderProvider' , null , 'function' )
134138
135139const NavigationRoutes = ( { reloadVersionConfig } : Readonly < NavigationRoutesTypes > ) => {
136140 const history = useHistory ( )
@@ -503,6 +507,28 @@ const NavigationRoutes = ({ reloadVersionConfig }: Readonly<NavigationRoutesType
503507 )
504508 }
505509
510+ const renderClusterForm : CostVisibilityRenderProviderProps [ 'renderClusterForm' ] = ( {
511+ clusterDetails,
512+ handleClose,
513+ handleSuccess,
514+ } ) => (
515+ < EditClusterDrawerContent
516+ handleModalClose = { handleClose }
517+ sshTunnelConfig = { clusterDetails . sshTunnelConfig }
518+ clusterId = { clusterDetails . clusterId }
519+ clusterName = { clusterDetails . clusterName }
520+ serverUrl = { clusterDetails . serverUrl }
521+ reload = { handleSuccess }
522+ prometheusUrl = { clusterDetails . prometheusUrl }
523+ proxyUrl = { clusterDetails . proxyUrl }
524+ toConnectWithSSHTunnel = { clusterDetails . toConnectWithSSHTunnel }
525+ isProd = { clusterDetails . isProd }
526+ installationId = { clusterDetails . installationId }
527+ category = { clusterDetails . category }
528+ insecureSkipTlsVerify = { clusterDetails . insecureSkipTlsVerify }
529+ />
530+ )
531+
506532 const renderMainContent = ( ) => {
507533 if ( pageState === ViewType . LOADING ) {
508534 return < DevtronProgressing parentClasses = "flex flex-grow-1 bg__primary" classes = "icon-dim-80" />
@@ -649,18 +675,20 @@ const NavigationRoutes = ({ reloadVersionConfig }: Readonly<NavigationRoutesType
649675 </ AppContext . Provider >
650676 </ Route >
651677 ) }
652- { EnterpriseRouter && (
678+ { EnterpriseRouter && CostVisibilityRenderProvider && (
653679 < Route
654680 path = { [
655681 CommonURLS . APPLICATION_MANAGEMENT ,
656682 CommonURLS . COST_VISIBILITY ,
657683 CommonURLS . AI_RECOMMENDATIONS ,
658684 ] }
659685 >
660- < EnterpriseRouter
661- AppConfig = { AppConfig }
662- OfflinePipelineModalAppView = { OffendingPipelineModalAppView }
663- />
686+ < CostVisibilityRenderProvider renderClusterForm = { renderClusterForm } >
687+ < EnterpriseRouter
688+ AppConfig = { AppConfig }
689+ OfflinePipelineModalAppView = { OffendingPipelineModalAppView }
690+ />
691+ </ CostVisibilityRenderProvider >
664692 </ Route >
665693 ) }
666694 < RedirectUserWithSentry
0 commit comments