mirror of
https://github.com/ansible/awx.git
synced 2026-01-22 23:18:03 -03:30
On Permissions detail page, Permission radio button is now required and validation works correctly.
This commit is contained in:
parent
cfb638e8e1
commit
453c13f116
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -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: {
|
||||
|
||||
@ -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 += "</label>\n";
|
||||
}
|
||||
if ( (options.mode == 'add' && field.addRequired) || (options.mode == 'edit' && field.editRequired) ) {
|
||||
html += "<span class=\"error\" ng-show=\"" + this.form.name + '_form.' + fld + ".$dirty && " +
|
||||
this.form.name + '_form.' + fld + ".$error.required\">A value is required!</span>\n";
|
||||
}
|
||||
html += "<p><span class=\"error api-error\" ng-bind=\"" + fld + "_api_error\"></span></p>\n";
|
||||
html += "</div>\n";
|
||||
html += "</div>\n";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user