fix: cannot read properties of undefined (reading 'type')

This commit is contained in:
chenos 2024-10-01 00:03:41 +08:00
parent dedca47d1d
commit 512df745fa
2 changed files with 6 additions and 6 deletions

View File

@ -45,7 +45,7 @@ export const GridCardItem = withDynamicSchemaProps(
const field = useField<ObjectField>();
const parentRecordData = useCollectionParentRecordData();
return (
<Card role="button" aria-label="grid-card-item" className={gridCardCss}>
<Card bordered={false} role="button" aria-label="grid-card-item" className={gridCardCss}>
<div className={itemCss}>
<RecordProvider record={field.value} parent={parentRecordData}>
{props.children}

View File

@ -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<string, any>;
@ -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
) {