chore: file collection template preset fields should be disabled (#3810)

This commit is contained in:
katherinehhh 2024-03-25 11:39:52 +08:00 committed by GitHub
parent e9e116e476
commit 5e22103e33
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View File

@ -193,6 +193,10 @@ export const PresetFields = observer(
rowSelection={{ rowSelection={{
type: 'checkbox', type: 'checkbox',
selectedRowKeys, selectedRowKeys,
getCheckboxProps: (record) => ({
disabled: form.values.template === 'file', // Column configuration not to be checked
name: record.name,
}),
onChange: (_, selectedRows) => { onChange: (_, selectedRows) => {
const fields = getDefaultCollectionFields(selectedRows, form.values); const fields = getDefaultCollectionFields(selectedRows, form.values);
const config = { const config = {

View File

@ -150,7 +150,6 @@ export class FileCollectionTemplate extends CollectionTemplate {
title: `{{t("File storage", { ns: "${NAMESPACE}" })}}`, title: `{{t("File storage", { ns: "${NAMESPACE}" })}}`,
type: 'hasOne', type: 'hasOne',
name: 'storage', name: 'storage',
required: true,
'x-decorator': 'FormItem', 'x-decorator': 'FormItem',
'x-component': 'Select', 'x-component': 'Select',
'x-reactions': ['{{useAsyncDataSource(loadStorages)}}'], 'x-reactions': ['{{useAsyncDataSource(loadStorages)}}'],