Issue 53934: Remove stored amount "too precise" validation check on setting amount modal#1861
Merged
Issue 53934: Remove stored amount "too precise" validation check on setting amount modal#1861
Conversation
labkey-susanh
approved these changes
Oct 6, 2025
packages/components/src/internal/components/samples/SampleAmountEditModal.tsx
Outdated
Show resolved
Hide resolved
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
Issue 53934: Sample Manager: show full precision on sample amount edit
Issue 53978: Inconsistent enforcement of precision in different places you can enter amounts
Our changes to the sample amounts/units columns moved the display unit conversion code into a SQL expression column to convert the base unit value into the display unit value (ex: stored as mL but displayed as L). This also include a ROUND() call that rounded the displayValue to the precision based on the unit type (i.e. mL shows 6 digits, L shows 9, uL shows 3, etc.).
However this means that the rounded display value is also what shows in the edit cases. As mentioned in one of the issues, a value entered as 0.0005 uL would display as the rounded 0.001 uL and would be 0.001 uL on edit in the grid, bulk, or sample amount modal.
This PR removes the "value is too precise" error on the sample amount modal, so that entering values there matches entering values from the editable grid and file import (which allow more precision). It also changes the display behavior to not do the ROUND() in SQL so that we can show the non-rounded value on edit in grid, bulk, and sample amount modal (i.e. we would display 0.001 uL as the display value but show the non rounded 0.0005 uL on edit).
Related Pull Requests
Changes