From 9e1b0e8d049b232a8777b8edec2cc47a95eca0a3 Mon Sep 17 00:00:00 2001 From: Katherine Date: Thu, 21 Nov 2024 17:12:34 +0800 Subject: [PATCH] fix: issue with displaying unsupported Sync from database in external data source view collection (#5696) --- lerna.json | 4 +--- .../collection-manager/Configuration/SyncFieldsAction.tsx | 6 +++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lerna.json b/lerna.json index 926b39c04..6f457fc23 100644 --- a/lerna.json +++ b/lerna.json @@ -2,9 +2,7 @@ "version": "1.4.0-beta.2", "npmClient": "yarn", "useWorkspaces": true, - "npmClientArgs": [ - "--ignore-engines" - ], + "npmClientArgs": ["--ignore-engines"], "command": { "version": { "forcePublish": true, diff --git a/packages/core/client/src/collection-manager/Configuration/SyncFieldsAction.tsx b/packages/core/client/src/collection-manager/Configuration/SyncFieldsAction.tsx index 9a9e80af9..6bc08d87a 100644 --- a/packages/core/client/src/collection-manager/Configuration/SyncFieldsAction.tsx +++ b/packages/core/client/src/collection-manager/Configuration/SyncFieldsAction.tsx @@ -15,6 +15,7 @@ import { Button } from 'antd'; import { cloneDeep, omit } from 'lodash'; import React, { useState } from 'react'; import { useTranslation } from 'react-i18next'; +import { useParams } from 'react-router-dom'; import { useAPIClient, useRequest } from '../../api-client'; import { RecordProvider, useRecord } from '../../record-provider'; import { ActionContextProvider, SchemaComponent, useActionContext, useCompile } from '../../schema-component'; @@ -172,8 +173,11 @@ export const SyncFieldsActionCom = (props) => { const [schema, setSchema] = useState({}); const compile = useCompile(); const { t } = useTranslation(); + const { name = 'main' } = useParams(); + return ( - record.template === 'view' && ( + record.template === 'view' && + name === 'main' && ( {children || (