Create draft review request for Update > Add File

Review Request #1455 — Created Nov. 13, 2018 and updated

guest7691
Review Board
e56c8f7...
smith
When a user adds a file through drag and drop, it creates a draft review
request, as expected. However, when a user adds a file through the menu option
Update > Add File, there is no draft review request created.

This bug fix addresses this issue by removing the window reload when the user
uploads a file and uses `reviewRequestEditor.createFileAttachment` instead of
`reviewRequest.createFileAttachment` to create a draft review and closing the
"Add File" dialog manually.

Testing Done:
Ran JS tests (all of which pass).

Tested behaviour in Chrome and Firefox by first running through the following
steps with the drag-and-drop file upload (which was expected to work, as a
baseline) and then running through the steps again by uploading a file with the
`Update > Add File` option:

1. Open an already published review request.
2. In the console, run the following commands:
   - `RB.PageManager.getPage().reviewRequest.draft.id` (expected & observed
     output: undefined)
   - `RB.PageManager.getPage().model.reviewRequestEditor.get('hasDraft')`
     (expected & observed output: false)
3. Upload file (with drag-and-drop or `Update > Add File` method)
4. Observe the file attachment in the `Files` section of the review
   request and the appearance of the draft review banner. Run the commands
   again:
   - `RB.PageManager.getPage().reviewRequest.draft.id` (expected & observed
     output: defined (some id))
   - `RB.PageManager.getPage().model.reviewRequestEditor.get('hasDraft')`
     (expected output: true)

Bugs closed: 4760

Reviewed at https://reviews.reviewboard.org/r/10262/


  • 0
  • 0
  • 0
  • 1
  • 1
Description From Last Updated
Loading...