mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 21:49:25 +08:00
fix: fix loss of data scope field in permission configuration
This commit is contained in:
parent
0adf5fb6b7
commit
a1909d9ce4
@ -8,7 +8,14 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { ISchema } from '@formily/react';
|
import { ISchema } from '@formily/react';
|
||||||
import { Filter, FlagProvider, VariableInput, useFilterFieldOptions, useFormBlockContext } from '@nocobase/client';
|
import {
|
||||||
|
Filter,
|
||||||
|
FlagProvider,
|
||||||
|
VariableInput,
|
||||||
|
useFilterFieldOptions,
|
||||||
|
useFormBlockContext,
|
||||||
|
withDynamicSchemaProps,
|
||||||
|
} from '@nocobase/client';
|
||||||
import React, { useContext, useEffect } from 'react';
|
import React, { useContext, useEffect } from 'react';
|
||||||
import { RoleResourceCollectionContext } from '../RolesResourcesActions';
|
import { RoleResourceCollectionContext } from '../RolesResourcesActions';
|
||||||
|
|
||||||
@ -146,13 +153,13 @@ export const getScopesSchema = (dataSourceKey) => {
|
|||||||
title: '{{t("Data scope")}}',
|
title: '{{t("Data scope")}}',
|
||||||
name: 'filter',
|
name: 'filter',
|
||||||
'x-decorator': 'FormItem',
|
'x-decorator': 'FormItem',
|
||||||
'x-component': (props) => {
|
'x-component': withDynamicSchemaProps((props) => {
|
||||||
return (
|
return (
|
||||||
<FlagProvider isVariableParsedInOtherContext={true}>
|
<FlagProvider isVariableParsedInOtherContext={true}>
|
||||||
<Filter {...props} />
|
<Filter {...props} />
|
||||||
</FlagProvider>
|
</FlagProvider>
|
||||||
);
|
);
|
||||||
},
|
}),
|
||||||
'x-use-component-props': () => {
|
'x-use-component-props': () => {
|
||||||
// eslint-disable-next-line react-hooks/rules-of-hooks
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
||||||
const ctx = useContext(RoleResourceCollectionContext);
|
const ctx = useContext(RoleResourceCollectionContext);
|
||||||
@ -280,13 +287,13 @@ export const getScopesSchema = (dataSourceKey) => {
|
|||||||
title: '{{t("Data scope")}}',
|
title: '{{t("Data scope")}}',
|
||||||
name: 'filter',
|
name: 'filter',
|
||||||
'x-decorator': 'FormItem',
|
'x-decorator': 'FormItem',
|
||||||
'x-component': (props) => {
|
'x-component': withDynamicSchemaProps((props) => {
|
||||||
return (
|
return (
|
||||||
<FlagProvider isVariableParsedInOtherContext={true}>
|
<FlagProvider isVariableParsedInOtherContext={true}>
|
||||||
<Filter {...props} />
|
<Filter {...props} />
|
||||||
</FlagProvider>
|
</FlagProvider>
|
||||||
);
|
);
|
||||||
},
|
}),
|
||||||
'x-use-component-props': () => {
|
'x-use-component-props': () => {
|
||||||
// eslint-disable-next-line react-hooks/rules-of-hooks
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
||||||
const ctx = useContext(RoleResourceCollectionContext);
|
const ctx = useContext(RoleResourceCollectionContext);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user