mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 05:18:03 +00:00
fix: missing toolbar props (#4291)
This commit is contained in:
parent
8de00afd12
commit
1604a4fdb6
@ -7,19 +7,9 @@
|
||||
* For more information, please refer to: https://www.nocobase.com/agreement.
|
||||
*/
|
||||
|
||||
import { useFieldSchema } from '@formily/react';
|
||||
import React from 'react';
|
||||
import { SchemaToolbar } from '../../schema-settings/GeneralSchemaDesigner';
|
||||
|
||||
export const ActionSchemaToolbar = (props) => {
|
||||
const fieldSchema = useFieldSchema();
|
||||
return (
|
||||
<SchemaToolbar
|
||||
initializer={false}
|
||||
showBorder={false}
|
||||
showBackground
|
||||
{...props}
|
||||
{...fieldSchema['x-toolbar-props']}
|
||||
/>
|
||||
);
|
||||
return <SchemaToolbar initializer={false} showBorder={false} showBackground {...props} />;
|
||||
};
|
||||
|
@ -82,7 +82,7 @@ export const Action: ComposedAction = withDynamicSchemaProps(
|
||||
const recordData = useCollectionRecordData();
|
||||
const parentRecordData = useCollectionParentRecordData();
|
||||
const collection = useCollection();
|
||||
const designerProps = fieldSchema['x-designer-props'];
|
||||
const designerProps = fieldSchema['x-toolbar-props'] || fieldSchema['x-designer-props'];
|
||||
const openMode = fieldSchema?.['x-component-props']?.['openMode'];
|
||||
const openSize = fieldSchema?.['x-component-props']?.['openSize'];
|
||||
const refreshDataBlockRequest = fieldSchema?.['x-component-props']?.['refreshDataBlockRequest'];
|
||||
|
@ -7,7 +7,7 @@
|
||||
* For more information, please refer to: https://www.nocobase.com/agreement.
|
||||
*/
|
||||
|
||||
import { screen, checkSettings, renderSingleSettings, checkModalSetting } from '@nocobase/test/client';
|
||||
import { checkModalSetting, renderSingleSettings } from '@nocobase/test/client';
|
||||
import { ButtonEditor } from '../Action.Designer';
|
||||
|
||||
describe('Action.Designer', () => {
|
||||
|
@ -9,6 +9,7 @@
|
||||
|
||||
import { SchemaSettings } from '@nocobase/client';
|
||||
import { getAppComponent } from '@nocobase/test/web';
|
||||
import React from 'react';
|
||||
|
||||
const myActionSettings = new SchemaSettings({
|
||||
name: 'myActionSettings',
|
||||
@ -20,6 +21,8 @@ const myActionSettings = new SchemaSettings({
|
||||
],
|
||||
});
|
||||
|
||||
const MyToolbar = (props) => <span>{props.title}</span>;
|
||||
|
||||
const App = getAppComponent({
|
||||
schema: {
|
||||
type: 'void',
|
||||
@ -60,12 +63,23 @@ const App = getAppComponent({
|
||||
'x-align': 'left',
|
||||
'x-settings': 'myActionSettings',
|
||||
},
|
||||
a5: {
|
||||
title: '',
|
||||
'x-component': 'Action',
|
||||
'x-action': 'a5',
|
||||
'x-align': 'left',
|
||||
'x-toolbar': 'MyToolbar',
|
||||
'x-toolbar-props': {
|
||||
title: 'MyTitle',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
appOptions: {
|
||||
schemaSettings: [myActionSettings],
|
||||
components: { MyToolbar },
|
||||
},
|
||||
designable: true,
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user