@@ -347,15 +347,18 @@ <h3 class="with-divider">Image Configuration</h3>
347
347
</ div >
348
348
</ div >
349
349
350
- < div class ="form-group " ng-if ="view.advancedOptions && strategyType !== 'JenkinsPipeline' ">
351
- < osc-secrets model ="secrets.picked.pullSecret "
352
- namespace ="projectName "
353
- display-type ="pull "
354
- type ="image "
355
- secrets-by-type ="secrets.secretsByType "
356
- service-account-to-link ="builder "
357
- alerts ="alerts ">
358
- </ osc-secrets >
350
+ < div class ="form-group " ng-if ="strategyType !== 'JenkinsPipeline' ">
351
+ <!-- Use ng-show instead of ng-if so the form is still marked invalid if a hidden field has errors. -->
352
+ < div ng-show ="view.advancedOptions ">
353
+ < osc-secrets model ="secrets.picked.pullSecret "
354
+ namespace ="projectName "
355
+ display-type ="pull "
356
+ type ="image "
357
+ secrets-by-type ="secrets.secretsByType "
358
+ service-account-to-link ="builder "
359
+ alerts ="alerts ">
360
+ </ osc-secrets >
361
+ </ div >
359
362
</ div >
360
363
361
364
< div class ="form-group " ng-if ="view.advancedOptions ">
@@ -398,7 +401,8 @@ <h3 class="with-divider">Image Configuration</h3>
398
401
</ div >
399
402
</ div >
400
403
401
- < div class ="form-group " ng-if ="view.advancedOptions ">
404
+ <!-- Use ng-show instead of ng-if so the form is still marked invalid if a hidden field has errors. -->
405
+ < div class ="form-group " ng-show ="view.advancedOptions ">
402
406
< osc-secrets model ="secrets.picked.pushSecret "
403
407
namespace ="projectName "
404
408
display-type ="push "
@@ -430,7 +434,8 @@ <h3 class="with-divider">Environment Variables<span class="help action-inline">
430
434
</ div >
431
435
</ div >
432
436
< div ng-if ="sources.git || !(updatedBuildConfig | isJenkinsPipelineStrategy) " class ="section ">
433
- < div ng-if ="view.advancedOptions ">
437
+ <!-- Use ng-show instead of ng-if so the form is still marked invalid if a hidden field has errors. -->
438
+ < div ng-show ="view.advancedOptions ">
434
439
< h3 class ="with-divider "> Triggers
435
440
< a ng-href ="{{'build-triggers' | helpLink}} " target ="_blank "> < span class ="learn-more-inline "> Learn More < i class ="fa fa-external-link " aria-hidden ="true "> </ i > </ span > </ a >
436
441
</ h3 >
@@ -485,23 +490,25 @@ <h5>Image change</h5>
485
490
</ dl >
486
491
</ div >
487
492
</ div >
488
- < div class ="section " ng-if ="!(updatedBuildConfig | isJenkinsPipelineStrategy) && view.advancedOptions ">
489
- < h3 class ="with-divider ">
490
- Build Secrets
491
- < a href ="{{'source_secrets' | helpLink}} " target ="_blank "> < span class ="learn-more-inline "> Learn More < i class ="fa fa-external-link " aria-hidden ="true "> </ i > </ span > </ a >
492
- </ h3 >
493
- < div class ="form-group ">
494
- < osc-source-secrets model ="secrets.picked.sourceSecrets "
495
- namespace ="projectName "
496
- secrets-by-type ="secrets.secretsByType "
497
- strategy-type ="strategyType "
498
- service-account-to-link ="builder "
499
- alerts ="alerts "
500
- display-type ="source "
501
- type ="source ">
502
- </ osc-source-secrets >
493
+ < div class ="section " ng-if ="!(updatedBuildConfig | isJenkinsPipelineStrategy) ">
494
+ <!-- Use ng-show instead of ng-if so the form is still marked invalid if a hidden field has errors. -->
495
+ < div ng-show ="view.advancedOptions ">
496
+ < h3 class ="with-divider ">
497
+ Build Secrets
498
+ < a href ="{{'source_secrets' | helpLink}} " target ="_blank "> < span class ="learn-more-inline "> Learn More < i class ="fa fa-external-link " aria-hidden ="true "> </ i > </ span > </ a >
499
+ </ h3 >
500
+ < div class ="form-group ">
501
+ < osc-source-secrets model ="secrets.picked.sourceSecrets "
502
+ namespace ="projectName "
503
+ secrets-by-type ="secrets.secretsByType "
504
+ strategy-type ="strategyType "
505
+ service-account-to-link ="builder "
506
+ alerts ="alerts "
507
+ display-type ="source "
508
+ type ="source ">
509
+ </ osc-source-secrets >
510
+ </ div >
503
511
</ div >
504
-
505
512
</ div >
506
513
< div class ="section mar-bottom-lg " ng-if ="view.advancedOptions ">
507
514
< h3 class ="with-divider "> Run Policy
@@ -529,74 +536,78 @@ <h3 class="with-divider">Run Policy
529
536
</ div >
530
537
</ div >
531
538
532
- < div ng-if ="view.advancedOptions && !(updatedBuildConfig | isJenkinsPipelineStrategy) " class ="section ">
533
- < h3 class ="with-divider ">
534
- Post-Commit Hooks
535
- < span class ="help action-inline ">
536
- < a href ="{{'build-hooks' | helpLink}} " aria-hidden ="true " target ="_blank "> < span class ="learn-more-inline "> Learn More < i class ="fa fa-external-link "> </ i > </ span > </ a >
537
- </ span >
538
- </ h3 >
539
+ < div ng-if ="!(updatedBuildConfig | isJenkinsPipelineStrategy) " class ="section ">
540
+ <!-- Use ng-show instead of ng-if so the form is still marked invalid if a hidden field has errors. -->
541
+ < div ng-show ="view.advancedOptions ">
542
+ < h3 class ="with-divider ">
543
+ Post-Commit Hooks
544
+ < span class ="help action-inline ">
545
+ < a href ="{{'build-hooks' | helpLink}} " aria-hidden ="true " target ="_blank "> < span class ="learn-more-inline "> Learn More < i class ="fa fa-external-link "> </ i > </ span > </ a >
546
+ </ span >
547
+ </ h3 >
539
548
540
- < div class ="checkbox ">
541
- < label >
542
- < input type ="checkbox " ng-model ="view.hasHooks " id ="enable-build-hooks ">
543
- Run build hooks after image is built
544
- </ label >
545
- < div class ="help-block ">
546
- Build hooks allow you to run commands at the end of the build to verify the image.
549
+ < div class ="checkbox ">
550
+ < label >
551
+ < input type ="checkbox " ng-model ="view.hasHooks " aria-describedby ="build-hooks-help ">
552
+ Run build hooks after image is built
553
+ </ label >
554
+ < div class ="help-block " id ="build-hooks-help ">
555
+ Build hooks allow you to run commands at the end of the build to verify the image.
556
+ </ div >
547
557
</ div >
548
- </ div >
549
558
550
- < div ng-if ="view.hasHooks ">
551
- < div class ="form-group ">
552
- < h4 > Hook Types</ h4 >
553
- < ui-select
554
- ng-model ="buildHookSelection.type "
555
- title ="Choose a type of build hook ">
556
- < ui-select-match > {{$select.selected.label}}</ ui-select-match >
557
- < ui-select-choices repeat ="type in buildHookTypes ">
558
- {{type.label}}
559
- </ ui-select-choices >
560
- </ ui-select >
561
- </ div >
559
+ < div ng-if ="view.hasHooks ">
560
+ < div class ="form-group ">
561
+ < label > Hook Types</ label >
562
+ < ui-select
563
+ ng-model ="buildHookSelection.type "
564
+ title ="Choose a type of build hook ">
565
+ < ui-select-match > {{$select.selected.label}}</ ui-select-match >
566
+ < ui-select-choices repeat ="type in buildHookTypes ">
567
+ {{type.label}}
568
+ </ ui-select-choices >
569
+ </ ui-select >
570
+ </ div >
562
571
563
- < fieldset >
564
- < div ng-if ="buildHookSelection.type.id === 'script' || buildHookSelection.type.id === 'scriptArgs' ">
565
- < h4 > Script</ h4 >
566
- < div
567
- ui-ace ="{
568
- mode: 'sh',
569
- theme: 'eclipse',
570
- rendererOptions: {
571
- fadeFoldWidgets: true,
572
- showPrintMargin: false
573
- }
574
- } "
575
- ng-model ="updatedBuildConfig.spec.postCommit.script "
576
- required
577
- class ="ace-bordered ace-inline mar-top-md ">
572
+ < fieldset >
573
+ < div ng-if ="buildHookSelection.type.id === 'script' || buildHookSelection.type.id === 'scriptArgs' ">
574
+ < label class ="required "> Script</ label >
575
+ < div
576
+ ui-ace ="{
577
+ mode: 'sh',
578
+ theme: 'eclipse',
579
+ rendererOptions: {
580
+ fadeFoldWidgets: true,
581
+ showPrintMargin: false
582
+ }
583
+ } "
584
+ ng-model ="updatedBuildConfig.spec.postCommit.script "
585
+ required
586
+ class ="ace-bordered ace-inline ">
587
+ </ div >
578
588
</ div >
579
- </ div >
580
589
581
- < div ng-if ="buildHookSelection.type.id === 'command' || buildHookSelection.type.id === 'commandArgs' ">
582
- < h4 > Command</ h4 >
583
- < edit-command
584
- args ="updatedBuildConfig.spec.postCommit.command "
585
- placeholder ="Add to command "
586
- is-required ="true ">
587
- </ edit-command >
588
- </ div >
590
+ < div ng-if ="buildHookSelection.type.id === 'command' || buildHookSelection.type.id === 'commandArgs' ">
591
+ < label class =" required " > Command</ label >
592
+ < edit-command
593
+ args ="updatedBuildConfig.spec.postCommit.command "
594
+ placeholder ="Add to command "
595
+ is-required ="true ">
596
+ </ edit-command >
597
+ </ div >
589
598
590
- < div ng-if ="buildHookSelection.type.id === 'args' || buildHookSelection.type.id === 'commandArgs' || buildHookSelection.type.id === 'scriptArgs' ">
591
- < h4 > Arguments</ h4 >
592
- < edit-command
593
- args ="updatedBuildConfig.spec.postCommit.args "
594
- type ="arguments "
595
- description ="getArgumentsDescription() "
596
- is-required ="true ">
597
- </ edit-command >
598
- </ div >
599
- </ fieldset >
599
+ < div ng-if ="buildHookSelection.type.id === 'args' || buildHookSelection.type.id === 'commandArgs' || buildHookSelection.type.id === 'scriptArgs' "
600
+ ng-class ="{ 'mar-top-lg': buildHookSelection.type.id === 'scriptArgs' } ">
601
+ < label class ="required "> Arguments</ label >
602
+ < edit-command
603
+ args ="updatedBuildConfig.spec.postCommit.args "
604
+ type ="arguments "
605
+ description ="getArgumentsDescription() "
606
+ is-required ="true ">
607
+ </ edit-command >
608
+ </ div >
609
+ </ fieldset >
610
+ </ div >
600
611
</ div >
601
612
</ div >
602
613
0 commit comments