From dbcbe6aea7a0f9f59a6ea46e832d478f8035e56a Mon Sep 17 00:00:00 2001 From: chenos Date: Wed, 29 Jun 2022 13:14:34 +0800 Subject: [PATCH] fix(client): consider explicitly re-exporting to resolve the ambiguity --- .../src/block-provider/KanbanBlockProvider.tsx | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/packages/core/client/src/block-provider/KanbanBlockProvider.tsx b/packages/core/client/src/block-provider/KanbanBlockProvider.tsx index 2cd863d96..568e7bd5c 100644 --- a/packages/core/client/src/block-provider/KanbanBlockProvider.tsx +++ b/packages/core/client/src/block-provider/KanbanBlockProvider.tsx @@ -49,8 +49,8 @@ const InternalKanbanBlockProvider = (props) => { ); }; -const recursiveProperties = (schema: Schema, component = 'CollectionField', associationFields, appends = []) => { - schema.mapProperties((s) => { +const recursiveProperties = (schema: Schema, component = 'CollectionField', associationFields, appends: any = []) => { + schema.mapProperties((s: any) => { const name = s.name.toString(); if (s['x-component'] === component && !appends.includes(name)) { // 关联字段和关联的关联字段 @@ -63,10 +63,10 @@ const recursiveProperties = (schema: Schema, component = 'CollectionField', asso } else { recursiveProperties(s, component, associationFields, appends); } - }) -} + }); +}; -export const useAssociationNames = (collection) => { +const useAssociationNames = (collection) => { const { getCollectionFields } = useCollectionManager(); const collectionFields = getCollectionFields(collection); const associationFields = new Set(); @@ -88,10 +88,9 @@ export const useAssociationNames = (collection) => { } return buf; }, new Schema({})); - const gridSchema = kanbanSchema?.properties?.card?.properties?.grid; + const gridSchema: any = kanbanSchema?.properties?.card?.properties?.grid; const appends = []; recursiveProperties(gridSchema, 'CollectionField', associationFields, appends); - console.log('useAssociationNames', appends); return uniq(appends); }; @@ -104,7 +103,7 @@ export const KanbanBlockProvider = (props) => { } return ( - + ); }; @@ -121,7 +120,7 @@ const useDisableCardDrag = () => { } const result = getActionParams(`${ctx?.props?.resource}:update`, { skipOwnCheck: true }); return !result; -} +}; export const useKanbanBlockProps = () => { const field = useField();