-
-
-
reviewboard/htdocs/media/rb/js/datastore.js (Diff revision 1) I know this mimics the code above...and isn't very DRY...but uuber-generalizing ScreenshotComments and DiffViewer Comments didn't seem much easier. :/
-
reviewboard/htdocs/media/rb/js/datastore.js (Diff revision 1) This was a bug I discovered that prevented comment dialogs from closing when pressing "Cancel".
-
reviewboard/htdocs/media/rb/js/reviews.js (Diff revision 1) This wraps up Comments with issues on the Review Details pages.
-
reviewboard/htdocs/media/rb/js/reviews.js (Diff revision 1) And this wraps up comments viewed inline in either the diff or screenshot viewers.
-
reviewboard/htdocs/media/rb/js/reviews.js (Diff revision 1) This creates the look of the issue DIV's.
-
reviewboard/htdocs/media/rb/js/reviews.js (Diff revision 1) And these are the buttons and button functions. Only viewable/usable by the review request submitter.
-
reviewboard/reviews/models.py (Diff revision 1) I chose @staticmethod, because it didn't make sense to me to give this function to each instance - rather, it belongs to the class itself.
-
reviewboard/reviews/models.py (Diff revision 1) More repetition - same reason as before though: generalizing Diffviewer/Screenshot Comment seemed too difficult. But I'll go for it if this is too much repetition.
-
reviewboard/reviews/templatetags/reviewtags.py (Diff revision 1) For these two...passed them because I couldn't find a better way of "figuring" them out in the Javascript. Is there a better way?
Add basic issue tracking to DiffComments and ScreenshotComments
Review Request #1718 — Created July 23, 2010 and submitted
The patch does the following: -Adds an issue_opened and issue_status field in both Comment (for Diffs) and ScreenshotComment. -Adds a BaseComment resource for DiffComment and ScreenshotComment resources to inherit from, which allows for changing Issue status -Adds a checkbox to the comment dialog to open an issue -Adds UI for displaying (and for review request submitters, manipulating) Issue statuses.
Added some WebAPI tests to check issue_opened/status logic. All tests pass.
Change Summary:
I've adjusted permissions so that issues can only be modified when a review request is open (as opposed to submitted or discarded).
Change Summary:
I've rebased this off of master, since the webapi webui changes have been merged in.
Description: |
|
||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Branch: |
|
||||||||||||||||||||||||||||||||||||||||||
Diff: |
Revision 3 (+646 -39)
|
-
Forgot to mention - the code for this is up on my Github: https://github.com/mikeconley/reviewboard.git in the issue_tracking branch.
-
-
reviewboard/diffviewer/models.py (Diff revision 3) Is this relevant to the change? It may require an evolution.
-
reviewboard/htdocs/media/rb/js/reviews.js (Diff revision 3) Can you add documentation for this function?
-
reviewboard/htdocs/media/rb/js/reviews.js (Diff revision 3) Shouldn't need 'this.' for the functions, I don't think.
-
reviewboard/htdocs/media/rb/js/reviews.js (Diff revision 3) Should also have docs. Same with the other functions.
-
-
-
-
-
reviewboard/htdocs/media/rb/js/reviews.js (Diff revision 3) Rather than using "open", "resolved", and "dropped" everywhere in the code, I'd prefer some constants we can reference. They can even just map to these strings, but that ways there's no risk of typos.
-
-
reviewboard/htdocs/media/rb/js/reviews.js (Diff revision 3) Can you add a default: that does some assertion check or something?
-
reviewboard/htdocs/media/rb/js/reviews.js (Diff revision 3) Space after if. I'd expect that you could just check gEditable instead of window['gEditable'], but maybe not?
-
-
-
reviewboard/htdocs/media/rb/js/reviews.js (Diff revision 3) Can you set the value using attr()? That'll make it easier to do localization later.
-
reviewboard/htdocs/media/rb/js/reviews.js (Diff revision 3) The .appendTo() and .hide() should each be on their own line. Same with the functions below.
-
-
-
reviewboard/htdocs/media/rb/js/reviews.js (Diff revision 3) Nothing outside of datastore.js should know about the actual API paths or make calls. This should all call into datastore objects.
-
-
reviewboard/htdocs/media/rb/js/reviews.js (Diff revision 3) You can remove the extra spaces before the =, since it's separated from the ones above and has more going on.
-
-
reviewboard/htdocs/media/rb/js/reviews.js (Diff revision 3) You can move the .appendTo to the statement above.
-
reviewboard/reviews/evolutions/__init__.py (Diff revision 3) These can be combined into one evolution. We generally want one evolution per set of changes in a commit, per-app.
-
reviewboard/reviews/models.py (Diff revision 3) Rather than having UNDEFINED, can we just allow issue_status to be blank and have null be undefined? It's nicer in the admin UI too.
-
reviewboard/reviews/models.py (Diff revision 3) Since this is multi-line, can we have each attribute on its own line?
-
reviewboard/reviews/models.py (Diff revision 3) Same here. Actually, given that we have all these statuses duplicated, it might be nice to have a simple CommentStatuses class that contained these values, the ISSUE_STATUSES array, and the *_to_* functions.
-
-
reviewboard/reviews/templatetags/reviewtags.py (Diff revision 3) When referring to an id, you should use pk. This lets the primary key field change (which, in practice, likely will never happen, but it's good to follow the pattern).
-
reviewboard/reviews/templatetags/reviewtags.py (Diff revision 3) Rather than this, can you import that resource and access its name_plural attribute?
-
reviewboard/reviews/templatetags/reviewtags.py (Diff revision 3) We're doing all this basically twice. Can we factor this part of it all out? Would be a good opportunity to also factor out the other common attributes between this and commentcounts.
-
-
-
-
reviewboard/reviews/templatetags/reviewtags.py (Diff revision 3) Blank line between these. Also, same as above with the resource.name_plural.
-
reviewboard/templates/reviews/comments_dlg.html (Diff revision 3) Instead of value="True", you should be doing: checked="checked".
-
reviewboard/templates/reviews/review_reply_section.html (Diff revision 3) This whole thing should be in the form of: $('<div/>') .reviewDetailIssue({ ... }) .issueUI() .appendTo(...);
-
-
reviewboard/webapi/resources.py (Diff revision 3) This should have a fields = {} to document the fields provided. So, before going into this too much, I'm not sure I understand yet why we need another resource for it. Can you go into the reason for a new resource instead of making this part of the comment resources?
-
-
reviewboard/webapi/resources.py (Diff revision 3) This should have documentation and decorators. Need @webapi_check_login_required and @webapi_check_local_site at least.
-
-
reviewboard/webapi/resources.py (Diff revision 3) Also need @webapi_login_required and @webapi_check_local_site, at least.
-
-
-
reviewboard/webapi/resources.py (Diff revision 3) Alignment issues. Also, should use (...) instead of \
-
reviewboard/webapi/resources.py (Diff revision 3) Requiring this will break API backward compatibility. Instead, make it optional, and then give it a default value in the argument list for the function.
-
-
reviewboard/webapi/resources.py (Diff revision 3) Does this mean if a diff comment does have an issue opened, we can never change it? Do we want that?
-
reviewboard/webapi/resources.py (Diff revision 3) You can stick issue_opened in the arg list for the function.
-
-
-
Change Summary:
This is a work-in-progress, but I wanted some early feedback, as this is a pretty radical departure from my last version of this patch. Instead of creating a new issue resource, I have a BaseCommentResource and a BaseComment model. ScreenshotComments and DiffComments now inherit from the BaseComment abstract class, and similarly the ScreenshotComment and DiffComment resources inherit from the BaseCommentResource. The BaseCommentResource takes care of the logic for updating issue statuses. The front end code got gutted as well. We're less cluttered now, and the review detail issue UI is in a template now, as opposed to generated on-the-fly via Javascript. Inline issue UI is still done via Javascript, and needs a little polish. I'm less interested in style/formatting feedback, and more interested in architectural input - but really, all feedback is welcome. Thanks!
Diff: |
Revision 4 (+532 -49)
|
---|
Change Summary:
Just updating the description a little.
Description: |
|
---|
-
I'd like you to make some visual changes here, mostly to tone down the look. I have specific comments for each type, but as a general comment I'd like these to be formatted in one line with a common baseline: [Icon] Text [Command] [Command]
-
I'd like the background color for this to be a light grey (just a bit different from the white of the page). The icon also doesn't make much sense to me; perhaps a grey X?
-
For this one, I'd like the background color to be orange or pink, with a thin red border--we want this to stand out a lot. I'd also like to change the text to "This is an open issue" and change the icon to a warning triangle--something that looks like !? (/!\).
-
Change Summary:
Updated the CSS to go with David's suggestions, and added some screenshots. Note that I've updated the screenshots, but not the diff. Diff comes soon.
Screenshots: |
|
---|
Change Summary:
- CSS has been updated to match the screenshots - Displaying the issue buttons now depends on whether or not the user is the submitter of the review request - Users that update the status of an issue no longer get the update notification (since they themselves performed the update) Again, I'm looking primarily for architectural feedback. Thanks!
Diff: |
Revision 5 (+543 -49)
|
---|
-
-
-
-
-
-
-
reviewboard/htdocs/media/rb/js/reviews.js (Diff revision 5) Doing this 3 times like this is bad for performance due to how DOM insertion works in jquery. It's better to build it all at once and then append: buttons.append( '<input type="button" class="issue-button resolve" value="Fixed" />' + '<input type="button" class="issue-button drop" value="Drop" />' + '<input type="button" class="issue-button reopen" value="Reopen" />'); In fact, it could include the divs as well.
-
-
-
-
reviewboard/webapi/resources.py (Diff revision 5) Since you have blank=True null=True on the model, you should be able to assign None here.
-
Change Summary:
Thanks for the review David - I haven't made all of your changes in this revision, but I'll get to them. The reason I'm posting this patch is that I've hit a little wall with the webapi tests, and need some advice. With this patch, running the webapi tests returns the following: http://www.pastie.org/1859245 This is the first of many tests that error out - all involving DiffComments and ScreenshotComments. This is the part that confuses me: "IntegrityError: reviews_screenshotcomment.issue_opened may not be NULL" I've made it explicit, however, that the default value for issue_opened is False, on line 1157 of reviews/models.py. And this is after nuking and rebuilding my SQLite database. What's going on? Why isn't the default value taking? I don't see how it's different from the other boolean model fields with defaults... Any advice highly appreciated! Thanks!
Diff: |
Revision 6 (+626 -49)
|
---|
-
-
reviewboard/webapi/resources.py (Diff revision 6) I mentioned this in IRC, but I'll get it here too. Your problem in the pastie comes from here--issue_opened is an optional parameter and is getting filled in with None (see djblets/webapi/decorators.py:190 for where that None is coming from). You then pass issue_opened=None into the model ctor below, which Django interprets as null. There are a couple potential solutions, but the easiest is probably issue_opened=bool(issue_opened) inside the ctor call.
Change Summary:
Ok, I think this is almost ready. I've applied David's suggestions, and I've added a few tests to the webapi app to check the issue_opened/issue_status logic. This code is available on my issue_tracking branch here: git://github.com/mikeconley/reviewboard.git
Testing Done: |
|
||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 7 (+909 -55)
|
||||||||||||||||||
Screenshots: |
|