Skip to content

Commit

Permalink
fix: fix: parseCheckArray checks for incremental field status
Browse files Browse the repository at this point in the history
Fix: `parseCheckArray` checks for `incremental` field status.
  • Loading branch information
foxhound87 committed Jul 14, 2023
1 parent 67fef53 commit 1d3ac21
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# 6.3.4 (master)
# 6.3.5 (master)
- Fix: `parseCheckArray` checks for `incremental` field status.
- Updated `semantic-release`

- # 6.3.4 (master)
- Fix: `isEmptyArray` reimplemented in `isArrayFromStruct` util function;
- Removed lodash `_.isArray()` with `Array.isArray()`
- Introduced `struct` prop in `makeField` method.
Expand Down
10 changes: 5 additions & 5 deletions src/Field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ export default class Field extends Base implements FieldInterface {
/* ------------------------------------------------------------------ */
/* COMPUTED */

get checkValidationErrors() {
get checkValidationErrors(): boolean {
return (
(this.validationAsyncData?.valid === false &&
!_.isEmpty(this.validationAsyncData)) ||
Expand Down Expand Up @@ -322,15 +322,15 @@ export default class Field extends Base implements FieldInterface {
}
}

get actionRunning() {
get actionRunning(): boolean {
return this.submitting || this.clearing || this.resetting;
}

get checked() {
get checked(): boolean {
return this.type === "checkbox" ? this.value : undefined;
}

get value() {
get value(): any {
return (typeof this._value === 'function' && !this.hasNestedFields)
? propGetter(this, FieldPropsEnum.value)
: this.getComputedProp(FieldPropsEnum.value);
Expand All @@ -342,7 +342,7 @@ export default class Field extends Base implements FieldInterface {
: this.getComputedProp(FieldPropsEnum.initial);
}

get default() {
get default(): any {
return this.$default
? toJS(this.$default)
: this.getComputedProp(FieldPropsEnum.default);
Expand Down
1 change: 1 addition & 0 deletions src/models/FieldInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import BaseInterface from "./BaseInterface";
import OptionsModel from "./OptionsModel";
import StateInterface from "./StateInterface";
export default interface FieldInterface extends BaseInterface {
hasInitialNestedFields: boolean;
id: string | undefined;
key: string | undefined;
name: string | undefined;
Expand Down
2 changes: 1 addition & 1 deletion src/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const parseArrayProp = (val: any, prop: string, removeNullishValuesInArrays: boo
};

const parseCheckArray = (field: any, value: any, prop: string, removeNullishValuesInArrays: boolean) => {
if (!field.fields.size && _.isObject(value) && _.isEmpty(value)) return [];
if (field.incremental && _.isObject(value) && _.isEmpty(value)) return [];
return field.hasIncrementalKeys ? parseArrayProp(value, prop, removeNullishValuesInArrays) : value;
}

Expand Down

0 comments on commit 1d3ac21

Please sign in to comment.