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:
parent
e37e87971d
commit
f96e7ff434
5 changed files with 69 additions and 17 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue