Merge "Fix issue the deleted item is selected again with batch delete"

This commit is contained in:
Zuul 2018-01-13 08:00:13 +00:00 committed by Gerrit Code Review
commit 13e0a59863
3 changed files with 15 additions and 6 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}