diff --git a/magnum_ui/static/dashboard/container-infra/cluster-templates/cluster-templates.service.js b/magnum_ui/static/dashboard/container-infra/cluster-templates/cluster-templates.service.js index ef2497af..dadc42b7 100644 --- a/magnum_ui/static/dashboard/container-infra/cluster-templates/cluster-templates.service.js +++ b/magnum_ui/static/dashboard/container-infra/cluster-templates/cluster-templates.service.js @@ -21,6 +21,7 @@ clusterTemplatesService.$inject = [ '$filter', + 'horizon.app.core.detailRoute', 'horizon.app.core.openstack-service-api.magnum' ]; @@ -34,7 +35,7 @@ * but do not need to be restricted to such use. Each exposed function * is documented below. */ - function clusterTemplatesService($filter, magnum) { + function clusterTemplatesService($filter, detailRoute, magnum) { return { getClusterTemplatesPromise: getClusterTemplatesPromise, urlFunction: urlFunction @@ -56,7 +57,7 @@ } function urlFunction(item) { - return 'project/ngdetails/OS::Magnum::ClusterTemplate/' + item.id; + return detailRoute + 'OS::Magnum::ClusterTemplate/' + item.id; } } })(); diff --git a/magnum_ui/static/dashboard/container-infra/cluster-templates/cluster-templates.service.spec.js b/magnum_ui/static/dashboard/container-infra/cluster-templates/cluster-templates.service.spec.js index 96a5e1a3..ece983a9 100644 --- a/magnum_ui/static/dashboard/container-infra/cluster-templates/cluster-templates.service.spec.js +++ b/magnum_ui/static/dashboard/container-infra/cluster-templates/cluster-templates.service.spec.js @@ -16,10 +16,11 @@ "use strict"; describe('cluster templates service', function() { - var service; + var service, detailRoute; beforeEach(module('horizon.dashboard.container-infra.cluster-templates')); beforeEach(inject(function($injector) { service = $injector.get('horizon.dashboard.container-infra.cluster-templates.service'); + detailRoute = $injector.get('horizon.app.core.detailRoute'); })); describe('getClusterTemplatesPromise', function() { @@ -42,7 +43,7 @@ describe('urlFunction', function() { it("get url", inject(function() { var result = service.urlFunction({id:"123abc"}); - expect(result).toBe("project/ngdetails/OS::Magnum::ClusterTemplate/123abc"); + expect(result).toBe(detailRoute + "OS::Magnum::ClusterTemplate/123abc"); })); }); diff --git a/magnum_ui/static/dashboard/container-infra/clusters/clusters.service.js b/magnum_ui/static/dashboard/container-infra/clusters/clusters.service.js index 58e0cd1e..74d56785 100644 --- a/magnum_ui/static/dashboard/container-infra/clusters/clusters.service.js +++ b/magnum_ui/static/dashboard/container-infra/clusters/clusters.service.js @@ -21,6 +21,7 @@ clustersService.$inject = [ '$filter', + 'horizon.app.core.detailRoute', 'horizon.app.core.openstack-service-api.magnum' ]; @@ -34,7 +35,7 @@ * but do not need to be restricted to such use. Each exposed function * is documented below. */ - function clustersService($filter, magnum) { + function clustersService($filter, detailRoute, magnum) { return { getClustersPromise: getClustersPromise, urlFunction: urlFunction @@ -55,7 +56,7 @@ } function urlFunction(item) { - return 'project/ngdetails/OS::Magnum::Cluster/' + item.id; + return detailRoute + 'OS::Magnum::Cluster/' + item.id; } } })(); diff --git a/magnum_ui/static/dashboard/container-infra/clusters/clusters.service.spec.js b/magnum_ui/static/dashboard/container-infra/clusters/clusters.service.spec.js index f8e9871a..e2993218 100644 --- a/magnum_ui/static/dashboard/container-infra/clusters/clusters.service.spec.js +++ b/magnum_ui/static/dashboard/container-infra/clusters/clusters.service.spec.js @@ -16,10 +16,11 @@ "use strict"; describe('cluster templates service', function() { - var service; + var service, detailRoute; beforeEach(module('horizon.dashboard.container-infra.cluster-templates')); beforeEach(inject(function($injector) { service = $injector.get('horizon.dashboard.container-infra.clusters.service'); + detailRoute = $injector.get('horizon.app.core.detailRoute'); })); describe('getClustersPromise', function() { @@ -42,7 +43,7 @@ describe('urlFunction', function() { it("get url", inject(function() { var result = service.urlFunction({id:"123abc"}); - expect(result).toBe("project/ngdetails/OS::Magnum::Cluster/123abc"); + expect(result).toBe(detailRoute + "OS::Magnum::Cluster/123abc"); })); });