Review Composer: Sidebar
Review Request #10225 — Created Oct. 11, 2018 and updated
The Review composer is the redesign of the review dialog to improve user
experience. The Review composer: sidebar serves as the sidebar for the
review composer.The sidebar contains a button to create new general comments to replace the
add general comments button in the review dialog. A rendered list of comments
which will serve as a table of contents of reviews left in the review and a
tips and documentation section.
Added new JS unit tests to test functionality added. All JS tests pass.
Description | From | Last Updated |
---|---|---|
Since we're doing _super.remove below we don't need this. |
brennie | |
Doing render() here will break things. |
brennie | |
This should be this.$el.append($generalCommentButton). |
brennie | |
Col: 15 'commentList' is defined but never used. |
reviewbot | |
Col: 15 'tipsSection' is defined but never used. |
reviewbot | |
Col: 69 Missing semicolon. |
reviewbot | |
You don't need this becuase of the _super call below. |
brennie | |
This should be in its own file. You will have to add the new file to staticbundles.py. |
brennie | |
Col: 29 Missing semicolon. |
reviewbot | |
Col: 63 Missing semicolon. |
reviewbot | |
Col: 11 Missing semicolon. |
reviewbot | |
Col: 35 Missing semicolon. |
reviewbot | |
Alphabetize. |
brennie | |
Alphabetize. |
brennie | |
Alphabetize. |
brennie | |
space between selector and { |
brennie | |
These are not very semantic styles. Their names indicate what they do, not why they do it or what they … |
brennie | |
Space between selector and { |
brennie | |
This should return this. |
brennie | |
Col: 7 'DiffCommentView' is defined but never used. |
reviewbot | |
Same comment here re: inline styles. |
brennie | |
Col: 7 'FileAttachmentCommentView' is defined but never used. |
reviewbot | |
Col: 7 'GeneralCommentView' is defined but never used. |
reviewbot | |
Col: 7 'ScreenshotCommentView' is defined but never used. |
reviewbot | |
We try to avoid inline style as much as possible. Is there a reason this can't be added to a … |
brennie | |
Col: 7 'HeaderFooterCommentView' is defined but never used. |
reviewbot | |
If it is intentionally a no-op, you do not need to define it since the parent already does. Same elsewhere. |
brennie | |
Col: 7 'ReviewOutline' is defined but never used. |
reviewbot | |
Col: 3 Missing semicolon. |
reviewbot | |
Same comment here re: inline styles. |
brennie | |
Our templates are indented a single space, not four. |
brennie | |
Space after ). Same elsewhere |
brennie | |
This is also using inline style. |
brennie | |
How about: this.listenTo( reviewDialogView._fileAttachmentCommentsCollection, 'add', comment => this._renderComment($reviewOutline, comment)); |
brennie | |
Since you're not doing anything with tipsSection, you can just do: this.$('#sidebar-tips-section') .append($(this.tipsTemplate({ ... }))); |
brennie | |
As a convention, we name jQuery objects $foo. |
brennie | |
This should have $() wrapped around the template to convert create the DOM nodes to attach to the tree. |
brennie | |
Since you aren't doing anything with $buttons afterwards, you can just do: this.$('#sidebar-tips-button') .append(...); |
brennie | |
Our templates are indented a single space, not four. |
brennie | |
Col: 7 'DiffCommentView' is defined but never used. |
reviewbot | |
Col: 7 'FileAttachmentCommentView' is defined but never used. |
reviewbot | |
Col: 7 'GeneralCommentView' is defined but never used. |
reviewbot | |
Col: 7 'ScreenshotCommentView' is defined but never used. |
reviewbot | |
Col: 7 'HeaderFooterCommentView' is defined but never used. |
reviewbot | |
Col: 7 'ReviewOutline' is defined but never used. |
reviewbot | |
Col: 3 Missing semicolon. |
reviewbot | |
Col: 7 'HeaderFooterCommentView' is defined but never used. |
reviewbot | |
Col: 58 Missing semicolon. |
reviewbot | |
Col: 58 Missing semicolon. |
reviewbot | |
Col: 58 Missing semicolon. |
reviewbot | |
Col: 58 Missing semicolon. |
reviewbot | |
Col: 7 'HeaderFooterCommentView' is defined but never used. |
reviewbot | |
Space after selector and before opening brace. |
brennie | |
Is text HTML-escaped? Or do we know its safe HTML? If not we need to use <%- text %>. |
brennie | |
<%- text %> |
brennie | |
Same comment about <%= foo %> vs <%- foo %>. |
brennie | |
<br> and it should be on the next line. |
brennie | |
<%- lines %> |
brennie | |
Unnecessary -- this is the default impl. |
brennie | |
Here too |
brennie | |
Space between ) and { |
brennie | |
Should be indented one space. |
brennie | |
<%- text %> |
brennie | |
<br> on next line. |
brennie | |
Unnecessary. |
brennie | |
Same comment here vs <%= vs <%-. |
brennie | |
<%- text %> |
brennie | |
<br> on next line. |
brennie | |
Unnecessary. |
brennie | |
This has to be marked for translation with gettext(). Replace this with a template var and pass in the result … |
brennie | |
This has to be marked for translation with gettext(). Replace this with a template var and pass in the result … |
brennie | |
Same comment here about <%= vs <%-. |
brennie | |
We should avoid <b> in favour of <strong>, which is more semantic (see: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/strong) However, since this is a title, … |
brennie | |
I don't know that we need an id selector here. class="tip-text" would be fine. |
brennie | |
gettext() |
brennie | |
Single quotes for strings |
brennie | |
Text needs to be marked for translation with gettext, e.g. $('<span class="fa fa-plus"></span>') .text(gettext('Add a general comment')) |
brennie | |
If you are going to use this for a multi-line string, use dedent, e.g. $(dedent` <span class="left-button fa fa-caret-left"></span> <span … |
brennie | |
Undo |
brennie | |
Comments should end in a period. However, I think the behaviour can be inferred from the name. |
brennie | |
Comments should end in a period. Again, I don't know that this is necessary. |
brennie | |
This file needs to be wrapped in an IIFE to not pollute global scope, e.g. (function() { const BaseCommentView = … |
brennie | |
Undo |
brennie | |
.sidebar-tips-button before .sidebar-tips-section. |
brennie | |
No blank line here. |
brennie | |
No blank line here. |
brennie | |
Move this to right before the block it is defined in. |
brennie | |
No blank line here. |
brennie | |
This does not interpolate variables, so it can just be a string literal. |
brennie | |
Instead of passing tips and current into the template, you can pass tip as tips[current] and use that instead. |
brennie | |
There is an extra ", right before class |
brennie | |
Needs a docstring. |
brennie | |
Col: 22 Missing semicolon. |
reviewbot | |
Col: 5 'emptyDiffCommentsPayload' is defined but never used. |
reviewbot | |
Col: 5 'emptyFileAttachmentCommentsPayload' is defined but never used. |
reviewbot | |
Col: 5 'emptyGeneralCommentsPayload' is defined but never used. |
reviewbot | |
Col: 5 'emptyScreenshotCommentsPayload' is defined but never used. |
reviewbot | |
Col: 5 'diffCommentPayload' is defined but never used. |
reviewbot | |
Col: 5 'fileAttachmentCommentPayload' is defined but never used. |
reviewbot | |
Col: 5 'generalCommentPayload' is defined but never used. |
reviewbot | |
Col: 5 'screenshotCommentPayload' is defined but never used. |
reviewbot | |
Col: 5 'origGeneralCommentsEnabled' is defined but never used. |
reviewbot | |
Col: 5 'dlg' is defined but never used. |
reviewbot | |
Col: 10 'createReviewDialog' is defined but never used. |
reviewbot | |
Col: 21 'ajaxData' is defined but never used. |
reviewbot | |
Col: 96 Missing semicolon. |
reviewbot | |
Col: 70 Missing semicolon. |
reviewbot | |
Col: 41 Expected '===' and instead saw '=='. |
reviewbot | |
Col: 56 Missing semicolon. |
reviewbot | |
Col: 70 Missing semicolon. |
reviewbot | |
W503 line break before binary operator |
reviewbot | |
W503 line break before binary operator |
reviewbot | |
W503 line break before binary operator |
reviewbot |
- Commit:
-
5fb2c2376b98734d72dbadd23daa7293de37f91c04902898f25f64a43893b9830fdaab93165165ee
Checks run (2 succeeded)
- Description:
-
Working on the sidebar for the review composer. It is expected to have a new button
~ to create general. A rendered list of comments with a bit of summary and a tips ~ section. ~ to create general comment. A rendered list of comments with a bit of summary and a ~ tips section. I am currently learning about views so that I can make reuse the code in the
~ reviewDialogView.es6.js
.~ reviewDialogView.es6.js
. I have started on the review composer sidebar view, I am+ currently trying to make sense of the functions in the file to see how I can use them.
- Commit:
-
04902898f25f64a43893b9830fdaab93165165ee13ecae7cffa2a0b8be60d312569cbfd296f8bcdb
Checks run (2 succeeded)
- Commit:
-
13ecae7cffa2a0b8be60d312569cbfd296f8bcdb2e1a975bcc19457609782645fafa4e2497fa1634
Checks run (2 succeeded)
- Commit:
-
2e1a975bcc19457609782645fafa4e2497fa1634d01eaecfc69b5d1537c008d0a948af81f02b41da
Checks run (2 succeeded)
- Commit:
-
d01eaecfc69b5d1537c008d0a948af81f02b41da74fef303975f2db8764f23d3bb41463e7520f8a6
- Diff:
-
Revision 6 (+55)
- Added Files:
Checks run (2 succeeded)
- Commit:
-
74fef303975f2db8764f23d3bb41463e7520f8a65582be688854b283c65ed3a8b8061322a3bbb0e4
Checks run (2 succeeded)
- Commit:
-
5582be688854b283c65ed3a8b8061322a3bbb0e441a14e598e91c79ec3df033cec9e10579d6492cd
Checks run (2 succeeded)
- Commit:
-
41a14e598e91c79ec3df033cec9e10579d6492cda0cf5d26ce9ff762da87090594209b980d7b7b3f
- Diff:
-
Revision 9 (+88 -15)
- Added Files:
- Change Summary:
-
Addressed issues
- Commit:
-
a0cf5d26ce9ff762da87090594209b980d7b7b3f0095971f15b3c30375ca6e7dff7aa49c0a40e601
Checks run (2 succeeded)
- Commit:
-
0095971f15b3c30375ca6e7dff7aa49c0a40e601380de8215cab0ca3c3597a8fd3cebd8dadeb677e
Checks run (2 succeeded)
- Commit:
-
380de8215cab0ca3c3597a8fd3cebd8dadeb677e108e628be306c43ce936a45d5da1a5b2bf4924d3
Checks run (2 succeeded)
- Commit:
-
108e628be306c43ce936a45d5da1a5b2bf4924d3d2860d4ba7246d93d090097f03c115d92c81d223
Checks run (2 succeeded)
- Commit:
-
005fb9fe095141d4cdfa032c45c6f020239b91f3137c383cb6d559b2abb9616a87d88ff8a85b1457
Checks run (2 succeeded)
- Commit:
-
137c383cb6d559b2abb9616a87d88ff8a85b1457973493d48a34f04ba4393a6a7f6be3daf642e59e
Checks run (2 succeeded)
- Commit:
-
973493d48a34f04ba4393a6a7f6be3daf642e59e656f0d7a6de4772498ad3c3132b46a1d8f481ea9
Checks run (2 succeeded)
- Commit:
-
656f0d7a6de4772498ad3c3132b46a1d8f481ea9a0f89f47f545f4689598f9498b6101eb04ed65c7
Checks run (2 succeeded)
- Commit:
-
08873e805748afae0a5de767eb141457f44130d1e0b597d7e2a48719e86e9c36a93813f4f86a60f4
Checks run (2 succeeded)
- Description:
-
~ Working on the sidebar for the review composer. It is expected to have a new button
~ to create general comment. A rendered list of comments with a bit of summary and a ~ tips section. ~ Working on the sidebar for the review composer. It is expected to have a
~ new button to create general comment. A rendered list of comments with a ~ bit of summary and a tips section. ~ I am currently learning about views so that I can make reuse the code in the
~ reviewDialogView.es6.js
. I have started on the review composer sidebar view, I am~ currently trying to make sense of the functions in the file to see how I can use them. ~ I have been able to complete implemention for the add new general comment
~ button and tips section. I am currently working on the review outline, one ~ of the issues I am currently having is updating the sidebar when a comment + is updated or when a new comment is made. I will also begin on making the + comments in the sidebar link to the respective comment in the review dialog + and the option to reorder comments in the review outline. - Commit:
-
e0b597d7e2a48719e86e9c36a93813f4f86a60f49163c543d5460ae63ea4e281eeaf941b0aabea52
- Diff:
-
Revision 21 (+209 -13)
- Added Files:
Checks run (2 succeeded)
- Commit:
-
9163c543d5460ae63ea4e281eeaf941b0aabea525bd40b0a9065829fa24a56520bec136b18c0170d
- Diff:
-
Revision 22 (+345 -13)
Checks run (1 failed, 1 succeeded)
JSHint
-
-
-
-
-
-
These are not very semantic styles. Their names indicate what they do, not why they do it or what they are styling. Can you update these with more descriptive names?
e.g. why do we want
.color
? Is it a header? If so then name it.header
. -
-
-
-
We try to avoid inline style as much as possible. Is there a reason this can't be added to a
.sidebar-general-comments
rule in the CSS? -
If it is intentionally a no-op, you do not need to define it since the parent already does. Same elsewhere.
-
-
-
-
-
How about:
this.listenTo( reviewDialogView._fileAttachmentCommentsCollection, 'add', comment => this._renderComment($reviewOutline, comment));
-
Since you're not doing anything with
tipsSection
, you can just do:this.$('#sidebar-tips-section') .append($(this.tipsTemplate({ ... })));
-
-
This should have
$()
wrapped around the template to convert create the DOM nodes to attach to the tree. -
Since you aren't doing anything with
$buttons
afterwards, you can just do:this.$('#sidebar-tips-button') .append(...);
-
- Commit:
-
5bd40b0a9065829fa24a56520bec136b18c0170d2025c05e3ade047a42d488dcd58178317518edd6
- Diff:
-
Revision 23 (+346 -13)
Checks run (1 failed, 1 succeeded)
JSHint
- Commit:
-
2025c05e3ade047a42d488dcd58178317518edd6bb13afeef9e9fe4a737a1e47bbdcfa85d3b4a4ff
- Diff:
-
Revision 24 (+360 -13)
- Commit:
-
bb13afeef9e9fe4a737a1e47bbdcfa85d3b4a4fffb26d33b9609a3acb5b3f84c06e649529e578595
- Diff:
-
Revision 25 (+360 -13)
- Commit:
-
fb26d33b9609a3acb5b3f84c06e649529e57859530448a6aaaa06453ce9484d14bbfcc78f6aed5a9
- Diff:
-
Revision 26 (+370 -13)
Checks run (2 succeeded)
- Commit:
-
30448a6aaaa06453ce9484d14bbfcc78f6aed5a9da865df31acb6d3d014be6c04c6cc744b9076f0a
- Diff:
-
Revision 27 (+378 -14)
Checks run (2 succeeded)
- Commit:
-
da865df31acb6d3d014be6c04c6cc744b9076f0a889309bcc07e128d37ad708e463abe079d80ba19
- Diff:
-
Revision 28 (+391 -14)
Checks run (2 succeeded)
-
-
-
-
-
-
-
-
-
This has to be marked for translation with
gettext()
. Replace this with a template var and pass in the result ofgettext()
when using the template. -
This has to be marked for translation with
gettext()
. Replace this with a template var and pass in the result ofgettext()
when using the template. -
-
-
Text needs to be marked for translation with
gettext
, e.g.$('<span class="fa fa-plus"></span>') .text(gettext('Add a general comment'))
-
If you are going to use this for a multi-line string, use
dedent
, e.g.$(dedent` <span class="left-button fa fa-caret-left"></span> <span class="right-button ra fa-caret-right"></span> `);
- Commit:
-
889309bcc07e128d37ad708e463abe079d80ba1951401a17de6e3170ace17bfe9bea7f170b3a70f1
- Diff:
-
Revision 29 (+390 -14)
Checks run (2 succeeded)
- Commit:
-
51401a17de6e3170ace17bfe9bea7f170b3a70f1786c797f3fadbefac05efa77778920735a8d011c
- Diff:
-
Revision 30 (+385 -14)
Checks run (2 succeeded)
- Commit:
-
786c797f3fadbefac05efa77778920735a8d011c4dc9b648cd74dbdcaeb31d0b76a127a8f2a54a29
- Diff:
-
Revision 31 (+384 -14)
Checks run (2 succeeded)
- Commit:
-
4dc9b648cd74dbdcaeb31d0b76a127a8f2a54a296322b55ee0fde82809e4cade2d5ab71f399060df
- Diff:
-
Revision 32 (+394 -15)
Checks run (2 succeeded)
- Change Summary:
-
Functionality is complete
- Commit:
-
6322b55ee0fde82809e4cade2d5ab71f399060df40ae58a61840c1ff2aab71c22f72734f675fb7c5
- Diff:
-
Revision 33 (+394 -15)
Checks run (2 succeeded)
-
-
-
-
-
This file needs to be wrapped in an IIFE to not pollute global scope, e.g.
(function() { const BaseCommentView = Backbone.View.extend({...}); // .. RB.ReviewComposerSidebar = Backbone.View.extend({...}); })();
This keeps all the variables in a function scope, so they don't escape into global scope (i.e, onto
window
).
- Commit:
-
40ae58a61840c1ff2aab71c22f72734f675fb7c5a0fa9d147610edae85cd47518492dadb79ef842c
- Diff:
-
Revision 34 (+439 -15)
Checks run (2 succeeded)
- Commit:
-
a0fa9d147610edae85cd47518492dadb79ef842c8118bee82b4b465af62bc01813083895aec9c4b3
- Diff:
-
Revision 35 (+431 -15)
Checks run (2 succeeded)
- Commit:
-
8118bee82b4b465af62bc01813083895aec9c4b3427865f519bf01cb26a6f4798d09902130f2b668
- Diff:
-
Revision 36 (+608 -16)
Checks run (1 failed, 1 succeeded)
JSHint
- Change Summary:
-
Resolved issues
- Commit:
-
427865f519bf01cb26a6f4798d09902130f2b6686b34655f1190522fb693d63575e5649b8cb6680d
- Diff:
-
Revision 37 (+607 -16)
Checks run (2 succeeded)
- Commit:
-
6b34655f1190522fb693d63575e5649b8cb6680d8c457e21916dadd6e0106d32e9927eb80f06afbf
- Diff:
-
Revision 38 (+692 -16)
Checks run (2 succeeded)
- Commit:
-
8c457e21916dadd6e0106d32e9927eb80f06afbf0e9c5f9f93568b07a1f162a09fa661b8eab84e3f
- Diff:
-
Revision 39 (+1497 -16)
Checks run (2 succeeded)
- Commit:
-
0e9c5f9f93568b07a1f162a09fa661b8eab84e3f30d77b2d4dd259efcbbaa427319c4637825be4dc
- Diff:
-
Revision 40 (+1558 -16)
- Change Summary:
-
Resolved raised issues
- Commit:
-
30d77b2d4dd259efcbbaa427319c4637825be4dcfe3e94b8e467993f787aeb153c4d74e4e7039144
- Diff:
-
Revision 41 (+1552 -16)
Checks run (2 succeeded)
- Summary:
-
[WIP] Review Composer: SidebarReview Composer: Sidebar
- Description:
-
~ Working on the sidebar for the review composer. It is expected to have a
~ new button to create general comment. A rendered list of comments with a ~ bit of summary and a tips section. ~ The Review composer is the redesign of the review dialog to improve user
~ experience. The Review composer: sidebar serves as the sidebar for the ~ review composer. ~ I have been able to complete implemention for the add new general comment
~ button and tips section. I am currently working on the review outline, one ~ of the issues I am currently having is updating the sidebar when a comment ~ is updated or when a new comment is made. I will also begin on making the ~ The sidebar contains a button to create new general comments to replace the
~ add general comments button in the review dialog. A rendered list of comments ~ which will serve as a table of contents of reviews left in the review and a ~ tips and documentation section. - comments in the sidebar link to the respective comment in the review dialog - and the option to reorder comments in the review outline. - Testing Done:
-
+ Added new JS unit tests to test functionality added. All JS tests pass.
- Change Summary:
-
Addressed issues
- Commit:
-
fe3e94b8e467993f787aeb153c4d74e4e7039144c2a3043f849846400f9cd4d9a59a56ed18c0cd0c
- Diff:
-
Revision 42 (+1552 -16)
Checks run (2 succeeded)
- Commit:
-
c2a3043f849846400f9cd4d9a59a56ed18c0cd0c9c8a09b1414693b7c2a17bdf1d649fd205723207
- Diff:
-
Revision 43 (+1649 -593)
- Commit:
-
9c8a09b1414693b7c2a17bdf1d649fd2057232079c9f15a8027b25e168f436be9017e283b62a99e6
- Diff:
-
Revision 44 (+1552 -16)
Checks run (2 succeeded)
- Change Summary:
-
Minor change forgot to change source for revision in template
- Commit:
-
9c9f15a8027b25e168f436be9017e283b62a99e63de845633b16456e575c876009926f684c30cafd
- Diff:
-
Revision 45 (+1552 -16)