Skip to content

Commit

Permalink
Merge pull request #241 from AtlasOfLivingAustralia/feature/issue3049
Browse files Browse the repository at this point in the history
enhancement and fix for species pre-pop
  • Loading branch information
chrisala authored Apr 8, 2024
2 parents d8f948d + 298b153 commit df967f1
Show file tree
Hide file tree
Showing 5 changed files with 765 additions and 36 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ plugins {
}


version "6.2-SNAPSHOT"
version "6.3-SPECIES-SNAPSHOT"
group "org.grails.plugins"

apply plugin:"eclipse"
Expand Down
9 changes: 4 additions & 5 deletions grails-app/assets/javascripts/forms-knockout-bindings.js
Original file line number Diff line number Diff line change
Expand Up @@ -1230,9 +1230,7 @@
'init': function (element, valueAccessor, allBindings, viewModel, bindingContext) {
var dataModelItem = valueAccessor();
var behaviours = dataModelItem.get('behaviour');
for (var i = 0; i < behaviours.length; i++) {
var behaviour = behaviours[i];

behaviours && behaviours.forEach(function(behaviour) {
if (behaviour.type == 'pre_populate') {
var config = behaviour.config;
var dataLoaderContext = dataModelItem.context;
Expand All @@ -1245,6 +1243,8 @@
propTarget.loadData(value);
} else if (_.isFunction(propTarget.load)) {
propTarget.load(value);
} else if (propTarget && propTarget.listParent && _.isFunction(propTarget.listParent["load" + propTarget.listName])) {
propTarget.listParent["load" + propTarget.listName](value);
} else if (ko.isObservable(propTarget)) {
propTarget(value);
} else {
Expand Down Expand Up @@ -1295,8 +1295,7 @@
}); // This is a computed rather than a pureComputed as it has a side effect.
});
}
}

});
}
};

Expand Down
1 change: 1 addition & 0 deletions grails-app/assets/javascripts/forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -1084,6 +1084,7 @@ function orEmptyArray(v) {
var listName = context.listName;
var modelName = context.outputModel.name;

self.listParent = context.parent;
self.listName = listName;
self.addRow = function (data) {
var newItem = self.newItem(data, self.rowCount());
Expand Down
Loading

0 comments on commit df967f1

Please sign in to comment.