mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 10:00:01 -03:30
add autopopulation parameter to lookupinit
This commit is contained in:
parent
3c2f3f323a
commit
df5a0a76d8
@ -38,9 +38,16 @@ export default
|
||||
instructions = params.instructions,
|
||||
postAction = params.postAction,
|
||||
callback = params.callback,
|
||||
autopopulateLookup,
|
||||
input_type = (params.input_type) ? params.input_type: "checkbox",
|
||||
defaultUrl, name, watchUrl;
|
||||
|
||||
if (params.autopopulateLookup !== undefined) {
|
||||
autopopulateLookup = params.autopopulateLookup;
|
||||
} else {
|
||||
autopopulateLookup = true;
|
||||
}
|
||||
|
||||
if (params.url) {
|
||||
// pass in a url value to override the default
|
||||
defaultUrl = params.url;
|
||||
@ -67,8 +74,11 @@ export default
|
||||
sourceField = form.fields[field].sourceField;
|
||||
|
||||
// this logic makes sure that the form is being added, and that the lookup to be autopopulated is required
|
||||
// we also look to see if the lookupinit autopopulateLookup parameter passed in by the controller is false
|
||||
function fieldIsAutopopulatable() {
|
||||
if (parent_scope.mode === "add") {
|
||||
if (autopopulateLookup === false) {
|
||||
return false;
|
||||
} if (parent_scope.mode === "add") {
|
||||
if (parent_scope[sourceModel + "_field"].awRequiredWhen &&
|
||||
parent_scope[sourceModel + "_field"].awRequiredWhen.variable &&
|
||||
parent_scope[parent_scope[sourceModel + "_field"].awRequiredWhen.variable]) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user