From bcad6c89dc3773b0425abb83968ea9804958363c Mon Sep 17 00:00:00 2001 From: katherinehhh Date: Mon, 19 Jun 2023 20:48:20 +0800 Subject: [PATCH] fix: file collection field should default to preview as the title field (#2059) * fix: after selecting files for multiple association fields, the selected files should not be removed * fix: file collection field should default to preview as the title field --------- Co-authored-by: chenos --- packages/core/client/src/schema-initializer/utils.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/core/client/src/schema-initializer/utils.ts b/packages/core/client/src/schema-initializer/utils.ts index 6c2bafb66..1356c656b 100644 --- a/packages/core/client/src/schema-initializer/utils.ts +++ b/packages/core/client/src/schema-initializer/utils.ts @@ -102,8 +102,15 @@ export const useTableColumnInitializerFields = () => { name: field.name, 'x-collection-field': `${name}.${field.name}`, 'x-component': 'CollectionField', + 'x-component-props': isFileCollection + ? { + fieldNames: { + label: 'preview', + value: 'id', + }, + } + : {}, 'x-read-pretty': isReadPretty || field.uiSchema?.['x-read-pretty'], - 'x-component-props': {}, 'x-decorator': isSubTable ? quickEditField.includes(field.interface) || isFileCollection ? 'QuickEdit'