@@ -14,7 +14,6 @@ import {
14
14
VisibleModal ,
15
15
Drawer ,
16
16
DeleteDialog ,
17
- DockerConfigOverrideType ,
18
17
RefVariableType ,
19
18
VariableType ,
20
19
MandatoryPluginDataType ,
@@ -179,7 +178,6 @@ export default function CIPipeline({
179
178
} ,
180
179
} )
181
180
const validationRules = new ValidationRules ( )
182
- const [ isDockerConfigOverridden , setDockerConfigOverridden ] = useState ( false )
183
181
const [ mandatoryPluginData , setMandatoryPluginData ] = useState < MandatoryPluginDataType > ( null )
184
182
const selectedBranchRef = useRef ( null )
185
183
@@ -285,6 +283,7 @@ export default function CIPipeline({
285
283
setPageState ( ViewType . LOADING )
286
284
getSecurityModuleStatus ( )
287
285
if ( ciPipelineId ) {
286
+ // TODO: Would need to add loader for getAvailablePlugins to avoid state toggle
288
287
getInitDataWithCIPipeline ( appId , ciPipelineId , true )
289
288
. then ( ( ciResponse ) => {
290
289
const preBuildVariable = calculateLastStepDetail (
@@ -383,7 +382,10 @@ export default function CIPipeline({
383
382
} catch ( error ) { }
384
383
}
385
384
386
- const getMandatoryPluginData = ( _formData : PipelineFormType , pluginList : PluginDetailType [ ] ) : void => {
385
+ const getMandatoryPluginData = (
386
+ _formData : PipelineFormType ,
387
+ pluginList : PluginDetailType [ ] ,
388
+ ) : void => {
387
389
if ( ! isJobCard && processPluginData && prepareFormData && pluginList . length ) {
388
390
let branchName = ''
389
391
if ( _formData ?. materials ?. length ) {
@@ -398,9 +400,7 @@ export default function CIPipeline({
398
400
processPluginData ( _formData , pluginList , appId , ciPipelineId , branchName )
399
401
. then ( ( response : MandatoryPluginDataType ) => {
400
402
setMandatoryPluginData ( response )
401
- if ( _formData ) {
402
- setFormData ( prepareFormData ( _formData , response ?. pluginData ?? [ ] ) )
403
- }
403
+ setFormData ( ( prevForm ) => prepareFormData ( { ...prevForm } , response ?. pluginData ?? [ ] ) )
404
404
} )
405
405
. catch ( ( error : ServerErrors ) => {
406
406
showError ( error )
@@ -533,11 +533,6 @@ export default function CIPipeline({
533
533
534
534
const msg = ciPipeline . id ? 'Pipeline Updated' : 'Pipeline Created'
535
535
536
- // Reset allow override flag to false if config matches with global
537
- if ( ! ciPipeline . isDockerConfigOverridden && ! isDockerConfigOverridden ) {
538
- formData . isDockerConfigOverridden = false
539
- formData . dockerConfigOverride = { } as DockerConfigOverrideType
540
- }
541
536
//here we check for the case where the pipeline is multigit and user selects pullrequest or tag creation(webhook)
542
537
//in that case we only send the webhook data not the other one.
543
538
let _materials = formData . materials
@@ -813,7 +808,6 @@ export default function CIPipeline({
813
808
isAdvanced = { isAdvanced }
814
809
ciPipeline = { ciPipeline }
815
810
isSecurityModuleInstalled = { isSecurityModuleInstalled }
816
- setDockerConfigOverridden = { setDockerConfigOverridden }
817
811
isJobView = { isJobCard }
818
812
getPluginData = { getPluginData }
819
813
/>
0 commit comments