Refactor useResourceValue hook #6261
Conversation
Triggered by 2ecbb4a on branch refs/heads/issue-6183
lexiclevenger
left a comment
There was a problem hiding this comment.
- Verify the save button is enabled and you can save
- Verify non-relationship fields rendered as a QueryComboBox behave properly
- Verify to-one relationships rendered as a QueryComboBox behave properly
- Ensure the 'Field is required' save blocker is set when applicable
- Ensure the 'Please match requested format' save blocker is displayed when a value is invalid for a field according to its formatter
- Ensure fields have their defaults properly set in accordance with their formatter
Looks good! However, changing the COType of an existing CO causes the new catalog number to save with the temporary value # instead of auto-incrementing.
Untitled.video.-.Made.with.Clipchamp.mp4
lexiclevenger
left a comment
There was a problem hiding this comment.
Meant to request changes
|
Question for testing; could you provide examples of non-relationship fields that can be rendered as a QCBX? Not sure of fields in the schema that matches that description. 😅 |
From #6261 (review) by @lexiclevenger Nice catch! Though the explanation here is a little awkward, as there's a couple distinct parts of autonumbering which need explanation 😅 Firstly -as far as I can tell- autonumbering has ever only worked when creating new records, and not when updating old records. This would mean that if you were to use the default CatalogNumberNumeric formatter and save an existing record with a Secondly, technically the default pattern of the incrementing formatter is a valid value for the formatter! With CatalogNumberNumeric for example, Here's a video recreating this exact Issue in cat_num_default.movOf course, with the changes relating to changing the catalogNumber when the CollectionObjectType changes, this is probably more apparent. What would you suggest as a solution?
From #6261 (comment) by @combs-a Hmmm, yes there should be no non-relationships that can be rendered as a QCBX. |
combs-a
left a comment
There was a problem hiding this comment.
A) Issue test
- Verify the save button is enabled and you can save
B) General test
- Verify non-relationship fields of different types behave properly
- Verify to-one relationships rendered as a QueryComboBox behave properly
- Ensure the 'Field is required' save blocker is set when applicable
- Ensure the 'Please match requested format' save blocker is displayed when a value is invalid for a field according to its formatter
- Ensure fields have their defaults properly set in accordance with their formatter
Everything looked good on my end! I used ojsmnh to be clear, we might want to check general testing on other things as well.
I wanted to note down some behavior; when adding a new record from a non-default COT CO, it'll use the format of the previous record. It's not something I'm worried about seeing as the save is blocked, just might be slightly annoying behavior for users.
My thought is that Add should always use the default Catalog Number formatter but this can be in a different issue.
firefox_02-24_09-02.mp4
pashiav
left a comment
There was a problem hiding this comment.
- Verify the save button is enabled and you can save
- Verify non-relationship fields of different types behave properly
- Verify to-one relationships rendered as a QueryComboBox behave properly
- Ensure the 'Field is required' save blocker is set when applicable
- Ensure the 'Please match requested format' save blocker is displayed when a value is invalid for a field according to its formatter
- Ensure fields have their defaults properly set in accordance with their formatter
Looks good! I tested on calvertmarinemuseum20250206.
I agree with @combs-a's comment. If not within the scope of this PR, should we create an issue and add it to a milestone?
|
Haven't made any functional changes to this PR in recent commits (https://github.com/specify/specify7/pull/6261/files/034605aa29ac8a9f17a00bde10f6715b7dce05ad..e5977ae17e182790e4ba495d186614f21d7a3e14), just working on adding automated tests! |
Triggered by f6bba4f on branch refs/heads/issue-6183
Fixes #6183
Checklist
self-explanatory (or properly documented)
Testing instructions
A) Issue test
B) General test