diff --git a/awx/ui/static/js/controllers/Permissions.js b/awx/ui/static/js/controllers/Permissions.js index ac6069e0a3..a4e7115808 100644 --- a/awx/ui/static/js/controllers/Permissions.js +++ b/awx/ui/static/js/controllers/Permissions.js @@ -135,6 +135,7 @@ function PermissionsAdd ($scope, $rootScope, $compile, $location, $log, $routePa else { scope.projectrequired = true; } + scope.permission_type = null; } } @@ -246,6 +247,7 @@ function PermissionsEdit ($scope, $rootScope, $compile, $location, $log, $routeP else { scope.projectrequired = true; } + scope.permission_type = null; } } diff --git a/awx/ui/static/js/forms/Permissions.js b/awx/ui/static/js/forms/Permissions.js index 11fc817cc8..078e6e5cb5 100644 --- a/awx/ui/static/js/forms/Permissions.js +++ b/awx/ui/static/js/forms/Permissions.js @@ -70,7 +70,9 @@ angular.module('PermissionFormDefinition', []) {label: 'Write', value: 'write', ngShow: "category == 'Inventory'" }, {label: 'Run', value: 'run', ngShow: "category == 'Deploy'" }, {label: 'Check', value: 'check', ngShow: "category == 'Deploy'" } - ] + ], + addRequired: true, + editRequired: true } /* , deployment_permission_type: { diff --git a/awx/ui/static/lib/ansible/form-generator.js b/awx/ui/static/lib/ansible/form-generator.js index 6ca3e6b11c..5b0340e2df 100644 --- a/awx/ui/static/lib/ansible/form-generator.js +++ b/awx/ui/static/lib/ansible/form-generator.js @@ -399,9 +399,15 @@ angular.module('FormGenerator', ['GeneratorHelpers']) html += "ng-model=\"" + fld + "\" "; html += (field.ngChange) ? this.attr(field,'ngChange') : ""; html += (field.readonly) ? "readonly " : ""; + html += (options.mode == 'edit' && field.editRequired) ? "required " : ""; + html += (options.mode == 'add' && field.addRequired) ? "required " : ""; html += " /> " + field.options[i].label + "\n"; html += "\n"; } + if ( (options.mode == 'add' && field.addRequired) || (options.mode == 'edit' && field.editRequired) ) { + html += "A value is required!\n"; + } html += "
\n"; html += "\n"; html += "\n";