diff --git a/packages/plugins/@nocobase/plugin-custom-request/src/client/__e2e__/schemaSettings.test.ts b/packages/plugins/@nocobase/plugin-custom-request/src/client/__e2e__/schemaSettings.test.ts new file mode 100644 index 000000000..a3bd9265b --- /dev/null +++ b/packages/plugins/@nocobase/plugin-custom-request/src/client/__e2e__/schemaSettings.test.ts @@ -0,0 +1,22 @@ +import { test, expect, oneEmptyTable } from '@nocobase/test/e2e'; + +test('edit button', async ({ page, mockPage, mockRecord }) => { + await mockPage(oneEmptyTable).goto(); + await mockRecord('t_unp4scqamw9'); + + // 新建一个 custom request action + await page.getByRole('button', { name: 'Actions' }).hover(); + await page.getByLabel('designer-schema-settings-TableV2.Column-TableV2.ActionColumnDesigner-').hover(); + await page.getByRole('menuitem', { name: 'Customize right' }).hover(); + await page.getByRole('menuitem', { name: 'Custom request' }).click(); + + // 打开编辑按钮弹窗 + await page.getByLabel('action-CustomRequestAction-').hover(); + await page.getByLabel('designer-schema-settings-CustomRequestAction-actionSettings:customRequest-').hover(); + await page.getByRole('menuitem', { name: 'Edit button' }).click(); + + // 应该只显示标题输入框 + await expect(page.getByText('Button title')).toBeVisible(); + await expect(page.getByText('Button icon')).not.toBeVisible(); + await expect(page.getByText('Button background color')).not.toBeVisible(); +}); diff --git a/packages/plugins/@nocobase/plugin-custom-request/src/client/schemaSettings.ts b/packages/plugins/@nocobase/plugin-custom-request/src/client/schemaSettings.ts index ecf091fa8..6f38bda04 100644 --- a/packages/plugins/@nocobase/plugin-custom-request/src/client/schemaSettings.ts +++ b/packages/plugins/@nocobase/plugin-custom-request/src/client/schemaSettings.ts @@ -18,7 +18,10 @@ export const customizeCustomRequestActionSettings = new SchemaSettings({ Component: ButtonEditor, useComponentProps() { const { buttonEditorProps } = useSchemaToolbar(); - return buttonEditorProps; + return { + isLink: true, + ...buttonEditorProps, + }; }, }, {