From 62960fa6407cafe14512de4c10cf76315202902c Mon Sep 17 00:00:00 2001 From: chrisala Date: Fri, 20 Dec 2024 13:25:50 +1100 Subject: [PATCH] Minor updates to BDR download #3169 --- grails-app/assets/javascripts/dataSets.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/grails-app/assets/javascripts/dataSets.js b/grails-app/assets/javascripts/dataSets.js index b0833d65f..1d5589014 100644 --- a/grails-app/assets/javascripts/dataSets.js +++ b/grails-app/assets/javascripts/dataSets.js @@ -42,7 +42,7 @@ var DataSetsViewModel =function(dataSets, projectService, config) { function isDownloadableMonitorDataSet(dataSet) { - if (dataSet.createdIn !== MONITOR_APP) { + if (dataSet.collectionApp !== MONITOR_APP) { return false; } var protocolId = dataSet.protocol; @@ -52,7 +52,7 @@ var DataSetsViewModel =function(dataSets, projectService, config) { if (isDownloadable) { var now = moment(); var creationDate = moment(dataSet.dateCreated); - var minutesToInjestDataSet = options.minutesToInjestDataSet || 1; + var minutesToInjestDataSet = config.minutesToInjestDataSet || 1; if (dataSet.progress !== ActivityProgress.planned) { if (creationDate.add(minutesToInjestDataSet, 'minutes').isBefore(now)) { isDownloadable = true; @@ -98,6 +98,9 @@ var DataSetsViewModel =function(dataSets, projectService, config) { if (this.createdIn === MONITOR_APP) { if (this.progress == ActivityProgress.planned) { + var now = moment(); + var creationDate = moment(dataSet.dateCreated); + if (creationDate.add(1, 'minutes').isBefore(now)) { this.progress = 'sync error'; }