•  
     
    story #12456 Cut/Copy/paste items
Summary
Empty
Cut/Copy/paste items
Empty
  • Copying or cutting a document stores it in a way that is persisted after a page refresh and shared between browser tabs
  • On dropdowns, if user has a document currently cut/copied then its name is displayed under the paste action (see live mockup)
    For example: given I'm copying file.txt, then in dropdown option, there will be
    Paste
    |__ file.txt
  • The paste action is disabled by front end opportunistically, if can determine the document can not be pasted the paste action is disabled with a info message. Potential cases where the paste is disabled:
    • same name
    • folder into itself or descendant
    • ...
  • If a user tries to cut and paste an item in a folder but another item has already the same name in it, pasting is not allowed (i.e. the same rule than the creation applies)
  • If a user tries to copy and paste an item in a folder but another item has already the same name in it, the document name is prefixed by "Copy of"
  • As of today, when we copy/cut/paste a document, we are redirected to an intermediate page that allows the user to choose the position of item. This page is not needed anymore (because item order is Folders first, then lexicographic).
  • cut adds an entry in the document history (as of today)
Empty
Status
Empty
Done
Development
  • [ ] Does it involves User Interface? 
  • [ ] Are there any mockups?
  • [ ] Are permissions checked?
  • [ ] Does it need Javascript development?
  • [ ] Does it need a forge upgrade bucket?
  • [ ] Does it need to execute things in system events?
  • [ ] Does it impact project creation (templates)?
  • [ ] Is it exploratory?

The Copy/Paste action is represented as a single POST /docman_folders/{id}/{type} call:

{
  "copy": {
    "item_id": 
  }
}

For each route, you either pass the usual creation representation or this "copy from" representation.

 

The Cut/Paste action is represented as a single PATCH /docman_{type}/{id} call:

{
  "move": {
    "item_id": 
  }
}
Details
#12456
Marie Ange Garnier (marieange)
2019-07-24 14:30
2018-10-26 15:54
4146

References
Referencing story #12456

Git commit

tuleap/tuleap/stable

Embedded files can be copied via the REST API 7e45d8ccd2
Folders can be copied via the REST API c79ef927f5
Copy of document is rejected when a file is being uploaded with the title in the destination folder 897b19567a
All document manager items can be copied via the REST API 18525357d4
Keep only one way to verify that the REST routes operate on a item of the expected type 7a6a73bf9a
Creation of a folder via the REST route should not check for ongoing file uploads 49bfaef77f
Embedded documents can be moved between folders via the REST API 11f71f0fc4
Item can be copied from the document UI 56c8a67b4d
Folders can be moved between folders via the REST API a86768e687
All types of documents can be moved between folders via the REST API 87f976bf26
Display some information about the content of clipboard in the header 5c05d7d0cf
Action menu is closed when the user clicks on the Copy/Paste actions 3988182055
Replace event management based on CustomEvents by a Vue-based event bus 868b76795c
Items can be moved from the document UI 0f9693c7ee
No notification when the item is created outside the viewport df3ea241a9
Persist document clipboard between page refreshes 7d2aa61bae
Modals does not open when the user is on the embedded document view 8dcf05a71a
Share clipboard mutations cross-tabs 1079da2b4d
Update information message when an item is being pasted 7db39afd66
Cut/copy/paste actions are available in document UI bd71060ca1

Follow-ups

User avatar
Thomas Gerbet (tgerbet)2019-07-17 14:25
Updating AC: the cut/move operation should be possible even if the document is locked (as of the current document manager UI).

  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
Thomas Gerbet (tgerbet)2019-07-09 10:37
Updating AC to let users duplicate documents in the same folder.

  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
Thomas Gerbet (tgerbet)2019-07-01 11:21
Updating AC and technical info.

  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
  • Attachments Image Pasted at 2019-7-1 11-07.png added
  • Technical informations
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes