Skip to content

Commit 250ac2b

Browse files
Issue 1164: Don't allow negative delta amounts when checking in samples (#2022)
1 parent f2a32c6 commit 250ac2b

5 files changed

Lines changed: 12 additions & 4 deletions

File tree

packages/components/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/components/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@labkey/components",
3-
"version": "7.45.0",
3+
"version": "7.45.1",
44
"description": "Components, models, actions, and utility functions for LabKey applications and pages",
55
"sideEffects": false,
66
"files": [

packages/components/releaseNotes/components.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# @labkey/components
22
Components, models, actions, and utility functions for LabKey applications and pages
33

4+
### version 7.45.1
5+
*Released*: 25 June 2026
6+
- GH Issue #1164: Don't allow negative delta value during checkin
7+
48
### version 7.45.0
59
*Released*: 25 June 2026
610
- GitHub Issue 1234: User management page update to use SiteUsers for inactive users grid

packages/components/src/internal/util/measurement.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,14 @@ describe('UnitModel', () => {
5353
expect(new UnitModel(null, null).isValidForSubmit()).toBeTruthy();
5454
expect(new UnitModel(null, 'bad').isValidForSubmit()).toBeTruthy();
5555
expect(new UnitModel(null, 'mL').isValidForSubmit()).toBeFalsy();
56+
expect(new UnitModel('no', 'mL').isValidForSubmit()).toBeFalsy();
57+
expect(new UnitModel(-1, 'mL').isValidForSubmit()).toBeFalsy();
5658
expect(new UnitModel(0, null).isValidForSubmit()).toBeFalsy();
5759
expect(new UnitModel(0, null).isValidForSubmit()).toBeFalsy();
5860
expect(new UnitModel(0, 'bad').isValidForSubmit()).toBeFalsy();
61+
expect(new UnitModel(-10.1, 'bad').isValidForSubmit()).toBeFalsy();
5962
expect(new UnitModel(0, 'mL').isValidForSubmit()).toBeTruthy();
63+
expect(new UnitModel(-0, 'mL').isValidForSubmit()).toBeTruthy();
6064
expect(new UnitModel(1, 'uL').isValidForSubmit()).toBeTruthy();
6165
});
6266
});

packages/components/src/internal/util/measurement.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export class UnitModel {
8686
}
8787

8888
isValidForSubmit(): boolean {
89-
const hasBoth = this.value != undefined && this.unit != null;
89+
const hasBoth = this.value != undefined && !isNaN(this.value) && this.value >= 0 && this.unit != null;
9090
const hasNeither = this.value == undefined && this.unit == null;
9191
return hasBoth || hasNeither;
9292
}

0 commit comments

Comments
 (0)