Skip to content

Commit

Permalink
Improve success and fail message on maps page.
Browse files Browse the repository at this point in the history
  • Loading branch information
alan-wu committed Aug 27, 2024
1 parent 1ff276b commit 362f809
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions pages/apps/maps/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -127,25 +127,24 @@ const checkSpecies = (route, organ, organ_name, taxo, for_species) => {
//Old link may contain the for_species as undefined
let failMessage = undefined
let successMessage = undefined
const target = flatmaps.speciesMap[taxo]
if (
route.query.for_species &&
route.query.for_species !== 'undefined'
for_species && for_species !== 'undefined'
) {
if (
route.query.for_species !== flatmaps.speciesMap[taxo]
) {
if (for_species !== target) {
failMessage = `Sorry! A flatmap for ${for_species} species does not yet exist. The ${organ_name} of a rat has been shown instead.`
} else if (!organ) {
failMessage = `Sorry! Applicable entity is not yet available. A generic flatmap for ${for_species} species has been shown instead.`
}
} else if (route.query.fid) {
successMessage = "A flatmap's unique id is provided, a legacy map may be displayed instead."
} else {
failMessage = 'Sorry! Species information cannot be found. '
if (organ) {
failMessage += `The ${organ_name} of a rat has been shown instead.`
} else {
failMessage += 'A generic rat flatmap has been shown instead.'
if (!target) {
if (organ) {
failMessage += `The ${organ_name} of a rat has been shown instead.`
} else {
failMessage += 'A generic rat flatmap has been shown instead.'
}
}
}
return { successMessage, failMessage }
Expand Down

0 comments on commit 362f809

Please sign in to comment.