1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 08:21:15 +03:00

Merge pull request #1921 from jakemcdermott/job-results/sanitize-breadcrumb

sanitize dynamic job details breadcrumb
This commit is contained in:
Jake McDermott 2018-05-22 20:09:27 -04:00 committed by GitHub
commit d9ce945762
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -186,9 +186,10 @@ function getWebSocketResource (type) {
return { name, key };
}
function JobsRun ($stateRegistry, strings) {
function JobsRun ($stateRegistry, $filter, strings) {
const parent = 'jobs';
const ncyBreadcrumb = { parent, label: strings.get('state.BREADCRUMB_DEFAULT') };
const sanitize = $filter('sanitize');
const state = {
url: '/:type/:id?job_event_search',
@ -231,7 +232,7 @@ function JobsRun ($stateRegistry, strings) {
breadcrumbLabel: [
'resource',
({ 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);
}
JobsRun.$inject = ['$stateRegistry', 'JobStrings'];
JobsRun.$inject = ['$stateRegistry', '$filter', 'JobStrings'];
angular
.module(MODULE_NAME, [