This is an automated email from the ASF dual-hosted git repository. mintsweet pushed a commit to branch feat-dora-config in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
commit 079ca78ad018395d874ecbe078b851576640bd72 Author: mintsweet <0x1304...@gmail.com> AuthorDate: Sat Sep 14 12:37:24 2024 +1200 fix: check match items total logic error --- .../components/check-matched-items/index.tsx | 42 +++++++++++----------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/config-ui/src/plugins/components/check-matched-items/index.tsx b/config-ui/src/plugins/components/check-matched-items/index.tsx index 72eb865e2..58c05dd30 100644 --- a/config-ui/src/plugins/components/check-matched-items/index.tsx +++ b/config-ui/src/plugins/components/check-matched-items/index.tsx @@ -69,27 +69,29 @@ export const CheckMatchedItems = ({ plugin, connectionId, transformation }: Prop Check Matched Items </Button> </div> - {total === 0 ? ( - <p>No item found</p> - ) : ( - <Flex vertical gap="small"> - <h3>Matched Items</h3> - <Flex wrap="wrap" gap="small"> - {state.map((it) => ( - <Tag key={it.url} color="blue"> - <ExternalLink link={it.url}>{it.name}</ExternalLink> - </Tag> - ))} + {total ? ( + total === 0 ? ( + <p>No item found</p> + ) : ( + <Flex vertical gap="small"> + <h4>Matched Items</h4> + <Flex wrap="wrap" gap="small"> + {state.map((it) => ( + <Tag key={it.url} color="blue"> + <ExternalLink link={it.url}>{it.name}</ExternalLink> + </Tag> + ))} + </Flex> + {total && total > state.length && ( + <div> + <Button type="link" size="small" loading={loading} icon={<PlusOutlined />} onClick={handleLoadItems}> + See More + </Button> + </div> + )} </Flex> - {total && total > state.length && ( - <div> - <Button type="link" size="small" loading={loading} icon={<PlusOutlined />} onClick={handleLoadItems}> - See More - </Button> - </div> - )} - </Flex> - )} + ) + ) : null} </Flex> ); };