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
The following commit(s) were added to refs/heads/feat-dora-config by this push:
new a0a074460 fix: check match items total
a0a074460 is described below
commit a0a0744604e7739be1d765207d6adba72e44fe5f
Author: mintsweet <[email protected]>
AuthorDate: Sat Sep 14 12:14:06 2024 +1200
fix: check match items total
---
config-ui/src/plugins/components/check-matched-items/index.tsx | 8 +++++---
1 file changed, 5 insertions(+), 3 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 bdfcde2ff..72eb865e2 100644
--- a/config-ui/src/plugins/components/check-matched-items/index.tsx
+++ b/config-ui/src/plugins/components/check-matched-items/index.tsx
@@ -41,7 +41,7 @@ interface Props {
export const CheckMatchedItems = ({ plugin, connectionId, transformation }:
Props) => {
const [page, setPage] = useState(1);
- const [total, setTotal] = useState(0);
+ const [total, setTotal] = useState<number>();
const [loading, setLoading] = useState(false);
const [state, dispatch] = useReducer(reducer, []);
@@ -69,7 +69,9 @@ export const CheckMatchedItems = ({ plugin, connectionId,
transformation }: Prop
Check Matched Items
</Button>
</div>
- {!!state.length && (
+ {total === 0 ? (
+ <p>No item found</p>
+ ) : (
<Flex vertical gap="small">
<h3>Matched Items</h3>
<Flex wrap="wrap" gap="small">
@@ -79,7 +81,7 @@ export const CheckMatchedItems = ({ plugin, connectionId,
transformation }: Prop
</Tag>
))}
</Flex>
- {total > state.length && (
+ {total && total > state.length && (
<div>
<Button type="link" size="small" loading={loading}
icon={<PlusOutlined />} onClick={handleLoadItems}>
See More