From b84d7340ad470f0cb3aa26785dc46e20ec2a071c Mon Sep 17 00:00:00 2001 From: Mats Bovin Date: Mon, 13 May 2024 08:12:16 +0200 Subject: [PATCH] Update ipt sync view. Add totals. Add diff. Styling --- .../org/ala/collectory/IptController.groovy | 13 ++++++- grails-app/views/ipt/syncView.gsp | 35 +++++++++++++++---- 2 files changed, 41 insertions(+), 7 deletions(-) diff --git a/grails-app/controllers/au/org/ala/collectory/IptController.groovy b/grails-app/controllers/au/org/ala/collectory/IptController.groovy index d2cd3252..01a8e523 100644 --- a/grails-app/controllers/au/org/ala/collectory/IptController.groovy +++ b/grails-app/controllers/au/org/ala/collectory/IptController.groovy @@ -234,6 +234,8 @@ class IptController { def sortDirection = params.order ?: "asc" def onlyUnsynced = Boolean.parseBoolean(params.onlyUnsynced ?: "false") def result = [] + def iptTotalCount = 0 + def atlasTotalCount = 0 if (provider.websiteUrl) { @@ -265,6 +267,9 @@ class IptController { row.atlasCount = it.type == "CHECKLIST" ? null : countJson.totalRecords } + iptTotalCount += (row.iptCount ?: 0) + atlasTotalCount += (row.atlasCount ?: 0) + def isUnsynced = row.iptCount != row.atlasCount || row.iptPublished != row.atlasPublished if (!onlyUnsynced || isUnsynced) { result.add(row) @@ -277,6 +282,12 @@ class IptController { } } - [result: result, instance: provider, sortBy: sortBy, sortDirection: sortDirection, onlyUnsynced: onlyUnsynced] + [result: result, + iptTotalCount: iptTotalCount, + atlasTotalCount: atlasTotalCount, + instance: provider, + sortBy: sortBy, + sortDirection: sortDirection, + onlyUnsynced: onlyUnsynced] } } diff --git a/grails-app/views/ipt/syncView.gsp b/grails-app/views/ipt/syncView.gsp index e1937ae0..9cdb6829 100644 --- a/grails-app/views/ipt/syncView.gsp +++ b/grails-app/views/ipt/syncView.gsp @@ -36,22 +36,22 @@ - IPT published + IPT date - Atlas published + Atlas date - IPT record count + IPT count - Atlas record count + Atlas count @@ -68,20 +68,43 @@ ${item.type} - style="color: green"> + ${item.iptPublished} style="color: red"> ${item.atlasPublished} - color: green"> + color: red"> + +
+ () +
+ + + Total all datasets + + + + + + + + + color: red"> + + +
+ () +
+ +