Skip to content

Commit f87d111

Browse files
authored
Merge pull request #2620 from devtron-labs/chore/sync-qr-dialog-behaviour
chore: sync qr dialog behaviour
2 parents c2f4954 + c2a7430 commit f87d111

File tree

9 files changed

+32
-86
lines changed

9 files changed

+32
-86
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,4 @@ FEATURE_ACTION_AUDIOS_ENABLE=true
6363
FEATURE_APPLICATION_TEMPLATES_ENABLE=true
6464
FEATURE_CODE_MIRROR_ENABLE=false
6565
FEATURE_DEFAULT_AUTHENTICATED_VIEW_ENABLE=false
66-
GATEKEEPER_URL=devtron.ai
66+
GATEKEEPER_URL=https://license.devtron.ai/dashboard

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"homepage": "/dashboard",
66
"dependencies": {
7-
"@devtron-labs/devtron-fe-common-lib": "1.10.10",
7+
"@devtron-labs/devtron-fe-common-lib": "1.10.11",
88
"@esbuild-plugins/node-globals-polyfill": "0.2.3",
99
"@rjsf/core": "^5.13.3",
1010
"@rjsf/utils": "^5.13.3",

src/App.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ import {
4242
} from './components/common'
4343
import { UPDATE_AVAILABLE_TOAST_PROGRESS_BG, URLS } from './config'
4444
import { validateToken } from './services/service'
45-
import { getCentralAPIHealth } from './utils'
4645

4746
const NavigationRoutes = lazy(() => import('./components/common/navigation/NavigationRoutes'))
4847
const Login = lazy(() => import('./components/login/Login'))
@@ -179,8 +178,6 @@ export default function App() {
179178
defaultRedirection()
180179
}
181180

182-
getCentralAPIHealth()
183-
184181
return () => {
185182
navigator.serviceWorker.removeEventListener('controllerchange', handleControllerChange)
186183
}

src/components/common/navigation/NavigationRoutes.tsx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ import { DEFAULT_GIT_OPS_FEATURE_FLAGS } from './constants'
8181
import { ParsedTabsData, ParsedTabsDataV1 } from '../DynamicTabs/types'
8282
import { SwitchThemeDialog } from '@Pages/Shared'
8383
import { SwitchThemeDialogProps } from '@Pages/Shared/SwitchThemeDialog/types'
84-
import { getShowStackManager } from 'src/utils'
84+
import { EnvironmentDataStateType } from './types'
8585

8686
// Monaco Editor worker initialization
8787
self.MonacoEnvironment = {
@@ -152,16 +152,12 @@ export default function NavigationRoutes() {
152152
}
153153
const [environmentId, setEnvironmentId] = useState(null)
154154
const contextValue = useMemo(() => ({ environmentId, setEnvironmentId }), [environmentId])
155-
const [environmentDataState, setEnvironmentDataState] = useState<
156-
Pick<
157-
MainContext,
158-
'isAirgapped' | 'isManifestScanningEnabled' | 'canOnlyViewPermittedEnvOrgLevel' | 'featureGitOpsFlags'
159-
>
160-
>({
155+
const [environmentDataState, setEnvironmentDataState] = useState<EnvironmentDataStateType>({
161156
isAirgapped: false,
162157
isManifestScanningEnabled: false,
163158
canOnlyViewPermittedEnvOrgLevel: false,
164159
featureGitOpsFlags: structuredClone(DEFAULT_GIT_OPS_FEATURE_FLAGS),
160+
devtronManagedLicensingEnabled: false,
165161
})
166162
const [userPreferences, setUserPreferences] = useState<UserPreferencesType>(null)
167163
const [userPreferencesError, setUserPreferencesError] = useState<ServerErrors>(null)
@@ -173,7 +169,8 @@ export default function NavigationRoutes() {
173169
appTheme,
174170
} = useTheme()
175171

176-
const { isAirgapped, isManifestScanningEnabled, canOnlyViewPermittedEnvOrgLevel } = environmentDataState
172+
const { isAirgapped, isManifestScanningEnabled, canOnlyViewPermittedEnvOrgLevel, devtronManagedLicensingEnabled } =
173+
environmentDataState
177174

178175
const handleCloseLicenseInfoDialog = () => {
179176
setLicenseInfoDialogType(null)
@@ -342,6 +339,7 @@ export default function NavigationRoutes() {
342339
isManifestScanningEnabled: false,
343340
canOnlyViewPermittedEnvOrgLevel: false,
344341
featureGitOpsFlags: structuredClone(DEFAULT_GIT_OPS_FEATURE_FLAGS),
342+
devtronManagedLicensingEnabled: false,
345343
}
346344

347345
if (!getEnvironmentData) {
@@ -361,6 +359,7 @@ export default function NavigationRoutes() {
361359
isManifestScanningEnabled: result.isManifestScanningEnabled,
362360
canOnlyViewPermittedEnvOrgLevel: result.canOnlyViewPermittedEnvOrgLevel,
363361
featureGitOpsFlags: parsedFeatureGitOpsFlags,
362+
devtronManagedLicensingEnabled: result.devtronManagedLicensingEnabled || false,
364363
}
365364
} catch {
366365
return fallbackResponse
@@ -408,6 +407,7 @@ export default function NavigationRoutes() {
408407
isManifestScanningEnabled: environmentDataResponse.isManifestScanningEnabled,
409408
canOnlyViewPermittedEnvOrgLevel: environmentDataResponse.canOnlyViewPermittedEnvOrgLevel,
410409
featureGitOpsFlags: environmentDataResponse.featureGitOpsFlags,
410+
devtronManagedLicensingEnabled: environmentDataResponse.devtronManagedLicensingEnabled,
411411
})
412412

413413
setServerMode(serverModeResponse)
@@ -484,11 +484,13 @@ export default function NavigationRoutes() {
484484
}
485485
const _isOnboardingPage = isOnboardingPage()
486486

487-
const handleOpenLicenseInfoDialog = (initialDialogTab?: LicenseInfoDialogType.ABOUT | LicenseInfoDialogType.LICENSE) => {
487+
const handleOpenLicenseInfoDialog = (
488+
initialDialogTab?: LicenseInfoDialogType.ABOUT | LicenseInfoDialogType.LICENSE,
489+
) => {
488490
setLicenseInfoDialogType(initialDialogTab || LicenseInfoDialogType.ABOUT)
489491
}
490492

491-
const showStackManager = getShowStackManager(currentServerInfo.serverInfo?.installationType, !!licenseData)
493+
const showStackManager = !devtronManagedLicensingEnabled
492494

493495
return (
494496
<MainContextProvider

src/components/common/navigation/types.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@
1515
*/
1616

1717
import { URLS } from '@Config/routes'
18-
import { customEnv, IconsProps, URLS as CommonURLS } from '@devtron-labs/devtron-fe-common-lib'
18+
import {
19+
customEnv,
20+
IconsProps,
21+
URLS as CommonURLS,
22+
EnvironmentDataValuesDTO,
23+
} from '@devtron-labs/devtron-fe-common-lib'
1924

2025
export interface NavigationListItemType {
2126
title: string
@@ -32,3 +37,7 @@ export interface NavigationListItemType {
3237
moduleName?: string
3338
moduleNameTrivy?: string
3439
}
40+
41+
export interface EnvironmentDataStateType extends Omit<EnvironmentDataValuesDTO, 'isAirGapEnvironment'> {
42+
isAirgapped: boolean
43+
}

src/components/v2/devtronStackManager/DevtronStackManager.component.tsx

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ import clair from '../../../assets/icons/ic-trivy-to-clair.svg'
8181
import warn from '../../../assets/icons/ic-error-medium.svg'
8282
import { SuccessModalComponent } from './SuccessModalComponent'
8383
import { EMPTY_STATE_STATUS } from '../../../config/constantMessaging'
84-
import { getShowStackManager } from 'src/utils'
8584

8685
const getInstallationStatusLabel = (
8786
installationStatus: ModuleStatus,
@@ -254,8 +253,6 @@ export const NavItem = ({
254253
showInitializing,
255254
showVersionInfo,
256255
}: StackManagerNavItemType): JSX.Element => {
257-
const { currentServerInfo, licenseData } = useMainContext()
258-
259256
const getNavLink = (route: StackManagerNavLinkType): JSX.Element => {
260257
return (
261258
<NavLink
@@ -304,18 +301,12 @@ export const NavItem = ({
304301
)
305302
}
306303

307-
const showAboutDevtronTab = getShowStackManager(currentServerInfo?.serverInfo?.installationType, !!licenseData)
308-
309304
return (
310305
<div className="flex column left">
311306
<div className="section-heading cn-6 fs-12 fw-6 pl-8 mb-8 dc__uppercase">Integrations</div>
312307
{ModulesSection.map((route) => getNavLink(route))}
313-
{showAboutDevtronTab && (
314-
<>
315-
<hr className="mt-8 mb-8 w-100 checklist__divider" />
316-
{getNavLink(AboutSection)}
317-
</>
318-
)}
308+
<hr className="mt-8 mb-8 w-100 checklist__divider" />
309+
{getNavLink(AboutSection)}
319310
</div>
320311
)
321312
}
@@ -917,7 +908,7 @@ export const InstallationWrapper = ({
917908
}}
918909
showTooltip={isInstallButtonDisabled}
919910
text={text}
920-
startIcon={<Icon />}
911+
startIcon={Icon ? <Icon /> : null}
921912
fullWidth
922913
/>
923914
)}

src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ if (!window || !window._env_) {
167167
FEATURE_APPLICATION_TEMPLATES_ENABLE: true,
168168
FEATURE_CODE_MIRROR_ENABLE: true,
169169
FEATURE_DEFAULT_AUTHENTICATED_VIEW_ENABLE: false,
170-
GATEKEEPER_URL: 'devtron.ai',
170+
GATEKEEPER_URL: 'https://license.devtron.ai/dashboard',
171171
}
172172
}
173173

src/utils.tsx

Lines changed: 0 additions & 53 deletions
This file was deleted.

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,10 +1126,10 @@
11261126
dependencies:
11271127
"@jridgewell/trace-mapping" "0.3.9"
11281128

1129-
"@devtron-labs/[email protected].10":
1130-
version "1.10.10"
1131-
resolved "https://registry.yarnpkg.com/@devtron-labs/devtron-fe-common-lib/-/devtron-fe-common-lib-1.10.10.tgz#7077bd2af98d8a3a2bceb4fa7685ec01fd4621b2"
1132-
integrity sha512-3GIlLeuptIgLGbMukAFngLVLkmInuhVbkI+2MCUWMhojM8J3sFsbSRj1Go7/dZCM63IeV2ZffZorTccukP6XrA==
1129+
"@devtron-labs/[email protected].11":
1130+
version "1.10.11"
1131+
resolved "https://registry.yarnpkg.com/@devtron-labs/devtron-fe-common-lib/-/devtron-fe-common-lib-1.10.11.tgz#3d26a29373cb36d2bec35389d7a67f6a3ca3ee42"
1132+
integrity sha512-7Pts9Su3jigWtDARNn3JvznS7RZbiBae9nB8FQdI9vgKT1sWLfbapkcgz5A0iXaF72qOmrqVnMEjnnVYh8a8Rw==
11331133
dependencies:
11341134
"@codemirror/lang-json" "6.0.1"
11351135
"@codemirror/lang-yaml" "6.1.2"

0 commit comments

Comments
 (0)