End User License Agreement
+
+ *
+ End User License Agreement
{{ license.eula }}
diff --git a/awx/ui/client/src/partials/survey-maker-modal.html b/awx/ui/client/src/partials/survey-maker-modal.html
index 41b9777138..882c833c61 100644
--- a/awx/ui/client/src/partials/survey-maker-modal.html
+++ b/awx/ui/client/src/partials/survey-maker-modal.html
@@ -48,7 +48,8 @@
diff --git a/awx/ui/client/src/shared/directives.js b/awx/ui/client/src/shared/directives.js
index fd1fbe7fbb..9ffde032df 100644
--- a/awx/ui/client/src/shared/directives.js
+++ b/awx/ui/client/src/shared/directives.js
@@ -417,50 +417,54 @@ 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', function() {
+.directive('awRequiredWhen', ['$timeout', function($timeout) {
return {
require: 'ngModel',
compile: function(tElem) {
- let label = $(tElem).closest('.form-group').find('label').first();
- $(label).addClass('prepend-asterisk');
- },
- link: function(scope, elm, attrs, ctrl) {
+ return {
+ pre: function preLink() {
+ let label = $(tElem).closest('.form-group').find('label').first();
+ $(label).prepend('*');
+ },
+ post: function postLink( scope, elm, attrs, ctrl ) {
+ function updateRequired() {
+ var isRequired = scope.$eval(attrs.awRequiredWhen);
- function updateRequired() {
- var isRequired = scope.$eval(attrs.awRequiredWhen);
+ var viewValue = elm.val(),
+ label, validity = true;
+ label = $(elm).closest('.form-group').find('label').first();
- var viewValue = elm.val(),
- label, validity = true;
- label = $(elm).closest('.form-group').find('label').first();
+ if (isRequired && (elm.attr('required') === null || elm.attr('required') === undefined)) {
+ $(elm).attr('required', 'required');
+ if(!$(label).find('span.foobar').length){
+ $(label).prepend('*');
+ }
+ } else if (!isRequired) {
+ elm.removeAttr('required');
+ if (!attrs.awrequiredAlwaysShowAsterisk) {
+ $(label).find('span.foobar')[0].remove();
+ }
+ }
+ if (isRequired && (viewValue === undefined || viewValue === null || viewValue === '')) {
+ validity = false;
+ }
+ ctrl.$setValidity('required', validity);
+ }
- if (isRequired && (elm.attr('required') === null || elm.attr('required') === undefined)) {
- $(elm).attr('required', 'required');
- $(label).removeClass('prepend-asterisk').addClass('prepend-asterisk');
- } else if (!isRequired) {
- elm.removeAttr('required');
- if (!attrs.awrequiredAlwaysShowAsterisk) {
- $(label).removeClass('prepend-asterisk');
+ scope.$watchGroup([attrs.awRequiredWhen, $(elm).attr('name')], function() {
+ // watch for the aw-required-when expression to change value
+ updateRequired();
+ });
+
+ if (attrs.awrequiredInit !== undefined && attrs.awrequiredInit !== null) {
+ // We already set a watcher on the attribute above so no need to call updateRequired() in here
+ scope[attrs.awRequiredWhen] = attrs.awrequiredInit;
}
}
- if (isRequired && (viewValue === undefined || viewValue === null || viewValue === '')) {
- validity = false;
- }
- ctrl.$setValidity('required', validity);
- }
-
- scope.$watchGroup([attrs.awRequiredWhen, $(elm).attr('name')], function() {
- // watch for the aw-required-when expression to change value
- updateRequired();
- });
-
- if (attrs.awrequiredInit !== undefined && attrs.awrequiredInit !== null) {
- // We already set a watcher on the attribute above so no need to call updateRequired() in here
- scope[attrs.awRequiredWhen] = attrs.awrequiredInit;
- }
-
+ };
}
};
-})
+}])
// 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 3052788485..da6dfbdf98 100644
--- a/awx/ui/client/src/shared/form-generator.js
+++ b/awx/ui/client/src/shared/form-generator.js
@@ -633,15 +633,17 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
if (field.label || field.labelBind) {
html += "