Skip to content

Commit

Permalink
Account for localization.isrequired with field.isRequired
Browse files Browse the repository at this point in the history
Fixes #4720
  • Loading branch information
melton-jason committed Apr 2, 2024
1 parent 968fc20 commit 1fd8bdc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ export class BusinessRuleManager<SCHEMA extends AnySchema> {
return true;
if (
field !== undefined &&
!(field.isRequired || field.localization.isrequired) &&
!field.isRequired &&
(value === undefined || value === null)
) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,19 +131,19 @@ export abstract class FieldBase {
this.isReadOnly =
globalFieldOverride === 'readOnly' || fieldDefinition.readOnly === true;

this.localization =
this.table.localization.items[this.name.toLowerCase()] ?? {};

this.isRequired =
globalFieldOverride === 'required'
? true
: globalFieldOverride === 'optional'
? false
: fieldDefinition.required;
: fieldDefinition.required || (this.localization?.isrequired ?? false);
this.type = fieldDefinition.type;
this.length = fieldDefinition.length;
this.databaseColumn = fieldDefinition.column;

this.localization =
this.table.localization.items[this.name.toLowerCase()] ?? {};

this.label =
typeof this.localization.name === 'string' &&
this.localization.name.length > 0
Expand Down

0 comments on commit 1fd8bdc

Please sign in to comment.