From 549cd347e9adbe8b69c8e003697eb3bdc3a157f7 Mon Sep 17 00:00:00 2001 From: Marliana Lara Date: Mon, 9 Jul 2018 11:11:56 -0400 Subject: [PATCH 1/2] Fix credential labels in jobs list --- awx/ui/client/features/jobs/jobsList.controller.js | 9 +++++++++ awx/ui/client/features/jobs/jobsList.view.html | 1 + 2 files changed, 10 insertions(+) diff --git a/awx/ui/client/features/jobs/jobsList.controller.js b/awx/ui/client/features/jobs/jobsList.controller.js index 2780e63ce1..7c2151471d 100644 --- a/awx/ui/client/features/jobs/jobsList.controller.js +++ b/awx/ui/client/features/jobs/jobsList.controller.js @@ -62,6 +62,15 @@ function ListJobsController ( vm.jobTypes = mapChoices(unifiedJob.options('actions.GET.type.choices')); + vm.buildCredentialTags = (credentials) => + credentials.map(credential => { + const icon = `${credential.kind}`; + const link = `/#/credentials/${credential.id}`; + const value = credential.name; + + return { icon, link, value }; + }); + vm.getSref = ({ type, id }) => { let sref; diff --git a/awx/ui/client/features/jobs/jobsList.view.html b/awx/ui/client/features/jobs/jobsList.view.html index 72d40c6130..190eba8ff7 100644 --- a/awx/ui/client/features/jobs/jobsList.view.html +++ b/awx/ui/client/features/jobs/jobsList.view.html @@ -65,6 +65,7 @@ label-value="{{:: vm.strings.get('list.ROW_ITEM_LABEL_CREDENTIALS') }}" tag-values="job.summary_fields.credentials" tags-are-creds="true"> + From deb6c3caf8ec128c09f505b2fef9c954c763b958 Mon Sep 17 00:00:00 2001 From: Marliana Lara Date: Tue, 10 Jul 2018 13:18:42 -0400 Subject: [PATCH 2/2] Sanitize credential name tags --- awx/ui/client/features/jobs/jobsList.controller.js | 2 +- awx/ui/client/features/output/details.component.js | 2 +- awx/ui/client/features/templates/templatesList.controller.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/awx/ui/client/features/jobs/jobsList.controller.js b/awx/ui/client/features/jobs/jobsList.controller.js index 7c2151471d..dc94915473 100644 --- a/awx/ui/client/features/jobs/jobsList.controller.js +++ b/awx/ui/client/features/jobs/jobsList.controller.js @@ -66,7 +66,7 @@ function ListJobsController ( credentials.map(credential => { const icon = `${credential.kind}`; const link = `/#/credentials/${credential.id}`; - const value = credential.name; + const value = $filter('sanitize')(credential.name); return { icon, link, value }; }); diff --git a/awx/ui/client/features/output/details.component.js b/awx/ui/client/features/output/details.component.js index 0fad725040..35a59d128e 100644 --- a/awx/ui/client/features/output/details.component.js +++ b/awx/ui/client/features/output/details.component.js @@ -417,7 +417,7 @@ function buildCredentialDetails (credential) { const icon = `${credential.kind}`; const link = `/#/credentials/${credential.id}`; const tooltip = strings.get('tooltips.CREDENTIAL'); - const value = credential.name; + const value = $filter('sanitize')(credential.name); return { icon, link, tooltip, value }; } diff --git a/awx/ui/client/features/templates/templatesList.controller.js b/awx/ui/client/features/templates/templatesList.controller.js index fe0a8d31af..28412ce3af 100644 --- a/awx/ui/client/features/templates/templatesList.controller.js +++ b/awx/ui/client/features/templates/templatesList.controller.js @@ -170,7 +170,7 @@ function ListTemplatesController( const icon = `${credential.kind}`; const link = `/#/credentials/${credential.id}`; const tooltip = strings.get('tooltips.VIEW_THE_CREDENTIAL'); - const value = credential.name; + const value = $filter('sanitize')(credential.name); return { icon, link, tooltip, value }; });