diff --git a/services/web-ui/package.json b/services/web-ui/package.json index 6bb179fd0..71d6b9ac1 100644 --- a/services/web-ui/package.json +++ b/services/web-ui/package.json @@ -1,6 +1,6 @@ { "name": "web-ui", - "version": "0.4.2", + "version": "0.4.3", "private": true, "license": "Apache-2.0", "dependencies": { diff --git a/services/web-ui/src/action/components.js b/services/web-ui/src/action/components.js index e01de2d6c..baa6e0240 100644 --- a/services/web-ui/src/action/components.js +++ b/services/web-ui/src/action/components.js @@ -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({ diff --git a/services/web-ui/src/component/flows/detail-page/index.js b/services/web-ui/src/component/flows/detail-page/index.js index 8baa862cd..406c1cd93 100644 --- a/services/web-ui/src/component/flows/detail-page/index.js +++ b/services/web-ui/src/component/flows/detail-page/index.js @@ -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: '', @@ -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);