Add an "Always match" mode to conditions.

Review Request #8424 — Created Sept. 21, 2016 and submitted

david
Djblets
release-0.10.x
3b90216...
djblets

Conditions are great, but sometimes you don't actually need them. Perhaps
someone is writing an integration with a chat service where they don't actually
care to limit which items get posted. Or an automatic review tool which should
run against all review requests, no matter what.

This change adds a new "Always match" mode to ConditionSet. When this is
chosen, the conditions list is hidden entirely, and the condition set will
always evaluate as matching.

This also contains a small fix to allow the condition form to load even when
the default value is empty (None).

  • Ran unit tests.
  • Used this in conjunction with a test integration.
Description From Last Updated

Missing a trailing period.

chipx86chipx86

Probably time we have a constant of valid modes that this and the one below can use for this check.

chipx86chipx86

Col: 13 E731 do not assign a lambda expression, use a def

reviewbotreviewbot

This should also set mode (probably to always now, but it'd be good to have a constant for the default ...

chipx86chipx86

Since we have _$rowsContainer now, can you update the selector for _$rows to check within the .children() of that?

chipx86chipx86

This should use events above.

chipx86chipx86

Col: 13 E731 do not assign a lambda expression, use a def

reviewbotreviewbot
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        djblets/conditions/conditions.py
        djblets/forms/tests/test_conditions_widget.py
        djblets/forms/widgets.py
        djblets/forms/fields.py
        djblets/conditions/tests/test_conditions.py
    
    Ignored Files:
        djblets/static/djblets/js/forms/views/conditionSetView.es6.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        djblets/conditions/conditions.py
        djblets/forms/tests/test_conditions_widget.py
        djblets/forms/widgets.py
        djblets/forms/fields.py
        djblets/conditions/tests/test_conditions.py
    
    Ignored Files:
        djblets/static/djblets/js/forms/views/conditionSetView.es6.js
    
    
  2. djblets/conditions/conditions.py (Diff revision 1)
     
     
    Col: 13
     E731 do not assign a lambda expression, use a def
    
  3. 
      
chipx86
  1. Nice addition.

  2. djblets/conditions/conditions.py (Diff revision 1)
     
     

    Missing a trailing period.

  3. djblets/conditions/conditions.py (Diff revision 1)
     
     

    Probably time we have a constant of valid modes that this and the one below can use for this check.

  4. djblets/forms/fields.py (Diff revision 1)
     
     
     
     

    This should also set mode (probably to always now, but it'd be good to have a constant for the default mode).

  5. Since we have _$rowsContainer now, can you update the selector for _$rows to check within the .children() of that?

  6. This should use events above.

  7. 
      
david
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        djblets/conditions/conditions.py
        djblets/forms/tests/test_conditions_widget.py
        djblets/forms/widgets.py
        djblets/forms/fields.py
        djblets/conditions/tests/test_conditions.py
    
    Ignored Files:
        djblets/static/djblets/js/forms/views/conditionSetView.es6.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        djblets/conditions/conditions.py
        djblets/forms/tests/test_conditions_widget.py
        djblets/forms/widgets.py
        djblets/forms/fields.py
        djblets/conditions/tests/test_conditions.py
    
    Ignored Files:
        djblets/static/djblets/js/forms/views/conditionSetView.es6.js
    
    
  2. djblets/conditions/conditions.py (Diff revision 2)
     
     
    Col: 13
     E731 do not assign a lambda expression, use a def
    
  3. 
      
chipx86
  1. Ship It!
  2. 
      
david
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-0.10.x (a34b157)
Loading...