mirror of
https://github.com/ansible/awx.git
synced 2026-02-18 19:50:05 -03:30
Add org Lookup implementation and WIP credential_type
This commit is contained in:
@@ -6,7 +6,6 @@ function EditCredentialsController (models, $state, $scope) {
|
||||
let me = models.me;
|
||||
let credential = models.credential;
|
||||
let credentialType = models.credentialType;
|
||||
let organization = models.organization;
|
||||
|
||||
vm.tab = {
|
||||
details: {
|
||||
@@ -21,9 +20,9 @@ function EditCredentialsController (models, $state, $scope) {
|
||||
};
|
||||
|
||||
$scope.$watch('$state.current.name', (value) => {
|
||||
if (value === 'credentials.edit') {
|
||||
if (/credentials.edit($|\.organization$)/.test(value)) {
|
||||
vm.tab.details._active = true;
|
||||
vm.tab.details._permissions = false;
|
||||
vm.tab.permissions._active = false;
|
||||
} else {
|
||||
vm.tab.permissions._active = true;
|
||||
vm.tab.details._active = false;
|
||||
@@ -39,13 +38,10 @@ function EditCredentialsController (models, $state, $scope) {
|
||||
omit: ['user', 'team', 'inputs']
|
||||
});
|
||||
|
||||
vm.form.organization._placeholder = DEFAULT_ORGANIZATION_PLACEHOLDER;
|
||||
vm.form.organization._data = organization.get('results');
|
||||
vm.form.organization._format = 'objects';
|
||||
vm.form.organization._exp = 'org as org.name for org in state._data';
|
||||
vm.form.organization._display = 'name';
|
||||
vm.form.organization._key = 'id';
|
||||
vm.form.organization._value = organization.getById(credential.get('organization'));
|
||||
vm.form.organization._resource = 'organization';
|
||||
vm.form.organization._route = 'credentials.edit.organization';
|
||||
vm.form.organization._value = credential.get('summary_fields.organization.id');
|
||||
vm.form.organization._displayValue = credential.get('summary_fields.organization.name');
|
||||
|
||||
vm.form.credential_type._data = credentialType.get('results');
|
||||
vm.form.credential_type._format = 'grouped-object';
|
||||
|
||||
Reference in New Issue
Block a user