-
-
reviewboard/accounts/evolutions/profile_enable_desktop_notifications.py (Diff revision 1) Col: 80 E501 line too long (90 > 79 characters)
-
reviewboard/accounts/forms/pages.py (Diff revision 1) Col: 80 E501 line too long (86 > 79 characters)
-
-
reviewboard/accounts/forms/pages.py (Diff revision 1) Col: 80 E501 line too long (101 > 79 characters)
-
Enable Desktop Notifications
Review Request #7660 — Created Sept. 25, 2015 and submitted
This task created a desktop notification to send to users when an update has been made to a review request. This involved adding a JSON column to the user profile called settings to represent user settings such as their preference on recieving desktop notifications. Users can enable or disable the desktop notifications using an option in the account setting form.
Tested on Chrome, Firefox, Internet Explorer and Safari.
Test Cases
1. Notifications enabled both in permissions and in account settings, and browser supported
expected: notification is shows
2. Notifications enabled in permissions but not in account settings, and browser supported
expected: updates bubble displayed
3. Notifications disabled in permissions but enabled in account settings, and browser supported
expected: updates bubble displayed
4. Notifications not supported by browser (Internet Explorer)
expected: updates bubble displayedThe JS Unit tests were also run during the testing for this task.
Description | From | Last Updated |
---|---|---|
Col: 80 E501 line too long (90 > 79 characters) |
![]() |
|
Col: 80 E501 line too long (86 > 79 characters) |
![]() |
|
Col: 72 W291 trailing whitespace |
![]() |
|
Col: 80 E501 line too long (101 > 79 characters) |
![]() |
|
Col: 80 E501 line too long (89 > 79 characters) |
![]() |
|
Col: 80 E501 line too long (90 > 79 characters) |
![]() |
|
Col: 80 E501 line too long (86 > 79 characters) |
![]() |
|
Col: 72 W291 trailing whitespace |
![]() |
|
Col: 80 E501 line too long (101 > 79 characters) |
![]() |
|
Col: 80 E501 line too long (89 > 79 characters) |
![]() |
|
Missing semicolon. |
|
|
Needs doc comment. |
|
|
Single quotes. |
|
|
We can do this in initialize() and then set e.g., this._shouldUseDesktopNotifications so we only have to do it once. |
|
|
No blank line here. |
|
|
No blank line here. |
|
|
We try not to go over 80 characters. We should use gettext() for the string with a %s-interpolation e.g. (gettext("Review … |
|
|
This should be a constant on the object. |
|
|
No blank line here. |
|
|
Single quotes. |
|
|
Can we reformat this as follows: 'enable_desktop_notifications': self.profile.settings.get( 'enable_desktop_notifications', True), If not, can we pull this out into a variable … |
|
|
Col: 45 E502 the backslash is redundant between brackets |
![]() |
|
Col: 17 E131 continuation line unaligned for hanging indent |
![]() |
|
Col: 80 E501 line too long (80 > 79 characters) |
![]() |
|
This should go with the first var statement at the beginning, e.g. var x = ..., y = ...; Also, … |
|
|
This conditional should be wrapped in parentheses. |
|
|
There should be a space between ) and {. |
|
|
This expression should be wrapped in parentheses. Also, the second and third conditions need to be indented four spaces, not … |
|
|
This will overwrite window.Notification. Can we set this as a method on the object? |
|
|
Blank line between statement and beginning of block. |
|
|
Update this docstring to refer to the fact that it also can use web notifications. |
|
|
Can you document the arguments to this function? We document them like: /* * ... * * Args: * info … |
|
|
receive |
|
|
Missing space between ) and { |
|
|
Missing a period. Also, can you document the args as above? |
|
|
Missing a period. Also, can you document the args as above? |
|
|
So this overrides window.Notification again. We should use a method on the object. We should only check for it once … |
|
|
This checking should be done in receiveNotification. |
|
|
These need to be declared at the top of the function. |
|
|
Missing a space between ) and { |
|
|
You can use _.delay(_.bind(...), ...) |
|
|
This should be formatted as: } else if (Notification.permission === 'denied' || Notificaiton.permission === 'default') { Also, this can be … |
|
|
We don't enforce line ending limits for HTML templates. This can be written as enableDesktopNotifications: {{user_profile.settings.enable_desktop_notifications|yesno:'true,false'}} |
|
|
Needs a trailing comma. This is to prevent having to modify this line later when adding a new line. |
|
|
This is missing: from __future__ import unicode_literals which must appear before the other imports, with a blank line in-between. |
|
|
Needs a trailing comma. |
|
|
Should be "Show desktop notifications ..." |
|
|
This should use the property you defined above (self.profile.should_enable_desktop_notifications) |
|
|
This should reuse the convenience function provided on the profile, so that we don't have two places determining a default … |
|
|
"Return", not "Get". "Get" implies that the function is going to get something from somewhere. "Return" implies it's going to … |
|
|
This also needs a "Returns" block, like: Returns: bool: <description of the return value here> |
|
|
Because settings defaults to null, we need to check here that it's not None before calling .get() |
|
|
This should be formatted more like: this._shouldUseDesktopNotifications = ( 'Notification' in window && RB.UserSession.instance.get(....)); |
|
|
Probably you can skip the first half of this and just see if this._notificationType is undefined. |
|
|
So right now, we have all this code, and some code below, that deals with cross-browser setup and requests for … |
|
|
Can we align the || with the opening (? We also tend to put operators on the previous line. this._notificationType … |
|
|
These two checks could be combined into the same if statement. Also make sure there's a space before opening {s. |
|
|
First line of function docs should be a summary fitting on one line without wrapping. You can then expand on … |
|
|
Space between if and (. It might also be nice to switch the order of the conditional: if (this._shouldUseDesktopNotifications && … |
|
|
We always want to show the in-page bubble. If I get a popup on my screen, I need to be … |
|
|
Same as above. The first line should be a summary fitting on a single line. |
|
|
Same as above. |
|
|
This can be simplified using JavaScript's || operator: var username = info.user.fullname || info.user.username; |
|
|
We generally combine var definitions into a single statement: var username = ..., notificationText = ...; |
|
|
Extra trailing whitespace should be removed. |
|
|
Space between the , and { |
|
|
Please indent these two lines one more level. |
|
|
As I mention below, if you have a local var for this._notification you can skip the extra bind. |
|
|
This could be formatted much more nicely: _.delay( _.bind(function() { this._notification.close(); }, this), RB.ReviewablePageView.NOTIFICATION_LIFETIME_MSECS); Even better, if you keep a … |
|
|
Col: 44 W291 trailing whitespace |
![]() |
|
This should be indented 4 spaces. |
|
|
No parens needed. |
|
|
Col: 1 W293 blank line contains whitespace |
![]() |
|
Remove this whitespace. |
|
|
"the user's browser" |
CH chronicleyu | |
Reformat this as: this._canNotify = ( this.notificationType !== undefined && RB.UserSession.instance.get('...')); Also, missing a semi-colon and there is trailing whitespace. |
|
|
Capital 'F' for the false. |
CH chronicleyu | |
Unindent these. |
|
|
No blank line here. |
|
|
Unindent. |
|
|
You don't have to wrap notification.close() in a function, e.g.: _.delay(notification.close, RB.NotificationManager.NOTIFICATION_LIFETIME_MSECS); |
|
|
Col: 44 W291 trailing whitespace |
![]() |
|
Col: 1 W293 blank line contains whitespace |
![]() |
|
There's an extra ' in here. |
|
|
Should be a lower-case 'true' |
|
|
Actually, the way you had it before was correct (since this is JavaScript, not Python). However, this should end in … |
|
|
I don't think this works (since notification.close() will call immediately). However, you probably can do: _.delay(_.bind(notification.close, notification), RB.NotificationManager.NOTIFICATION_LIFETIME_MSECS); |
|
|
I think this should be _showUpdatesBubble |
|
|
Fix indentation |
|
|
Fix indentation |
|
|
This file uses tabs instead of spaces. We use 4 spaces for all our JS. |
|
|
Register |
|
|
Catch |
|
|
Create |
|
|
Show |
|
|
will create. |
|
|
Missing period. |
|
|
Remove this line. |
|
|
"Set up" |
|
|
Dedent by 4 |
|
|
Return. Missing period. |
|
|
"Send" The first sentence of a doccomment should be a single line. |
|
|
Missing period. |
|
|
Missing a period. Also doesnt tell us that the following list is a list of keys. |
|
|
Backquotes, not single quotes. |
|
|
"Create" First sentence of a doc comment should fit on a single line. Also, minor typos: ``RB.notificationManager.notifiy |
|
|
second line should be indented one more space |
|
|
should be indented one more space. |
|
|
backquotes, not single quotes. |
|
|
"Call" |
|
|
Call. shouldNotify. |
|
|
"Call". Needs args. |
|
|
"Return" Needs args. |
|
|
API |
|
|
"Otherwise," |
|
|
"then use their preference" "Otherwise," |
|
|
Missing a period. Also this should be: `:py:data:`True` |
|
|
No need for an else clause. We can just have return True. |
|
|
The bubble will always be displayed, no? |
|
|
Missing a period. |
|
|
"This function will handle the review updated ..." |
|
|
Missing a period. |
|
|
Missing period. |
|
|
Missing period. |
|
|
Missing period. |
|
|
Missing period. |
|
|
"This function will create ..." "notification" |
|
|
", then we will send" |
|
|
Missing period. |
|
|
"This function will tell. |
|
|
It, not This. |
|
|
``true`` |
|
|
"Otherwise, ``false`` will be returned. |
|
|
``title`` (``String``) Note the space. Also, missing a period. Capitalization of the. |
|
|
Same as above. |
|
|
Same as above. |
|
|
Same as above. |
|
|
Capitilizaiton and missing period. |
|
|
Same as above. |
|
|
Same as above. |
|
|
Same as above. |
|
|
See my comments in the other doc-comment. |
|
|
Capitilzation and missing period. |
|
|
Same as above. |
|
|
Same as above. |
|
|
Same as ahove. |
|
|
See my comments on the other doc comment. |
|
|
Col: 1 W293 blank line contains whitespace |
![]() |
|
This should be in sentence casing, like the other options. |
|
|
This can be: return (not self.settings or self.settings.get('enable_desktop_notifications', True)) |
|
|
The function name would be better as _onReviewRequestUpdated. |
|
|
The /* is indented one space too far. |
|
|
"and send", no "s". |
|
|
This isn't true anymore, right? We're always sending the bubble now. |
|
|
Blank line between these. |
|
|
No need to capitalize "Updates Bubble." |
|
|
Indentation is wonky here. Make sure you run jshint to catch these. |
|
|
"review request update," or just "update." |
|
|
I'm having a hard time parsing that sentence. I think it's the "used" bit and maybe "the notification." |
|
|
Indenation here and below all looks wrong, too. Go through everything and make sure every indentation level is an even … |
|
|
Most of this looks like stuff that could easily be inline in the call below. |
|
|
This should go into more detail on what this is responsible for, requirements, etc. |
|
|
The entire purpose of what this class does is express visual notifications based off data, so this by definition should … |
|
|
"for the user browser" doesn't make sense. "user's browser" ? |
|
|
Should be sentence casing. Also, this sentence is a bit confusing. I don't think there's a notification telling us about … |
|
|
Most of the stuff in here should be in initialize. Any variable state defaults should be there. The only thing … |
|
|
This should just be a constant on the model. |
|
|
4 space indentation on everything. |
|
|
Too many parens. They're not needed here. |
|
|
Indentation is off here as well. Same with ones below. Make sure to check every comment. |
|
|
Indentation is off here as well. |
|
|
Blank line between these. |
|
|
No backticks for the types. |
|
|
"URL String" isn't a type. It's just a String. |
|
|
the /* is indented one space too far. |
|
|
Blank line between each argument. |
|
|
Blank line between these. |
|
|
I'm not sure this is useful. This function is just taking positional arguments and turning it into an object of … |
|
|
Space before {. |
|
|
This is only needed by the prototype implementation above, so I'd move it there. Then, update call sites to use … |
|
|
We shouldn't have a copy of every single function, since those can all just access the instance. A wrapper function … |
|
|
The test suite needs a unit test for every function available to it, under every condition, simulating the ability to … |
|
|
Sentence casing. |
|
|
Col: 1 W293 blank line contains whitespace |
![]() |
|
Col: 13 E128 continuation line under-indented for visual indent |
![]() |
|
Col: 13 E128 continuation line under-indented for visual indent |
![]() |
|
I've been informed in my work that this should just be: ``True`` |
|
|
Remove this blank line. |
|
|
The indentation here is a little off. It should be: NOTIFICATION_TYPE: (window.Notification || window.mozNotification || window.webkitNotification) |
|
|
Single quotes. |
|
|
Single quotes. |
|
|
Can you move this function definition inline into the notify call? |
|
|
There is no var statement for this variable. |
|
|
I'd rather have this all inline: RB.Notificationmanager.instance.notify({ ... }); |
|
|
You don't need quotes around JS object keys. |
|
|
Undo this. |
|
|
Should be at top of function. |
|

Description: |
|
||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 2 (+87 -9) |

-
Tool: Pyflakes Processed Files: reviewboard/accounts/evolutions/profile_enable_desktop_notifications.py reviewboard/accounts/evolutions/__init__.py reviewboard/accounts/models.py reviewboard/accounts/forms/pages.py Ignored Files: reviewboard/templates/base.html reviewboard/static/rb/js/pages/views/reviewablePageView.js Tool: PEP8 Style Checker Processed Files: reviewboard/accounts/evolutions/profile_enable_desktop_notifications.py reviewboard/accounts/evolutions/__init__.py reviewboard/accounts/models.py reviewboard/accounts/forms/pages.py Ignored Files: reviewboard/templates/base.html reviewboard/static/rb/js/pages/views/reviewablePageView.js
-
reviewboard/accounts/evolutions/profile_enable_desktop_notifications.py (Diff revision 2) Col: 80 E501 line too long (90 > 79 characters)
-
reviewboard/accounts/forms/pages.py (Diff revision 2) Col: 80 E501 line too long (86 > 79 characters)
-
-
reviewboard/accounts/forms/pages.py (Diff revision 2) Col: 80 E501 line too long (101 > 79 characters)
-
Description: |
|
---|
-
-
-
-
-
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 2) We can do this in
initialize()
and then set e.g.,this._shouldUseDesktopNotifications
so we only have to do it once. -
-
-
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 2) We try not to go over 80 characters.
We should use
gettext()
for the string with a%s
-interpolatione.g. (
gettext("Review request submitted by %s", username)
)Also, can we rip out the ternary into its own variable to make the
new Notification
simpler? -
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 2) This should be a constant on the object.
-
-

-
Tool: Pyflakes Processed Files: reviewboard/accounts/evolutions/__init__.py reviewboard/accounts/forms/pages.py reviewboard/accounts/evolutions/profile_settings.py reviewboard/accounts/models.py Ignored Files: reviewboard/templates/base.html reviewboard/static/rb/js/pages/views/reviewablePageView.js Tool: PEP8 Style Checker Processed Files: reviewboard/accounts/evolutions/__init__.py reviewboard/accounts/forms/pages.py reviewboard/accounts/evolutions/profile_settings.py reviewboard/accounts/models.py Ignored Files: reviewboard/templates/base.html reviewboard/static/rb/js/pages/views/reviewablePageView.js
-
reviewboard/accounts/forms/pages.py (Diff revision 3) Col: 45 E502 the backslash is redundant between brackets
-
reviewboard/accounts/forms/pages.py (Diff revision 3) Col: 17 E131 continuation line unaligned for hanging indent
-
reviewboard/accounts/forms/pages.py (Diff revision 3) Col: 80 E501 line too long (80 > 79 characters)
Summary: |
|
|||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description: |
|
|||||||||||||||||||||||||||||||||
Testing Done: |
|
-
This looks really good! Most things are just style issues.
-
reviewboard/accounts/forms/pages.py (Diff revision 3) Can we reformat this as follows:
'enable_desktop_notifications': self.profile.settings.get( 'enable_desktop_notifications', True),
If not, can we pull this out into a variable first?
-
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 3) This should go with the first
var
statement at the beginning, e.g.var x = ..., y = ...;
Also, since
window
's scope is implicit in JS, the real notification (window.Notification
) can be accessed asNotification
anywhere. We should call this something else to avoid any confusion. -
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 3) This conditional should be wrapped in parentheses.
-
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 3) There should be a space between
)
and{
. -
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 3) This expression should be wrapped in parentheses.
Also, the second and third conditions need to be indented four spaces, not two.
-
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 3) This will overwrite
window.Notification
. Can we set this as a method on the object? -
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 3) Blank line between statement and beginning of block.
-
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 3) Update this docstring to refer to the fact that it also can use web notifications.
-
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 3) Can you document the arguments to this function?
We document them like:
/* * ... * * Args: * info (info's type): * A brief description of info */
Also this first line is indented by one extra space.
-
-
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 3) Missing space between
)
and{
-
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 3) Missing a period.
Also, can you document the args as above?
-
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 3) Missing a period. Also, can you document the args as above?
-
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 3) So this overrides
window.Notification
again. We should use a method on the object. We should only check for it once and store it.This expression should be wrapped in parentheses and the second & third lines need to be indented at 4 spaces each.
-
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 3) This checking should be done in
receiveNotification
. -
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 3) These need to be declared at the top of the function.
-
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 3) Missing a space between
)
and{
-
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 3) You can use
_.delay(_.bind(...), ...)
-
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 3) This should be formatted as:
} else if (Notification.permission === 'denied' || Notificaiton.permission === 'default') {
Also, this can be written as
Notification.permission !== 'granted'
. -
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 3) Should this be 5000? Isn't chrome 5s?
-
reviewboard/templates/base.html (Diff revision 3) We don't enforce line ending limits for HTML templates.
This can be written as
enableDesktopNotifications: {{user_profile.settings.enable_desktop_notifications|yesno:'true,false'}}

-
Tool: Pyflakes Processed Files: reviewboard/accounts/evolutions/__init__.py reviewboard/accounts/forms/pages.py reviewboard/accounts/evolutions/profile_settings.py reviewboard/accounts/models.py Ignored Files: reviewboard/templates/base.html reviewboard/static/rb/js/pages/views/reviewablePageView.js Tool: PEP8 Style Checker Processed Files: reviewboard/accounts/evolutions/__init__.py reviewboard/accounts/forms/pages.py reviewboard/accounts/evolutions/profile_settings.py reviewboard/accounts/models.py Ignored Files: reviewboard/templates/base.html reviewboard/static/rb/js/pages/views/reviewablePageView.js
-
-
reviewboard/accounts/forms/pages.py (Diff revision 4) This should use the property you defined above (
self.profile.should_enable_desktop_notifications
) -
reviewboard/accounts/models.py (Diff revision 4) Because
settings
defaults to null, we need to check here that it's notNone
before calling.get()
-
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 4) Probably you can skip the first half of this and just see if
this._notificationType
isundefined
. -
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 4) Can we align the || with the opening (? We also tend to put operators on the previous line.
this._notificationType = (window.Notification || window.mozNotification || window.webkitNotification)
-
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 4) These two checks could be combined into the same if statement. Also make sure there's a space before opening {s.
-
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 4) Space between
if
and(
.It might also be nice to switch the order of the conditional:
if (this._shouldUseDesktopNotifications && this._notificationType.permission === 'granted') { this._sendDesktopNotification(info); } else { this._sendUpdatesBubble(info); }
-
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 4) This can be simplified using JavaScript's || operator:
var username = info.user.fullname || info.user.username;
-
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 4) We generally combine
var
definitions into a single statement:var username = ..., notificationText = ...;
-
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 4) Space between the , and {
-
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 4) Please indent these two lines one more level.
-
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 4) As I mention below, if you have a local var for
this._notification
you can skip the extra bind. -
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 4) This could be formatted much more nicely:
_.delay( _.bind(function() { this._notification.close(); }, this), RB.ReviewablePageView.NOTIFICATION_LIFETIME_MSECS);
Even better, if you keep a local var that points to the same thing as
this._notification
, you can skip the bind entirely.
-
<p>I'm going to recommend an additional set of changes to the design here.</p>
<p>Right now, we have a bunch of new code in ReviewablePageView for figuring out the</p> -
reviewboard/accounts/evolutions/__init__.py (Diff revision 4) Needs a trailing comma. This is to prevent having to modify this line later when adding a new line.
-
reviewboard/accounts/evolutions/profile_settings.py (Diff revision 4) This is missing:
from __future__ import unicode_literals
which must appear before the other imports, with a blank line in-between.
-
-
-
reviewboard/accounts/forms/pages.py (Diff revision 4) This should reuse the convenience function provided on the profile, so that we don't have two places determining a default value.
-
reviewboard/accounts/models.py (Diff revision 4) "Return", not "Get".
"Get" implies that the function is going to get something from somewhere. "Return" implies it's going to return a value.
-
reviewboard/accounts/models.py (Diff revision 4) This also needs a "Returns" block, like:
Returns: bool: <description of the return value here>
-
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 4) This should be formatted more like:
this._shouldUseDesktopNotifications = ( 'Notification' in window && RB.UserSession.instance.get(....));
-
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 4) So right now, we have all this code, and some code below, that deals with cross-browser setup and requests for desktop notifications, along with the checks for whether we can use these notifications.
If we later have a new view not based on ReviewablePageView that wants to do the same thing, we're going to have to repeat this.
Instead, I suggest we have a new wrapper object,
ui/managers/notificationManager.js
, that manages all this. Callers should be able to simply do:RB.NotificationManager.setup(); ... if (RB.NotificationManager.canNotify) { RB.NotificationManager.notify({ ... // data on the notification }); }
The manager would, in
setup
, figure out the type of object and request permission if needed. It would only do this once, allowingsetup
to be called by any class expecting to do notifications.This makes for a nice, reusable interface around notifications that we can later extend, and more easily unit test.
(Also, there should be unit tests for these changes.)
-
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 4) First line of function docs should be a summary fitting on one line without wrapping. You can then expand on a description.
-
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 4) We always want to show the in-page bubble. If I get a popup on my screen, I need to be able to find out what page had the update. If it's not on the page as well, I'll have to guess.
-
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 4) Same as above. The first line should be a summary fitting on a single line.
-
-
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 4) Extra trailing whitespace should be removed.

-
Tool: Pyflakes Processed Files: reviewboard/staticbundles.py reviewboard/accounts/evolutions/__init__.py reviewboard/accounts/forms/pages.py reviewboard/accounts/evolutions/profile_settings.py reviewboard/accounts/models.py Ignored Files: reviewboard/static/rb/js/ui/managers/notificationManagerModel.js reviewboard/templates/base.html reviewboard/static/rb/js/pages/views/reviewablePageView.js Tool: PEP8 Style Checker Processed Files: reviewboard/staticbundles.py reviewboard/accounts/evolutions/__init__.py reviewboard/accounts/forms/pages.py reviewboard/accounts/evolutions/profile_settings.py reviewboard/accounts/models.py Ignored Files: reviewboard/static/rb/js/ui/managers/notificationManagerModel.js reviewboard/templates/base.html reviewboard/static/rb/js/pages/views/reviewablePageView.js
-
-
-
-
-
-
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 5) Remove this whitespace.
-
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revision 5) Reformat this as:
this._canNotify = ( this.notificationType !== undefined && RB.UserSession.instance.get('...'));
Also, missing a semi-colon and there is trailing whitespace.
-
-
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revision 5) No blank line here.
-
-
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revision 5) You don't have to wrap
notification.close()
in a function, e.g.:_.delay(notification.close, RB.NotificationManager.NOTIFICATION_LIFETIME_MSECS);
-
-
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revision 5) "the user's browser"
-
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revision 5) Capital 'F' for the false.
Diff: |
Revision 6 (+299 -10)
|
---|

-
Tool: PEP8 Style Checker Processed Files: reviewboard/staticbundles.py reviewboard/accounts/evolutions/__init__.py reviewboard/accounts/forms/pages.py reviewboard/accounts/evolutions/profile_settings.py reviewboard/accounts/models.py Ignored Files: reviewboard/static/rb/js/ui/managers/tests/notificationManagerModelTests.js reviewboard/static/rb/js/ui/managers/notificationManagerModel.js reviewboard/templates/base.html reviewboard/static/rb/js/pages/views/reviewablePageView.js Tool: Pyflakes Processed Files: reviewboard/staticbundles.py reviewboard/accounts/evolutions/__init__.py reviewboard/accounts/forms/pages.py reviewboard/accounts/evolutions/profile_settings.py reviewboard/accounts/models.py Ignored Files: reviewboard/static/rb/js/ui/managers/tests/notificationManagerModelTests.js reviewboard/static/rb/js/ui/managers/notificationManagerModel.js reviewboard/templates/base.html reviewboard/static/rb/js/pages/views/reviewablePageView.js
-
-
Diff: |
Revision 7 (+296 -10)
|
---|

-
Tool: Pyflakes Processed Files: reviewboard/staticbundles.py reviewboard/accounts/evolutions/__init__.py reviewboard/accounts/forms/pages.py reviewboard/accounts/evolutions/profile_settings.py reviewboard/accounts/models.py Ignored Files: reviewboard/static/rb/js/ui/managers/tests/notificationManagerModelTests.js reviewboard/static/rb/js/ui/managers/notificationManagerModel.js reviewboard/templates/base.html reviewboard/static/rb/js/pages/views/reviewablePageView.js Tool: PEP8 Style Checker Processed Files: reviewboard/staticbundles.py reviewboard/accounts/evolutions/__init__.py reviewboard/accounts/forms/pages.py reviewboard/accounts/evolutions/profile_settings.py reviewboard/accounts/models.py Ignored Files: reviewboard/static/rb/js/ui/managers/tests/notificationManagerModelTests.js reviewboard/static/rb/js/ui/managers/notificationManagerModel.js reviewboard/templates/base.html reviewboard/static/rb/js/pages/views/reviewablePageView.js
-
-
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 7) I think this should be
_showUpdatesBubble
-
-
-
-
-
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revisions 6 - 7) There's an extra ' in here.
-
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revisions 6 - 7) Should be a lower-case 'true'
-
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revisions 6 - 7) Actually, the way you had it before was correct (since this is JavaScript, not Python). However, this should end in a period.
-
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revisions 6 - 7) I don't think this works (since
notification.close()
will call immediately). However, you probably can do:_.delay(_.bind(notification.close, notification), RB.NotificationManager.NOTIFICATION_LIFETIME_MSECS);
Diff: |
Revision 8 (+290 -10)
|
---|

-
Tool: Pyflakes Processed Files: reviewboard/staticbundles.py reviewboard/accounts/evolutions/__init__.py reviewboard/accounts/forms/pages.py reviewboard/accounts/evolutions/profile_settings.py reviewboard/accounts/models.py Ignored Files: reviewboard/static/rb/js/ui/managers/tests/notificationManagerModelTests.js reviewboard/static/rb/js/ui/managers/notificationManagerModel.js reviewboard/templates/base.html reviewboard/static/rb/js/pages/views/reviewablePageView.js Tool: PEP8 Style Checker Processed Files: reviewboard/staticbundles.py reviewboard/accounts/evolutions/__init__.py reviewboard/accounts/forms/pages.py reviewboard/accounts/evolutions/profile_settings.py reviewboard/accounts/models.py Ignored Files: reviewboard/static/rb/js/ui/managers/tests/notificationManagerModelTests.js reviewboard/static/rb/js/ui/managers/notificationManagerModel.js reviewboard/templates/base.html reviewboard/static/rb/js/pages/views/reviewablePageView.js
-
Doc comments should end in periods.
-
-
-
-
-
-
-
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revision 8) Remove this line.
-
-
-
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revision 8) Return.
Missing period.
-
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revision 8) "Send"
The first sentence of a doccomment should be a single line.
-
-
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revision 8) Missing a period. Also doesnt tell us that the following list is a list of keys.
-
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revision 8) Backquotes, not single quotes.
-
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revision 8) What happens when you call
.close()
on a closed notification? -
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revision 8) "Create"
First sentence of a doc comment should fit on a single line.
Also, minor typos:
``RB.notificationManager.notifiy
-
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revision 8) second line should be indented one more space
-
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revision 8) should be indented one more space.
-
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revision 8) backquotes, not single quotes.
-
-
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revision 8) Call.
shouldNotify
. -
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revision 8) "Call". Needs args.
-
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revision 8) "Return"
Needs args.
-
Diff: |
Revision 9 (+329 -11)
|
---|

-
Tool: Pyflakes Processed Files: reviewboard/staticbundles.py reviewboard/accounts/evolutions/__init__.py reviewboard/accounts/forms/pages.py reviewboard/accounts/evolutions/profile_settings.py reviewboard/accounts/models.py Ignored Files: reviewboard/static/rb/js/ui/managers/tests/notificationManagerModelTests.js reviewboard/static/rb/js/ui/managers/notificationManagerModel.js reviewboard/templates/base.html reviewboard/static/rb/js/pages/views/reviewablePageView.js Tool: PEP8 Style Checker Processed Files: reviewboard/staticbundles.py reviewboard/accounts/evolutions/__init__.py reviewboard/accounts/forms/pages.py reviewboard/accounts/evolutions/profile_settings.py reviewboard/accounts/models.py Ignored Files: reviewboard/static/rb/js/ui/managers/tests/notificationManagerModelTests.js reviewboard/static/rb/js/ui/managers/notificationManagerModel.js reviewboard/templates/base.html reviewboard/static/rb/js/pages/views/reviewablePageView.js
-
The only comments I have have to do with grammar and word choice. Otherwise, I am fine with this landing.
Could you also rewrite the summary into paragraph form and mention in the testing done that you ran the JS unit tests?
Thanks!
-
-
-
reviewboard/accounts/models.py (Diff revision 9) Missing a period. Also this should be:
`:py:data:`True`
-
reviewboard/accounts/models.py (Diff revision 9) No need for an
else
clause. We can just havereturn True
. -
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 9) The bubble will always be displayed, no?
-
-
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 9) "This function will handle the review updated ..."
-
-
-
-
-
-
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 9) "This function will create ..."
"notification"
-
-
-
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revision 9) "This function will tell.
-
-
-
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revision 9) "Otherwise, ``false`` will be returned.
-
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revision 9) ``title`` (``String``)
Note the space.
Also, missing a period.
Capitalization of the.
-
-
-
-
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revision 9) Capitilizaiton and missing period.
-
-
-
-
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revision 9) See my comments in the other doc-comment.
-
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revision 9) Capitilzation and missing period.
-
-
-
-
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revision 9) See my comments on the other doc comment.
Diff: |
Revision 10 (+330 -11)
|
---|

-
Tool: Pyflakes Processed Files: reviewboard/staticbundles.py reviewboard/accounts/evolutions/__init__.py reviewboard/accounts/forms/pages.py reviewboard/accounts/evolutions/profile_settings.py reviewboard/accounts/models.py Ignored Files: reviewboard/static/rb/js/ui/managers/tests/notificationManagerModelTests.js reviewboard/static/rb/js/ui/managers/notificationManagerModel.js reviewboard/templates/base.html reviewboard/static/rb/js/pages/views/reviewablePageView.js Tool: PEP8 Style Checker Processed Files: reviewboard/staticbundles.py reviewboard/accounts/evolutions/__init__.py reviewboard/accounts/forms/pages.py reviewboard/accounts/evolutions/profile_settings.py reviewboard/accounts/models.py Ignored Files: reviewboard/static/rb/js/ui/managers/tests/notificationManagerModelTests.js reviewboard/static/rb/js/ui/managers/notificationManagerModel.js reviewboard/templates/base.html reviewboard/static/rb/js/pages/views/reviewablePageView.js
-
Description: |
|
|||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Testing Done: |
|
Diff: |
Revision 11 (+330 -11)
|
---|

-
Tool: PEP8 Style Checker Processed Files: reviewboard/staticbundles.py reviewboard/accounts/evolutions/__init__.py reviewboard/accounts/forms/pages.py reviewboard/accounts/evolutions/profile_settings.py reviewboard/accounts/models.py Ignored Files: reviewboard/static/rb/js/ui/managers/tests/notificationManagerModelTests.js reviewboard/static/rb/js/ui/managers/notificationManagerModel.js reviewboard/templates/base.html reviewboard/static/rb/js/pages/views/reviewablePageView.js Tool: Pyflakes Processed Files: reviewboard/staticbundles.py reviewboard/accounts/evolutions/__init__.py reviewboard/accounts/forms/pages.py reviewboard/accounts/evolutions/profile_settings.py reviewboard/accounts/models.py Ignored Files: reviewboard/static/rb/js/ui/managers/tests/notificationManagerModelTests.js reviewboard/static/rb/js/ui/managers/notificationManagerModel.js reviewboard/templates/base.html reviewboard/static/rb/js/pages/views/reviewablePageView.js
-
Overall, this is looking very good. There's a few things missing, and a few things you don't need, which I've covered below.
The biggest issue that stands out to me, though, is a lack of consistency with indentation levels. This sort of thing must be absolutely consistent, and it feels like maybe your editor just isn't set right to enforce or help notice indentation differences.
We use 4 space indentation, both for JavaScript statements and within documentation. I've highlighted a number of places where I noticed inconsistencies, but please go through and make sure everything is consistent throughout the change.
-
reviewboard/accounts/forms/pages.py (Diff revision 11) This should be in sentence casing, like the other options.
-
reviewboard/accounts/models.py (Diff revision 11) This can be:
return (not self.settings or self.settings.get('enable_desktop_notifications', True))
-
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 11) The function name would be better as
_onReviewRequestUpdated
. -
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 11) The
/*
is indented one space too far. -
-
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 11) This isn't true anymore, right? We're always sending the bubble now.
-
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 11) Blank line between these.
-
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 11) No need to capitalize "Updates Bubble."
-
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 11) Indentation is wonky here.
Make sure you run
jshint
to catch these. -
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 11) "review request update," or just "update."
-
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 11) I'm having a hard time parsing that sentence. I think it's the "used" bit and maybe "the notification."
-
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 11) Indenation here and below all looks wrong, too.
Go through everything and make sure every indentation level is an even multiple of 4.
-
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 11) Most of this looks like stuff that could easily be inline in the call below.
-
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revision 11) This should go into more detail on what this is responsible for, requirements, etc.
-
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revision 11) The entire purpose of what this class does is express visual notifications based off data, so this by definition should be a
View
and not aModel
. -
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revision 11) "for the user browser" doesn't make sense. "user's browser" ?
-
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revision 11) Should be sentence casing.
Also, this sentence is a bit confusing. I don't think there's a notification telling us about notifications.
-
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revision 11) Most of the stuff in here should be in
initialize
. Any variable state defaults should be there. The only thing that should belong in a special setup function would be the part that requests permission. -
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revision 11) This should just be a constant on the model.
-
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revision 11) 4 space indentation on everything.
-
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revision 11) Too many parens. They're not needed here.
-
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revision 11) Indentation is off here as well.
Same with ones below. Make sure to check every comment.
-
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revision 11) Indentation is off here as well.
-
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revision 11) Blank line between these.
-
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revision 11) No backticks for the types.
-
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revision 11) "URL String" isn't a type. It's just a String.
-
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revision 11) the
/*
is indented one space too far. -
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revision 11) Blank line between each argument.
-
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revision 11) Blank line between these.
-
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revision 11) I'm not sure this is useful.
This function is just taking positional arguments and turning it into an object of keys/values. Thing is, when you have a function as complicated as this in JavaScript, argument-wise, it's often better to instead have it take
options
and to pull from that, emulating Python keyword arguments.However, that'd defeat the whole point of this function. So, given that, it's probably best not to have this function at all.
-
-
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revision 11) This is only needed by the prototype implementation above, so I'd move it there. Then, update call sites to use
this.NOTIFICATION_LIFETIME_MSECS
. -
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revision 11) We shouldn't have a copy of every single function, since those can all just access the instance. A wrapper function like these are only useful if they're doing additional work, like instantiating things.
Same below.
shouldNotify
doesn't even do the right thing, as the wrapped function returns a value. -
reviewboard/static/rb/js/ui/managers/tests/notificationManagerModelTests.js (Diff revision 11) The test suite needs a unit test for every function available to it, under every condition, simulating the ability to use notifications, inability to use them, different sorts of arguments and interaction, etc.
-
reviewboard/static/rb/js/ui/managers/tests/notificationManagerModelTests.js (Diff revision 11) Sentence casing.
Diff: |
Revision 12 (+257 -25)
|
---|

-
Tool: Pyflakes Processed Files: reviewboard/staticbundles.py reviewboard/accounts/evolutions/__init__.py reviewboard/accounts/forms/pages.py reviewboard/accounts/evolutions/profile_settings.py reviewboard/accounts/models.py Ignored Files: reviewboard/static/rb/js/ui/managers/tests/notificationManagerModelTests.js reviewboard/static/rb/js/ui/managers/notificationManagerModel.js reviewboard/templates/base.html reviewboard/static/rb/js/pages/views/reviewablePageView.js Tool: PEP8 Style Checker Processed Files: reviewboard/staticbundles.py reviewboard/accounts/evolutions/__init__.py reviewboard/accounts/forms/pages.py reviewboard/accounts/evolutions/profile_settings.py reviewboard/accounts/models.py Ignored Files: reviewboard/static/rb/js/ui/managers/tests/notificationManagerModelTests.js reviewboard/static/rb/js/ui/managers/notificationManagerModel.js reviewboard/templates/base.html reviewboard/static/rb/js/pages/views/reviewablePageView.js
-
-
reviewboard/accounts/models.py (Diff revision 12) Col: 13 E128 continuation line under-indented for visual indent
Diff: |
Revision 13 (+257 -25)
|
---|

-
Tool: Pyflakes Processed Files: reviewboard/staticbundles.py reviewboard/accounts/evolutions/__init__.py reviewboard/accounts/forms/pages.py reviewboard/accounts/evolutions/profile_settings.py reviewboard/accounts/models.py Ignored Files: reviewboard/static/rb/js/ui/managers/tests/notificationManagerModelTests.js reviewboard/static/rb/js/ui/managers/notificationManagerModel.js reviewboard/templates/base.html reviewboard/static/rb/js/pages/views/reviewablePageView.js Tool: PEP8 Style Checker Processed Files: reviewboard/staticbundles.py reviewboard/accounts/evolutions/__init__.py reviewboard/accounts/forms/pages.py reviewboard/accounts/evolutions/profile_settings.py reviewboard/accounts/models.py Ignored Files: reviewboard/static/rb/js/ui/managers/tests/notificationManagerModelTests.js reviewboard/static/rb/js/ui/managers/notificationManagerModel.js reviewboard/templates/base.html reviewboard/static/rb/js/pages/views/reviewablePageView.js
-
reviewboard/accounts/models.py (Diff revision 13) Col: 13 E128 continuation line under-indented for visual indent
Diff: |
Revision 14 (+257 -25)
|
---|

-
Tool: PEP8 Style Checker Processed Files: reviewboard/staticbundles.py reviewboard/accounts/evolutions/__init__.py reviewboard/accounts/forms/pages.py reviewboard/accounts/evolutions/profile_settings.py reviewboard/accounts/models.py Ignored Files: reviewboard/static/rb/js/ui/managers/tests/notificationManagerModelTests.js reviewboard/static/rb/js/ui/managers/notificationManagerModel.js reviewboard/templates/base.html reviewboard/static/rb/js/pages/views/reviewablePageView.js Tool: Pyflakes Processed Files: reviewboard/staticbundles.py reviewboard/accounts/evolutions/__init__.py reviewboard/accounts/forms/pages.py reviewboard/accounts/evolutions/profile_settings.py reviewboard/accounts/models.py Ignored Files: reviewboard/static/rb/js/ui/managers/tests/notificationManagerModelTests.js reviewboard/static/rb/js/ui/managers/notificationManagerModel.js reviewboard/templates/base.html reviewboard/static/rb/js/pages/views/reviewablePageView.js
Diff: |
Revision 15 (+258 -25)
|
---|

-
Tool: Pyflakes Processed Files: reviewboard/staticbundles.py reviewboard/accounts/evolutions/__init__.py reviewboard/accounts/forms/pages.py reviewboard/accounts/evolutions/profile_settings.py reviewboard/accounts/models.py Ignored Files: reviewboard/static/rb/js/ui/managers/tests/notificationManagerModelTests.js reviewboard/static/rb/js/ui/managers/notificationManagerModel.js reviewboard/templates/base.html reviewboard/static/rb/js/pages/views/reviewablePageView.js Tool: PEP8 Style Checker Processed Files: reviewboard/staticbundles.py reviewboard/accounts/evolutions/__init__.py reviewboard/accounts/forms/pages.py reviewboard/accounts/evolutions/profile_settings.py reviewboard/accounts/models.py Ignored Files: reviewboard/static/rb/js/ui/managers/tests/notificationManagerModelTests.js reviewboard/static/rb/js/ui/managers/notificationManagerModel.js reviewboard/templates/base.html reviewboard/static/rb/js/pages/views/reviewablePageView.js
-
-
reviewboard/accounts/models.py (Diff revision 15) I've been informed in my work that this should just be:
``True``
-
Diff: |
Revision 16 (+309 -26)
|
---|

-
Tool: Pyflakes Processed Files: reviewboard/staticbundles.py reviewboard/accounts/evolutions/__init__.py reviewboard/accounts/forms/pages.py reviewboard/accounts/evolutions/profile_settings.py reviewboard/accounts/models.py Ignored Files: reviewboard/static/rb/js/pages/views/tests/reviewablePageViewTests.js reviewboard/static/rb/js/ui/managers/tests/notificationManagerModelTests.js reviewboard/static/rb/js/ui/managers/notificationManagerModel.js reviewboard/templates/base.html reviewboard/static/rb/js/pages/views/reviewablePageView.js Tool: PEP8 Style Checker Processed Files: reviewboard/staticbundles.py reviewboard/accounts/evolutions/__init__.py reviewboard/accounts/forms/pages.py reviewboard/accounts/evolutions/profile_settings.py reviewboard/accounts/models.py Ignored Files: reviewboard/static/rb/js/pages/views/tests/reviewablePageViewTests.js reviewboard/static/rb/js/ui/managers/tests/notificationManagerModelTests.js reviewboard/static/rb/js/ui/managers/notificationManagerModel.js reviewboard/templates/base.html reviewboard/static/rb/js/pages/views/reviewablePageView.js
Diff: |
Revision 17 (+315 -26)
|
---|

-
Tool: PEP8 Style Checker Processed Files: reviewboard/staticbundles.py reviewboard/accounts/evolutions/__init__.py reviewboard/accounts/forms/pages.py reviewboard/accounts/evolutions/profile_settings.py reviewboard/accounts/models.py Ignored Files: reviewboard/static/rb/js/pages/views/tests/reviewablePageViewTests.js reviewboard/static/rb/js/ui/managers/tests/notificationManagerModelTests.js reviewboard/static/rb/js/ui/managers/notificationManagerModel.js reviewboard/templates/base.html reviewboard/static/rb/js/pages/views/reviewablePageView.js Tool: Pyflakes Processed Files: reviewboard/staticbundles.py reviewboard/accounts/evolutions/__init__.py reviewboard/accounts/forms/pages.py reviewboard/accounts/evolutions/profile_settings.py reviewboard/accounts/models.py Ignored Files: reviewboard/static/rb/js/pages/views/tests/reviewablePageViewTests.js reviewboard/static/rb/js/ui/managers/tests/notificationManagerModelTests.js reviewboard/static/rb/js/ui/managers/notificationManagerModel.js reviewboard/templates/base.html reviewboard/static/rb/js/pages/views/reviewablePageView.js
-
-
reviewboard/static/rb/js/ui/managers/notificationManagerModel.js (Diff revisions 15 - 17) The indentation here is a little off. It should be:
NOTIFICATION_TYPE: (window.Notification || window.mozNotification || window.webkitNotification)
-
reviewboard/static/rb/js/pages/views/tests/reviewablePageViewTests.js (Diff revision 17) Single quotes.
-
reviewboard/static/rb/js/pages/views/tests/reviewablePageViewTests.js (Diff revision 17) Single quotes.
Diff: |
Revision 18 (+315 -26)
|
---|

-
Tool: Pyflakes Processed Files: reviewboard/staticbundles.py reviewboard/accounts/evolutions/__init__.py reviewboard/accounts/forms/pages.py reviewboard/accounts/evolutions/profile_settings.py reviewboard/accounts/models.py Ignored Files: reviewboard/static/rb/js/pages/views/tests/reviewablePageViewTests.js reviewboard/static/rb/js/ui/managers/tests/notificationManagerModelTests.js reviewboard/static/rb/js/ui/managers/notificationManagerModel.js reviewboard/templates/base.html reviewboard/static/rb/js/pages/views/reviewablePageView.js Tool: PEP8 Style Checker Processed Files: reviewboard/staticbundles.py reviewboard/accounts/evolutions/__init__.py reviewboard/accounts/forms/pages.py reviewboard/accounts/evolutions/profile_settings.py reviewboard/accounts/models.py Ignored Files: reviewboard/static/rb/js/pages/views/tests/reviewablePageViewTests.js reviewboard/static/rb/js/ui/managers/tests/notificationManagerModelTests.js reviewboard/static/rb/js/ui/managers/notificationManagerModel.js reviewboard/templates/base.html reviewboard/static/rb/js/pages/views/reviewablePageView.js
-
Some nitpicks, then looks good to me.
-
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 18) Can you move this function definition inline into the
notify
call? -
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 18) There is no
var
statement for this variable. -
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 18) I'd rather have this all inline:
RB.Notificationmanager.instance.notify({ ... });
-
reviewboard/static/rb/js/pages/views/reviewablePageView.js (Diff revision 18) You don't need quotes around JS object keys.
-
-
reviewboard/static/rb/js/pages/views/tests/reviewablePageViewTests.js (Diff revision 18) Should be at top of function.