Remove automatic filling of node label and fallback on id
4 unresolved threads
4 unresolved threads
Follow-up of !387 (merged)
Since I added a test for this, I also rewritten most of the tests in nodes.cy.ts
. They can all be run in isolation.
Merge request reports
Activity
Filter activity
20 16 cy.get('.react-flow').contains('Always and forever...').should('be.visible'); 21 17 }); 22 18 19 it('fallbacks on id when there is no label', () => { 20 cy.findByRole('textbox', { name: 'Edit label' }).click().clear(); 21 22 cy.get('@node').within(() => { 23 cy.contains('taskSkeleton0'); 24 }); 25 }); 8 function DataNode(args: NodeProps) { 9 const nodeData = useNodeDataStore((state) => state.nodesData.get(args.id)); 10 assertNodeDataDefined(nodeData, args.id); 8 function DataNode(props: NodeProps) { 9 const nodeData = useNodeDataStore((state) => state.nodesData.get(props.id)); 10 assertNodeDataDefined(nodeData, props.id); 11 11 12 12 const uiProps = nodeData.ui_props; 13 13 14 14 return ( 15 15 <Node 16 id={args.id} 16 id={props.id} 17 17 type={nodeData.task_props.task_type} 18 label={nodeData.ewoks_props.label || ''} 18 label={nodeData.ewoks_props.label || props.id} 1 1 { 2 2 "graph": { 3 "id": "workflow2" 3 "id": "workflow2", 4 "label": "workflow2" By adding
graph.label
, I can now enable the test of !387 (merged).Of course, I plan to remove it once I removed the automatic filling of
graph.label
when loading/saving.
requested review from @bocciare
Sorry @bocciare , I went a bit overboard with the changes. I can break them down in separate commits if you find it hard to read.
Edited by Loic Hudermentioned in commit fe81f443
Please register or sign in to reply