-
Notifications
You must be signed in to change notification settings - Fork 5
Make it possible to add tags to taxa #892
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
Conversation
* feat: added support for tag creation for a given taxon * chore: moved Tag<->Taxon many2many to the Taxon model * feat: added the Tag admin model * feat: added custom assign_tags action to the TaxonViewSet to assign tags for a given taxon and return the assigned tags filtered by project * fixed formatting * merged migrations * feat: added tags to the Taxon admin model * feat: added global tags * added db migration * feat: show global tags if there is an active project * feat: added or based taxon filtering by tag_id * chore: renamed TaxonTagFilterBackend * fix: fixed filtering tags by project_id in the TaxonViewSet list * Add frontend support for taxa tags (#828) * feat: setup UI for taxon tags * feat: prepare UI controls for tag filtering * feat: hook up UI tags with backend * fix: update filter key from tag -> tag_id * fixed Taxon List tags column name * feat: added tags inverse filter * feat: return global tags with project tags * chore: reset tag migrations, add default tags * fix: remove invalid field in taxa list query * chore: add type hints for reverse relationships --------- Co-authored-by: Anna Viklund <annamariaviklund@gmail.com> Co-authored-by: Michael Bunsen <notbot@gmail.com>
✅ Deploy Preview for antenna-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
ami/main/models.py
Outdated
image = models.ImageField(upload_to="projects", blank=True, null=True) | ||
owner = models.ForeignKey(User, on_delete=models.SET_NULL, null=True, related_name="projects") | ||
members = models.ManyToManyField(User, related_name="user_projects", blank=True) | ||
feature_flags: dict[str, bool] = {"tags": False} # @TODO return stored feature flags for project |
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 here is where we can tweak the hard coded feature flags
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.
This is great, first feature flags! I will make a way to store them with each project in the DB
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.
I added a true feature_flags field to the model, and I see the tags: true
in the API details for my test project, but I can't get any tag features to render in the UI. I added some tags for the project as well. I'm not sure where the project details are being fetched.
I see! This is because after the BE updates, data was not returned in the expected format. I pushed an update to return feature flags as an object instead of an array of arrays. Let me know if I did this in the correct way! :) Tested and it seems to work now. |
Ah sorry I missed that @annavik, thanks for fixing! I tested again and it works! Wohoo! Merging! |
Summary
In this PR, we cherry pick the tag feature from the OOD branch. The changes includes both frontend and backend updates.
Related Issues
Original issue: #825
Original PR:s: #828 and #830
Comments