diff --git a/packages/core/client/src/formily/NocoBaseRecursionField.tsx b/packages/core/client/src/formily/NocoBaseRecursionField.tsx index 4c48351125..c2c75af9bb 100644 --- a/packages/core/client/src/formily/NocoBaseRecursionField.tsx +++ b/packages/core/client/src/formily/NocoBaseRecursionField.tsx @@ -152,12 +152,12 @@ const createMergedSchemaInstance = (schema: Schema, uiSchema: ISchema, onlyRende const firstPropertyKey = Object.keys(clonedSchema.properties)[0]; const firstPropertyValue = Object.values(clonedSchema.properties)[0]; // Some uiSchema's type value is "void", which can cause exceptions, so we need to ignore the type field - clonedSchema.properties[firstPropertyKey] = merge(_.omit(uiSchema, 'type'), firstPropertyValue); + clonedSchema.properties[firstPropertyKey] = merge(_.omit(uiSchema, 'type', 'x-read-pretty'), firstPropertyValue); return new Schema(clonedSchema); } // Some uiSchema's type value is "void", which can cause exceptions, so we need to ignore the type field - return new Schema(merge(_.omit(uiSchema, 'type'), clonedSchema)); + return new Schema(merge(_.omit(uiSchema, 'type', 'x-read-pretty'), clonedSchema)); }; const propertiesToReactElement = ({ diff --git a/packages/plugins/@nocobase/plugin-data-source-main/src/client/__e2e__/fields/createdAt/schemaInitializer.test.ts b/packages/plugins/@nocobase/plugin-data-source-main/src/client/__e2e__/fields/createdAt/schemaInitializer.test.ts index 1a4bb0fee9..544eadb5f1 100644 --- a/packages/plugins/@nocobase/plugin-data-source-main/src/client/__e2e__/fields/createdAt/schemaInitializer.test.ts +++ b/packages/plugins/@nocobase/plugin-data-source-main/src/client/__e2e__/fields/createdAt/schemaInitializer.test.ts @@ -62,6 +62,25 @@ test.describe('form item & edit form', () => { }); }); +test.describe('form item & filter form', () => { + test('should be editable', async ({ page, mockPage, mockRecord }) => { + await mockPage().goto(); + + // 1. 添加一个 filter form 区块 + await page.getByLabel('schema-initializer-Grid-page:').hover(); + await page.getByRole('menuitem', { name: 'Form right' }).nth(1).hover(); + await page.getByRole('menuitem', { name: 'Users' }).click(); + + // 2. 为 filter form 添加一个 createdAt 字段 + await page.getByLabel('schema-initializer-Grid-filterForm:configureFields-users').hover(); + await page.getByRole('menuitem', { name: 'Created at' }).first().click(); + await page.mouse.move(300, 0); + + // 3. createdAt 字段字段应该是可编辑的 + await expect(page.getByPlaceholder('Select date')).toBeVisible(); + }); +}); + test.describe('form item & view form', () => { test('configure fields', async ({ page, mockPage, mockRecord }) => { const nocoPage = await mockPage(oneTableBlockWithAddNewAndViewAndEditAndSystemInfoFields).waitForInit();