feat(kube): Add a confirmation modal before deleting one or more application or configuration (#4522)

pull/3937/head
Maxime Bajeux 2020-12-10 08:46:58 +01:00 committed by GitHub
parent 20cf948e53
commit 60c5ab3eec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 3 deletions

View File

@ -79,8 +79,12 @@ class KubernetesApplicationsController {
}
removeAction(selectedItems) {
this.ModalService.confirmDeletion('Do you want to remove the selected application(s)?', (confirmed) => {
if (confirmed) {
return this.$async(this.removeActionAsync, selectedItems);
}
});
}
onPublishingModeClick(application) {
this.state.activeTab = 1;

View File

@ -3,12 +3,13 @@ import KubernetesConfigurationHelper from 'Kubernetes/helpers/configurationHelpe
class KubernetesConfigurationsController {
/* @ngInject */
constructor($async, $state, Notifications, KubernetesConfigurationService, KubernetesApplicationService) {
constructor($async, $state, Notifications, KubernetesConfigurationService, KubernetesApplicationService, ModalService) {
this.$async = $async;
this.$state = $state;
this.Notifications = Notifications;
this.KubernetesConfigurationService = KubernetesConfigurationService;
this.KubernetesApplicationService = KubernetesApplicationService;
this.ModalService = ModalService;
this.onInit = this.onInit.bind(this);
this.getConfigurations = this.getConfigurations.bind(this);
@ -56,8 +57,12 @@ class KubernetesConfigurationsController {
}
removeAction(selectedItems) {
this.ModalService.confirmDeletion('Do you want to remove the selected configuration(s)?', (confirmed) => {
if (confirmed) {
return this.$async(this.removeActionAsync, selectedItems);
}
});
}
async getApplicationsAsync() {
try {