Allow comments to be deleted from review dialog
Review Request #7744 — Created Oct. 28, 2015 and submitted
The review dialog now displays a delete icon next to all deletable
comments (diff comments and attachment comments, currently). Previously,
the only way to delete a comment was to delete it from the review UI
where it was created. However, with general comments coming soon, there
was no review UI to manage them and delete them. Hence, it makes sense
for all deletable comments to be deletable from within the review
dialog.JS Unit tests have been added for deletion of diff comments, attachment
comments, and screenshot comments.This patch also contains some minor JS cleanups:
-RB.BaseResourceModel.ready
now ensures itssuccess
anderror
options are functions before bdinging them.
- Replaced a binding ofself = this
and calling a function by binding
said function to the correct context.
- Cleaned up some assignments inRB.BaseResourceModel._finishDestroy
so that it only does oneset()
call instead of several.
- Ran JS tests.
- Deleted attachment comments and diff comments from the review dialog.
It worked as expected. - Manually verified that the deletion confirmation works in both cases.
Description | From | Last Updated |
---|---|---|
The order of things is weird here. Can we put the pencil first? We may also want to make the … |
david | |
I suspect this should not be within the <label> element. |
david | |
How about: this._commentViews = _.without(this._commentViews, view); |
david | |
This variable isn't used anymore. |
david |
-
This should have some confirmation before deleting.
-
The order of things is weird here. Can we put the pencil first?
We may also want to make the trash can slightly less tall, and try to align the baselines better.
-
reviewboard/static/rb/js/views/reviewDialogView.js (Diff revision 1) I suspect this should not be within the
<label>
element. -
reviewboard/static/rb/js/views/reviewDialogView.js (Diff revision 1) How about:
this._commentViews = _.without(this._commentViews, view);
-
Tool: PEP8 Style Checker Ignored Files: reviewboard/static/rb/js/views/reviewDialogView.js reviewboard/static/rb/css/pages/reviews.less reviewboard/static/rb/js/resources/models/baseResourceModel.js Tool: Pyflakes Ignored Files: reviewboard/static/rb/js/views/reviewDialogView.js reviewboard/static/rb/css/pages/reviews.less reviewboard/static/rb/js/resources/models/baseResourceModel.js
Change Summary:
Add unit tests
Description: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Testing Done: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
Diff: |
Revision 3 (+172 -22) |
-
Tool: Pyflakes Ignored Files: reviewboard/static/rb/js/views/reviewDialogView.js reviewboard/static/rb/css/pages/reviews.less reviewboard/static/rb/js/views/tests/reviewDialogViewTests.js reviewboard/static/rb/js/resources/models/baseResourceModel.js Tool: PEP8 Style Checker Ignored Files: reviewboard/static/rb/js/views/reviewDialogView.js reviewboard/static/rb/css/pages/reviews.less reviewboard/static/rb/js/views/tests/reviewDialogViewTests.js reviewboard/static/rb/js/resources/models/baseResourceModel.js
-
Tool: Pyflakes Ignored Files: reviewboard/static/rb/js/views/reviewDialogView.js reviewboard/static/rb/css/pages/reviews.less reviewboard/static/rb/js/views/tests/reviewDialogViewTests.js reviewboard/static/rb/js/resources/models/baseResourceModel.js Tool: PEP8 Style Checker Ignored Files: reviewboard/static/rb/js/views/reviewDialogView.js reviewboard/static/rb/css/pages/reviews.less reviewboard/static/rb/js/views/tests/reviewDialogViewTests.js reviewboard/static/rb/js/resources/models/baseResourceModel.js
-
-
reviewboard/static/rb/js/views/reviewDialogView.js (Diff revision 4) This variable isn't used anymore.