Skip to content

Add Series Entry to Collection Objects #6710

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 35 commits into from
Jul 7, 2025
Merged

Add Series Entry to Collection Objects #6710

merged 35 commits into from
Jul 7, 2025

Conversation

alesan99
Copy link
Contributor

@alesan99 alesan99 commented Jun 18, 2025

Fixes #6276

Adds Bulk Carry Forward Range preference to Collection Objects.

image

Checklist

  • Self-review the PR after opening it to make sure the changes look good and
    self-explanatory (or properly documented)
  • Add relevant issue to release milestone
  • Add pr to documentation list
  • Add automated tests
  • Add a reverse migration if a migration is present in the PR

Testing instructions

  • Go to Data Entry for Collection Object
  • Click on Form Meta and enable Carry Forward and Bulk Carry Forward Range. Also enable "create record set"
  • Fill out some fields on the form and save.
  • The Carry Forward range input should appear
  • Make sure you can only enter a valid start catalog number (It should use the catalog num of the CO you just saved)
  • Make sure you can only enter a valid end catalog number
  • Make sure you can't enter invalid ranges (where the start is bigger than the end for example)
  • Click Carry Forward and make sure all the COs in the range you specified were created
  • Try to Carry Forward over catalog numbers belonging to COs that already exist
  • Click Carry Forward and see a dialog with a list of all existing catalog numbers.
  • Click on Form Meta and disable the "create record set on bulk carry" preference
  • Try Bulk Carry Forward and make sure no record set is created. But make sure all newly created records appear on the form page thing.
  • Try creating a CO with a Collection Object Type with that uses a different formatter for the catalog number. Bulk Carry should still work, except if the formatter does not support autoincrementing (the button will be disabled).

@alesan99 alesan99 changed the title add series entry button Add Series Entry to Collection Objects Jun 24, 2025
@alesan99
Copy link
Contributor Author

alesan99 commented Jun 24, 2025

TODO:

  • Use bulk carry forward: Add a pref to use range instead of current incrementing behavior
  • If range pref true, use the bulk carry forward box to enter the last cat num for the range
  • Dialog for showing existing COs with catalog numbers
  • Check if catalog nums are formatted correctly on frontend
  • Check if catalog num range is correct on front end
  • Option to disable record set creation
  • Tests for series_autonumber_range
  • Try to move range_end next to the catalog number on the form (if possible?). (Did this on a separate PR Add series entry field to form (series=true) #6871)
  • Possible bug with formatter.title? Should use a new formatter.name property

@alesan99 alesan99 added this to the 7.11.1 milestone Jun 25, 2025
@alesan99 alesan99 marked this pull request as ready for review July 1, 2025 18:18
@alesan99 alesan99 requested review from a team July 1, 2025 18:18
Copy link
Collaborator

@bhumikaguptaa bhumikaguptaa left a comment

Choose a reason for hiding this comment

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

  • The Carry Forward range input should appear
  • Make sure you can only enter a valid start catalog number (It should use the catalog num of the CO you just saved)
  • Make sure you can only enter a valid end catalog number
  • Make sure you can't enter invalid ranges (where the start is bigger than the end for example)
  • Click Carry Forward and make sure all the COs in the range you specified were created
  • Click Carry Forward and see a dialog with a list of all existing catalog numbers.
  • Try Bulk Carry Forward and make sure no record set is created. But make sure all newly created records appear on the form page thing.

Works as expected!

@bhumikaguptaa bhumikaguptaa requested a review from a team July 1, 2025 21:27
@alesan99
Copy link
Contributor Author

alesan99 commented Jul 2, 2025

I fixed an issue with the catalog number formatter not being used if you are using one that has a custom title for it.

I added the following check to the instructions to test formatters:

  • Try creating a CO with a Collection Object Type with that uses a different formatter for the catalog number. Bulk Carry should still work, except if the formatter does not support autoincrementing (the button will be disabled).

Copy link
Collaborator

@emenslin emenslin left a comment

Choose a reason for hiding this comment

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

Does not work on DBs with multiple collections (ojsmnh in the fossil inverts collection), but worked fine on a db with only one collection (kubirds). On a a DB with multiple collections it claims that the numbers are already being used when they do not exist, this is likely because the numbers do exist in another collection.

07-02_09.10.mp4

@github-project-automation github-project-automation bot moved this from 📋Back Log to Dev Attention Needed in General Tester Board Jul 2, 2025
Increase record limit to 500
@alesan99
Copy link
Contributor Author

alesan99 commented Jul 2, 2025

@emenslin I think I have a fix for that, pushed it 👍👍

@CarolineDenis CarolineDenis requested a review from emenslin July 3, 2025 17:24
Copy link
Collaborator

@emenslin emenslin left a comment

Choose a reason for hiding this comment

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

  • The Carry Forward range input should appear
  • Make sure you can only enter a valid start catalog number (It should use the catalog num of the CO you just saved)
  • Make sure you can only enter a valid end catalog number
  • Make sure you can't enter invalid ranges (where the start is bigger than the end for example)
  • Click Carry Forward and make sure all the COs in the range you specified were created
  • Click Carry Forward and see a dialog with a list of all existing catalog numbers.
  • Try Bulk Carry Forward and make sure no record set is created. But make sure all newly created records appear on the form page thing.
  • Try creating a CO with a Collection Object Type with that uses a different formatter for the catalog number. Bulk Carry should still work, except if the formatter does not support autoincrementing (the button will be disabled).

I think if someone tries to carry forward over the range limit then it should just be blocked instead of throwing an error (something similar to the dialog when you try to carry forward over a number that already exists). With the current behavior the error also forces the user to go to the home screen which is not ideal.

07-03_14.41.mp4

alesan99 added 2 commits July 7, 2025 12:59
Refactor BulkCarryRange error dialog
Triggered by 5f64c9a on branch refs/heads/issue-6276
@alesan99
Copy link
Contributor Author

alesan99 commented Jul 7, 2025

@emenslin I added a better dialog 👍 And if an error occurs for whatever reason you should be able to dismiss it now!
image

I did have to refactor parts of the code, so I could've broken some things. From my testing everything still seems to work, but you'll probably want to double check.

@alesan99 alesan99 requested a review from emenslin July 7, 2025 18:10
Copy link
Collaborator

@emenslin emenslin left a comment

Choose a reason for hiding this comment

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

  • The Carry Forward range input should appear
  • Make sure you can only enter a valid start catalog number (It should use the catalog num of the CO you just saved)
  • Make sure you can only enter a valid end catalog number
  • Make sure you can't enter invalid ranges (where the start is bigger than the end for example)
  • Click Carry Forward and make sure all the COs in the range you specified were created
  • Click Carry Forward and see a dialog with a list of all existing catalog numbers.
  • Try Bulk Carry Forward and make sure no record set is created. But make sure all newly created records appear on the form page thing.
  • Try creating a CO with a Collection Object Type with that uses a different formatter for the catalog number. Bulk Carry should still work, except if the formatter does not support autoincrementing (the button will be disabled).

Looks good, I did not run into any errors!

@alesan99 alesan99 merged commit 2dbd08c into main Jul 7, 2025
13 of 14 checks passed
@alesan99 alesan99 deleted the issue-6276 branch July 7, 2025 20:40
@github-project-automation github-project-automation bot moved this from Dev Attention Needed to ✅Done in General Tester Board Jul 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Add support for entering a range for series data entry
4 participants