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 c2391b79ad [INLONG-11416][Dashboard] Data synchronization corrects the 
display problem of uncommitted data (#11424)
c2391b79ad is described below

commit c2391b79ad69361555df6933202e096912d08f0e
Author: kamianlaida <[email protected]>
AuthorDate: Mon Oct 28 21:12:24 2024 +0800

    [INLONG-11416][Dashboard] Data synchronization corrects the display problem 
of uncommitted data (#11424)
---
 .../src/plugins/sync/common/SyncDefaultInfo.ts     |  2 +-
 .../src/ui/pages/SynchronizeDetail/Info/index.tsx  | 38 ++++++++++++++++------
 2 files changed, 29 insertions(+), 11 deletions(-)

diff --git a/inlong-dashboard/src/plugins/sync/common/SyncDefaultInfo.ts 
b/inlong-dashboard/src/plugins/sync/common/SyncDefaultInfo.ts
index 4e229a73f0..1fbf1ecfda 100644
--- a/inlong-dashboard/src/plugins/sync/common/SyncDefaultInfo.ts
+++ b/inlong-dashboard/src/plugins/sync/common/SyncDefaultInfo.ts
@@ -33,7 +33,7 @@ const { I18nMap, I18n } = DataWithBackend;
 const { FieldList, FieldDecorator } = RenderRow;
 const { ColumnList, ColumnDecorator } = RenderList;
 
-const format = 'HH:mm';
+export const format = 'HH:mm';
 const conventionalTimeFormat = 'YYYY-MM-DD HH:mm';
 
 export class SyncDefaultInfo implements DataWithBackend, RenderRow, RenderList 
{
diff --git a/inlong-dashboard/src/ui/pages/SynchronizeDetail/Info/index.tsx 
b/inlong-dashboard/src/ui/pages/SynchronizeDetail/Info/index.tsx
index 28784c7826..e6325dcf5d 100644
--- a/inlong-dashboard/src/ui/pages/SynchronizeDetail/Info/index.tsx
+++ b/inlong-dashboard/src/ui/pages/SynchronizeDetail/Info/index.tsx
@@ -28,6 +28,7 @@ import { useFormContent } from './config';
 import { CommonInterface } from '../common';
 import { State } from '@/core/stores';
 import dayjs from 'dayjs';
+import { format } from '@/plugins/sync/common/SyncDefaultInfo';
 
 type Props = CommonInterface;
 
@@ -52,7 +53,11 @@ const Comp = ({ inlongGroupId, inlongStreamId, readonly, 
isCreate }: Props, ref)
       form.setFieldValue('scheduleType', 0);
       form.setFieldValue('scheduleUnit', 'H');
     }
-  }, [form, isCreate]);
+    if (isUpdate) {
+      form.setFieldValue('scheduleType', 0);
+      form.setFieldValue('scheduleUnit', 'H');
+    }
+  }, [form, isCreate, isUpdate]);
 
   const isUpdateStream = useMemo(() => {
     return !!inlongStreamId;
@@ -61,15 +66,27 @@ const Comp = ({ inlongGroupId, inlongStreamId, readonly, 
isCreate }: Props, ref)
   const { data, run: getData } = useRequest(`/group/get/${inlongGroupId}`, {
     ready: isUpdate,
     refreshDeps: [inlongGroupId],
-    formatResult: data => ({
-      ...data,
-      inCharges: data.inCharges.split(','),
-      time: [
-        dayjs(dayjs(data?.startTime), conventionalTimeFormat),
-        dayjs(dayjs(data?.endTime), conventionalTimeFormat),
-      ],
-      delayTime: convertMinutesToDelayTime(data.delayTime),
-    }),
+    formatResult: data => {
+      if (data.inlongGroupMode === 1) {
+        return {
+          ...data,
+          scheduleType: 0,
+          scheduleUnit: 'H',
+          scheduleInterval: 0,
+          delayTime: dayjs('00:00', format),
+          selfDepend: 0,
+        };
+      }
+      return {
+        ...data,
+        inCharges: data.inCharges.split(','),
+        time: [
+          dayjs(dayjs(data?.startTime), conventionalTimeFormat),
+          dayjs(dayjs(data?.endTime), conventionalTimeFormat),
+        ],
+        delayTime: convertMinutesToDelayTime(data.delayTime),
+      };
+    },
     onSuccess: data => {
       setMqType(data.mqType);
       form.setFieldsValue(data);
@@ -214,6 +231,7 @@ const Comp = ({ inlongGroupId, inlongStreamId, readonly, 
isCreate }: Props, ref)
         onValuesChange={(c, values) => setMqType(values.mqType)}
         useMaxWidth={1400}
         col={14}
+        labelWrap
       />
 
       {!isCreate && !readonly && (

Reply via email to