@@ -62,12 +62,12 @@ export function setImageTags(request, pipelineId: number, artifactId: number) {
62
62
return post ( `${ ROUTES . IMAGE_TAGGING } /${ pipelineId } /${ artifactId } ` , request )
63
63
}
64
64
65
- const cdMaterialListModal = ( artifacts : any [ ] , offset : number , artifactId ?: number , artifactStatus ?: string ) => {
65
+ const cdMaterialListModal = ( artifacts : any [ ] , offset : number , artifactId ?: number , artifactStatus ?: string , disableDefaultSelection ?: boolean ) => {
66
66
if ( ! artifacts || ! artifacts . length ) return [ ]
67
67
68
68
const markFirstSelected = offset === 0
69
69
const startIndex = offset
70
- let isImageMarked = false
70
+ let isImageMarked = disableDefaultSelection
71
71
72
72
const materials = artifacts . map ( ( material , index ) => {
73
73
let artifactStatusValue = ''
@@ -178,8 +178,8 @@ const processCDMaterialsMetaInfo = (cdMaterialsResult): CDMaterialsMetaInfo => {
178
178
}
179
179
180
180
return {
181
- appReleaseTagNames : cdMaterialsResult . appReleaseTagNames ,
182
- tagsEditable : cdMaterialsResult . tagsEditable ,
181
+ appReleaseTagNames : cdMaterialsResult . appReleaseTagNames ?? [ ] ,
182
+ tagsEditable : cdMaterialsResult . tagsEditable ?? false ,
183
183
hideImageTaggingHardDelete : cdMaterialsResult . hideImageTaggingHardDelete ,
184
184
resourceFilters : cdMaterialsResult . resourceFilters ?? [ ] ,
185
185
totalCount : cdMaterialsResult . totalCount ?? 0 ,
@@ -201,11 +201,12 @@ const processImagePromotionInfo = (cdMaterialsResult): ImagePromotionMaterialInf
201
201
}
202
202
}
203
203
204
- const processCDMaterialServiceResponse = (
204
+ export const processCDMaterialServiceResponse = (
205
205
cdMaterialsResult ,
206
206
stage : DeploymentNodeType ,
207
207
offset : number ,
208
208
filter : CDMaterialFilterQuery ,
209
+ disableDefaultSelection ?: boolean ,
209
210
) : CDMaterialResponseType => {
210
211
if ( ! cdMaterialsResult ) {
211
212
return {
@@ -221,6 +222,7 @@ const processCDMaterialServiceResponse = (
221
222
offset ?? 0 ,
222
223
cdMaterialsResult . latest_wf_artifact_id ,
223
224
cdMaterialsResult . latest_wf_artifact_status ,
225
+ disableDefaultSelection ,
224
226
)
225
227
const approvalInfo = processCDMaterialsApprovalInfo (
226
228
stage === DeploymentNodeType . CD || stage === DeploymentNodeType . APPROVAL ,
@@ -251,7 +253,7 @@ const getSanitizedQueryParams = (queryParams: CDMaterialServiceQueryParams): CDM
251
253
export const genericCDMaterialsService = (
252
254
serviceType : CDMaterialServiceEnum ,
253
255
/**
254
- * In case of hotfix would be sending it as null
256
+ * In case of multiple candidates are there like promotion, would be sending it as null
255
257
*/
256
258
cdMaterialID : number ,
257
259
/**
@@ -274,7 +276,6 @@ export const genericCDMaterialsService = (
274
276
// Directly sending queryParams since do not need to get queryParams sanitized in case of image promotion
275
277
URL = getUrlWithSearchParams ( ROUTES . APP_ARTIFACT_PROMOTE_MATERIAL , queryParams )
276
278
break
277
-
278
279
// Meant for handling getCDMaterialList
279
280
default :
280
281
URL = getUrlWithSearchParams ( `${ ROUTES . CD_MATERIAL_GET } /${ cdMaterialID } /material` , {
0 commit comments