Skip to content

QueryBuilder: Show catalognumber format tool when mapped to-many - #6994

Merged
CarolineDenis merged 5 commits into
mainfrom
issue-6990
Aug 11, 2025
Merged

QueryBuilder: Show catalognumber format tool when mapped to-many#6994
CarolineDenis merged 5 commits into
mainfrom
issue-6990

Conversation

@melton-jason

Copy link
Copy Markdown
Contributor

Fixes #6990

The underlying Issue here stemmed from the fact that both the WorkBench and QueryBuilder maintains indices when mapping to-many relationships: for example a mapping of CollectionObject -> determinations might be mapped "behind the scenes" as CollectionObject -> determinations -> #1. In the WorkBench, if a second Determination is mapped then it would be mapped as CollectionObject -> determinations -> #2, and so.

For #5485 when determining the terminating field of the query line/filter, it would use the internal mapping path (including to-many indices). This PR removes to-many indices from the mapping path when determining the terminating field.

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

  • Ensure there are at least two CollectionObjectTypes in the Collection which have different CatalogNumberFormatNames

    • You can use the QueryBuilder to query on CollectionObjectType and see all types and their formats in a Collection
    • If there are not at least two CollectionObjectTypes with differing CatalogNumberFormatNames, you can always create a new CollectionObjectType (don't forget to log out or reload the page after creating the type, or the format selection tool for catalognumber in the QueryBuilder might not initially appear)
  • Open or go to a new query for a base table which is not CollectionObject, but has a path to CollectionObject along which there is a least one to-many relationship.

    • Some examples include:
Base Table Name Field Path
Accession collectionObjects -> catalogNumber
Appraisal collectionObjects -> catalogNumber
CollectingEvent collectionObjects -> catalogNumber
Locality collectingEvents -> collectionObjects -> catalogNumber
Attachment collectionObjectAttachments -> collectionObject -> catalogNumber
  • Add CollectionObject -> catalogNumber to the query, and change the filter from Any to any filter which expects the format to be preserved (any of Equal, Greater than, Greater than or equal to, Less than, Less than or equal to, Between or In)

  • Ensure the gear icon appears next to the query field, and it allows you to select the Catalog Number format for the field

  • Open or go to a new query for a base table which has a path to CollectionObject along which there are no to-many relationships

    • Some examples include:
Base Table Name Field Path
CollectionObject catalogNumber
Preparation collectionObject -> catalogNumber
Determination collectionObject -> catalogNumber
DNA Sequence collectionObject -> catalogNumber
Loan Preparation preparation -> collectionObject -> catalogNumber
  • Add CollectionObject -> catalogNumber to the query, and change the filter from Any to any filter which expects the format to be preserved (any of Equal, Greater than, Greater than or equal to, Less than, Less than or equal to, Between or In)
  • Ensure the gear icon appears next to the query field, and it allows you to select the Catalog Number format for the field

@melton-jason melton-jason added this to the 7.x milestone Jul 9, 2025
@melton-jason
melton-jason requested review from a team July 9, 2025 20:42
@github-project-automation github-project-automation Bot moved this to 📋Back Log in General Tester Board Jul 9, 2025

@emenslin emenslin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

  • Ensure the gear icon appears next to the query field, and it allows you to select the Catalog Number format for the field
  • Ensure the gear icon appears next to the query field, and it allows you to select the Catalog Number format for the field

Looks good, gear icon appears next to field in both cases!
Screenshot 2025-08-06 123607

@emenslin
emenslin requested a review from a team August 6, 2025 18:07
@CarolineDenis CarolineDenis modified the milestones: 7.x, 7.11.2 Aug 6, 2025

@bhumikaguptaa bhumikaguptaa left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

  • Ensure the gear icon appears next to the query field, and it allows you to select the Catalog Number format for the field
  • Ensure the gear icon appears next to the query field, and it allows you to select the Catalog Number format for the field

Works as expected! The gear icon appears.

@CarolineDenis
CarolineDenis merged commit 54c6c1f into main Aug 11, 2025
14 checks passed
@CarolineDenis
CarolineDenis deleted the issue-6990 branch August 11, 2025 13:25
@github-project-automation github-project-automation Bot moved this from 📋Back Log to ✅Done in General Tester Board Aug 11, 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.

Cannot select catalog number formatter in queries when base table has a to-many relationship with CO

4 participants