Fix issue the deleted item is selected again with batch delete
Items recently deleted with batch action are shown in deletion confirmation dialog when execute the batch delete action again. Steps to reproduce: 1. Create 2 new items 2. Delete one of them using the batch delete action on top of the table 3. Select the another item and click the batch delete action Expect to see the confirmation dialog shows one selected item, but it shows the item that was deleted in step 2 as well. Also, HTTP DELETE method for already deleted item is submitted again and occurs error. This patch fixes this issue. Change-Id: I5940b3b073d5bb9273068c22e090e3af390c9792 Closes-Bug: #1742599
This commit is contained in:
parent
efa2b2c8e5
commit
a9c0984909
|
@ -125,8 +125,11 @@
|
|||
deleteModalResult.fail.forEach(function markFailed(item) {
|
||||
result.failed(resourceType, getEntity(item).id);
|
||||
});
|
||||
if (result.result.failed.length === 0 && result.result.deleted.length > 0) {
|
||||
$location.path('/project/container/containers');
|
||||
var indexPath = '/project/container/containers';
|
||||
var currentPath = $location.path();
|
||||
if (result.result.failed.length === 0 && result.result.deleted.length > 0 &&
|
||||
currentPath !== indexPath) {
|
||||
$location.path(indexPath);
|
||||
} else {
|
||||
return result.result;
|
||||
}
|
||||
|
|
|
@ -125,8 +125,11 @@
|
|||
deleteModalResult.fail.forEach(function markFailed(item) {
|
||||
result.failed(resourceType, getEntity(item).id);
|
||||
});
|
||||
if (result.result.failed.length === 0 && result.result.deleted.length > 0) {
|
||||
$location.path('/project/container/containers');
|
||||
var indexPath = '/project/container/containers';
|
||||
var currentPath = $location.path();
|
||||
if (result.result.failed.length === 0 && result.result.deleted.length > 0 &&
|
||||
currentPath !== indexPath) {
|
||||
$location.path(indexPath);
|
||||
} else {
|
||||
return result.result;
|
||||
}
|
||||
|
|
|
@ -131,8 +131,11 @@
|
|||
deleteModalResult.fail.forEach(function markFailed(item) {
|
||||
result.failed(resourceType, getEntity(item).id);
|
||||
});
|
||||
if (result.result.failed.length === 0 && result.result.deleted.length > 0) {
|
||||
$location.path('/project/container/containers');
|
||||
var indexPath = '/project/container/containers';
|
||||
var currentPath = $location.path();
|
||||
if (result.result.failed.length === 0 && result.result.deleted.length > 0 &&
|
||||
currentPath !== indexPath) {
|
||||
$location.path(indexPath);
|
||||
} else {
|
||||
return result.result;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue