[Checklist] Adding support for auto adding checklist templates to new checklists

Review Request #8013 — Created Feb. 28, 2016 and updated

imadueme
rb-extension-pack
master
7960
rb-extension-pack, students

Added support for automatically adding checklist templates to all new review
checklists for a user.

Added an evolution which adds a field, 'auto_add' to ChecklistTemplate that
determines whether they should be added to all new checklists made by the user.
In the UI this is represented with a checkbox as shown in the attachment below.

The templates are added when the checklist is created which happens the first
time a user loads the diff page for a review they haven't seen before.

Additional templates and items can still be added to a checklist that was
initially populated with default template items.

These changes depend on the changes in review request #7960.

Manually ensured that the evolution migration worked without errors on
reviewboard-2.5.x with the previous checklist schema.

Ensured that the auto add fields toggle correctly and get loaded
correctly on the templates page in My Accounts.

Ensured that new only those templates marked with the auto add flag are
added to every new review checklist created by the user.

Regression testing to confirm that making templates, adding checklist
items, checking them off, deleting them, and so on still work.

Loading file attachments...

Description From Last Updated

Col: 21 E711 comparison to None should be 'if cond is not None:'

reviewbotreviewbot

Col: 29 E271 multiple spaces after keyword

reviewbotreviewbot
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        checklist/checklist/evolutions/__init__.py
        checklist/checklist/models.py
        checklist/checklist/resources/checklist_template.py
        checklist/checklist/evolutions/add_auto_add.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/evolutions/__init__.py
        checklist/checklist/models.py
        checklist/checklist/resources/checklist_template.py
        checklist/checklist/evolutions/add_auto_add.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
    
    
  2. Col: 21
     E711 comparison to None should be 'if cond is not None:'
    
  3. 
      
imadueme
  1. 
      
  2. WIP test code, missing load of auto-added templates

  3. 
      
imadueme
imadueme
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        checklist/checklist/evolutions/__init__.py
        checklist/checklist/models.py
        checklist/checklist/resources/checklist_template.py
        checklist/checklist/evolutions/add_auto_add.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/evolutions/__init__.py
        checklist/checklist/models.py
        checklist/checklist/resources/checklist_template.py
        checklist/checklist/evolutions/add_auto_add.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
    
    
  2. Col: 29
     E271 multiple spaces after keyword
    
  3. 
      
imadueme
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        checklist/checklist/evolutions/__init__.py
        checklist/checklist/models.py
        checklist/checklist/resources/checklist_template.py
        checklist/checklist/evolutions/add_auto_add.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/evolutions/__init__.py
        checklist/checklist/models.py
        checklist/checklist/resources/checklist_template.py
        checklist/checklist/evolutions/add_auto_add.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
    
    
  2. 
      
imadueme
Review request changed

Change Summary:

Updated review request info

Summary:

-[WIP] [Checklist] Adding support for auto adding checklist templates to new checklists
+[Checklist] Adding support for auto adding checklist templates to new checklists

Description:

~  

Adding support for auto adding checklist templates to new checklists

  ~

Added support for automatically adding checklist templates to all new review

  + checklists for a user.

   
~  

Added an evolution so that checklist templates have a field for the user

~   to flag to determine whether they should be added to all new checklists
~   made by the user.

  ~

Added an evolution which adds a field, 'auto_add' to ChecklistTemplate that

  ~ determines whether they should be added to all new checklists made by the user.
  ~ In the UI this is represented with a checkbox as shown in the attachment below.

   
~  

Added UI as shown in the attached image for checking them off.

  ~

The templates are added when the checklist is created which happens the first

  + time a user loads the diff page for a review they haven't seen before.

   
~  

All that's missing is in the checklist_resources.py#create method

~   if the checklist was newly created search for all auto added templates
~   and automatically add them.

  ~

Additional templates and items can still be added to a checklist that was

  ~ initially populated with default template items.

  ~
  +

These changes depend on the changes in review request #7960.

Testing Done:

~  

Manually ensured that the evolution and UI works to properly save the boolean

~   field that determines whether a checklist should be auto added.

  ~

Manually ensured that the evolution migration worked without errors on

  ~ reviewboard-2.5.x with the previous checklist schema.

  +
  +

Ensured that the auto add fields toggle correctly and get loaded

  + correctly on the templates page in My Accounts.

  +
  +

Ensured that new only those templates marked with the auto add flag are

  + added to every new review checklist created by the user.

  +
  +

Regression testing to confirm that making templates, adding checklist

  + items, checking them off, deleting them, and so on still work.

Loading...