-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
StateManager conditional states need labels and priority over the main state #165
Closed
3 tasks done
Comments
jace
added a commit
that referenced
this issue
Feb 7, 2018
jace
added a commit
that referenced
this issue
Feb 7, 2018
This breaks one test, but that test is for an internal object
jace
added a commit
that referenced
this issue
Feb 7, 2018
jace
added a commit
that referenced
this issue
Feb 7, 2018
We don't need a priority field if we just use definition order and make later definitions higher priority (so conditional states defined after the main state also take higher priority). |
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
In Funnel, we have a conditional state named
SCHEDULED
which builds on theCONFIRMED
state and confirms a linked session in the schedule.SCHEDULED
takes precedence overCONFIRMED
in the UI. A proposal that is scheduled should be listed as such and not as merely confirmed. This requires three changes:Conditional states need labels, similar to the labels inherited from the LabeledEnum (including
NameTuple
support).add_conditional_state
needs to accept alabel
parameter.proposal.state.label
(in Funnel) should return the conditional state's label instead of the main state's. To achieve this, conditional states should have apriority
field, should be pre-sorted by priority, and should be tested in order of priority to find the first match. Main states have a priority of0
and conditional states should getmax+1
unless manually specified. This will allow more than one conditional state to exist on the same main state.Sometimes we'll want a UI construct like this:
{% if proposal.state.SCHEDULED %}{{ proposal.state.SCHEDULED.label %}{% endif %}
. This can't work becausestate.NAME
is a boolean. What if it is aManagedStateWrapper
instead, which in turn implements__nonzero__
/__bool__
? Theif
condition will continue to work then.The text was updated successfully, but these errors were encountered: