You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by he...@apache.org on 2022/11/30 06:47:11 UTC

[inlong] branch master updated: [INLONG-6680][Dashboard] Set the plugin to default when there is no target plugin (#6682)

This is an automated email from the ASF dual-hosted git repository.

healchow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/inlong.git


The following commit(s) were added to refs/heads/master by this push:
     new 2de3cd863 [INLONG-6680][Dashboard] Set the plugin to default when there is no target plugin (#6682)
2de3cd863 is described below

commit 2de3cd86395c45e5a3eb19d20b4fedbc1c69699c
Author: Daniel <le...@apache.org>
AuthorDate: Wed Nov 30 14:47:05 2022 +0800

    [INLONG-6680][Dashboard] Set the plugin to default when there is no target plugin (#6682)
---
 inlong-dashboard/src/metas/index.ts | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/inlong-dashboard/src/metas/index.ts b/inlong-dashboard/src/metas/index.ts
index 4f2a1d833..cdc1f6614 100644
--- a/inlong-dashboard/src/metas/index.ts
+++ b/inlong-dashboard/src/metas/index.ts
@@ -66,10 +66,14 @@ export const useLoadMeta = <T>(metaType: MetaTypeKeys, subType: string): UseLoad
   const [loading, setLoading] = useState<boolean>(false);
   const [Entity, setEntity] = useState<{ default: T }>();
 
+  const { defaultValue } = useDefaultMeta(metaType);
+
   const load = useCallback(
     async subType => {
       const subList = metasMap[metaType]?.[0];
-      const LoadEntity = subList?.find(item => item.value === subType)?.LoadEntity;
+      const LoadEntity =
+        subList?.find(item => item.value === subType)?.LoadEntity ||
+        subList?.find(item => item.value === defaultValue)?.LoadEntity;
       if (LoadEntity) {
         setLoading(true);
         try {
@@ -80,7 +84,7 @@ export const useLoadMeta = <T>(metaType: MetaTypeKeys, subType: string): UseLoad
         }
       }
     },
-    [metaType],
+    [metaType, defaultValue],
   );
 
   useEffect(() => {