From 2a469cac107792dfff71d6cb71eeb8813e895fcc Mon Sep 17 00:00:00 2001 From: Joe Lipson Date: Thu, 29 Aug 2024 15:12:50 +1000 Subject: [PATCH 1/9] update build container --- cicd/build/pipeline/pipeline.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cicd/build/pipeline/pipeline.yaml b/cicd/build/pipeline/pipeline.yaml index 8fdb5fe9..6984eb22 100644 --- a/cicd/build/pipeline/pipeline.yaml +++ b/cicd/build/pipeline/pipeline.yaml @@ -94,7 +94,7 @@ Resources: Environment: Type: LINUX_CONTAINER ComputeType: BUILD_GENERAL1_SMALL - Image: aws/codebuild/standard:5.0 + Image: aws/codebuild/standard:7.0 Source: Type: CODEPIPELINE BuildSpec: !Sub cicd/${pProductComponent}/pipeline/build_alerts_buildspec.yaml From f2d3bd302b56ba816f17550e9f4c1db652d60db6 Mon Sep 17 00:00:00 2001 From: QBai <31238531+qifeng-bai@users.noreply.github.com> Date: Fri, 30 Aug 2024 09:55:30 +1000 Subject: [PATCH 2/9] #237 (fix) ' is not shown in Blogs template Bump to 4.2.2 snapshot --- build.gradle | 2 +- .../controllers/au/org/ala/alerts/AdminController.groovy | 4 ++-- .../au/org/ala/alerts/NotificationController.groovy | 2 +- grails-app/services/au/org/ala/alerts/UserService.groovy | 2 +- grails-app/views/email/blogs.gsp | 1 + 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index 9bd8a831..ed5a338e 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,7 @@ * rights and limitations under the License. */ buildscript { - version "4.2.1" + version "4.2.2-SNAPSHOT" group "au.org.ala" } diff --git a/grails-app/controllers/au/org/ala/alerts/AdminController.groovy b/grails-app/controllers/au/org/ala/alerts/AdminController.groovy index 0b9a534c..2079896e 100644 --- a/grails-app/controllers/au/org/ala/alerts/AdminController.groovy +++ b/grails-app/controllers/au/org/ala/alerts/AdminController.groovy @@ -42,7 +42,7 @@ class AdminController { def subscriptionsPerPage = grailsApplication.config.biosecurity?.subscriptionsPerPage? grailsApplication.config.biosecurity.subscriptionsPerPage.toInteger() : 10 def index() {} - @Transactional + def findUser() { List users = [] if (params.term) { @@ -51,7 +51,7 @@ class AdminController { render view: "/admin/userAlerts", model: [users: users] } - @Transactional + def updateUserEmails() { def updated = userService.updateUserEmails() flash.message = "Updated ${updated} email addresses in system" diff --git a/grails-app/controllers/au/org/ala/alerts/NotificationController.groovy b/grails-app/controllers/au/org/ala/alerts/NotificationController.groovy index d689d807..8632cd42 100644 --- a/grails-app/controllers/au/org/ala/alerts/NotificationController.groovy +++ b/grails-app/controllers/au/org/ala/alerts/NotificationController.groovy @@ -134,7 +134,7 @@ class NotificationController { notificationService.refreshProperties(queryResult, lastResult) boolean hasChanged = notificationService.hasChanged(queryResult) def records = notificationService.collectUpdatedRecords(queryResult) - def results = ["hasChanged": hasChanged, "brief": queryResult.details(), "records": records] + def results = ["hasChanged": hasChanged, "brief": queryResult.brief(), "records": records] render results as JSON } diff --git a/grails-app/services/au/org/ala/alerts/UserService.groovy b/grails-app/services/au/org/ala/alerts/UserService.groovy index 379b072f..32ed2b3a 100644 --- a/grails-app/services/au/org/ala/alerts/UserService.groovy +++ b/grails-app/services/au/org/ala/alerts/UserService.groovy @@ -85,7 +85,7 @@ class UserService { * * @return total number of updates */ -// @Transactional // transactions handled manually + int updateUserEmails() { final int pageSize = grailsApplication.config.getProperty('alerts.user-sync.batch-size', Integer, 1000) def toUpdate = [] diff --git a/grails-app/views/email/blogs.gsp b/grails-app/views/email/blogs.gsp index d66dd9fd..f7c3080f 100644 --- a/grails-app/views/email/blogs.gsp +++ b/grails-app/views/email/blogs.gsp @@ -1,6 +1,7 @@ <%@ page contentType="text/html"%> <%@ page import="java.text.SimpleDateFormat" %> <%@ page import="org.apache.commons.lang3.StringUtils" %> +<%@ page contentType="text/html; charset=UTF-8" %> From 96f3b8ea3adcf7e239f455297f02f39771f18b62 Mon Sep 17 00:00:00 2001 From: Nick dos Remedios Date: Thu, 5 Sep 2024 08:27:10 +1000 Subject: [PATCH 3/9] Bump `ala-bootstrap3` to 4.5.0 --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index ed5a338e..3f9472b3 100644 --- a/build.gradle +++ b/build.gradle @@ -121,7 +121,7 @@ dependencies { testImplementation "org.grails:grails-test-mixins:3.3.0" // Grails plugin dependencies - runtimeOnly "org.grails.plugins:ala-bootstrap3:4.4.0", noCache + runtimeOnly "org.grails.plugins:ala-bootstrap3:4.5.0", noCache implementation "org.grails.plugins:ala-auth:$alaSecurityLibsVersion" implementation "org.grails.plugins:ala-ws-security-plugin:$alaSecurityLibsVersion" implementation "org.grails.plugins:ala-ws-plugin:$alaSecurityLibsVersion" From df7507ab5f82db908b9d4167c0ffa74c95203be7 Mon Sep 17 00:00:00 2001 From: Nick dos Remedios Date: Thu, 5 Sep 2024 08:27:24 +1000 Subject: [PATCH 4/9] Fix NPE --- .../services/au/org/ala/alerts/NotificationService.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grails-app/services/au/org/ala/alerts/NotificationService.groovy b/grails-app/services/au/org/ala/alerts/NotificationService.groovy index 8c79ec1f..c3e07b66 100644 --- a/grails-app/services/au/org/ala/alerts/NotificationService.groovy +++ b/grails-app/services/au/org/ala/alerts/NotificationService.groovy @@ -385,7 +385,7 @@ class NotificationService { } } - if (queryService.checkChangeByDiff(queryResult)) { + if (queryService.checkChangeByDiff(query)) { log.debug("[QUERY " + query.id + "] Has change check. Checking JSON for query : " + query.name) changed = diffService.hasChangedJsonDiff(jsonPrevious, jsonCurrent, query) } From ab97d77802fff4f79d33d5710e59bb77a5e0c383 Mon Sep 17 00:00:00 2001 From: Nick dos Remedios Date: Thu, 5 Sep 2024 08:28:04 +1000 Subject: [PATCH 5/9] Fix broken styling on Quartz admin page --- grails-app/views/layouts/main.gsp | 1 + 1 file changed, 1 insertion(+) create mode 100644 grails-app/views/layouts/main.gsp diff --git a/grails-app/views/layouts/main.gsp b/grails-app/views/layouts/main.gsp new file mode 100644 index 00000000..5e464da5 --- /dev/null +++ b/grails-app/views/layouts/main.gsp @@ -0,0 +1 @@ + \ No newline at end of file From a816a861d6f3c92845438d89d10ce050044a56b7 Mon Sep 17 00:00:00 2001 From: Nick dos Remedios Date: Thu, 5 Sep 2024 08:28:45 +1000 Subject: [PATCH 6/9] #237 attempt to fix right quotation char issue in emails --- grails-app/views/email/blogs.gsp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/grails-app/views/email/blogs.gsp b/grails-app/views/email/blogs.gsp index f7c3080f..aaf9da8d 100644 --- a/grails-app/views/email/blogs.gsp +++ b/grails-app/views/email/blogs.gsp @@ -1,10 +1,9 @@ -<%@ page contentType="text/html"%> +<%@ page contentType="text/html" %> <%@ page import="java.text.SimpleDateFormat" %> <%@ page import="org.apache.commons.lang3.StringUtils" %> -<%@ page contentType="text/html; charset=UTF-8" %> - + - + @@ -47,12 +46,12 @@ } .main-shadow-div { - mso-table-lspace: 0pt; - mso-table-rspace: 0pt; + mso-table-lspace: 0; + mso-table-rspace: 0; box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1); width: 100%; max-width: 620px; - margin: 20px auto 0px; + margin: 20px auto 0; } .center-white-div{ @@ -82,7 +81,7 @@ } .blog-thumbnail-div { - padding: 10px 0px 10px 0px; + padding: 10px 0 10px 0; align-items: center; max-width: 130px; } @@ -192,7 +191,7 @@ %{-- int responseCode = connection.responseCode--}% %{-- if (responseCode == 404) {--}% %{-- // Handle the case where the image URL returns a 404 status code--}% -%{-- out << "Sorry, no image availabe "--}% +%{-- out << "Sorry, no image available "--}% %{-- } else {--}% %{-- // Handle the case where the image URL returns a different status code--}% %{-- out << "\"${raw(blog.title.rendered)}\""--}% From 3dca6dd7f9ab145fff0819aa28410b90e93b48d4 Mon Sep 17 00:00:00 2001 From: Nick dos Remedios Date: Fri, 6 Sep 2024 14:57:59 +1000 Subject: [PATCH 7/9] #275 Fix for `no transaction is in progress` exception for biosecurity alerts --- .../services/au/org/ala/alerts/BiosecurityService.groovy | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/grails-app/services/au/org/ala/alerts/BiosecurityService.groovy b/grails-app/services/au/org/ala/alerts/BiosecurityService.groovy index 3fca0e7a..61d5989e 100644 --- a/grails-app/services/au/org/ala/alerts/BiosecurityService.groovy +++ b/grails-app/services/au/org/ala/alerts/BiosecurityService.groovy @@ -16,6 +16,7 @@ package au.org.ala.alerts; import com.jayway.jsonpath.JsonPath import grails.converters.JSON +import grails.gorm.transactions.Transactional import org.apache.commons.lang.time.DateUtils import org.apache.http.entity.ContentType import java.text.SimpleDateFormat @@ -62,6 +63,7 @@ class BiosecurityService { * @param query * @param since The local date to check the subscription since */ + @Transactional def triggerBiosecuritySubscription(Query query, Date since) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'") Date now = new Date() @@ -149,7 +151,6 @@ class BiosecurityService { } } - def processQueryBiosecurity(Query query, Date since, Date to) { def drId = query.listId if (drId) { From f56d87a993e4b353443d5c2812793138b7117ca4 Mon Sep 17 00:00:00 2001 From: Nick dos Remedios Date: Mon, 9 Sep 2024 09:20:50 +1000 Subject: [PATCH 8/9] #237 Minor HTML tweaks for blogs.gsp --- grails-app/views/email/blogs.gsp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/grails-app/views/email/blogs.gsp b/grails-app/views/email/blogs.gsp index aaf9da8d..fd473549 100644 --- a/grails-app/views/email/blogs.gsp +++ b/grails-app/views/email/blogs.gsp @@ -4,6 +4,7 @@ + @@ -218,7 +219,7 @@ @@ -237,14 +238,14 @@ CSIRO GBIF -

You are receiving this email because you opted in to ALA blog alerts. +

You are receiving this email because you opted in to ALA blog alerts.

Our mailing address is:

Atlas of Living Australia
GPO Box 1700
Canberra, ACT 2601
Australia

Don't want to receive these emails? You can unsubscribe. -

+
From de17fff9db7ea7c3f41a0913930ccd1d643db965 Mon Sep 17 00:00:00 2001 From: Nick dos Remedios Date: Mon, 9 Sep 2024 12:38:22 +1000 Subject: [PATCH 9/9] Version 4.2.2 --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 3f9472b3..921e4d96 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,7 @@ * rights and limitations under the License. */ buildscript { - version "4.2.2-SNAPSHOT" + version "4.2.2" group "au.org.ala" }