Users with no editing ability on a review request should not see issue buttons on inline comments

Review Request #2419 — Created June 23, 2011 and submitted

Information

Review Board
master

Reviewers

I noticed that after I'd created a review with some issues, when I went and viewed my comments in the diff viewer, the buttons for dropping / fixing the issues were visible to me, even though I was not the review requester.

This patch fixes that bug, as well as putting the issue status message in the inline comments.  Not sure how that one slipped by.
Manual testing.
Description From Last Updated

Indentation is wrong.

chipx86chipx86

We don't deal with scoping issues, so no need for self anymore.

chipx86chipx86

You can return this.

chipx86chipx86

First line of a comment should be blank. So: /* * Wraps an ... */

chipx86chipx86

Doesn't look like self is needed, since we never deal with scoping issues from callbacks. You can just use this …

chipx86chipx86

Can just use this.

chipx86chipx86
mike_conley
chipx86
  1. 
      
  2. reviewboard/htdocs/media/rb/js/reviews.js (Diff revision 1)
     
     
     
     
     
     
    should we even be rendering/creating the buttons in the case where the current user shouldn't see them? Rather than hiding after?
  3. reviewboard/htdocs/media/rb/js/reviews.js (Diff revision 1)
     
     
     
    Show all issues
    Indentation is wrong.
  4. 
      
chipx86
  1. 
      
  2. Show all issues
    We don't deal with scoping issues, so no need for self anymore.
  3. Show all issues
    You can return this.
  4. Show all issues
    First line of a comment should be blank. So:
    
    /*
     * Wraps an ...
     */
  5. reviewboard/htdocs/media/rb/js/reviews.js (Diff revision 2)
     
     
     
    Show all issues
    Doesn't look like self is needed, since we never deal with scoping issues from callbacks. You can just use this below.
  6. Show all issues
    Can just use this.
  7. reviewboard/htdocs/media/rb/js/reviews.js (Diff revision 2)
     
     
     
    Is this actually replacing issue with some new element? If not, we can just do issue.issueButtons().
  8. reviewboard/htdocs/media/rb/js/reviews.js (Diff revision 2)
     
     
     
     
    Same question here. Though, in this case, I don't see where issue is even used anymore. So I think we can remove the assignment.
  9. 
      
mike_conley
Review request changed

Change Summary:

Thanks for the review - updated with style changes.

While I was patching this, I also noticed that the issue state for an inline comment wasn't being persisted on closing and re-opening the comment window, so I've fixed that by registering a simple callback with the issue manager.

Diff:

Revision 3 (+38 -8)

Show changes

david
  1. Ship It!
  2. 
      
Loading...