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

Feature/duplicate fragments #439

Merged
merged 22 commits into from
May 2, 2024
Merged

Conversation

acholyn
Copy link
Collaborator

@acholyn acholyn commented Mar 8, 2024

closes #393

  • Have expanded the current duplication functionality to include tracking of duplicates (similarly to mentions) and alerting users when attempting to edit certain facets of an anonymous/fragment if there are duplicates.
  • This functionality is extended to when fragments and anonymous fragments are converted between
  • When duplicating an anonymous/fragment the new fragment is added to the duplicates field
  • There is a field for anonymous fragments to be used when a conversion has happened
  • they have a property called duplicates_list which combines duplicates from the property and the reverse relationships

@acholyn acholyn requested a review from tcouch March 8, 2024 13:31
@acholyn acholyn marked this pull request as ready for review March 13, 2024 12:57
@tcouch
Copy link
Collaborator

tcouch commented Mar 21, 2024

A couple of things still to do:

  • Duplicating a duplicate should make the new fragment a duplicate of both the original and the first duplicate.
  • Users should see a warning that a fragment has duplicates if they try to edit it. Maybe a banner at the top?

@acholyn
Copy link
Collaborator Author

acholyn commented Mar 21, 2024

would it work in that when duplicating, if the original has duplicates, add those items to the new instance's list of duplicates and it to theirs?

Copy link
Collaborator

@tcouch tcouch left a comment

Choose a reason for hiding this comment

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

I get an error when converting an anonymous fragment with duplicates into an unlinked fragment. To reproduce:

  1. Duplicate an anonymous fragment
  2. Convert the original anonymous fragment to unlinked

Result:

ValueError: Cannot query "Unlinked 450": Must be "AnonymousFragment" instance.

.github/workflows/docker.yml Outdated Show resolved Hide resolved
),
),
migrations.AddField(
model_name="testimonium",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Did we raise the issue of what to do about testimonia? I can see there's no option to duplicate testimonia on the detail page, but wasn't sure if we'd asked about this?

If it's not an option, these fields are redundant, but I guess not causing any harm. Maybe just add a comment here and in models/base.py to state that these are here and why if that's the case.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm not sure we did ask if we should enable it for them, I'll make note to do that. They are currently redundant but are there because it's on the HistoricalBaseModel and it complained when I removed this from the migration.

src/rard/research/views/fragment.py Show resolved Hide resolved
@acholyn
Copy link
Collaborator Author

acholyn commented Apr 26, 2024

conversion issue should be fixed now but initially the new fragment page didn't load and I had to reload for it to display, wondering if this was specific to my device

@tcouch
Copy link
Collaborator

tcouch commented May 1, 2024

I think the migration leaf node error we're seeing is because GH actions actually runs some kind of merged version of this branch and development together. Usually it's quite good at telling you there's a conflict, but in the case of migrations it's not clever enough to warn that development has a 0070 migration file and so does this branch.

TL;DR: Merge development into this branch and resolve the migration conflict by making this branch's migration file 0071.

@acholyn acholyn merged commit 6c4ed34 into development May 2, 2024
5 checks passed
@acholyn acholyn deleted the feature/duplicate-fragments branch May 2, 2024 07:55
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.

Duplicating fragments
2 participants