From 91460313983588f9a9e92978cb9ae15f00f97ff4 Mon Sep 17 00:00:00 2001 From: Zeke Zhang <958414905@qq.com> Date: Thu, 7 Mar 2024 18:46:25 +0800 Subject: [PATCH] refactor: table:configureColumns --- .../collection-manager/interfaces/subTable.ts | 2 +- .../form-create/schemaSettings.test.ts | 4 +- .../__e2e__/form-create/templatesOfBug.ts | 14 ++--- .../__e2e__/schemaInitializer.test.ts | 2 +- .../table/TableColumnInitializers.tsx | 2 +- .../table/__e2e__/schemaInitializer.test.ts | 4 +- .../table/__e2e__/schemaSettings.test.ts | 6 +- .../table/__e2e__/templatesOfBug.ts | 6 +- .../modules/dialog/__e2e__/templatesOfBug.ts | 4 +- .../antd/association-field/schema.ts | 2 +- .../client/src/schema-initializer/utils.ts | 4 +- packages/core/test/src/e2e/templatesOfPage.ts | 54 ++++++++--------- .../plugin-acl/src/client/__e2e__/utils.ts | 2 +- .../src/client/__e2e__/utils.ts | 4 +- .../src/client/__e2e__/utils.ts | 4 +- .../src/client/__e2e__/utils.ts | 4 +- .../src/client/__e2e__/utils.ts | 2 +- .../fields/manyToMany/schemaSettings.test.ts | 2 +- .../src/client/__e2e__/utils.ts | 2 +- .../client/__e2e__/schemaInitailizer.test.ts | 4 +- .../plugin-gantt/src/client/__e2e__/utils.ts | 2 +- .../plugin-gantt/src/client/utils.tsx | 2 +- .../src/server/__tests__/fixtures/data.ts | 60 +++++++++---------- 23 files changed, 92 insertions(+), 100 deletions(-) diff --git a/packages/core/client/src/collection-manager/interfaces/subTable.ts b/packages/core/client/src/collection-manager/interfaces/subTable.ts index 5cd23008e6..e3a0f4434d 100644 --- a/packages/core/client/src/collection-manager/interfaces/subTable.ts +++ b/packages/core/client/src/collection-manager/interfaces/subTable.ts @@ -48,7 +48,7 @@ export class SubTableFieldInterface extends CollectionFieldInterface { }, [field.name]: { type: 'array', - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component': 'TableV2', 'x-component-props': { rowSelection: { diff --git a/packages/core/client/src/modules/blocks/data-blocks/form/__e2e__/form-create/schemaSettings.test.ts b/packages/core/client/src/modules/blocks/data-blocks/form/__e2e__/form-create/schemaSettings.test.ts index ee3f096863..d1edef10dd 100644 --- a/packages/core/client/src/modules/blocks/data-blocks/form/__e2e__/form-create/schemaSettings.test.ts +++ b/packages/core/client/src/modules/blocks/data-blocks/form/__e2e__/form-create/schemaSettings.test.ts @@ -622,7 +622,7 @@ test.describe('creation form block schema settings', () => { .hover(); await page.mouse.move(100, 0); - await page.getByLabel('schema-initializer-AssociationField.SubTable-fieldInitializers:tableColumn-users').hover(); + await page.getByLabel('schema-initializer-AssociationField.SubTable-table:configureColumns-users').hover(); await page.getByRole('menuitem', { name: 'Nickname' }).click(); await page.getByRole('menuitem', { name: 'Username' }).click(); @@ -1014,7 +1014,7 @@ test.describe('creation form block schema settings', () => { _isJSONSchemaObject: true, version: '2.0', type: 'array', - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component': 'TableV2', 'x-component-props': { rowKey: 'id', diff --git a/packages/core/client/src/modules/blocks/data-blocks/form/__e2e__/form-create/templatesOfBug.ts b/packages/core/client/src/modules/blocks/data-blocks/form/__e2e__/form-create/templatesOfBug.ts index 02f7f06f36..f4f49dc599 100644 --- a/packages/core/client/src/modules/blocks/data-blocks/form/__e2e__/form-create/templatesOfBug.ts +++ b/packages/core/client/src/modules/blocks/data-blocks/form/__e2e__/form-create/templatesOfBug.ts @@ -350,7 +350,7 @@ export const T2174 = { _isJSONSchemaObject: true, version: '2.0', type: 'array', - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component': 'TableV2', 'x-component-props': { rowKey: 'id', @@ -944,7 +944,7 @@ export const T2614: PageConfig = { _isJSONSchemaObject: true, version: '2.0', type: 'array', - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component': 'TableV2', 'x-component-props': { rowKey: 'id', @@ -2202,7 +2202,7 @@ export const T2993: PageConfig = { _isJSONSchemaObject: true, version: '2.0', type: 'array', - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component': 'TableV2', 'x-component-props': { rowKey: 'id', @@ -2613,7 +2613,7 @@ export const T2615: PageConfig = { _isJSONSchemaObject: true, version: '2.0', type: 'array', - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component': 'TableV2', 'x-component-props': { rowKey: 'id', @@ -3881,7 +3881,7 @@ export const T2845: PageConfig = { _isJSONSchemaObject: true, version: '2.0', type: 'array', - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component': 'TableV2', 'x-component-props': { rowKey: 'id', @@ -4753,7 +4753,7 @@ export const T2200 = { _isJSONSchemaObject: true, version: '2.0', type: 'array', - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component': 'TableV2', 'x-component-props': { rowKey: 'id', @@ -5125,7 +5125,7 @@ export const T3106: PageConfig = { version: '2.0', type: 'void', 'x-component': 'AssociationField.SubTable', - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-initializer-props': { action: false, }, diff --git a/packages/core/client/src/modules/blocks/data-blocks/table-selector/__e2e__/schemaInitializer.test.ts b/packages/core/client/src/modules/blocks/data-blocks/table-selector/__e2e__/schemaInitializer.test.ts index 2bcaf12ea6..14421ea655 100644 --- a/packages/core/client/src/modules/blocks/data-blocks/table-selector/__e2e__/schemaInitializer.test.ts +++ b/packages/core/client/src/modules/blocks/data-blocks/table-selector/__e2e__/schemaInitializer.test.ts @@ -99,6 +99,6 @@ test.describe('configure actions column', () => { }); async function createActionColumn(page: Page) { - await page.getByLabel('schema-initializer-TableV2.Selector-fieldInitializers:tableColumn-users').hover(); + await page.getByLabel('schema-initializer-TableV2.Selector-table:configureColumns-users').hover(); await page.getByRole('menuitem', { name: 'Action column' }).click(); } diff --git a/packages/core/client/src/modules/blocks/data-blocks/table/TableColumnInitializers.tsx b/packages/core/client/src/modules/blocks/data-blocks/table/TableColumnInitializers.tsx index 40c2f353a6..dcc8d31e49 100644 --- a/packages/core/client/src/modules/blocks/data-blocks/table/TableColumnInitializers.tsx +++ b/packages/core/client/src/modules/blocks/data-blocks/table/TableColumnInitializers.tsx @@ -112,7 +112,7 @@ export const tableColumnInitializers_deprecated = new CompatibleSchemaInitialize export const tableColumnInitializers = new CompatibleSchemaInitializer( { - name: 'fieldInitializers:tableColumn', + name: 'table:configureColumns', insertPosition: 'beforeEnd', icon: 'SettingOutlined', title: '{{t("Configure columns")}}', diff --git a/packages/core/client/src/modules/blocks/data-blocks/table/__e2e__/schemaInitializer.test.ts b/packages/core/client/src/modules/blocks/data-blocks/table/__e2e__/schemaInitializer.test.ts index 2f2c21561d..af3615a7b7 100644 --- a/packages/core/client/src/modules/blocks/data-blocks/table/__e2e__/schemaInitializer.test.ts +++ b/packages/core/client/src/modules/blocks/data-blocks/table/__e2e__/schemaInitializer.test.ts @@ -70,9 +70,7 @@ test.describe('configure columns', () => { test.describe.configure({ retries: process.env.CI ? 4 : 0 }); test('action column & display collection fields & display association fields', async ({ page, mockPage }) => { await mockPage(oneEmptyTable).goto(); - const configureColumnButton = page.getByLabel( - 'schema-initializer-TableV2-fieldInitializers:tableColumn-t_unp4scqamw9', - ); + const configureColumnButton = page.getByLabel('schema-initializer-TableV2-table:configureColumns-t_unp4scqamw9'); // Action column ------------------------------------------------------------- // 1. 点击开关,可以开启和关闭 Action column diff --git a/packages/core/client/src/modules/blocks/data-blocks/table/__e2e__/schemaSettings.test.ts b/packages/core/client/src/modules/blocks/data-blocks/table/__e2e__/schemaSettings.test.ts index 539da2a977..8281b1a53f 100644 --- a/packages/core/client/src/modules/blocks/data-blocks/table/__e2e__/schemaSettings.test.ts +++ b/packages/core/client/src/modules/blocks/data-blocks/table/__e2e__/schemaSettings.test.ts @@ -101,7 +101,7 @@ test.describe('table block schema settings', () => { ).toBeChecked(); await expect(page.getByRole('menuitem', { name: 'Set default sorting rules' })).toBeHidden(); // 显示出来 email 和 ID - await page.getByLabel('schema-initializer-TableV2-fieldInitializers:tableColumn-general').hover(); + await page.getByLabel('schema-initializer-TableV2-table:configureColumns-general').hover(); await page.getByRole('menuitem', { name: 'email' }).click(); await page.getByRole('menuitem', { name: 'ID', exact: true }).click(); await page.getByLabel('schema-initializer-TableV2-').click(); @@ -141,7 +141,7 @@ test.describe('table block schema settings', () => { } async function createColumnItem(page: Page, fieldName: string) { - await page.getByLabel('schema-initializer-TableV2-fieldInitializers:tableColumn-general').hover(); + await page.getByLabel('schema-initializer-TableV2-table:configureColumns-general').hover(); await page.getByRole('menuitem', { name: fieldName, exact: true }).click(); await page.mouse.move(300, 0); } @@ -213,7 +213,7 @@ test.describe('table block schema settings', () => { await page.getByRole('button', { name: 'OK', exact: true }).click(); // 显示出来 email 和 ID - await page.getByLabel('schema-initializer-TableV2-fieldInitializers:tableColumn-general').hover(); + await page.getByLabel('schema-initializer-TableV2-table:configureColumns-general').hover(); await page.getByRole('menuitem', { name: 'email' }).click(); await page.getByRole('menuitem', { name: 'ID', exact: true }).click(); await page.mouse.move(300, 0); diff --git a/packages/core/client/src/modules/blocks/data-blocks/table/__e2e__/templatesOfBug.ts b/packages/core/client/src/modules/blocks/data-blocks/table/__e2e__/templatesOfBug.ts index abfc1c9ff4..ac4db1d4d0 100644 --- a/packages/core/client/src/modules/blocks/data-blocks/table/__e2e__/templatesOfBug.ts +++ b/packages/core/client/src/modules/blocks/data-blocks/table/__e2e__/templatesOfBug.ts @@ -87,7 +87,7 @@ export const T2183 = { _isJSONSchemaObject: true, version: '2.0', type: 'array', - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component': 'TableV2', 'x-component-props': { rowKey: 'id', @@ -246,7 +246,7 @@ export const T2186 = { _isJSONSchemaObject: true, version: '2.0', type: 'array', - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component': 'TableV2', 'x-component-props': { rowKey: 'id', @@ -383,7 +383,7 @@ export const T2187 = { _isJSONSchemaObject: true, version: '2.0', type: 'array', - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component': 'TableV2', 'x-component-props': { rowKey: 'id', diff --git a/packages/core/client/src/modules/dialog/__e2e__/templatesOfBug.ts b/packages/core/client/src/modules/dialog/__e2e__/templatesOfBug.ts index 42ce23a06a..795a55ec23 100644 --- a/packages/core/client/src/modules/dialog/__e2e__/templatesOfBug.ts +++ b/packages/core/client/src/modules/dialog/__e2e__/templatesOfBug.ts @@ -74,7 +74,7 @@ export const T2797: PageConfig = { _isJSONSchemaObject: true, version: '2.0', type: 'array', - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component': 'TableV2', 'x-component-props': { rowKey: 'id', @@ -654,7 +654,7 @@ export const T2838: PageConfig = { _isJSONSchemaObject: true, version: '2.0', type: 'array', - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component': 'TableV2', 'x-component-props': { rowKey: 'id', diff --git a/packages/core/client/src/schema-component/antd/association-field/schema.ts b/packages/core/client/src/schema-component/antd/association-field/schema.ts index 28cc045f74..23ceada498 100644 --- a/packages/core/client/src/schema-component/antd/association-field/schema.ts +++ b/packages/core/client/src/schema-component/antd/association-field/schema.ts @@ -122,7 +122,7 @@ export default { SubTable: { type: 'void', 'x-component': 'AssociationField.SubTable', - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-initializer-props': { action: false, }, diff --git a/packages/core/client/src/schema-initializer/utils.ts b/packages/core/client/src/schema-initializer/utils.ts index 55b0f44e1a..2709b6a3f8 100644 --- a/packages/core/client/src/schema-initializer/utils.ts +++ b/packages/core/client/src/schema-initializer/utils.ts @@ -1365,7 +1365,7 @@ export const createTableBlockSchema = (options) => { }, [uid()]: { type: 'array', - 'x-initializer': tableColumnInitializers ?? 'fieldInitializers:tableColumn', + 'x-initializer': tableColumnInitializers ?? 'table:configureColumns', 'x-component': 'TableV2', 'x-component-props': { rowKey: 'id', @@ -1469,7 +1469,7 @@ export const createTableSelectorSchema = (options) => { }, value: { type: 'array', - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component': 'TableV2.Selector', 'x-component-props': { rowSelection: { diff --git a/packages/core/test/src/e2e/templatesOfPage.ts b/packages/core/test/src/e2e/templatesOfPage.ts index f217bdf711..c50c88fe8e 100644 --- a/packages/core/test/src/e2e/templatesOfPage.ts +++ b/packages/core/test/src/e2e/templatesOfPage.ts @@ -208,7 +208,7 @@ export const oneEmptyTable: PageConfig = { _isJSONSchemaObject: true, version: '2.0', type: 'array', - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component': 'TableV2', 'x-component-props': { rowKey: 'id', @@ -1468,7 +1468,7 @@ export const oneEmptyTableBlockWithActions: PageConfig = { _isJSONSchemaObject: true, version: '2.0', type: 'array', - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component': 'TableV2', 'x-component-props': { rowKey: 'id', @@ -2248,7 +2248,7 @@ export const oneTableBlockWithActionsAndFormBlocks: PageConfig = { _isJSONSchemaObject: true, version: '2.0', type: 'array', - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component': 'TableV2', 'x-component-props': { rowKey: 'id', @@ -2799,7 +2799,7 @@ export const oneEmptyTableBlockWithCustomizeActions: PageConfig = { _isJSONSchemaObject: true, version: '2.0', type: 'array', - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component': 'TableV2', 'x-component-props': { rowKey: 'id', @@ -4537,7 +4537,7 @@ export const oneTableBlockWithAddNewAndViewAndEditAndBasicFields: PageConfig = { _isJSONSchemaObject: true, version: '2.0', type: 'array', - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component': 'TableV2', 'x-component-props': { rowKey: 'id', @@ -5926,7 +5926,7 @@ export const oneTableBlockWithAddNewAndViewAndEditAndBasicFieldsAndSubTable: Pag _isJSONSchemaObject: true, version: '2.0', type: 'array', - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component': 'TableV2', 'x-component-props': { rowKey: 'id', @@ -6090,7 +6090,7 @@ export const oneTableBlockWithAddNewAndViewAndEditAndBasicFieldsAndSubTable: Pag 'x-component': 'AssociationField.SubTable', 'x-initializer': - 'fieldInitializers:tableColumn', + 'table:configureColumns', 'x-initializer-props': { action: false, }, @@ -6750,7 +6750,7 @@ export const oneTableBlockWithAddNewAndViewAndEditAndChoicesFields: PageConfig = _isJSONSchemaObject: true, version: '2.0', type: 'array', - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component': 'TableV2', 'x-component-props': { rowKey: 'id', @@ -8070,7 +8070,7 @@ export const oneTableBlockWithAddNewAndViewAndEditAndMediaFields: PageConfig = { _isJSONSchemaObject: true, version: '2.0', type: 'array', - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component': 'TableV2', 'x-component-props': { rowKey: 'id', @@ -9125,7 +9125,7 @@ export const oneTableBlockWithAddNewAndViewAndEditAndDatetimeFields: PageConfig _isJSONSchemaObject: true, version: '2.0', type: 'array', - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component': 'TableV2', 'x-component-props': { rowKey: 'id', @@ -10211,7 +10211,7 @@ export const oneTableBlockWithAddNewAndViewAndEditAndAssociationFields: PageConf _isJSONSchemaObject: true, version: '2.0', type: 'array', - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component': 'TableV2', 'x-component-props': { rowKey: 'id', @@ -11806,7 +11806,7 @@ export const oneTableBlockWithAddNewAndViewAndEditAndAdvancedFields: PageConfig _isJSONSchemaObject: true, version: '2.0', type: 'array', - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component': 'TableV2', 'x-component-props': { rowKey: 'id', @@ -13202,7 +13202,7 @@ export const oneTableBlockWithAddNewAndViewAndEditAndSystemInfoFields: PageConfi _isJSONSchemaObject: true, version: '2.0', type: 'array', - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component': 'TableV2', 'x-component-props': { rowKey: 'id', @@ -14468,7 +14468,7 @@ export const oneEmptyTableWithTreeCollection: PageConfig = { _isJSONSchemaObject: true, version: '2.0', type: 'array', - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component': 'TableV2', 'x-component-props': { rowKey: 'id', @@ -14751,7 +14751,7 @@ export const oneCollapseAndOneTableWithSameCollection: PageConfig = { _isJSONSchemaObject: true, version: '2.0', type: 'array', - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component': 'TableV2', 'x-component-props': { rowKey: 'id', @@ -15551,7 +15551,7 @@ export const oneTableSubformWithMultiLevelAssociationFields: PageConfig = { _isJSONSchemaObject: true, version: '2.0', type: 'array', - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component': 'TableV2', 'x-component-props': { rowKey: 'id', @@ -17267,7 +17267,7 @@ export const oneTableSubtableWithMultiLevelAssociationFields: PageConfig = { _isJSONSchemaObject: true, version: '2.0', type: 'array', - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component': 'TableV2', 'x-component-props': { rowKey: 'id', @@ -17557,7 +17557,7 @@ export const oneTableSubtableWithMultiLevelAssociationFields: PageConfig = { 'x-component': 'AssociationField.SubTable', 'x-initializer': - 'fieldInitializers:tableColumn', + 'table:configureColumns', 'x-initializer-props': { action: false, }, @@ -17899,7 +17899,7 @@ export const oneTableSubtableWithMultiLevelAssociationFields: PageConfig = { 'x-component': 'AssociationField.SubTable', 'x-initializer': - 'fieldInitializers:tableColumn', + 'table:configureColumns', 'x-initializer-props': { action: false, }, @@ -18442,7 +18442,7 @@ export const formBlockDefaultValueTemplate: PageConfig = { _isJSONSchemaObject: true, version: '2.0', type: 'array', - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component': 'TableV2', 'x-component-props': { rowKey: 'id', @@ -19002,7 +19002,7 @@ export const oneFormAndOneTableWithSameCollection: PageConfig = { _isJSONSchemaObject: true, version: '2.0', type: 'array', - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component': 'TableV2', 'x-component-props': { rowKey: 'id', @@ -19193,7 +19193,7 @@ export const twoTableWithSameCollection: PageConfig = { _isJSONSchemaObject: true, version: '2.0', type: 'array', - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component': 'TableV2', 'x-component-props': { rowKey: 'id', @@ -19301,7 +19301,7 @@ export const twoTableWithSameCollection: PageConfig = { _isJSONSchemaObject: true, version: '2.0', type: 'array', - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component': 'TableV2', 'x-component-props': { rowKey: 'id', @@ -19458,7 +19458,7 @@ export const twoTableWithAssociationFields: PageConfig = { _isJSONSchemaObject: true, version: '2.0', type: 'array', - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component': 'TableV2', 'x-component-props': { rowKey: 'id', @@ -19565,7 +19565,7 @@ export const twoTableWithAssociationFields: PageConfig = { _isJSONSchemaObject: true, version: '2.0', type: 'array', - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component': 'TableV2', 'x-component-props': { rowKey: 'id', @@ -19723,7 +19723,7 @@ export const oneEmptyTableBlockBasedOnUsers = { _isJSONSchemaObject: true, version: '2.0', type: 'array', - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component': 'TableV2', 'x-component-props': { rowKey: 'id', @@ -19904,7 +19904,7 @@ export const checkboxForTableRow = { _isJSONSchemaObject: true, version: '2.0', type: 'array', - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component': 'TableV2', 'x-component-props': { rowKey: 'id', diff --git a/packages/plugins/@nocobase/plugin-acl/src/client/__e2e__/utils.ts b/packages/plugins/@nocobase/plugin-acl/src/client/__e2e__/utils.ts index 575aa331bd..9a4aee93ff 100644 --- a/packages/plugins/@nocobase/plugin-acl/src/client/__e2e__/utils.ts +++ b/packages/plugins/@nocobase/plugin-acl/src/client/__e2e__/utils.ts @@ -767,7 +767,7 @@ export const oneTableBlock: PageConfig = { type: 'array', version: '2.0', 'x-component': 'TableV2', - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component-props': { rowKey: 'id', useProps: '{{ useTableBlockProps }}', diff --git a/packages/plugins/@nocobase/plugin-action-bulk-edit/src/client/__e2e__/utils.ts b/packages/plugins/@nocobase/plugin-action-bulk-edit/src/client/__e2e__/utils.ts index 27fb19dd6a..2fc37d02a2 100644 --- a/packages/plugins/@nocobase/plugin-action-bulk-edit/src/client/__e2e__/utils.ts +++ b/packages/plugins/@nocobase/plugin-action-bulk-edit/src/client/__e2e__/utils.ts @@ -170,7 +170,7 @@ export const oneEmptyGantt: PageConfig = { maxWidth: '35%', }, }, - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component': 'TableV2', 'x-component-props': { rowKey: 'id', @@ -464,7 +464,7 @@ export const oneEmptyTableBlockWithCustomizeActions: PageConfig = { _isJSONSchemaObject: true, version: '2.0', type: 'array', - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component': 'TableV2', 'x-component-props': { rowKey: 'id', diff --git a/packages/plugins/@nocobase/plugin-action-bulk-update/src/client/__e2e__/utils.ts b/packages/plugins/@nocobase/plugin-action-bulk-update/src/client/__e2e__/utils.ts index 68511ba67a..d0ea513d43 100644 --- a/packages/plugins/@nocobase/plugin-action-bulk-update/src/client/__e2e__/utils.ts +++ b/packages/plugins/@nocobase/plugin-action-bulk-update/src/client/__e2e__/utils.ts @@ -213,7 +213,7 @@ export const oneEmptyGantt: PageConfig = { maxWidth: '35%', }, }, - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component': 'TableV2', 'x-component-props': { rowKey: 'id', @@ -457,7 +457,7 @@ export const oneEmptyTableBlockWithCustomizeUpdate: PageConfig = { type: 'array', version: '2.0', 'x-component': 'TableV2', - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component-props': { rowKey: 'id', useProps: '{{ useTableBlockProps }}', diff --git a/packages/plugins/@nocobase/plugin-action-duplicate/src/client/__e2e__/utils.ts b/packages/plugins/@nocobase/plugin-action-duplicate/src/client/__e2e__/utils.ts index b9bb9573cc..164e21a112 100644 --- a/packages/plugins/@nocobase/plugin-action-duplicate/src/client/__e2e__/utils.ts +++ b/packages/plugins/@nocobase/plugin-action-duplicate/src/client/__e2e__/utils.ts @@ -170,7 +170,7 @@ export const oneEmptyGantt: PageConfig = { maxWidth: '35%', }, }, - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component': 'TableV2', 'x-component-props': { rowKey: 'id', @@ -384,7 +384,7 @@ export const oneEmptyTableBlockWithDuplicateActions: PageConfig = { _isJSONSchemaObject: true, version: '2.0', type: 'array', - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component': 'TableV2', 'x-component-props': { rowKey: 'id', diff --git a/packages/plugins/@nocobase/plugin-action-print/src/client/__e2e__/utils.ts b/packages/plugins/@nocobase/plugin-action-print/src/client/__e2e__/utils.ts index 27dbca3cf5..05fac8deca 100644 --- a/packages/plugins/@nocobase/plugin-action-print/src/client/__e2e__/utils.ts +++ b/packages/plugins/@nocobase/plugin-action-print/src/client/__e2e__/utils.ts @@ -152,7 +152,7 @@ export const oneTableWithViewAction: PageConfig = { type: 'array', version: '2.0', 'x-component': 'TableV2', - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component-props': { rowKey: 'id', useProps: '{{ useTableBlockProps }}', diff --git a/packages/plugins/@nocobase/plugin-collection-manager/src/client/__e2e__/fields/manyToMany/schemaSettings.test.ts b/packages/plugins/@nocobase/plugin-collection-manager/src/client/__e2e__/fields/manyToMany/schemaSettings.test.ts index 4a5c7da051..87b53d701c 100644 --- a/packages/plugins/@nocobase/plugin-collection-manager/src/client/__e2e__/fields/manyToMany/schemaSettings.test.ts +++ b/packages/plugins/@nocobase/plugin-collection-manager/src/client/__e2e__/fields/manyToMany/schemaSettings.test.ts @@ -260,7 +260,7 @@ test.describe('form item & create form', () => { await expect( page .getByLabel('block-item-CollectionField-general-form-general.manyToMany-manyToMany') - .getByLabel('schema-initializer-AssociationField.SubTable-fieldInitializers:tableColumn-users'), + .getByLabel('schema-initializer-AssociationField.SubTable-table:configureColumns-users'), ).toBeVisible(); // 选择 Sub-form diff --git a/packages/plugins/@nocobase/plugin-collection-manager/src/client/__e2e__/utils.ts b/packages/plugins/@nocobase/plugin-collection-manager/src/client/__e2e__/utils.ts index a9ce63895d..97b646c26d 100644 --- a/packages/plugins/@nocobase/plugin-collection-manager/src/client/__e2e__/utils.ts +++ b/packages/plugins/@nocobase/plugin-collection-manager/src/client/__e2e__/utils.ts @@ -6,7 +6,7 @@ export async function showSettingsMenu(page: Page, fieldName: string) { } export async function createColumnItem(page: Page, fieldName: string) { - await page.getByLabel('schema-initializer-TableV2-fieldInitializers:tableColumn-general').hover(); + await page.getByLabel('schema-initializer-TableV2-table:configureColumns-general').hover(); await page.getByRole('menuitem', { name: fieldName, exact: true }).click(); await page.mouse.move(300, 0); } diff --git a/packages/plugins/@nocobase/plugin-gantt/src/client/__e2e__/schemaInitailizer.test.ts b/packages/plugins/@nocobase/plugin-gantt/src/client/__e2e__/schemaInitailizer.test.ts index 3e6e309f2e..733aa22ee8 100644 --- a/packages/plugins/@nocobase/plugin-gantt/src/client/__e2e__/schemaInitailizer.test.ts +++ b/packages/plugins/@nocobase/plugin-gantt/src/client/__e2e__/schemaInitailizer.test.ts @@ -25,7 +25,7 @@ test('BlockInitializers should add gantt block', async ({ page, mockPage, mockCo test.describe('configure fields', () => { test('add field,then remove field in gantt block', async ({ page, mockPage, mockRecord }) => { await mockPage(oneEmptyGantt).goto(); - await page.getByLabel('schema-initializer-TableV2-fieldInitializers:tableColumn-general').hover(); + await page.getByLabel('schema-initializer-TableV2-table:configureColumns-general').hover(); await page.getByRole('menuitem', { name: 'ID' }).click(); await page.getByRole('menuitem', { name: 'Single line text2' }).click(); //添加字段 @@ -43,7 +43,7 @@ test.describe('configure fields', () => { test('add assciation field should appends association', async ({ page, mockPage, mockRecord }) => { await mockPage(oneEmptyGantt).goto(); await mockRecord('general', { singleLineText: 'singleLineText', manyToOne: { id: 1 } }); - await page.getByLabel('schema-initializer-TableV2-fieldInitializers:tableColumn-general').hover(); + await page.getByLabel('schema-initializer-TableV2-table:configureColumns-general').hover(); //关系字段,断言请求的appends是否符合预期 const [request] = await Promise.all([ diff --git a/packages/plugins/@nocobase/plugin-gantt/src/client/__e2e__/utils.ts b/packages/plugins/@nocobase/plugin-gantt/src/client/__e2e__/utils.ts index 45d1067a85..2223daa375 100644 --- a/packages/plugins/@nocobase/plugin-gantt/src/client/__e2e__/utils.ts +++ b/packages/plugins/@nocobase/plugin-gantt/src/client/__e2e__/utils.ts @@ -213,7 +213,7 @@ export const oneEmptyGantt: PageConfig = { maxWidth: '35%', }, }, - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component': 'TableV2', 'x-component-props': { rowKey: 'id', diff --git a/packages/plugins/@nocobase/plugin-gantt/src/client/utils.tsx b/packages/plugins/@nocobase/plugin-gantt/src/client/utils.tsx index 510611fc6f..61d2adf8e0 100644 --- a/packages/plugins/@nocobase/plugin-gantt/src/client/utils.tsx +++ b/packages/plugins/@nocobase/plugin-gantt/src/client/utils.tsx @@ -68,7 +68,7 @@ export const createGanttBlockSchema = (options) => { }, }, - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component': 'TableV2', 'x-component-props': { rowKey: 'id', diff --git a/packages/plugins/@nocobase/plugin-ui-schema-storage/src/server/__tests__/fixtures/data.ts b/packages/plugins/@nocobase/plugin-ui-schema-storage/src/server/__tests__/fixtures/data.ts index 8ed177f6a6..99df558025 100644 --- a/packages/plugins/@nocobase/plugin-ui-schema-storage/src/server/__tests__/fixtures/data.ts +++ b/packages/plugins/@nocobase/plugin-ui-schema-storage/src/server/__tests__/fixtures/data.ts @@ -284,7 +284,7 @@ export default { rowSelection: { type: 'checkbox' }, useDataSource: '{{ cm.useDataSourceFromRAC }}', }, - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-uid': 'nd7c9jym6f9', 'x-async': false, 'x-index': 1, @@ -488,7 +488,7 @@ export default { rowSelection: { type: 'checkbox' }, useDataSource: '{{ cm.useDataSourceFromRAC }}', }, - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', properties: { gpysrsz6uw3: { _isJSONSchemaObject: true, @@ -673,7 +673,7 @@ export default { rowSelection: { type: 'checkbox' }, useDataSource: '{{ cm.useDataSourceFromRAC }}', }, - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', properties: { ppttymwsr3d: { _isJSONSchemaObject: true, @@ -901,7 +901,7 @@ export default { rowSelection: { type: 'checkbox' }, useDataSource: '{{ cm.useDataSourceFromRAC }}', }, - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', properties: { xfyrokl5xzu: { _isJSONSchemaObject: true, @@ -1199,8 +1199,7 @@ export default { useDataSource: '{{ cm.useDataSourceFromRAC }}', }, - 'x-initializer': - 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-uid': 'n1svf2lkvqd', 'x-async': false, 'x-index': 1, @@ -1391,8 +1390,7 @@ export default { useDataSource: '{{ cm.useDataSourceFromRAC }}', }, - 'x-initializer': - 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-uid': 'ymddh2e0ufc', 'x-async': false, 'x-index': 1, @@ -1563,7 +1561,7 @@ export default { type: 'array', title: '{{t("Fields")}}', 'x-component': 'Table.Array', - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component-props': { pagination: false, expandable: { childrenColumnName: '__nochildren__' }, @@ -1833,7 +1831,7 @@ export default { rowSelection: { type: 'checkbox' }, useDataSource: '{{ cm.useDataSourceFromRAC }}', }, - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-uid': '0d2h3ova480', 'x-async': false, 'x-index': 1, @@ -1997,7 +1995,7 @@ export default { rowSelection: { type: 'checkbox' }, useDataSource: '{{ cm.useDataSourceFromRAC }}', }, - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-uid': 'z4rlx8hfjtq', 'x-async': false, 'x-index': 1, @@ -2224,7 +2222,7 @@ export default { useAction: '{{cm.useMoveAction}}', useDataSource: '{{cm.useDataSourceFromRAC}}', }, - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', properties: { actions: { _isJSONSchemaObject: true, @@ -2456,8 +2454,7 @@ export default { useDataSource: '{{ cm.useDataSourceFromRAC }}', }, - 'x-initializer': - 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-uid': '4ytlnx3h4r8', 'x-async': false, 'x-index': 1, @@ -2677,8 +2674,7 @@ export default { useDataSource: '{{ cm.useDataSourceFromRAC }}', }, - 'x-initializer': - 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-uid': 'v25lnvhyzzf', 'x-async': false, 'x-index': 1, @@ -2827,8 +2823,7 @@ export default { useDataSource: '{{ cm.useDataSourceFromRAC }}', }, - 'x-initializer': - 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-uid': 'zpvg0dqa6ah', 'x-async': false, 'x-index': 1, @@ -3153,8 +3148,7 @@ export default { type: 'array', title: '{{t("Fields")}}', 'x-component': 'Table.Array', - 'x-initializer': - 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component-props': { pagination: false, expandable: { @@ -3287,7 +3281,7 @@ export default { '{{ cm.useDataSourceFromRAC }}', }, 'x-initializer': - 'fieldInitializers:tableColumn', + 'table:configureColumns', 'x-uid': 'cobw3nz2wb7', 'x-async': false, 'x-index': 1, @@ -3691,7 +3685,7 @@ export default { rowSelection: { type: 'checkbox' }, useDataSource: '{{ cm.useDataSourceFromRAC }}', }, - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-uid': 'je1aq3fa393', 'x-async': false, 'x-index': 1, @@ -3895,7 +3889,7 @@ export default { rowSelection: { type: 'checkbox' }, useDataSource: '{{ cm.useDataSourceFromRAC }}', }, - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', properties: { cj30vjztnkq: { _isJSONSchemaObject: true, @@ -4081,7 +4075,7 @@ export default { rowSelection: { type: 'checkbox' }, useDataSource: '{{ cm.useDataSourceFromRAC }}', }, - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', properties: { dvv0tf3p4o9: { _isJSONSchemaObject: true, @@ -4309,7 +4303,7 @@ export default { rowSelection: { type: 'checkbox' }, useDataSource: '{{ cm.useDataSourceFromRAC }}', }, - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', properties: { dncah8wtscx: { _isJSONSchemaObject: true, @@ -4613,7 +4607,7 @@ export default { '{{ cm.useDataSourceFromRAC }}', }, 'x-initializer': - 'fieldInitializers:tableColumn', + 'table:configureColumns', 'x-uid': 's8hao0uqg8g', 'x-async': false, 'x-index': 1, @@ -4811,7 +4805,7 @@ export default { '{{ cm.useDataSourceFromRAC }}', }, 'x-initializer': - 'fieldInitializers:tableColumn', + 'table:configureColumns', 'x-uid': '0v1u8mu6z1p', 'x-async': false, 'x-index': 1, @@ -4986,7 +4980,7 @@ export default { type: 'array', title: '{{t("Fields")}}', 'x-component': 'Table.Array', - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-component-props': { pagination: false, expandable: { childrenColumnName: '__nochildren__' }, @@ -5148,7 +5142,7 @@ export default { '{{ cm.useDataSourceFromRAC }}', }, 'x-initializer': - 'fieldInitializers:tableColumn', + 'table:configureColumns', 'x-uid': '369iecwk6gw', 'x-async': false, 'x-index': 1, @@ -5359,7 +5353,7 @@ export default { '{{ cm.useDataSourceFromRAC }}', }, 'x-initializer': - 'fieldInitializers:tableColumn', + 'table:configureColumns', 'x-uid': 'jffadc6g4j0', 'x-async': false, 'x-index': 1, @@ -5616,7 +5610,7 @@ export default { rowSelection: { type: 'checkbox' }, useDataSource: '{{ cm.useDataSourceFromRAC }}', }, - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-uid': 'i9y89citemg', 'x-async': false, 'x-index': 1, @@ -6002,7 +5996,7 @@ export default { rowSelection: { type: 'checkbox' }, useDataSource: '{{ cm.useDataSourceFromRAC }}', }, - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-uid': 'v3abytn9e51', 'x-async': false, 'x-index': 1, @@ -6187,7 +6181,7 @@ export default { rowSelection: { type: 'checkbox' }, useDataSource: '{{ cm.useDataSourceFromRAC }}', }, - 'x-initializer': 'fieldInitializers:tableColumn', + 'x-initializer': 'table:configureColumns', 'x-uid': 'p1tbjz52j84', 'x-async': false, 'x-index': 1,