Skip to content

Commit

Permalink
refactor: update seatunnel 2.3.5 feishu connectors
Browse files Browse the repository at this point in the history
  • Loading branch information
wangqi committed May 10, 2024
1 parent 1f7fe61 commit c8eb121
Show file tree
Hide file tree
Showing 7 changed files with 419 additions and 433 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ public enum FakeProperties {
.addValidator(Validators.POSITIVE_INTEGER_VALIDATOR)
.validateAndBuild();

public static final PropertyDescriptor<JsonNode> ROWS = new PropertyDescriptor.Builder<JsonNode>()
.name("rows")
.description(
"The row list of fake data output per degree of parallelism")
.type(PropertyType.OBJECT)
.parser(Parsers.JSON_PARSER)
.addValidator(Validators.NON_BLANK_VALIDATOR)
.validateAndBuild();

public static final PropertyDescriptor<Integer> SPLIT_NUM = new PropertyDescriptor.Builder<Integer>()
.name("split.num")
.description("the number of splits generated by the enumerator for each degree of parallelism")
Expand Down Expand Up @@ -106,15 +115,6 @@ public enum FakeProperties {
.addValidator(Validators.POSITIVE_INTEGER_VALIDATOR)
.validateAndBuild();

public static final PropertyDescriptor<JsonNode> ROWS = new PropertyDescriptor.Builder<JsonNode>()
.name("rows")
.description(
"The row list of fake data output per degree of parallelism")
.type(PropertyType.OBJECT)
.parser(Parsers.JSON_PARSER)
.addValidator(Validators.NON_BLANK_VALIDATOR)
.validateAndBuild();

public static final PropertyDescriptor<String> STRING_FAKE_MODE = new PropertyDescriptor.Builder()
.name("string.fake.mode")
.description("The fake mode of generating string data")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ public FakeSourcePlugin() {
props.add(TABLES_CONFIGS);
props.add(SCHEMA);
props.add(ROW_NUM);
props.add(ROWS);
props.add(SPLIT_NUM);
props.add(SPLIT_READ_INTERVAL);
props.add(MAP_SIZE);
props.add(ARRAY_SIZE);
props.add(BYTES_SIZE);
props.add(STRING_SIZE);
props.add(ROWS);

props.add(STRING_FAKE_MODE);
props.add(STRING_TEMPLATE);
Expand Down
5 changes: 2 additions & 3 deletions scaleph-ui-react/src/locales/zh-CN/pages/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,8 @@ export default {

// feishu
'pages.project.di.step.feishu.url': '飞书机器人URL',
'pages.project.di.step.feishu.headers': 'Header',
'pages.project.di.step.feishu.header': 'header',
'pages.project.di.step.feishu.value': 'value',
'pages.project.di.step.feishu.headers': 'Headers',
'pages.project.di.step.feishu.headers.tooltip': 'Http 请求 Headers',

// dingtalk
'pages.project.di.step.dingtalk.url': '钉钉机器人URL',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,7 @@ export const WeChatParams = {

export const FeishuParams = {
url: 'url',
headerArray: 'headerArray',
headers: 'headers',
header: 'header',
headerValue: 'headerValue'
};

export const DingTalkParams = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@ const SinkEmailStepForm: React.FC<ModalFormProps<Node>> = ({data, visible, onVis
<ProFormGroup>
<ProFormTextArea
name={EmailParams.emailAuthorizationCode}
label={intl.formatMessage({
id: 'pages.project.di.step.email.emailAuthorizationCode',
})}
label={intl.formatMessage({id: 'pages.project.di.step.email.emailAuthorizationCode'})}
rules={[{required: true}]}
/>
</ProFormGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import React, {useEffect} from 'react';
import {Form} from 'antd';
import {DrawerForm, ProFormGroup, ProFormList, ProFormText} from '@ant-design/pro-components';
import {InfoCircleOutlined} from "@ant-design/icons";
import {DrawerForm, ProFormGroup, ProFormText} from '@ant-design/pro-components';
import {getIntl, getLocale} from "@umijs/max";
import {Node, XFlow} from '@antv/xflow';
import {ModalFormProps} from '@/typings';
import {FeishuParams, STEP_ATTR_TYPE} from '../constant';
import {StepSchemaService} from "../helper";
import CommonConfigItem
from "@/pages/Project/Workspace/DataIntegration/SeaTunnel/Dag/components/node/steps/common/config/commonConfig";

const SinkFeishuStepForm: React.FC<ModalFormProps<Node>> = ({data, visible, onVisibleChange, onOK}) => {
const intl = getIntl(getLocale());
Expand All @@ -32,7 +35,7 @@ const SinkFeishuStepForm: React.FC<ModalFormProps<Node>> = ({data, visible, onVi
}}
onFinish={(values) => {
if (onOK) {
StepSchemaService.formatHeader(values);
StepSchemaService.formatCommonConfig(values, FeishuParams.headers, FeishuParams.headers);
onOK(values)
return Promise.resolve(true)
}
Expand All @@ -50,28 +53,17 @@ const SinkFeishuStepForm: React.FC<ModalFormProps<Node>> = ({data, visible, onVi
label={intl.formatMessage({id: 'pages.project.di.step.feishu.url'})}
rules={[{required: true}]}
/>
<ProFormList
name={FeishuParams.headerArray}
label={intl.formatMessage({id: 'pages.project.di.step.feishu.headers'})}
copyIconProps={false}
creatorButtonProps={{
creatorButtonText: intl.formatMessage({id: 'pages.project.di.step.feishu.header'}),
type: 'text',
<ProFormGroup
title={intl.formatMessage({id: 'pages.project.di.step.feishu.headers'})}
tooltip={{
title: intl.formatMessage({id: 'pages.project.di.step.feishu.headers.tooltip'}),
icon: <InfoCircleOutlined/>,
}}
collapsible={true}
defaultCollapsed={true}
>
<ProFormGroup>
<ProFormText
name={FeishuParams.header}
label={intl.formatMessage({id: 'pages.project.di.step.feishu.header'})}
colProps={{span: 10, offset: 1}}
/>
<ProFormText
name={FeishuParams.headerValue}
label={intl.formatMessage({id: 'pages.project.di.step.feishu.value'})}
colProps={{span: 10, offset: 1}}
/>
</ProFormGroup>
</ProFormList>
<CommonConfigItem data={FeishuParams.headers}/>
</ProFormGroup>
</DrawerForm>
</XFlow>
);
Expand Down
Loading

0 comments on commit c8eb121

Please sign in to comment.