From 5fb532c87b31109bd219f187a0474b954ae3009e Mon Sep 17 00:00:00 2001 From: mabashian Date: Fri, 6 Apr 2018 11:05:54 -0400 Subject: [PATCH] Updated job results related resources tooltips --- .../features/output/details.directive.js | 21 +++++++++++-------- .../features/output/details.partial.html | 14 ++++++++----- awx/ui/client/features/output/jobs.strings.js | 11 ++++++++++ 3 files changed, 32 insertions(+), 14 deletions(-) diff --git a/awx/ui/client/features/output/details.directive.js b/awx/ui/client/features/output/details.directive.js index 3c0e677d9b..80251e3d9d 100644 --- a/awx/ui/client/features/output/details.directive.js +++ b/awx/ui/client/features/output/details.directive.js @@ -106,8 +106,9 @@ function getSourceWorkflowJobDetails () { } const link = `/#/workflows/${sourceWorkflowJob.id}`; + const tooltip = strings.get('resourceTooltips.SOURCE_WORKFLOW_JOB'); - return { link }; + return { link, tooltip }; } function getJobTemplateDetails () { @@ -120,8 +121,9 @@ function getJobTemplateDetails () { const label = 'Job Template'; const link = `/#/templates/job_template/${jobTemplate.id}`; const value = $filter('sanitize')(jobTemplate.name); + const tooltip = strings.get('resourceTooltips.JOB_TEMPLATE'); - return { label, link, value }; + return { label, link, value, tooltip }; } function getLaunchedByDetails () { @@ -142,11 +144,11 @@ function getLaunchedByDetails () { let value; if (createdBy) { - tooltip = 'Edit the User'; + tooltip = strings.get('resourceTooltips.USER'); link = `/#/users/${createdBy.id}`; value = $filter('sanitize')(createdBy.username); } else if (relatedSchedule && jobTemplate) { - tooltip = 'Edit the Schedule'; + tooltip = strings.get('resourceTooltips.SCHEDULE'); link = `/#/templates/job_template/${jobTemplate.id}/schedules/${schedule.id}`; value = $filter('sanitize')(schedule.name); } else { @@ -166,7 +168,7 @@ function getInventoryDetails () { } const label = 'Inventory'; - const tooltip = 'Edit the inventory'; + const tooltip = strings.get('resourceTooltips.INVENTORY'); const value = $filter('sanitize')(inventory.name); let link; @@ -191,18 +193,19 @@ function getProjectDetails () { const label = 'Project'; const link = `/#/projects/${project.id}`; const value = $filter('sanitize')(project.name); + const tooltip = strings.get('resourceTooltips.PROJECT'); if (projectUpdate) { const update = { link: `/#/jobz/project/${projectUpdate.id}`, - tooltip: 'View project checkout results', + tooltip: strings.get('resourceTooltips.PROJECT_UPDATE'), status: projectUpdate.status, }; - return { label, link, value, update }; + return { label, link, value, tooltip, update }; } - return { label, link, value }; + return { label, link, value, tooltip }; } function getSCMRevisionDetails () { @@ -275,7 +278,7 @@ function getCredentialDetails () { } const link = `/#/credentials/${credential.id}`; - const tooltip = 'Edit the Credential'; + const tooltip = strings.get('resourceTooltips.CREDENTIAL'); const value = $filter('sanitize')(credential.name); return { label, link, tooltip, value }; diff --git a/awx/ui/client/features/output/details.partial.html b/awx/ui/client/features/output/details.partial.html index 9417d30670..db5864647f 100644 --- a/awx/ui/client/features/output/details.partial.html +++ b/awx/ui/client/features/output/details.partial.html @@ -70,14 +70,17 @@ -
+
@@ -143,12 +146,13 @@
-
+
diff --git a/awx/ui/client/features/output/jobs.strings.js b/awx/ui/client/features/output/jobs.strings.js index af52a98472..5e0d9a8cb8 100644 --- a/awx/ui/client/features/output/jobs.strings.js +++ b/awx/ui/client/features/output/jobs.strings.js @@ -20,6 +20,17 @@ function JobsStrings (BaseString) { RUNNING: t.s('The host status bar will update when the job is complete.'), UNAVAILABLE: t.s('Host status information for this job unavailable.'), }; + + ns.resourceTooltips = { + USER: t.s('View the User'), + SCHEDULE: t.s('View the Schedule'), + INVENTORY: t.s('View the Inventory'), + CREDENTIAL: t.s('View the Credential'), + JOB_TEMPLATE: t.s('View the Job Template'), + SOURCE_WORKFLOW_JOB: t.s('View the source Workflow Job'), + PROJECT: t.s('View the Project'), + PROJECT_UPDATE: t.s('View Project checkout results') + }; } JobsStrings.$inject = ['BaseStringService'];