Skip to content

Feature/paratoo #914

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
10 changes: 8 additions & 2 deletions 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 Expand Up @@ -304,7 +310,7 @@ class ParatooService {
String guid = protocol.attributes.identifier
guids << guid
String name = protocol.attributes.name
ParatooProtocolConfig protocolConfig = getProtocolConfig(id)
ParatooProtocolConfig protocolConfig = getProtocolConfig(guid)
ActivityForm form = ActivityForm.findByExternalId(guid)
if (!form) {
form = new ActivityForm()
Expand Down