Skip to content

Commit

Permalink
Merge pull request #2816 from AtlasOfLivingAustralia/2.10
Browse files Browse the repository at this point in the history
v2.10
  • Loading branch information
chrisala authored Mar 3, 2023
2 parents d1c07e1 + 0a8d900 commit ab1049f
Show file tree
Hide file tree
Showing 81 changed files with 3,065 additions and 858 deletions.
1,331 changes: 820 additions & 511 deletions forms/bushfires/Priority Species Grants Final Report.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions forms/bushfires/bushfiresStatesProgressReport.json
Original file line number Diff line number Diff line change
Expand Up @@ -5190,6 +5190,7 @@
"Environmental thinning",
"Improving fish passage",
"Natural features (rocks, logs)",
"Reef restoration/creation",
"Other"
],
"validate": "required"
Expand Down
1 change: 1 addition & 0 deletions forms/bushfires/stateInterventionFinalReport.json
Original file line number Diff line number Diff line change
Expand Up @@ -5226,6 +5226,7 @@
"Environmental thinning",
"Improving fish passage",
"Natural features (rocks, logs)",
"Reef restoration/creation",
"Other"
],
"validate": "required"
Expand Down
1 change: 1 addition & 0 deletions forms/bushfires/stateInterventionProgressReport.json
Original file line number Diff line number Diff line change
Expand Up @@ -5191,6 +5191,7 @@
"Environmental thinning",
"Improving fish passage",
"Natural features (rocks, logs)",
"Reef restoration/creation",
"Other"
],
"validate": "required"
Expand Down
6 changes: 3 additions & 3 deletions forms/esp/ESP Annual Report Submission.json
Original file line number Diff line number Diff line change
Expand Up @@ -577,16 +577,16 @@
"type": "computed"
},
{
"expression": "activity.plannedEndDate",
"name": "date",
"expression": "reportId",
"name": "reportId",
"type": "computed"
},
{
"name": "scoreIds",
"value": "4d03150f-763b-4baf-b49f-60a2dbda0235"
}
],
"url": "/project/scoresForFinancialYear/"
"url": "/project/scoresForReport/"
}
}
]
Expand Down
202 changes: 202 additions & 0 deletions forms/other/habitatAugmentation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
{
"name": "Habitat augmentation",
"description": null,
"type": "Activity",
"sections": [
{
"name": "Habitat augmentation",
"description": null,
"optionalQuestionText": null,
"optional": false,
"collapsedByDefault": false,
"collapsibleHeading": null,
"templateName": "habitatAugmentation",
"template": {
"dataModel": [
{
"columns": [
{
"dataType": "text",
"name": "initialOrFollowup",
"constraints": [
"Initial",
"Follow-up"
],
"validate": "required"
},
{
"dataType": "number",
"name": "areaAugmentedHa",
"units": "ha",
"decimalPlaces": 3,
"validate": "required,min[0]"
},
{
"dataType": "number",
"name": "lengthAugmentedKm",
"units": "km",
"decimalPlaces": 3,
"validate": "required,min[0]"
},
{
"dataType": "number",
"name": "numberOfStructuresInstalled",
"validate": "required,min[0]"
},
{
"dataType": "text",
"name": "habitatAugmentationType",
"description": "",
"constraints": [
"Artificial fauna movement devices",
"Artificial nesting or roosting habitat (incl. tiles, fence posts)",
"Environmental thinning",
"Improving fish passage",
"Natural features (rocks, logs)",
"Reef restoration/creation",
"Other"
],
"validate": "required"
},
{
"dataType": "text",
"name": "otherHabitatAugmentationType",
"description": "Please specify the habitat augmentation type if Other (specify in notes) was selected in the Type of habitat augmentation column.",
"behaviour": [
{
"condition": "habitatAugmentationType == \"Other\"",
"type": "visible"
}
],
"validate": "required,maxSize[100]"
},
{
"dataType": "text",
"name": "habitatAugmentationObjective",
"description": "",
"validate": "required,maxSize[300]"
},
{
"dataType": "number",
"name": "areaBenefittedByHabitatAugmentationHa",
"units": "ha",
"decimalPlaces": 3
},
{
"dataType": "text",
"name": "evidenceOfBenefit",
"validate": "maxSize[300]"
}
],
"dataType": "list",
"name": "habitatAugmentationDetails"
},
{
"dataType": "text",
"name": "comments",
"validate": "maxSize[1500]"
}
],
"title": "Habitat augmentation",
"modelName": "habitatAugmentation",
"viewModel": [
{
"type": "section",
"items": [
{
"columns": [
{
"width": "10%",
"source": "initialOrFollowup",
"title": "Initial or follow-up control?",
"type": "selectOne"
},
{
"width": "10%",
"type": "col",
"title": "Actual area (ha) / length (km) of habitat augmentation",
"items": [
{
"source": "areaAugmentedHa",
"type": "number",
"displayOptions": {
"displayUnits": true
}
},
{
"source": "lengthAugmentedKm",
"type": "number",
"displayOptions": {
"displayUnits": true
}
}
]
},
{
"width": "5%",
"source": "numberOfStructuresInstalled",
"type": "number",
"title": "Number of structures installed"
},
{
"width": "15%",
"title": "Type of habitat augmentation / installed",
"type": "col",
"items": [
{
"type": "row",
"items": [
{
"source": "habitatAugmentationType",
"type": "select2"
}
]
},
{
"type": "row",
"items": [
{
"source": "otherHabitatAugmentationType",
"type": "textarea"
}
]
}
]
},
{
"width": "15%",
"source": "habitatAugmentationObjective",
"title": "Purpose of habitat augmentation",
"type": "textarea"
}
],
"userAddedRows": true,
"source": "habitatAugmentationDetails",
"type": "table"
},
{
"type": "row",
"items": [
{
"preLabel": "Clarification, if needed",
"type": "textarea",
"rows": 4,
"css": "span8",
"source": "comments"
}
]
}
]
}
]
}
}
],
"formVersion": 1,
"category": null,
"status": "active",
"gmsId": null,
"supportsSites": false,
"supportsPhotoPoints": false,
"minOptionalSectionsCompleted": 1
}
1 change: 1 addition & 0 deletions forms/rlp/rlpOutputReport.json
Original file line number Diff line number Diff line change
Expand Up @@ -6691,6 +6691,7 @@
"Environmental thinning",
"Improving fish passage",
"Natural features (rocks, logs)",
"Reef restoration/creation",
"Other"
],
"validate": "required"
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
meritVersion=2.9
meritVersion=2.10
#gorm.version=7.0.8.RELEASE
grailsVersion=4.1.2
gormVersion=7.0.2
Expand Down
39 changes: 13 additions & 26 deletions grails-app/assets/javascripts/esp-overview.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,15 @@ var SiteStatusModel = function(site, currentStage, map, sitesViewModel) {
*
* This function has a side effect of saving a selected reporting period in local storage
*/
function selectReportingPeriod(project) {
var selectedYearStorageKey = 'selectedFinancialYear-'+project.projectId;
var selectedYear = project.financialYearSelected || amplify.store(selectedYearStorageKey);
function selectReportingPeriod(project, options) {
var selectedYearStorageKey = 'selectedReportId-'+project.projectId;
var selectedReportId = options.selectedReportId || amplify.store(selectedYearStorageKey);
var currentReport;
if (selectedYear) {
currentReport = findReportFromFinancialYear(project.reports,selectedYear);
amplify.store(selectedYearStorageKey, selectedYear);
if (selectedReportId) {
currentReport = _.find(project.reports, function(selectedReport) {
return selectedReport.reportId == selectedReportId;
});
amplify.store(selectedYearStorageKey, selectedReportId);
}
else {
currentReport = findReportFromDate(project.reports);
Expand All @@ -153,7 +155,7 @@ var SimplifiedReportingViewModel = function(project, config) {
return report.publicationStatus == 'published' || report.publicationStatus == 'pendingApproval';
});

var currentReport = selectReportingPeriod(project);
var currentReport = selectReportingPeriod(project, config);

currentReport = new Report(currentReport);

Expand Down Expand Up @@ -192,7 +194,6 @@ var SimplifiedReportingViewModel = function(project, config) {

var reportToDate = currentReport.toDate;

self.reportingFinancialYear = isoDateToFinancialYear(reportToDate);
self.dueDate = convertToSimpleDate(reportToDate);

self.finishedReporting = currentStage.canSubmitReport();
Expand Down Expand Up @@ -239,7 +240,7 @@ var SimplifiedReportingViewModel = function(project, config) {
var currentDate = new Date().toISOStringNoMillis();
_.each(project.reports, function (report){
if (report.fromDate <= currentDate) {
self.reportSelectionList.push({label:buildReportLabel(report), value:isoDateToFinancialYear(report.toDate), stage: report.name, disable: report.publicationStatus == 'cancelled'});
self.reportSelectionList.push({label:buildReportLabel(report), value:report.reportId, stage: report.name, disable: report.publicationStatus == 'cancelled'});
}
});

Expand All @@ -258,7 +259,7 @@ var SimplifiedReportingViewModel = function(project, config) {
}

// will set the value of the dropdown Reporting Period
self.selectedChoice = ko.observable(isoDateToFinancialYear(currentReport.toDate));
self.selectedChoice = ko.observable(currentReport.reportId);

var selectedReport = _.find(self.reportSelectionList, function(report) { return report.value == self.selectedChoice()});
var selectedReportLabel = selectedReport && selectedReport.label;
Expand All @@ -269,12 +270,12 @@ var SimplifiedReportingViewModel = function(project, config) {
popoverText = 'This report has been marked as <strong>Not Required</strong>. Please contact your ESP Project Manager for further information.';
}
$('.reportingPeriodSpan').popover({html:useHtml, title:'Please select reporting period', content:popoverText, placement:'top', trigger:'hover'})
$('.reportingPeriodSpan').popover('show');

// refreshes the page with the financial year selected
self.selectionChanged = function(event) {
blockUIWithMessage('Reloading project...');
var url = config.projectUrl;
document.location.href = url + "/" + "?financialYearSelected=" + event.selectedChoice();
document.location.href = url + "/" + "?selectedReportId=" + event.selectedChoice();
}

self.adminReportingHelp = ko.pureComputed(function() {
Expand Down Expand Up @@ -440,9 +441,6 @@ var SimplifiedReportingViewModel = function(project, config) {
if (!hasSubmittedOrPublishedReport && !self.hasCollectedReportingDates()) {
self.collectReportDates();
}
else if (self.hasCollectedReportingDates()) {
self.reportingFinancialYear = isoDateToFinancialYear(project.custom.reportindPeriodEnd);
}

};

Expand Down Expand Up @@ -500,14 +498,3 @@ function findReportFromDate (reports) {

return report;
}

function findReportFromFinancialYear (reports,financialYearSelected) {
var report;
$.each(reports, function (i, period) {
if (financialYearSelected == isoDateToFinancialYear(period.toDate)) {
report = period;
}
});

return report;
}
Loading

0 comments on commit ab1049f

Please sign in to comment.