Skip to content

Commit

Permalink
#596 remove faulty formatting for stateConservation comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Collins committed Feb 22, 2024
1 parent bf88c04 commit 1b90e5c
Showing 1 changed file with 0 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,6 @@ class PostProcessingService {
//log.debug "record = ${record as JSON}"
String stateProvince = ""
String stateKey = ""
Map statesListsPaths = grailsApplication.config.getProperty('stateConservationListPath', Map, [:])
// conservation list is state based, so first we need to know the state
modifiedRecord.get("Location")?.each {
if (it.name == "stateProvince") {
Expand All @@ -431,16 +430,6 @@ class PostProcessingService {
stateKey = WordUtils.capitalizeFully(stateProvince).replaceAll("\\s+", "")
}
}
modifiedRecord.get("Occurrence")?.each {
if (it.name == "stateConservation" && stateProvince && statesListsPaths.containsKey(stateKey)) {
String statusValue = it.processed ?: it.raw
List statusValues = statusValue.tokenize(",").unique( false ) // remove duplicate values
statusValue = (statusValues.size() == 2) ? statusValues[1] : statusValues.join(", ") // only show 'sourceStatus' if 2 values are present

String specieslistUrl = "${grailsApplication.config.getProperty('speciesList.baseURL')}${statesListsPaths[stateKey]}"
it.processed = "<a href=\"${specieslistUrl}\" target=\"_lists\">${stateProvince}: ${statusValue}</a>"
}
}

modifiedRecord
}
Expand Down

0 comments on commit 1b90e5c

Please sign in to comment.