mirror of
https://github.com/ZwareBear/awx.git
synced 2026-05-16 15:58:39 -05:00
Convert organization Select to Lookup
This commit is contained in:
@@ -77,25 +77,24 @@ function httpOptions (resource) {
|
||||
});
|
||||
}
|
||||
|
||||
function get (method, keys) {
|
||||
let model;
|
||||
function options (keys) {
|
||||
return this.find('options', keys);
|
||||
}
|
||||
|
||||
if (keys) {
|
||||
model = this.model[method.toUpperCase()];
|
||||
} else {
|
||||
model = this.model.GET;
|
||||
keys = method;
|
||||
}
|
||||
function get (keys) {
|
||||
return this.find('get', keys);
|
||||
}
|
||||
|
||||
function find (method, keys) {
|
||||
let value = this.model[method.toUpperCase()];
|
||||
|
||||
if (!keys) {
|
||||
return model;
|
||||
return value;
|
||||
}
|
||||
|
||||
keys = keys.split('.');
|
||||
|
||||
let value = model;
|
||||
|
||||
try {
|
||||
keys = keys.split('.');
|
||||
|
||||
keys.forEach(key => {
|
||||
let bracketIndex = key.indexOf('[');
|
||||
let hasArray = bracketIndex !== -1;
|
||||
@@ -137,6 +136,8 @@ function getById (id) {
|
||||
function BaseModel (path) {
|
||||
this.model = {};
|
||||
this.get = get;
|
||||
this.options = options;
|
||||
this.find = find;
|
||||
this.normalizePath = normalizePath;
|
||||
this.getById = getById;
|
||||
this.request = request;
|
||||
|
||||
@@ -3,7 +3,7 @@ const ENCRYPTED_VALUE = '$encrypted$';
|
||||
let BaseModel;
|
||||
|
||||
function createFormSchema (method, config) {
|
||||
let schema = Object.assign({}, this.get('options', `actions.${method.toUpperCase()}`));
|
||||
let schema = Object.assign({}, this.options(`actions.${method.toUpperCase()}`));
|
||||
|
||||
if (config && config.omit) {
|
||||
config.omit.forEach(key => {
|
||||
|
||||
Reference in New Issue
Block a user