Skip to content

Commit

Permalink
Re-add project area #3436
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisala committed Feb 7, 2025
1 parent 5d604d3 commit 3a10c85
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -918,6 +918,10 @@ class ProjectController {
if (model.activity.siteId) {
model.reportSite = sites?.find { it.siteId == model.activity.siteId }
}
Map projectArea = sites?.find { it.type == SiteService.SITE_TYPE_PROJECT_AREA }
if (projectArea) {
model.projectArea = siteService.getSiteGeoJson(projectArea.siteId)
}
model.selectableFeaturesUrl = g.createLink(action:'ajaxProjectSites', id:projectId)
}
model
Expand Down
2 changes: 1 addition & 1 deletion grails-app/views/activity/activityReport.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
};
var locked = ${locked};
var metaModel = <fc:modelAsJavascript model="${metaModel}" default="{}"/>
var metaModel = <fc:modelAsJavascript model="${metaModel}" default="{}"/>;
var master = null;
var mapPopupSelector = '#map-modal';
var reportMasterOptions = {
Expand Down
12 changes: 12 additions & 0 deletions src/main/scripts/releases/4.2/restoreSites.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
load("../../utils/audit.js");
let projectId = '7743afa2-6a8d-4476-a38d-964c037421bd';
let excludedNames = ['219', '259', '284', '1022', '1331', '830', '228', '1434', '1047'];

db.site.find({projects:projectId, type:'worksArea', name: {$nin: excludedNames}}).forEach(function(site) {
site.status = 'active';
site.notes = null;

db.site.replaceOne({_id:site._id}, site);

audit('site', site.siteId, 'update', '<system>');
});

0 comments on commit 3a10c85

Please sign in to comment.