Remove edition/cloning from the Node component
4 unresolved threads
4 unresolved threads
Fix #101 (closed), fix #116 (closed) and fix #117 (closed)
Edited by Loic Huder
Merge request reports
Activity
Filter activity
68 const [nodeSize, setNodeSize] = useState(nodeWidth); 69 45 const inExecutionMode = useStore((state) => state.inExecutionMode); 70 46 const graphInfo = useStore((state) => state.graphInfo); 71 47 const setOpenSnackbar = useStore((state) => state.setOpenSnackbar); 72 const selectedElement = useSelectedElement(); 73 const [edit, setEdit] = useState(false); 74 const [labelLocal, setLabelLocal] = useState(label); 75 const [detailsL, setDetailsL] = useState(false); 76 77 const setNodeData = useNodeDataStore((state) => state.setNodeData); 78 79 useEffect(() => { 80 setNodeSize(nodeWidth); 81 setLabelLocal(label); 82 setDetailsL(details || false); 83 }, [nodeWidth, label, details, detailsL]); 217 (edit ? ( 218 <TextField 219 label="edit node Label" 220 multiline 221 maxRows={4} 222 value={labelLocal} 223 onChange={labelChanged} 224 variant="standard" 225 /> 226 ) : ( 227 <div style={customTitle as React.CSSProperties}>{labelLocal}</div> 228 ))} 229 {!withLabel && !withImage && ( 230 <div style={customTitle as React.CSSProperties}> 231 {label.slice(0, 1)} 232 </div> Moved this in its own component. Not too happy with the
showFull
/showCropped
API so if you have a better idea...For the record, here is the desired behaviour:
withImage
withLabel
Result true true Show image and label false true Show only the label true false Show only the image false false Show a cropped label
339 arrow 340 placement="top" 341 > 342 <IconButton 343 aria-label="exit edit mode" 344 onClick={() => { 345 setEdit(false); 346 setNodeLabel(); 347 }} 348 > 349 <SaveIcon color="primary" /> 350 </IconButton> 351 </Tooltip> 352 )} */} 353 </> 354 )} requested review from @bocciare
mentioned in commit 3b203645
Please register or sign in to reply