Issue 3532: Linking to a collapsed review does not expand the review
Review Request #6332 — Created Sept. 17, 2014 and submitted
Linking to a collapsed review does not expand the review. Fixed by parsing the url and force the linked box to open.
Tested on local server, add /#review{review_id} to url will trigger the corresponding box to open.
All unit tests passed.
Description | From | Last Updated |
---|---|---|
Empty line contains whitespace. |
brennie | |
Use spaces instead of tabs. |
brennie | |
var statements must always be at the top of the function. There should also only be one single var, like … |
chipx86 | |
Variable names are always namedLikeThis in our JavaScript code. No underscores. |
chipx86 | |
Space after if, and always have a single blank line separating other code and an if statement. |
chipx86 | |
This has tabs and not spaces. Likewise for the next few lines. |
brennie | |
The .removeClass and .addClass should be indented 4 spaces relative to the element they're called on. |
chipx86 | |
list comprehension redefines 'file_attachment' from line 589 |
reviewbot | |
These could be combined into a single statement since you only use url once. |
david | |
Add a space between ) and {. Also, javascript comparisons should almost always use === instead of == Can you … |
david | |
These are indented too much. |
david | |
Since '#review' may not be in the URL, we should first check for the presence. I know JavaScript will (at … |
chipx86 | |
In JavaScript, you want to use === for comparison (though it'll require that the types be compatible, meaning you'll need … |
chipx86 |
- Bugs:
- Change Summary:
-
Added the students group
- Groups:
-
Tool: Pyflakes Ignored Files: reviewboard/static/rb/js/views/reviewBoxView.js AUTHORS Tool: PEP8 Style Checker Ignored Files: reviewboard/static/rb/js/views/reviewBoxView.js AUTHORS
-
Tool: PEP8 Style Checker Ignored Files: reviewboard/static/rb/js/views/reviewBoxView.js AUTHORS Tool: Pyflakes Ignored Files: reviewboard/static/rb/js/views/reviewBoxView.js AUTHORS
-
Tool: PEP8 Style Checker Ignored Files: reviewboard/static/rb/js/views/reviewBoxView.js AUTHORS Tool: Pyflakes Ignored Files: reviewboard/static/rb/js/views/reviewBoxView.js AUTHORS
-
Some general comments involving coding style, but for this particular change, I thought we were going to fix this up in the Python code?
The Python code (
review_detail
in reviewboard/reviews/views.py) controls the initial state of the boxes. It should be checking the#review
and setting the matchingcollapsed
state toFalse
. This way, the page is rendered in the correct state.The Python code is already doing this for other things (like comparing timestamps and such) to set the default states, which is why we want it there.
-
var
statements must always be at the top of the function. There should also only be one singlevar
, like this:var foo = 1, bar = 2, s = '';
-
-
-
The
.removeClass
and.addClass
should be indented 4 spaces relative to the element they're called on.
- Summary:
-
Issue 3532: Linking to a collapsed review does not expand the review[WIP] Issue 3532: Linking to a collapsed review does not expand the review
- Testing Done:
-
- Tested on local server, add /#review{review_id} to url will trigger the corresponding box to open.
- - All unit tests passed.
- Commit:
-
64fdbf1a151f28958867f595891aa317cb643afc11a384c7b3dcfdd7a17a27d8352add4b2a217f75
- Description:
-
~ Linking to a collapsed review does not expand the review. Fixed by parsing the url and force the linked box to open.
~ Linking to a collapsed review does not expand the review. Fixed by parsing the url and force the linked box to open. But somehow it doesn't work.
- Description:
-
Linking to a collapsed review does not expand the review. Fixed by parsing the url and force the linked box to open. But somehow it doesn't work.
+ + I think it's because request.get_full_path() won’t include the anchor at the end, here is the reference:
+ https://code.djangoproject.com/ticket/18456 + + So, have to do this at front-end?
-
Have you looked into Fragment Identifiers? As best I understand the part of the URL after the # isn't sent to the server. A plaintext dump of the url at the point you're working on should verify that.
- Summary:
-
[WIP] Issue 3532: Linking to a collapsed review does not expand the reviewIssue 3532: Linking to a collapsed review does not expand the review
- Description:
-
~ Linking to a collapsed review does not expand the review. Fixed by parsing the url and force the linked box to open. But somehow it doesn't work.
~ Linking to a collapsed review does not expand the review. Fixed by parsing the url and force the linked box to open.
- - I think it's because request.get_full_path() won’t include the anchor at the end, here is the reference:
- https://code.djangoproject.com/ticket/18456 - - So, have to do this at front-end?
- Testing Done:
-
+ Tested on local server, add /#review{review_id} to url will trigger the corresponding box to open.
+ + All unit tests passed.
- Commit:
-
11a384c7b3dcfdd7a17a27d8352add4b2a217f757867de13cfc44770c040195a96d62dd3612004af
-
Tool: PEP8 Style Checker Ignored Files: reviewboard/static/rb/js/views/reviewBoxView.js AUTHORS Tool: Pyflakes Ignored Files: reviewboard/static/rb/js/views/reviewBoxView.js AUTHORS
-
Tool: PEP8 Style Checker Ignored Files: reviewboard/static/rb/js/views/reviewBoxView.js AUTHORS Tool: Pyflakes Ignored Files: reviewboard/static/rb/js/views/reviewBoxView.js AUTHORS
-
-
Since
'#review'
may not be in the URL, we should first check for the presence. I know JavaScript will (at least on Chrome) just returnundefined
, but this code makes it look like'#review'
is always expected to be there. -
In JavaScript, you want to use
===
for comparison (though it'll require that the types be compatible, meaning you'll need toparseInt(loadReviewID, 10)
.