Refactor RB.UploadAttachmentView to extend RB.DialogView

Review Request #10884 — Created Feb. 5, 2020 and submitted — Latest diff uploaded

Information

Review Board
release-3.0.x
4a89476...

Reviewers

This review request refactors RB.UploadAttachmentView to extend RB.DialogView
as opposed to calling the RB.DialogView constructor and modalBox directly.
The change involves extending the RB.DialogView prototype for initialization,
rendering, and events with the necessary properties in RB.UploadAttachmentView.
RB.UploadAttachmentView also uses the button map provided by RB.DialogView to
render its upload and cancel buttons, removing the need to create DOM nodes for
them directly in the class.

The 'path' id is also removed and replaced with a 'js-path' class to reduce the
chance of conflicting elements.

  • dialogView unit tests still pass

Manual testing:
- opening the dialog, uploading a file, and submitting it (without editing the caption)
- opening the dialog, uploading a file, editing the caption, and submitting it
- opening the dialog, editing the caption, uploading a file, and submitting it
- opening the dialog, uploading a file, then cancelling the dialog
- opening the dialog, editing the caption, then cancelling the dialog
- opening the dialog, then cancelling the dialog without uploading anything
- verified the 'Upload' button is disabled unless a file is actually uploaded

    Loading...