fix: graph collection current appInfo error (#2364)

This commit is contained in:
katherinehhh 2023-07-31 17:47:10 +08:00 committed by GitHub
parent 18bf6e507e
commit 07f1f16ea0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -375,9 +375,10 @@ export const GraphDrawPage = React.memo(() => {
const [collectionData, setCollectionData] = useState<any>([]);
const [collectionList, setCollectionList] = useState<any>([]);
const { refreshCM } = useCollectionManager();
const currentAppInfo = useCurrentAppInfo();
const {
data: { database },
} = useCurrentAppInfo();
} = currentAppInfo;
const categoryCtx = useContext(CollectionCategroriesContext);
const scope = { ...options?.scope };
const components = { ...options?.components };
@ -506,7 +507,7 @@ export const GraphDrawPage = React.memo(() => {
{
inherit: 'react-shape',
component: (node) => (
<CurrentAppInfoContext.Provider value={database}>
<CurrentAppInfoContext.Provider value={currentAppInfo}>
<APIClientProvider apiClient={api}>
<SchemaComponentOptions inherit scope={scope} components={components}>
<CollectionCategroriesProvider {...categoryCtx}>

View File

@ -186,6 +186,7 @@ const PortsCom = React.memo<any>(({ targetGraph, collectionData, setTargetNode,
const [collapse, setCollapse] = useState(false);
const { t } = useGCMTranslation();
const compile = useCompile();
const { styles } = useStyles();
const {
data: { database },
} = useCurrentAppInfo();
@ -204,9 +205,7 @@ const PortsCom = React.memo<any>(({ targetGraph, collectionData, setTargetNode,
return `${prefix || ''}${uid()}`;
};
const CollectionConten = (data) => {
const { styles } = useStyles();
const { type, name, primaryKey, allowNull, autoIncrement } = data;
return (
<div className={styles.collectionPopoverClass}>
<div className="field-content">