Ask for confirmation when archiving a board's lane
Its easy to accidentally archive a lane, we should check for the user's confirmation first. Change-Id: I87c25d94da35ab61eecfdf1207d6e3af3869d7b7
This commit is contained in:
@@ -174,9 +174,21 @@ angular.module('sb.board').controller('BoardDetailController',
|
||||
* Remove a lane from the board.
|
||||
*/
|
||||
$scope.removeLane = function (worklist) {
|
||||
var idx = $scope.board.worklists.indexOf(worklist);
|
||||
$scope.board.worklists.splice(idx, 1);
|
||||
worklist.$delete();
|
||||
var modalInstance = $modal.open({
|
||||
templateUrl: 'app/worklists/template/delete.html',
|
||||
controller: 'WorklistDeleteController',
|
||||
resolve: {
|
||||
worklist: function() {
|
||||
return worklist;
|
||||
},
|
||||
redirect: false
|
||||
}
|
||||
});
|
||||
|
||||
modalInstance.result.then(function() {
|
||||
var idx = $scope.board.worklists.indexOf(worklist);
|
||||
$scope.board.worklists.splice(idx, 1);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
* Controller for "delete worklist" modal
|
||||
*/
|
||||
angular.module('sb.worklist').controller('WorklistDeleteController',
|
||||
function ($log, $scope, $state, worklist, $modalInstance) {
|
||||
function ($log, $scope, $state, worklist, redirect, $modalInstance) {
|
||||
'use strict';
|
||||
|
||||
$scope.worklist = worklist;
|
||||
@@ -30,8 +30,10 @@ angular.module('sb.worklist').controller('WorklistDeleteController',
|
||||
$scope.remove = function () {
|
||||
$scope.worklist.$delete(
|
||||
function () {
|
||||
$modalInstance.dismiss('success');
|
||||
$state.go('sb.dashboard.boards');
|
||||
if (!!redirect) {
|
||||
$state.go('sb.dashboard.boards');
|
||||
}
|
||||
return $modalInstance.close('success');
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
@@ -141,7 +141,8 @@ angular.module('sb.worklist').controller('WorklistDetailController',
|
||||
resolve: {
|
||||
worklist: function() {
|
||||
return $scope.worklist;
|
||||
}
|
||||
},
|
||||
redirect: true
|
||||
}
|
||||
});
|
||||
return modalInstance.result;
|
||||
|
||||
Reference in New Issue
Block a user