Support COT catalog number configurations in the Query Builder#5485
Merged
Conversation
Triggered by 5e2823e on branch refs/heads/issue-5232-qb
melton-jason
commented
Dec 18, 2024
alesan99
requested changes
Dec 18, 2024
alesan99
left a comment
Contributor
There was a problem hiding this comment.
Testing instructions
- Ensure that by default, the Collection's default Catalog Number format is enforced
- [c] Ensure the input of the field is now validating based on the format defined on the chosen Collection Object Type
- Ensure each filter on the Catalog Number field with validation can independently have its own format
- [c] Save the Query and refresh the page: the Query should load successfully
- Ensure the query returns correct results when using filters with multiple Catalog Number formats
- If there is only one CollectionObjectType or all CollectionObjectTypes either don't specify a Catalog Number format or use the
- Briefly generally test other functionality of the Query Builder, such as: running old queries, selecting a different record formatter (#4615), Query From Tree Node, etc.
The functionality looks good! 👍👍
I just have a minor note
If multiple COTs share the same formatter the selection dropdown always chooses the first one with that format. It's a little weird but the functionality works since it is the same formatter after all.
I imagine in practice most people will have a different formatter for each COT if they aren't sticking with the default, but if someone comes across this it may appear broken.
chrome_zfCxfAL2N3.mp4
The queries also not filtered very strictly and YEAR-###### includes ######## results, which is more noticeable when doing 'less than' queries.
Though this is in line with normal Catalog Number behavior and its easily solvable by adding COT to your query.
CarolineDenis
approved these changes
Dec 18, 2024
sharadsw
approved these changes
Dec 18, 2024
acwhite211
approved these changes
Dec 20, 2024
7 tasks
melton-jason
added a commit
that referenced
this pull request
May 1, 2025
…eric Fixes #6464 See related #5485 and #6245 This handles the most common case. In the case where there exists both numeric and non-numeric formats for catalogNumber, the numeric formats will still be cast as a string. This also ONLY works with formats called CatalogNumberNumeric; i.e., any other purely numeric format will not be considered as numeric by the QueryBuilder
sharadsw
added a commit
that referenced
this pull request
May 2, 2025
…0.2` (#6465) * Handle case where rank name has spaces * Use name as default tree rank query * Handle edge case for fullname query * Use name for fullname * Skip test temporarily * Revert mapping for fullname * Fix case for fullName query with 1 space in rank - Also adds a unit test to ensure this doesn't break again * Cast catalogNumber to Numeric in query results if all formats are numeric Fixes #6464 See related #5485 and #6245 This handles the most common case. In the case where there exists both numeric and non-numeric formats for catalogNumber, the numeric formats will still be cast as a string. This also ONLY works with formats called CatalogNumberNumeric; i.e., any other purely numeric format will not be considered as numeric by the QueryBuilder * Add comment to catalogNumber cast for queries --------- Co-authored-by: melton-jason <meltonjason12@yahoo.com>
7 tasks
3 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #5474
Related to #5232
Allows the selection of Collection Object Type (COT) Catalog Number formats in the Query Builder!:
Known edge case: #5487 and #5488
Checklist
self-explanatory (or properly documented)
Testing instructions
Create a CollectionObjectType with a Catalog Number Format Name which differs from that of the Collection's default Catalog Number format
Catalog Num Format Namefield to determine the default formatCreate a new Collection Object query, add Catalog Number to the query, and switch the type from
Anyto any of:Ensure that by default, the Collection's default Catalog Number format is enforced
Switch the Catalog Number format to the previously created Collection Object Type using the new gear icon and picklist
Ensure the input of the field is now validating based on the format defined on the chosen Collection Object Type
Add one or more OR filters to the Catalog Number field (this can be done through the
+button) with a type from the list aboveEnsure each filter on the Catalog Number field with validation can independently have its own format
Save the Query and refresh the page: the Query should load successfully
Ensure the query returns correct results when using filters with multiple Catalog Number formats
If there is only one CollectionObjectType or all CollectionObjectTypes either don't specify a Catalog Number format or use the Collection's default, then the gear icon to select a formatter should not appear on Catalog Number
Collection Object -> Catalog Numberalong with formatted/aggregated fields are the only filters which should have the gear icon to select a formatBriefly generally test other functionality of the Query Builder, such as: running old queries, selecting a different record formatter (Add support for explicitly choose a formatter in QB #4615), Query From Tree Node, etc.