From 5e22103e331909a13221823543a5e4055c6372cd Mon Sep 17 00:00:00 2001 From: katherinehhh Date: Mon, 25 Mar 2024 11:39:52 +0800 Subject: [PATCH] chore: file collection template preset fields should be disabled (#3810) --- .../collection-manager/templates/components/PresetFields.tsx | 4 ++++ .../plugin-file-manager/src/client/templates/file.ts | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/core/client/src/collection-manager/templates/components/PresetFields.tsx b/packages/core/client/src/collection-manager/templates/components/PresetFields.tsx index 81d6180d3..39b682323 100644 --- a/packages/core/client/src/collection-manager/templates/components/PresetFields.tsx +++ b/packages/core/client/src/collection-manager/templates/components/PresetFields.tsx @@ -193,6 +193,10 @@ export const PresetFields = observer( rowSelection={{ type: 'checkbox', selectedRowKeys, + getCheckboxProps: (record) => ({ + disabled: form.values.template === 'file', // Column configuration not to be checked + name: record.name, + }), onChange: (_, selectedRows) => { const fields = getDefaultCollectionFields(selectedRows, form.values); const config = { diff --git a/packages/plugins/@nocobase/plugin-file-manager/src/client/templates/file.ts b/packages/plugins/@nocobase/plugin-file-manager/src/client/templates/file.ts index a028c17f8..efc374a05 100644 --- a/packages/plugins/@nocobase/plugin-file-manager/src/client/templates/file.ts +++ b/packages/plugins/@nocobase/plugin-file-manager/src/client/templates/file.ts @@ -150,7 +150,6 @@ export class FileCollectionTemplate extends CollectionTemplate { title: `{{t("File storage", { ns: "${NAMESPACE}" })}}`, type: 'hasOne', name: 'storage', - required: true, 'x-decorator': 'FormItem', 'x-component': 'Select', 'x-reactions': ['{{useAsyncDataSource(loadStorages)}}'],