Skip to content
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

Improve success and fail message on maps page. #190

Merged
merged 1 commit into from
Aug 28, 2024
Merged
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
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
Loading