Skip to content

Commit

Permalink
Exclude intervention protocols until they are ready #823
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisala committed Mar 4, 2024
1 parent 4b0c239 commit 54df440
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions grails-app/conf/application.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@ if (!ecodata.use.uuids) {
ecodata.documentation.exampleProjectUrl = 'http://ecodata-test.ala.org.au/ws/activitiesForProject/746cb3f2-1f76-3824-9e80-fa735ae5ff35'
// Used by ParatooService to sync available protocols
paratoo.core.baseUrl = 'https://dev.core-api.monitor.tern.org.au/api'
paratoo.excludeInterventionProtocols = true

auth.baseUrl = 'https://auth-test.ala.org.au'
userDetails.web.url = "${auth.baseUrl}/userdetails/"
Expand Down
8 changes: 7 additions & 1 deletion grails-app/services/au/org/ala/ecodata/ParatooService.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class ParatooService {
static final List DEFAULT_MODULES =
['Plot Selection and Layout', 'Plot Description', 'Opportune']
static final List ADMIN_ONLY_PROTOCOLS = ['Plot Selection']
static final String INTERVENTION_PROTOCOL_TAG = 'intervention'

GrailsApplication grailsApplication
SettingService settingService
Expand Down Expand Up @@ -66,7 +67,7 @@ class ParatooService {
projects.findAll{it.protocols}
}

private static List findProjectProtocols(ParatooProject project) {
private List findProjectProtocols(ParatooProject project) {
log.debug "Finding protocols for ${project.id} ${project.name}"
List<ActivityForm> protocols = []

Expand All @@ -77,6 +78,11 @@ class ParatooService {
if (!project.isParaooAdmin()) {
protocols = protocols.findAll{!(it.name in ADMIN_ONLY_PROTOCOLS)}
}
// Temporarily exclude intervention protocols until they are ready
if (grailsApplication.config.getProperty('paratoo.excludeInterventionProtocols', Boolean.class, true)) {
protocols = protocols.findAll{!(INTERVENTION_PROTOCOL_TAG in it.tags)}
}

}
protocols
}
Expand Down

0 comments on commit 54df440

Please sign in to comment.