Conversation
This was referenced Dec 3, 2025
labkey-susanh
approved these changes
Dec 4, 2025
| expect(new UnitModel(99999.133, 'uL').as('L').toString()).toBe('0.099999133 L'); | ||
| expect(new UnitModel(99999.13345678, 'uL').as('L').toString()).toBe('0.099999133 L'); | ||
| expect(new UnitModel(99999.13345678, 'mg').as('kg').toString()).toBe('0.099999133457 kg'); | ||
| expect(new UnitModel(99999.13345678, 'mg').as('kg').toString()).toBe('0.09999913345678 kg'); |
Contributor
There was a problem hiding this comment.
Somewhere we should also have a verification of an amount that is rounded in the UI.
| return false; | ||
| } | ||
|
|
||
| export const isValidSampleAmountWithError = (v: any): any => { |
Contributor
There was a problem hiding this comment.
I don't love the name of this method. Since it's really just returning an error message for invalid amounts, perhaps getInvalidSampleAmountMessage would be appropriate.
| value: UNITS_KIND.COUNT, | ||
| label: 'Other', | ||
| hideSubSelect: true, | ||
| msg: 'Amounts can be entered as unit, pcs, pack, blocks, slides, cells, box, kit, tests, or bottle and won’t be converted.', |
Contributor
There was a problem hiding this comment.
Alphabetization here would be more consistent and readable.
| value: UNITS_KIND.NONE, | ||
| label: 'Any', | ||
| hideSubSelect: true, | ||
| msg: 'Amounts can be entered in any unit and won’t be converted.', |
Contributor
There was a problem hiding this comment.
Perhaps "won't be converted when stored or displayed?" (I'm not sure users know when or why conversions happen.)
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.
Rationale
Support more unit types and validate amount input values
Related Pull Requests
Changes
sampleAmountfor validating sample amount/units input on forms