cytoscape / cytoscape.js-compound-drag-and-drop

Compound node drag-and-drop UI for adding and removing children
MIT License
33 stars 16 forks source link

Fix/fake parents #22

Closed sashokbg closed 2 years ago

sashokbg commented 2 years ago

I have opened this PR in place of #17.

As you have suggested the library now detects automatically if a parent node is a "real node" and it prevents its deletion. To make this work I have added a class called "cdnd-fake-parent" for parents that can be removed.

I have also added E2E tests that prove it works.

You can run them with npm run test:e2e and check the generated report in test/reports

maxkfranz commented 2 years ago

I've reviewed the PR, and it looks great.

Before it's merged in, do you think it would make sense to use a class name like cdnd-new-parent to be consistent with the naming of newParentNode() in options?

https://github.com/cytoscape/cytoscape.js-compound-drag-and-drop#api

stale[bot] commented 2 years ago

This issue has been automatically marked as stale, because it has not had activity within the past 30 days. It will be closed if no further activity occurs within the next 30 days. If a feature request is important to you, please consider making a pull request. Thank you for your contributions.

sashokbg commented 2 years ago

Hello @maxkfranz I have updated the code to change the class to cdnd-new-parent and also rebased the branch with master.

sashokbg commented 2 years ago

Hello, I have documented the new class and also moved the callback description up. Sorry for the delay

maxkfranz commented 2 years ago

v1.1.0 released