diff --git a/awx/ui/static/js/forms/Projects.js b/awx/ui/static/js/forms/Projects.js index 0073d36766..8fb91265b4 100644 --- a/awx/ui/static/js/forms/Projects.js +++ b/awx/ui/static/js/forms/Projects.js @@ -83,8 +83,6 @@ angular.module('ProjectFormDefinition', []) type: 'select', id: 'local-path-select', ngOptions: 'path for path in project_local_paths', - addRequired: false, - editRequired: false, awRequiredWhen: { variable: "pathRequired", init: "true" }, ngShow: "scm_type == '' || scm_type == null", awPopOver: '
Select from the list of directories found in the base path.' + diff --git a/awx/ui/static/lib/ansible/directives.js b/awx/ui/static/lib/ansible/directives.js index cffa971d96..af0c2d38d4 100644 --- a/awx/ui/static/lib/ansible/directives.js +++ b/awx/ui/static/lib/ansible/directives.js @@ -107,22 +107,30 @@ angular.module('AWDirectives', ['RestServices', 'Utilities', 'AuthService', 'Hos function checkIt () { var viewValue = elm.val(); + var txt, label; validity = true; if ( scope[attrs.awRequiredWhen] && (elm.attr('required') == null || elm.attr('required') == undefined) ) { $(elm).attr('required','required'); if ($(elm).hasClass('lookup')) { $(elm).parent().parent().parent().find('label').prepend('* '); } + else { + $(elm).parent().parent().find('label').prepend('* '); + } } else if (!scope[attrs.awRequiredWhen]) { elm.removeAttr('required'); if ($(elm).hasClass('lookup')) { - var txt = $(elm).parent().parent().parent().find('label').text(); - var txt = txt.replace(/^\*/,''); - var label = $(elm).parent().parent().parent().find('label'); - if (label) { - label.text(txt); - } + txt = $(elm).parent().parent().parent().find('label').text(); + label = $(elm).parent().parent().parent().find('label'); + } + else { + txt = $(elm).parent().parent().find('label').text(); + label = $(elm).parent().parent().find('label'); + } + txt = txt.replace(/^\* /,''); + if (label) { + label.text(txt); } } if (scope[attrs.awRequiredWhen] && (viewValue == undefined || viewValue == null || viewValue == '')) {