mirror of
https://github.com/SuiteCRM/SuiteCRM-Core.git
synced 2025-09-02 08:09:19 +08:00
Fix int validation
This commit is contained in:
parent
2ae25538e7
commit
003412ebdf
2 changed files with 3 additions and 8 deletions
|
@ -158,9 +158,7 @@ export class NumberFormatter implements Formatter {
|
|||
return false;
|
||||
}
|
||||
const regex = new RegExp(this.getIntUserFormatPattern());
|
||||
if (regex.test(trimmedInputValue)) {
|
||||
return false;
|
||||
}
|
||||
return !regex.test(trimmedInputValue);
|
||||
}
|
||||
|
||||
validateFloatUserFormat(inputValue: any): boolean {
|
||||
|
|
|
@ -61,16 +61,13 @@ export class IntValidator implements ValidatorInterface {
|
|||
}
|
||||
|
||||
applies(record: Record, viewField: ViewFieldDefinition): boolean {
|
||||
if (!viewField || !viewField.fieldDefinition) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return viewField.type === 'int';
|
||||
return (viewField?.type ?? viewField?.fieldDefinition?.type) === 'int' ;
|
||||
}
|
||||
|
||||
getValidator(viewField: ViewFieldDefinition): StandardValidatorFn[] {
|
||||
|
||||
if (!viewField || !viewField.fieldDefinition) {
|
||||
if (!(viewField?.type ?? viewField?.fieldDefinition?.type)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue