Commit 96fdc692 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

Merge branch 'dev' into dev-list-charts

parents 1cb5bfa8 d9a9615c
...@@ -18,47 +18,9 @@ ...@@ -18,47 +18,9 @@
<link href="styles/CodeEditor.css" rel="stylesheet" type="text/css" /> <link href="styles/CodeEditor.css" rel="stylesheet" type="text/css" />
<link href="styles/range-slider.css" rel="stylesheet" type="text/css" /> <link href="styles/range-slider.css" rel="stylesheet" type="text/css" />
<style> <style>
* {margin: 0; padding: 0; list-style: none;} .tree { margin: 0; padding: 0; border: 0; }
.tree ul li { .tree LI { list-style: none; }
margin-left: 15px; .tree UL { margin: 0 0 0 1.5em; border: 0; padding: 0; }
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> </style>
</head> </head>
<body> <body>
......
{ {
"name": "Gargantext", "name": "Gargantext",
"version": "0.0.1.5.2", "version": "0.0.1.6",
"scripts": { "scripts": {
"rebase-set": "spago package-set-upgrade && spago psc-package-insdhall", "rebase-set": "spago package-set-upgrade && spago psc-package-insdhall",
"rebuild-set": "spago psc-package-insdhall", "rebuild-set": "spago psc-package-insdhall",
......
...@@ -123,7 +123,7 @@ loadedTreeView p = R.createElement loadedTreeViewCpt p [] ...@@ -123,7 +123,7 @@ loadedTreeView p = R.createElement loadedTreeViewCpt p []
, tasks , tasks
, tree , tree
, session , session
} _ = pure $ H.div { className: "tree"} } _ = pure $ H.ul { className: "tree"}
[ toHtml { asyncTasks [ toHtml { asyncTasks
, frontends , frontends
, mCurrentRoute , mCurrentRoute
...@@ -176,9 +176,8 @@ toHtml p@{ asyncTasks ...@@ -176,9 +176,8 @@ toHtml p@{ asyncTasks
let withId (NTree (LNode {id: id'}) _) = id' let withId (NTree (LNode {id: id'}) _) = id'
pure $ H.ul {} pure $ H.li {} $
[ H.li {} [ nodeMainSpan { id
( [ nodeMainSpan { id
, dispatch: pAction , dispatch: pAction
, folderOpen , folderOpen
, frontends , frontends
...@@ -188,15 +187,12 @@ toHtml p@{ asyncTasks ...@@ -188,15 +187,12 @@ toHtml p@{ asyncTasks
, session , session
, tasks , tasks
} ] } ]
<> childNodes (Record.merge commonProps <> childNodes ( Record.merge commonProps
{ asyncTasks { asyncTasks
, children: ary , children: ary
, folderOpen , folderOpen
} }
) )
)
]
type ChildNodesProps = type ChildNodesProps =
( asyncTasks :: R.State GAT.Storage ( asyncTasks :: R.State GAT.Storage
...@@ -209,12 +205,12 @@ childNodes :: Record ChildNodesProps -> Array R.Element ...@@ -209,12 +205,12 @@ childNodes :: Record ChildNodesProps -> Array R.Element
childNodes { children: [] } = [] childNodes { children: [] } = []
childNodes { folderOpen: (false /\ _) } = [] childNodes { folderOpen: (false /\ _) } = []
childNodes props@{ asyncTasks, children, reload } = childNodes props@{ asyncTasks, children, reload } =
map (\ctree@(NTree (LNode {id}) _) -> map (\ctree@(NTree (LNode {id}) _) -> H.ul {} [
toHtml (Record.merge commonProps { asyncTasks toHtml (Record.merge commonProps { asyncTasks
, tasks: tasksStruct id asyncTasks reload , tasks: tasksStruct id asyncTasks reload
, tree: ctree , tree: ctree
} }
) )]
) $ sorted children ) $ sorted children
where where
commonProps = RecordE.pick props :: Record CommonProps commonProps = RecordE.pick props :: Record CommonProps
......
...@@ -57,7 +57,8 @@ nodeMainSpan p@{ dispatch, folderOpen, frontends, session } = R.createElement el ...@@ -57,7 +57,8 @@ nodeMainSpan p@{ dispatch, folderOpen, frontends, session } = R.createElement el
popoverRef <- R.useRef null popoverRef <- R.useRef null
pure $ H.span (dropProps droppedFile isDragOver) $ pure $ H.span (dropProps droppedFile isDragOver) $
[ folderIcon nodeType folderOpen [ chevronIcon nodeType folderOpen
, folderIcon nodeType folderOpen
, if showBox then , if showBox then
Popover.popover { arrow: false Popover.popover { arrow: false
, open: false , open: false
...@@ -94,6 +95,15 @@ nodeMainSpan p@{ dispatch, folderOpen, frontends, session } = R.createElement el ...@@ -94,6 +95,15 @@ nodeMainSpan p@{ dispatch, folderOpen, frontends, session } = R.createElement el
name' {name, nodeType} = if nodeType == GT.NodeUser name' {name, nodeType} = if nodeType == GT.NodeUser
then show session then show session
else name 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 /\ _) = folderIcon nodeType folderOpen'@(open /\ _) =
H.a { className: "folder-icon" H.a { className: "folder-icon"
......
...@@ -16,32 +16,13 @@ import Reactix.DOM.HTML as H ...@@ -16,32 +16,13 @@ import Reactix.DOM.HTML as H
updateRequest :: UpdateNodeParams -> Session -> ID -> Aff GT.AsyncTaskWithType updateRequest :: UpdateNodeParams -> Session -> ID -> Aff GT.AsyncTaskWithType
updateRequest (UpdateNodeParamsList meth) session nodeId = do updateRequest updateNodeParams session nodeId = do
task <- post session p meth task <- post session p updateNodeParams
pure $ GT.AsyncTaskWithType {task, typ: GT.UpdateNode } pure $ GT.AsyncTaskWithType {task, typ: GT.UpdateNode }
where where
p = GR.NodeAPI GT.Node (Just nodeId) "update/nobody" p = GR.NodeAPI GT.Node (Just nodeId) "update"
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"
---------------------------------------------------------------------- ----------------------------------------------------------------------
update :: NodeType update :: NodeType
-> (Action -> Aff Unit) -> (Action -> Aff Unit)
-> R.Hooks R.Element -> R.Hooks R.Element
......
...@@ -109,3 +109,5 @@ queryProgress { asyncTask: GT.AsyncTaskWithType { task: GT.AsyncTask {id} ...@@ -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 GT.UpdateNode = NodeAPI GT.Node (Just corpusId) $ path <> id <> "/poll?limit=1"
p _ = NodeAPI GT.Corpus (Just corpusId) $ path <> id <> "/poll?limit=1" p _ = NodeAPI GT.Corpus (Just corpusId) $ path <> id <> "/poll?limit=1"
path = GT.asyncTaskTypePath typ path = GT.asyncTaskTypePath typ
-- TODO wait route: take the result if failure then message
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