Skip to content

Commit 782339f

Browse files
committed
fix: review comments
1 parent bcc6d69 commit 782339f

File tree

15 files changed

+39
-78
lines changed

15 files changed

+39
-78
lines changed

src/Common/Common.service.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
import { MutableRefObject } from 'react'
1818
import moment from 'moment'
19-
import { sanitizeApprovalConfigData, sanitizeUserApprovalConfig, sanitizeUserApprovalList } from '@Shared/Helpers'
19+
import { sanitizeApprovalConfigData, sanitizeUserApprovalList } from '@Shared/Helpers'
2020
import { PolicyBlockInfo, RuntimeParamsAPIResponseType, RuntimePluginVariables } from '@Shared/types'
2121
import { get, post } from './Api'
2222
import { GitProviderType, ROUTES } from './Constants'
@@ -228,14 +228,12 @@ const processCDMaterialsApprovalInfo = (enableApproval: boolean, cdMaterialsResu
228228
return {
229229
canApproverDeploy: cdMaterialsResult?.canApproverDeploy ?? false,
230230
deploymentApprovalInfo: null,
231-
userApprovalConfig: null,
232231
}
233232
}
234233

235234
return {
236235
canApproverDeploy: cdMaterialsResult.canApproverDeploy ?? false,
237236
deploymentApprovalInfo: sanitizeDeploymentApprovalInfo(cdMaterialsResult.deploymentApprovalInfo),
238-
userApprovalConfig: sanitizeUserApprovalConfig(cdMaterialsResult.userApprovalConfig)
239237
}
240238
}
241239

src/Common/Hooks/useUrlFilters/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,3 @@
1616

1717
export { default as useUrlFilters } from './useUrlFilters'
1818
export type { UseUrlFiltersProps, UseUrlFiltersReturnType } from './types'
19-
export { parseAllSearchParamsForUseUrlFilters } from './utils'

src/Common/Hooks/useUrlFilters/utils.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,3 @@ export const setItemInLocalStorageIfKeyExists = (localStorageKey: string, value:
33
localStorage.setItem(localStorageKey, value)
44
}
55
}
6-
7-
export const parseAllSearchParamsForUseUrlFilters = <T,>(params: URLSearchParams) =>
8-
Array.from(params.entries()).reduce((acc, [key, value]) => {
9-
acc[key] = value
10-
return acc
11-
}, {} as T)

src/Common/Types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,6 @@ export interface DeploymentApprovalInfoType {
744744
export interface CDMaterialsApprovalInfo {
745745
canApproverDeploy: boolean
746746
deploymentApprovalInfo: DeploymentApprovalInfoType
747-
userApprovalConfig: UserApprovalConfigType | null
748747
}
749748

750749
export interface CDMaterialsMetaInfo {
Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
import { DeploymentNodeType } from '@Common/Types'
2+
13
export const STAGE_MAP = {
2-
PRECD: 'PRE',
3-
CD: 'DEPLOY',
4-
POSTCD: 'POST',
5-
APPROVAL: 'APPROVAL',
6-
}
4+
[DeploymentNodeType.PRECD]: 'PRE',
5+
[DeploymentNodeType.CD]: 'DEPLOY',
6+
[DeploymentNodeType.POSTCD]: 'POST',
7+
[DeploymentNodeType.APPROVAL]: 'APPROVAL',
8+
} as const

src/Pages/Applications/DevtronApps/Details/CDPipeline/types.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { BuildStageType, FormType } from '@Common/CIPipeline.Types'
2-
import { DeploymentAppTypes, DeploymentNodeType } from '@Common/Types'
2+
import { APIOptions, DeploymentAppTypes, DeploymentNodeType } from '@Common/Types'
3+
import { STAGE_MAP } from '@Pages/index'
34
import { DeploymentStrategy } from '@Shared/Components'
45
import { EnvListMinDTO, RuntimeParamsTriggerPayloadType } from '@Shared/types'
5-
import { MutableRefObject } from 'react'
66

77
interface ConfigSecretType {
88
label: string
@@ -107,14 +107,13 @@ export interface SelectedResourceType {
107107
clusterName?: string
108108
}
109109

110-
export interface TriggerCDNodeServiceProps {
110+
export interface TriggerCDNodeServiceProps extends Pick<APIOptions, 'abortControllerRef'> {
111111
pipelineId: number
112112
ciArtifactId: number
113113
appId: number
114114
stageType: DeploymentNodeType
115115
deploymentWithConfig?: string
116116
wfrId?: number
117-
abortControllerRef?: MutableRefObject<AbortController>
118117
/**
119118
* Would be available only case of PRE/POST CD
120119
*/
@@ -126,6 +125,6 @@ export interface TriggerCDPipelinePayloadType
126125
TriggerCDNodeServiceProps,
127126
'pipelineId' | 'appId' | 'ciArtifactId' | 'runtimeParamsPayload' | 'deploymentWithConfig'
128127
> {
129-
cdWorkflowType: string
128+
cdWorkflowType: (typeof STAGE_MAP)[keyof typeof STAGE_MAP]
130129
wfrIdForDeploymentWithSpecificTrigger?: number
131130
}

src/Pages/ResourceBrowser/service.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { post, trash } from '@Common/Api'
22
import { ROUTES } from '@Common/Constants'
3-
import { ResponseType } from '@Common/Types'
4-
import { MutableRefObject } from 'react'
3+
import { APIOptions, ResponseType } from '@Common/Types'
54
import {
65
CreateResourceDTO,
76
CreateResourcePayload,
@@ -26,10 +25,10 @@ export const createNewResource = (
2625

2726
export const deleteResource = (
2827
resourceListPayload: ResourceListPayloadType,
29-
abortControllerRef?: MutableRefObject<AbortController>,
28+
abortControllerRef?: APIOptions['abortControllerRef'],
3029
): Promise<ResponseType<ResourceType[]>> => post(ROUTES.DELETE_RESOURCE, resourceListPayload, { abortControllerRef })
3130

3231
export const deleteNodeCapacity = (
3332
requestPayload: NodeActionRequest,
34-
abortControllerRef?: MutableRefObject<AbortController>,
33+
abortControllerRef?: APIOptions['abortControllerRef'],
3534
): Promise<ResponseType> => trash(ROUTES.NODE_CAPACITY, requestPayload, { abortControllerRef })

src/Shared/Components/BulkOperations/BulkOperations.component.tsx

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -170,22 +170,20 @@ const BulkOperations = ({
170170

171171
const renderConfirmationDialog = () => (
172172
<ConfirmationModal
173-
{...{
174-
...confirmationModalConfig,
175-
handleClose: handleModalClose,
176-
showConfirmationModal: true,
177-
buttonConfig: {
178-
primaryButtonConfig: {
179-
...confirmationModalConfig.buttonConfig.primaryButtonConfig,
180-
onClick: handleBulkOperations,
181-
disabled: apiCallInProgress,
182-
isLoading: apiCallInProgress,
183-
},
184-
secondaryButtonConfig: {
185-
...confirmationModalConfig.buttonConfig.secondaryButtonConfig,
186-
onClick: handleModalClose,
187-
disabled: apiCallInProgress,
188-
},
173+
{...confirmationModalConfig}
174+
handleClose={handleModalClose}
175+
showConfirmationModal
176+
buttonConfig={{
177+
primaryButtonConfig: {
178+
...confirmationModalConfig.buttonConfig.primaryButtonConfig,
179+
onClick: handleBulkOperations,
180+
disabled: apiCallInProgress,
181+
isLoading: apiCallInProgress,
182+
},
183+
secondaryButtonConfig: {
184+
...confirmationModalConfig.buttonConfig.secondaryButtonConfig,
185+
onClick: handleModalClose,
186+
disabled: apiCallInProgress,
189187
},
190188
}}
191189
/>

src/Shared/Components/BulkOperations/BulkOperationsResultModal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ const BulkOperationsResultModal = ({
118118
/>
119119
</header>
120120
<div className="flexbox-col dc__gap-16 dc__overflow-hidden pt-20 flex-grow-1 bulk-operations__results-modal__content">
121-
<div className="bulk-operations__results-modal__bar-chart ml-20 mr-20 flexbox-col">
121+
<div className="bulk-operations__results-modal__bar-chart br-8 flexbox-col dc__align-start dc__align-self-stretch dc__border bcn-0 ml-20 mr-20">
122122
<SegmentedBarChart
123123
entities={resultsStore.getBarChartEntities()}
124124
rootClassName="p-16 fs-13 dc__border-bottom-n1"
@@ -137,7 +137,7 @@ const BulkOperationsResultModal = ({
137137
</div>
138138
<div className="flexbox-col lh-20 dc__overflow-hidden">
139139
<div
140-
className="dc__grid dc__border-bottom-n1 py-10 fs-12 fw-6 cn-7 ml-20 mr-20 dc__gap-16"
140+
className="dc__grid dc__border-bottom-n1 py-8 fs-12 fw-6 cn-7 ml-20 mr-20 dc__gap-16"
141141
style={{ gridTemplateColumns }}
142142
>
143143
{modalHeaders.map((header) => (

0 commit comments

Comments
 (0)