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

Add tag deletion/addition filters for conflict resolution page #919

Merged
merged 14 commits into from
Nov 28, 2023

Conversation

caseyhans
Copy link
Collaborator

@caseyhans caseyhans commented Oct 6, 2023

Adds additional filtering to conflict resolution page.

  • Added deleted_tags field to UserReferenceTag model
  • Candidate Tag Additions: filters by references with users seeking to add a specific tag (tag is present for an unresolved UserReferenceTag, but not on reference.tags)
  • Candidate Tag Deletions: filters by references with users seeking to remove a specific tag (tag is in user_tag.deleted_tags)

image

  • Show tag deletions on Tag Status page

  • Show text for empty UserReferenceTag case
    image

  • Change empty conflict resolution list message from success ("Conflict resolution complete") to "No conflicts found"
    image

@caseyhans caseyhans marked this pull request as ready for review October 10, 2023 14:13
@caseyhans caseyhans marked this pull request as draft October 10, 2023 15:45
@caseyhans caseyhans marked this pull request as ready for review October 11, 2023 19:59
@shapiromatron shapiromatron self-assigned this Oct 16, 2023
@shapiromatron shapiromatron removed their request for review October 23, 2023 13:51
@shapiromatron shapiromatron removed their assignment Oct 23, 2023
@shapiromatron shapiromatron marked this pull request as draft October 23, 2023 13:52
@caseyhans caseyhans marked this pull request as ready for review November 1, 2023 19:12
Copy link
Owner

@shapiromatron shapiromatron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice job. This was a fun read.

Made some minor changes; if you're ok, feel free to merge!

  • ef5786f reuse tag queryset for each field instead of multiple queries
  • 0cda1b0 use == instead of is for numerical comparison
  • a07c65f use alert template tag; add icon template tag

from django.db import migrations, models


def add_deletions(apps, schema_editor):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was a joy to read; nice job.

@@ -188,6 +214,52 @@ def filter_anything_tagged_me(self, queryset, name, value):
).filter(my_tag_count__gt=0)
return queryset.distinct()

def filter_tag_additions(self, queryset, name, value):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These methods look good, but they could be slow. I don't think we need to change anything now.

We may need to monitor performance with some real data after its in the wild for a while to determine if we need to optimize. I'm thinking specifically of a case where we include descendants, and the parent has many children. I wonder if there's a way to see to see if a reference has any of these tags in a single query.

I think you could do it it with the ArrayField using overlap, but that's only for the deletions, not the additions.

@caseyhans caseyhans merged commit 41877a8 into main Nov 28, 2023
3 checks passed
@caseyhans caseyhans deleted the tag-deletion-addition-filters branch November 28, 2023 21:49
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.

2 participants