Use detailRoute constant for path of details view
This patch replaces hard coded "project/ngdetails/" for path of details view to constant using "horizon.app.core.detailRoute". Change-Id: I57232feb09b38adc436b2da2de9bce445ba35906 Closes-Bug: #1641250
This commit is contained in:
parent
e882e115f3
commit
6e9c342e91
@ -21,6 +21,7 @@
|
||||
|
||||
service.$inject = [
|
||||
'$filter',
|
||||
'horizon.app.core.detailRoute',
|
||||
'horizon.app.core.openstack-service-api.{{cookiecutter.api_module}}'
|
||||
];
|
||||
|
||||
@ -34,7 +35,7 @@
|
||||
* but do not need to be restricted to such use. Each exposed function
|
||||
* is documented below.
|
||||
*/
|
||||
function service($filter, api) {
|
||||
function service($filter, detailRoute, api) {
|
||||
return {
|
||||
getPromise: getPromise,
|
||||
urlFunction: urlFunction
|
||||
@ -55,7 +56,7 @@
|
||||
}
|
||||
|
||||
function urlFunction(item) {
|
||||
return 'project/ngdetails/OS::{{cookiecutter.api_name}}::{{cookiecutter.panel_func}}/' + item.id;
|
||||
return detailRoute + 'OS::{{cookiecutter.api_name}}::{{cookiecutter.panel_func}}/' + item.id;
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
@ -40,8 +40,9 @@
|
||||
|
||||
describe('urlFunction', function() {
|
||||
it("get url", inject(function() {
|
||||
var detailRoute = $injector.get('horizon.app.core.detailRoute');
|
||||
var result = service.urlFunction({id:"123abc"});
|
||||
expect(result).toBe("project/ngdetails/OS::{{cookiecutter.api_name}}::{{cookiecutter.panel_func}}/123abc");
|
||||
expect(result).toBe(detailRoute + "OS::{{cookiecutter.api_name}}::{{cookiecutter.panel_func}}/123abc");
|
||||
}));
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user