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

server/perkeepd/ui: Drag-and-drop upload files and directories #1264

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

omarchehab98
Copy link
Contributor

Summary:

Re-implement drag-and-drop handler to upload files and optionally support directories if browser implements webkitGetAsEntry on DataTransferItem.

Test Plan:

Case A) Directory

  1. Drag and drop a directory
  2. Perkeep should receive all files, even deeply nested ones

Case B) Files

  1. Drag and drop a selection of many files
  2. Perkeep should receive all files

Case C) Other elements

  1. Drag and drop non-file and non-directory elements such as an HTML image
  2. Nothing should happen

Closes: #54 #657

@googlebot googlebot added the cla: yes Author has submitted the Google CLA. label Jun 13, 2019
Summary:

Re-implement drag-and-drop handler to upload files and optionally support directories if browser implements `webkitGetAsEntry` on `DataTransferItem`.

Test Plan:

Case A) Directory

1. Drag and drop a directory
2. Perkeep should receive all files, even deeply nested ones

Case B) Files

1. Drag and drop a selection of many files
2. Perkeep should receive all files

Case C) Other elements

1. Drag and drop non-file and non-directory elements such as an HTML image
2. Nothing should happen

Closes: perkeep#54 perkeep#657
@omarchehab98
Copy link
Contributor Author

omarchehab98 commented Jun 15, 2019

In the second commit, I added abort handlers to server connection methods so that we can implement cancel functionality in the upload dialog. I should have made this it's own pull request tbh, I'll rebase it onto master and remove it from this PR

@omarchehab98
Copy link
Contributor Author

@bradfitz @mpl could someone please review this?

@mpl
Copy link
Contributor

mpl commented Jun 24, 2019

I've just had a quick try, and I see that this PR "flattens" all the directories hierarchy, i.e. it uploads each file as the camliContent of a stand-alone permanode. it's good, but I don't remember what we said last time we discussed it (if we ever), so I'm not sure this is what we want as the default behaviour.

I can see at least 2 other alternatives:

  1. we'd still have a permanode per file, but we'd keep the hierarchy through sets, i.e. each directory would be represented by a set (a permanode with a camliMember attribute).
  2. we do not create a permanode per file. we faithfully create files and directories schemas, just as things were on the host.

So I think we need to discuss that on the referenced issue before moving forward with that PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Author has submitted the Google CLA. waitingforreply
Projects
None yet
Development

Successfully merging this pull request may close these issues.

drag-and-drop directories in the web UI
4 participants