Skip to content

Commit 663300b

Browse files
committed
feat: add about devtron dialog for oss
1 parent 6667157 commit 663300b

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

src/components/common/navigation/NavigationRoutes.tsx

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ import {
4141
LicenseInfoDialogType,
4242
DevtronLicenseInfo,
4343
useUserPreferences,
44+
AboutDevtronDialog,
4445
} from '@devtron-labs/devtron-fe-common-lib'
4546
import { Route, Switch, useRouteMatch, useHistory, useLocation } from 'react-router-dom'
4647
import * as Sentry from '@sentry/browser'
@@ -350,7 +351,8 @@ export default function NavigationRoutes() {
350351
result.canOnlyViewPermittedEnvOrgLevel ??
351352
ENVIRONMENT_DATA_FALLBACK['canOnlyViewPermittedEnvOrgLevel'],
352353
featureGitOpsFlags: parsedFeatureGitOpsFlags,
353-
canFetchHelmAppStatus: result.canFetchHelmAppStatus ?? ENVIRONMENT_DATA_FALLBACK['canFetchHelmAppStatus'],
354+
canFetchHelmAppStatus:
355+
result.canFetchHelmAppStatus ?? ENVIRONMENT_DATA_FALLBACK['canFetchHelmAppStatus'],
354356
devtronManagedLicensingEnabled:
355357
result.devtronManagedLicensingEnabled ??
356358
ENVIRONMENT_DATA_FALLBACK['devtronManagedLicensingEnabled'],
@@ -438,6 +440,20 @@ export default function NavigationRoutes() {
438440

439441
const showStackManager = !devtronManagedLicensingEnabled
440442

443+
const renderAboutDevtronDialog = () => {
444+
if (!licenseInfoDialogType) {
445+
return null
446+
}
447+
return licenseData && LicenseInfoDialog ? (
448+
<LicenseInfoDialog
449+
handleCloseLicenseInfoDialog={handleCloseLicenseInfoDialog}
450+
initialDialogType={licenseInfoDialogType}
451+
/>
452+
) : (
453+
<AboutDevtronDialog handleCloseLicenseInfoDialog={handleCloseLicenseInfoDialog} />
454+
)
455+
}
456+
441457
return (
442458
<MainContextProvider
443459
value={{
@@ -485,13 +501,7 @@ export default function NavigationRoutes() {
485501
handleUpdateUserThemePreference={handleUpdateUserThemePreference}
486502
/>
487503
)}
488-
{licenseInfoDialogType && LicenseInfoDialog && (
489-
<LicenseInfoDialog
490-
handleCloseLicenseInfoDialog={handleCloseLicenseInfoDialog}
491-
currentVersion={currentServerInfo.serverInfo?.currentVersion}
492-
initialDialogType={licenseInfoDialogType}
493-
/>
494-
)}
504+
{renderAboutDevtronDialog()}
495505
{!_isOnboardingPage && (
496506
<Navigation
497507
currentServerInfo={currentServerInfo}

0 commit comments

Comments
 (0)