-
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
Merged
Merged
Changes from 8 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
ddd0146
Add support for Taxa Tags (#830)
mohamedelabbas1996 496d756
chore: remove unused import
annavik 3d2cc6a
fix: pass project ID when assigning tags
annavik c6106f6
chore: skip adding initial tags to the database
annavik 362bbf6
fix: update migration deps
annavik d1b2dbd
fix: revert caption update to fix build
annavik cf19829
feat: put tags feature behind feature flag
annavik 826a3c1
feat: disable tag filters if no tags for project
annavik ceea5db
Merge branch 'main' into feat/taxa-tags
mihow b13a8e6
Merge branch 'main' of github.com:RolnickLab/antenna into feat/taxa-tags
mihow 71d78ad
chore: fix migration ordering
mihow d141fef
feat: store feature flags with project
mihow b3b52e7
Merge branch 'main' into feat/taxa-tags
mihow 77ff6d3
fix: return feature flags as a dictionary in API response
annavik 5d9c5f7
style: simplify tags form
annavik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Generated by Django 4.2.10 on 2025-05-15 21:23 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("main", "0059_alter_project_options"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="Tag", | ||
fields=[ | ||
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), | ||
("created_at", models.DateTimeField(auto_now_add=True)), | ||
("updated_at", models.DateTimeField(auto_now=True)), | ||
("name", models.CharField(max_length=255)), | ||
( | ||
"project", | ||
models.ForeignKey( | ||
blank=True, | ||
null=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="tags", | ||
to="main.project", | ||
), | ||
), | ||
], | ||
options={ | ||
"unique_together": {("name", "project")}, | ||
}, | ||
), | ||
migrations.AddField( | ||
model_name="taxon", | ||
name="tags", | ||
field=models.ManyToManyField(blank=True, related_name="taxa", to="main.tag"), | ||
), | ||
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Select } from 'nova-ui-kit' | ||
import { FilterProps } from './types' | ||
|
||
export const TagFilter = ({ data = [], value, onAdd }: FilterProps) => { | ||
const tags = data as { id: number; name: string }[] | ||
|
||
return ( | ||
<Select.Root | ||
disabled={tags.length === 0} | ||
value={value ?? ''} | ||
onValueChange={onAdd} | ||
> | ||
<Select.Trigger> | ||
<Select.Value placeholder="Select a value" /> | ||
</Select.Trigger> | ||
<Select.Content className="max-h-72"> | ||
{tags.map((option) => ( | ||
<Select.Item key={option.id} value={`${option.id}`}> | ||
{option.name} | ||
</Select.Item> | ||
))} | ||
</Select.Content> | ||
</Select.Root> | ||
) | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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