@@ -21,6 +21,8 @@ module.exports = angular.module('spinnaker.core.pipeline.config.pipelineConfigur
21
21
22
22
this . actionsTemplateUrl = overrideRegistry . getTemplate ( 'pipelineConfigActions' , require ( './actions/pipelineConfigActions.html' ) ) ;
23
23
24
+ let original = _ . cloneDeep ( $scope . pipeline ) ;
25
+
24
26
pipelineConfigService . getHistory ( $scope . pipeline . id , 2 ) . then ( history => {
25
27
if ( history && history . length > 1 ) {
26
28
$scope . viewState . hasHistory = true ;
@@ -144,6 +146,30 @@ module.exports = angular.module('spinnaker.core.pipeline.config.pipelineConfigur
144
146
} ) ;
145
147
} ;
146
148
149
+ this . enablePipeline = ( ) => {
150
+ $uibModal . open ( {
151
+ templateUrl : require ( './actions/enable/enablePipelineModal.html' ) ,
152
+ controller : 'EnablePipelineModalCtrl as ctrl' ,
153
+ resolve : {
154
+ pipeline : ( ) => original
155
+ }
156
+ } ) . result . then ( disableToggled ) ;
157
+ } ;
158
+
159
+ this . disablePipeline = ( ) => {
160
+ $uibModal . open ( {
161
+ templateUrl : require ( './actions/disable/disablePipelineModal.html' ) ,
162
+ controller : 'DisablePipelineModalCtrl as ctrl' ,
163
+ resolve : {
164
+ pipeline : ( ) => original
165
+ }
166
+ } ) . result . then ( disableToggled ) ;
167
+ } ;
168
+
169
+ function disableToggled ( ) {
170
+ $scope . pipeline . disabled = ! $scope . pipeline . disabled ;
171
+ }
172
+
147
173
this . showHistory = ( ) => {
148
174
$uibModal . open ( {
149
175
templateUrl : require ( './actions/history/showHistory.modal.html' ) ,
0 commit comments