projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
15856: Adds a conditional warning icon on the breadcrumbs and collection panel.
[arvados.git]
/
src
/
validators
/
is-number.tsx
diff --git
a/src/validators/is-number.tsx
b/src/validators/is-number.tsx
index 9b548b948384a500df50134db9c9da888b48ba64..b43eec956cb927f7c9d4058da05479dbbca9e15c 100644
(file)
--- a/
src/validators/is-number.tsx
+++ b/
src/validators/is-number.tsx
@@
-3,8
+3,8
@@
// SPDX-License-Identifier: AGPL-3.0
import { isNumber as isNum } from 'lodash';
// SPDX-License-Identifier: AGPL-3.0
import { isNumber as isNum } from 'lodash';
-const ERROR_MESSAGE = 'This field
must be a number
';
+const ERROR_MESSAGE = 'This field
can only contain numeric values
';
export const isNumber = (value: any) => {
export const isNumber = (value: any) => {
- return isNum(value) ? undefined : ERROR_MESSAGE;
+ return
!isNaN(value) &&
isNum(value) ? undefined : ERROR_MESSAGE;
};
};