From f1923d25cd5870f36aa4b35aa66c9a21bfe3d60d Mon Sep 17 00:00:00 2001 From: katherinehhh Date: Wed, 8 May 2024 14:47:37 +0800 Subject: [PATCH] refactor: external data source view collection createMainOnly (#4287) --- packages/core/client/src/collection-manager/templates/view.tsx | 3 +++ .../component/CollectionsManager/EditCollectionAction.tsx | 1 + 2 files changed, 4 insertions(+) diff --git a/packages/core/client/src/collection-manager/templates/view.tsx b/packages/core/client/src/collection-manager/templates/view.tsx index f3a4338ed6..a5034edd4a 100644 --- a/packages/core/client/src/collection-manager/templates/view.tsx +++ b/packages/core/client/src/collection-manager/templates/view.tsx @@ -38,6 +38,7 @@ export class ViewCollectionTemplate extends CollectionTemplate { 'x-component': 'Select', 'x-reactions': ['{{useAsyncDataSource(loadDBViews)}}'], 'x-disabled': '{{ !createOnly }}', + 'x-visible': '{{!createMainOnly}}', }, name: { type: 'string', @@ -106,6 +107,7 @@ export class ViewCollectionTemplate extends CollectionTemplate { 'x-decorator': 'FormItem', 'x-component': 'Checkbox', default: false, + 'x-visible': '{{!createMainOnly}}', }, sources: { type: 'array', @@ -117,6 +119,7 @@ export class ViewCollectionTemplate extends CollectionTemplate { }, 'x-reactions': ['{{useAsyncDataSource(loadCollections)}}'], 'x-disabled': true, + 'x-visible': '{{!createMainOnly}}', }, fields: { type: 'array', diff --git a/packages/plugins/@nocobase/plugin-data-source-manager/src/client/component/CollectionsManager/EditCollectionAction.tsx b/packages/plugins/@nocobase/plugin-data-source-manager/src/client/component/CollectionsManager/EditCollectionAction.tsx index f6bf0173f2..09d37d4a1e 100644 --- a/packages/plugins/@nocobase/plugin-data-source-manager/src/client/component/CollectionsManager/EditCollectionAction.tsx +++ b/packages/plugins/@nocobase/plugin-data-source-manager/src/client/component/CollectionsManager/EditCollectionAction.tsx @@ -211,6 +211,7 @@ const EditCollectionAction = (props) => { createOnly: false, filterTargetKeyOptions, isView: record.view, + createMainOnly: true, ...scope, }} />