Storing/restoring incomplete editor state
In some cases it can be useful to have functionality to be able to store an incomplete editor state, and then later do an enterInformation
but prefill the editor with that incomplete state. @eveen is for example building a questionnaire in which there must be a Back button. When you click Back, the answers on the current page must be stored (and restored when you get back there) even if not the entire editor has been filled in yet.
I can see how we might do this on the frontend: add functions to every Component
to serialize/deserialize the state; container components would recurse. But how do we get that information in the backend? Perhaps we can add an editor modifier withIncompleteState :: (Editor a) -> Editor (Either JSONNode a)
or -> Editor (JSONNode, ?a)
, which always has a value (the JSON being the representation of the incomplete value)? But this messes with functions like hasValue
: a button with hasValue
should not be enabled when you use an Either JSONNode a
editor and there is an incomplete value.
@baslijns do you have ideas about this? (Perhaps the new editors already make this easier?)