diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d8cdd31..550eb1a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # 1.0.0 --installs on--> 2.4 IDE-EE / 3.1 IDE-CE - +- [FP-2542 - Removed code that prevented flow validations from running](https://movai.atlassian.net/browse/FP-2542) - [FP-2540 - Duplicated code on the new merge request](https://movai.atlassian.net/browse/FP-2540) - [FP-2530 - Added ParameterWithType for instances that need to save the type](https://movai.atlassian.net/browse/FP-2530) - [FP-2359 - Added a way for the BaseApp keybinds to work](https://movai.atlassian.net/browse/FP-2359) diff --git a/src/editors/Flow/view/Core/Graph/GraphBase.js b/src/editors/Flow/view/Core/Graph/GraphBase.js index 4570d929..47f78c7f 100644 --- a/src/editors/Flow/view/Core/Graph/GraphBase.js +++ b/src/editors/Flow/view/Core/Graph/GraphBase.js @@ -607,8 +607,7 @@ export default class GraphBase { // is this a subflow node? const [first, ...rest] = nodeName.split("__"); - if (first !== this.mInterface.id) - throw new Error("GraphBase.updateNodeStatus: update for other flow? " + first); + if (first !== this.mInterface.id) return; if (rest.length) for (let i = 0; i < rest.length; i++) { diff --git a/src/editors/Flow/view/Flow.jsx b/src/editors/Flow/view/Flow.jsx index a74ce443..ff5faa30 100644 --- a/src/editors/Flow/view/Flow.jsx +++ b/src/editors/Flow/view/Flow.jsx @@ -95,7 +95,7 @@ export const Flow = (props, ref) => { const [runningFlow, setRunningFlow] = useState(""); const [warnings, setWarnings] = useState([]); const [flowDebugging, setFlowDebugging] = useState(); - const [warningsVisibility, setWarningsVisibility] = useState(false); + const [warningsVisibility, setWarningsVisibility] = useState(true); const [viewMode, setViewMode] = useState(FLOW_VIEW_MODE.default); const [tooltipConfig, setTooltipConfig] = useState(null); const [contextMenuOptions, setContextMenuOptions] = useState(null); @@ -158,11 +158,11 @@ export const Flow = (props, ref) => { */ const startNode = useCallback( node => { - commandNode("RUN", node, robotSelected).then(() => { + commandNode("RUN", node).then(() => { node.statusLoading = true; }); }, - [robotSelected, commandNode] + [commandNode] ); /** @@ -171,11 +171,11 @@ export const Flow = (props, ref) => { */ const stopNode = useCallback( node => { - commandNode("KILL", node, robotSelected).then(() => { + commandNode("KILL", node).then(() => { node.statusLoading = true; }); }, - [robotSelected, commandNode] + [commandNode] ); /** @@ -486,7 +486,7 @@ export const Flow = (props, ref) => { ) }; }, - [MENUS, call, id, instance, openDoc, getMenuComponent, t] + [call, id, instance, openDoc, getMenuComponent, t] ); /** @@ -530,7 +530,7 @@ export const Flow = (props, ref) => { ) }; }, - [MENUS, call, id, instance, t] + [call, id, instance, t] ); /** @@ -608,7 +608,6 @@ export const Flow = (props, ref) => { activeBookmark ); }, [ - MENUS, id, name, instance, @@ -683,17 +682,6 @@ export const Flow = (props, ref) => { * */ //======================================================================================== - /** - * On flow validation - * @param {*} validationWarnings - */ - const onFlowValidated = validationWarnings => { - const persistentWarns = validationWarnings.warnings.filter( - el => el.isPersistent - ); - setWarnings(persistentWarns); - }; - /** * Remove Node Bookmark and set selectedNode to null */ @@ -705,7 +693,7 @@ export const Flow = (props, ref) => { MENUS.current.DETAIL.NAME ); selectedNodeRef.current = null; - }, [MENUS, call, selectedNodeRef]); + }, [call, selectedNodeRef]); /** * On Node Selected @@ -729,7 +717,7 @@ export const Flow = (props, ref) => { } }, 300); }, - [MENUS, addNodeMenu, unselectNode, onLinkSelected] + [addNodeMenu, unselectNode, onLinkSelected] ); /** @@ -831,15 +819,13 @@ export const Flow = (props, ref) => { ); // Subscribe to flow validations - interfaceSubscriptionsList.current.push( - mainInterface.graph.onFlowValidated.subscribe(evtData => { - const persistentWarns = evtData.warnings.filter( - el => el.isPersistent - ); + mainInterface.graph.onFlowValidated.subscribe(evtData => { + const persistentWarns = evtData.warnings.filter( + el => el.isPersistent + ); - onFlowValidated({ warnings: persistentWarns }); - }) - ); + setWarnings(persistentWarns); + }); mainInterface.onLoad = () => setLoading(false); diff --git a/src/editors/Flow/view/Views/BaseFlow.jsx b/src/editors/Flow/view/Views/BaseFlow.jsx index 598389dc..880cb080 100644 --- a/src/editors/Flow/view/Views/BaseFlow.jsx +++ b/src/editors/Flow/view/Views/BaseFlow.jsx @@ -103,7 +103,7 @@ const BaseFlow = props => { )} -
+
{warnings.length > 0 && ( )}