mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-07-01 18:52: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);
|
||||
};
|
||||
|
||||
// 列宽度默认为 200
|
||||
await expectActionsColumnWidth(200);
|
||||
// 列宽度默认为 100
|
||||
await expectActionsColumnWidth(100);
|
||||
|
||||
await page.getByText('Actions', { exact: true }).hover();
|
||||
await page.getByLabel('designer-schema-settings-TableV2.Column-fieldSettings:TableColumn-users').hover();
|
||||
|
@ -51,7 +51,7 @@ export const Resizable = () => {
|
||||
'x-decorator': 'FormItem',
|
||||
'x-component': 'InputNumber',
|
||||
'x-component-props': {},
|
||||
default: fieldSchema?.['x-component-props']?.width || 200,
|
||||
default: fieldSchema?.['x-component-props']?.width || 100,
|
||||
},
|
||||
},
|
||||
} as ISchema
|
||||
|
@ -321,8 +321,8 @@ test.describe('configure actions column', () => {
|
||||
test('column width', async ({ page, mockPage }) => {
|
||||
await mockPage(oneEmptyTable).goto();
|
||||
|
||||
// 列宽度默认为 200
|
||||
await expect(page.getByRole('columnheader', { name: 'Actions', exact: true })).toHaveJSProperty('offsetWidth', 200);
|
||||
// 列宽度默认为 100
|
||||
await expect(page.getByRole('columnheader', { name: 'Actions', exact: true })).toHaveJSProperty('offsetWidth', 100);
|
||||
|
||||
await page.getByText('Actions', { exact: true }).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'),
|
||||
properties: {
|
||||
width: {
|
||||
default: columnSchema?.['x-component-props']?.['width'] || 200,
|
||||
default: columnSchema?.['x-component-props']?.['width'] || 100,
|
||||
'x-decorator': 'FormItem',
|
||||
'x-component': 'InputNumber',
|
||||
'x-component-props': {},
|
||||
|
@ -172,7 +172,7 @@ export const TableColumnDesigner = (props) => {
|
||||
title: t('Column width'),
|
||||
properties: {
|
||||
width: {
|
||||
default: columnSchema?.['x-component-props']?.['width'] || 200,
|
||||
default: columnSchema?.['x-component-props']?.['width'] || 100,
|
||||
'x-decorator': 'FormItem',
|
||||
'x-component': 'InputNumber',
|
||||
'x-component-props': {},
|
||||
|
@ -129,7 +129,7 @@ const useTableColumns = (props: { showDel?: any; isSubTable?: boolean }, paginat
|
||||
sorter: s['x-component-props']?.['sorter'],
|
||||
columnHidden,
|
||||
...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) => {
|
||||
// 这行代码会导致这里的测试不通过: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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user