fix launch instance GBP issue

Change-Id: Ieb10c59d4b06c56e4cfde9f80c34d17b6bf9eb74
(cherry picked from commit 3e823ad3dc)
This commit is contained in:
Pulkit vajpayee 2022-07-20 11:48:33 +05:30 committed by pulkit vajpayee
parent 88f082a7fa
commit d0b57d03fa
3 changed files with 18 additions and 5 deletions

View File

@ -22,12 +22,25 @@
.factory('gbpui.group-member.launch-context.service', launchContextService);
launchContextService.$inject = [];
launchContextService.$inject = [
'$location',
'horizon.framework.util.http.service',
];
function launchContextService() {
function launchContextService($location,apiService) {
var policyGroups = {'data':[],'status':0};
!$location.absUrl().includes('login') && apiService
.get('project/policytargets/policy_target_groups')
.error(function () {
policyGroups.status = 1
}).then(data => {
policyGroups.data = data.data;
policyGroups.status = 1;
});
return {
launchContext: {
defaults: []
defaults: [],
policyGroups,
}
};
}

View File

@ -39,7 +39,7 @@
// This check can be potentially made more restrictive to specifically
// check if policy_target is in the URL
if (launchContextService.launchContext.successUrl != '/dashboard/project/instances/' && launchContextService.launchContext.successUrl != '/dashboard/project/network_topology/' && launchContextService.launchContext.successUrl != '/project/instances/' && launchContextService.launchContext.successUrl != '/project/network_topology/') {
if (launchContextService.launchContext.policyGroups.data.length && launchContextService.launchContext.successUrl != '/dashboard/project/instances/' && launchContextService.launchContext.successUrl != '/dashboard/project/network_topology/' && launchContextService.launchContext.successUrl != '/project/instances/' && launchContextService.launchContext.successUrl != '/project/network_topology/') {
// Finds and replaces the Network and Port wizard pages with
// the GBP wizard page
var networkIndex = -1;

View File

@ -8,7 +8,7 @@
#
# Hacking should appear first in case something else depends on pep8
-e git://github.com/openstack/horizon.git@queens-eol#egg=horizon
-e git+https://github.com/openstack/horizon.git@queens-eol#egg=horizon
hacking<0.11,>=0.10.0
#
cmd2<0.9.0