File tree Expand file tree Collapse file tree 3 files changed +19
-3
lines changed
visual-programming-system/src
web-flow-executor/src/nodes Expand file tree Collapse file tree 3 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -1567,7 +1567,10 @@ export class Rect<T extends BaseNodeInfo> {
15671567 }
15681568 if ( this . nodeInfo ?. isGroup ) {
15691569 const groupOfInitiator = initiator ?. nodeInfo ?. groupId ;
1570- if ( groupOfInitiator && groupOfInitiator !== this . nodeComponent . id ) {
1570+ if (
1571+ ! groupOfInitiator ||
1572+ ( groupOfInitiator && groupOfInitiator !== this . nodeComponent . id )
1573+ ) {
15711574 this . nodeInfo ?. groupedNodeIds ?. forEach ( ( id ) => {
15721575 const groupedNode = this . canvasApp ?. elements . get ( id ) ;
15731576 if ( groupedNode && groupedNode . id !== initiator . id ) {
Original file line number Diff line number Diff line change @@ -245,7 +245,7 @@ export const importToCanvas = <T extends BaseNodeInfo>(
245245 } ) ;
246246 }
247247 } else {
248- nodeTask . createVisualNode (
248+ const createdNode = nodeTask . createVisualNode (
249249 canvasApp ,
250250 node . x ,
251251 node . y ,
@@ -258,6 +258,19 @@ export const importToCanvas = <T extends BaseNodeInfo>(
258258 node . nodeInfo ,
259259 getNodeTaskFactory
260260 ) ;
261+
262+ // TODO : find a better implementation for this
263+ // problem now is that the nodes should pass the above node.nodeInfo themselves
264+ // to the create canvasApp.createRect function call when creating the node ...
265+ // ... and then it is overwritten.. the below fixes this for now
266+ if (
267+ createdNode &&
268+ node . nodeInfo ?. isInGroup &&
269+ createdNode . nodeInfo
270+ ) {
271+ createdNode . nodeInfo . isInGroup = true ;
272+ createdNode . nodeInfo . groupId = node . nodeInfo . groupId ;
273+ }
261274 }
262275 }
263276 }
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ export const getGroup: NodeTaskFactory<NodeInfo> = (
4949 const wrapper = createElement (
5050 'div' ,
5151 {
52- class : `${ cssClasses . wrapperGroupCssClasses } bg-purple-500 ` ,
52+ class : `${ cssClasses . wrapperGroupCssClasses } bg-slate-700 ` ,
5353 } ,
5454 undefined
5555 ) as unknown as INodeComponent < NodeInfo > ;
You can’t perform that action at this time.
0 commit comments