summaryrefslogtreecommitdiff
path: root/openstack_dashboard/static
diff options
context:
space:
mode:
authorTatiana Ovchinnikova <t.v.ovtchinnikova@gmail.com>2022-09-13 12:23:04 -0500
committerTatiana Ovchinnikova <t.v.ovtchinnikova@gmail.com>2022-09-14 16:37:58 +0000
commit1011d4237ebe055a969e14076c69cddd43cf0578 (patch)
tree0f99b86e8831f82d8bf4ff039e586fdaef50c131 /openstack_dashboard/static
parent0b1dd3d89e94a975b44a56c626d67c61ad840ca3 (diff)
downloadhorizon-1011d4237ebe055a969e14076c69cddd43cf0578.tar.gz
Fix redirect after deleting from details page
On apache environments, when WEBROOT is "/dashboard/" and not "/", redirection after deleting from Angular details page is broken. If we go to image/key pair/server group/etc details page, and delete it from this page, redirect url is "/dashboard/dashboard/project/..." instead of "/dashboard/project/..." This patch switches from using WEBROOT depentent panel navigation to getting default index url directly from details view controller. It also cleans up a work around that was implemented for some pages. Change-Id: I6bd06ea479f473a319f8100cbf8d168424b62461
Diffstat (limited to 'openstack_dashboard/static')
-rw-r--r--openstack_dashboard/static/app/core/keypairs/actions/delete.service.js8
-rw-r--r--openstack_dashboard/static/app/core/server_groups/actions/delete.action.service.js7
-rw-r--r--openstack_dashboard/static/app/core/server_groups/actions/delete.action.service.spec.js4
-rw-r--r--openstack_dashboard/static/app/core/trunks/actions/delete.action.service.js11
4 files changed, 2 insertions, 28 deletions
diff --git a/openstack_dashboard/static/app/core/keypairs/actions/delete.service.js b/openstack_dashboard/static/app/core/keypairs/actions/delete.service.js
index a053ee544..439249088 100644
--- a/openstack_dashboard/static/app/core/keypairs/actions/delete.service.js
+++ b/openstack_dashboard/static/app/core/keypairs/actions/delete.service.js
@@ -81,14 +81,6 @@
deleteModalResult.fail.forEach(function markFailed(item) {
actionResult.failed(resourceType, item.context.id);
});
-
- var path = '/project/key_pairs';
- if ($location.url() !== path && actionResult.result.failed.length === 0 &&
- actionResult.result.deleted.length > 0) {
- $location.path(path);
- } else {
- return actionResult.result;
- }
}
function labelize(count) {
diff --git a/openstack_dashboard/static/app/core/server_groups/actions/delete.action.service.js b/openstack_dashboard/static/app/core/server_groups/actions/delete.action.service.js
index 51b8b2285..6d1a325c7 100644
--- a/openstack_dashboard/static/app/core/server_groups/actions/delete.action.service.js
+++ b/openstack_dashboard/static/app/core/server_groups/actions/delete.action.service.js
@@ -79,13 +79,6 @@
deleteModalResult.fail.forEach(function markFailed(item) {
actionResult.failed(serverGroupResourceType, item.context.id);
});
- var path = '/project/server_groups';
- if ($location.url() !== path && actionResult.result.failed.length === 0 &&
- actionResult.result.deleted.length > 0) {
- $location.path(path);
- } else {
- return actionResult.result;
- }
}
function labelize(count) {
diff --git a/openstack_dashboard/static/app/core/server_groups/actions/delete.action.service.spec.js b/openstack_dashboard/static/app/core/server_groups/actions/delete.action.service.spec.js
index 2105a9061..9575caf38 100644
--- a/openstack_dashboard/static/app/core/server_groups/actions/delete.action.service.spec.js
+++ b/openstack_dashboard/static/app/core/server_groups/actions/delete.action.service.spec.js
@@ -135,7 +135,8 @@
function testDeleteResult() {
$location.path("ngdetails/OS::Nova::ServerGroup/1");
- $httpBackend.expectGET('/static/app/core/server_groups/panel.html').respond({});
+ $httpBackend.expectGET('/static/framework/widgets/details/routed-details-view.html')
+ .respond({});
var servergroup = {id: 1, name: 'sg1'};
deferredModal.resolve({fail: [], pass:[{data:{"data": "", "status": "204"},
context:servergroup}]});
@@ -147,7 +148,6 @@
var deleteFunction = contextArg.deleteEntity;
deleteFunction(servergroup.id);
expect(novaAPI.deleteServerGroup).toHaveBeenCalledWith(servergroup.id, true);
- expect($location.path()).toEqual("/project/server_groups");
}
}); // end of delete modal
diff --git a/openstack_dashboard/static/app/core/trunks/actions/delete.action.service.js b/openstack_dashboard/static/app/core/trunks/actions/delete.action.service.js
index bef4dd273..b695e3bfd 100644
--- a/openstack_dashboard/static/app/core/trunks/actions/delete.action.service.js
+++ b/openstack_dashboard/static/app/core/trunks/actions/delete.action.service.js
@@ -82,17 +82,6 @@
result.fail.forEach(function markFailed(item) {
actionResult.failed(resourceType, item.context.id);
});
-
- var path = "admin/trunks";
- if ($location.url().indexOf("admin") === -1) {
- path = "project/trunks";
- }
- if ($location.url() !== path && actionResult.result.failed.length === 0 &&
- actionResult.result.deleted.length > 0) {
- $location.path(path);
- } else {
- return actionResult.result;
- }
}
}