Put common graph saving behaviour in a function to remove label filling
Merged
Put common graph saving behaviour in a function to remove label filling
workflow-save
into
main
6 unresolved threads
6 unresolved threads
Each time a graph must be saved as an Ewoks workflow, the same process must be done:
- Curate node/link data to remove default values/unspecified values
- Enrich the react-flow nodes/links with the curated data
-
Deal with special nodes: graph inputs/outputs (
calcEwoksGraphProp
), note nodescalcNoteNodes
- Convert the enriched nodes/links in ewoks nodes/links
This process was inconsistently done depending on the saving method (download, saving to server through the dialog, saving to server without dialog).
In this MR, I introduce a method prepareEwoksGraph
that takes care of all this process and is called whatever the saving method. This notably allows me to remove the fallback of label
to id
, putting the finishing touch to the test in !387 (merged).
Edited by Loic Huder
Merge request reports
Activity
Filter activity
added 1 commit
- a5456c9a - Put common graph saving behaviour in a function to remove label filling
added 1 commit
- 723944a0 - Put common graph saving behaviour in a function to remove label filling
93 83 return; 94 84 } 95 85 96 // DOC: Remove empty lines if any in DataMapping, Conditions, DefaultValues 97 86 try { 98 const newNodesData = curateNodeData(getNodesData()); 99 const newEdgesData = curateEdgeData(getEdgesData()); 100 setNodesData(newNodesData); 101 setEdgesData(newEdgesData); 22 22 return <SubgraphStack />; 23 23 } 24 24 25 return ( 26 <span data-cy={displayedWorkflowInfo.label}> 27 {displayedWorkflowInfo.label || displayedWorkflowInfo.id} 28 </span> 29 ); 25 const { id, label = id } = displayedWorkflowInfo; 26 return <span data-cy={label}>{label}</span>; changed this line in version 4 of the diff
- Resolved by Axel Bocciarelli
99 graph: displayedWorkflowInfo, 100 nodes: getNodes().map((nod) => { 101 return { ...nod, data: getNodesData().get(nod.id) as EwoksRFNodeData }; 102 }), 103 links: getEdges().map((edge) => { 104 return { 105 ...edge, 106 data: getEdgesData().get(edge.id) as EwoksRFLinkData, 107 }; 108 }), 109 }; 110 setSelection(newSelection); 111 setTitle(newSelection === 'ewoks' ? 'Ewoks Graph' : 'RF Graph'); 112 setGraph(newSelection === 'ewoks' ? rfToEwoks(graphRf) : graphRf); 113 setIsOpen(true); 114 }; 58 edgesWithoutData: Edge[], 59 rawNodeData: Map<string, EwoksRFNodeData>, 60 rawLinkData: Map<string, EwoksRFLinkData> 61 ): GraphEwoks { 62 const nodeData = curateNodeData(rawNodeData); 63 const nodes = nodesWithoutData.map((node) => enrichWithData(node, nodeData)); 64 65 const linkData = curateEdgeData(rawLinkData); 66 const links = edgesWithoutData.map((edge) => enrichWithData(edge, linkData)); 67 68 let graph = calcEwoksGraphProp({ graph: graphInfo, nodes, links }); 69 const noteNodes = calcNoteNodes(nodes); 70 const uiprops = 71 noteNodes.length > 0 72 ? { ...graph.uiProps, notes: noteNodes } 73 : graph.uiProps; requested review from @bocciare
added 8 commits
-
723944a0...9bc26229 - 7 commits from branch
main
- d8607a63 - Put common graph saving behaviour in a function to remove label filling
-
723944a0...9bc26229 - 7 commits from branch
enabled an automatic merge when the pipeline for d8607a63 succeeds
mentioned in commit c33631c7
Please register or sign in to reply