Skip to content

Commit

Permalink
6.1.1-SNAPSHOT
Browse files Browse the repository at this point in the history
- create site when siteId is missing
  • Loading branch information
temi committed Sep 19, 2023
1 parent 3a0e07f commit 2ee8860
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 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.1"
version "6.1.1-SNAPSHOT"
group "org.grails.plugins"

apply plugin:"eclipse"
Expand Down
8 changes: 7 additions & 1 deletion grails-app/assets/javascripts/viewModels.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,15 @@ function enmapify(args) {
viewModel.getSiteId = function () {
return siteIdObservable();
};
viewModel.loadActivitySite = function () {
viewModel.loadActivitySite = function (data) {
var siteId = activityLevelData.activity && activityLevelData.activity.siteId;
siteId && siteIdObservable(siteId);
// if siteId is not set, then we need to create a site from lat and lon coordinates
if (edit && !siteIdObservable() && data) {
if (data.decimalLatitude && data.decimalLongitude) {
viewModel.addMarker(data);
}
}
};

function isEmpty(value){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ class ModelJSTagLib {
if (data.${mod.name} && typeof data.${mod.name} !== 'undefined') {
self.data.${mod.name}(data.${mod.name});
} else {
self.loadActivitySite();
self.loadActivitySite({decimalLatitude: data.${mod.name}Latitude, decimalLongitude: data.${mod.name}Longitude);
}
if (data.${mod.name}Accuracy){
Expand Down

0 comments on commit 2ee8860

Please sign in to comment.