[checklist] Implement checklist templates in account pages
Review Request #7099 — Created March 21, 2015 and submitted
An additional functionality of the checklist extension is to allow users to create individual templates which can be quickly added to any existing checklists. This change does not enable checklist templates to be imported into existing checklists.
Checklist templates are stored with two attributes, their title as a string and their list of items in JSON format.
The form for users to modify their checklist templates is under their account preferences page. In the form, users can add checklist templates, remove checklist templates, or edit an existing checklist template.
The form will automatically add new item fields when it detects that the user is editing the last item field, or when the user presses enter.
On Chrome 41.0.2272 and Safari 8.0.2:
- Basic CRUD functionality - adding, editing and removing - works as it should.
- Does not accept templates without a title.
- Empty items are not included upon form submission.
- Tested and ensured that the UI shortcuts (enter, tab) work.
- Verified that the issue where the menu entry will disappear has been resolved (after #7103).
- Ensured that users can only view and edit their own templates.
Description | From | Last Updated |
---|---|---|
'AccountPageFormsHook' imported but unused |
reviewbot | |
Col: 50 E231 missing whitespace after ',' |
reviewbot | |
Col: 56 E231 missing whitespace after ',' |
reviewbot | |
Col: 80 E501 line too long (83 > 79 characters) |
reviewbot | |
Col: 1 W391 blank line at end of file |
reviewbot | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
undefined name 'ObjectDoesNotExist' |
reviewbot | |
undefined name 'DOES_NOT_EXIST' |
reviewbot | |
undefined name 'webapi_response_errors' |
reviewbot | |
Two blank lines here |
XU xuanyi | |
Two blank lines over here. |
XU xuanyi | |
Two blank lines here. |
XU xuanyi | |
Two blank lines here. |
XU xuanyi | |
Two blank lines here. |
XU xuanyi | |
Two blank lines here. |
XU xuanyi | |
Two blank lines here. |
XU xuanyi | |
No blank line here (django, djblets, and reviewboard are all "3rd party" from checklist's perspective). |
david | |
No blank line here (django, djblets, and reviewboard are all "3rd party" from checklist's perspective). |
david | |
These can also be chained, eliminating the need to define $itemLi (which seems to be missing a var statement anyway): … |
david | |
These can be chained: this.$el .hide() .before(editView.$el); |
david | |
In javascript, a trailing comma on the last entry in an array or object can break on some browsers. |
david | |
We generally use _$ instead of $_ for internal jquery variables. |
david | |
In javascript, a trailing comma on the last entry in an array or object can break on some browsers. |
david | |
This needs to independently test keyCode against ENTER and 13. Right now this evaluates to only testing against ENTER: if … |
david |
- Change Summary:
-
Fix Review Bot issues.
- Commit:
-
a457a68d0b8ea143322af81e1cc461f259006bf7cf26c5738cf7603daee958e090f5420af267f37e
- Diff:
-
Revision 2 (+584 -14)
-
Tool: Pyflakes Processed Files: checklist/checklist/models.py checklist/checklist/resources/checklist_template.py checklist/checklist/extension.py checklist/checklist/resources/checklist.py Ignored Files: checklist/checklist/static/css/accountpage.less checklist/checklist/static/js/models/checklistTemplate.js checklist/checklist/static/js/views/checklistAccountPageView.js Tool: PEP8 Style Checker Processed Files: checklist/checklist/models.py checklist/checklist/resources/checklist_template.py checklist/checklist/extension.py checklist/checklist/resources/checklist.py Ignored Files: checklist/checklist/static/css/accountpage.less checklist/checklist/static/js/models/checklistTemplate.js checklist/checklist/static/js/views/checklistAccountPageView.js
-
- Commit:
-
cf26c5738cf7603daee958e090f5420af267f37e4787e6fbd8c3b226725d6087049325d8a73e5fdc
- Diff:
-
Revision 3 (+585 -14)
-
Tool: Pyflakes Processed Files: checklist/checklist/models.py checklist/checklist/resources/checklist_template.py checklist/checklist/extension.py checklist/checklist/resources/checklist.py Ignored Files: checklist/checklist/static/css/accountpage.less checklist/checklist/static/js/models/checklistTemplate.js checklist/checklist/static/js/views/checklistAccountPageView.js Tool: PEP8 Style Checker Processed Files: checklist/checklist/models.py checklist/checklist/resources/checklist_template.py checklist/checklist/extension.py checklist/checklist/resources/checklist.py Ignored Files: checklist/checklist/static/css/accountpage.less checklist/checklist/static/js/models/checklistTemplate.js checklist/checklist/static/js/views/checklistAccountPageView.js
- Change Summary:
-
Removed [WIP] after #7103.
- Summary:
-
[WIP] Implement checklist templates in account pagesImplement checklist templates in account pages
- Description:
-
An additional functionality of the checklist extension is to allow users to create individual templates which can be quickly added to any existing checklists. This change does not enable checklist templates to be imported into existing checklists.
Checklist templates are stored with two attributes, their title as a string and their list of items in JSON format.
~ The page for users to modify their checklist templates is under their account preferences page. In the page, users can add checklist templates, remove checklist templates, or edit an existing checklist template.
~ The form for users to modify their checklist templates is under their account preferences page. In the form, users can add checklist templates, remove checklist templates, or edit an existing checklist template.
The form will automatically add new item fields when it detects that the user is editing the last item field, or when the user presses enter.
- - Why is this still a work in progress?
- There exists an issue when the extension restarts for it does not execute the AccountPagesHook
, leading to a missing menu entry in account preferences. - Testing Done:
-
On Chrome 41.0.2272 and Safari 8.0.2:
- Basic CRUD functionality - adding, editing and removing - works as it should.
- Does not accept templates without a title.
- Tested and ensured that the UI shortcuts also work.
~ ~ - Verified that the issue where the menu entry will disappear has been resolved (after #7103).
- The cause for the missing menu entry issue is known, but the reason for the cause is still unknown. This is a time critical bug that still requires looking into.
- Change Summary:
-
Add init.py imports.
- Commit:
-
4787e6fbd8c3b226725d6087049325d8a73e5fdc84926c5ba210f0f49746bbea277c6f4ee3ce83af
- Diff:
-
Revision 4 (+590 -14)
-
Tool: Pyflakes Processed Files: checklist/checklist/models.py checklist/checklist/resources/checklist_template.py checklist/checklist/extension.py checklist/checklist/resources/__init__.py checklist/checklist/resources/checklist_resource.py Ignored Files: checklist/checklist/static/css/accountpage.less checklist/checklist/static/js/models/checklistTemplate.js checklist/checklist/static/js/views/checklistAccountPageView.js Tool: PEP8 Style Checker Processed Files: checklist/checklist/models.py checklist/checklist/resources/checklist_template.py checklist/checklist/extension.py checklist/checklist/resources/__init__.py checklist/checklist/resources/checklist_resource.py Ignored Files: checklist/checklist/static/css/accountpage.less checklist/checklist/static/js/models/checklistTemplate.js checklist/checklist/static/js/views/checklistAccountPageView.js
- Change Summary:
-
Found a bug where templates that do not belong to the user are shown.
- Summary:
-
Implement checklist templates in account pages[WIP] Implement checklist templates in account pages
- Testing Done:
-
On Chrome 41.0.2272 and Safari 8.0.2:
- Basic CRUD functionality - adding, editing and removing - works as it should.
- Does not accept templates without a title.
- Tested and ensured that the UI shortcuts also work.
- Verified that the issue where the menu entry will disappear has been resolved (after #7103).
+ + 28 Mar 2015: found a bug where templates that do not belong to the user are shown.
- Change Summary:
-
Fixed the bug where templates that do not belong to the user are shown.
- Summary:
-
[WIP] Implement checklist templates in account pagesImplement checklist templates in account pages
- Testing Done:
-
On Chrome 41.0.2272 and Safari 8.0.2:
- Basic CRUD functionality - adding, editing and removing - works as it should.
- Does not accept templates without a title.
~ - Tested and ensured that the UI shortcuts also work.
~ - Verified that the issue where the menu entry will disappear has been resolved (after #7103).
~ ~ 28 Mar 2015: found a bug where templates that do not belong to the user are shown.
~ - Empty items are not included upon form submission.
~ - Tested and ensured that the UI shortcuts (enter, tab) work.
~ - Verified that the issue where the menu entry will disappear has been resolved (after #7103).
~ - Ensured that users can only view and edit their own templates.
- Commit:
-
84926c5ba210f0f49746bbea277c6f4ee3ce83af44a7b8f7d59b1c1606cbfc1559f3edb156184697
- Diff:
-
Revision 5 (+596 -14)
-
Tool: PEP8 Style Checker Processed Files: checklist/checklist/models.py checklist/checklist/resources/checklist_template.py checklist/checklist/extension.py checklist/checklist/resources/__init__.py checklist/checklist/resources/checklist_resource.py Ignored Files: checklist/checklist/static/css/accountpage.less checklist/checklist/static/js/models/checklistTemplate.js checklist/checklist/static/js/views/checklistAccountPageView.js Tool: Pyflakes Processed Files: checklist/checklist/models.py checklist/checklist/resources/checklist_template.py checklist/checklist/extension.py checklist/checklist/resources/__init__.py checklist/checklist/resources/checklist_resource.py Ignored Files: checklist/checklist/static/css/accountpage.less checklist/checklist/static/js/models/checklistTemplate.js checklist/checklist/static/js/views/checklistAccountPageView.js
- Change Summary:
-
Fixed line breaks and semi-colon.
- Commit:
-
44a7b8f7d59b1c1606cbfc1559f3edb1561846973c41f18bfb1ca2b9ed35a05277af98ef24029963
- Diff:
-
Revision 6 (+606 -17)
-
Tool: PEP8 Style Checker Processed Files: checklist/checklist/models.py checklist/checklist/resources/checklist_template.py checklist/checklist/extension.py checklist/checklist/resources/__init__.py checklist/checklist/resources/checklist_resource.py Ignored Files: checklist/checklist/static/css/accountpage.less checklist/checklist/static/js/models/checklistTemplate.js checklist/checklist/static/js/views/checklistAccountPageView.js Tool: Pyflakes Processed Files: checklist/checklist/models.py checklist/checklist/resources/checklist_template.py checklist/checklist/extension.py checklist/checklist/resources/__init__.py checklist/checklist/resources/checklist_resource.py Ignored Files: checklist/checklist/static/css/accountpage.less checklist/checklist/static/js/models/checklistTemplate.js checklist/checklist/static/js/views/checklistAccountPageView.js
-
-
No blank line here (django, djblets, and reviewboard are all "3rd party" from checklist's perspective).
-
No blank line here (django, djblets, and reviewboard are all "3rd party" from checklist's perspective).
-
These can also be chained, eliminating the need to define
$itemLi
(which seems to be missing avar
statement anyway):$('<li class="rbchecklist-template-item" />') .text(item) .appendTo($items);
-
-
-
-
-
This needs to independently test
keyCode
againstENTER
and13
. Right now this evaluates to only testing againstENTER
:if (event.keyCode === $.ui.keyCode.ENTER || event.keyCode === 13) {
- Change Summary:
-
Add docs and fix syntax.
Now focuses on the title field upon adding a new template. - Commit:
-
3c41f18bfb1ca2b9ed35a05277af98ef24029963d09b682ba0f1c9fc13e46e1985d01832b8b268df
- Diff:
-
Revision 7 (+617 -17)
-
Tool: PEP8 Style Checker Processed Files: checklist/checklist/models.py checklist/checklist/resources/checklist_template.py checklist/checklist/extension.py checklist/checklist/resources/__init__.py checklist/checklist/resources/checklist_resource.py Ignored Files: checklist/checklist/static/css/accountpage.less checklist/checklist/static/js/models/checklistTemplate.js checklist/checklist/static/js/views/checklistAccountPageView.js Tool: Pyflakes Processed Files: checklist/checklist/models.py checklist/checklist/resources/checklist_template.py checklist/checklist/extension.py checklist/checklist/resources/__init__.py checklist/checklist/resources/checklist_resource.py Ignored Files: checklist/checklist/static/css/accountpage.less checklist/checklist/static/js/models/checklistTemplate.js checklist/checklist/static/js/views/checklistAccountPageView.js