projects
/
arvados-workbench2.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
18559: Add context menu filter system for more complex context menus on user profile.
[arvados-workbench2.git]
/
src
/
validators
/
max-length.tsx
diff --git
a/src/validators/max-length.tsx
b/src/validators/max-length.tsx
index 1f8e5095cab29e5ccebadfe05ab0ea7fb6618539..370aa4c3a2ac939dbe8d957c8e1d7df691c4f22a 100644
(file)
--- a/
src/validators/max-length.tsx
+++ b/
src/validators/max-length.tsx
@@
-5,20
+5,12
@@
export const ERROR_MESSAGE = 'Maximum string length of this field is: ';
export const DEFAULT_MAX_VALUE = 60;
export const ERROR_MESSAGE = 'Maximum string length of this field is: ';
export const DEFAULT_MAX_VALUE = 60;
-interface MaxLengthProps {
- maxLengthValue: number;
- defaultErrorMessage: string;
-}
-
-// TODO types for maxLength
-const maxLength: any = (maxLengthValue = DEFAULT_MAX_VALUE, errorMessage = ERROR_MESSAGE) => {
+export const maxLength: any = (maxLengthValue = DEFAULT_MAX_VALUE, errorMessage = ERROR_MESSAGE) => {
return (value: string) => {
if (value) {
return (value: string) => {
if (value) {
- return value && value
&& value
.length <= maxLengthValue ? undefined : `${errorMessage || ERROR_MESSAGE} ${maxLengthValue}`;
+ return value && value.length <= maxLengthValue ? undefined : `${errorMessage || ERROR_MESSAGE} ${maxLengthValue}`;
}
return undefined;
};
};
}
return undefined;
};
};
-
-export default maxLength;
\ No newline at end of file