Commit 28929fe4 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[CLEAN] FIXME: subtree needs a shape

parent cfae041b
...@@ -10,14 +10,7 @@ ...@@ -10,14 +10,7 @@
&.disabled &.disabled
cursor: wait cursor: wait
.node .node
padding-left: 10px
margin-top: 1px margin-top: 1px
.name
&.clickable
color: #337ab7
cursor: pointer
&:hover
text-decoration: underline
.lefthanded .lefthanded
ul ul
margin-right : 19px margin-right : 19px
......
...@@ -37,8 +37,7 @@ mergeNodeCpt = R.hooksComponent "G.C.F.T.N.A.M.mergeNode" cpt ...@@ -37,8 +37,7 @@ mergeNodeCpt = R.hooksComponent "G.C.F.T.N.A.M.mergeNode" cpt
Nothing -> H.div {} [] Nothing -> H.div {} []
_ -> H.div {} [] _ -> H.div {} []
pure $ panel [ pure $ panel [ subTreeView { action
subTreeView { action
, dispatch , dispatch
, id , id
, nodeType , nodeType
...@@ -46,13 +45,13 @@ mergeNodeCpt = R.hooksComponent "G.C.F.T.N.A.M.mergeNode" cpt ...@@ -46,13 +45,13 @@ mergeNodeCpt = R.hooksComponent "G.C.F.T.N.A.M.mergeNode" cpt
, subTreeParams , subTreeParams
, handed , handed
} }
, H.div { className:"panel panel-primary"} , H.div { className:"panel panel-primary"}
[ H.text "Merge which list?" [ H.text "Merge which list?"
, checkboxes [GT.MapTerm, GT.CandidateTerm, GT.StopTerm] options , checkboxes [GT.MapTerm, GT.CandidateTerm, GT.StopTerm] options
] ]
, H.div { className:"panel panel-primary"} , H.div { className:"panel panel-primary"}
[ H.text "Title" [ H.text "Title"
, H.div {className: "checkbox"} , H.div {className: "checkbox"}
[checkbox merge, H.text "Merge data?"] [checkbox merge, H.text "Merge data?"]
] ]
] button ] button
...@@ -83,12 +83,13 @@ subTreeViewLoaded props = R.createElement subTreeViewLoadedCpt props [] ...@@ -83,12 +83,13 @@ subTreeViewLoaded props = R.createElement subTreeViewLoadedCpt props []
subTreeViewLoadedCpt :: R.Component CorpusTreeProps subTreeViewLoadedCpt :: R.Component CorpusTreeProps
subTreeViewLoadedCpt = R.hooksComponent "G.C.F.T.N.A.U.subTreeViewLoadedCpt" cpt subTreeViewLoadedCpt = R.hooksComponent "G.C.F.T.N.A.U.subTreeViewLoadedCpt" cpt
where where
cpt p@{dispatch, id, nodeType, session, tree} _ = do cpt p@{dispatch, id, nodeType, session, tree, handed} _ = do
pure $ H.div {className:"panel panel-primary"} pure $ H.div {className:"tree"}
[H.div { className: "tree" } [H.div { className: if handed == GT.RightHanded
[ H.div { className: "" } then "righthanded"
[ subTreeTreeView p ] else "lefthanded"
] }
[ subTreeTreeView p ]
] ]
subTreeTreeView :: Record CorpusTreeProps -> R.Element subTreeTreeView :: Record CorpusTreeProps -> R.Element
...@@ -113,13 +114,14 @@ subTreeTreeViewCpt = R.hooksComponent "G.C.F.T.N.A.U.subTreeTreeViewCpt" cpt ...@@ -113,13 +114,14 @@ subTreeTreeViewCpt = R.hooksComponent "G.C.F.T.N.A.U.subTreeTreeViewCpt" cpt
GT.LeftHanded -> A.reverse GT.LeftHanded -> A.reverse
GT.RightHanded -> identity GT.RightHanded -> identity
pure $ H.div { className: if handed == GT.RightHanded pure $ H.div {} $ (ordering [ H.div { className: "node " <> GT.fldr nodeType true} []
then "righthanded" , H.span { style : if validNodeType
else "lefthanded" then { color : "blue"
} $ (ordering [ H.div { className: "node " <> GT.fldr nodeType true} [] , "text-decoration": "underline"
, H.span { style : if validNodeType }
then { color : "blue", "text-decoration": "underline"} else { color : ""
else { color : "" , "text-decoration": "none"} , "text-decoration": "none"
}
, on: { click: onClick } , on: { click: onClick }
} }
[ nodeText { isSelected: isSelected targetId valAction [ nodeText { isSelected: isSelected targetId valAction
...@@ -133,7 +135,7 @@ subTreeTreeViewCpt = R.hooksComponent "G.C.F.T.N.A.U.subTreeTreeViewCpt" cpt ...@@ -133,7 +135,7 @@ subTreeTreeViewCpt = R.hooksComponent "G.C.F.T.N.A.U.subTreeTreeViewCpt" cpt
where where
SubTreeParams { valitypes } = subTreeParams SubTreeParams { valitypes } = subTreeParams
sortedAry = A.sortWith (\(NTree (LNode {id:id'}) _) -> id') sortedAry = A.sortWith (\(NTree (LNode {id:id'}) _) -> id')
$ A.filter (\(NTree (LNode {id:id'}) _) -> id'/= id) ary $ A.filter (\(NTree (LNode {id:id'}) _) -> id'/= id) ary
......
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