1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-30 18:59:41 +02:00

feat(app/volumes): add confirmation modal before deleting volumes in volumes view and volume view (#4597)

This commit is contained in:
Alice Groux 2020-12-16 07:57:31 +01:00 committed by GitHub
parent bd98b8956a
commit 58bf76a58f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 26 deletions

View file

@ -51,14 +51,18 @@ angular.module('portainer.docker').controller('VolumeController', [
};
$scope.removeVolume = function removeVolume() {
VolumeService.remove($scope.volume)
.then(function success() {
Notifications.success('Volume successfully removed', $transition$.params().id);
$state.go('docker.volumes', {});
})
.catch(function error(err) {
Notifications.error('Failure', err, 'Unable to remove volume');
});
ModalService.confirmDeletion('Do you want to remove this volume?', (confirmed) => {
if (confirmed) {
VolumeService.remove($scope.volume)
.then(function success() {
Notifications.success('Volume successfully removed', $transition$.params().id);
$state.go('docker.volumes', {});
})
.catch(function error(err) {
Notifications.error('Failure', err, 'Unable to remove volume');
});
}
});
};
function getVolumeDataFromContainer(container, volumeId) {