@@ -39,22 +39,19 @@ export interface SidePanelConfig {
3939 docLink : string | null
4040}
4141
42- export interface MainContext {
43- serverMode : SERVER_MODE
42+ type CommonMainContextProps = {
4443 setServerMode : ( serverMode : SERVER_MODE ) => void
4544 isHelpGettingStartedClicked : boolean
4645 showCloseButtonAfterGettingStartedClicked : ( ) => void
47- loginCount : number
4846 setLoginCount : ( loginCount : number ) => void
4947 showGettingStartedCard : boolean
5048 setShowGettingStartedCard : ( showGettingStartedCard : boolean ) => void
5149 isGettingStartedClicked : boolean
5250 setGettingStartedClicked : ( isGettingStartedClicked : boolean ) => void
5351 moduleInInstallingState : string
5452 setModuleInInstallingState : ( moduleInInstallingState : string ) => void
55- installedModuleMap : MutableRefObject < Record < string , boolean > >
5653 currentServerInfo : {
57- serverInfo : ServerInfo
54+ serverInfo : ServerInfo | null
5855 fetchingServerInfo : boolean
5956 }
6057 isAirgapped : boolean
@@ -79,31 +76,60 @@ export interface MainContext {
7976 handleOpenLicenseInfoDialog : (
8077 initialDialogType ?: LicenseInfoDialogType . ABOUT | LicenseInfoDialogType . LICENSE ,
8178 ) => void
82- /**
83- * Data is set only if showLicenseData is received as true
84- */
85- licenseData : DevtronLicenseInfo
8679 setLicenseData : Dispatch < SetStateAction < DevtronLicenseInfo > >
8780 canFetchHelmAppStatus : boolean
88- reloadVersionConfig : ReloadVersionConfigTypes
89- intelligenceConfig : IntelligenceConfig
9081 setIntelligenceConfig : Dispatch < SetStateAction < IntelligenceConfig > >
91-
92- sidePanelConfig : SidePanelConfig
9382 setSidePanelConfig : Dispatch < SetStateAction < SidePanelConfig > >
94-
95- /**
96- * Indicates whether the current Devtron instance is running as an Enterprise edition. \
97- * This flag is determined based on server-side configuration.
98- */
99- isEnterprise : boolean
100- /**
101- * Indicates whether the fe-lib modules are available in the current instance. \
102- * Used to conditionally render or enable features that depend on fe-lib
103- */
104- isFELibAvailable : boolean
10583}
10684
85+ export type MainContext = CommonMainContextProps &
86+ (
87+ | {
88+ isLicenseDashboard ?: never
89+ serverMode : SERVER_MODE
90+ loginCount : number | null
91+ installedModuleMap : MutableRefObject < Record < string , boolean > >
92+ /**
93+ * Data is set only if showLicenseData is received as true
94+ */
95+ licenseData : DevtronLicenseInfo
96+
97+ reloadVersionConfig : ReloadVersionConfigTypes
98+ intelligenceConfig : IntelligenceConfig
99+
100+ sidePanelConfig : SidePanelConfig
101+
102+ /**
103+ * Indicates whether the current Devtron instance is running as an Enterprise edition. \
104+ * This flag is determined based on server-side configuration.
105+ */
106+ isEnterprise : boolean
107+ /**
108+ * Indicates whether the fe-lib modules are available in the current instance. \
109+ * Used to conditionally render or enable features that depend on fe-lib
110+ */
111+ isFELibAvailable : boolean
112+ }
113+ | {
114+ isLicenseDashboard : true
115+ serverMode : null
116+ loginCount : null
117+ installedModuleMap : null
118+ /**
119+ * Data is set only if showLicenseData is received as true
120+ */
121+ licenseData : null
122+
123+ reloadVersionConfig : null
124+ intelligenceConfig : null
125+
126+ sidePanelConfig : null
127+
128+ isEnterprise : false
129+ isFELibAvailable : false
130+ }
131+ )
132+
107133export interface MainContextProviderProps {
108134 children : ReactNode
109135 value : MainContext
0 commit comments