diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index efa01fc0e..6a79047d5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,7 +30,13 @@ jobs: with: node-version: 16 + - run: npm config set //npm.pkg.github.com/:_authToken $NODE_AUTH_TOKEN + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - run: npm install + + - name: Validate Gradle wrapper uses: gradle/wrapper-validation-action@v1.0.6 diff --git a/.gitignore b/.gitignore index c3ffcbbf6..46bd4e399 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,6 @@ grails-app/assets/vendor-ext /build/ /.gradle/ /grails-app/assets/components/compile/templates.js +/ehcache/.lock +/ehcache/file/homePageStatistics_c96622e3da276e1ccd3532e6f1f975756232b01a/offheap-disk-store/ehcache-disk-store.data +/ehcache/file/homePageStatistics_c96622e3da276e1ccd3532e6f1f975756232b01a/offheap-disk-store/ehcache-disk-store.meta diff --git a/.npmrc b/.npmrc new file mode 100644 index 000000000..737d3ce72 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +@atlasoflivingaustralia:registry=https://npm.pkg.github.com \ No newline at end of file diff --git a/README.md b/README.md index b82d59bda..bceac21ce 100644 --- a/README.md +++ b/README.md @@ -28,10 +28,14 @@ It is currently in use by the Australian Government. This configuration file largely specifies URLs to MERIT dependencies. See https://github.com/AtlasOfLivingAustralia/fieldcapture/wiki/MERIT-Dependencies for information about these. Note that you will need to obtain an ALA API key to use ALA services and a Google Maps API key and specify them in this file. +npm / nodejs are used to run javascript unit tests. There is a dependency on the ecodata-client-plugin for some javascript which is published to github packages which requires an access token to read. + * Install npm and nodejs (see https://www.npmjs.com/get-npm) +* Authenticate to github packages using your github username and access token setup for package:read * Install the node dependencies for MERIT. Note these are currently only used for testing. ``` +npm login --scope=@atlasoflivingaustralia --auth-type=legacy --registry=https://npm.pkg.github.com npm install npm install -g karma ``` diff --git a/build.gradle b/build.gradle index 3dbad12d5..b039b7c2e 100644 --- a/build.gradle +++ b/build.gradle @@ -97,8 +97,7 @@ dependencies { implementation "org.grails.plugins:gsp" implementation 'dk.glasius:external-config:3.0.0' implementation "org.grails.plugins:ala-auth:$alaSecurityLibsVersion" - // Needs to be left at 2.0 until we finish replacing pdfgen HTML report generation - implementation "org.grails.plugins:ala-ws-security-plugin:2.0" + implementation "org.grails.plugins:ala-ws-security-plugin:$alaSecurityLibsVersion" implementation "org.grails.plugins:ala-ws-plugin:$alaSecurityLibsVersion" implementation "au.org.ala:userdetails-service-client:$alaSecurityLibsVersion" implementation "com.github.ben-manes.caffeine:caffeine:3.1.6" @@ -150,6 +149,7 @@ dependencies { implementation "commons-io:commons-io:2.6" implementation "org.seleniumhq.selenium:selenium-chrome-driver:3.14.0" implementation "com.bertramlabs.plugins:asset-pipeline-grails:$assetPipelineVersion" + implementation group: 'com.googlecode.owasp-java-html-sanitizer', name: 'owasp-java-html-sanitizer', version: '20220608.1' compileOnly "io.micronaut:micronaut-inject-groovy" console "org.grails:grails-console" @@ -186,7 +186,7 @@ dependencies { providedCompile "io.methvin:directory-watcher:0.4.0" if (!Boolean.valueOf(inplace)) { - implementation "org.grails.plugins:ecodata-client-plugin:6.1.2" + implementation "org.grails.plugins:ecodata-client-plugin:6.2" } } @@ -244,15 +244,16 @@ clientDependencies { 'underscore'('1.12.1') { include 'underscore.js' } - 'datatables.net-bs4'("1.10.25") - "datatables.net-buttons-dt"("1.7.1") - 'datatables.net-buttons-bs4'("1.7.1") + 'datatables.net'("1.13.6") + 'datatables.net-bs4'("1.13.6") + "datatables.net-buttons-dt"("2.4.2") + 'datatables.net-buttons-bs4'("2.4.2") '@danielfarrell/bootstrap-combobox'('1.1.8', transitive:false) 'fancybox'('3.0.1') "fuelux"("3.17.2", transitive:false) "fuse.js"("6.4.6", transitive:false) "leaflet"("0.7.7") - "select2-theme-bootstrap4"("1.0.0") + "select2-theme-bootstrap4"("1.0.2") "slickgrid"("2.4.38") "slider-pro"("1.6.0", transitive:false) "jquery-appear-original"("0.4.1", transitive:false) diff --git a/forms/bushfires/bushfiresStatesProgressReport.json b/forms/bushfires/bushfiresStatesProgressReport.json index aab43862d..444389452 100644 --- a/forms/bushfires/bushfiresStatesProgressReport.json +++ b/forms/bushfires/bushfiresStatesProgressReport.json @@ -9968,52 +9968,39 @@ "name": "sitesTested" }, { - "defaultValue": { - "type": "computed", + "computed": { "expression": "$geom.areaHa(sitesTested)" }, "dataType": "number", "name": "areaTestedHa", - "units": "Ha", - "validate": [ - { - "rule": "min", - "param": { - "type": "computed", - "expression": "$geom.areaHa(sitesTested)*0.9" - } - }, + "units": "ha", + "decimalPlaces": 3, + "behaviour": [ { - "rule": "max", - "param": { - "type": "computed", - "expression": "$geom.areaHa(sitesTested)*1.1" + "condition": "areaTestedChangeHa > 0", + "type": "conditional_validation", + "value": { + "message": "", + "validate": "required,min[0.0001]" } } ] }, { - "defaultValue": { - "type": "computed", + "computed": { "expression": "$geom.lengthKm(sitesTested)" }, "dataType": "number", "name": "lengthTestedKm", - "units": "Km", - "validate": [ - { - "rule": "min", - "param": { - "type": "computed", - "expression": "$geom.lengthKm(sitesTested)*0.9", - "errorMessages": "Please Select" - } - }, + "units": "km", + "decimalPlaces": 3, + "behaviour": [ { - "rule": "max", - "param": { - "type": "computed", - "expression": "$geom.lengthKm(sitesTested)*1.1" + "condition": "lengthTestedChangeKm > 0", + "type": "conditional_validation", + "value": { + "message": "", + "validate": "required,min[0.0001]" } } ] diff --git a/forms/nht/nhtOutputReport.json b/forms/nht/nhtOutputReport.json index a793fc5e1..15cbb1f9a 100644 --- a/forms/nht/nhtOutputReport.json +++ b/forms/nht/nhtOutputReport.json @@ -1,13 +1,15 @@ { - "id": "62b005e698aff40faac38c16", - "dateCreated": "2022-06-20T05:30:14Z", + "id": "64bf6c1ac9126a73736284ff", + "dateCreated": "2023-07-25T06:30:50Z", "minOptionalSectionsCompleted": 0, "supportsSites": true, - "lastUpdated": "2023-03-16T12:49:16Z", + "lastUpdated": "2023-10-04T11:46:09Z", "createdUserId": "1493", + "external": false, "activationDate": null, "supportsPhotoPoints": false, "publicationStatus": "published", + "externalIds": null, "gmsId": null, "name": "NHT Output Report", "sections": [ @@ -20,7 +22,7 @@ { "name": "nhtCommunications", "dataType": "text", - "description": "This does not include communication activities undertaken under the 'Communication Materials' Project Service or regional capacity service. All Communication Materials must correctly acknowledge Australian Government funding.", + "description": "This does not include communication activities undertaken under the 'Communication Materials' Project Service or regional capacity service. Refer to the Project Services and Overheads (PS&O) service summary to clarify what type of communications activity is paid under the PS&O service. All Communication Materials must correctly acknowledge Australian Government funding.", "validate": "required", "constraints": [ "Yes", @@ -31,12 +33,18 @@ "name": "yesCommunicationsMaterial", "dataType": "text", "validate": "required,maxSize[300]", + "description": "Upload documents by clicking onto the 'Attach Document' button or provide a link in the free text field.", "behaviour": [ { "condition": "nhtCommunications == \"Yes\"", "type": "enable" } ] + }, + { + "dataType": "document", + "name": "attachments", + "description": "Please attach any Evidence of Service Delivery here." } ], "viewModel": [ @@ -60,6 +68,27 @@ "preLabel": "If yes, please provide link or copy of the material." } ] + }, + { + "type": "row", + "behaviour": [ + { + "type": "if_expression", + "condition": "nhtCommunications == \"Yes\"" + } + ], + "items": [ + { + "type": "col", + "items": [ + { + "title": "Attached documents", + "source": "attachments", + "type": "document" + } + ] + } + ] } ] }, @@ -108,6 +137,27 @@ "dataType": "number", "name": "engagementNoParticipants", "validate": "required" + }, + { + "dataType": "date", + "name": "activityDateFrom", + "validate": "required" + }, + { + "dataType": "date", + "name": "activityDateTo", + "validate": [ + { + "rule": "required" + }, + { + "rule": "future", + "param": { + "expression": "formatDateForValidation(activityDateFrom)", + "type": "computed" + } + } + ] } ] }, @@ -117,14 +167,14 @@ "validate": "maxSize[1500]" }, { - "dataType": "text", - "name": "projectAssuranceDetails", + "dataType": "boolean", + "name": "dataUploaded", "description": "" }, { - "dataType": "boolean", - "name": "booleanField", - "description": "" + "name": "projectAssuranceDetails", + "dataType": "text", + "validate": "required,maxSize[5000]" }, { "dataType": "list", @@ -133,7 +183,7 @@ { "dataType": "document", "name": "attachments", - "description": "Please attach any Evidence of Service Delivery here" + "description": "Please attach any Evidence of Service Delivery here." } ] } @@ -144,12 +194,13 @@ { "type": "table", "source": "engagementDetails", - "title": "Please list community engagement activities undertaken, including the title, description, and the number of participants for each activity undertaken in this reporting period, if any.", + "title": "Please list community engagement activities undertaken, including the title, description, and the number of participants for each activity undertaken in this reporting period, if any.

Each activity must be reported in a separate row.
This does not include engagement activities undertaken in community/stakeholder engagement service or regional capacity service. The Register of Engagement must be retained as evidence.", + "preLabel": "If yes, please provide link or copy of the material.", "userAddedRows": true, "columns": [ { "source": "engagementType", - "type": "select2Many", + "type": "selectOne", "width": "20%", "title": "Type" }, @@ -162,6 +213,7 @@ { "type": "textarea", "source": "engagementPurpose", + "width": "25%", "title": "Purpose", "rows": 4 }, @@ -170,6 +222,18 @@ "type": "number", "width": "10%", "title": "Number of participants" + }, + { + "title": "Activity Date from", + "source": "activityDateFrom", + "type": "date", + "width": "10%" + }, + { + "title": "Activity Date to", + "source": "activityDateTo", + "type": "date", + "width": "10%" } ] } @@ -206,7 +270,7 @@ { "name": "yesUndergoneReview", "dataType": "text", - "validate": "required,maxSize[300]", + "validate": "required,maxSize[4000]", "behaviour": [ { "condition": "undergoneReview == \"Yes\"", @@ -227,7 +291,7 @@ "constraints": [ "Yes", "No", - "NA" + "Not Applicable" ] }, { @@ -237,11 +301,22 @@ "constraints": [ "Yes", "No", - "NA" + "Not Applicable" + ] + }, + { + "name": "planName", + "dataType": "text", + "validate": "required,maxSize[100]", + "behaviour": [ + { + "condition": "plansDeveloped == \"Yes\"", + "type": "enable" + } ] }, { - "name": "yesPlansDeveloped", + "name": "planPurpose", "dataType": "text", "validate": "required,maxSize[300]", "behaviour": [ @@ -258,7 +333,7 @@ "constraints": [ "Yes", "No", - "NA" + "Not Applicable" ] }, { @@ -273,9 +348,41 @@ "condition": "facilitatedPlanningMeetings == \"Yes\"" } ], - "name": "meetingDate", + "name": "meetingDateFrom", "validate": "required" }, + { + "dataType": "date", + "behaviour": [ + { + "type": "enable_and_clear", + "condition": "facilitatedPlanningMeetings == \"Yes\"" + } + ], + "name": "meetingDateTo", + "validate": [ + { + "rule": "required" + }, + { + "rule": "future", + "param": { + "expression": "formatDateForValidation(meetingDateFrom)", + "type": "computed" + } + }] + }, + { + "dataType": "text", + "behaviour": [ + { + "type": "enable_and_clear", + "condition": "facilitatedPlanningMeetings == \"Yes\"" + } + ], + "name": "meetingName", + "validate": "required,maxSize[100]" + }, { "dataType": "text", "behaviour": [ @@ -285,7 +392,7 @@ } ], "name": "meetingDescription", - "validate": "required" + "validate": "required,maxSize[4000]" } ] }, @@ -295,14 +402,14 @@ "validate": "maxSize[1500]" }, { - "dataType": "text", - "name": "projectAssuranceDetails", + "dataType": "boolean", + "name": "dataUploaded", "description": "" }, { - "dataType": "boolean", - "name": "booleanField", - "description": "" + "name": "projectAssuranceDetails", + "dataType": "text", + "validate": "required,maxSize[5000]" }, { "dataType": "list", @@ -311,7 +418,7 @@ { "dataType": "document", "name": "attachments", - "description": "Please attach any Evidence of Service Delivery here" + "description": "Please attach any Evidence of Service Delivery here." } ] } @@ -364,9 +471,16 @@ "type": "row", "items": [ { + "css": "span3", + "type": "text", + "source": "planName", + "preLabel": "Name of plan" + }, + { + "css": "span6", "type": "textarea", - "source": "yesPlansDeveloped", - "preLabel": "If yes, please provide name and purpose of plan." + "source": "planPurpose", + "preLabel": "Purpose of plan" } ] }, @@ -389,10 +503,22 @@ "userAddedRows": true, "columns": [ { - "source": "meetingDate", + "source": "meetingDateFrom", "type": "date", "width": "10%", - "title": "Meeting/Workshop Date" + "title": "Date from" + }, + { + "source": "meetingDateTo", + "type": "date", + "width": "10%", + "title": "Date to" + }, + { + "type": "text", + "source": "meetingName", + "title": "Name of event", + "rows": 4 }, { "type": "textarea", @@ -421,9 +547,7 @@ "template": { "name": "NHT - Project Commencement", "title": "Project Commencement", - "dataModel": [ - - ], + "dataModel": [], "viewModel": [ { "type": "row", @@ -455,7 +579,7 @@ "name": "undergoneWhsReview", "dataType": "text", "validate": "required", - "description":"The WHS risk register for project services must be reviewed and updated where new risks are identified, or control measures have changed.", + "description": "The WHS risk register for project services must be reviewed and updated where new risks are identified, or control measures have changed.", "constraints": [ "Yes", "No" @@ -476,7 +600,7 @@ "name": "hasNotifiableIncident", "dataType": "text", "validate": "required", - "description":"A WHS Notifiable incident is defined within Work Health and Safety Act (Cth) 2011 Part 3 – Incident Notification. (https://www.legislation.gov.au/Details/C2018C00293). Refer to Deed of Standing offer clause 42 Work Health and Safety for further information on these requirements.", + "description": "A WHS Notifiable incident is defined within Work Health and Safety Act (Cth) 2011 Part 3 – Incident Notification. (https://www.legislation.gov.au/Details/C2018C00293). Refer to Deed of Standing offer clause 42 Work Health and Safety for further information on these requirements.", "constraints": [ "Yes", "No" @@ -500,11 +624,11 @@ "name": "hasVerifiedSubContractors", "dataType": "text", "validate": "required", - "description":"If there have been no current or new subcontracting arrangement during this reporting period, please report as Not Applicable. Refer to Deed of standing offer clause 20 Subcontracting and 42 Work Health and Safety for further information on these requirements.", + "description": "If there have been no current or new subcontracting arrangement during this reporting period, please report as Not Applicable. Refer to Deed of standing offer clause 20 Subcontracting and 42 Work Health and Safety for further information on these requirements.", "constraints": [ "Yes", "No", - "NA" + "Not Applicable" ] }, { @@ -573,7 +697,7 @@ ], "items": [ { - "source": "