From f8c6690d6d2f2a00324d9961819bc66d6282ccfc Mon Sep 17 00:00:00 2001 From: mabashian Date: Wed, 30 Aug 2017 15:41:45 -0400 Subject: [PATCH] Properly name the required asterisks class --- awx/ui/client/legacy-styles/ansible-ui.less | 4 ---- awx/ui/client/legacy-styles/forms.less | 4 ++++ .../prompt-for-passwords.factory.js | 4 ++-- .../src/job-submission/job-submission.partial.html | 14 +++++++------- awx/ui/client/src/license/license.partial.html | 6 +++--- awx/ui/client/src/partials/survey-maker-modal.html | 2 +- awx/ui/client/src/shared/directives.js | 12 ++++++------ awx/ui/client/src/shared/form-generator.js | 2 +- 8 files changed, 24 insertions(+), 24 deletions(-) diff --git a/awx/ui/client/legacy-styles/ansible-ui.less b/awx/ui/client/legacy-styles/ansible-ui.less index cd0db22747..77830b329c 100644 --- a/awx/ui/client/legacy-styles/ansible-ui.less +++ b/awx/ui/client/legacy-styles/ansible-ui.less @@ -342,10 +342,6 @@ textarea.allowresize { } } -.foobar { - color: @red; -} - .subtitle { font-size: 16px; } diff --git a/awx/ui/client/legacy-styles/forms.less b/awx/ui/client/legacy-styles/forms.less index 76f8bd002c..4fb40e395d 100644 --- a/awx/ui/client/legacy-styles/forms.less +++ b/awx/ui/client/legacy-styles/forms.less @@ -700,6 +700,10 @@ input[type='radio']:checked:before { width: 30px; } +.Form-requiredAsterisk { + color: @red; +} + @media only screen and (max-width: 650px) { .Form-formGroup { flex: 1 0 auto; diff --git a/awx/ui/client/src/job-submission/job-submission-factories/prompt-for-passwords.factory.js b/awx/ui/client/src/job-submission/job-submission-factories/prompt-for-passwords.factory.js index 05ef967b84..40557c58c3 100644 --- a/awx/ui/client/src/job-submission/job-submission-factories/prompt-for-passwords.factory.js +++ b/awx/ui/client/src/job-submission/job-submission-factories/prompt-for-passwords.factory.js @@ -19,7 +19,7 @@ export default scope[fld] = ''; html += "
\n"; html += "\n"; html += "\n"; html += "\n"; - html += '*'; + html += '*'; html += "
@@ -114,7 +114,7 @@
@@ -128,7 +128,7 @@
@@ -142,7 +142,7 @@
@@ -179,7 +179,7 @@
@@ -198,7 +198,7 @@
@@ -276,7 +276,7 @@
diff --git a/awx/ui/client/src/license/license.partial.html b/awx/ui/client/src/license/license.partial.html index 67202500ef..7b8bfe3499 100644 --- a/awx/ui/client/src/license/license.partial.html +++ b/awx/ui/client/src/license/license.partial.html @@ -100,7 +100,7 @@
- * + * License File
@@ -108,8 +108,8 @@ {{fileName|translate}}
-
- * +
+ * End User License Agreement
diff --git a/awx/ui/client/src/shared/directives.js b/awx/ui/client/src/shared/directives.js index 9ffde032df..71684933d7 100644 --- a/awx/ui/client/src/shared/directives.js +++ b/awx/ui/client/src/shared/directives.js @@ -417,14 +417,14 @@ function(ConfigurationUtils, i18n, $rootScope) { // Make a field required conditionally using an expression. If the expression evaluates to true, the // field will be required. Otherwise, the required attribute will be removed. // -.directive('awRequiredWhen', ['$timeout', function($timeout) { +.directive('awRequiredWhen', function() { return { require: 'ngModel', compile: function(tElem) { return { pre: function preLink() { let label = $(tElem).closest('.form-group').find('label').first(); - $(label).prepend('*'); + $(label).prepend('*'); }, post: function postLink( scope, elm, attrs, ctrl ) { function updateRequired() { @@ -436,13 +436,13 @@ function(ConfigurationUtils, i18n, $rootScope) { if (isRequired && (elm.attr('required') === null || elm.attr('required') === undefined)) { $(elm).attr('required', 'required'); - if(!$(label).find('span.foobar').length){ - $(label).prepend('*'); + if(!$(label).find('span.Form-requiredAsterisk').length){ + $(label).prepend('*'); } } else if (!isRequired) { elm.removeAttr('required'); if (!attrs.awrequiredAlwaysShowAsterisk) { - $(label).find('span.foobar')[0].remove(); + $(label).find('span.Form-requiredAsterisk')[0].remove(); } } if (isRequired && (viewValue === undefined || viewValue === null || viewValue === '')) { @@ -464,7 +464,7 @@ function(ConfigurationUtils, i18n, $rootScope) { }; } }; -}]) +}) // awPlaceholder: Dynamic placeholder set to a scope variable you want watched. // Value will be place in field placeholder attribute. diff --git a/awx/ui/client/src/shared/form-generator.js b/awx/ui/client/src/shared/form-generator.js index da6dfbdf98..704ed857f9 100644 --- a/awx/ui/client/src/shared/form-generator.js +++ b/awx/ui/client/src/shared/form-generator.js @@ -639,7 +639,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat html += (field.labelNGClass) ? "ng-class=\"" + field.labelNGClass + "\" " : ""; html += "for=\"" + fld + '">\n'; - html += `${field.required ? '*' : ''}`; + html += `${field.required ? '*' : ''}`; html += (field.icon) ? Icon(field.icon) : ""; if (field.labelBind) {