You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by do...@apache.org on 2022/10/14 10:18:35 UTC

[inlong] branch master updated: [INLONG-6185][Dashboard] The suffix configuration function will only be executed once (#6187)

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

dockerzhang 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 531c7969a [INLONG-6185][Dashboard] The suffix configuration function will only be executed once (#6187)
531c7969a is described below

commit 531c7969a224a2de22e7e06ee596fe5e4a268c8a
Author: Daniel <le...@apache.org>
AuthorDate: Fri Oct 14 18:18:29 2022 +0800

    [INLONG-6185][Dashboard] The suffix configuration function will only be executed once (#6187)
---
 inlong-dashboard/src/components/FormGenerator/FormGenerator.tsx | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/inlong-dashboard/src/components/FormGenerator/FormGenerator.tsx b/inlong-dashboard/src/components/FormGenerator/FormGenerator.tsx
index 0d35dfd82..9821670d8 100644
--- a/inlong-dashboard/src/components/FormGenerator/FormGenerator.tsx
+++ b/inlong-dashboard/src/components/FormGenerator/FormGenerator.tsx
@@ -117,17 +117,18 @@ const FormGenerator: React.FC<FormGeneratorProps> = props => {
         if (v.suffix?.name) {
           const suffixNp = Array.isArray(v.suffix.name) ? v.suffix.name : v.suffix.name.split('.');
           v.suffix.name = suffixNp && suffixNp.length > 1 ? suffixNp : v.suffix.name;
-          if (typeof v.suffix?.props === 'function') {
-            v.suffix.props = v.suffix.props(realTimeValues);
-          }
         }
+        const suffixProps =
+          typeof v.suffix?.props === 'function' ? v.suffix.props(realTimeValues) : v.suffix?.props;
 
         return {
           ...v,
           name,
           type: viewOnly ? 'text' : v.type,
           suffix:
-            typeof v.suffix === 'object' && viewOnly ? { ...v.suffix, type: 'text' } : v.suffix,
+            typeof v.suffix === 'object'
+              ? { ...v.suffix, props: suffixProps, type: viewOnly ? 'text' : v.suffix.type }
+              : v.suffix,
           extra: viewOnly ? null : v.extra,
           props: {
             ...initialProps,