4760: Update > Add File on a review request does not create a draft review request
- Fixed
- Review Board
shoven | |
What version are you running?
4.0.x
What's the URL of the page containing the problem?
/r/<review request id>
What steps will reproduce the problem?
- Open an already published review request.
- In the console, run the following commands:
- RB.PageManager.getPage().reviewRequest.draft.id (expected output: undefined)
- RB.PageManager.getPage().model.reviewRequestEditor.get('hasDraft') (expected output: false)
- Select Update > Add File
- Choose a file and upload
- Once the page refreshes, run the commands again:
- RB.PageManager.getPage().reviewRequest.draft.id (expected output: defined (some id), observed output: undefined)
- 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 inviews/uploadAttachmentView.js
.
-_onUploadFileClicked
inreviewRequestEditorView
would need to pass thethis.model
in as something likereviewRequestEditor
when constructing theRB.UploadAttachmentView
. That view would then need to store that and, insend()
, callthis.reviewRequestEditor.createFileAttachment
instead ofthis.options.reviewRequest.createFileAttachment
.
- Close the 'Add file' dialog.