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/08/03 11:14:13 UTC

[inlong] branch master updated: [INLONG-5345][Dashboard] Group approval supports partial field modification (#5346)

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 25e818eb3 [INLONG-5345][Dashboard] Group approval supports partial field modification (#5346)
25e818eb3 is described below

commit 25e818eb36259437f140313cfce2fad5a11390dc
Author: Daniel <le...@outlook.com>
AuthorDate: Wed Aug 3 19:14:08 2022 +0800

    [INLONG-5345][Dashboard] Group approval supports partial field modification (#5346)
---
 .../src/pages/ApprovalDetail/AccessConfig.tsx      | 41 +++++++++++++++-------
 1 file changed, 29 insertions(+), 12 deletions(-)

diff --git a/inlong-dashboard/src/pages/ApprovalDetail/AccessConfig.tsx b/inlong-dashboard/src/pages/ApprovalDetail/AccessConfig.tsx
index 2d90b1643..a9c7ea2c2 100644
--- a/inlong-dashboard/src/pages/ApprovalDetail/AccessConfig.tsx
+++ b/inlong-dashboard/src/pages/ApprovalDetail/AccessConfig.tsx
@@ -22,7 +22,7 @@ import { Divider, Table } from 'antd';
 import i18n from '@/i18n';
 import { genBusinessFields } from '@/components/AccessHelper';
 
-const getBusinessContent = initialValues => [
+const getBusinessContent = (initialValues, isFinished, isViwer) => [
   ...genBusinessFields(
     [
       'inlongGroupId',
@@ -47,14 +47,29 @@ const getBusinessContent = initialValues => [
     initialValues,
   ).map(item => {
     const obj = { ...item };
-    if (typeof obj.suffix !== 'string') {
-      delete obj.suffix;
-    }
-    delete obj.rules;
-    delete obj.extra;
 
-    if (typeof obj.type === 'string' || obj.name === 'inlongGroupId' || obj.name === 'inCharges') {
+    const canEditSet = new Set([
+      'ensemble',
+      'writeQuorum',
+      'ackQuorum',
+      'retentionTime',
+      'ttl',
+      'retentionSize',
+    ]);
+
+    if (
+      (typeof obj.type === 'string' && !canEditSet.has(obj.name as string)) ||
+      obj.name === 'inCharges' ||
+      isFinished ||
+      isViwer
+    ) {
       obj.type = 'text';
+      delete obj.rules;
+      delete obj.extra;
+      if ((obj.suffix as any)?.type) {
+        (obj.suffix as any).type = 'text';
+        delete (obj.suffix as any).rules;
+      }
     }
 
     return obj;
@@ -70,7 +85,7 @@ export const getFormContent = ({ isViwer, formData, suffixContent, noExtraForm,
         </Divider>
       ),
     },
-    ...(getBusinessContent(formData.groupInfo) || []),
+    ...(getBusinessContent(formData.groupInfo, isFinished, isViwer) || []),
     {
       type: (
         <Divider orientation="left">
@@ -106,17 +121,19 @@ export const getFormContent = ({ isViwer, formData, suffixContent, noExtraForm,
           name: ['inlongClusterTag'],
           rules: [{ required: true }],
           props: {
+            showSearch: true,
             disabled: isFinished,
             options: {
-              requestAuto: isFinished,
-              requestService: {
+              requestTrigger: ['onOpen', 'onSearch'],
+              requestService: keyword => ({
                 url: '/cluster/tag/list',
                 method: 'POST',
                 data: {
+                  keyword,
                   pageNum: 1,
-                  pageSize: 100,
+                  pageSize: 20,
                 },
-              },
+              }),
               requestParams: {
                 formatResult: result =>
                   result?.list?.map(item => ({