1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-08 15:25:22 +02:00

fix(ui): confirm deletion [EE-4612] (#8868)

This commit is contained in:
Chaim Lev-Ari 2023-05-21 17:16:15 +07:00 committed by GitHub
parent e37e87971d
commit f96e7ff434
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 69 additions and 17 deletions

View file

@ -1,5 +1,7 @@
import angular from 'angular';
import _ from 'lodash-es';
import { confirmDestructive } from '@@/modals/confirm';
import { buildConfirmButton } from '@@/modals/utils';
angular.module('portainer.app').controller('GroupsController', GroupsController);
@ -11,6 +13,16 @@ function GroupsController($scope, $state, $async, GroupService, Notifications) {
}
async function removeActionAsync(selectedItems) {
const confirmed = await confirmDestructive({
title: 'Are you sure?',
message: 'Are you sure you want to remove the selected environment group(s)?',
confirmButton: buildConfirmButton('Remove', 'danger'),
});
if (!confirmed) {
return;
}
for (let group of selectedItems) {
try {
await GroupService.deleteGroup(group.Id);

View file

@ -1,5 +1,7 @@
import angular from 'angular';
import _ from 'lodash-es';
import { confirmDestructive } from '@@/modals/confirm';
import { buildConfirmButton } from '@@/modals/utils';
angular.module('portainer.app').controller('TagsController', TagsController);
@ -30,6 +32,16 @@ function TagsController($scope, $state, $async, TagService, Notifications) {
}
async function removeActionAsync(tags) {
const confirmed = await confirmDestructive({
title: 'Are you sure?',
message: 'Are you sure you want to remove the selected tag(s)?',
confirmButton: buildConfirmButton('Remove', 'danger'),
});
if (!confirmed) {
return;
}
for (let tag of tags) {
try {
await TagService.deleteTag(tag.Id);