mirror of
https://github.com/ansible/awx.git
synced 2026-03-21 19:07:39 -02:30
sanitize dynamic breadcrumb label
This commit is contained in:
@@ -186,9 +186,10 @@ function getWebSocketResource (type) {
|
|||||||
return { name, key };
|
return { name, key };
|
||||||
}
|
}
|
||||||
|
|
||||||
function JobsRun ($stateRegistry, strings) {
|
function JobsRun ($stateRegistry, $filter, strings) {
|
||||||
const parent = 'jobs';
|
const parent = 'jobs';
|
||||||
const ncyBreadcrumb = { parent, label: strings.get('state.BREADCRUMB_DEFAULT') };
|
const ncyBreadcrumb = { parent, label: strings.get('state.BREADCRUMB_DEFAULT') };
|
||||||
|
const sanitize = $filter('sanitize');
|
||||||
|
|
||||||
const state = {
|
const state = {
|
||||||
url: '/:type/:id?job_event_search',
|
url: '/:type/:id?job_event_search',
|
||||||
@@ -231,7 +232,7 @@ function JobsRun ($stateRegistry, strings) {
|
|||||||
breadcrumbLabel: [
|
breadcrumbLabel: [
|
||||||
'resource',
|
'resource',
|
||||||
({ model }) => {
|
({ model }) => {
|
||||||
ncyBreadcrumb.label = `${model.get('id')} - ${model.get('name')}`;
|
ncyBreadcrumb.label = `${model.get('id')} - ${sanitize(model.get('name'))}`;
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -240,7 +241,7 @@ function JobsRun ($stateRegistry, strings) {
|
|||||||
$stateRegistry.register(state);
|
$stateRegistry.register(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
JobsRun.$inject = ['$stateRegistry', 'JobStrings'];
|
JobsRun.$inject = ['$stateRegistry', '$filter', 'JobStrings'];
|
||||||
|
|
||||||
angular
|
angular
|
||||||
.module(MODULE_NAME, [
|
.module(MODULE_NAME, [
|
||||||
|
|||||||
Reference in New Issue
Block a user