Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: duplicate node / new node from existing #312

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

thefennecdeer
Copy link

I've added two new ways to duplicate nodes, based on #203. Now, from any locals.xml, you can click "Add node based on existing" and select any node visible to that nodehost.

This will grab that node's files from the node/REST/files endpoint, and recursively downloads it to a temp folder, and renaming it to the final name upon every file completion. I cannibalized the unused "Packages.java" to make a HTTP file downloader.

For quick duplication (within the same nodehost), you can go to any node and click the "duplicate" button within the 'functions' dropdown.

3
4

Also! First pull request!

@justparking
Copy link
Contributor

Hey @thefennecdeer - I've been on holiday for 2 weeks and noticed this while I was away. This pull-request looks very exciting! I look forward to checking it out.

I'll give it a whirl soon and touch base again once I get settled into things again.

@thefennecdeer
Copy link
Author

Hey @thefennecdeer - I've been on holiday for 2 weeks and noticed this while I was away. This pull-request looks very exciting! I look forward to checking it out.

I'll give it a whirl soon and touch base again once I get settled into things again.

No worries! I'd also like to pick your brain about #233 (comment)

I think an option is to simply have a collapsed textboxes where the context of the clipboard can be pasted. I wouldn't even both about code formatting, simply a place to dump text.

In an earlier iteration, I played with the idea of having the text editor appear in the duplicate-modal for naming the duplicate node - the idea being it copies the node to a temp folder, and then you can continue editing the temp soon-to-be node files safely, but that felt a bit like feature creep when you could just edit it after making the node.

what workflow do you imagine would feel the best?

@scroix
Copy link
Member

scroix commented Apr 19, 2024

Hey @thefennecdeer super happy to see your feature.

I was just wondering whether this feature could be implemented purely on the frontend? Essentially, just using existing utilities made available by the API to achieve the same result without providing new and explicit methods to service the feature in the backend?

@justparking, you know the API better than anyone, any ideas?

@thefennecdeer
Copy link
Author

I think it's possible, through having the client reclusively read a nodes files (/REST/files + /REST/files/contents?path={filename}), and them pass the contents of each file to the new node (/REST/files/save?path={filename}).
I opted to go with backend methods as I was a bit worried about making the user's browser handle a bunch of files like that, but I'll give it a shot and see how it goes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants