Commit 12404dee authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

Merge branch 'dev' into dev-tree-node-name-length

parents 6cf4237a c1cca339
...@@ -13,6 +13,15 @@ ...@@ -13,6 +13,15 @@
.tree .node-actions .update-button.disabled { .tree .node-actions .update-button.disabled {
cursor: wait; cursor: wait;
} }
.tree .lefthanded ul {
margin-right: 19px;
}
.tree .lefthanded li .leaf {
justify-content: flex-end;
}
.tree .righthanded li .leaf {
justify-content: flex-start;
}
.progress-pie { .progress-pie {
background: rgba(51, 122, 183, 0.1); background: rgba(51, 122, 183, 0.1);
......
...@@ -9,6 +9,18 @@ ...@@ -9,6 +9,18 @@
cursor: pointer cursor: pointer
&.disabled &.disabled
cursor: wait cursor: wait
.lefthanded
ul
margin-right : 19px
li
.leaf
justify-content : flex-end
.righthanded
li
.leaf
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
......
...@@ -15,7 +15,7 @@ import Gargantext.Components.Forest.Tree (treeView) ...@@ -15,7 +15,7 @@ import Gargantext.Components.Forest.Tree (treeView)
import Gargantext.Ends (Frontends) import Gargantext.Ends (Frontends)
import Gargantext.Routes (AppRoute) import Gargantext.Routes (AppRoute)
import Gargantext.Sessions (Session(..), Sessions, OpenNodes, unSessions) import Gargantext.Sessions (Session(..), Sessions, OpenNodes, unSessions)
import Gargantext.Types (Reload, Handed) import Gargantext.Types (Reload, Handed(..))
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
type Props = type Props =
...@@ -49,7 +49,8 @@ forestCpt = R.hooksComponent "G.C.Forest.forest" cpt where ...@@ -49,7 +49,8 @@ forestCpt = R.hooksComponent "G.C.Forest.forest" cpt where
) )
(cpt' openNodes asyncTasks reload showLogin) (cpt' openNodes asyncTasks reload showLogin)
cpt' openNodes asyncTasks reload showLogin (frontends /\ route /\ sessions /\ _ /\ _ /\ _ /\ _ /\ handed) = do cpt' openNodes asyncTasks reload showLogin (frontends /\ route /\ sessions /\ _ /\ _ /\ _ /\ _ /\ handed) = do
pure $ R.fragment $ A.cons (plus showLogin) trees --pure $ R.fragment $ A.cons (plus showLogin) trees
pure $ R2.row $ [plus handed showLogin] <> trees
where where
trees = tree <$> unSessions sessions trees = tree <$> unSessions sessions
tree s@(Session {treeId}) = tree s@(Session {treeId}) =
...@@ -63,8 +64,11 @@ forestCpt = R.hooksComponent "G.C.Forest.forest" cpt where ...@@ -63,8 +64,11 @@ forestCpt = R.hooksComponent "G.C.Forest.forest" cpt where
, session: s , session: s
} }
plus :: R2.Setter Boolean -> R.Element plus :: Handed -> R2.Setter Boolean -> R.Element
plus showLogin = plus handed showLogin = H.div {className: if handed == RightHanded
then "flex-start" -- TODO we should use lefthanded SASS class here
else "flex-end"
} [
H.button { on: {click} H.button { on: {click}
, className: "btn btn-default" , className: "btn btn-default"
} }
...@@ -75,6 +79,7 @@ plus showLogin = ...@@ -75,6 +79,7 @@ plus showLogin =
--, H.div { "type": "", className: "fa fa-plus-circle fa-lg"} [] --, H.div { "type": "", className: "fa fa-plus-circle fa-lg"} []
--, H.div { "type": "", className: "fa fa-minus-circle fa-lg"} [] --, H.div { "type": "", className: "fa fa-minus-circle fa-lg"} []
] ]
]
-- TODO same as the one in the Login Modal (same CSS) -- TODO same as the one in the Login Modal (same CSS)
-- [ H.i { className: "material-icons md-36"} [] ] -- [ H.i { className: "material-icons md-36"} [] ]
where where
......
...@@ -133,20 +133,23 @@ loadedTreeView p = R.createElement loadedTreeViewCpt p [] ...@@ -133,20 +133,23 @@ loadedTreeView p = R.createElement loadedTreeViewCpt p []
, session , session
, tasks , tasks
, tree , tree
} _ = pure $ H.ul { className: "tree " <> if handed == GT.RightHanded } _ = pure $ H.ul { className: "tree"
then "flex-start" }
else "flex-end" [ H.div { className: if handed == GT.RightHanded
} then "righthanded"
[ toHtml { asyncTasks else "lefthanded"
, frontends }
, handed [ toHtml { asyncTasks
, mCurrentRoute , frontends
, openNodes , handed
, reload , mCurrentRoute
, session , openNodes
, tasks , reload
, tree , session
} , tasks
, tree
}
]
] ]
------------------------------------------------------------------------ ------------------------------------------------------------------------
......
...@@ -68,44 +68,46 @@ nodeMainSpan p@{ dispatch, folderOpen, frontends, handed, session } = R.createEl ...@@ -68,44 +68,46 @@ nodeMainSpan p@{ dispatch, folderOpen, frontends, handed, session } = R.createEl
pure $ H.span (dropProps droppedFile isDragOver) pure $ H.span (dropProps droppedFile isDragOver)
$ ordering $ ordering
[ chevronIcon nodeType folderOpen [ chevronIcon nodeType folderOpen
, folderIcon nodeType folderOpen , folderIcon nodeType folderOpen
, if showBox then , if showBox then
Popover.popover { arrow: false Popover.popover { arrow: false
, open: false , open: false
, onClose: \_ -> pure unit , onClose: \_ -> pure unit
, onOpen: \_ -> pure unit , onOpen: \_ -> pure unit
, ref: popoverRef } [ , ref: popoverRef } [
popOverIcon popOverIcon
, mNodePopupView props (onPopoverClose popoverRef) , mNodePopupView props (onPopoverClose popoverRef)
] ]
else H.div {} [] else H.div {} []
, nodeLink { frontends
, id , nodeLink { frontends
, isSelected: mCurrentRoute == Routes.nodeTypeAppRoute nodeType (sessionId session) id , id
, name: name' props , isSelected: mCurrentRoute == Routes.nodeTypeAppRoute nodeType (sessionId session) id
, nodeType , name: name' props
, session } , nodeType
, nodeActions { id , session }
, nodeType , nodeActions { id
, refreshTree: const $ dispatch RefreshTree , nodeType
, session } , refreshTree: const $ dispatch RefreshTree
, fileTypeView { dispatch, droppedFile, id, isDragOver, nodeType } , session
, H.div {} (map (\t -> asyncProgressBar { asyncTask: t }
, barType: Pie , fileTypeView { dispatch, droppedFile, id, isDragOver, nodeType }
, corpusId: id , H.div {} (map (\t -> asyncProgressBar { asyncTask: t
, onFinish: const $ onTaskFinish t , barType: Pie
, session , corpusId: id
} , onFinish: const $ onTaskFinish t
) tasks , session
) }
, if nodeType == GT.NodeUser ) tasks
then GV.versionView {session} )
else H.div {} [] , if nodeType == GT.NodeUser
] then GV.versionView {session}
where else H.div {} []
SettingsBox {show: showBox} = settingsBox nodeType ]
onPopoverClose popoverRef _ = Popover.setOpen popoverRef false where
SettingsBox {show: showBox} = settingsBox nodeType
onPopoverClose popoverRef _ = Popover.setOpen popoverRef false
name' {name, nodeType} = if nodeType == GT.NodeUser name' {name, nodeType} = if nodeType == GT.NodeUser
then show session then show session
...@@ -143,7 +145,8 @@ nodeMainSpan p@{ dispatch, folderOpen, frontends, handed, session } = R.createEl ...@@ -143,7 +145,8 @@ nodeMainSpan p@{ dispatch, folderOpen, frontends, handed, session } = R.createEl
{ className: "leaf " <> (dropClass droppedFile isDragOver) { className: "leaf " <> (dropClass droppedFile isDragOver)
, on: { drop: dropHandler droppedFile , on: { drop: dropHandler droppedFile
, dragOver: onDragOverHandler isDragOver , dragOver: onDragOverHandler isDragOver
, dragLeave: onDragLeave isDragOver } } , dragLeave: onDragLeave isDragOver }
}
where where
dropClass (Just _ /\ _) _ = "file-dropped" dropClass (Just _ /\ _) _ = "file-dropped"
dropClass _ (true /\ _) = "file-dropped" dropClass _ (true /\ _) = "file-dropped"
......
...@@ -3,12 +3,12 @@ module Gargantext.Components.Nodes.File where ...@@ -3,12 +3,12 @@ module Gargantext.Components.Nodes.File where
import Data.Argonaut (class DecodeJson, decodeJson, (.:)) import Data.Argonaut (class DecodeJson, decodeJson, (.:))
import Data.Maybe (Maybe(..)) import Data.Maybe (Maybe(..))
import DOM.Simple.Console (log2) import DOM.Simple.Console (log2)
import Effect.Aff (Aff, launchAff_) import Effect.Aff (Aff)
import Reactix as R import Reactix as R
import Reactix.DOM.HTML as H import Reactix.DOM.HTML as H
import Gargantext.Prelude import Gargantext.Prelude
import Gargantext.Ends (toUrl)
import Gargantext.Hooks.Loader (useLoader) import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Routes (SessionRoute(..)) import Gargantext.Routes (SessionRoute(..))
import Gargantext.Sessions (Session, get) import Gargantext.Sessions (Session, get)
...@@ -101,7 +101,7 @@ fileLayoutLoadedCpt = R.hooksComponent "G.C.N.F.fileLayoutLoaded" cpt ...@@ -101,7 +101,7 @@ fileLayoutLoadedCpt = R.hooksComponent "G.C.N.F.fileLayoutLoaded" cpt
] ]
, H.div { className: "row" } [ , H.div { className: "row" } [
H.div { className: "btn btn-default" } [ H.div { className: "btn btn-default" } [
H.a { href: "/api/v1.0/node/" <> show nodeId <> "/file/download" H.a { href: toUrl session ("node/" <> show nodeId <> "/file/download")
, target: "_blank" , target: "_blank"
} [ H.text "Download" ] } [ H.text "Download" ]
] ]
......
...@@ -126,7 +126,7 @@ instance optionalInstance :: Union r t s => Optional r s ...@@ -126,7 +126,7 @@ instance optionalInstance :: Union r t s => Optional r s
showTabType' :: TabType -> String showTabType' :: TabType -> String
showTabType' (TabCorpus t) = show t showTabType' (TabCorpus t) = show t
showTabType' (TabDocument t) = show t showTabType' (TabDocument t) = show t
showTabType' (TabPairing t) = show t showTabType' (TabPairing t) = show t
data TabPostQuery = TabPostQuery { data TabPostQuery = TabPostQuery {
offset :: Int offset :: Int
......
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