From a9eab0f9fea8dd11ccb3d7729af571916e10db99 Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Tue, 18 Jul 2017 14:41:48 -0400 Subject: [PATCH 1/2] update forks default placeholder in jt and adhoc commands also update styling of to-the-right-of-label checkboxes --- awx/ui/client/legacy-styles/forms.less | 24 +++++++++++++++++++ .../inventories/adhoc/adhoc.controller.js | 6 +++-- .../inventories/adhoc/adhoc.form.js | 12 +++++----- awx/ui/client/src/shared/form-generator.js | 17 ++++++------- .../job-template-add.controller.js | 4 +++- .../job-template-edit.controller.js | 4 +++- .../factories/callback-help-init.factory.js | 8 ++++++- .../job_templates/job-template.form.js | 6 ++--- 8 files changed, 59 insertions(+), 22 deletions(-) diff --git a/awx/ui/client/legacy-styles/forms.less b/awx/ui/client/legacy-styles/forms.less index 2795e15586..87d376779d 100644 --- a/awx/ui/client/legacy-styles/forms.less +++ b/awx/ui/client/legacy-styles/forms.less @@ -216,6 +216,17 @@ } } +.Form-checkbox--subCheckbox { + font-size: 10px; + color: @default-stdout-txt; + text-transform: uppercase; + margin-top: 2px; + + input { + margin-top: 2px; + } +} + .Form-textUneditable { .Form-textInput { border: none; @@ -733,3 +744,16 @@ input[type='radio']:checked:before { overflow-wrap: break-word; white-space: normal; } + +::-webkit-input-placeholder { /* Chrome/Opera/Safari */ + color: @b7grey; +} +::-moz-placeholder { /* Firefox 19+ */ + color: @b7grey; +} +:-ms-input-placeholder { /* IE 10+ */ + color: @b7grey; +} +:-moz-placeholder { /* Firefox 18- */ + color: @b7grey; +} diff --git a/awx/ui/client/src/inventories-hosts/inventories/adhoc/adhoc.controller.js b/awx/ui/client/src/inventories-hosts/inventories/adhoc/adhoc.controller.js index 5d6ed65a29..86534a5871 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/adhoc/adhoc.controller.js +++ b/awx/ui/client/src/inventories-hosts/inventories/adhoc/adhoc.controller.js @@ -42,8 +42,10 @@ function adhocController($q, $scope, $stateParams, $scope.verbosity = verbosity_options[verbosity]; } } - $("#forks-number").spinner("value", forks_default); - $scope.forks = forks_default; + if (forks_default !== 0) { + $("#forks-number").spinner("value", forks_default); + $scope.forks = forks_default; + } }; // set when "working" starts and stops diff --git a/awx/ui/client/src/inventories-hosts/inventories/adhoc/adhoc.form.js b/awx/ui/client/src/inventories-hosts/inventories/adhoc/adhoc.form.js index da010ed9fb..1b6010683a 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/adhoc/adhoc.form.js +++ b/awx/ui/client/src/inventories-hosts/inventories/adhoc/adhoc.form.js @@ -97,15 +97,15 @@ export default ['i18n', function(i18n) { id: 'forks-number', type: 'number', integer: true, - min: 0, + min: 1, spinner: true, - "default": 0, - required: true, 'class': "input-small", column: 1, - awPopOver: '

The number of parallel or simultaneous processes to use while executing the command. 0 signifies ' + - 'the default value from the ansible configuration file.

', + awPopOver: '

' + i18n.sprintf(i18n._('The number of parallel or simultaneous processes to use while executing the playbook. Inputting no value will use ' + + 'the default value from the %sansible configuration file%s.'), '' + + '', '') +'

', + placeholder: 'DEFAULT', dataTitle: i18n._('Forks'), dataPlacement: 'right', dataContainer: "body" diff --git a/awx/ui/client/src/shared/form-generator.js b/awx/ui/client/src/shared/form-generator.js index 97ce9da934..91e704d401 100644 --- a/awx/ui/client/src/shared/form-generator.js +++ b/awx/ui/client/src/shared/form-generator.js @@ -776,7 +776,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat ngModel: field.subCheckbox.variable, ngShow: field.subCheckbox.ngShow, ngChange: field.subCheckbox.ngChange, - ngDisabled: field.ngDisabled || field.subCheckbox.ngDisabled, + ngDisabled: field.subCheckbox.ngDisabled || field.ngDisabled, text: field.subCheckbox.text || '' }; } @@ -800,7 +800,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat ngShow: field.subCheckbox.ngShow, ngChange: field.subCheckbox.ngChange, ngModel: field.subCheckbox.variable, - ngDisabled: field.ngDisabled, + ngDisabled: field.subCheckbox.ngDisabled || field.ngDisabled, text: field.subCheckbox.text || '' }; } @@ -1019,7 +1019,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat ngModel: field.subCheckbox.variable, ngShow: field.subCheckbox.ngShow, ngChange: field.subCheckbox.ngChange, - ngDisabled: field.ngDisabled || field.subCheckbox.ngDisabled, + ngDisabled: field.subCheckbox.ngDisabled || field.ngDisabled, text: field.subCheckbox.text || '' }; } @@ -1074,7 +1074,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat ngShow: field.subCheckbox.ngShow, ngModel: field.subCheckbox.variable, ngChange: field.subCheckbox.ngChange, - ngDisabled: field.subCheckbox.ngDisabled, + ngDisabled: field.subCheckbox.ngDisabled || field.ngDisabled, text: field.subCheckbox.text }; } @@ -1147,7 +1147,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat ngShow: field.subCheckbox.ngShow, ngChange: field.subCheckbox.ngChange, ngModel: field.subCheckbox.variable, - ngDisabled: field.ngDisabled, + ngDisabled: field.subCheckbox.ngDisabled || field.ngDisabled, text: field.subCheckbox.text || '' }; } @@ -1171,6 +1171,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat html += "ng-model=\"" + fld + '" '; html += 'name="' + fld + '" '; html += buildId(field, fld, this.form); + html += (field.placeholder) ? this.attr(field, 'placeholder') : ""; html += (field.min || field.min === 0) ? this.attr(field, 'min') : ""; html += (field.max) ? this.attr(field, 'max') : ""; html += (field.ngChange) ? this.attr(field, 'ngChange') : ""; @@ -1365,7 +1366,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat ngShow: field.subCheckbox.ngShow, ngChange: field.subCheckbox.ngChange, ngModel: field.subCheckbox.variable, - ngDisabled: field.ngDisabled, + ngDisabled: field.subCheckbox.ngDisabled || field.ngDisabled, text: field.subCheckbox.text || '' }; } @@ -1448,7 +1449,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat ngShow: field.subCheckbox.ngShow, ngChange: field.subCheckbox.ngChange, ngModel: field.subCheckbox.variable, - ngDisabled: field.ngDisabled, + ngDisabled: field.subCheckbox.ngDisabled || field.ngDisabled, text: field.subCheckbox.text || '' }; } @@ -2049,7 +2050,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat let ngShow = options.ngShow ? `ng-show="${options.ngShow}"` : ''; return ` -