GitHub Issue 790: Sample check-in and discard should not allow amount/unit input for differing units#1947
Open
cnathe wants to merge 4 commits intorelease26.3-SNAPSHOTfrom
Open
GitHub Issue 790: Sample check-in and discard should not allow amount/unit input for differing units#1947cnathe wants to merge 4 commits intorelease26.3-SNAPSHOTfrom
cnathe wants to merge 4 commits intorelease26.3-SNAPSHOTfrom
Conversation
… "Count" unit labels - even though sample units might be of the same kind, make sure they are the same label in the "Count" case
XingY
reviewed
Mar 5, 2026
| return unitA.kind === unitB.kind; | ||
|
|
||
| // GitHub Issue #790: for "Count" kind, the specific label must also match | ||
| const matchingKinds = unitA.kind === unitB.kind; |
Contributor
There was a problem hiding this comment.
I believe the issue here is the faulty check of units for all selected rows, instead of compatibility of those Count units. If we do want to disallow Count units with different labels to be compatible, then we probably also need to enforce that on the server side.
Contributor
Author
There was a problem hiding this comment.
Yes, I was missing a piece in my initial repro steps. Thank you for the patch on that (see ui-premium Pr for that change). After discussion, we are going to keep this change as well to prevent (via the UI) the amount input from showing for Count unit types that differ in labels (i.e. cells and boxes).
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
GitHub Issue 790: Checking samples in from the same sample type but with differing units sometimes doesn't display proper warning
When a sample type allows for "any" units, the options for the "Count" unit kind include multiple labels. The check in and discard modals are currently checking for matching unit kinds when seeing if it should show the input to set the amount/unit or decrement the amount unit for the selected samples. In the case of the "Count" unit kind, we also want to make sure that the samples have matching unit labels (i.e. it doesn't make sense for a sample with N cells and another samples with N bottles to show an input to decrement them by N "something").
Related Pull Requests
Changes