From 512df745fa395c47cdee65b9fad3473e384557f8 Mon Sep 17 00:00:00 2001 From: chenos Date: Tue, 1 Oct 2024 00:03:41 +0800 Subject: [PATCH] fix: cannot read properties of undefined (reading 'type') --- .../schema-component/antd/grid-card/GridCard.Item.tsx | 2 +- .../client/src/schema-component/common/utils/uitls.tsx | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/core/client/src/schema-component/antd/grid-card/GridCard.Item.tsx b/packages/core/client/src/schema-component/antd/grid-card/GridCard.Item.tsx index 0e93250c58..1bcba0f03a 100644 --- a/packages/core/client/src/schema-component/antd/grid-card/GridCard.Item.tsx +++ b/packages/core/client/src/schema-component/antd/grid-card/GridCard.Item.tsx @@ -45,7 +45,7 @@ export const GridCardItem = withDynamicSchemaProps( const field = useField(); const parentRecordData = useCollectionParentRecordData(); return ( - +
{props.children} diff --git a/packages/core/client/src/schema-component/common/utils/uitls.tsx b/packages/core/client/src/schema-component/common/utils/uitls.tsx index c305551283..67cdf25ab0 100644 --- a/packages/core/client/src/schema-component/common/utils/uitls.tsx +++ b/packages/core/client/src/schema-component/common/utils/uitls.tsx @@ -7,18 +7,17 @@ * For more information, please refer to: https://www.nocobase.com/agreement. */ -import Handlebars from 'handlebars'; -import { dayjs } from '@nocobase/utils/client'; import helpers from '@budibase/handlebars-helpers'; +import { dayjs, getPickerFormat } from '@nocobase/utils/client'; +import Handlebars from 'handlebars'; import _, { every, findIndex, some } from 'lodash'; -import { getPickerFormat } from '@nocobase/utils/client'; +import url from 'url'; import { replaceVariableValue } from '../../../block-provider/hooks'; import { VariableOption, VariablesContextType } from '../../../variables/types'; import { isVariable } from '../../../variables/utils/isVariable'; import { transformVariableValue } from '../../../variables/utils/transformVariableValue'; -import { getJsonLogic } from '../../common/utils/logic'; import { inferPickerType } from '../../antd/date-picker/util'; -import url from 'url'; +import { getJsonLogic } from '../../common/utils/logic'; type VariablesCtx = { /** 当前登录的用户 */ $user?: Record; @@ -129,6 +128,7 @@ export const conditionAnalyses = async ({ let currentInputValue = transformVariableValue(targetValue, { targetCollectionField }); const comparisonValue = transformVariableValue(value, { targetCollectionField }); if ( + targetCollectionField?.type && ['datetime', 'date', 'datetimeNoTz', 'dateOnly', 'unixTimestamp'].includes(targetCollectionField.type) && currentInputValue ) {