diff --git a/src/config/routes.ts b/src/config/routes.ts
index 2c63851a29..f721df778e 100644
--- a/src/config/routes.ts
+++ b/src/config/routes.ts
@@ -66,7 +66,6 @@ export const URLS = {
APP_ENV_OVERRIDE_CONFIG: 'env-override',
APP_ENV_CONFIG_COMPARE: 'config-compare',
APP_EXTERNAL_LINKS: 'external-links',
- // APP_CONFIG_PROTECTION: 'config-protection',
APP_CI_CONFIG: 'ci-pipeline',
APP_CD_CONFIG: 'cd-pipeline',
APP_EXTERNAL_CI_CONFIG: 'external-ci',
From d6f1ccdd434affd3a12192b0aed3aa4ee62f78fd Mon Sep 17 00:00:00 2001
From: Eshank Vaish <48060426+eshankvaish@users.noreply.github.com>
Date: Mon, 2 Dec 2024 17:14:29 +0530
Subject: [PATCH 025/186] refactor: remove unused code
---
.../triggerView/__mocks__/workflow.mock.ts | 47 +++++----
.../__mocks__/workflow.sequential.mock.ts | 99 +++++++++----------
2 files changed, 72 insertions(+), 74 deletions(-)
diff --git a/src/components/app/details/triggerView/__mocks__/workflow.mock.ts b/src/components/app/details/triggerView/__mocks__/workflow.mock.ts
index db2bffb3de..00037b9e3e 100644
--- a/src/components/app/details/triggerView/__mocks__/workflow.mock.ts
+++ b/src/components/app/details/triggerView/__mocks__/workflow.mock.ts
@@ -591,7 +591,6 @@ export const workflowsTrigger = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
status: DEFAULT_STATUS,
description: 'test',
triggerType: 'Auto',
@@ -685,7 +684,7 @@ export const workflowsTrigger = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Manual',
@@ -717,7 +716,7 @@ export const workflowsTrigger = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Manual',
@@ -814,7 +813,7 @@ export const workflowsCreate = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Auto',
@@ -908,7 +907,7 @@ export const workflowsCreate = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Manual',
@@ -940,7 +939,7 @@ export const workflowsCreate = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Manual',
@@ -1062,7 +1061,7 @@ export const workflowsTriggerPrePostCD = [
parentPipelineType: undefined,
downstreams: ['POSTCD-79'],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Auto',
@@ -1229,7 +1228,7 @@ export const workflowsTriggerPrePostCD = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Manual',
@@ -1261,7 +1260,7 @@ export const workflowsTriggerPrePostCD = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Manual',
@@ -1358,7 +1357,7 @@ export const workflowsCreatePrePostCD = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Auto',
@@ -1452,7 +1451,7 @@ export const workflowsCreatePrePostCD = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Manual',
@@ -1484,7 +1483,7 @@ export const workflowsCreatePrePostCD = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Manual',
@@ -1840,7 +1839,7 @@ export const workflowsTriggerPreCDResp = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Manual',
@@ -1958,7 +1957,7 @@ export const workflowsTriggerPreCDResp = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Manual',
@@ -1990,7 +1989,7 @@ export const workflowsTriggerPreCDResp = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Manual',
@@ -2087,7 +2086,7 @@ export const workflowsCreatePreCDResp = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Manual',
@@ -2181,7 +2180,7 @@ export const workflowsCreatePreCDResp = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Manual',
@@ -2213,7 +2212,7 @@ export const workflowsCreatePreCDResp = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Manual',
@@ -2310,7 +2309,7 @@ export const workflowsCreatePostCD = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Manual',
@@ -2404,7 +2403,7 @@ export const workflowsCreatePostCD = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Manual',
@@ -2436,7 +2435,7 @@ export const workflowsCreatePostCD = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Manual',
@@ -2533,7 +2532,7 @@ export const workflowsTriggerPostCD = [
parentPipelineType: undefined,
downstreams: ['POSTCD-79'],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Manual',
@@ -2676,7 +2675,7 @@ export const workflowsTriggerPostCD = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Manual',
@@ -2708,7 +2707,7 @@ export const workflowsTriggerPostCD = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Manual',
diff --git a/src/components/app/details/triggerView/__mocks__/workflow.sequential.mock.ts b/src/components/app/details/triggerView/__mocks__/workflow.sequential.mock.ts
index d055692efa..52b4e33524 100644
--- a/src/components/app/details/triggerView/__mocks__/workflow.sequential.mock.ts
+++ b/src/components/app/details/triggerView/__mocks__/workflow.sequential.mock.ts
@@ -162,7 +162,6 @@ export const workflowsTriggerWithSequential = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Auto',
@@ -205,7 +204,7 @@ export const workflowsTriggerWithSequential = [
title: 'amit-16-jan-replica-amit-16-jan-erferf2',
triggerType: 'Auto',
type: 'CD',
- userApprovalConfig: undefined,
+
width: 200,
x: 0,
y: 0,
@@ -288,7 +287,7 @@ export const workflowsTriggerWithSequential = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Manual',
@@ -320,7 +319,7 @@ export const workflowsTriggerWithSequential = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Manual',
@@ -363,7 +362,7 @@ export const workflowsTriggerWithSequential = [
title: 'amit-16-jan-replica-dep2',
triggerType: 'Manual',
type: 'CD',
- userApprovalConfig: undefined,
+
width: 200,
x: 0,
y: 0,
@@ -449,7 +448,7 @@ export const workflowsCreateWithSequential = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Auto',
@@ -492,7 +491,7 @@ export const workflowsCreateWithSequential = [
title: 'Deploy',
triggerType: 'Auto',
type: 'CD',
- userApprovalConfig: undefined,
+
width: 240,
x: 0,
y: 0,
@@ -575,7 +574,7 @@ export const workflowsCreateWithSequential = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Manual',
@@ -607,7 +606,7 @@ export const workflowsCreateWithSequential = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Manual',
@@ -650,7 +649,7 @@ export const workflowsCreateWithSequential = [
title: 'Deploy',
triggerType: 'Manual',
type: 'CD',
- userApprovalConfig: undefined,
+
width: 240,
x: 0,
y: 0,
@@ -761,7 +760,7 @@ export const workflowsTriggerPrePostCDWithSequential = [
parentPipelineType: undefined,
downstreams: ['POSTCD-79'],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Auto',
@@ -877,7 +876,7 @@ export const workflowsTriggerPrePostCDWithSequential = [
title: 'amit-16-jan-replica-amit-16-jan-erferf2',
triggerType: 'Auto',
type: 'CD',
- userApprovalConfig: undefined,
+
width: 200,
x: 0,
y: 0,
@@ -960,7 +959,7 @@ export const workflowsTriggerPrePostCDWithSequential = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Manual',
@@ -992,7 +991,7 @@ export const workflowsTriggerPrePostCDWithSequential = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Manual',
@@ -1035,7 +1034,7 @@ export const workflowsTriggerPrePostCDWithSequential = [
title: 'amit-16-jan-replica-dep2',
triggerType: 'Manual',
type: 'CD',
- userApprovalConfig: undefined,
+
width: 200,
x: 0,
y: 0,
@@ -1146,7 +1145,7 @@ export const workflowsTriggerPrePostCDWithPrePostSequential = [
parentPipelineType: undefined,
downstreams: ['POSTCD-79'],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Auto',
@@ -1335,7 +1334,7 @@ export const workflowsTriggerPrePostCDWithPrePostSequential = [
title: 'amit-16-jan-replica-amit-16-jan-erferf2',
triggerType: 'Auto',
type: 'CD',
- userApprovalConfig: undefined,
+
width: 200,
x: 0,
y: 0,
@@ -1443,7 +1442,7 @@ export const workflowsTriggerPrePostCDWithPrePostSequential = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Manual',
@@ -1475,7 +1474,7 @@ export const workflowsTriggerPrePostCDWithPrePostSequential = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Manual',
@@ -1591,7 +1590,7 @@ export const workflowsTriggerPrePostCDWithPrePostSequential = [
title: 'amit-16-jan-replica-dep2',
triggerType: 'Manual',
type: 'CD',
- userApprovalConfig: undefined,
+
width: 200,
x: 0,
y: 0,
@@ -1702,7 +1701,7 @@ export const workflowsCreatePrePostCDWithSequential = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Auto',
@@ -1744,7 +1743,7 @@ export const workflowsCreatePrePostCDWithSequential = [
title: 'Deploy',
triggerType: 'Auto',
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
width: 240,
x: 0,
@@ -1828,7 +1827,7 @@ export const workflowsCreatePrePostCDWithSequential = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Manual',
@@ -1860,7 +1859,7 @@ export const workflowsCreatePrePostCDWithSequential = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Manual',
@@ -1903,7 +1902,7 @@ export const workflowsCreatePrePostCDWithSequential = [
title: 'Deploy',
triggerType: 'Manual',
type: 'CD',
- userApprovalConfig: undefined,
+
width: 240,
x: 0,
y: 0,
@@ -1989,7 +1988,7 @@ export const workflowsCreatePrePostCDWithPrePostSequential = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Auto',
@@ -2032,7 +2031,7 @@ export const workflowsCreatePrePostCDWithPrePostSequential = [
title: 'Pre-deploy, Deploy, Post-deploy',
triggerType: 'Auto',
type: 'CD',
- userApprovalConfig: undefined,
+
width: 240,
x: 0,
y: 0,
@@ -2115,7 +2114,7 @@ export const workflowsCreatePrePostCDWithPrePostSequential = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Manual',
@@ -2147,7 +2146,7 @@ export const workflowsCreatePrePostCDWithPrePostSequential = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Manual',
@@ -2190,7 +2189,7 @@ export const workflowsCreatePrePostCDWithPrePostSequential = [
title: 'Pre-deploy, Deploy, Post-deploy',
triggerType: 'Manual',
type: 'CD',
- userApprovalConfig: undefined,
+
width: 240,
x: 0,
y: 0,
@@ -2449,7 +2448,7 @@ export const workflowsTriggerPreCDRespWithSequential = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Manual',
@@ -2516,7 +2515,7 @@ export const workflowsTriggerPreCDRespWithSequential = [
title: 'amit-16-jan-replica-amit-16-jan-erferf2',
triggerType: 'Auto',
type: 'CD',
- userApprovalConfig: undefined,
+
width: 200,
x: 0,
y: 0,
@@ -2599,7 +2598,7 @@ export const workflowsTriggerPreCDRespWithSequential = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Manual',
@@ -2631,7 +2630,7 @@ export const workflowsTriggerPreCDRespWithSequential = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Manual',
@@ -2674,7 +2673,7 @@ export const workflowsTriggerPreCDRespWithSequential = [
title: 'amit-16-jan-replica-dep2',
triggerType: 'Manual',
type: 'CD',
- userApprovalConfig: undefined,
+
width: 200,
x: 0,
y: 0,
@@ -2760,7 +2759,7 @@ export const workflowsCreatePreCDRespWithSequential = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Manual',
@@ -2803,7 +2802,7 @@ export const workflowsCreatePreCDRespWithSequential = [
title: 'Deploy',
triggerType: 'Auto',
type: 'CD',
- userApprovalConfig: undefined,
+
width: 240,
x: 0,
y: 0,
@@ -2887,7 +2886,7 @@ export const workflowsCreatePreCDRespWithSequential = [
downstreams: [],
description: 'test',
type: 'CD',
- userApprovalConfig: undefined,
+
status: DEFAULT_STATUS,
triggerType: 'Manual',
environmentName: 'dev2',
@@ -2918,7 +2917,7 @@ export const workflowsCreatePreCDRespWithSequential = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Manual',
@@ -2961,7 +2960,7 @@ export const workflowsCreatePreCDRespWithSequential = [
title: 'Deploy',
triggerType: 'Manual',
type: 'CD',
- userApprovalConfig: undefined,
+
width: 240,
x: 0,
y: 0,
@@ -3047,7 +3046,7 @@ export const workflowsCreatePostCDWithSequential = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Manual',
@@ -3090,7 +3089,7 @@ export const workflowsCreatePostCDWithSequential = [
title: 'Deploy',
triggerType: 'Auto',
type: 'CD',
- userApprovalConfig: undefined,
+
width: 240,
x: 0,
y: 0,
@@ -3173,7 +3172,7 @@ export const workflowsCreatePostCDWithSequential = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Manual',
@@ -3205,7 +3204,7 @@ export const workflowsCreatePostCDWithSequential = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Manual',
@@ -3248,7 +3247,7 @@ export const workflowsCreatePostCDWithSequential = [
title: 'Deploy',
triggerType: 'Manual',
type: 'CD',
- userApprovalConfig: undefined,
+
width: 240,
x: 0,
y: 0,
@@ -3332,7 +3331,7 @@ export const workflowsTriggerPostCDWithSequential = [
deploymentAppDeleteRequest: undefined,
downstreams: ['POSTCD-79'],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Manual',
@@ -3426,7 +3425,7 @@ export const workflowsTriggerPostCDWithSequential = [
title: 'amit-16-jan-replica-amit-16-jan-erferf2',
triggerType: 'Auto',
type: 'CD',
- userApprovalConfig: undefined,
+
width: 200,
x: 0,
y: 0,
@@ -3509,7 +3508,7 @@ export const workflowsTriggerPostCDWithSequential = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
+
description: 'test',
status: DEFAULT_STATUS,
triggerType: 'Manual',
@@ -3542,7 +3541,7 @@ export const workflowsTriggerPostCDWithSequential = [
parentPipelineType: undefined,
downstreams: [],
type: 'CD',
- userApprovalConfig: undefined,
+
status: DEFAULT_STATUS,
triggerType: 'Manual',
environmentName: 'dev4',
@@ -3584,7 +3583,7 @@ export const workflowsTriggerPostCDWithSequential = [
title: 'amit-16-jan-replica-dep2',
triggerType: 'Manual',
type: 'CD',
- userApprovalConfig: undefined,
+
width: 200,
x: 0,
y: 0,
From 13b094ee37429ee89e39d8ab2310fd312074c762 Mon Sep 17 00:00:00 2001
From: Eshank Vaish <48060426+eshankvaish@users.noreply.github.com>
Date: Mon, 2 Dec 2024 17:17:46 +0530
Subject: [PATCH 026/186] fix: approval policy configured state on app details
---
.../app/details/appDetails/SourceInfo.tsx | 15 ++-------------
src/components/app/types.ts | 4 ++--
2 files changed, 4 insertions(+), 15 deletions(-)
diff --git a/src/components/app/details/appDetails/SourceInfo.tsx b/src/components/app/details/appDetails/SourceInfo.tsx
index 43f8147567..1fa5a97e48 100644
--- a/src/components/app/details/appDetails/SourceInfo.tsx
+++ b/src/components/app/details/appDetails/SourceInfo.tsx
@@ -25,7 +25,7 @@ import {
ComponentSizeType,
DATE_TIME_FORMATS,
DeploymentAppTypes,
- getIsManualApprovalConfigured,
+ getIsApprovalPolicyConfigured,
handleUTCTime,
ReleaseMode,
Tooltip,
@@ -121,20 +121,9 @@ export const SourceInfo = ({
return
{loadingCards}
}
- const getIsApprovalConfigured = (): boolean => {
- try {
- // TODO: Check this one
- const userApprovalConfig = appDetails?.userApprovalConfig || '{}'
- const parsedUserApprovalConfig = JSON.parse(userApprovalConfig)
- return getIsManualApprovalConfigured(parsedUserApprovalConfig)
- } catch (error) {
- return false
- }
- }
-
const renderDevtronAppsEnvironmentSelector = (environment) => {
// If moving to a component then move getIsApprovalConfigured with it as well with memoization.
- const isApprovalConfigured = getIsApprovalConfigured()
+ const isApprovalConfigured = getIsApprovalPolicyConfigured(appDetails?.userApprovalMetadata?.approvalConfigData)
const relativeSnapshotTime = appDetails?.resourceTree?.lastSnapshotTime
? handleUTCTime(appDetails.resourceTree.lastSnapshotTime, true)
: ''
diff --git a/src/components/app/types.ts b/src/components/app/types.ts
index bbb8cda86f..02eae38d5a 100644
--- a/src/components/app/types.ts
+++ b/src/components/app/types.ts
@@ -28,6 +28,7 @@ import {
RuntimeParamsListItemType,
RuntimeParamsTriggerPayloadType,
HelmReleaseStatus,
+ UserApprovalMetadataType,
} from '@devtron-labs/devtron-fe-common-lib'
import { DeploymentStatusDetailsBreakdownDataType, ErrorItem } from './details/appDetails/appDetails.type'
import { GroupFilterType } from '../ApplicationGroup/AppGroup.types'
@@ -102,8 +103,7 @@ export interface AppDetails extends CDModalProps {
appId: number
deploymentAppType?: DeploymentAppTypes
externalCi?: boolean
- // TODO: Need to check this one
- userApprovalConfig?: string
+ userApprovalMetadata?: UserApprovalMetadataType
ciArtifactId?: number
parentArtifactId?: number
deprecated?: boolean
From 92fe1dcc5dbf50add2afbc9b42a7fc741263945c Mon Sep 17 00:00:00 2001
From: Eshank Vaish <48060426+eshankvaish@users.noreply.github.com>
Date: Mon, 2 Dec 2024 17:20:46 +0530
Subject: [PATCH 027/186] refactor: remove redundant code
---
src/components/app/details/appDetails/SourceInfo.tsx | 2 +-
src/components/app/types.ts | 4 ++--
src/components/cdPipeline/CDPipeline.tsx | 2 --
3 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/src/components/app/details/appDetails/SourceInfo.tsx b/src/components/app/details/appDetails/SourceInfo.tsx
index 1fa5a97e48..04f6710755 100644
--- a/src/components/app/details/appDetails/SourceInfo.tsx
+++ b/src/components/app/details/appDetails/SourceInfo.tsx
@@ -123,7 +123,7 @@ export const SourceInfo = ({
const renderDevtronAppsEnvironmentSelector = (environment) => {
// If moving to a component then move getIsApprovalConfigured with it as well with memoization.
- const isApprovalConfigured = getIsApprovalPolicyConfigured(appDetails?.userApprovalMetadata?.approvalConfigData)
+ const isApprovalConfigured = getIsApprovalPolicyConfigured(appDetails?.approvalConfigData)
const relativeSnapshotTime = appDetails?.resourceTree?.lastSnapshotTime
? handleUTCTime(appDetails.resourceTree.lastSnapshotTime, true)
: ''
diff --git a/src/components/app/types.ts b/src/components/app/types.ts
index 02eae38d5a..df72a08dda 100644
--- a/src/components/app/types.ts
+++ b/src/components/app/types.ts
@@ -28,7 +28,7 @@ import {
RuntimeParamsListItemType,
RuntimeParamsTriggerPayloadType,
HelmReleaseStatus,
- UserApprovalMetadataType,
+ ApprovalConfigDataType,
} from '@devtron-labs/devtron-fe-common-lib'
import { DeploymentStatusDetailsBreakdownDataType, ErrorItem } from './details/appDetails/appDetails.type'
import { GroupFilterType } from '../ApplicationGroup/AppGroup.types'
@@ -103,7 +103,7 @@ export interface AppDetails extends CDModalProps {
appId: number
deploymentAppType?: DeploymentAppTypes
externalCi?: boolean
- userApprovalMetadata?: UserApprovalMetadataType
+ approvalConfigData?: ApprovalConfigDataType
ciArtifactId?: number
parentArtifactId?: number
deprecated?: boolean
diff --git a/src/components/cdPipeline/CDPipeline.tsx b/src/components/cdPipeline/CDPipeline.tsx
index 3553c247df..31389b5b14 100644
--- a/src/components/cdPipeline/CDPipeline.tsx
+++ b/src/components/cdPipeline/CDPipeline.tsx
@@ -184,8 +184,6 @@ export default function CDPipeline({
triggerType: TriggerType.Auto,
steps: [],
},
- // Utilizing the null checks to get default value
- // TODO: Remove
isClusterCdActive: false,
deploymentAppCreated: false,
clusterName: '',
From 6f6bffa4cd2020e08b4307ce8e0708bbbdcd13b3 Mon Sep 17 00:00:00 2001
From: Eshank Vaish <48060426+eshankvaish@users.noreply.github.com>
Date: Tue, 3 Dec 2024 11:35:58 +0530
Subject: [PATCH 028/186] chore: bump common lib
---
package.json | 2 +-
yarn.lock | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/package.json b/package.json
index 7e77708836..7a497a7ffa 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
"private": true,
"homepage": "/dashboard",
"dependencies": {
- "@devtron-labs/devtron-fe-common-lib": "1.1.6-beta-6",
+ "@devtron-labs/devtron-fe-common-lib": "1.1.6-beta-7",
"@esbuild-plugins/node-globals-polyfill": "0.2.3",
"@rjsf/core": "^5.13.3",
"@rjsf/utils": "^5.13.3",
diff --git a/yarn.lock b/yarn.lock
index 96da0bde15..cc37902302 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -974,10 +974,10 @@
dependencies:
"@jridgewell/trace-mapping" "0.3.9"
-"@devtron-labs/devtron-fe-common-lib@1.1.6-beta-6":
- version "1.1.6-beta-6"
- resolved "https://registry.yarnpkg.com/@devtron-labs/devtron-fe-common-lib/-/devtron-fe-common-lib-1.1.6-beta-6.tgz#ad13516f7f85fd00242af4c72ffe64c78d1e4bd8"
- integrity sha512-bfZvC+jAW5lWPYIpASRsbS7IlOVNnOuKbSUldLE3oaQNT+ofedH1JNOFZBBF3q9HGrgfZnBv2mFDuZTjE53Bkg==
+"@devtron-labs/devtron-fe-common-lib@1.1.6-beta-7":
+ version "1.1.6-beta-7"
+ resolved "https://registry.yarnpkg.com/@devtron-labs/devtron-fe-common-lib/-/devtron-fe-common-lib-1.1.6-beta-7.tgz#f1674984f3993431493f1113fde35b55baa5f278"
+ integrity sha512-CW4OSMHvAGeXr+Qxqi3CeV3STKZGYSTcpVSPfFGzGkdTJ38XTUZ5fNijj8HHsoy/O56H2Mhda3UL/dc7iFocPA==
dependencies:
"@types/react-dates" "^21.8.6"
ansi_up "^5.2.1"
From 0c742f048666e9697f09dcd251bd9964374de222 Mon Sep 17 00:00:00 2001
From: AbhishekA1509
Date: Tue, 3 Dec 2024 18:18:12 +0530
Subject: [PATCH 029/186] feat: add dc__opacity-hover
---
src/css/base.scss | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/src/css/base.scss b/src/css/base.scss
index 8e6e89bc1c..d0af955da7 100644
--- a/src/css/base.scss
+++ b/src/css/base.scss
@@ -1742,6 +1742,27 @@ button.anchor {
}
}
+.dc__opacity-hover {
+ .dc__opacity-hover--child {
+ opacity: 0;
+ }
+
+ &.dc__opacity-hover--parent:hover {
+ .dc__opacity-hover {
+
+ // If we give this class then the element will be visible on hover
+ &--child {
+ opacity: 1;
+ }
+
+ // For hiding a child on hover on parent
+ &--hide-child {
+ opacity: 0;
+ }
+ }
+ }
+}
+
.dc__hover-icon {
.dc__show-first--icon {
display: inherit;
From eaa8c40bfe76c9bb384217dcb1368d908d5db36a Mon Sep 17 00:00:00 2001
From: AbhishekA1509
Date: Thu, 5 Dec 2024 13:05:13 +0530
Subject: [PATCH 030/186] feat: add scss block for details[open] state
---
src/css/base.scss | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/css/base.scss b/src/css/base.scss
index d0af955da7..1febd541cd 100644
--- a/src/css/base.scss
+++ b/src/css/base.scss
@@ -3443,6 +3443,10 @@ textarea,
height: fit-content !important;
}
+.dc__h-min-content {
+ height: min-content;
+}
+
.h-0 {
height: 0px;
}
@@ -5275,3 +5279,11 @@ textarea::placeholder {
.code-editor-red-diff {
background: var(--R100);
}
+
+details[open] {
+ .dc__accordion-summary {
+ &--icon-flip-90 {
+ transform: rotate(90deg);
+ }
+ }
+}
From 0299ba5eaffd0e07df8a450979375bad55fc1f27 Mon Sep 17 00:00:00 2001
From: Eshank Vaish <48060426+eshankvaish@users.noreply.github.com>
Date: Thu, 5 Dec 2024 13:26:00 +0530
Subject: [PATCH 031/186] chore: bump common
---
package.json | 2 +-
yarn.lock | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/package.json b/package.json
index 5564eeb092..12e5bd0923 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
"private": true,
"homepage": "/dashboard",
"dependencies": {
- "@devtron-labs/devtron-fe-common-lib": "1.2.3-beta-1",
+ "@devtron-labs/devtron-fe-common-lib": "1.2.3-beta-3",
"@esbuild-plugins/node-globals-polyfill": "0.2.3",
"@rjsf/core": "^5.13.3",
"@rjsf/utils": "^5.13.3",
diff --git a/yarn.lock b/yarn.lock
index 3273548331..39f6d42406 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -974,10 +974,10 @@
dependencies:
"@jridgewell/trace-mapping" "0.3.9"
-"@devtron-labs/devtron-fe-common-lib@1.2.3-beta-1":
- version "1.2.3-beta-1"
- resolved "https://registry.yarnpkg.com/@devtron-labs/devtron-fe-common-lib/-/devtron-fe-common-lib-1.2.3-beta-1.tgz#b54ffa809b93beafec81bc0d4e2e78b8882b83e2"
- integrity sha512-CQsAd4JGCnaDVE08UtJSjkMgwMLRkbfbGNftmmxfiBDk8EMds6crqiGN9vQGiwqcnWXaZ67rPqkKY8ryeIYL6Q==
+"@devtron-labs/devtron-fe-common-lib@1.2.3-beta-3":
+ version "1.2.3-beta-3"
+ resolved "https://registry.yarnpkg.com/@devtron-labs/devtron-fe-common-lib/-/devtron-fe-common-lib-1.2.3-beta-3.tgz#ec5c2eaa6c27936444094266d9c653c2f9448674"
+ integrity sha512-b4yQZN0ykzlVfBeanxDLqHhTCyrSSefeudlbaXygzUvzLaF4ckSDvQvOyGVqc3nScJxguFmeW0pa793SEGCnDg==
dependencies:
"@types/react-dates" "^21.8.6"
ansi_up "^5.2.1"
From 8069a16bb9039bae42390d4d8d8b0c619797170c Mon Sep 17 00:00:00 2001
From: Eshank Vaish <48060426+eshankvaish@users.noreply.github.com>
Date: Fri, 6 Dec 2024 13:20:09 +0530
Subject: [PATCH 032/186] refactor: code review comments
---
.../Details/AppConfigurations/AppConfig.tsx | 16 ++++++-------
.../AppConfigurations/AppConfig.types.ts | 11 ++++-----
.../AppConfiguration.provider.tsx | 2 +-
.../MainContent/AppComposeRouter.tsx | 10 ++++----
.../MainContent/ConfigToolbar.tsx | 10 +++++++-
.../DeploymentConfigCompare.tsx | 13 ++++++-----
.../DeploymentTemplate/DeploymentTemplate.tsx | 16 ++++++++-----
.../DeploymentTemplate/constants.ts | 1 -
.../AppConfigurations/MainContent/types.ts | 6 ++---
.../Navigation/AppNavigation.tsx | 6 ++---
.../Navigation/EnvConfigurationsNav.tsx | 6 ++---
.../Navigation/EnvironmentOverrideRouter.tsx | 23 ++++++++++---------
.../Navigation/Navigation.helper.tsx | 2 +-
.../Detail/Configurations/Configurations.tsx | 8 +++----
.../Releases/Detail/Configurations/types.ts | 2 +-
.../ConfigMapSecret.service.ts | 2 +-
.../ConfigMapSecretContainer.tsx | 3 +++
.../EnvironmentOverride.tsx | 10 ++++----
.../EnvironmentOverrides.types.ts | 2 +-
.../ApplicationGroup/AppGroup.types.ts | 2 +-
.../EnvironmentConfig/ApplicationRoutes.tsx | 6 ++---
.../Details/EnvironmentConfig/EnvConfig.tsx | 4 ++--
.../app/details/triggerView/TriggerView.tsx | 1 +
.../details/triggerView/workflow.service.ts | 2 +-
24 files changed, 88 insertions(+), 76 deletions(-)
diff --git a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/AppConfig.tsx b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/AppConfig.tsx
index c6b91ebca4..f9211ace86 100644
--- a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/AppConfig.tsx
+++ b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/AppConfig.tsx
@@ -78,7 +78,7 @@ export const AppConfig = ({ appName, resourceKind, filteredEnvIds }: AppConfigPr
canDeleteApp: false,
workflowsRes: null,
environmentList: [],
- envIdToEnvApprovalConfigMap: {} as ResourceIdToResourceApprovalPolicyConfigMapType,
+ envIdToEnvApprovalConfigurationMap: {} as ResourceIdToResourceApprovalPolicyConfigMapType,
envConfig: {
isLoading: true,
config: null,
@@ -108,14 +108,14 @@ export const AppConfig = ({ appName, resourceKind, filteredEnvIds }: AppConfigPr
*/
const fetchEnvironments = (): Promise<{
updatedEnvs: AppConfigState['environmentList']
- envIdToEnvApprovalConfigMap: ResourceIdToResourceApprovalPolicyConfigMapType
+ envIdToEnvApprovalConfigurationMap: ResourceIdToResourceApprovalPolicyConfigMapType
}> =>
Promise.all([
isJob ? getJobOtherEnvironmentMin(appId) : getAppOtherEnvironmentMin(appId),
typeof getApprovalPolicyConfigForApp === 'function' && !isJob
? getApprovalPolicyConfigForApp(Number(appId))
: null,
- ]).then(([envResult, envIdToEnvApprovalConfigMap]) => {
+ ]).then(([envResult, envIdToEnvApprovalConfigurationMap]) => {
const filteredEnvMap = filteredEnvIds?.split(',').reduce((agg, curr) => agg.set(+curr, true), new Map())
const updatedEnvs: AppConfigState['environmentList'] =
@@ -125,7 +125,7 @@ export const AppConfig = ({ appName, resourceKind, filteredEnvIds }: AppConfigPr
return {
updatedEnvs,
- envIdToEnvApprovalConfigMap,
+ envIdToEnvApprovalConfigurationMap,
}
})
@@ -273,7 +273,7 @@ export const AppConfig = ({ appName, resourceKind, filteredEnvIds }: AppConfigPr
useEffect(() => {
if (appConfigData) {
// SET APP CONFIG DATA IN STATE
- const [configStatusRes, workflowRes, { updatedEnvs, envIdToEnvApprovalConfigMap }] = appConfigData
+ const [configStatusRes, workflowRes, { updatedEnvs, envIdToEnvApprovalConfigurationMap }] = appConfigData
const { navItems, isCDPipeline, isCiPipeline, configs, redirectUrl, lastConfiguredStage } =
processConfigStatusData(configStatusRes.result)
@@ -292,7 +292,7 @@ export const AppConfig = ({ appName, resourceKind, filteredEnvIds }: AppConfigPr
canDeleteApp: workflowRes.result.workflows.length === 0,
workflowsRes: workflowRes.result,
environmentList: updatedEnvs,
- envIdToEnvApprovalConfigMap,
+ envIdToEnvApprovalConfigurationMap,
})
if (location.pathname === match.url) {
history.replace(redirectUrl)
@@ -371,11 +371,11 @@ export const AppConfig = ({ appName, resourceKind, filteredEnvIds }: AppConfigPr
const reloadEnvironments = () => {
fetchEnvironments()
- .then(({ updatedEnvs, envIdToEnvApprovalConfigMap }) => {
+ .then(({ updatedEnvs, envIdToEnvApprovalConfigurationMap }) => {
setState((prevState) => ({
...prevState,
environmentList: updatedEnvs,
- envIdToEnvApprovalConfigMap,
+ envIdToEnvApprovalConfigurationMap,
}))
})
.catch((errors) => {
diff --git a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/AppConfig.types.ts b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/AppConfig.types.ts
index 89d4eedf6b..67fdc70f35 100644
--- a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/AppConfig.types.ts
+++ b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/AppConfig.types.ts
@@ -44,7 +44,6 @@ export enum STAGE_NAME {
SECRETS = 'SECRETS',
ENV_OVERRIDE = 'ENV_OVERRIDE',
EXTERNAL_LINKS = 'EXTERNAL_LINKS',
- // PROTECT_CONFIGURATION = 'PROTECT_CONFIGURATION',
REDIRECT_ITEM = 'REDIRECT_ITEM',
}
@@ -93,7 +92,7 @@ export interface AppConfigState {
workflowsRes?: WorkflowResult
/** Array containing environments data. */
environmentList?: AppEnvironment[]
- envIdToEnvApprovalConfigMap: ResourceIdToResourceApprovalPolicyConfigMapType
+ envIdToEnvApprovalConfigurationMap: ResourceIdToResourceApprovalPolicyConfigMapType
/** The environment config containing the loading state, configState and title of deployment template, configmaps & secrets. */
envConfig: EnvConfigurationState
}
@@ -158,7 +157,7 @@ interface CommonAppConfigurationProps {
export interface AppConfigurationContextType
extends CommonAppConfigurationProps,
- Pick {
+ Pick {
isUnlocked: AppStageUnlockedType
navItems: CustomNavItemsType[]
isCiPipeline: boolean
@@ -167,7 +166,7 @@ export interface AppConfigurationContextType
workflowsRes: WorkflowResult
setRepoState: React.Dispatch>
isJobView: boolean
- envIdToEnvApprovalConfigMap: ResourceIdToResourceApprovalPolicyConfigMapType
+ envIdToEnvApprovalConfigurationMap: ResourceIdToResourceApprovalPolicyConfigMapType
lastUnlockedStage: string
isWorkflowEditorUnlocked: boolean
getRepo: string
@@ -204,7 +203,7 @@ export interface EnvironmentOptionType {
id: number
}
-export interface EnvConfigurationsNavProps extends Pick {
+export interface EnvConfigurationsNavProps extends Pick {
envConfig: EnvConfigurationState
fetchEnvConfig: (envId: number) => void
environments: EnvironmentOptionType[]
@@ -245,7 +244,7 @@ export interface DeploymentConfigParams {
}
export type DeploymentConfigCompareProps = {
- appOrEnvIdToAppOrEnvApprovalConfigMap: AppConfigState['envIdToEnvApprovalConfigMap']
+ appOrEnvIdToResourceApprovalConfigurationMap: AppConfigState['envIdToEnvApprovalConfigurationMap']
environments: EnvironmentOptionType[]
goBackURL?: string
getNavItemHref: (resourceType: EnvResourceType, resourceName: string) => string
diff --git a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/AppConfiguration.provider.tsx b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/AppConfiguration.provider.tsx
index bf5df55e21..36206cafc2 100644
--- a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/AppConfiguration.provider.tsx
+++ b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/AppConfiguration.provider.tsx
@@ -68,7 +68,7 @@ export const AppConfigurationProvider = (props: AppConfigurationProviderProps) =
environments: state.environmentList,
userRole,
setRepoState: setShowRepoOnDelete,
- envIdToEnvApprovalConfigMap: state.envIdToEnvApprovalConfigMap,
+ envIdToEnvApprovalConfigurationMap: state.envIdToEnvApprovalConfigurationMap,
filteredEnvIds,
reloadAppConfig,
lastUnlockedStage: state.redirectionUrl,
diff --git a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/AppComposeRouter.tsx b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/AppComposeRouter.tsx
index ec649fb6d6..306c4eec32 100644
--- a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/AppComposeRouter.tsx
+++ b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/AppComposeRouter.tsx
@@ -93,12 +93,12 @@ const AppComposeRouter = () => {
lastUnlockedStage,
envConfig,
fetchEnvConfig,
- envIdToEnvApprovalConfigMap,
+ envIdToEnvApprovalConfigurationMap,
} = useAppConfigurationContext()
const { currentAppName } = useAppContext()
const approvalConfigMapForBaseConfiguration =
- envIdToEnvApprovalConfigMap?.[BASE_CONFIGURATION_ENV_ID]?.approvalConfigurationMap
+ envIdToEnvApprovalConfigurationMap?.[BASE_CONFIGURATION_ENV_ID]?.approvalConfigurationMap
const renderJobViewRoutes = (): JSX.Element => (
// currently the logic for redirection to next unlocked stage is in respondOnSuccess function can be done for MaterialList also
@@ -171,7 +171,7 @@ const AppComposeRouter = () => {
fetchEnvConfig={fetchEnvConfig}
onErrorRedirectURL={lastUnlockedStage}
appName={currentAppName}
- appOrEnvIdToAppOrEnvApprovalConfigMap={envIdToEnvApprovalConfigMap}
+ appOrEnvIdToResourceApprovalConfigurationMap={envIdToEnvApprovalConfigurationMap}
/>
)}
,
@@ -289,7 +289,7 @@ const AppComposeRouter = () => {
fetchEnvConfig={fetchEnvConfig}
onErrorRedirectURL={lastUnlockedStage}
appName={currentAppName}
- appOrEnvIdToAppOrEnvApprovalConfigMap={envIdToEnvApprovalConfigMap}
+ appOrEnvIdToResourceApprovalConfigurationMap={envIdToEnvApprovalConfigurationMap}
/>
)}
,
@@ -322,7 +322,7 @@ const AppComposeRouter = () => {
getNavItemHref={(resourceType, resourceName) =>
`${generatePath(match.path, { ...match.params, resourceType, resourceName })}${location.search}`
}
- appOrEnvIdToAppOrEnvApprovalConfigMap={envIdToEnvApprovalConfigMap}
+ appOrEnvIdToResourceApprovalConfigurationMap={envIdToEnvApprovalConfigurationMap}
/>
)
}}
diff --git a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/ConfigToolbar.tsx b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/ConfigToolbar.tsx
index 2f1bcd8e18..2faef7f7a3 100644
--- a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/ConfigToolbar.tsx
+++ b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/ConfigToolbar.tsx
@@ -96,6 +96,9 @@ const ConfigToolbar = ({
isApprovalPolicyConfigured = false,
isApprovalPending,
isDraftPresent,
+ draftId,
+ draftVersionId,
+ handleReload,
userApprovalMetadata,
disableAllActions = false,
parsingError = '',
@@ -209,7 +212,12 @@ const ConfigToolbar = ({
return (
<>
{shouldRenderApproverInfoTippy && (
-
+
)}
{shouldRenderCommentsView && (
{
// HOOKS
const { push } = useHistory()
@@ -110,7 +109,7 @@ export const DeploymentConfigCompare = ({
[type, compareWith, compareTo, appId, envId, environments],
)
const isBaseConfigProtected =
- appOrEnvIdToAppOrEnvApprovalConfigMap?.[BASE_CONFIGURATION_ENV_ID]?.isApprovalApplicable
+ appOrEnvIdToResourceApprovalConfigurationMap?.[BASE_CONFIGURATION_ENV_ID]?.isApprovalApplicable
// STATES
const [selectedTab, setSelectedTab] = useState(
@@ -435,7 +434,7 @@ export const DeploymentConfigCompare = ({
const renderEnvironmentConfigTypeSelectorProps = (isCompare?: boolean) => {
const identifier = getIdentifierForApprovalConfig(isCompare)
const isEnvProtected =
- appOrEnvIdToAppOrEnvApprovalConfigMap?.[identifier]?.isApprovalApplicable ?? isBaseConfigProtected
+ appOrEnvIdToResourceApprovalConfigurationMap?.[identifier]?.isApprovalApplicable ?? isBaseConfigProtected
return {
id: `environment-config-type-selector-${isCompare ? 'compare' : 'current'}`,
@@ -482,7 +481,8 @@ export const DeploymentConfigCompare = ({
},
...(compareWithConfigType !== AppEnvDeploymentConfigType.DEFAULT_VERSION &&
((compareEnvOptions?.previousDeployments.length ||
- appOrEnvIdToAppOrEnvApprovalConfigMap?.[getIdentifierForApprovalConfig(true)]?.isApprovalApplicable) ??
+ appOrEnvIdToResourceApprovalConfigurationMap?.[getIdentifierForApprovalConfig(true)]
+ ?.isApprovalApplicable) ??
isBaseConfigProtected)
? [
{
@@ -500,7 +500,8 @@ export const DeploymentConfigCompare = ({
text: compareTo || BASE_CONFIGURATIONS.name,
},
...(((currentEnvOptions?.previousDeployments.length ||
- appOrEnvIdToAppOrEnvApprovalConfigMap?.[getIdentifierForApprovalConfig(false)]?.isApprovalApplicable) ??
+ appOrEnvIdToResourceApprovalConfigurationMap?.[getIdentifierForApprovalConfig(false)]
+ ?.isApprovalApplicable) ??
isBaseConfigProtected
? [
{
diff --git a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentTemplate/DeploymentTemplate.tsx b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentTemplate/DeploymentTemplate.tsx
index e7c2c6314e..6764a71108 100644
--- a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentTemplate/DeploymentTemplate.tsx
+++ b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentTemplate/DeploymentTemplate.tsx
@@ -1,6 +1,7 @@
import { useEffect, SyntheticEvent, useMemo, useReducer, Reducer, useRef } from 'react'
import ReactGA from 'react-ga4'
import {
+ BASE_CONFIGURATION_ENV_ID,
BaseURLParams,
ConfigurationType,
DeploymentChartVersionType,
@@ -54,7 +55,7 @@ import {
UpdateBaseDTPayloadType,
UpdateEnvironmentDTPayloadType,
} from './types'
-import { BASE_DEPLOYMENT_TEMPLATE_ENV_ID, NO_SCOPED_VARIABLES_MESSAGE } from './constants'
+import { NO_SCOPED_VARIABLES_MESSAGE } from './constants'
import DeploymentTemplateOptionsHeader from './DeploymentTemplateOptionsHeader'
import DeploymentTemplateForm from './DeploymentTemplateForm'
import DeploymentTemplateCTA from './DeploymentTemplateCTA'
@@ -704,7 +705,7 @@ const DeploymentTemplate = ({
const [draftPromiseResponse, publishedAndBaseTemplateDataResponse] = await Promise.allSettled([
getDraftByResourceName(
+appId,
- +envId || BASE_DEPLOYMENT_TEMPLATE_ENV_ID,
+ +envId || BASE_CONFIGURATION_ENV_ID,
3,
getDeploymentTemplateResourceName(environmentName),
),
@@ -793,7 +794,7 @@ const DeploymentTemplate = ({
reloadEnvironments()
const [chartRefsDataResponse, lockedKeysConfigResponse] = await Promise.allSettled([
getChartList({ appId, envId }),
- getJsonPath ? getJsonPath(appId, envId || BASE_DEPLOYMENT_TEMPLATE_ENV_ID) : Promise.resolve(null),
+ getJsonPath ? getJsonPath(appId, envId || BASE_CONFIGURATION_ENV_ID) : Promise.resolve(null),
])
if (chartRefsDataResponse.status === 'rejected') {
@@ -840,7 +841,7 @@ const DeploymentTemplate = ({
},
})
- fetchEnvConfig(+envId || BASE_DEPLOYMENT_TEMPLATE_ENV_ID)
+ fetchEnvConfig(+envId || BASE_CONFIGURATION_ENV_ID)
reloadEnvironments()
await handleInitialDataLoad()
}
@@ -1530,6 +1531,9 @@ const DeploymentTemplate = ({
restoreLastSavedYAML={restoreLastSavedTemplate}
showEnableReadMeButton={isEditMode}
showDeleteOverrideDraftEmptyState={showDeleteOverrideDraftEmptyState}
+ draftId={draftTemplateData?.latestDraft?.draftId}
+ draftVersionId={draftTemplateData?.latestDraft?.draftVersionId}
+ handleReload={handleReload}
>
{!showNoPublishedVersionEmptyState && (
)}
{SaveChangesModal && showSaveChangesModal && (
& {
configHeaderTab: ConfigHeaderTabType
handleToggleScopedVariablesView: () => void
resolveScopedVariables: boolean
@@ -116,7 +116,6 @@ export type ConfigToolbarProps = {
*/
isApprovalPending?: boolean
isDraftPresent?: boolean
- userApprovalMetadata: UserApprovalMetadataType
/**
* @default - false
* If given would disable all the actions
@@ -132,6 +131,7 @@ export type ConfigToolbarProps = {
isPublishedConfigPresent?: boolean
headerMessage?: string
showDeleteOverrideDraftEmptyState: boolean
+ handleReload: () => void
} & ConfigToolbarReadMeProps
interface ConfigToolbarPopupMenuLockedConfigDataType {
diff --git a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/Navigation/AppNavigation.tsx b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/Navigation/AppNavigation.tsx
index cd756cc459..74013dcd1e 100644
--- a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/Navigation/AppNavigation.tsx
+++ b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/Navigation/AppNavigation.tsx
@@ -59,7 +59,7 @@ export const AppNavigation = () => {
fetchEnvConfig,
isUnlocked,
lastUnlockedStage,
- envIdToEnvApprovalConfigMap,
+ envIdToEnvApprovalConfigurationMap,
} = useAppConfigurationContext()
// CONSTANTS
@@ -143,7 +143,7 @@ export const AppNavigation = () => {
compareWithURL={`${path}/:envId(\\d+)?`}
showComparison={!isJobView && isUnlocked.workflowEditor}
isCMSecretLocked={!isUnlocked.workflowEditor}
- envIdToEnvApprovalConfigMap={envIdToEnvApprovalConfigMap}
+ envIdToEnvApprovalConfigurationMap={envIdToEnvApprovalConfigurationMap}
/>
)}
@@ -190,7 +190,7 @@ export const AppNavigation = () => {
return (
)
})}
diff --git a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/Navigation/EnvConfigurationsNav.tsx b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/Navigation/EnvConfigurationsNav.tsx
index 421e0e2475..09a5c65b09 100644
--- a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/Navigation/EnvConfigurationsNav.tsx
+++ b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/Navigation/EnvConfigurationsNav.tsx
@@ -49,7 +49,7 @@ export const EnvConfigurationsNav = ({
isCMSecretLocked,
hideEnvSelector,
compareWithURL,
- envIdToEnvApprovalConfigMap,
+ envIdToEnvApprovalConfigurationMap,
}: EnvConfigurationsNavProps) => {
// HOOKS
const history = useHistory()
@@ -124,11 +124,11 @@ export const EnvConfigurationsNav = ({
config,
path,
params,
- envIdToEnvApprovalConfigMap?.[envId]?.approvalConfigurationMap,
+ envIdToEnvApprovalConfigurationMap?.[envId]?.approvalConfigurationMap,
)
setUpdatedEnvConfig(isCreate ? addUnnamedNavLink(newEnvConfig) : newEnvConfig)
}
- }, [isLoading, config, pathname, envIdToEnvApprovalConfigMap])
+ }, [isLoading, config, pathname, envIdToEnvApprovalConfigurationMap])
useEffect(() => {
if (!isLoading && config) {
diff --git a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/Navigation/EnvironmentOverrideRouter.tsx b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/Navigation/EnvironmentOverrideRouter.tsx
index 872e078890..5f5b1f3ca3 100644
--- a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/Navigation/EnvironmentOverrideRouter.tsx
+++ b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/Navigation/EnvironmentOverrideRouter.tsx
@@ -205,8 +205,8 @@ const JobEnvOverrideRoute = ({ envOverride, ciPipelines, reload, isEnvProtected
}
const EnvironmentOverrideRouter = ({
- envIdToEnvApprovalConfigMap,
-}: Pick) => {
+ envIdToEnvApprovalConfigurationMap,
+}: Pick) => {
const { pathname } = useLocation()
const { appId } = useParams<{ appId: string }>()
const previousPathName = usePrevious(pathname)
@@ -313,8 +313,11 @@ const EnvironmentOverrideRouter = ({
if (environments.length) {
return (
- {environments.map(
- (env) =>
+ {environments.map((env) => {
+ const isApprovalApplicable =
+ envIdToEnvApprovalConfigurationMap?.[env.environmentId]?.isApprovalApplicable
+
+ return (
!env.deploymentAppDeleteRequest && (
{isJobView ? (
@@ -323,21 +326,19 @@ const EnvironmentOverrideRouter = ({
envOverride={env}
ciPipelines={ciPipelines}
reload={reloadEnvData}
- isEnvProtected={
- envIdToEnvApprovalConfigMap?.[env.environmentId]?.isApprovalApplicable
- }
+ isEnvProtected={isApprovalApplicable}
/>
) : (
renderNavItem({
title: env.environmentName,
- isProtectionAllowed:
- envIdToEnvApprovalConfigMap?.[env.environmentId]?.isApprovalApplicable,
+ isProtectionAllowed: isApprovalApplicable,
href: `${URLS.APP_ENV_OVERRIDE_CONFIG}/${env.environmentId}/${EnvResourceType.DeploymentTemplate}`,
})
)}
- ),
- )}
+ )
+ )
+ })}
)
}
diff --git a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/Navigation/Navigation.helper.tsx b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/Navigation/Navigation.helper.tsx
index 0dff838151..32a7746442 100644
--- a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/Navigation/Navigation.helper.tsx
+++ b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/Navigation/Navigation.helper.tsx
@@ -26,7 +26,7 @@ const renderNavItemIcon = (isLocked: boolean, isApprovalPolicyConfigured: boolea
if (isLocked) {
return
}
- if (!isLocked && isApprovalPolicyConfigured) {
+ if (isApprovalPolicyConfigured) {
return
}
return null
diff --git a/src/Pages/Releases/Detail/Configurations/Configurations.tsx b/src/Pages/Releases/Detail/Configurations/Configurations.tsx
index fd7eb3b279..bb924d8658 100644
--- a/src/Pages/Releases/Detail/Configurations/Configurations.tsx
+++ b/src/Pages/Releases/Detail/Configurations/Configurations.tsx
@@ -46,7 +46,7 @@ export const Configurations = () => {
reloadEnvironments,
isAppListLoading,
isEnvListLoading,
- envIdToEnvApprovalConfigMap,
+ envIdToEnvApprovalConfigurationMap,
}: ReleaseConfigurationContextType = useReleaseConfigurationContext()
// ASYNC CALLS
@@ -69,7 +69,7 @@ export const Configurations = () => {
() => (environments ? environments.find(({ id }) => +envId === id) : null),
[environments, envId, isEnvListLoading],
)
- const approvalConfigForEnv = envIdToEnvApprovalConfigMap[selectedEnv?.id]?.approvalConfigurationMap
+ const approvalConfigForEnv = envIdToEnvApprovalConfigurationMap[selectedEnv?.id]?.approvalConfigurationMap
const showConfig = !!selectedApp && !!selectedEnv
// RENDERERS
@@ -85,7 +85,7 @@ export const Configurations = () => {
showDeploymentTemplate
showComparison
hideEnvSelector
- envIdToEnvApprovalConfigMap={envIdToEnvApprovalConfigMap}
+ envIdToEnvApprovalConfigurationMap={envIdToEnvApprovalConfigurationMap}
/>
@@ -169,7 +169,7 @@ export const Configurations = () => {
getNavItemHref={(resourceType, resourceName) =>
`${generatePath(match.path, { ...match.params, resourceType, resourceName })}${location.search}`
}
- appOrEnvIdToAppOrEnvApprovalConfigMap={envIdToEnvApprovalConfigMap}
+ appOrEnvIdToResourceApprovalConfigurationMap={envIdToEnvApprovalConfigurationMap}
/>
) : (
diff --git a/src/Pages/Releases/Detail/Configurations/types.ts b/src/Pages/Releases/Detail/Configurations/types.ts
index 9412c75449..fdc656c3b3 100644
--- a/src/Pages/Releases/Detail/Configurations/types.ts
+++ b/src/Pages/Releases/Detail/Configurations/types.ts
@@ -9,7 +9,7 @@ interface AppOptionType extends Omit, 'label'> {
label: string
}
-export interface ReleaseConfigurationContextType extends Pick {
+export interface ReleaseConfigurationContextType extends Pick {
environments: EnvironmentOptionType[]
applications: AppOptionType[]
reloadEnvironments: () => void
diff --git a/src/Pages/Shared/ConfigMapSecret/ConfigMapSecret.service.ts b/src/Pages/Shared/ConfigMapSecret/ConfigMapSecret.service.ts
index 5dba77f41a..7d182be219 100644
--- a/src/Pages/Shared/ConfigMapSecret/ConfigMapSecret.service.ts
+++ b/src/Pages/Shared/ConfigMapSecret/ConfigMapSecret.service.ts
@@ -181,7 +181,7 @@ export const getConfigMapSecretConfigDraftData = async ({
>) => {
try {
const res = await (getDraftByResourceName
- ? getDraftByResourceName(appId, envId ?? -1, componentType, name, abortControllerRef.current.signal)
+ ? getDraftByResourceName(appId, envId ?? -1, componentType, name, abortControllerRef)
: null)
return res ? (res.result as DraftMetadataDTO) : null
diff --git a/src/Pages/Shared/ConfigMapSecret/ConfigMapSecretContainer.tsx b/src/Pages/Shared/ConfigMapSecret/ConfigMapSecretContainer.tsx
index 66f268dcc2..f9974a4d4c 100644
--- a/src/Pages/Shared/ConfigMapSecret/ConfigMapSecretContainer.tsx
+++ b/src/Pages/Shared/ConfigMapSecret/ConfigMapSecretContainer.tsx
@@ -788,6 +788,9 @@ export const ConfigMapSecretContainer = ({
shouldMergeTemplateWithPatches={null}
parsingError={parsingError}
restoreLastSavedYAML={restoreLastSavedYAML}
+ draftId={draftData?.draftId}
+ draftVersionId={draftData?.draftVersionId}
+ handleReload={updateCMSecret}
/>
)}
{renderConfigHeaderTabContent()}
diff --git a/src/Pages/Shared/EnvironmentOverride/EnvironmentOverride.tsx b/src/Pages/Shared/EnvironmentOverride/EnvironmentOverride.tsx
index 11c3afdd00..67f0ac1c7a 100644
--- a/src/Pages/Shared/EnvironmentOverride/EnvironmentOverride.tsx
+++ b/src/Pages/Shared/EnvironmentOverride/EnvironmentOverride.tsx
@@ -47,7 +47,7 @@ const EnvironmentOverride = ({
onErrorRedirectURL,
envConfig,
fetchEnvConfig,
- appOrEnvIdToAppOrEnvApprovalConfigMap,
+ appOrEnvIdToResourceApprovalConfigurationMap,
}: EnvironmentOverrideComponentProps) => {
const isAppGroupView = !!envName
const params = useParams<{ appId: string; envId: string }>()
@@ -60,11 +60,9 @@ const EnvironmentOverride = ({
const environmentsMap = mapByKey(environments || [], 'environmentId')
const appMap = mapByKey(appList || [], 'id')
- const approvalConfigMap = (
- isAppGroupView
- ? appOrEnvIdToAppOrEnvApprovalConfigMap[+params.appId]
- : appOrEnvIdToAppOrEnvApprovalConfigMap[+params.envId]
- )?.approvalConfigurationMap
+ const approvalConfigMap =
+ appOrEnvIdToResourceApprovalConfigurationMap[+(isAppGroupView ? params.appId : params.envId)]
+ ?.approvalConfigurationMap
useEffect(() => {
if (params.envId) {
diff --git a/src/Pages/Shared/EnvironmentOverride/EnvironmentOverrides.types.ts b/src/Pages/Shared/EnvironmentOverride/EnvironmentOverrides.types.ts
index bbd8d7d48a..3a36f910e5 100644
--- a/src/Pages/Shared/EnvironmentOverride/EnvironmentOverrides.types.ts
+++ b/src/Pages/Shared/EnvironmentOverride/EnvironmentOverrides.types.ts
@@ -60,7 +60,7 @@ export interface EnvironmentOverrideComponentProps {
onErrorRedirectURL: string
envConfig: EnvConfigurationState
fetchEnvConfig: (envId: number) => void
- appOrEnvIdToAppOrEnvApprovalConfigMap: AppConfigState['envIdToEnvApprovalConfigMap']
+ appOrEnvIdToResourceApprovalConfigurationMap: AppConfigState['envIdToEnvApprovalConfigurationMap']
}
export interface CommonEnvironmentOverridesProps {
diff --git a/src/components/ApplicationGroup/AppGroup.types.ts b/src/components/ApplicationGroup/AppGroup.types.ts
index f19bfa8798..64e997d4ac 100644
--- a/src/components/ApplicationGroup/AppGroup.types.ts
+++ b/src/components/ApplicationGroup/AppGroup.types.ts
@@ -254,7 +254,7 @@ export interface ApplicationRouteType {
envAppList: ConfigAppList[]
envConfig: EnvConfigurationState
fetchEnvConfig: () => void
- appIdToAppApprovalConfigMap: AppConfigState['envIdToEnvApprovalConfigMap']
+ appIdToAppApprovalConfigMap: AppConfigState['envIdToEnvApprovalConfigurationMap']
}
export interface AppGroupFilterConfig
diff --git a/src/components/ApplicationGroup/Details/EnvironmentConfig/ApplicationRoutes.tsx b/src/components/ApplicationGroup/Details/EnvironmentConfig/ApplicationRoutes.tsx
index 45484f93a2..78e68fda5a 100644
--- a/src/components/ApplicationGroup/Details/EnvironmentConfig/ApplicationRoutes.tsx
+++ b/src/components/ApplicationGroup/Details/EnvironmentConfig/ApplicationRoutes.tsx
@@ -42,15 +42,13 @@ const ApplicationRoute = ({
({
- ...env,
- }))}
+ environments={envAppList}
goBackURL={generatePath(path, { envId })}
showDeploymentTemplate
paramToCheck="appId"
compareWithURL={path}
showComparison
- envIdToEnvApprovalConfigMap={appIdToAppApprovalConfigMap}
+ envIdToEnvApprovalConfigurationMap={appIdToAppApprovalConfigMap}
/>
diff --git a/src/components/ApplicationGroup/Details/EnvironmentConfig/EnvConfig.tsx b/src/components/ApplicationGroup/Details/EnvironmentConfig/EnvConfig.tsx
index 09634104a8..ce25277878 100644
--- a/src/components/ApplicationGroup/Details/EnvironmentConfig/EnvConfig.tsx
+++ b/src/components/ApplicationGroup/Details/EnvironmentConfig/EnvConfig.tsx
@@ -142,7 +142,7 @@ const EnvConfig = ({ filteredAppIds, envName }: AppGroupDetailDefaultType) => {
getNavItemHref={(resourceType, resourceName) =>
`${generatePath(match.path, { ...match.params, resourceType, resourceName })}${location.search}`
}
- appOrEnvIdToAppOrEnvApprovalConfigMap={appIdToAppApprovalConfigMap}
+ appOrEnvIdToResourceApprovalConfigurationMap={appIdToAppApprovalConfigMap}
/>
)
}}
@@ -170,7 +170,7 @@ const EnvConfig = ({ filteredAppIds, envName }: AppGroupDetailDefaultType) => {
envConfig={envConfig}
fetchEnvConfig={refetch}
onErrorRedirectURL={generatePath(path, { envId })}
- appOrEnvIdToAppOrEnvApprovalConfigMap={appIdToAppApprovalConfigMap}
+ appOrEnvIdToResourceApprovalConfigurationMap={appIdToAppApprovalConfigMap}
/>
) : (
diff --git a/src/components/app/details/triggerView/TriggerView.tsx b/src/components/app/details/triggerView/TriggerView.tsx
index 7ae8526210..5d4314d8f0 100644
--- a/src/components/app/details/triggerView/TriggerView.tsx
+++ b/src/components/app/details/triggerView/TriggerView.tsx
@@ -763,6 +763,7 @@ class TriggerView extends Component