mirror of
https://github.com/VinylDNS/vinyldns
synced 2025-09-05 00:35:29 +00:00
Portal cancel in review dns change (#796)
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
angular.module('batch-change')
|
||||
.controller('BatchChangesController', function($scope, $timeout, batchChangeService, pagingService, utilityService){
|
||||
$scope.batchChanges = [];
|
||||
$scope.currentBatchChange;
|
||||
|
||||
// Set default params: empty start from and 100 max items
|
||||
var batchChangePaging = pagingService.getNewPagingParams(100);
|
||||
@@ -110,6 +111,35 @@
|
||||
$scope.refreshBatchChanges();
|
||||
}
|
||||
|
||||
$scope.cancelChange = function(batchChange) {
|
||||
$scope.currentBatchChange = batchChange;
|
||||
$("#cancel_batch_change").modal("show");
|
||||
|
||||
}
|
||||
|
||||
$scope.confirmCancel = function() {
|
||||
batchChangePaging = pagingService.resetPaging(batchChangePaging);
|
||||
$("#cancel_batch_change").modal("hide");
|
||||
|
||||
function success(response) {
|
||||
var alert = utilityService.success('Successfully cancelled DNS Change', response, 'cancelBatchChange: cancelBatchChange successful');
|
||||
$scope.alerts.push(alert);
|
||||
$scope.refreshBatchChanges();
|
||||
}
|
||||
|
||||
return batchChangeService
|
||||
.cancelBatchChange($scope.currentBatchChange.id)
|
||||
.then(success)
|
||||
.catch(function (error){
|
||||
handleError(error, 'batchChangesService::cancelBatchChange-failure');
|
||||
});
|
||||
};
|
||||
|
||||
$scope.cancelCancel = function() {
|
||||
$("#cancel_batch_change").modal("hide");
|
||||
$scope.currentBatchChange = null;
|
||||
}
|
||||
|
||||
$timeout($scope.refreshBatchChanges, 0);
|
||||
});
|
||||
})();
|
||||
|
Reference in New Issue
Block a user