2
0
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:
Britney Wright
2019-08-13 12:10:11 -04:00
committed by GitHub
parent 53ffabdd32
commit 6eab96ce57
9 changed files with 120 additions and 5 deletions

View File

@@ -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);
});
})();