-
Notifications
You must be signed in to change notification settings - Fork 5
Expose all Taxon parents #491
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
Expose all Taxon parents #491
Conversation
✅ Deploy Preview for ami-web ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for ami-storybook ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@annavik Can you help update the species list view to get the ranks back? I can't track that one down. |
if (taxon.parents) { | ||
this.ranks = taxon.parents | ||
} else if (taxon.parent?.parents) { | ||
// TODO: Update this when species list is returning parents similar to other endpoints |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mihow seems in the species list case, data structure looked slightly different. I could still access all parents though from the parent
object. We can skip this once we streamline the format :)
parents?: ServerTaxon[] | ||
} | ||
|
||
const SORTED_RANKS = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mihow I noticed the ranks were not always sorted (you can for example see this on the second occurrence table screenshot you posted in PR description). I added some client side sorting for now, based on this list of ranks. I hope it's correct!
We can skip this if backend plan to sort, but leaving it for now.
This adds a new
parents
attribute to the Taxon object in all related API endpoints. This new attribute is an ordered list of all ranks and is intended to be used instead of the recursiveparent
attribute.Most UI views have been updated to use the new
parents
list, except for the species list view! I can't crack that one.One
parent
is still available if needed.This enables the bulk ID actions to be much more useful because you can select multiple occurrences and choose the taxon rank that is common among all of them (family, superfamily, lepidoptera, etc)
Also fixes #485, you can click on any rank and the species detail page will not 404.