fix(client): consider explicitly re-exporting to resolve the ambiguity
This commit is contained in:
parent
32e744319e
commit
dbcbe6aea7
@ -49,8 +49,8 @@ const InternalKanbanBlockProvider = (props) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const recursiveProperties = (schema: Schema, component = 'CollectionField', associationFields, appends = []) => {
|
const recursiveProperties = (schema: Schema, component = 'CollectionField', associationFields, appends: any = []) => {
|
||||||
schema.mapProperties((s) => {
|
schema.mapProperties((s: any) => {
|
||||||
const name = s.name.toString();
|
const name = s.name.toString();
|
||||||
if (s['x-component'] === component && !appends.includes(name)) {
|
if (s['x-component'] === component && !appends.includes(name)) {
|
||||||
// 关联字段和关联的关联字段
|
// 关联字段和关联的关联字段
|
||||||
@ -63,10 +63,10 @@ const recursiveProperties = (schema: Schema, component = 'CollectionField', asso
|
|||||||
} else {
|
} else {
|
||||||
recursiveProperties(s, component, associationFields, appends);
|
recursiveProperties(s, component, associationFields, appends);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
export const useAssociationNames = (collection) => {
|
const useAssociationNames = (collection) => {
|
||||||
const { getCollectionFields } = useCollectionManager();
|
const { getCollectionFields } = useCollectionManager();
|
||||||
const collectionFields = getCollectionFields(collection);
|
const collectionFields = getCollectionFields(collection);
|
||||||
const associationFields = new Set();
|
const associationFields = new Set();
|
||||||
@ -88,10 +88,9 @@ export const useAssociationNames = (collection) => {
|
|||||||
}
|
}
|
||||||
return buf;
|
return buf;
|
||||||
}, new Schema({}));
|
}, new Schema({}));
|
||||||
const gridSchema = kanbanSchema?.properties?.card?.properties?.grid;
|
const gridSchema: any = kanbanSchema?.properties?.card?.properties?.grid;
|
||||||
const appends = [];
|
const appends = [];
|
||||||
recursiveProperties(gridSchema, 'CollectionField', associationFields, appends);
|
recursiveProperties(gridSchema, 'CollectionField', associationFields, appends);
|
||||||
console.log('useAssociationNames', appends);
|
|
||||||
return uniq(appends);
|
return uniq(appends);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -104,7 +103,7 @@ export const KanbanBlockProvider = (props) => {
|
|||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<BlockProvider {...props} params={params}>
|
<BlockProvider {...props} params={params}>
|
||||||
<InternalKanbanBlockProvider {...props} />
|
<InternalKanbanBlockProvider {...props} params={params} />
|
||||||
</BlockProvider>
|
</BlockProvider>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@ -121,7 +120,7 @@ const useDisableCardDrag = () => {
|
|||||||
}
|
}
|
||||||
const result = getActionParams(`${ctx?.props?.resource}:update`, { skipOwnCheck: true });
|
const result = getActionParams(`${ctx?.props?.resource}:update`, { skipOwnCheck: true });
|
||||||
return !result;
|
return !result;
|
||||||
}
|
};
|
||||||
|
|
||||||
export const useKanbanBlockProps = () => {
|
export const useKanbanBlockProps = () => {
|
||||||
const field = useField<ArrayField>();
|
const field = useField<ArrayField>();
|
||||||
|
Loading…
Reference in New Issue
Block a user