fix(collection-manager): missing collection manager context
This commit is contained in:
parent
e3b6c0513a
commit
075426471e
@ -177,6 +177,7 @@ export default {
|
||||
"Add filter group": "Add filter group",
|
||||
"is": "is",
|
||||
"is not": "is not",
|
||||
"is variable": "is variable",
|
||||
"contains": "contains",
|
||||
"does not contain": "does not contain",
|
||||
"starts with": "starts with",
|
||||
|
@ -197,6 +197,7 @@ export default {
|
||||
"Add filter group": "添加筛选分组",
|
||||
"is": "等于",
|
||||
"is not": "不等于",
|
||||
"is variable": "为动态变量",
|
||||
"contains": "包含",
|
||||
"does not contain": "不包含",
|
||||
"starts with": "开头是",
|
||||
|
@ -11,6 +11,7 @@ import { createPortal } from 'react-dom';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import {
|
||||
ActionContext,
|
||||
CollectionManagerContext,
|
||||
createDesignable,
|
||||
Designable,
|
||||
FormProvider,
|
||||
@ -21,7 +22,7 @@ import {
|
||||
useAPIClient,
|
||||
useCollection,
|
||||
useCompile,
|
||||
useDesignable,
|
||||
useDesignable
|
||||
} from '..';
|
||||
import { useSchemaTemplateManager } from '../schema-templates';
|
||||
import { useBlockTemplateContext } from '../schema-templates/BlockTemplate';
|
||||
@ -559,6 +560,7 @@ SchemaSettings.ActionModalItem = React.memo((props: any) => {
|
||||
SchemaSettings.ModalItem = (props) => {
|
||||
const { hidden, title, components, scope, effects, schema, onSubmit, initialValues, ...others } = props;
|
||||
const options = useContext(SchemaOptionsContext);
|
||||
const cm = useContext(CollectionManagerContext);
|
||||
if (hidden) {
|
||||
return null;
|
||||
}
|
||||
@ -568,11 +570,13 @@ SchemaSettings.ModalItem = (props) => {
|
||||
onClick={() => {
|
||||
FormDialog(schema.title || title, () => {
|
||||
return (
|
||||
<CollectionManagerContext.Provider value={cm}>
|
||||
<SchemaComponentOptions scope={options.scope} components={options.components}>
|
||||
<FormLayout layout={'vertical'}>
|
||||
<SchemaComponent components={components} scope={scope} schema={schema} />
|
||||
</FormLayout>
|
||||
</SchemaComponentOptions>
|
||||
</CollectionManagerContext.Provider>
|
||||
);
|
||||
})
|
||||
.open({
|
||||
@ -627,6 +631,5 @@ SchemaSettings.BlockTitleItem = () => {
|
||||
dn.refresh();
|
||||
}}
|
||||
/>
|
||||
)
|
||||
|
||||
}
|
||||
);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user