From a1909d9ce4ce3827bd6a8f9984347e8e9faa2887 Mon Sep 17 00:00:00 2001 From: Zeke Zhang <958414905@qq.com> Date: Mon, 27 May 2024 18:24:54 +0800 Subject: [PATCH] fix: fix loss of data scope field in permission configuration --- .../PermissionManager/schemas/scopes.tsx | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/packages/plugins/@nocobase/plugin-data-source-manager/src/client/component/PermissionManager/schemas/scopes.tsx b/packages/plugins/@nocobase/plugin-data-source-manager/src/client/component/PermissionManager/schemas/scopes.tsx index 0728dc8e85..06d353c67d 100644 --- a/packages/plugins/@nocobase/plugin-data-source-manager/src/client/component/PermissionManager/schemas/scopes.tsx +++ b/packages/plugins/@nocobase/plugin-data-source-manager/src/client/component/PermissionManager/schemas/scopes.tsx @@ -8,7 +8,14 @@ */ 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 { RoleResourceCollectionContext } from '../RolesResourcesActions'; @@ -146,13 +153,13 @@ export const getScopesSchema = (dataSourceKey) => { title: '{{t("Data scope")}}', name: 'filter', 'x-decorator': 'FormItem', - 'x-component': (props) => { + 'x-component': withDynamicSchemaProps((props) => { return ( ); - }, + }), 'x-use-component-props': () => { // eslint-disable-next-line react-hooks/rules-of-hooks const ctx = useContext(RoleResourceCollectionContext); @@ -280,13 +287,13 @@ export const getScopesSchema = (dataSourceKey) => { title: '{{t("Data scope")}}', name: 'filter', 'x-decorator': 'FormItem', - 'x-component': (props) => { + 'x-component': withDynamicSchemaProps((props) => { return ( ); - }, + }), 'x-use-component-props': () => { // eslint-disable-next-line react-hooks/rules-of-hooks const ctx = useContext(RoleResourceCollectionContext);