Skip to content

Commit 5b2c9de

Browse files
committed
Merge branch 'develop' of https://github.com/devtron-labs/dashboard into feat/security-summary-card
2 parents cbb398d + 6f49458 commit 5b2c9de

31 files changed

+1189
-439
lines changed

.storybook/preview.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,19 @@ const preview: Preview = {
1212
date: /Date$/i,
1313
},
1414
},
15+
backgrounds: {
16+
values: [
17+
{
18+
name: 'Light',
19+
value: 'var(--N0)',
20+
},
21+
{
22+
name: 'Dark',
23+
value: 'var(--N700)',
24+
},
25+
],
26+
default: 'Light',
27+
},
1528
},
1629
tags: ['autodocs'],
1730
decorators: (Story) => (

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": "0.3.5-beta-6",
7+
"@devtron-labs/devtron-fe-common-lib": "0.3.6-beta-3",
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: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
import { lazy, Suspense, useRef, useState, useEffect } from 'react'
1818
import { Route, Switch, Redirect, useHistory, useLocation } from 'react-router-dom'
19-
import './css/application.scss';
19+
import './css/application.scss'
2020
import {
2121
showError,
2222
BreadcrumbStore,
@@ -26,9 +26,10 @@ import {
2626
useUserEmail,
2727
URLS as CommonURLS,
2828
ToastManager,
29-
ToastVariantType
29+
ToastVariantType,
3030
} from '@devtron-labs/devtron-fe-common-lib'
3131
import { ReactComponent as ICSparkles } from '@Icons/ic-sparkles.svg'
32+
import { ReactComponent as ICArrowClockwise } from '@Icons/ic-arrow-clockwise.svg'
3233
import { useRegisterSW } from 'virtual:pwa-register/react'
3334
import {
3435
useOnline,
@@ -78,19 +79,22 @@ export default function App() {
7879
useEffect(() => {
7980
if (didMountRef.current) {
8081
if (!isOnline) {
82+
onlineToast(
83+
{
84+
variant: ToastVariantType.error,
85+
title: 'You are offline!',
86+
description: 'You are not seeing real-time data and any changes you make will not be saved.',
87+
},
88+
{
89+
autoClose: false,
90+
},
91+
)
92+
} else {
8193
onlineToast({
82-
variant: ToastVariantType.error,
83-
title: 'You are offline!',
84-
description: 'You are not seeing real-time data and any changes you make will not be saved.',
85-
}, {
86-
autoClose: false
94+
variant: ToastVariantType.success,
95+
title: 'Connected!',
96+
description: "You're back online.",
8797
})
88-
} else {
89-
onlineToast({
90-
variant: ToastVariantType.success,
91-
title: 'Connected!',
92-
description: "You're back online.",
93-
})
9498
}
9599
} else {
96100
didMountRef.current = true
@@ -245,6 +249,7 @@ export default function App() {
245249
text: 'Reload',
246250
dataTestId: 'reload-btn',
247251
onClick: update,
252+
startIcon: <ICArrowClockwise />,
248253
},
249254
icon: <ICSparkles />,
250255
progressBarBg: UPDATE_AVAILABLE_TOAST_PROGRESS_BG,
@@ -281,6 +286,7 @@ export default function App() {
281286
text: 'Reload',
282287
dataTestId: 'reload-btn',
283288
onClick: reloadLocation,
289+
startIcon: <ICArrowClockwise />,
284290
},
285291
icon: <ICSparkles />,
286292
progressBarBg: UPDATE_AVAILABLE_TOAST_PROGRESS_BG,

src/Pages/Applications/DevtronApps/Details/AppConfigurations/AppConfig.types.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ export interface ExtendedCollapsibleListItem
241241
configState: ResourceConfigState
242242
}
243243

244+
// DEPLOYMENT CONFIG COMPARE INTERFACES & TYPES ------- START
244245
export interface DeploymentConfigParams {
245246
appId: string
246247
envId: string
@@ -276,6 +277,8 @@ export enum AppEnvDeploymentConfigQueryParams {
276277
COMPARE_WITH_IDENTIFIER_ID = 'compareWithIdentifierId',
277278
COMPARE_WITH_PIPELINE_ID = 'compareWithPipelineId',
278279
CHART_REF_ID = 'chartRefId',
280+
MANIFEST_CHART_REF_ID = 'manifestChartRefId',
281+
COMPARE_WITH_MANIFEST_CHART_REF_ID = 'compareWithManifestChartRefId',
279282
}
280283

281284
export interface AppEnvDeploymentConfigQueryParamsType {
@@ -287,4 +290,29 @@ export interface AppEnvDeploymentConfigQueryParamsType {
287290
compareWithIdentifierId?: number
288291
compareWithPipelineId?: number
289292
chartRefId?: number
293+
manifestChartRefId?: number
294+
compareWithManifestChartRefId?: number
290295
}
296+
297+
export type GetConfigDiffDataProps = Required<
298+
Pick<DeploymentConfigCompareProps, 'appName' | 'envName' | 'type'> & {
299+
configType: AppEnvDeploymentConfigType
300+
compareName: string
301+
identifierId: number
302+
pipelineId: number
303+
}
304+
>
305+
306+
export type GetDeploymentTemplateDataProps = Omit<GetConfigDiffDataProps, 'identifierId' | 'pipelineId'>
307+
308+
export type GetManifestDataProps = Pick<DeploymentConfigCompareProps, 'type' | 'environments'> & {
309+
appId: string
310+
envId: string
311+
configType: AppEnvDeploymentConfigType
312+
compareName: string
313+
values: string
314+
identifierId: number
315+
pipelineId: number
316+
manifestChartRefId: number
317+
}
318+
// DEPLOYMENT CONFIG COMPARE INTERFACES & TYPES ------- END

src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/AppComposeRouter.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,10 @@ const AppComposeRouter = () => {
302302
const envOverridePath = match.params.envId
303303
? `/${URLS.APP_ENV_OVERRIDE_CONFIG}/${match.params.envId}`
304304
: ''
305-
const resourceTypePath = `/${match.params.resourceType}`
305+
// Set the resourceTypePath based on the resourceType from the URL parameters.
306+
// If the resourceType is 'Manifest', use 'deployment-template' as the back URL.
307+
// Otherwise, use the actual resourceType from the URL, which could be 'deployment-template', 'configmap', or 'secrets'.
308+
const resourceTypePath = `/${match.params.resourceType === EnvResourceType.Manifest ? EnvResourceType.DeploymentTemplate : match.params.resourceType}`
306309
const resourceNamePath = match.params.resourceName
307310
? `/${match.params.resourceName}`
308311
: ''

0 commit comments

Comments
 (0)