From c5dd0344524ed2ab7181013b4d062f2cde463809 Mon Sep 17 00:00:00 2001 From: katherinehhh Date: Tue, 5 Mar 2024 18:19:53 +0800 Subject: [PATCH] fix: role name is error in role configure (#3618) --- .../client/component/PermissionManager/DataSourceTable.tsx | 1 - .../client/component/PermissionManager/RoleConfigure.tsx | 7 ++++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/plugins/@nocobase/plugin-data-source-manager/src/client/component/PermissionManager/DataSourceTable.tsx b/packages/plugins/@nocobase/plugin-data-source-manager/src/client/component/PermissionManager/DataSourceTable.tsx index 0e75b03a2..714e25b7a 100644 --- a/packages/plugins/@nocobase/plugin-data-source-manager/src/client/component/PermissionManager/DataSourceTable.tsx +++ b/packages/plugins/@nocobase/plugin-data-source-manager/src/client/component/PermissionManager/DataSourceTable.tsx @@ -31,7 +31,6 @@ export const useAvailableActions = () => { export const DataSourceTable = () => { const record = useRecord(); - console.log(record.key); return (
diff --git a/packages/plugins/@nocobase/plugin-data-source-manager/src/client/component/PermissionManager/RoleConfigure.tsx b/packages/plugins/@nocobase/plugin-data-source-manager/src/client/component/PermissionManager/RoleConfigure.tsx index d1fcc5d48..e25b4d3a0 100644 --- a/packages/plugins/@nocobase/plugin-data-source-manager/src/client/component/PermissionManager/RoleConfigure.tsx +++ b/packages/plugins/@nocobase/plugin-data-source-manager/src/client/component/PermissionManager/RoleConfigure.tsx @@ -3,12 +3,12 @@ import React, { useContext } from 'react'; import { useTranslation } from 'react-i18next'; import { useAPIClient, useRequest, SchemaComponent, useRecord } from '@nocobase/client'; import { PermissionContext } from './PermisionProvider'; +import { CurrentRolesContext } from './'; export const RoleConfigure = () => { - const { update, currentRecord } = useContext(PermissionContext); + const { update } = useContext(PermissionContext); const { t } = useTranslation(); const { key } = useRecord(); - return ( { 'x-component-props': { useValues: (options) => { const api = useAPIClient(); + const role = useContext(CurrentRolesContext); return useRequest( () => api .resource(`dataSources/${key}/roles`) .get({ - filterByTk: currentRecord.name, + filterByTk: role.name, }) .then((res) => { const record = res?.data?.data;