From 3b7dfc4cf7950eacd79614b6d4e0bf55fed13c14 Mon Sep 17 00:00:00 2001 From: Katherine Date: Fri, 10 Jan 2025 11:33:59 +0800 Subject: [PATCH] refactor: remove linkage rules from Associate button (#6016) * refactor: remove linkage rules from Associate button * fix: bug --- lerna.json | 4 +--- .../view-edit-popup/customizePopupActionSettings.tsx | 8 ++++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lerna.json b/lerna.json index 3c926cb960..b6151f6dcd 100644 --- a/lerna.json +++ b/lerna.json @@ -2,9 +2,7 @@ "version": "1.5.0-beta.26", "npmClient": "yarn", "useWorkspaces": true, - "npmClientArgs": [ - "--ignore-engines" - ], + "npmClientArgs": ["--ignore-engines"], "command": { "version": { "forcePublish": true, diff --git a/packages/core/client/src/modules/actions/view-edit-popup/customizePopupActionSettings.tsx b/packages/core/client/src/modules/actions/view-edit-popup/customizePopupActionSettings.tsx index bb8a34a452..fe50338b5f 100644 --- a/packages/core/client/src/modules/actions/view-edit-popup/customizePopupActionSettings.tsx +++ b/packages/core/client/src/modules/actions/view-edit-popup/customizePopupActionSettings.tsx @@ -7,13 +7,16 @@ * For more information, please refer to: https://www.nocobase.com/agreement. */ +import { useFieldSchema } from '@formily/react'; import { useSchemaToolbar } from '../../../application'; import { SchemaSettings } from '../../../application/schema-settings/SchemaSettings'; import { useCollection_deprecated } from '../../../collection-manager'; +import { useCollection } from '../../../data-source'; import { ButtonEditor, RemoveButton } from '../../../schema-component/antd/action/Action.Designer'; import { SchemaSettingOpenModeSchemaItems } from '../../../schema-items'; import { SchemaSettingsLinkageRules } from '../../../schema-settings'; import { useOpenModeContext } from '../../popup/OpenModeProvider'; +import { useCurrentPopupRecord } from '../../variable/variablesProvider/VariablePopupRecordProvider'; export const customizePopupActionSettings = new SchemaSettings({ name: 'actionSettings:popup', @@ -37,6 +40,11 @@ export const customizePopupActionSettings = new SchemaSettings({ collectionName: name, }; }, + useVisible() { + const { collection } = useCurrentPopupRecord() || {}; + const currentCollection = useCollection(); + return !collection || collection?.name === currentCollection?.name; + }, }, { name: 'openMode',