mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-07-02 11:12:20 +08:00
refactor: adjust default column width to 100 in table (#5625)
* refactor: adjust default column width to 100 in table * fix: test
This commit is contained in:
parent
6badfd8983
commit
dafc3a16a1
@ -87,8 +87,8 @@ test.describe('configure actions column', () => {
|
|||||||
expect(Math.floor(box.width)).toBe(width);
|
expect(Math.floor(box.width)).toBe(width);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 列宽度默认为 200
|
// 列宽度默认为 100
|
||||||
await expectActionsColumnWidth(200);
|
await expectActionsColumnWidth(100);
|
||||||
|
|
||||||
await page.getByText('Actions', { exact: true }).hover();
|
await page.getByText('Actions', { exact: true }).hover();
|
||||||
await page.getByLabel('designer-schema-settings-TableV2.Column-fieldSettings:TableColumn-users').hover();
|
await page.getByLabel('designer-schema-settings-TableV2.Column-fieldSettings:TableColumn-users').hover();
|
||||||
|
@ -51,7 +51,7 @@ export const Resizable = () => {
|
|||||||
'x-decorator': 'FormItem',
|
'x-decorator': 'FormItem',
|
||||||
'x-component': 'InputNumber',
|
'x-component': 'InputNumber',
|
||||||
'x-component-props': {},
|
'x-component-props': {},
|
||||||
default: fieldSchema?.['x-component-props']?.width || 200,
|
default: fieldSchema?.['x-component-props']?.width || 100,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
} as ISchema
|
} as ISchema
|
||||||
|
@ -321,8 +321,8 @@ test.describe('configure actions column', () => {
|
|||||||
test('column width', async ({ page, mockPage }) => {
|
test('column width', async ({ page, mockPage }) => {
|
||||||
await mockPage(oneEmptyTable).goto();
|
await mockPage(oneEmptyTable).goto();
|
||||||
|
|
||||||
// 列宽度默认为 200
|
// 列宽度默认为 100
|
||||||
await expect(page.getByRole('columnheader', { name: 'Actions', exact: true })).toHaveJSProperty('offsetWidth', 200);
|
await expect(page.getByRole('columnheader', { name: 'Actions', exact: true })).toHaveJSProperty('offsetWidth', 100);
|
||||||
|
|
||||||
await page.getByText('Actions', { exact: true }).hover();
|
await page.getByText('Actions', { exact: true }).hover();
|
||||||
await page.getByLabel('designer-schema-settings-TableV2.Column-TableV2.ActionColumnDesigner-').hover();
|
await page.getByLabel('designer-schema-settings-TableV2.Column-TableV2.ActionColumnDesigner-').hover();
|
||||||
|
@ -122,7 +122,7 @@ export const tableColumnSettings = new SchemaSettings({
|
|||||||
title: t('Column width'),
|
title: t('Column width'),
|
||||||
properties: {
|
properties: {
|
||||||
width: {
|
width: {
|
||||||
default: columnSchema?.['x-component-props']?.['width'] || 200,
|
default: columnSchema?.['x-component-props']?.['width'] || 100,
|
||||||
'x-decorator': 'FormItem',
|
'x-decorator': 'FormItem',
|
||||||
'x-component': 'InputNumber',
|
'x-component': 'InputNumber',
|
||||||
'x-component-props': {},
|
'x-component-props': {},
|
||||||
|
@ -172,7 +172,7 @@ export const TableColumnDesigner = (props) => {
|
|||||||
title: t('Column width'),
|
title: t('Column width'),
|
||||||
properties: {
|
properties: {
|
||||||
width: {
|
width: {
|
||||||
default: columnSchema?.['x-component-props']?.['width'] || 200,
|
default: columnSchema?.['x-component-props']?.['width'] || 100,
|
||||||
'x-decorator': 'FormItem',
|
'x-decorator': 'FormItem',
|
||||||
'x-component': 'InputNumber',
|
'x-component': 'InputNumber',
|
||||||
'x-component-props': {},
|
'x-component-props': {},
|
||||||
|
@ -129,7 +129,7 @@ const useTableColumns = (props: { showDel?: any; isSubTable?: boolean }, paginat
|
|||||||
sorter: s['x-component-props']?.['sorter'],
|
sorter: s['x-component-props']?.['sorter'],
|
||||||
columnHidden,
|
columnHidden,
|
||||||
...s['x-component-props'],
|
...s['x-component-props'],
|
||||||
width: columnHidden && !designable ? 0 : s['x-component-props']?.width || 200,
|
width: columnHidden && !designable ? 0 : s['x-component-props']?.width || 100,
|
||||||
render: (v, record) => {
|
render: (v, record) => {
|
||||||
// 这行代码会导致这里的测试不通过:packages/core/client/src/modules/blocks/data-blocks/table/__e2e__/schemaInitializer.test.ts:189
|
// 这行代码会导致这里的测试不通过:packages/core/client/src/modules/blocks/data-blocks/table/__e2e__/schemaInitializer.test.ts:189
|
||||||
// if (collectionFields?.length === 1 && collectionFields[0]['x-read-pretty'] && v == undefined) return null;
|
// if (collectionFields?.length === 1 && collectionFields[0]['x-read-pretty'] && v == undefined) return null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user