Refine general comments support

Review Request #7764 — Created Nov. 9, 2015 and submitted — Latest diff uploaded

Information

Review Board
master

Reviewers

This patch adds the finishing touches to support for general comments
-- that is, comments unattached from a file attachment, diff, etc. --
on reviews.

A button has been added to the review dialog to add a general comment.
These comments can be deleted with the delete comment icon that is
present with all other comments. JavaScript unit tests have been added
to test the deletion functionality.

A button has been added to the draft review banner to add a general
comment. This comment can only be deleted from within the review
dialog.

The include_text_types fields have been removed from the
BaseCommentResource because it requires special parsing. They were
added, but their type was incorrect. The field expects a
comma-separated list of the text types, not a single text type. This
broke the ability to comment has so has been reverted. A unit test has
been added to ensure this behaviour does not regress.

Calls to _no_access_error in the ReviewGeneralCommentResource and
ReviewReplyGeneralCommentResource have been corrected to
get_no_access_error, as the former method does not exist.

  • Ran unit tests.
  • Ran JS tests.
  • Added comments from both the banner and the dialog.
  • Deleted comments from the dialog.
reviewboard/static/rb/css/common.less
reviewboard/static/rb/js/pages/views/reviewablePageView.js
reviewboard/static/rb/js/resources/models/reviewModel.js
reviewboard/static/rb/js/views/draftReviewBannerView.js
reviewboard/static/rb/js/views/reviewDialogView.js
reviewboard/static/rb/js/views/tests/reviewDialogViewTests.js
reviewboard/templates/reviews/reviewable_base.html
reviewboard/webapi/mixins.py
reviewboard/webapi/resources/base_comment.py
reviewboard/webapi/resources/review_general_comment.py
reviewboard/webapi/resources/review_reply_general_comment.py
reviewboard/webapi/tests/mixins_comment.py
Loading...