Pink - Persistent data
Design
Axioms
- By default, all parameters are editable.
- Parameters values can be set by:
- Action default
- Action config
- Recipe config
- User
- The overriding order is: Action default < Action config < Recipe config < User
-
Profiles are a new DB entity storing:
- Action parameters values
- Element state (checked or not)
- Content state (checked or not)
Scenarii
When loading
- For each element:
- For each action:
- For each parameter:
- Set default value from action (if exists)
- Set value from flow (if exists)
- Set value from profile (if parameter is editable, and if exists)
- For each parameter:
- For each action:
When editing
- If parameter is editable (the UI should not allow it otherwise, but the validation must be on the API side, not UI):
- Save new value to the action object
When closing
- For each element:
- Store checked state
- For each action:
- For each parameter:
- Store value
- For each parameter:
When executing (action)
- Get default value (from action object)
- Get action value if any
- Get user value if any
- If user value and not editable: raise exception
When executing (recipe)
- Get default value (from action object)
- Get action value if any
- Get recipe value if any
- Get user value if any
- If user value and not editable: raise exception
- If user value and user value different from recipe value: raise exception (if execute(safe==False))
Entities
Profiles
- Properties:
- slug
- name
- description
- Attached to version? or document?
Scopes
- The flow object is in charge of collecting the profile data
Problems/Questions
- If the type of parameter is changed?
- How are profiles moved from version to version?
- When an element is deleted, it should also be deleted from the profile, in case later a new element with the same slug is created?
- What about multi-selection?
- If no preset value: OK
- If same preset value: OK
- If different preset value:
- Grey UI
- Allow to set the value after warning that it will apply this new value for all elements (or give the choice to make it a temporary value, that doesn't affect the preset value of each element)
Tasks
-
Design -
Breakdown tasks -
Implement snapshot to dict at Moka closing -
Implement data populate from dict profile -
Editing a value updates the Action wrapper -
Executing a standalone action reads the right parameters values -
Executing a reciped action reads the right parameters values -
Implement Profiles in link -
Review pending problems
Edited by Corentin