Skip to content

Commit 434cbf8

Browse files
Merge pull request #1392 from openintegrationhub/basaas/flows-ui
Adjust components
2 parents 0e62671 + 524916e commit 434cbf8

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

services/web-ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "web-ui",
3-
"version": "0.4.2",
3+
"version": "0.4.3",
44
"private": true,
55
"license": "Apache-2.0",
66
"dependencies": {

services/web-ui/src/action/components.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@ export const UPDATE_COMPONENT_ERROR = 'UPDATE_COMPONENT_ERROR';
1212
export const CREATE_COMPONENT = 'CREATE_COMPONENT';
1313
export const DELETE_COMPONENT = 'DELETE_COMPONENT';
1414

15-
export const getComponents = () => async (dispatch) => {
15+
export const getComponents = (pageSize) => async (dispatch) => {
1616
try {
1717
const result = await axios({
1818
method: 'get',
1919
url: `${conf.endpoints.component}/components`,
2020
withCredentials: true,
21+
...(pageSize ? { params: { 'page[size]': pageSize } } : {}),
2122
});
2223

2324
dispatch({

services/web-ui/src/component/flows/detail-page/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ class FlowDetails extends React.PureComponent {
141141
constructor(props) {
142142
super(props);
143143
props.getFlows();
144-
props.getComponents();
144+
props.getComponents(100);
145145
props.getSecrets();
146146
this.state = {
147147
position: '',
@@ -592,7 +592,10 @@ class FlowDetails extends React.PureComponent {
592592
const newEdge = { ...edge, target: this.state.editNodeName };
593593

594594
const { nodes } = this.state.flow.graph;
595-
const { edges } = this.state.flow.graph;
595+
let { edges } = this.state.flow.graph;
596+
if (edges.length === 1 && !edges[0].hasOwnProperty('target')) {
597+
edges = [];
598+
}
596599
const indexNode = nodes.findIndex((item) => item.id === selNode.id);
597600
const newNodes = nodes.filter((item) => item.id !== selNode.id);
598601
newNodes.splice(indexNode, 0, node);

0 commit comments

Comments
 (0)