mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 03:56:16 +00:00
fix: component CustomRequestAction support x-use-component-props (#5379)
Some checks are pending
Build Docker Image / build-and-push (push) Waiting to run
Build Pro Image / build-and-push (push) Waiting to run
E2E / Build (push) Waiting to run
E2E / Core and plugins (push) Blocked by required conditions
E2E / plugin-workflow (push) Blocked by required conditions
E2E / plugin-workflow-approval (push) Blocked by required conditions
E2E / plugin-data-source-main (push) Blocked by required conditions
E2E / Comment on PR (push) Blocked by required conditions
NocoBase FrontEnd Test / frontend-test (18) (push) Waiting to run
Some checks are pending
Build Docker Image / build-and-push (push) Waiting to run
Build Pro Image / build-and-push (push) Waiting to run
E2E / Build (push) Waiting to run
E2E / Core and plugins (push) Blocked by required conditions
E2E / plugin-workflow (push) Blocked by required conditions
E2E / plugin-workflow-approval (push) Blocked by required conditions
E2E / plugin-data-source-main (push) Blocked by required conditions
E2E / Comment on PR (push) Blocked by required conditions
NocoBase FrontEnd Test / frontend-test (18) (push) Waiting to run
This commit is contained in:
parent
d63d5567e0
commit
61d9bdf0e5
@ -7,7 +7,7 @@
|
||||
* For more information, please refer to: https://www.nocobase.com/agreement.
|
||||
*/
|
||||
|
||||
import { Action, useAPIClient, useRequest } from '@nocobase/client';
|
||||
import { Action, useAPIClient, useRequest, withDynamicSchemaProps } from '@nocobase/client';
|
||||
import React from 'react';
|
||||
import { useFieldSchema } from '@formily/react';
|
||||
import { listByCurrentRoleUrl } from '../constants';
|
||||
@ -39,12 +39,14 @@ const components = {
|
||||
'customize:table:request': Action.Link,
|
||||
};
|
||||
|
||||
export const CustomRequestAction = (props) => {
|
||||
export const CustomRequestAction: React.FC<any> & {
|
||||
[key: string]: any;
|
||||
} = withDynamicSchemaProps((props) => {
|
||||
const fieldSchema = useFieldSchema();
|
||||
const xAction = fieldSchema['x-action'];
|
||||
const Component = components[xAction] || Action;
|
||||
return <Component {...props} useProps={useCustomizeRequestActionProps}></Component>;
|
||||
};
|
||||
});
|
||||
|
||||
CustomRequestAction.Designer = CustomRequestActionDesigner;
|
||||
CustomRequestAction.Decorator = CustomRequestActionACLDecorator;
|
||||
|
Loading…
Reference in New Issue
Block a user