diff --git a/dist/index.html b/dist/index.html index 1b6dd63572baf1d7c8e1359704a57e9dc80cc353..0f1f5c6d3d2d82db7e5fa60b657715179f549d94 100644 --- a/dist/index.html +++ b/dist/index.html @@ -18,48 +18,10 @@ <link href="styles/CodeEditor.css" rel="stylesheet" type="text/css" /> <link href="styles/range-slider.css" rel="stylesheet" type="text/css" /> <style> - * {margin: 0; padding: 0; list-style: none;} - .tree ul li { - margin-left: 15px; - position: relative; - padding-left: 5px; - } - #toolbar {display : inline;} - #toolbar ul li {display : inline } - #toolbar ul li form {display : inline} - .tree { margin-top : 20px;} - .tree ul li::before { - content: " "; - position: absolute; - width: 1px; - background-color: #000; - top: 5px; - bottom: -12px; - left: -10px; - } - body > .tree ul > li:first-child::before {top: 12px;} - .tree ul li:not(:first-child):last-child::before {display: none;} - .tree ul li:only-child::before { - display: list-item; - content: " "; - position: absolute; - width: 1px; - background-color: "#000"; - top: 5px; - bottom: 7px; - height: 7px; - left: -10px; - } - .tree ul li::after { - content: " "; - position: absolute; - left: -10px; - width: 10px; - height: 1px; - background-color: "#000"; - top: 12px; - } - </style> + .tree { margin: 0; padding: 0; border: 0; } + .tree LI { list-style: none; } + .tree UL { margin: 0 0 0 1.5em; border: 0; padding: 0; } + </style> </head> <body> <div id="app" class ="container-fluid"></div> diff --git a/package.json b/package.json index 1532cd8d653b597c3391b92ba3518c8ac38edc32..97d1a2f027637463a7f3a8d5e70b60ddf3605d00 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Gargantext", - "version": "0.0.1.5.2", + "version": "0.0.1.6", "scripts": { "rebase-set": "spago package-set-upgrade && spago psc-package-insdhall", "rebuild-set": "spago psc-package-insdhall", diff --git a/src/Gargantext/Components/Forest/Tree.purs b/src/Gargantext/Components/Forest/Tree.purs index 6364b9a99d2cdf85c12b1c25e95355df2173dd98..14237f5f4530471245e4ed2d09458a3fc51d1880 100644 --- a/src/Gargantext/Components/Forest/Tree.purs +++ b/src/Gargantext/Components/Forest/Tree.purs @@ -123,7 +123,7 @@ loadedTreeView p = R.createElement loadedTreeViewCpt p [] , tasks , tree , session - } _ = pure $ H.div { className: "tree"} + } _ = pure $ H.ul { className: "tree"} [ toHtml { asyncTasks , frontends , mCurrentRoute @@ -176,27 +176,23 @@ toHtml p@{ asyncTasks let withId (NTree (LNode {id: id'}) _) = id' - pure $ H.ul {} - [ H.li {} - ( [ nodeMainSpan { id - , dispatch: pAction - , folderOpen - , frontends - , mCurrentRoute - , name - , nodeType - , session - , tasks - } ] - <> childNodes (Record.merge commonProps - { asyncTasks - , children: ary - , folderOpen - } - ) - ) - ] - + pure $ H.li {} $ + [ nodeMainSpan { id + , dispatch: pAction + , folderOpen + , frontends + , mCurrentRoute + , name + , nodeType + , session + , tasks + } ] + <> childNodes ( Record.merge commonProps + { asyncTasks + , children: ary + , folderOpen + } + ) type ChildNodesProps = ( asyncTasks :: R.State GAT.Storage @@ -209,12 +205,12 @@ childNodes :: Record ChildNodesProps -> Array R.Element childNodes { children: [] } = [] childNodes { folderOpen: (false /\ _) } = [] childNodes props@{ asyncTasks, children, reload } = - map (\ctree@(NTree (LNode {id}) _) -> + map (\ctree@(NTree (LNode {id}) _) -> H.ul {} [ toHtml (Record.merge commonProps { asyncTasks , tasks: tasksStruct id asyncTasks reload , tree: ctree } - ) + )] ) $ sorted children where commonProps = RecordE.pick props :: Record CommonProps diff --git a/src/Gargantext/Components/Forest/Tree/Node.purs b/src/Gargantext/Components/Forest/Tree/Node.purs index 55720bfbf639b2ef2e737d74178451d144b61a7b..44966ea5b7d927414f185a863027caec1c88b22f 100644 --- a/src/Gargantext/Components/Forest/Tree/Node.purs +++ b/src/Gargantext/Components/Forest/Tree/Node.purs @@ -57,7 +57,8 @@ nodeMainSpan p@{ dispatch, folderOpen, frontends, session } = R.createElement el popoverRef <- R.useRef null pure $ H.span (dropProps droppedFile isDragOver) $ - [ folderIcon nodeType folderOpen + [ chevronIcon nodeType folderOpen + , folderIcon nodeType folderOpen , if showBox then Popover.popover { arrow: false , open: false @@ -94,6 +95,15 @@ nodeMainSpan p@{ dispatch, folderOpen, frontends, session } = R.createElement el name' {name, nodeType} = if nodeType == GT.NodeUser then show session else name + chevronIcon nodeType folderOpen'@(open /\ _) = + H.a { className: "chevron-icon" + , onClick: R2.effToggler folderOpen' + } + [ H.i { + className: if open + then "fa fa-chevron-down" + else "fa fa-chevron-right" + } [] ] folderIcon nodeType folderOpen'@(open /\ _) = H.a { className: "folder-icon" diff --git a/src/Gargantext/Components/Forest/Tree/Node/Action/Update.purs b/src/Gargantext/Components/Forest/Tree/Node/Action/Update.purs index 769b25f0d172d0a3ea8928c495eff376a9e190f8..5806a14fdb64f29b3ea9bf38c107fd5556119614 100644 --- a/src/Gargantext/Components/Forest/Tree/Node/Action/Update.purs +++ b/src/Gargantext/Components/Forest/Tree/Node/Action/Update.purs @@ -16,32 +16,13 @@ import Reactix.DOM.HTML as H updateRequest :: UpdateNodeParams -> Session -> ID -> Aff GT.AsyncTaskWithType -updateRequest (UpdateNodeParamsList meth) session nodeId = do - task <- post session p meth +updateRequest updateNodeParams session nodeId = do + task <- post session p updateNodeParams pure $ GT.AsyncTaskWithType {task, typ: GT.UpdateNode } where - p = GR.NodeAPI GT.Node (Just nodeId) "update/nobody" - -updateRequest (UpdateNodeParamsGraph meth) session nodeId = do - task <- post session p meth - pure $ GT.AsyncTaskWithType {task, typ: GT.UpdateNode } - where - p = GR.NodeAPI GT.Node (Just nodeId) "update/nobody" - -updateRequest (UpdateNodeParamsTexts meth) session nodeId = do - task <- post session p meth - pure $ GT.AsyncTaskWithType {task, typ: GT.UpdateNode } - where - p = GR.NodeAPI GT.Node (Just nodeId) "update/nobody" - -updateRequest (UpdateNodeParamsBoard meth) session nodeId = do - task <- post session p meth - pure $ GT.AsyncTaskWithType {task, typ: GT.UpdateNode } - where - p = GR.NodeAPI GT.Node (Just nodeId) "update/nobody" + p = GR.NodeAPI GT.Node (Just nodeId) "update" ---------------------------------------------------------------------- - update :: NodeType -> (Action -> Aff Unit) -> R.Hooks R.Element diff --git a/src/Gargantext/Components/Forest/Tree/Node/Tools/ProgressBar.purs b/src/Gargantext/Components/Forest/Tree/Node/Tools/ProgressBar.purs index f8c68a7e57c2e1e7bb3c86548d41c68a002d9716..fcf6bc93427063b8985cda1e969b820b27bc5fe5 100644 --- a/src/Gargantext/Components/Forest/Tree/Node/Tools/ProgressBar.purs +++ b/src/Gargantext/Components/Forest/Tree/Node/Tools/ProgressBar.purs @@ -109,3 +109,5 @@ queryProgress { asyncTask: GT.AsyncTaskWithType { task: GT.AsyncTask {id} p GT.UpdateNode = NodeAPI GT.Node (Just corpusId) $ path <> id <> "/poll?limit=1" p _ = NodeAPI GT.Corpus (Just corpusId) $ path <> id <> "/poll?limit=1" path = GT.asyncTaskTypePath typ + + -- TODO wait route: take the result if failure then message