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