Skip to content

Commit 6dec146

Browse files
authored
[Elsa] bugfix: fix variable updater node bugs (#339)
1 parent ed985e2 commit 6dec146

File tree

9 files changed

+28
-28
lines changed

9 files changed

+28
-28
lines changed

framework/elsa/fit-elsa-react/src/components/variableUpdate/Constant.js renamed to framework/elsa/fit-elsa-react/src/components/variableUpdater/Constant.js

File renamed without changes.

framework/elsa/fit-elsa-react/src/components/variableUpdate/VariableUpdateInputForm.jsx renamed to framework/elsa/fit-elsa-react/src/components/variableUpdater/VariableUpdaterInputForm.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const {Panel} = Collapse;
2525
* @param shapeStatus 图形状态集合.
2626
* @returns {JSX.Element} DOM对象
2727
*/
28-
const _VariableUpdateInputForm = ({variables, shapeStatus}) => {
28+
const _VariableUpdaterInputForm = ({variables, shapeStatus}) => {
2929

3030
return (<>
3131
<div className={'jade-variable-input-content'}>
@@ -40,7 +40,7 @@ const _VariableUpdateInputForm = ({variables, shapeStatus}) => {
4040
</>);
4141
};
4242

43-
_VariableUpdateInputForm.propTypes = {
43+
_VariableUpdaterInputForm.propTypes = {
4444
variables: PropTypes.array.isRequired, shapeStatus: PropTypes.object,
4545
};
4646

@@ -60,7 +60,7 @@ const isVariablesEqual = (prevProps, nextProps) => {
6060
return true;
6161
};
6262

63-
export const VariableUpdateInputForm = React.memo(_VariableUpdateInputForm, areEqual);
63+
export const VariableUpdaterInputForm = React.memo(_VariableUpdaterInputForm, areEqual);
6464

6565
/**
6666
* 变量条目.

framework/elsa/fit-elsa-react/src/components/variableUpdate/VariableUpdateWrapper.jsx renamed to framework/elsa/fit-elsa-react/src/components/variableUpdater/VariableUpdaterWrapper.jsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import React, {useState} from 'react';
88
import {Button} from 'antd';
99
import {PlusOutlined} from '@ant-design/icons';
1010
import PropTypes from 'prop-types';
11-
import {VariableUpdateInputForm} from './VariableUpdateInputForm.jsx';
11+
import {VariableUpdaterInputForm} from './VariableUpdaterInputForm.jsx';
1212
import {useTranslation} from 'react-i18next';
13-
import './variableUpdate.css';
13+
import './variableUpdater.css';
1414
import {useConfigContext, useDispatch} from '@/components/DefaultRoot.jsx';
1515
import {v4 as uuidv4} from 'uuid';
1616

@@ -21,7 +21,7 @@ import {v4 as uuidv4} from 'uuid';
2121
* @param shapeStatus 图形状态集合.
2222
* @returns {JSX.Element} DOM对象.
2323
*/
24-
const _VariableUpdateWrapper = ({data, shapeStatus}) => {
24+
const _VariableUpdaterWrapper = ({data, shapeStatus}) => {
2525
const {t} = useTranslation();
2626
const dispatch = useDispatch();
2727
const isConfig = useConfigContext();
@@ -60,13 +60,13 @@ const _VariableUpdateWrapper = ({data, shapeStatus}) => {
6060
<div className="jade-panel-header-font" style={{paddingLeft: '4px'}}>{t('add')}</div>
6161
</Button>
6262
</div>
63-
<VariableUpdateInputForm variables={variables} shapeStatus={shapeStatus}/>
63+
<VariableUpdaterInputForm variables={variables} shapeStatus={shapeStatus}/>
6464
</div>
6565
</>);
6666
};
6767

68-
_VariableUpdateWrapper.propTypes = {
68+
_VariableUpdaterWrapper.propTypes = {
6969
data: PropTypes.object.isRequired, shapeStatus: PropTypes.object,
7070
};
7171

72-
export const VariableUpdateWrapper = React.memo(_VariableUpdateWrapper);
72+
export const VariableUpdaterWrapper = React.memo(_VariableUpdaterWrapper);

framework/elsa/fit-elsa-react/src/components/variableUpdate/reducers/reducers.js renamed to framework/elsa/fit-elsa-react/src/components/variableUpdater/reducers/reducers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Licensed under the MIT License. See License.txt in the project root for license information.
55
*--------------------------------------------------------------------------------------------*/
66

7-
import {createDefaultVariable} from '@/components/variableUpdate/Constant.js';
7+
import {createDefaultVariable} from '@/components/variableUpdater/Constant.js';
88

99
/**
1010
* 添加变量 事件处理器.

framework/elsa/fit-elsa-react/src/components/variableUpdate/variableUpdate.css renamed to framework/elsa/fit-elsa-react/src/components/variableUpdater/variableUpdater.css

File renamed without changes.

framework/elsa/fit-elsa-react/src/components/variableUpdate/variableUpdateComponent.jsx renamed to framework/elsa/fit-elsa-react/src/components/variableUpdater/variableUpdaterComponent.jsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ import {v4 as uuidv4} from 'uuid';
88

99
import {defaultComponent} from '../defaultComponent.js';
1010
import {DATA_TYPES, FROM_TYPE} from '@/common/Consts.js';
11-
import {VariableUpdateWrapper} from '@/components/variableUpdate/VariableUpdateWrapper.jsx';
12-
import {AddVariableReducer, DeleteVariableReducer, UpdateVariableReducer} from '@/components/variableUpdate/reducers/reducers.js';
11+
import {VariableUpdaterWrapper} from '@/components/variableUpdater/VariableUpdaterWrapper.jsx';
12+
import {AddVariableReducer, DeleteVariableReducer, UpdateVariableReducer} from '@/components/variableUpdater/reducers/reducers.js';
1313
import {ChangeFlowMetaReducer} from '@/components/common/reducers/commonReducers.js';
14-
import {createDefaultVariable} from '@/components/variableUpdate/Constant.js';
14+
import {createDefaultVariable} from '@/components/variableUpdater/Constant.js';
1515

1616

1717
/**
@@ -20,7 +20,7 @@ import {createDefaultVariable} from '@/components/variableUpdate/Constant.js';
2020
* @param jadeConfig 组件配置信息
2121
* @return {{}} 组件
2222
*/
23-
export const variableUpdateComponent = (jadeConfig) => {
23+
export const variableUpdaterComponent = (jadeConfig) => {
2424
const self = defaultComponent(jadeConfig);
2525
const addReducer = (map, reducer) => map.set(reducer.type, reducer);
2626
const builtInReducers = new Map();
@@ -52,7 +52,7 @@ export const variableUpdateComponent = (jadeConfig) => {
5252
* @param data 数据.
5353
*/
5454
self.getReactComponents = (shapeStatus, data) => {
55-
return (<><VariableUpdateWrapper shapeStatus={shapeStatus} data={data}/></>);
55+
return (<><VariableUpdaterWrapper shapeStatus={shapeStatus} data={data}/></>);
5656
};
5757

5858
/**

framework/elsa/fit-elsa-react/src/components/variableUpdate/variableUpdateDrawer.jsx renamed to framework/elsa/fit-elsa-react/src/components/variableUpdater/variableUpdaterDrawer.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@
55
*--------------------------------------------------------------------------------------------*/
66

77
import {jadeNodeDrawer} from '../base/jadeNodeDrawer.jsx';
8-
import VariableUpdate from '../asserts/icon-variable-update.svg?react'; // 导入背景图片
8+
import VariableUpdater from '../asserts/icon-variable-update.svg?react'; // 导入背景图片
99

1010
/**
1111
* 变量更新节点绘制器
1212
*
1313
* @override
1414
*/
15-
export const variableUpdateDrawer = (shape, div, x, y) => {
15+
export const variableUpdaterDrawer = (shape, div, x, y) => {
1616
const self = jadeNodeDrawer(shape, div, x, y);
17-
self.type = 'variableUpdateDrawer';
17+
self.type = 'variableUpdaterDrawer';
1818

1919
/**
2020
* @override
2121
*/
2222
self.getHeaderIcon = () => {
2323
return (<>
24-
<VariableUpdate className='jade-node-custom-header-icon'/>
24+
<VariableUpdater className='jade-node-custom-header-icon'/>
2525
</>);
2626
};
2727

framework/elsa/fit-elsa-react/src/components/variableUpdate/variableUpdateNodeState.jsx renamed to framework/elsa/fit-elsa-react/src/components/variableUpdater/variableUpdaterNodeState.jsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@
66

77
import {jadeNode} from '../base/jadeNode.jsx';
88
import {DEFAULT_FLOW_META} from '@/common/Consts.js';
9-
import {variableUpdateDrawer} from '@/components/variableUpdate/variableUpdateDrawer.jsx';
9+
import {variableUpdaterDrawer} from '@/components/variableUpdater/variableUpdaterDrawer.jsx';
1010

1111
/**
1212
* 变量更新节点.
1313
*
1414
* @override
1515
*/
16-
export const variableUpdateNodeState = (id, x, y, width, height, parent, drawer) => {
17-
const self = jadeNode(id, x, y, width, height, parent, drawer ? drawer : variableUpdateDrawer);
16+
export const variableUpdaterNodeState = (id, x, y, width, height, parent, drawer) => {
17+
const self = jadeNode(id, x, y, width, height, parent, drawer ? drawer : variableUpdaterDrawer);
1818
self.text = '变量更新';
19-
self.type = 'variableUpdateNodeState';
20-
self.componentName = 'variableUpdateComponent';
19+
self.type = 'variableUpdaterNodeState';
20+
self.componentName = 'variableUpdaterComponent';
2121
self.flowMeta.jober.fitables.push("modelengine.fit.jade.aipp.variable.updater");
2222

2323
/**

framework/elsa/fit-elsa-react/src/flow/jadeFlowGraph.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ import {parallelNodeState} from '@/components/parallelNode/parallelNodeState.jsx
6161
import {parallelComponent} from '@/components/parallelNode/parallelComponent.jsx';
6262
import {textConcatenateNodeState} from "@/components/textConcatenationNode/textConcatenateNodeState.jsx";
6363
import {textConcatenateNodeComponent} from "@/components/textConcatenationNode/textConcatenateNodeComponent.jsx";
64-
import {variableUpdateNodeState} from '@/components/variableUpdate/variableUpdateNodeState.jsx';
65-
import {variableUpdateComponent} from '@/components/variableUpdate/variableUpdateComponent.jsx';
64+
import {variableUpdaterNodeState} from '@/components/variableUpdater/variableUpdaterNodeState.jsx';
65+
import {variableUpdaterComponent} from '@/components/variableUpdater/variableUpdaterComponent.jsx';
6666
import {replyNodeState} from '@/components/replyNode/replyNodeState.jsx';
6767
import {replyNodeComponent} from '@/components/replyNode/replyNodeComponent.jsx';
6868

@@ -173,8 +173,8 @@ export const jadeFlowGraph = (div, title) => {
173173
self.registerPlugin('parallelComponent', parallelComponent);
174174
self.registerPlugin('textConcatenateNodeState', textConcatenateNodeState);
175175
self.registerPlugin('textConcatenateNodeComponent', textConcatenateNodeComponent);
176-
self.registerPlugin('variableUpdateNodeState', variableUpdateNodeState);
177-
self.registerPlugin('variableUpdateComponent', variableUpdateComponent);
176+
self.registerPlugin('variableUpdaterNodeState', variableUpdaterNodeState);
177+
self.registerPlugin('variableUpdaterComponent', variableUpdaterComponent);
178178
self.registerPlugin('replyNodeState', replyNodeState);
179179
self.registerPlugin('replyNodeComponent', replyNodeComponent);
180180
return initialize.apply(self);

0 commit comments

Comments
 (0)