Skip to content

Commit

Permalink
Merge pull request #1392 from openintegrationhub/basaas/flows-ui
Browse files Browse the repository at this point in the history
Adjust components
  • Loading branch information
JusupAchmerzaevBasaas authored Feb 8, 2022
2 parents 0e62671 + 524916e commit 434cbf8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion services/web-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "web-ui",
"version": "0.4.2",
"version": "0.4.3",
"private": true,
"license": "Apache-2.0",
"dependencies": {
Expand Down
3 changes: 2 additions & 1 deletion services/web-ui/src/action/components.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ export const UPDATE_COMPONENT_ERROR = 'UPDATE_COMPONENT_ERROR';
export const CREATE_COMPONENT = 'CREATE_COMPONENT';
export const DELETE_COMPONENT = 'DELETE_COMPONENT';

export const getComponents = () => async (dispatch) => {
export const getComponents = (pageSize) => async (dispatch) => {
try {
const result = await axios({
method: 'get',
url: `${conf.endpoints.component}/components`,
withCredentials: true,
...(pageSize ? { params: { 'page[size]': pageSize } } : {}),
});

dispatch({
Expand Down
7 changes: 5 additions & 2 deletions services/web-ui/src/component/flows/detail-page/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class FlowDetails extends React.PureComponent {
constructor(props) {
super(props);
props.getFlows();
props.getComponents();
props.getComponents(100);
props.getSecrets();
this.state = {
position: '',
Expand Down Expand Up @@ -592,7 +592,10 @@ class FlowDetails extends React.PureComponent {
const newEdge = { ...edge, target: this.state.editNodeName };

const { nodes } = this.state.flow.graph;
const { edges } = this.state.flow.graph;
let { edges } = this.state.flow.graph;
if (edges.length === 1 && !edges[0].hasOwnProperty('target')) {
edges = [];
}
const indexNode = nodes.findIndex((item) => item.id === selNode.id);
const newNodes = nodes.filter((item) => item.id !== selNode.id);
newNodes.splice(indexNode, 0, node);
Expand Down

0 comments on commit 434cbf8

Please sign in to comment.