-
-
-
I know this mimics the code above...and isn't very DRY...but uuber-generalizing ScreenshotComments and DiffViewer Comments didn't seem much easier. :/
-
-
-
-
-
And these are the buttons and button functions. Only viewable/usable by the review request submitter.
-
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.
-
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.
-
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).
- Diff:
-
Revision 2 (+630 -37)
- Change Summary:
-
I've rebased this off of master, since the webapi webui changes have been merged in.
- Description:
-
- This patch is dependent upon webapi-resource-webui (http://github.com/chipx86/reviewboard/tree/webapi-resources-webui)
- The patch does the following:
-Adds an issue_opened and issue_status field in both Comment (for Diffs) and ScreenshotComment. -Adds an Issue resource to both diff Comment's and ScreenshotComment's, 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. Screenshots display most of what I've done.
~ I'm not the best graphical designer in the world, so I'm totally open to feedback and suggestions on the UI. Hell, I'm open to feedback on the entire thing.
~ There's another feature I want to put in afterwards that lists all of the issues on a particular review request, but I'd like to solidify how the issues themselves work before I start on that. So that's what this review request is all about.
+ + I'm not the best graphical designer in the world, so I'm totally open to feedback and suggestions on the UI. Hell, I'm open to feedback on the entire thing. Questions are OK too.
- Branch:
-
webapi-resource-webuimaster
- 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.
-
-
-
-
-
-
-
-
-
-
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.
-
-
-
Space after if. I'd expect that you could just check gEditable instead of window['gEditable'], but maybe not?
-
-
-
-
-
-
-
Nothing outside of datastore.js should know about the actual API paths or make calls. This should all call into datastore objects.
-
-
You can remove the extra spaces before the =, since it's separated from the ones above and has more going on.
-
-
-
These can be combined into one evolution. We generally want one evolution per set of changes in a commit, per-app.
-
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.
-
-
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.
-
-
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).
-
-
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.
-
-
-
-
-
-
This whole thing should be in the form of: $('<div/>') .reviewDetailIssue({ ... }) .issueUI() .appendTo(...);
-
-
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?
-
-
This should have documentation and decorators. Need @webapi_check_login_required and @webapi_check_local_site at least.
-
-
-
-
-
-
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.
-
-
Does this mean if a diff comment does have an issue opened, we can never change it? Do we want that?
-
-
-
-
- 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:
-
The patch does the following:
-Adds an issue_opened and issue_status field in both Comment (for Diffs) and ScreenshotComment. ~ -Adds an Issue resource to both diff Comment's and ScreenshotComment's, which allows for changing Issue status ~ -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. - - Screenshots display most of what I've done.
- - There's another feature I want to put in afterwards that lists all of the issues on a particular review request, but I'd like to solidify how the issues themselves work before I start on that. So that's what this review request is all about.
- - I'm not the best graphical designer in the world, so I'm totally open to feedback and suggestions on the UI. Hell, I'm open to feedback on the entire thing. Questions are OK too.
-
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:
-
Comment dialog inline - issue droppedComment dialog inline - issue openedComment dialog inline - issue resolvedReview details - issue droppedReview details - issue openedReview details - issue resolvedIssue dropped - review detailIssue opened - inlineIssue resolved - inlineIssue dropped - inlineIssue opened - review detailIssue resolved - review detail
- 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)
-
-
-
-
-
-
-
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.
-
-
-
-
-
- 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)
-
-
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:
-
~ Manual. Tests for the Issue resources are forthcoming.
~ Added some WebAPI tests to check issue_opened/status logic. All tests pass.
- Diff:
-
Revision 7 (+909 -55)
- Screenshots:
-
Issue opened - inlineIssue opened - review detailIssue opened - review detailIssue opened - inline