Skip to content

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
26.3_fb_checkInUnits790
Open

GitHub Issue 790: Sample check-in and discard should not allow amount/unit input for differing units#1947
cnathe wants to merge 4 commits intorelease26.3-SNAPSHOTfrom
26.3_fb_checkInUnits790

Conversation

@cnathe
Copy link
Contributor

@cnathe cnathe commented Mar 4, 2026

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

  • update areUnitsCompatible to account for different "Count" unit labels

cnathe added 2 commits March 3, 2026 14:52
… "Count" unit labels

- even though sample units might be of the same kind, make sure they are the same label in the "Count" case
@cnathe cnathe self-assigned this Mar 4, 2026
@cnathe cnathe requested a review from XingY March 4, 2026 22:51
return unitA.kind === unitB.kind;

// GitHub Issue #790: for "Count" kind, the specific label must also match
const matchingKinds = unitA.kind === unitB.kind;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

@cnathe cnathe requested a review from XingY March 5, 2026 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants