Patch to Add "Move" Functionality to Web Interface #1579

Closed
opened 2011-11-10 08:16:39 +00:00 by marcusw · 11 comments
marcusw commented 2011-11-10 08:16:39 +00:00
Owner

I made a patch to add a move button to the directory listing of the web interface. It's used to move a file/dir inside a dir to a different dir contained in that dir. I have not written unit tests yet but they should be ready in a few days. This patch applies cleanly to both the 1.9.0 release (use patch -p1) and to the latest git (5fc99788269c350479b6ac51009d2725035ce0c5).

I have tested it in practical usage and found it to work quite well and handle errors gracefully.

Possible future improvements include the ability to move to a dircap URI outside of the current directory, but I will have to figure out how to convert a URI into a working DirectoryNode in a deferrer-friendly way before I can do this.

EDIT: Looks like I can't get the upload file thing to work. Here's a pastebin of the patch.

I made a patch to add a move button to the directory listing of the web interface. It's used to move a file/dir inside a dir to a different dir contained in that dir. I have not written unit tests yet but they should be ready in a few days. This patch applies cleanly to both the 1.9.0 release (use patch -p1) and to the latest git (5fc99788269c350479b6ac51009d2725035ce0c5). I have tested it in practical usage and found it to work quite well and handle errors gracefully. Possible future improvements include the ability to move to a dircap URI outside of the current directory, but I will have to figure out how to convert a URI into a working [DirectoryNode](wiki/DirectoryNode) in a deferrer-friendly way before I can do this. EDIT: Looks like I can't get the upload file thing to work. [Here](https://pastee.org/rqrdj)'s a pastebin of the patch.
tahoe-lafs added the
code-frontend-web
minor
enhancement
n/a
labels 2011-11-10 08:16:39 +00:00
tahoe-lafs added this to the soon milestone 2011-11-10 08:16:39 +00:00
marcusw commented 2011-11-11 01:43:04 +00:00
Author
Owner

Added unit tests. Updated patch is here. Currently working on arbitrary URI targets and copy-only (an option to skip deleting the original link).

Added unit tests. Updated patch is [here](https://pastee.org/53vmr). Currently working on arbitrary URI targets and copy-only (an option to skip deleting the original link).
marcusw commented 2011-11-11 05:02:04 +00:00
Author
Owner

Finished arbitrary URI targets and unit tests for that feature. Updated patch. Decided to nix copy-only due to code complexity and lack of usefulness. Thanks for #tahoe-lafs for helping me out when I got suck! I'm done for now.

Finished arbitrary URI targets and unit tests for that feature. [Updated patch](https://pastee.org/pze4w). Decided to nix copy-only due to code complexity and lack of usefulness. Thanks for #tahoe-lafs for helping me out when I got suck! I'm done for now.
marcusw commented 2011-11-12 07:46:27 +00:00
Author
Owner

Wrote documentation for the new webapi function and stuck it in docs/frontends/webapi.rst. Patch

Wrote documentation for the new webapi function and stuck it in docs/frontends/webapi.rst. [Patch](https://pastee.org/9prv)
marcusw commented 2011-11-17 02:06:55 +00:00
Author
Owner

Attachment movebutton.diff (20607 bytes) added

"Final" complete patch including tests, docs, and the actual code.

**Attachment** movebutton.diff (20607 bytes) added "Final" complete patch including tests, docs, and the actual code.
marcusw commented 2011-11-17 02:08:08 +00:00
Author
Owner

The latest version of this patch should be looked for at the git branch.

The latest version of this patch should be looked for at the [git branch](https://github.com/marcuswanner/tahoe-lafs/commits/movebutton).

Assigning to ChosenOne for review.

Assigning to ChosenOne for review.

I am now reviewing this ticket.

I am now reviewing this ticket.
nejucomo was unassigned by zooko 2012-03-30 20:48:28 +00:00
zancas was assigned by zooko 2012-03-30 20:48:28 +00:00
tahoe-lafs added
normal
1.9.1
and removed
minor
n/a
labels 2012-04-01 04:29:38 +00:00
tahoe-lafs modified the milestone from soon to 1.10.0 2012-04-01 04:29:38 +00:00

I have reviewed this patch. It adds a 'move' operation to the Directory web view.

  • Both directories and files can be moved (from a mutable directory to a mutable directory).
  • By default, the semantic is similar to 'mv -f' in that a the destination name will be overwritten if it exists, although a '?replace=false' option is provided.
  • Attempts to move an object to a nonexistent or not-writeable directory will return 410 Gone.
  • Destination directories can be indicated by URI or by pathname
  • Slashes in the destination name aren't permitted, though they're accepted for source

The move operation (dirnode.py) is a symlink followed a copy followed (on success) by an unlink, so the only possible race condition would result in two instances of the file. This behavior seems safe and isn't at all specific to the web interface anyway.

Straightforward tests are provided for all of the failure cases (except the interrupted-move described above, which is OK).

Minor note: a meme was applied incorrectly for the name of a nonexistent directory - 'notchucktesta' should be 'nopechecktesta'

I have reviewed this patch. It adds a 'move' operation to the Directory web view. - Both directories and files can be moved (from a mutable directory to a mutable directory). - By default, the semantic is similar to 'mv -f' in that a the destination name will be overwritten if it exists, although a '?replace=false' option is provided. - Attempts to move an object to a nonexistent or not-writeable directory will return 410 Gone. - Destination directories can be indicated by URI or by pathname - Slashes in the destination name aren't permitted, though they're accepted for source The move operation (dirnode.py) is a symlink followed a copy followed (on success) by an unlink, so the only possible race condition would result in two instances of the file. This behavior seems safe and isn't at all specific to the web interface anyway. Straightforward tests are provided for all of the failure cases (except the interrupted-move described above, which is OK). Minor note: a meme was applied incorrectly for the name of a nonexistent directory - 'notchucktesta' should be 'nopechecktesta'
Brian Warner <warner@lothar.com> commented 2012-05-09 23:33:22 +00:00
Author
Owner

In changeset:b29d0920d380c066:

Adding 'move' button to web UI, closes #1579

This adds "move file" capability to the web UI's directory display. The
support and test framework is heavily based on the similar "rename file"
feature. Unit tests and documentation are included. Multiple in-progress
versions of this patch may be found in ticket 1579. This version
includes arbitrary URI target support and is compatible with the change
from tahoe_css to tahoe.css.
In changeset:b29d0920d380c066: ``` Adding 'move' button to web UI, closes #1579 This adds "move file" capability to the web UI's directory display. The support and test framework is heavily based on the similar "rename file" feature. Unit tests and documentation are included. Multiple in-progress versions of this patch may be found in ticket 1579. This version includes arbitrary URI target support and is compatible with the change from tahoe_css to tahoe.css. ```
tahoe-lafs added the
fixed
label 2012-05-09 23:33:22 +00:00

I just landed this in changeset:841757, along with a few improvements. The only user-visible one was to merge the "move" page with the existing "rename" page, putting both forms next to each other, and changing the wording/layout to make it more clear what's getting moved where.

I just landed this in changeset:841757, along with a few improvements. The only user-visible one was to merge the "move" page with the existing "rename" page, putting both forms next to each other, and changing the wording/layout to make it more clear what's getting moved where.

We might want to change the API before releasing this feature.. I've opened #1732 about it.

We might want to change the API before releasing this feature.. I've opened #1732 about it.
Sign in to join this conversation.
No Milestone
No Assignees
5 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Reference: tahoe-lafs/trac-2024-07-25#1579
No description provided.