Refactor RB.UploadAttachmentView to extend RB.DialogView
Review Request #10884 — Created Feb. 5, 2020 and submitted — Latest diff uploaded
This review request refactors
RB.UploadAttachmentViewto extendRB.DialogView
as opposed to calling theRB.DialogViewconstructor andmodalBoxdirectly.
The change involves extending theRB.DialogViewprototype for initialization,
rendering, and events with the necessary properties inRB.UploadAttachmentView.
RB.UploadAttachmentViewalso uses the button map provided byRB.DialogViewto
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