Commit c53119e0 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[FIX] subtree

parent 79910d34
...@@ -43,7 +43,9 @@ subTreeOut (LinkNode {params}) = params ...@@ -43,7 +43,9 @@ subTreeOut (LinkNode {params}) = params
subTreeOut _ = Nothing subTreeOut _ = Nothing
setTreeOut :: Action -> Maybe SubTreeOut -> Action setTreeOut :: Action -> Maybe SubTreeOut -> Action
setTreeOut (MoveNode {params:_}) p = MoveNode {params: p} setTreeOut (MoveNode {params:_}) p = MoveNode {params: p}
setTreeOut (MergeNode {params:_}) p = MergeNode {params: p}
setTreeOut (LinkNode {params:_}) p = LinkNode {params: p}
setTreeOut a _ = a setTreeOut a _ = a
......
...@@ -22,11 +22,11 @@ linkNodeReq session fromId toId = ...@@ -22,11 +22,11 @@ linkNodeReq session fromId toId =
linkNode :: Record SubTreeParamsIn -> R.Hooks R.Element linkNode :: Record SubTreeParamsIn -> R.Hooks R.Element
linkNode p@{dispatch, subTreeParams, id, nodeType, session} = do linkNode p@{dispatch, subTreeParams, id, nodeType, session} = do
action@(valAction /\ setAction) :: R.State Action <- R.useState' (MoveNode {params:Nothing}) action@(valAction /\ setAction) :: R.State Action <- R.useState' (LinkNode {params:Nothing})
let button = case valAction of let button = case valAction of
MoveNode {params} -> case params of LinkNode {params} -> case params of
Just val -> submitButton (MoveNode {params: Just val}) dispatch Just val -> submitButton (LinkNode {params: Just val}) dispatch
Nothing -> H.div {} [] Nothing -> H.div {} []
_ -> H.div {} [] _ -> H.div {} []
......
...@@ -22,14 +22,14 @@ mergeNodeReq session fromId toId = ...@@ -22,14 +22,14 @@ mergeNodeReq session fromId toId =
mergeNode :: Record SubTreeParamsIn -> R.Hooks R.Element mergeNode :: Record SubTreeParamsIn -> R.Hooks R.Element
mergeNode p@{dispatch, subTreeParams, id, nodeType, session} = do mergeNode p@{dispatch, subTreeParams, id, nodeType, session} = do
action@(valAction /\ setAction) :: R.State Action <- R.useState' (MoveNode {params:Nothing}) action@(valAction /\ setAction) :: R.State Action <- R.useState' (MergeNode {params:Nothing})
merge <- R.useState' false merge <- R.useState' false
options <- R.useState' (Set.singleton GT.MapTerm) options <- R.useState' (Set.singleton GT.MapTerm)
let button = case valAction of let button = case valAction of
MoveNode {params} -> case params of MergeNode {params} -> case params of
Just val -> submitButton (MoveNode {params: Just val}) dispatch Just val -> submitButton (MergeNode {params: Just val}) dispatch
Nothing -> H.div {} [] Nothing -> H.div {} []
_ -> H.div {} [] _ -> H.div {} []
......
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