Skip to content

Commit df504b3

Browse files
committed
Merge branch 'develop' of https://github.com/devtron-labs/dashboard into feat/command-bar
2 parents 767f565 + 9b03cad commit df504b3

File tree

113 files changed

+8997
-10198
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+8997
-10198
lines changed

.eslintignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*.test.tsx
55
.eslintrc.js
66
vite.config.mts
7+
scripts/
78

89
# The following files have eslint errors/warnings
910
src/Pages/GlobalConfigurations/Authorization/APITokens/__tests__/ApiTokens.test.tsx
@@ -101,10 +102,7 @@ src/components/app/details/testViewer/TestRunDetails.tsx
101102
src/components/app/details/testViewer/TestRunList.tsx
102103
src/components/app/details/triggerView/EmptyStateCIMaterial.tsx
103104
src/components/app/details/triggerView/MaterialSource.tsx
104-
src/components/app/details/triggerView/TriggerView.tsx
105105
src/components/app/details/triggerView/__tests__/triggerview.test.tsx
106-
src/components/app/details/triggerView/cdMaterial.tsx
107-
src/components/app/details/triggerView/ciMaterial.tsx
108106
src/components/app/details/triggerView/ciWebhook.service.ts
109107
src/components/app/details/triggerView/config.ts
110108
src/components/app/details/triggerView/workflow.service.ts

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,6 @@ yalc.lock
5252
!.yarn/sdks
5353
!.yarn/versions
5454
.pnp.*
55+
56+
.env.secrets
57+
scripts/

index.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
@import url('https://fonts.googleapis.com/css2?family=Inconsolata&display=swap');
33
@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@300;400;700;900&display=swap');
44
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap');
5+
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:[email protected]&display=swap');
56

67
/*
78
* Although this is duplicated but this would help us with consistent loader in case

package.json

Lines changed: 2 additions & 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.19.0",
7+
"@devtron-labs/devtron-fe-common-lib": "1.19.0-pre-5",
88
"@esbuild-plugins/node-globals-polyfill": "0.2.3",
99
"@rjsf/core": "^5.13.3",
1010
"@rjsf/utils": "^5.13.3",
@@ -48,6 +48,7 @@
4848
"lint": "tsc --noEmit && eslint 'src/**/*.{js,jsx,ts,tsx}' --max-warnings 0",
4949
"lint-fix": "eslint 'src/**/*.{js,jsx,ts,tsx}' --fix",
5050
"start": "vite --open",
51+
"dev": "node scripts/secrets-mgr.js",
5152
"build": "NODE_OPTIONS=--max_old_space_size=8192 vite build",
5253
"serve": "vite preview",
5354
"build-light": "NODE_OPTIONS=--max_old_space_size=8192 GENERATE_SOURCEMAP=false vite build",

src/Pages/ChartStore/ChartDetails/ChartDetailsAbout.tsx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -134,16 +134,18 @@ export const ChartDetailsAbout = ({ chartDetails, isLoading }: ChartDetailsAbout
134134
return (
135135
<div className="flexbox-col dc__gap-20 mw-none">
136136
<div className="flexbox-col dc__gap-12">
137-
<ImageWithFallback
138-
imageProps={{
139-
src: icon,
140-
alt: 'chart-icon',
141-
className: 'br-6',
142-
height: 48,
143-
width: 48,
144-
}}
145-
fallbackImage={<Icon name="ic-helm" color="N700" size={48} />}
146-
/>
137+
<div className="h-48 dc__mxw-200">
138+
<ImageWithFallback
139+
imageProps={{
140+
src: icon,
141+
alt: 'chart-icon',
142+
className: 'br-6',
143+
height: '100%',
144+
width: 'auto',
145+
}}
146+
fallbackImage={<Icon name="ic-helm" color="N700" size={48} />}
147+
/>
148+
</div>
147149
<h2 className="m-0 fs-16 lh-24 fw-6 cn-9">{name}</h2>
148150
<p className="m-0 fs-13 lh-20 cn-9">{description}</p>
149151
</div>

src/components/ApplicationGroup/AppGroup.types.ts

Lines changed: 44 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,27 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { Dispatch, SetStateAction } from 'react'
1817
import { MultiValue } from 'react-select'
1918

2019
import {
2120
ACTION_STATE,
2221
AppInfoListType,
23-
ApprovalConfigDataType,
24-
CDModalTabType,
22+
CIMaterialType,
2523
CommonNodeAttr,
2624
DeploymentNodeType,
27-
DeploymentStrategyTypeWithDefault,
28-
FilterConditionsListType,
2925
GVKType,
3026
MODAL_TYPE,
3127
OptionType,
32-
PipelineIdsVsDeploymentStrategyMap,
3328
ResponseType,
3429
RuntimePluginVariables,
30+
ServerErrors,
31+
TriggerBlockedInfo,
3532
UseUrlFiltersReturnType,
36-
WorkflowNodeType,
3733
WorkflowType,
3834
} from '@devtron-labs/devtron-fe-common-lib'
3935

40-
import { TIME_STAMP_ORDER } from '@Components/app/details/triggerView/Constants'
41-
import { CDMaterialProps, RuntimeParamsErrorState, WebhookPayloadType } from '@Components/app/details/triggerView/types'
36+
import { GitInfoMaterialProps } from '@Components/app/details/triggerView/BuildImageModal/types'
37+
import { DeployImageContentProps } from '@Components/app/details/triggerView/DeployImageModal/types'
4238
import {
4339
AppConfigState,
4440
EnvConfigurationsNavProps,
@@ -50,58 +46,60 @@ import { WorkloadCheckType } from '../v2/appDetails/sourceInfo/scaleWorkloads/sc
5046
import { AppFilterTabs, BulkResponseStatus } from './Constants'
5147

5248
interface BulkTriggerAppDetailType {
53-
workFlowId: string
5449
appId: number
5550
name: string
5651
material?: any[]
5752
warningMessage?: string
5853
}
5954

6055
export interface BulkCIDetailType extends BulkTriggerAppDetailType {
61-
ciPipelineName: string
62-
ciPipelineId: string
63-
isFirstTrigger: boolean
64-
isCacheAvailable: boolean
65-
isLinkedCI: boolean
66-
isLinkedCD: boolean
67-
title: string
68-
isJobCI: boolean
69-
isWebhookCI: boolean
70-
parentAppId: number
71-
parentCIPipelineId: number
56+
workflowId: string
57+
material: CIMaterialType[]
58+
runtimeParams: RuntimePluginVariables[]
59+
node: CommonNodeAttr
7260
errorMessage: string
73-
hideSearchHeader: boolean
61+
runtimeParamsInitialError: ServerErrors | null
62+
materialInitialError: ServerErrors | null
7463
filteredCIPipelines: any
64+
ciConfiguredGitMaterialId: WorkflowType['ciConfiguredGitMaterialId']
65+
runtimeParamsErrorState: GitInfoMaterialProps['runtimeParamsErrorState']
66+
ignoreCache: boolean
67+
}
68+
69+
export type BulkCDDetailDerivedFromNode = Required<
70+
Pick<
71+
DeployImageContentProps,
72+
| 'pipelineId'
73+
| 'appId'
74+
| 'parentEnvironmentName'
75+
| 'isTriggerBlockedDueToPlugin'
76+
| 'configurePluginURL'
77+
| 'triggerType'
78+
| 'appName'
79+
>
80+
> & {
81+
stageNotAvailable: boolean
82+
errorMessage: string
83+
triggerBlockedInfo: TriggerBlockedInfo
84+
consequence: CommonNodeAttr['pluginBlockState']
85+
showPluginWarning: CommonNodeAttr['showPluginWarning']
7586
}
7687

88+
export type BulkCDDetailType = BulkCDDetailDerivedFromNode &
89+
Pick<DeployImageContentProps, 'materialResponse' | 'deploymentWindowMetadata' | 'deployViewState'> & {
90+
/**
91+
* True in cases when we reload materials on single app
92+
*/
93+
areMaterialsLoading: boolean
94+
materialError: ServerErrors | null
95+
tagsWarningMessage: string
96+
}
97+
7798
export interface BulkCDDetailTypeResponse {
7899
bulkCDDetailType: BulkCDDetailType[]
79100
uniqueReleaseTags: string[]
80101
}
81102

82-
export interface BulkCDDetailType
83-
extends BulkTriggerAppDetailType,
84-
Pick<CDMaterialProps, 'isTriggerBlockedDueToPlugin' | 'configurePluginURL' | 'consequence'>,
85-
Partial<Pick<CommonNodeAttr, 'showPluginWarning' | 'triggerBlockedInfo'>> {
86-
cdPipelineName?: string
87-
cdPipelineId?: string
88-
stageType?: DeploymentNodeType
89-
triggerType?: string
90-
envName: string
91-
envId: number
92-
parentPipelineId?: string
93-
parentPipelineType?: WorkflowNodeType
94-
parentEnvironmentName?: string
95-
approvalConfigData?: ApprovalConfigDataType
96-
requestedUserId?: number
97-
appReleaseTags?: string[]
98-
tagsEditable?: boolean
99-
ciPipelineId?: number
100-
hideImageTaggingHardDelete?: boolean
101-
resourceFilters?: FilterConditionsListType[]
102-
isExceptionUser?: boolean
103-
}
104-
105103
export type TriggerVirtualEnvResponseRowType =
106104
| {
107105
isVirtual: true
@@ -123,61 +121,6 @@ export type ResponseRowType = {
123121
envId?: number
124122
} & TriggerVirtualEnvResponseRowType
125123

126-
interface BulkRuntimeParamsType {
127-
runtimeParams: Record<string, RuntimePluginVariables[]>
128-
setRuntimeParams: React.Dispatch<React.SetStateAction<Record<string, RuntimePluginVariables[]>>>
129-
runtimeParamsErrorState: Record<string, RuntimeParamsErrorState>
130-
setRuntimeParamsErrorState: React.Dispatch<React.SetStateAction<Record<string, RuntimeParamsErrorState>>>
131-
}
132-
133-
export interface BulkCITriggerType extends BulkRuntimeParamsType {
134-
appList: BulkCIDetailType[]
135-
closePopup: (e) => void
136-
updateBulkInputMaterial: (materialList: Record<string, any[]>) => void
137-
onClickTriggerBulkCI: (appIgnoreCache: Record<number, boolean>, appsToRetry?: Record<string, boolean>) => void
138-
getWebhookPayload: (id, webhookTimeStampOrder?: typeof TIME_STAMP_ORDER) => void
139-
webhookPayloads: WebhookPayloadType
140-
setWebhookPayloads: React.Dispatch<React.SetStateAction<WebhookPayloadType>>
141-
isWebhookPayloadLoading: boolean
142-
isShowRegexModal: (_appId: number, ciNodeId: number, inputMaterialList: any[]) => boolean
143-
responseList: ResponseRowType[]
144-
isLoading: boolean
145-
setLoading: React.Dispatch<React.SetStateAction<boolean>>
146-
setPageViewType: React.Dispatch<React.SetStateAction<string>>
147-
}
148-
149-
export interface BulkCDTriggerType extends BulkRuntimeParamsType {
150-
stage: DeploymentNodeType
151-
appList: BulkCDDetailType[]
152-
closePopup: (e) => void
153-
updateBulkInputMaterial: (materialList: Record<string, any>) => void
154-
onClickTriggerBulkCD: (
155-
skipIfHibernated: boolean,
156-
pipelineIdVsStrategyMap: PipelineIdsVsDeploymentStrategyMap,
157-
appsToRetry?: Record<string, boolean>,
158-
) => void
159-
changeTab?: (
160-
materrialId: string | number,
161-
artifactId: number,
162-
tab: CDModalTabType,
163-
selectedCDDetail?: { id: number; type: DeploymentNodeType },
164-
) => void
165-
toggleSourceInfo?: (materialIndex: number, selectedCDDetail?: { id: number; type: DeploymentNodeType }) => void
166-
selectImage?: (
167-
index: number,
168-
materialType: string,
169-
selectedCDDetail?: { id: number; type: DeploymentNodeType },
170-
) => void
171-
responseList: ResponseRowType[]
172-
isLoading: boolean
173-
setLoading: React.Dispatch<React.SetStateAction<boolean>>
174-
isVirtualEnv?: boolean
175-
uniqueReleaseTags: string[]
176-
feasiblePipelineIds: Set<number>
177-
bulkDeploymentStrategy: DeploymentStrategyTypeWithDefault
178-
setBulkDeploymentStrategy: Dispatch<SetStateAction<DeploymentStrategyTypeWithDefault>>
179-
}
180-
181124
export interface ProcessWorkFlowStatusType {
182125
cicdInProgress: boolean
183126
workflows: WorkflowType[]
@@ -211,15 +154,11 @@ export interface TriggerResponseModalBodyProps {
211154

212155
type RetryFailedType =
213156
| {
214-
onClickRetryDeploy: BulkCDTriggerType['onClickTriggerBulkCD']
215-
skipHibernatedApps: boolean
216-
pipelineIdVsStrategyMap: PipelineIdsVsDeploymentStrategyMap
157+
onClickRetryDeploy: (appsToRetry: Record<string, boolean>) => void
217158
onClickRetryBuild?: never
218159
}
219160
| {
220161
onClickRetryDeploy?: never
221-
skipHibernatedApps?: never
222-
pipelineIdVsStrategyMap?: never
223162
onClickRetryBuild: (appsToRetry: Record<string, boolean>) => void
224163
}
225164

@@ -233,11 +172,6 @@ export interface TriggerModalRowType {
233172
isVirtualEnv?: boolean
234173
}
235174

236-
export interface WorkflowNodeSelectionType {
237-
id: number
238-
name: string
239-
type: WorkflowNodeType
240-
}
241175
export interface WorkflowAppSelectionType {
242176
id: number
243177
name: string

src/components/ApplicationGroup/AppGroup.utils.ts

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -96,28 +96,37 @@ export const processWorkflowStatuses = (
9696
}
9797
})
9898
}
99-
// Update Workflow using maps
100-
const _workflows = workflowsList.map((wf) => {
101-
wf.nodes = wf.nodes.map((node) => {
99+
// Update Workflow using maps, returning new objects for reactivity
100+
const _workflows = workflowsList.map((wf) => ({
101+
...wf,
102+
nodes: wf.nodes.map((node) => {
102103
switch (node.type) {
103104
case 'CI':
104-
node.status = ciMap[node.id]?.status
105-
node.storageConfigured = ciMap[node.id]?.storageConfigured
106-
break
105+
return {
106+
...node,
107+
status: ciMap[node.id]?.status,
108+
storageConfigured: ciMap[node.id]?.storageConfigured,
109+
}
107110
case 'PRECD':
108-
node.status = preCDMap[node.id]
109-
break
111+
return {
112+
...node,
113+
status: preCDMap[node.id],
114+
}
110115
case 'POSTCD':
111-
node.status = postCDMap[node.id]
112-
break
116+
return {
117+
...node,
118+
status: postCDMap[node.id],
119+
}
113120
case 'CD':
114-
node.status = cdMap[node.id]
115-
break
121+
return {
122+
...node,
123+
status: cdMap[node.id],
124+
}
125+
default:
126+
return { ...node }
116127
}
117-
return node
118128
})
119-
return wf
120-
})
129+
}))
121130
return { cicdInProgress, workflows: _workflows }
122131
}
123132

0 commit comments

Comments
 (0)