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 842e09b82 [INLONG-6498][Dashboard] Field resolution for unified inlong group approval (#6499) 842e09b82 is described below commit 842e09b829fd424270e42e6ee7290dada3e7cb20 Author: Daniel <lee...@apache.org> AuthorDate: Fri Nov 11 10:51:05 2022 +0800 [INLONG-6498][Dashboard] Field resolution for unified inlong group approval (#6499) --- .../src/components/FormGenerator/plugins.tsx | 5 ++++- inlong-dashboard/src/locales/cn.json | 10 +++++----- inlong-dashboard/src/locales/en.json | 10 +++++----- .../src/pages/ProcessDetail/{Access.tsx => Group.tsx} | 2 +- .../ProcessDetail/{AccessConfig.tsx => GroupConfig.tsx} | 17 ++++++----------- inlong-dashboard/src/pages/ProcessDetail/index.tsx | 4 ++-- 6 files changed, 23 insertions(+), 25 deletions(-) diff --git a/inlong-dashboard/src/components/FormGenerator/plugins.tsx b/inlong-dashboard/src/components/FormGenerator/plugins.tsx index 228c1bee9..cd01029a5 100644 --- a/inlong-dashboard/src/components/FormGenerator/plugins.tsx +++ b/inlong-dashboard/src/components/FormGenerator/plugins.tsx @@ -36,10 +36,13 @@ import { import HighSelect from '@/components/HighSelect'; import i18n from '@/i18n'; -const text: React.FC<Record<string, any>> = ({ value, options }) => { +const text: React.FC<Record<string, any>> = ({ value, options, asyncValueLabel }) => { if (dayjs.isDayjs[value]) { return value.format('YYYY-MM-DD HH:mm'); } + if (asyncValueLabel) { + return asyncValueLabel; + } if (Array.isArray(value) && value.every(dayjs.isDayjs)) { return value.map(item => item.format('YYYY-MM-DD HH:mm')).join(' ~ '); } diff --git a/inlong-dashboard/src/locales/cn.json b/inlong-dashboard/src/locales/cn.json index 029da9daf..60f5a5af0 100644 --- a/inlong-dashboard/src/locales/cn.json +++ b/inlong-dashboard/src/locales/cn.json @@ -416,11 +416,11 @@ "pages.GroupDetail.Audit.Min": "分钟", "pages.GroupDetail.Audit.Hour": "小时", "pages.GroupDetail.Audit.Day": "天", - "pages.ApprovalDetail.AccessConfig.DataStorages": "数据存储", - "pages.ApprovalDetail.AccessConfig.ApprovalInformation": "审批信息", - "pages.ApprovalDetail.AccessConfig.DataFlowInformation": "数据流信息", - "pages.ApprovalDetail.AccessConfig.BasicInformation": "基础信息", - "pages.ApprovalDetail.AccessConfig.BindClusterTag": "集群标签", + "pages.ApprovalDetail.GroupConfig.DataStorages": "数据存储", + "pages.ApprovalDetail.GroupConfig.ApprovalInformation": "审批信息", + "pages.ApprovalDetail.GroupConfig.DataFlowInformation": "数据流信息", + "pages.ApprovalDetail.GroupConfig.BasicInformation": "基础信息", + "pages.ApprovalDetail.GroupConfig.BindClusterTag": "集群标签", "pages.ApprovalDetail.ConsumeConfig.ConsumerGroup": "消费组", "pages.ApprovalDetail.ConsumeConfig.BasicInfo": "基础信息", "pages.ApprovalDetail.ConsumeConfig.ApprovalInfo": "审批信息", diff --git a/inlong-dashboard/src/locales/en.json b/inlong-dashboard/src/locales/en.json index 70e2e536e..fffa3bb68 100644 --- a/inlong-dashboard/src/locales/en.json +++ b/inlong-dashboard/src/locales/en.json @@ -416,11 +416,11 @@ "pages.GroupDetail.Audit.Min": "Minute", "pages.GroupDetail.Audit.Hour": "Hour", "pages.GroupDetail.Audit.Day": "Day", - "pages.ApprovalDetail.AccessConfig.DataStorages": "DataStorages", - "pages.ApprovalDetail.AccessConfig.ApprovalInformation": "Approval information", - "pages.ApprovalDetail.AccessConfig.DataFlowInformation": "Data stream information", - "pages.ApprovalDetail.AccessConfig.BasicInformation": "Basic information", - "pages.ApprovalDetail.AccessConfig.BindClusterTag": "Cluster tag", + "pages.ApprovalDetail.GroupConfig.DataStorages": "DataStorages", + "pages.ApprovalDetail.GroupConfig.ApprovalInformation": "Approval information", + "pages.ApprovalDetail.GroupConfig.DataFlowInformation": "Data stream information", + "pages.ApprovalDetail.GroupConfig.BasicInformation": "Basic information", + "pages.ApprovalDetail.GroupConfig.BindClusterTag": "Cluster tag", "pages.ApprovalDetail.ConsumeConfig.ConsumerGroup": "Consumer group", "pages.ApprovalDetail.ConsumeConfig.BasicInfo": "Basic information", "pages.ApprovalDetail.ConsumeConfig.ApprovalInfo": "Approval information", diff --git a/inlong-dashboard/src/pages/ProcessDetail/Access.tsx b/inlong-dashboard/src/pages/ProcessDetail/Group.tsx similarity index 97% rename from inlong-dashboard/src/pages/ProcessDetail/Access.tsx rename to inlong-dashboard/src/pages/ProcessDetail/Group.tsx index b3afabeb9..700702db8 100644 --- a/inlong-dashboard/src/pages/ProcessDetail/Access.tsx +++ b/inlong-dashboard/src/pages/ProcessDetail/Group.tsx @@ -20,7 +20,7 @@ import React, { useMemo, forwardRef, useImperativeHandle, useEffect } from 'react'; import FormGenerator, { useForm } from '@/components/FormGenerator'; import { CommonInterface } from './common'; -import { useGroupFormContent, getFormContent } from './AccessConfig'; +import { useGroupFormContent, getFormContent } from './GroupConfig'; export type Props = CommonInterface; diff --git a/inlong-dashboard/src/pages/ProcessDetail/AccessConfig.tsx b/inlong-dashboard/src/pages/ProcessDetail/GroupConfig.tsx similarity index 86% rename from inlong-dashboard/src/pages/ProcessDetail/AccessConfig.tsx rename to inlong-dashboard/src/pages/ProcessDetail/GroupConfig.tsx index 3ffd3fbef..14a493d53 100644 --- a/inlong-dashboard/src/pages/ProcessDetail/AccessConfig.tsx +++ b/inlong-dashboard/src/pages/ProcessDetail/GroupConfig.tsx @@ -41,12 +41,7 @@ export const useGroupFormContent = ({ mqType = '', isFinished, isViwer }) => { 'retentionSize', ]); - if ( - (typeof obj.type === 'string' && !canEditSet.has(obj.name as string)) || - obj.name === 'inCharges' || - isFinished || - isViwer - ) { + if (!canEditSet.has(obj.name as string) || isFinished || isViwer) { obj.type = 'text'; delete obj.rules; delete obj.extra; @@ -72,7 +67,7 @@ export const getFormContent = ({ { type: ( <Divider orientation="left"> - {i18n.t('pages.ApprovalDetail.AccessConfig.BasicInformation')} + {i18n.t('pages.ApprovalDetail.GroupConfig.BasicInformation')} </Divider> ), }, @@ -80,7 +75,7 @@ export const getFormContent = ({ { type: ( <Divider orientation="left"> - {i18n.t('pages.ApprovalDetail.AccessConfig.DataFlowInformation')} + {i18n.t('pages.ApprovalDetail.GroupConfig.DataFlowInformation')} </Divider> ), }, @@ -91,7 +86,7 @@ export const getFormContent = ({ columns={[ { title: 'ID', dataIndex: 'inlongStreamId' }, { - title: i18n.t('pages.ApprovalDetail.AccessConfig.DataStorages'), + title: i18n.t('pages.ApprovalDetail.GroupConfig.DataStorages'), dataIndex: 'sinkList', render: text => text.map(item => item.sinkType).join(','), }, @@ -108,7 +103,7 @@ export const getFormContent = ({ : [ { type: 'select', - label: i18n.t('pages.ApprovalDetail.AccessConfig.BindClusterTag'), + label: i18n.t('pages.ApprovalDetail.GroupConfig.BindClusterTag'), name: ['inlongClusterTag'], rules: [{ required: true }], props: { @@ -144,7 +139,7 @@ export const getFormContent = ({ { type: ( <Divider orientation="left"> - {i18n.t('pages.ApprovalDetail.AccessConfig.ApprovalInformation')} + {i18n.t('pages.ApprovalDetail.GroupConfig.ApprovalInformation')} </Divider> ), }, diff --git a/inlong-dashboard/src/pages/ProcessDetail/index.tsx b/inlong-dashboard/src/pages/ProcessDetail/index.tsx index 64b86667a..be5c5ce28 100644 --- a/inlong-dashboard/src/pages/ProcessDetail/index.tsx +++ b/inlong-dashboard/src/pages/ProcessDetail/index.tsx @@ -26,7 +26,7 @@ import i18n from '@/i18n'; import { timestampFormat } from '@/utils'; import request from '@/utils/request'; import Steps from './Steps'; -import Access from './Access'; +import Group from './Group'; import Consume from './Consume'; const workflowFormat = (applicant, startEvent, taskHistory = []) => { @@ -174,7 +174,7 @@ const Comp: React.FC = () => { const Form = useMemo(() => { return { - APPLY_GROUP_PROCESS: Access, + APPLY_GROUP_PROCESS: Group, APPLY_CONSUME_PROCESS: Consume, }[processInfo?.name]; }, [processInfo]);