Skip to content

Conversation

annavik
Copy link
Member

@annavik annavik commented Jul 4, 2025

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

  • For the original feature, we added a set of global tags to the database as a migration step. I think for the prod app, we can skip this? I excluded this step from code (see commit c6106f6).
  • We want to start by introducing tags for selected projects only. To make this possible, we will put tags behind a feature flag. To begin with, feature flags will be hard coded on the backend side and tags will be disabled for all projects. This means we can merge the code, but introduce tags to users at a later point.

mohamedelabbas1996 and others added 3 commits July 4, 2025 10:03
* 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>
Copy link

netlify bot commented Jul 4, 2025

Deploy Preview for antenna-preview ready!

Name Link
🔨 Latest commit 5d9c5f7
🔍 Latest deploy log https://app.netlify.com/projects/antenna-preview/deploys/6891ff80b1923200092ee3e2
😎 Deploy Preview https://deploy-preview-892--antenna-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 61 (🟢 up 1 from production)
Accessibility: 80 (no change from production)
Best Practices: 100 (no change from production)
SEO: 92 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@annavik annavik marked this pull request as ready for review July 4, 2025 10:00
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
Copy link
Member Author

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

Copy link
Collaborator

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

@annavik annavik requested a review from mihow July 4, 2025 10:01
Copy link
Collaborator

@mihow mihow left a 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.

@annavik annavik self-assigned this Aug 5, 2025
@annavik
Copy link
Member Author

annavik commented Aug 5, 2025

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.

Before:
Screenshot 2025-08-05 at 14 58 40

After:
Screenshot 2025-08-05 at 14 58 56

@mihow
Copy link
Collaborator

mihow commented Aug 5, 2025

Ah sorry I missed that @annavik, thanks for fixing! I tested again and it works! Wohoo! Merging!

@mihow mihow merged commit 2df1630 into main Aug 5, 2025
8 checks passed
@mihow mihow deleted the feat/taxa-tags branch August 5, 2025 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants