diff --git a/lerna.json b/lerna.json index 79f79f730d..25f2420703 100644 --- a/lerna.json +++ b/lerna.json @@ -2,9 +2,7 @@ "version": "1.3.42-beta", "npmClient": "yarn", "useWorkspaces": true, - "npmClientArgs": [ - "--ignore-engines" - ], + "npmClientArgs": ["--ignore-engines"], "command": { "version": { "forcePublish": true, diff --git a/packages/core/client/src/block-provider/DetailsBlockProvider.tsx b/packages/core/client/src/block-provider/DetailsBlockProvider.tsx index cb050435cb..9c1a6c2293 100644 --- a/packages/core/client/src/block-provider/DetailsBlockProvider.tsx +++ b/packages/core/client/src/block-provider/DetailsBlockProvider.tsx @@ -142,6 +142,8 @@ export const useDetailsBlockProps = () => { .reset() .then(() => { ctx.form.setInitialValues(data || {}); + ctx.form.setValues(data || {}); + // Using `ctx.form.setValues(data || {});` here may cause an internal infinite loop in Formily }) .catch(console.error); diff --git a/packages/plugins/@nocobase/plugin-data-source-main/src/client/__e2e__/fields/checkbox/schemaSettings.test.ts b/packages/plugins/@nocobase/plugin-data-source-main/src/client/__e2e__/fields/checkbox/schemaSettings.test.ts index c7e94c032c..d5fbee9105 100644 --- a/packages/plugins/@nocobase/plugin-data-source-main/src/client/__e2e__/fields/checkbox/schemaSettings.test.ts +++ b/packages/plugins/@nocobase/plugin-data-source-main/src/client/__e2e__/fields/checkbox/schemaSettings.test.ts @@ -159,7 +159,7 @@ test.describe('form item & edit form', () => { gotoPage: async () => { record = await (async (mockPage, mockRecord) => { const nocoPage = await mockPage(oneTableBlockWithAddNewAndViewAndEditAndChoicesFields).waitForInit(); - const record = await mockRecord('general'); + const record = await mockRecord('general', { checkbox: false }); await nocoPage.goto(); return record; diff --git a/packages/plugins/@nocobase/plugin-map/src/client/components/MapComponent.tsx b/packages/plugins/@nocobase/plugin-map/src/client/components/MapComponent.tsx index a5bf4a71d8..b436bfc9bb 100644 --- a/packages/plugins/@nocobase/plugin-map/src/client/components/MapComponent.tsx +++ b/packages/plugins/@nocobase/plugin-map/src/client/components/MapComponent.tsx @@ -27,7 +27,6 @@ export const MapComponent = React.forwardRef((props, ref) => { if (!Component) { return
{t(`The ${mapType} cannot found`)}
; } - return ; }); MapComponent.displayName = 'MapComponent'; diff --git a/packages/plugins/@nocobase/plugin-map/src/client/components/ReadPretty.tsx b/packages/plugins/@nocobase/plugin-map/src/client/components/ReadPretty.tsx index f331418a2e..d691199b0c 100644 --- a/packages/plugins/@nocobase/plugin-map/src/client/components/ReadPretty.tsx +++ b/packages/plugins/@nocobase/plugin-map/src/client/components/ReadPretty.tsx @@ -7,7 +7,7 @@ * For more information, please refer to: https://www.nocobase.com/agreement. */ -import { useFieldSchema, useForm } from '@formily/react'; +import { useField, useFieldSchema, useForm } from '@formily/react'; import { EllipsisWithTooltip, useCollection_deprecated, useFieldTitle } from '@nocobase/client'; import React from 'react'; import { MapComponent } from './MapComponent'; @@ -19,9 +19,9 @@ const ReadPretty = (props) => { const collectionField = getField(fieldSchema.name); const mapType = props.mapType || collectionField?.uiSchema['x-component-props']?.mapType; const form = useForm(); + const field = useField(); useFieldTitle(); - - if (!form.readPretty) { + if (!form.readPretty || field.readPretty) { return (