@@ -11,7 +11,6 @@ import {
11
11
CDMaterialType ,
12
12
CommonNodeAttr ,
13
13
ComponentSizeType ,
14
- ConditionalWrap ,
15
14
DEPLOYMENT_WINDOW_TYPE ,
16
15
DeploymentNodeType ,
17
16
ErrorScreenManager ,
@@ -49,6 +48,7 @@ import { getIsMaterialApproved } from '../cdMaterials.utils'
49
48
import { TriggerViewContext } from '../config'
50
49
import { TRIGGER_VIEW_PARAMS } from '../Constants'
51
50
import { FilterConditionViews , HandleRuntimeParamChange , TriggerViewContextType } from '../types'
51
+ import { BULK_DEPLOY_ACTIVE_IMAGE_TAG , BULK_DEPLOY_LATEST_IMAGE_TAG } from './constants'
52
52
import ImageSelectionCTA from './ImageSelectionCTA'
53
53
import MaterialListEmptyState from './MaterialListEmptyState'
54
54
import MaterialListSkeleton from './MaterialListSkeleton'
@@ -77,10 +77,6 @@ const MissingPluginBlockState = importComponentFromFELibrary('MissingPluginBlock
77
77
const PolicyEnforcementMessage = importComponentFromFELibrary ( 'PolicyEnforcementMessage' )
78
78
const TriggerBlockedError = importComponentFromFELibrary ( 'TriggerBlockedError' , null , 'function' )
79
79
80
- const renderMaterialListBodyWrapper = ( children : JSX . Element ) => (
81
- < div className = "flexbox-col py-16 px-20 dc__overflow-auto" > { children } </ div >
82
- )
83
-
84
80
const DeployImageContent = ( {
85
81
appId,
86
82
envId,
@@ -117,8 +113,6 @@ const DeployImageContent = ({
117
113
const { isSuperAdmin } = useMainContext ( )
118
114
const { onClickApprovalNode } = useContext < TriggerViewContextType > ( TriggerViewContext )
119
115
120
- const { triggerBlockedInfo, warningMessage, materialError } = appInfoMap [ appId ] || { }
121
-
122
116
const isExceptionUser = materialResponse ?. deploymentApprovalInfo ?. approvalConfigData ?. isExceptionUser ?? false
123
117
const requestedUserId = materialResponse ?. requestedUserId
124
118
const isApprovalConfigured = getIsApprovalPolicyConfigured (
@@ -140,9 +134,11 @@ const DeployImageContent = ({
140
134
app . materialResponse ?. appReleaseTagNames ?. forEach ( ( tag ) => tagNames . add ( tag ) )
141
135
} )
142
136
143
- return Array . from ( tagNames )
144
- . sort ( stringComparatorBySortOrder )
145
- . map ( ( tag ) => ( { label : tag , value : tag } ) )
137
+ return [ BULK_DEPLOY_LATEST_IMAGE_TAG , BULK_DEPLOY_ACTIVE_IMAGE_TAG ] . concat (
138
+ Array . from ( tagNames )
139
+ . sort ( stringComparatorBySortOrder )
140
+ . map ( ( tag ) => ( { label : tag , value : tag } ) ) ,
141
+ )
146
142
} , [ appInfoMap ] )
147
143
148
144
const selectedTagOption = useMemo ( ( ) => {
@@ -431,11 +427,11 @@ const DeployImageContent = ({
431
427
return < TriggerBlockedError stageType = { stageType } />
432
428
}
433
429
434
- if ( ! ! warningMessage && ! app . showPluginWarning ) {
430
+ if ( ! ! app . warningMessage && ! app . showPluginWarning ) {
435
431
return (
436
432
< div className = "flex left top dc__gap-4" >
437
433
< Icon name = "ic-warning" color = { null } size = { 14 } />
438
- < span className = "fw-4 fs-12 cy-7 dc__truncate" > { warningMessage } </ span >
434
+ < span className = "fw-4 fs-12 cy-7 dc__truncate" > { app . warningMessage } </ span >
439
435
</ div >
440
436
)
441
437
}
@@ -457,8 +453,8 @@ const DeployImageContent = ({
457
453
const renderSidebar = ( ) => {
458
454
if ( isBulkTrigger ) {
459
455
return (
460
- < div className = "flexbox-col h-100 dc__overflow-auto" >
461
- < div className = "dc__position-sticky dc__top-0 pt-12 bg__primary" >
456
+ < div className = "flexbox-col h-100 dc__overflow-auto bg__primary " >
457
+ < div className = "dc__position-sticky dc__top-0 pt-12 bg__primary dc__zi-1 " >
462
458
{ showRuntimeParams && (
463
459
< div className = "px-16 pb-8" >
464
460
< RuntimeParamTabs
@@ -477,7 +473,7 @@ const DeployImageContent = ({
477
473
{ currentSidebarTab === CDMaterialSidebarType . IMAGE && (
478
474
< >
479
475
< span className = "px-16" > Select image by release tag</ span >
480
- < div className = "tag-selection-dropdown px-16 pt-6 pb-12 dc__zi-1 " >
476
+ < div className = "tag-selection-dropdown px-16 pt-6 pb-12" >
481
477
< SelectPicker
482
478
name = "bulk-cd-trigger__select-tag"
483
479
inputId = "bulk-cd-trigger__select-tag"
@@ -494,7 +490,9 @@ const DeployImageContent = ({
494
490
</ div >
495
491
</ >
496
492
) }
497
- < span className = "dc__border-bottom fw-6 fs-13 cn-7 py-8 px-16" > APPLICATIONS</ span >
493
+ < div className = "dc__border-bottom py-8 px-16 w-100" >
494
+ < span className = "fw-6 fs-13 cn-7" > APPLICATIONS</ span >
495
+ </ div >
498
496
</ div >
499
497
500
498
{ sortedAppValues . map ( ( appDetails ) => (
@@ -681,7 +679,7 @@ const DeployImageContent = ({
681
679
const renderEmptyView = ( ) : JSX . Element => {
682
680
const selectedApp = appInfoMap [ + appId ]
683
681
684
- if ( triggerBlockedInfo ?. blockedBy === TriggerBlockType . MANDATORY_TAG ) {
682
+ if ( selectedApp . triggerBlockedInfo ?. blockedBy === TriggerBlockType . MANDATORY_TAG ) {
685
683
return < TriggerBlockEmptyState stageType = { stageType } appId = { appId } />
686
684
}
687
685
@@ -698,8 +696,14 @@ const DeployImageContent = ({
698
696
)
699
697
}
700
698
701
- if ( materialError ) {
702
- return < ErrorScreenManager code = { materialError . code } reload = { reloadMaterials } on404Redirect = { handleClose } />
699
+ if ( selectedApp . materialError ) {
700
+ return (
701
+ < ErrorScreenManager
702
+ code = { selectedApp . materialError . code }
703
+ reload = { reloadMaterials }
704
+ on404Redirect = { handleClose }
705
+ />
706
+ )
703
707
}
704
708
705
709
return (
@@ -713,7 +717,7 @@ const DeployImageContent = ({
713
717
714
718
const renderContent = ( ) => {
715
719
if ( isBulkTrigger ) {
716
- const { areMaterialsLoading } = appInfoMap [ + appId ] || { }
720
+ const { areMaterialsLoading, triggerBlockedInfo , materialError } = appInfoMap [ + appId ] || { }
717
721
if ( currentSidebarTab === CDMaterialSidebarType . IMAGE && areMaterialsLoading ) {
718
722
return < MaterialListSkeleton />
719
723
}
@@ -872,13 +876,10 @@ const DeployImageContent = ({
872
876
) }
873
877
874
878
< div
875
- className = { `flex-grow-1 dc__overflow-auto h-100 ${ isPreOrPostCD && ! isBulkTrigger ? 'display-grid cd-material__container-with-sidebar' : 'flexbox-col flex-grow-1 py-16 px-20' } ` }
879
+ className = { `flex-grow-1 dc__overflow-auto h-100 ${ isPreOrPostCD || isBulkTrigger ? 'display-grid cd-material__container-with-sidebar' : 'flexbox-col flex-grow-1 py-16 px-20' } ` }
876
880
>
877
881
{ renderSidebar ( ) }
878
-
879
- < ConditionalWrap condition = { isPreOrPostCD && ! isBulkTrigger } wrap = { renderMaterialListBodyWrapper } >
880
- { renderContent ( ) }
881
- </ ConditionalWrap >
882
+ < div className = "flexbox-col py-16 px-20 dc__overflow-auto" > { renderContent ( ) } </ div >
882
883
</ div >
883
884
</ >
884
885
)
0 commit comments