mirror of
https://github.com/ansible/awx.git
synced 2026-02-18 19:50:05 -03:30
Add ability to submit cred form after api validation error
This commit is contained in:
@@ -6,6 +6,9 @@ function EditCredentialsController (models, $state, $scope, strings) {
|
||||
let credentialType = models.credentialType;
|
||||
let organization = models.organization;
|
||||
|
||||
let omit = ['user', 'team', 'inputs'];
|
||||
let isEditable = credential.isEditable();
|
||||
|
||||
vm.mode = 'edit';
|
||||
vm.strings = strings;
|
||||
vm.panelTitle = credential.get('name');
|
||||
@@ -35,11 +38,12 @@ function EditCredentialsController (models, $state, $scope, strings) {
|
||||
// Only exists for permissions compatibility
|
||||
$scope.credential_obj = credential.get();
|
||||
|
||||
vm.form = credential.createFormSchema({
|
||||
omit: ['user', 'team', 'inputs']
|
||||
});
|
||||
|
||||
vm.form.disabled = !credential.isEditable();
|
||||
if (isEditable) {
|
||||
vm.form = credential.createFormSchema('put', { omit });
|
||||
} else {
|
||||
vm.form = credential.createFormSchema({ omit });
|
||||
vm.form.disabled = !isEditable;
|
||||
}
|
||||
|
||||
vm.form.organization._resource = 'organization';
|
||||
vm.form.organization._model = organization;
|
||||
|
||||
Reference in New Issue
Block a user