4760: Update > Add File on a review request does not create a draft review request


What version are you running?


What's the URL of the page containing the problem?

/r/<review request id>

What steps will reproduce the problem?

  1. Open an already published review request.
  2. In the console, run the following commands:
  3. RB.PageManager.getPage().reviewRequest.draft.id (expected output: undefined)
  4. RB.PageManager.getPage().model.reviewRequestEditor.get('hasDraft') (expected output: false)
  5. Select Update > Add File
  6. Choose a file and upload
  7. Once the page refreshes, run the commands again:
  8. RB.PageManager.getPage().reviewRequest.draft.id (expected output: defined (some id), observed output: undefined)
  9. RB.PageManager.getPage().model.reviewRequestEditor.get('hasDraft') (expected output: true)

In contrast, try uploading a file with the drag-and-drop method and notice that all commands will return the expected output.

What is the expected output? What do you see instead?

See steps above for expected output at each step. The main change is that after uploading a file, we expect RB.PageManager.getPage().reviewRequest.draft.id to be defined, but currently it is undefined (see attached files for expected and observed output).

What operating system are you using? What browser?

macOS 10.13.6, Chrome Version 69

Please provide any additional information below.

Suggested fix:
- Remove the reload in views/uploadAttachmentView.js.
- _onUploadFileClicked in reviewRequestEditorView would need to pass the this.model in as something like reviewRequestEditor when constructing the RB.UploadAttachmentView. That view would then need to store that and, in send(), call this.reviewRequestEditor.createFileAttachment instead of this.options.reviewRequest.createFileAttachment.
- Close the 'Add file' dialog.

#1 shoven

I will work on this.

#2 david

Fixed in release-4.0.x (e56c8f7). This will ship in 4.0. Thanks!

  • -New