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

[ACCESSIBILTY] SubTree handed (needs SASS/CSS fix).

parent c2ae2ae4
...@@ -202,16 +202,4 @@ a:focus, a:hover { ...@@ -202,16 +202,4 @@ a:focus, a:hover {
cursor: pointer; cursor: pointer;
} }
.copy-from-corpus .tree .node {
padding-left: 10px;
margin-top: 5px;
}
.copy-from-corpus .tree .node .name.clickable {
color: #337ab7;
cursor: pointer;
}
.copy-from-corpus .tree .node .name.clickable:hover {
text-decoration: underline;
}
/*# sourceMappingURL=Login.css.map */ /*# sourceMappingURL=Login.css.map */
...@@ -183,19 +183,6 @@ li ...@@ -183,19 +183,6 @@ li
display: flex display: flex
justify-content: space-between justify-content: space-between
a:focus, a:hover a:focus, a:hover
cursor: pointer cursor: pointer
.copy-from-corpus
.tree
.node
padding-left: 10px
margin-top: 5px
.name
&.clickable
color: #337ab7
cursor: pointer
&:hover
text-decoration: underline
...@@ -13,6 +13,17 @@ ...@@ -13,6 +13,17 @@
.tree .node-actions .update-button.disabled { .tree .node-actions .update-button.disabled {
cursor: wait; cursor: wait;
} }
.tree .node {
padding-left: 10px;
margin-top: 1px;
}
.tree .node .name.clickable {
color: #337ab7;
cursor: pointer;
}
.tree .node .name.clickable:hover {
text-decoration: underline;
}
.tree .lefthanded ul { .tree .lefthanded ul {
margin-right: 19px; margin-right: 19px;
} }
......
...@@ -9,6 +9,15 @@ ...@@ -9,6 +9,15 @@
cursor: pointer cursor: pointer
&.disabled &.disabled
cursor: wait cursor: wait
.node
padding-left: 10px
margin-top: 1px
.name
&.clickable
color: #337ab7
cursor: pointer
&:hover
text-decoration: underline
.lefthanded .lefthanded
ul ul
margin-right : 19px margin-right : 19px
...@@ -21,7 +30,6 @@ ...@@ -21,7 +30,6 @@
.leaf .leaf
justify-content : flex-start justify-content : flex-start
// based on https://codeburst.io/how-to-pure-css-pie-charts-w-css-variables-38287aea161e // based on https://codeburst.io/how-to-pure-css-pie-charts-w-css-variables-38287aea161e
.progress-pie .progress-pie
background: rgba(51, 122, 183, 0.1) background: rgba(51, 122, 183, 0.1)
......
...@@ -44,7 +44,6 @@ type NodeMainSpanProps = ...@@ -44,7 +44,6 @@ type NodeMainSpanProps =
, name :: Name , name :: Name
, nodeType :: GT.NodeType , nodeType :: GT.NodeType
, tasks :: Record Tasks , tasks :: Record Tasks
, handed :: GT.Handed
| CommonProps | CommonProps
) )
...@@ -77,7 +76,9 @@ nodeMainSpan p@{ dispatch, folderOpen, frontends, handed, session } = R.createEl ...@@ -77,7 +76,9 @@ nodeMainSpan p@{ dispatch, folderOpen, frontends, handed, session } = R.createEl
(sessionId session) id (sessionId session) id
, name: name' props , name: name' props
, nodeType , nodeType
, session } , session
, handed
}
, fileTypeView { dispatch, droppedFile, id, isDragOver, nodeType } , fileTypeView { dispatch, droppedFile, id, isDragOver, nodeType }
, H.div {} (map (\t -> asyncProgressBar { asyncTask: t , H.div {} (map (\t -> asyncProgressBar { asyncTask: t
...@@ -148,6 +149,7 @@ nodeMainSpan p@{ dispatch, folderOpen, frontends, handed, session } = R.createEl ...@@ -148,6 +149,7 @@ nodeMainSpan p@{ dispatch, folderOpen, frontends, handed, session } = R.createEl
, nodeType , nodeType
, onPopoverClose , onPopoverClose
, session , session
, handed : props.handed
} }
dropProps droppedFile isDragOver = dropProps droppedFile isDragOver =
......
...@@ -58,7 +58,7 @@ linkNode p = R.createElement linkNodeCpt p [] ...@@ -58,7 +58,7 @@ linkNode p = R.createElement linkNodeCpt p []
linkNodeCpt :: R.Component SubTreeParamsIn linkNodeCpt :: R.Component SubTreeParamsIn
linkNodeCpt = R.hooksComponent "G.C.F.T.N.A.L.linkNode" cpt linkNodeCpt = R.hooksComponent "G.C.F.T.N.A.L.linkNode" cpt
where where
cpt p@{dispatch, subTreeParams, id, nodeType, session} _ = do cpt p@{dispatch, subTreeParams, id, nodeType, session, handed} _ = do
action@(valAction /\ setAction) :: R.State Action <- R.useState' (LinkNode {nodeType:Nothing,params:Nothing}) action@(valAction /\ setAction) :: R.State Action <- R.useState' (LinkNode {nodeType:Nothing,params:Nothing})
...@@ -75,5 +75,6 @@ linkNodeCpt = R.hooksComponent "G.C.F.T.N.A.L.linkNode" cpt ...@@ -75,5 +75,6 @@ linkNodeCpt = R.hooksComponent "G.C.F.T.N.A.L.linkNode" cpt
, nodeType , nodeType
, session , session
, subTreeParams , subTreeParams
, handed
} }
] button ] button
...@@ -25,7 +25,7 @@ mergeNode p = R.createElement mergeNodeCpt p [] ...@@ -25,7 +25,7 @@ mergeNode p = R.createElement mergeNodeCpt p []
mergeNodeCpt :: R.Component SubTreeParamsIn mergeNodeCpt :: R.Component SubTreeParamsIn
mergeNodeCpt = R.hooksComponent "G.C.F.T.N.A.M.mergeNode" cpt mergeNodeCpt = R.hooksComponent "G.C.F.T.N.A.M.mergeNode" cpt
where where
cpt p@{dispatch, subTreeParams, id, nodeType, session} _ = do cpt p@{dispatch, subTreeParams, id, nodeType, session, handed} _ = do
action@(valAction /\ setAction) :: R.State Action <- R.useState' (MergeNode {params:Nothing}) action@(valAction /\ setAction) :: R.State Action <- R.useState' (MergeNode {params:Nothing})
merge <- R.useState' false merge <- R.useState' false
...@@ -44,6 +44,7 @@ mergeNodeCpt = R.hooksComponent "G.C.F.T.N.A.M.mergeNode" cpt ...@@ -44,6 +44,7 @@ mergeNodeCpt = R.hooksComponent "G.C.F.T.N.A.M.mergeNode" cpt
, nodeType , nodeType
, session , session
, subTreeParams , subTreeParams
, handed
} }
, H.div { className:"panel panel-primary"} , H.div { className:"panel panel-primary"}
[ H.text "Merge which list?" [ H.text "Merge which list?"
......
...@@ -24,7 +24,7 @@ moveNode p = R.createElement moveNodeCpt p [] ...@@ -24,7 +24,7 @@ moveNode p = R.createElement moveNodeCpt p []
moveNodeCpt :: R.Component SubTreeParamsIn moveNodeCpt :: R.Component SubTreeParamsIn
moveNodeCpt = R.hooksComponent "G.C.F.T.N.A.M.moveNode" cpt moveNodeCpt = R.hooksComponent "G.C.F.T.N.A.M.moveNode" cpt
where where
cpt p@{dispatch, subTreeParams, id, nodeType, session} _ = do cpt p@{dispatch, subTreeParams, id, nodeType, session, handed} _ = do
action@(valAction /\ setAction) :: R.State Action <- R.useState' (MoveNode {params: Nothing}) action@(valAction /\ setAction) :: R.State Action <- R.useState' (MoveNode {params: Nothing})
let button = case valAction of let button = case valAction of
...@@ -39,5 +39,6 @@ moveNodeCpt = R.hooksComponent "G.C.F.T.N.A.M.moveNode" cpt ...@@ -39,5 +39,6 @@ moveNodeCpt = R.hooksComponent "G.C.F.T.N.A.M.moveNode" cpt
, nodeType , nodeType
, session , session
, subTreeParams , subTreeParams
, handed
} }
] button ] button
...@@ -57,7 +57,7 @@ shareNode p = R.createElement shareNodeCpt p [] ...@@ -57,7 +57,7 @@ shareNode p = R.createElement shareNodeCpt p []
shareNodeCpt :: R.Component SubTreeParamsIn shareNodeCpt :: R.Component SubTreeParamsIn
shareNodeCpt = R.hooksComponent "G.C.F.T.N.A.M.shareNode" cpt shareNodeCpt = R.hooksComponent "G.C.F.T.N.A.M.shareNode" cpt
where where
cpt p@{dispatch, subTreeParams, id, nodeType, session} _ = do cpt p@{dispatch, subTreeParams, id, nodeType, session, handed} _ = do
action@(valAction /\ setAction) :: R.State Action <- R.useState' (Action.SharePublic {params: Nothing}) action@(valAction /\ setAction) :: R.State Action <- R.useState' (Action.SharePublic {params: Nothing})
let button = case valAction of let button = case valAction of
...@@ -67,11 +67,12 @@ shareNodeCpt = R.hooksComponent "G.C.F.T.N.A.M.shareNode" cpt ...@@ -67,11 +67,12 @@ shareNodeCpt = R.hooksComponent "G.C.F.T.N.A.M.shareNode" cpt
_ -> H.div {} [] _ -> H.div {} []
pure $ Tools.panel [ subTreeView { action pure $ Tools.panel [ subTreeView { action
, dispatch , dispatch
, id , id
, nodeType , nodeType
, session , session
, subTreeParams , subTreeParams
} , handed
}
] button ] button
...@@ -180,6 +180,7 @@ nodePopupCpt = R.hooksComponent "G.C.F.T.N.B.nodePopupView" cpt ...@@ -180,6 +180,7 @@ nodePopupCpt = R.hooksComponent "G.C.F.T.N.B.nodePopupView" cpt
, nodePopup: Just NodePopup , nodePopup: Just NodePopup
, nodeType : props.nodeType , nodeType : props.nodeType
, session : props.session , session : props.session
, handed : props.handed
} }
type ActionState = type ActionState =
...@@ -252,6 +253,7 @@ type PanelActionProps = ...@@ -252,6 +253,7 @@ type PanelActionProps =
, nodePopup :: Maybe NodePopup , nodePopup :: Maybe NodePopup
, nodeType :: GT.NodeType , nodeType :: GT.NodeType
, session :: Session , session :: Session
, handed :: GT.Handed
) )
panelAction :: Record PanelActionProps -> R.Element panelAction :: Record PanelActionProps -> R.Element
...@@ -275,14 +277,14 @@ panelActionCpt = R.hooksComponent "G.C.F.T.N.B.panelAction" cpt ...@@ -275,14 +277,14 @@ panelActionCpt = R.hooksComponent "G.C.F.T.N.B.panelAction" cpt
----------- -----------
-- Functions using SubTree -- Functions using SubTree
cpt {action: Merge {subTreeParams}, dispatch, id, nodeType, session} _ = do cpt {action: Merge {subTreeParams}, dispatch, id, nodeType, session, handed} _ = do
pure $ mergeNode {dispatch, id, nodeType, session, subTreeParams} pure $ mergeNode {dispatch, id, nodeType, session, subTreeParams, handed}
cpt {action: Move {subTreeParams}, dispatch, id, nodeType, session} _ = do cpt {action: Move {subTreeParams}, dispatch, id, nodeType, session, handed} _ = do
pure $ moveNode {dispatch, id, nodeType, session, subTreeParams} pure $ moveNode {dispatch, id, nodeType, session, subTreeParams, handed}
cpt {action: Link {subTreeParams}, dispatch, id, nodeType, session} _ = do cpt {action: Link {subTreeParams}, dispatch, id, nodeType, session, handed} _ = do
pure $ linkNode {dispatch, id, nodeType, session, subTreeParams} pure $ linkNode {dispatch, id, nodeType, session, subTreeParams, handed}
----------- -----------
cpt {action : Share, dispatch, id, name } _ = do cpt {action : Share, dispatch, id, name } _ = do
...@@ -308,8 +310,8 @@ panelActionCpt = R.hooksComponent "G.C.F.T.N.B.panelAction" cpt ...@@ -308,8 +310,8 @@ panelActionCpt = R.hooksComponent "G.C.F.T.N.B.panelAction" cpt
cpt {action : Publish {subTreeParams}, dispatch, id, nodeType, session } _ = do cpt {action : Publish {subTreeParams}, dispatch, id, nodeType, session, handed} _ = do
pure $ Share.shareNode {dispatch, id, nodeType, session, subTreeParams} pure $ Share.shareNode {dispatch, id, nodeType, session, subTreeParams, handed}
cpt props@{action: SearchBox, id, session, dispatch, nodePopup} _ = cpt props@{action: SearchBox, id, session, dispatch, nodePopup} _ =
......
...@@ -14,6 +14,7 @@ import Gargantext.Types as GT ...@@ -14,6 +14,7 @@ import Gargantext.Types as GT
type CommonProps = type CommonProps =
( dispatch :: Action -> Aff Unit ( dispatch :: Action -> Aff Unit
, session :: Session , session :: Session
, handed :: GT.Handed
) )
type NodePopupProps = type NodePopupProps =
......
...@@ -273,6 +273,7 @@ type NodeLinkProps = ( ...@@ -273,6 +273,7 @@ type NodeLinkProps = (
, name :: Name , name :: Name
, nodeType :: GT.NodeType , nodeType :: GT.NodeType
, session :: Session , session :: Session
, handed :: GT.Handed
) )
nodeLink :: Record NodeLinkProps -> R.Element nodeLink :: Record NodeLinkProps -> R.Element
...@@ -281,7 +282,7 @@ nodeLink p = R.createElement nodeLinkCpt p [] ...@@ -281,7 +282,7 @@ nodeLink p = R.createElement nodeLinkCpt p []
nodeLinkCpt :: R.Component NodeLinkProps nodeLinkCpt :: R.Component NodeLinkProps
nodeLinkCpt = R.hooksComponent "G.C.F.T.N.T.nodeLink" cpt nodeLinkCpt = R.hooksComponent "G.C.F.T.N.T.nodeLink" cpt
where where
cpt { frontends, id, isSelected, name, nodeType, session } _ = do cpt { frontends, id, isSelected, name, nodeType, session, handed} _ = do
popoverRef <- R.useRef null popoverRef <- R.useRef null
pure $ pure $
...@@ -289,6 +290,7 @@ nodeLinkCpt = R.hooksComponent "G.C.F.T.N.T.nodeLink" cpt ...@@ -289,6 +290,7 @@ nodeLinkCpt = R.hooksComponent "G.C.F.T.N.T.nodeLink" cpt
, href: url frontends $ GT.NodePath (sessionId session) nodeType (Just id) } , href: url frontends $ GT.NodePath (sessionId session) nodeType (Just id) }
[ nodeText { isSelected [ nodeText { isSelected
, name , name
, handed
} }
] ]
, ReactTooltip.reactTooltip { id: tooltipId } , ReactTooltip.reactTooltip { id: tooltipId }
...@@ -308,6 +310,7 @@ nodeLinkCpt = R.hooksComponent "G.C.F.T.N.T.nodeLink" cpt ...@@ -308,6 +310,7 @@ nodeLinkCpt = R.hooksComponent "G.C.F.T.N.T.nodeLink" cpt
type NodeTextProps = type NodeTextProps =
( isSelected :: Boolean ( isSelected :: Boolean
, name :: Name , name :: Name
, handed :: GT.Handed
) )
nodeText :: Record NodeTextProps -> R.Element nodeText :: Record NodeTextProps -> R.Element
...@@ -322,8 +325,10 @@ nodeTextCpt = R.hooksComponent "G.C.F.T.N.T.nodeText" cpt ...@@ -322,8 +325,10 @@ nodeTextCpt = R.hooksComponent "G.C.F.T.N.T.nodeText" cpt
H.text ("| " <> name15 name <> " | ") H.text ("| " <> name15 name <> " | ")
] ]
] ]
cpt {isSelected: false, name} _ = do cpt {isSelected: false, name, handed} _ = do
pure $ H.text (name15 name) pure $ if handed == GT.RightHanded
then H.text "..." <> H.text (name15 name)
else H.text (name15 name) <> H.text "..."
name len n = if S.length n < len then name len n = if S.length n < len then
n n
......
...@@ -10,7 +10,7 @@ import Gargantext.Components.Forest.Tree.Node.Tools.SubTree.Types (SubTreeParams ...@@ -10,7 +10,7 @@ import Gargantext.Components.Forest.Tree.Node.Tools.SubTree.Types (SubTreeParams
import Gargantext.Components.Forest.Tree.Node.Tools.FTree (FTree, LNode(..), NTree(..)) import Gargantext.Components.Forest.Tree.Node.Tools.FTree (FTree, LNode(..), NTree(..))
import Gargantext.Components.Forest.Tree.Node.Tools (nodeText) import Gargantext.Components.Forest.Tree.Node.Tools (nodeText)
import Gargantext.Hooks.Loader (useLoader) import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Prelude (map, pure, show, ($), (&&), (/=), (<>), const, (==){-, discard, bind, void-}) import Gargantext.Prelude (map, pure, show, ($), (&&), (/=), (<>), const, (==), identity{-, discard, bind, void-})
import Gargantext.Routes as GR import Gargantext.Routes as GR
import Gargantext.Sessions (Session(..), get) import Gargantext.Sessions (Session(..), get)
import Gargantext.Types as GT import Gargantext.Types as GT
...@@ -19,6 +19,7 @@ import Reactix.DOM.HTML as H ...@@ -19,6 +19,7 @@ import Reactix.DOM.HTML as H
type SubTreeParamsIn = type SubTreeParamsIn =
( subTreeParams :: SubTreeParams ( subTreeParams :: SubTreeParams
, handed :: GT.Handed
| Props | Props
) )
...@@ -40,6 +41,7 @@ subTreeViewCpt = R.hooksComponent "G.C.F.T.N.A.U.subTreeView" cpt ...@@ -40,6 +41,7 @@ subTreeViewCpt = R.hooksComponent "G.C.F.T.N.A.U.subTreeView" cpt
, session , session
, subTreeParams , subTreeParams
, action , action
, handed
} _ = } _ =
do do
let let
...@@ -56,6 +58,7 @@ subTreeViewCpt = R.hooksComponent "G.C.F.T.N.A.U.subTreeView" cpt ...@@ -56,6 +58,7 @@ subTreeViewCpt = R.hooksComponent "G.C.F.T.N.A.U.subTreeView" cpt
, tree , tree
, subTreeParams , subTreeParams
, action , action
, handed
} }
loadSubTree :: Array GT.NodeType -> Session -> Aff FTree loadSubTree :: Array GT.NodeType -> Session -> Aff FTree
...@@ -82,9 +85,9 @@ subTreeViewLoadedCpt = R.hooksComponent "G.C.F.T.N.A.U.subTreeViewLoadedCpt" cpt ...@@ -82,9 +85,9 @@ 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} _ = do
pure $ H.div {className:"panel panel-primary"} pure $ H.div {className:"panel panel-primary"}
[H.div { className: "copy-from-corpus" } [H.div { className: "tree" }
[ H.div { className: "tree" } [ H.div { className: "" }
[subTreeTreeView p] [ subTreeTreeView p ]
] ]
] ]
...@@ -103,18 +106,30 @@ subTreeTreeViewCpt = R.hooksComponent "G.C.F.T.N.A.U.subTreeTreeViewCpt" cpt ...@@ -103,18 +106,30 @@ subTreeTreeViewCpt = R.hooksComponent "G.C.F.T.N.A.U.subTreeTreeViewCpt" cpt
, subTreeParams , subTreeParams
, dispatch , dispatch
, action , action
, handed
} _ = do } _ = do
pure $ H.div {} [ H.div { className: "node " <> GT.fldr nodeType true} let ordering =
( [ H.span { className: "name " <> clickable case handed of
, on: { click: onClick } GT.LeftHanded -> A.reverse
} [ nodeText { isSelected: isSelected targetId valAction GT.RightHanded -> identity
, name: " " <> name
} pure $ H.div { className: if handed == GT.RightHanded
] then "righthanded"
else "lefthanded"
] <> children } $ (ordering [ H.div { className: "node " <> GT.fldr nodeType true} []
) , H.span { style : if validNodeType
] then { color : "blue", "text-decoration": "underline"}
else { color : "" , "text-decoration": "none"}
, on: { click: onClick }
}
[ nodeText { isSelected: isSelected targetId valAction
, name: " " <> name
, handed
}
]
]
)
<> children
where where
SubTreeParams { valitypes } = subTreeParams SubTreeParams { valitypes } = subTreeParams
......
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