@@ -26,7 +26,6 @@ import {
26
26
RefVariableType ,
27
27
VariableType ,
28
28
MandatoryPluginDataType ,
29
- MandatoryPluginDetailType ,
30
29
ButtonWithLoader ,
31
30
PluginDataStoreType ,
32
31
ProcessPluginDataReturnType ,
@@ -35,6 +34,11 @@ import {
35
34
getPluginsDetail ,
36
35
ErrorScreenManager ,
37
36
getUpdatedPluginStore ,
37
+ ModuleNameMap ,
38
+ SourceTypeMap ,
39
+ DEFAULT_ENV ,
40
+ getEnvironmentListMinPublic ,
41
+ ModuleStatus ,
38
42
Environment ,
39
43
PipelineFormType ,
40
44
} from '@devtron-labs/devtron-fe-common-lib'
@@ -50,11 +54,9 @@ import {
50
54
BuildStageVariable ,
51
55
BuildTabText ,
52
56
JobPipelineTabText ,
53
- ModuleNameMap ,
54
57
TriggerType ,
55
58
URLS ,
56
59
ViewType ,
57
- SourceTypeMap ,
58
60
} from '../../config'
59
61
import {
60
62
deleteCIPipeline ,
@@ -71,14 +73,11 @@ import { Sidebar } from './Sidebar'
71
73
import { Build } from './Build'
72
74
import { ReactComponent as WarningTriangle } from '../../assets/icons/ic-warning.svg'
73
75
import { getModuleInfo } from '../v2/devtronStackManager/DevtronStackManager.service'
74
- import { ModuleStatus } from '../v2/devtronStackManager/DevtronStackManager.type'
75
76
import { MULTI_REQUIRED_FIELDS_MSG } from '../../config/constantMessaging'
76
77
import { LoadingState } from '../ciConfig/types'
77
78
import { pipelineContext } from '../workflowEditor/workflowEditor'
78
79
import { calculateLastStepDetailsLogic , checkUniqueness , validateTask } from '../cdPipeline/cdpipeline.util'
79
80
import { PipelineContext , PipelineFormDataErrorType } from '../workflowEditor/types'
80
- import { getEnvironmentListMinPublic } from '../../services/service'
81
- import { DEFAULT_ENV } from '../app/details/triggerView/Constants'
82
81
83
82
const processPluginData = importComponentFromFELibrary ( 'processPluginData' , null , 'function' )
84
83
const validatePlugins = importComponentFromFELibrary ( 'validatePlugins' , null , 'function' )
@@ -203,11 +202,13 @@ export default function CIPipeline({
203
202
structuredClone ( DEFAULT_PLUGIN_DATA_STORE ) ,
204
203
)
205
204
const [ availableTags , setAvailableTags ] = useState < string [ ] > ( [ ] )
205
+ const [ hideScopedVariableWidget , setHideScopedVariableWidget ] = useState < boolean > ( false )
206
+ const [ disableParentModalClose , setDisableParentModalClose ] = useState < boolean > ( false )
206
207
207
208
const selectedBranchRef = useRef ( null )
208
209
209
- const mandatoryPluginsMap : Record < number , MandatoryPluginDetailType > = useMemo ( ( ) => {
210
- const _mandatoryPluginsMap : Record < number , MandatoryPluginDetailType > = { }
210
+ const mandatoryPluginsMap : PipelineContext [ 'mandatoryPluginsMap' ] = useMemo ( ( ) => {
211
+ const _mandatoryPluginsMap : PipelineContext [ 'mandatoryPluginsMap' ] = { }
211
212
if ( mandatoryPluginData ?. pluginData . length ) {
212
213
for ( const plugin of mandatoryPluginData . pluginData ) {
213
214
_mandatoryPluginsMap [ plugin . parentPluginId ] = plugin
@@ -224,6 +225,18 @@ export default function CIPipeline({
224
225
)
225
226
}
226
227
228
+ const handleHideScopedVariableWidgetUpdate : PipelineContext [ 'handleHideScopedVariableWidgetUpdate' ] = (
229
+ hideScopedVariableWidgetValue : boolean ,
230
+ ) => {
231
+ setHideScopedVariableWidget ( hideScopedVariableWidgetValue )
232
+ }
233
+
234
+ const handleDisableParentModalCloseUpdate : PipelineContext [ 'handleDisableParentModalCloseUpdate' ] = (
235
+ disableParentModalCloseValue : boolean ,
236
+ ) => {
237
+ setDisableParentModalClose ( disableParentModalCloseValue )
238
+ }
239
+
227
240
const handleUpdateAvailableTags : PipelineContext [ 'handleUpdateAvailableTags' ] = ( tags ) => {
228
241
setAvailableTags ( tags )
229
242
}
@@ -521,6 +534,10 @@ export default function CIPipeline({
521
534
} , [ location . pathname , ciPipeline . pipelineType ] )
522
535
523
536
const handleClose = ( ) => {
537
+ if ( disableParentModalClose ) {
538
+ return null
539
+ }
540
+
524
541
close ( )
525
542
}
526
543
@@ -737,7 +754,7 @@ export default function CIPipeline({
737
754
< NavLink
738
755
data-testid = { `${ toLink } -button` }
739
756
replace
740
- className = "tab-list__tab-link fs-13 pt-5 pb-5 flexbox"
757
+ className = "tab-list__tab-link fs-13 pt-0 pb-8 flexbox"
741
758
activeClassName = "active"
742
759
to = { toLink }
743
760
onClick = { ( ) => {
@@ -747,7 +764,7 @@ export default function CIPipeline({
747
764
{ isJobCard ? JobPipelineTabText [ stageName ] : BuildTabText [ stageName ] }
748
765
{ ( showAlert || showWarning ) && (
749
766
< WarningTriangle
750
- className = { `icon-dim-16 mr-5 ml-5 mt-3 ${
767
+ className = { `icon-dim-16 mr-5 ml-5 mt-2 ${
751
768
showAlert ? 'alert-icon-r5-imp' : 'warning-icon-y7-imp'
752
769
} `}
753
770
/>
@@ -780,6 +797,9 @@ export default function CIPipeline({
780
797
pageState,
781
798
availableTags,
782
799
handleUpdateAvailableTags,
800
+ handleHideScopedVariableWidgetUpdate,
801
+ handleDisableParentModalCloseUpdate,
802
+ mandatoryPluginsMap,
783
803
}
784
804
} , [
785
805
formData ,
@@ -792,6 +812,7 @@ export default function CIPipeline({
792
812
globalVariables ,
793
813
pluginDataStore ,
794
814
availableTags ,
815
+ mandatoryPluginsMap ,
795
816
] )
796
817
797
818
const renderCIPipelineModalContent = ( ) => {
@@ -827,7 +848,6 @@ export default function CIPipeline({
827
848
isJobCI = { isJobCI }
828
849
mandatoryPluginData = { mandatoryPluginData }
829
850
setInputVariablesListFromPrevStep = { setInputVariablesListFromPrevStep }
830
- mandatoryPluginsMap = { mandatoryPluginsMap }
831
851
environments = { environments }
832
852
selectedEnv = { selectedEnv }
833
853
setSelectedEnv = { setSelectedEnv }
@@ -837,12 +857,12 @@ export default function CIPipeline({
837
857
< Switch >
838
858
{ isAdvanced && (
839
859
< Route path = { `${ path } /pre-build` } >
840
- < PreBuild isJobView = { isJobCard } mandatoryPluginsMap = { mandatoryPluginsMap } />
860
+ < PreBuild isJobView = { isJobCard } />
841
861
</ Route >
842
862
) }
843
863
{ isAdvanced && (
844
864
< Route path = { `${ path } /post-build` } >
845
- < PreBuild mandatoryPluginsMap = { mandatoryPluginsMap } />
865
+ < PreBuild />
846
866
</ Route >
847
867
) }
848
868
< Route path = { `${ path } /build` } >
@@ -901,7 +921,7 @@ export default function CIPipeline({
901
921
isAdvanced ? 'advanced-option-container' : 'bottom-border-radius'
902
922
} `}
903
923
>
904
- < div className = "flex flex-align-center flex-justify bcn-0 py-12 pr-20 pl -20" >
924
+ < div className = "flex flex-align-center flex-justify bcn-0 py-12 px -20" >
905
925
< h2 className = "fs-16 fw-6 lh-1-43 m-0" data-testid = "build-pipeline-heading" >
906
926
{ title }
907
927
</ h2 >
@@ -917,7 +937,11 @@ export default function CIPipeline({
917
937
}
918
938
919
939
const renderFloatingVariablesWidget = ( ) => {
920
- if ( ! window . _env_ . ENABLE_SCOPED_VARIABLES || activeStageName === BuildStageVariable . Build ) {
940
+ if (
941
+ ! window . _env_ . ENABLE_SCOPED_VARIABLES ||
942
+ activeStageName === BuildStageVariable . Build ||
943
+ hideScopedVariableWidget
944
+ ) {
921
945
return < > </ >
922
946
}
923
947
0 commit comments