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