From cf0efe969ef52507205d85a60f480650a8116dc2 Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Tue, 1 May 2018 16:20:44 -0700 Subject: [PATCH 1/2] Changes "Cancel" to "OK" on cancel-job-prompt modal --- awx/ui/client/features/jobs/jobsList.controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/ui/client/features/jobs/jobsList.controller.js b/awx/ui/client/features/jobs/jobsList.controller.js index 4959d41b5e..dbb32a93c3 100644 --- a/awx/ui/client/features/jobs/jobsList.controller.js +++ b/awx/ui/client/features/jobs/jobsList.controller.js @@ -174,7 +174,7 @@ function ListJobsController ( resourceName: $filter('sanitize')(job.name), body: deleteModalBody, action, - actionText: strings.get('CANCEL') + actionText: strings.get('OK') }); }; From 7a3fb02791613546af8c8dfdb26442907451b98e Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Wed, 2 May 2018 10:44:04 -0700 Subject: [PATCH 2/2] Aligns text for canceling/deleting a job on the jobs list & the stdout page --- awx/ui/client/features/jobs/jobsList.controller.js | 5 +++-- awx/ui/client/features/output/details.directive.js | 13 +++++++------ awx/ui/client/features/output/jobs.strings.js | 8 -------- awx/ui/client/index.template.ejs | 2 +- awx/ui/client/lib/services/base-string.service.js | 5 ++++- awx/ui/client/src/shared/prompt-dialog.js | 7 ++++--- 6 files changed, 19 insertions(+), 21 deletions(-) diff --git a/awx/ui/client/features/jobs/jobsList.controller.js b/awx/ui/client/features/jobs/jobsList.controller.js index dbb32a93c3..7b5b4d8656 100644 --- a/awx/ui/client/features/jobs/jobsList.controller.js +++ b/awx/ui/client/features/jobs/jobsList.controller.js @@ -132,7 +132,7 @@ function ListJobsController ( resourceName: $filter('sanitize')(job.name), body: deleteModalBody, action, - actionText: 'DELETE' + actionText: strings.get('DELETE'), }); }; @@ -174,7 +174,8 @@ function ListJobsController ( resourceName: $filter('sanitize')(job.name), body: deleteModalBody, action, - actionText: strings.get('OK') + actionText: strings.get('cancelJob.CANCEL_JOB'), + cancelText: strings.get('cancelJob.RETURN') }); }; diff --git a/awx/ui/client/features/output/details.directive.js b/awx/ui/client/features/output/details.directive.js index d4e590e1c3..76d25270d5 100644 --- a/awx/ui/client/features/output/details.directive.js +++ b/awx/ui/client/features/output/details.directive.js @@ -442,9 +442,10 @@ function toggleLabels () { } function cancelJob () { - const actionText = strings.get('warnings.CANCEL_ACTION'); - const hdr = strings.get('warnings.CANCEL_HEADER'); - const warning = strings.get('warnings.CANCEL_BODY'); + const actionText = strings.get('cancelJob.CANCEL_JOB'); + const hdr = strings.get('cancelJob.HEADER'); + const warning = strings.get('cancelJob.SUBMIT_REQUEST'); + const cancelText = strings.get('cancelJob.RETURN'); const id = resource.model.get('id'); const name = $filter('sanitize')(resource.model.get('name')); @@ -467,13 +468,13 @@ function cancelJob () { }); }; - prompt({ hdr, resourceName, body, actionText, action }); + prompt({ hdr, resourceName, body, actionText, action, cancelText }); } function deleteJob () { const actionText = strings.get('DELETE'); - const hdr = strings.get('warnings.DELETE_HEADER'); - const warning = strings.get('warnings.DELETE_BODY'); + const hdr = strings.get('deleteResource.HEADER'); + const warning = strings.get('deleteResource.CONFIRM', 'job'); const id = resource.model.get('id'); const name = $filter('sanitize')(resource.model.get('name')); diff --git a/awx/ui/client/features/output/jobs.strings.js b/awx/ui/client/features/output/jobs.strings.js index f1f3ace11d..742c4c38fb 100644 --- a/awx/ui/client/features/output/jobs.strings.js +++ b/awx/ui/client/features/output/jobs.strings.js @@ -8,14 +8,6 @@ function JobsStrings (BaseString) { TITLE: t.s('JOBZ') }; - ns.warnings = { - CANCEL_ACTION: t.s('PROCEED'), - CANCEL_BODY: t.s('Are you sure you want to cancel this job?'), - CANCEL_HEADER: t.s('Cancel Job'), - DELETE_BODY: t.s('Are you sure you want to delete this job?'), - DELETE_HEADER: t.s('Delete Job'), - }; - ns.status = { RUNNING: t.s('The host status bar will update when the job is complete.'), UNAVAILABLE: t.s('Host status information for this job is unavailable.'), diff --git a/awx/ui/client/index.template.ejs b/awx/ui/client/index.template.ejs index 6f6a5c2cba..2fc0f09c30 100644 --- a/awx/ui/client/index.template.ejs +++ b/awx/ui/client/index.template.ejs @@ -48,7 +48,7 @@ diff --git a/awx/ui/client/lib/services/base-string.service.js b/awx/ui/client/lib/services/base-string.service.js index b024b8ad3e..cab067700e 100644 --- a/awx/ui/client/lib/services/base-string.service.js +++ b/awx/ui/client/lib/services/base-string.service.js @@ -69,6 +69,7 @@ function BaseStringService (namespace) { this.JSON = t.s('JSON'); this.DELETE = t.s('DELETE'); this.COPY = t.s('COPY'); + this.YES = t.s('YES'); this.deleteResource = { HEADER: t.s('Delete'), @@ -79,7 +80,9 @@ function BaseStringService (namespace) { this.cancelJob = { HEADER: t.s('Cancel'), - SUBMIT_REQUEST: t.s('Are you sure you want to submit the request to cancel this job?') + SUBMIT_REQUEST: t.s('Are you sure you want to submit the request to cancel this job?'), + CANCEL_JOB: t.s('Cancel Job'), + RETURN: t.s('Return') }; this.error = { diff --git a/awx/ui/client/src/shared/prompt-dialog.js b/awx/ui/client/src/shared/prompt-dialog.js index 2d5cc58ddf..cfcc9e0e2e 100644 --- a/awx/ui/client/src/shared/prompt-dialog.js +++ b/awx/ui/client/src/shared/prompt-dialog.js @@ -31,8 +31,8 @@ export default angular.module('PromptDialog', ['Utilities']) - .factory('Prompt', [ - function () { + .factory('Prompt', [ 'AppStrings', + function (strings) { return function (params) { var dialog = angular.element(document.getElementById('prompt-modal')), @@ -42,7 +42,8 @@ angular.module('PromptDialog', ['Utilities']) scope.promptResourceName = params.resourceName; scope.promptBody = params.body; scope.promptAction = params.action; - scope.promptActionText = (params.actionText === null || params.actionText === undefined || params.actionText === '') ? 'YES' : params.actionText; + scope.promptActionText = (params.actionText === null || params.actionText === undefined || params.actionText === '') ? strings.get('YES') : params.actionText; + scope.cancelActionText = (params.cancelText === null || params.cancelText === undefined || params.cancelText === '') ? strings.get('CANCEL') : params.cancelText; scope.hideActionButton = params.hideActionButton ? true : false; local_backdrop = (params.backdrop === undefined) ? "static" : params.backdrop;