This is an automated email from the ASF dual-hosted git repository. mintsweet pushed a commit to branch fix-6573 in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
commit ebc637c2a209b19707a5a29a3739699001ddec95 Author: mintsweet <[email protected]> AuthorDate: Thu Dec 7 12:05:59 2023 +0800 fix(config-ui): missed the last result when adding a search scope --- .../src/plugins/components/data-scope-remote/search-remote.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/config-ui/src/plugins/components/data-scope-remote/search-remote.tsx b/config-ui/src/plugins/components/data-scope-remote/search-remote.tsx index 399d64182..9b7448ff5 100644 --- a/config-ui/src/plugins/components/data-scope-remote/search-remote.tsx +++ b/config-ui/src/plugins/components/data-scope-remote/search-remote.tsx @@ -54,11 +54,13 @@ export const SearchRemote = ({ plugin, connectionId, config, disabledScope, sele const [search, setSearch] = useState<{ items: McsItem<T.ResItem>[]; + currentItems: McsItem<T.ResItem>[]; query: string; page: number; total: number; }>({ items: [], + currentItems: [], query: '', page: 1, total: 0, @@ -127,14 +129,15 @@ export const SearchRemote = ({ plugin, connectionId, config, disabledScope, sele pageSize: 20, }); - const items = (res.children ?? []).map((it) => ({ + const newItems = (res.children ?? []).map((it) => ({ ...it, title: it.name, })); setSearch((s) => ({ ...s, - items, + items: [...allItems, ...newItems], + currentItems: newItems, total: res.count, })); }; @@ -186,7 +189,7 @@ export const SearchRemote = ({ plugin, connectionId, config, disabledScope, sele /> ) : ( <MillerColumnsSelect - items={search.items} + items={search.currentItems} columnCount={1} columnHeight={300} getCanExpand={() => false}
