Commit 7199cfcd authored by Steffen Michels's avatar Steffen Michels

expose invalid current editor states in conflict resolution functions of UpdateSharedOption

parent baa90b4e
......@@ -27,9 +27,9 @@ from Data.Functor import class Functor
//The first argument is the new view as computed from the changed sds,
//and the second argument is the edited view by the user.
:: UpdateSharedOption a b
= E.v: UpdateSharedAs (a -> v) (a v -> b) (v v -> v) & iTask v
| E.v: UpdateSharedUsing (a -> v) (a v -> b) (v v -> v) (Editor v) & iTask v
| E.v: UpdateSharedUsingAuto (a -> Maybe v) (a v -> b) (v v -> v) (Editor v) & iTask v
= E.v: UpdateSharedAs (a -> v) (a v -> b) (v (Maybe v) -> v) & iTask v
| E.v: UpdateSharedUsing (a -> v) (a v -> b) (v (Maybe v) -> v) (Editor v) & iTask v
| E.v: UpdateSharedUsingAuto (a -> Maybe v) (a v -> b) (v (Maybe v) -> v) (Editor v) & iTask v
//Selection in arbitrary containers (explicit identification is needed)
:: SelectOption c s
......
......@@ -113,11 +113,11 @@ updateInformation` (UpdateUsing tof fromf editor) m
updateSharedInformation :: ![UpdateSharedOption r w] !(sds () r w) -> Task r | iTask r & iTask w & RWShared sds
updateSharedInformation options sds = updateSharedInformation` (updateSharedEditor options) sds
updateSharedInformation` (UpdateSharedUsing tof fromf conflictf editor) sds
= interactRW sds {onInit = \r -> (r, Update $ tof r), onEdit = \v l -> (l, Just (\r -> fromf r v)), onRefresh = \r _ (Just v) -> (r,conflictf (tof r) v, Nothing)}
= interactRW sds {onInit = \r -> (r, Update $ tof r), onEdit = \v l -> (l, Just (\r -> fromf r v)), onRefresh = \r _ v -> (r,conflictf (tof r) v, Nothing)}
editor @ fst
updateSharedInformation` (UpdateSharedUsingAuto tof fromf conflictf editor) sds
= interactRW sds {onInit = \r -> (r, maybe Enter Update (tof r)), onEdit = \v l -> (l, Just (\r -> fromf r v))
, onRefresh = \r _ (Just v) -> (r, maybe v (\r` -> conflictf r` v) (tof r), Nothing)}
, onRefresh = \r _ v -> (r, maybe undef (\r` -> conflictf r` v) (tof r), Nothing)}
editor @ fst
viewSharedInformation :: ![ViewOption r] !(sds () r w) -> Task r | iTask r & TC w & Registrable sds
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment