From 8aee0eef9be118acfdd1e9789a3452bf21ec8832 Mon Sep 17 00:00:00 2001 From: katherinehhh Date: Sat, 6 May 2023 21:44:01 +0800 Subject: [PATCH] fix: association scope inherit (#1806) --- .../core/client/src/collection-manager/action-hooks.ts | 8 ++++---- .../src/schema-component/antd/filter/FilterItem.tsx | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/core/client/src/collection-manager/action-hooks.ts b/packages/core/client/src/collection-manager/action-hooks.ts index 0bca602062..817842a9ac 100644 --- a/packages/core/client/src/collection-manager/action-hooks.ts +++ b/packages/core/client/src/collection-manager/action-hooks.ts @@ -159,9 +159,9 @@ export const useCollectionFilterOptions = (collectionName: string) => { }; const options = getOptions(fields, 1); const compile = useCompile(); - const { getChildrenCollections } = useCollectionManager(); - const collection = useCollection(); - const childrenCollections = getChildrenCollections(collection.name); + const { getChildrenCollections, getCollection } = useCollectionManager(); + const collection = getCollection(collectionName); + const childrenCollections = getChildrenCollections(collectionName); if (childrenCollections.length > 0 && !options.find((v) => v.name == 'tableoid')) { options.push({ name: 'tableoid', @@ -169,7 +169,7 @@ export const useCollectionFilterOptions = (collectionName: string) => { title: '{{t("Table OID(Inheritance)")}}', schema: { 'x-component': 'Select', - enum: [{ value: collection.name, label: compile(collection.title) }].concat( + enum: [{ value: collectionName, label: compile(collection.title) }].concat( childrenCollections.map((v) => { return { value: v.name, diff --git a/packages/core/client/src/schema-component/antd/filter/FilterItem.tsx b/packages/core/client/src/schema-component/antd/filter/FilterItem.tsx index a0ebc21791..8f10a6a950 100644 --- a/packages/core/client/src/schema-component/antd/filter/FilterItem.tsx +++ b/packages/core/client/src/schema-component/antd/filter/FilterItem.tsx @@ -47,7 +47,7 @@ export const FilterItem = observer((props: any) => { /> {!operator?.noValue && React.createElement(DynamicComponent, { - value, + value: value ? value : undefined, schema, onChange(value) { setValue(value);