@@ -7,10 +7,12 @@ Vue.component('app-newpipeline', {
77 fromApiVersion : '' ,
88 to : '' ,
99 toApiVersion : '' ,
10+ action : 'deploy' ,
1011 runTests : false
1112 } ,
1213 validate : false ,
1314 connection : null ,
15+ actionList : [ { value : 'deploy' , label : 'Deploy (Add/Update)' } , { value : 'destruct' , label : 'Destruct (Delete)' } ] ,
1416 apiVersionList : [ ]
1517 }
1618 } ,
@@ -34,7 +36,7 @@ Vue.component('app-newpipeline', {
3436 } ,
3537 methods : {
3638 reload : function ( ) {
37- this . pipeline = { from : '' , fromApiVersion : '' , to : '' , toApiVersion : '' , runTests : false } ;
39+ this . pipeline = { from : '' , fromApiVersion : '' , to : '' , toApiVersion : '' , action : 'deploy' , runTests : false } ;
3840 this . validate = false ;
3941 this . connection = null ;
4042 this . initApiVerList ( ) ;
@@ -103,6 +105,7 @@ Vue.component('app-newpipeline', {
103105 pipeline [ 'to' ] = self . pipeline . to ;
104106 pipeline [ 'toApiVersion' ] = self . pipeline . toApiVersion ;
105107 pipeline [ 'fromApiVersion' ] = self . pipeline . fromApiVersion ;
108+ pipeline [ 'action' ] = self . pipeline . action ;
106109 pipeline [ 'runTests' ] = self . pipeline . runTests ;
107110 pipeline [ 'status' ] = 'ready' ;
108111 pipeline [ 'created_at' ] = now . toISOString ( ) ;
@@ -149,7 +152,7 @@ Vue.component('app-newpipeline', {
149152 if ( ! pipeline . from || pipeline . from . length == 0 ) {
150153 return 'CONNECTION (FROM) is required' ;
151154 }
152- if ( ! pipeline . to || pipeline . to . length == 0 ) {
155+ if ( pipeline . action != 'destruct' && ( ! pipeline . to || pipeline . to . length == 0 ) ) {
153156 return 'CONNECTION (TO) is required' ;
154157 }
155158 if ( ! pipeline . name || pipeline . name . length == 0 ) {
@@ -222,9 +225,8 @@ Vue.component('app-newpipeline', {
222225 </label>
223226 <div class="slds-form-element__control slds-size_4-of-12">
224227 <div class="slds-select_container">
225- <select class="slds-select" disabled="disabled">
226- <option value="deploy">Deploy (Add/Update)</option>
227- <option value="destruct">Destruct (Delete)</option>
228+ <select class="slds-select" v-model="pipeline.action">
229+ <option v-for="act in actionList" v-bind:value="act.value" v-bind:seleced="pipeline.action==act.value">{{ act.label }}</option>
228230 </select>
229231 </div>
230232 </div>
@@ -233,12 +235,12 @@ Vue.component('app-newpipeline', {
233235 <footer class="slds-card__footer"></footer>
234236 </article>
235237 </div><!-- .slds-size_5-of-12 -->
236- <div class="new-pipeline-connect-icon mt4">
238+ <div class="new-pipeline-connect-icon mt4" v-if="pipeline.action!='destruct'" >
237239 <div class="slds-align_absolute-center">
238240 <span class="pipeline-from-icon"><i class="fas fa-arrow-right"></i></span>
239241 </div>
240242 </div><!-- .slds-size_1-of-12 -->
241- <div class="new-pipeline-connect">
243+ <div class="new-pipeline-connect" v-if="pipeline.action!='destruct'" >
242244 <article class="slds-card ">
243245 <div class="slds-card__header slds-grid">
244246 <div class="slds-media__figure">
@@ -302,7 +304,7 @@ Vue.component('app-newpipeline', {
302304 <div class="slds-size_12-of-12 mt1" v-if="validate==true">
303305 <div class="slds-wrap slds-text-align_right">
304306 <button class="slds-button slds-button_neutral" v-on:click="savePipeline">Save</button>
305- <button class="slds-button slds-button_brand" v-on:click="runPipeline">Run Pipeline</button>
307+ <button class="slds-button" v-bind:class="{' slds-button_brand': pipeline.action!='destruct', 'slds-button_destructive': pipeline.action=='destruct'} " v-on:click="runPipeline">Run Pipeline</button>
306308 </div>
307309 </div><!-- .slds-size_11-of-12 -->
308310 </div><!-- #pipeline-new -->
0 commit comments