@8base/utils
Advanced tools
Comparing version 2.6.5 to 2.6.6
@@ -6,2 +6,13 @@ # Change Log | ||
## [2.6.6](https://github.com/8base/sdk/compare/v2.6.5...v2.6.6) (2022-03-18) | ||
### Bug Fixes | ||
* **utils:** ignore pristine values at format data mutation ([21625c6](https://github.com/8base/sdk/commit/21625c687069903436a69451b4e214e9b3332ed4)) | ||
## [2.6.5](https://github.com/8base/sdk/compare/v2.6.4...v2.6.5) (2021-10-29) | ||
@@ -8,0 +19,0 @@ |
@@ -32,2 +32,3 @@ "use strict"; | ||
ignoreNonTableFields: true, | ||
ignorePristineValues: false, | ||
}; | ||
@@ -68,3 +69,3 @@ const shouldPreserveMetaField = ({ type, fieldName }) => { | ||
const fieldSchema = selectors_1.tableSelectors.getFieldByName(tableSchema, fieldName); | ||
const { skip, mutate, ignoreNonTableFields } = options; | ||
const { skip, mutate, ignoreNonTableFields, ignorePristineValues } = options; | ||
if (!fieldSchema) { | ||
@@ -109,9 +110,11 @@ if (ignoreNonTableFields) { | ||
} | ||
if (typeof formatedFieldData === 'string' && formatedFieldData === initialFieldData) { | ||
return result; | ||
if (ignorePristineValues) { | ||
if (typeof formatedFieldData === 'string' && formatedFieldData === initialFieldData) { | ||
return result; | ||
} | ||
// TODO: need to discuss with core team how to handle case when filed `isList` and have `Default Value` | ||
// if (Array.isArray(formatedFieldData) && R.equals(formatedFieldData, initialFieldData)) { | ||
// return result; | ||
// } | ||
} | ||
// TODO: need to discuss with core team how to handle case when filed `isList` and have `Default Value` | ||
// if (Array.isArray(formatedFieldData) && R.equals(formatedFieldData, initialFieldData)) { | ||
// return result; | ||
// } | ||
return Object.assign(Object.assign({}, result), { [fieldName]: formatedFieldData }); | ||
@@ -118,0 +121,0 @@ }, {}, dataKeys); |
@@ -150,3 +150,4 @@ import { FIELD_TYPE, SWITCH_FORMATS, TEXT_FORMATS, NUMBER_FORMATS, FILE_FORMATS, DATE_FORMATS, MUTATION_TYPE, SMART_FORMATS, APP_STATUS, FIELD_KINDS, TABLE_ORIGIN_TYPES } from './constants'; | ||
ignoreNonTableFields?: boolean; | ||
ignorePristineValues?: boolean; | ||
}; | ||
//# sourceMappingURL=types.d.ts.map |
{ | ||
"name": "@8base/utils", | ||
"version": "2.6.5", | ||
"version": "2.6.6", | ||
"repository": "https://github.com/8base/sdk", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/8base/sdk/tree/master/packages/core/utils", |
@@ -20,2 +20,3 @@ import * as R from 'ramda'; | ||
ignoreNonTableFields: true, | ||
ignorePristineValues: false, | ||
}; | ||
@@ -78,3 +79,3 @@ | ||
const fieldSchema = tableSelectors.getFieldByName(tableSchema, fieldName); | ||
const { skip, mutate, ignoreNonTableFields } = options; | ||
const { skip, mutate, ignoreNonTableFields, ignorePristineValues } = options; | ||
@@ -136,11 +137,13 @@ if (!fieldSchema) { | ||
if (typeof formatedFieldData === 'string' && formatedFieldData === initialFieldData) { | ||
return result; | ||
if (ignorePristineValues) { | ||
if (typeof formatedFieldData === 'string' && formatedFieldData === initialFieldData) { | ||
return result; | ||
} | ||
// TODO: need to discuss with core team how to handle case when filed `isList` and have `Default Value` | ||
// if (Array.isArray(formatedFieldData) && R.equals(formatedFieldData, initialFieldData)) { | ||
// return result; | ||
// } | ||
} | ||
// TODO: need to discuss with core team how to handle case when filed `isList` and have `Default Value` | ||
// if (Array.isArray(formatedFieldData) && R.equals(formatedFieldData, initialFieldData)) { | ||
// return result; | ||
// } | ||
return { | ||
@@ -147,0 +150,0 @@ ...result, |
@@ -187,2 +187,3 @@ import { | ||
ignoreNonTableFields?: boolean; | ||
ignorePristineValues?: boolean; | ||
}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
332463
5308