fix: issue with displaying unsupported Sync from database in external data source view collection (#5696)

This commit is contained in:
Katherine 2024-11-21 17:12:34 +08:00 committed by GitHub
parent f351f78936
commit 9e1b0e8d04
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 4 deletions

View File

@ -2,9 +2,7 @@
"version": "1.4.0-beta.2", "version": "1.4.0-beta.2",
"npmClient": "yarn", "npmClient": "yarn",
"useWorkspaces": true, "useWorkspaces": true,
"npmClientArgs": [ "npmClientArgs": ["--ignore-engines"],
"--ignore-engines"
],
"command": { "command": {
"version": { "version": {
"forcePublish": true, "forcePublish": true,

View File

@ -15,6 +15,7 @@ import { Button } from 'antd';
import { cloneDeep, omit } from 'lodash'; import { cloneDeep, omit } from 'lodash';
import React, { useState } from 'react'; import React, { useState } from 'react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { useParams } from 'react-router-dom';
import { useAPIClient, useRequest } from '../../api-client'; import { useAPIClient, useRequest } from '../../api-client';
import { RecordProvider, useRecord } from '../../record-provider'; import { RecordProvider, useRecord } from '../../record-provider';
import { ActionContextProvider, SchemaComponent, useActionContext, useCompile } from '../../schema-component'; import { ActionContextProvider, SchemaComponent, useActionContext, useCompile } from '../../schema-component';
@ -172,8 +173,11 @@ export const SyncFieldsActionCom = (props) => {
const [schema, setSchema] = useState({}); const [schema, setSchema] = useState({});
const compile = useCompile(); const compile = useCompile();
const { t } = useTranslation(); const { t } = useTranslation();
const { name = 'main' } = useParams();
return ( return (
record.template === 'view' && ( record.template === 'view' &&
name === 'main' && (
<RecordProvider record={record}> <RecordProvider record={record}>
<ActionContextProvider value={{ visible, setVisible, drawerProps: { width: 900 } }}> <ActionContextProvider value={{ visible, setVisible, drawerProps: { width: 900 } }}>
{children || ( {children || (