salgum1114/react-design-editor

WorkflowEditor Copy&Paste location initialization issue

Closed this issue · 5 comments

Hello.

Could you see what you left an issue related to WorkflowEditor besides Cavas?.. There are two things I posted last time..
If you have time, please review.

The issue we found this time is that the left and top positions are initialized when Copy&Paste is done? There is a problem.

Broadcast----Broadcast (2 nodes and 1 link) is reproduced by copying and pasting.

As a result of hard debugging, it is related to the EventHandler.ts part.

public paste = (e: ClipboardEvent) => {
    const activeSelection = new fabric.ActiveSelection(nodes.length? nodes: targets, {
        canvas: this.handler.canvas,
        ...this.handler.activeSelection,
    });
}

Commenting out this part is fine.
I tried to fix it, but I don't know...
Ask for help.. help...

{
	"nodes": [
		{
			"id": "db422c03-f6ae-46b7-b55a-6794636fab16",
			"name": "Broadcast",
			"description": "",
			"nodeClazz": "BroadcastNode",
			"configuration": {
				"outputCount": 1
			},
			"properties": {
				"left": 220,
				"top": 120,
				"icon": ""
			}
		},
		{
			"id": "b08d6f06-e437-4d98-b9ce-42f5f598c60f",
			"name": "Broadcast",
			"description": "",
			"nodeClazz": "BroadcastNode",
			"configuration": {
				"outputCount": 0
			},
			"properties": {
				"left": 220,
				"top": 200,
				"icon": ""
			}
		},
		{
			"id": "dd39bc50-77ad-478f-9950-49dcf9ff2f5e",
			"name": "Broadcast",
			"description": "",
			"nodeClazz": "BroadcastNode",
			"configuration": {
				"outputCount": 1
			},
			"properties": {
				"left": -100,
				"top": -60,
				"icon": ""
			}
		},
		{
			"id": "32a228c9-1012-457d-a2d2-8e0cf4ab86b2",
			"name": "Broadcast",
			"description": "",
			"nodeClazz": "BroadcastNode",
			"configuration": {
				"outputCount": 0
			},
			"properties": {
				"left": -100,
				"top": 20,
				"icon": ""
			}
		}
	],
	"links": [
		{
			"fromNode": "db422c03-f6ae-46b7-b55a-6794636fab16",
			"fromPort": "defaultFromPort",
			"toNode": "b08d6f06-e437-4d98-b9ce-42f5f598c60f",
			"properties": {
				"left": 320,
				"top": 180
			}
		},
		{
			"fromNode": "dd39bc50-77ad-478f-9950-49dcf9ff2f5e",
			"fromPort": "defaultFromPort",
			"toNode": "32a228c9-1012-457d-a2d2-8e0cf4ab86b2",
			"properties": {
				"left": 340,
				"top": 200
			}
		}
	],
	"properties": {
		"viewportTransform": [
			1,
			0,
			0,
			1,
			0,
			0
		]
	}
}

Hi, @heesangbb

Sorry but I don't know what the error you are referring to. Please attach a screenshot or a GIF.

rde_issue_199

Thank you for responding.

@heesangbb

Thanks, i'll check it.

Hi, @heesangbb

Fixed from #200.

Thank you!!
I pull the update and applied it, and it works very well.