Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Grégoire Locqueville
purescript-gargantext
Commits
12404dee
Commit
12404dee
authored
Aug 25, 2020
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into dev-tree-node-name-length
parents
6cf4237a
c1cca339
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
93 additions
and
61 deletions
+93
-61
Tree.css
dist/styles/Tree.css
+9
-0
Tree.sass
dist/styles/Tree.sass
+12
-0
Forest.purs
src/Gargantext/Components/Forest.purs
+9
-4
Tree.purs
src/Gargantext/Components/Forest/Tree.purs
+17
-14
Node.purs
src/Gargantext/Components/Forest/Tree/Node.purs
+42
-39
File.purs
src/Gargantext/Components/Nodes/File.purs
+3
-3
Types.purs
src/Gargantext/Types.purs
+1
-1
No files found.
dist/styles/Tree.css
View file @
12404dee
...
...
@@ -13,6 +13,15 @@
.tree
.node-actions
.update-button.disabled
{
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
{
background
:
rgba
(
51
,
122
,
183
,
0.1
);
...
...
dist/styles/Tree.sass
View file @
12404dee
...
...
@@ -9,6 +9,18 @@
cursor
:
pointer
&
.disabled
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
.progress-pie
...
...
src/Gargantext/Components/Forest.purs
View file @
12404dee
...
...
@@ -15,7 +15,7 @@ import Gargantext.Components.Forest.Tree (treeView)
import Gargantext.Ends (Frontends)
import Gargantext.Routes (AppRoute)
import Gargantext.Sessions (Session(..), Sessions, OpenNodes, unSessions)
import Gargantext.Types (Reload, Handed)
import Gargantext.Types (Reload, Handed
(..)
)
import Gargantext.Utils.Reactix as R2
type Props =
...
...
@@ -49,7 +49,8 @@ forestCpt = R.hooksComponent "G.C.Forest.forest" cpt where
)
(cpt' openNodes asyncTasks reload showLogin)
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
trees = tree <$> unSessions sessions
tree s@(Session {treeId}) =
...
...
@@ -63,8 +64,11 @@ forestCpt = R.hooksComponent "G.C.Forest.forest" cpt where
, session: s
}
plus :: R2.Setter Boolean -> R.Element
plus showLogin =
plus :: Handed -> R2.Setter Boolean -> R.Element
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}
, className: "btn btn-default"
}
...
...
@@ -75,6 +79,7 @@ plus showLogin =
--, H.div { "type": "", className: "fa fa-plus-circle fa-lg"} []
--, H.div { "type": "", className: "fa fa-minus-circle fa-lg"} []
]
]
-- TODO same as the one in the Login Modal (same CSS)
-- [ H.i { className: "material-icons md-36"} [] ]
where
...
...
src/Gargantext/Components/Forest/Tree.purs
View file @
12404dee
...
...
@@ -133,20 +133,23 @@ loadedTreeView p = R.createElement loadedTreeViewCpt p []
, session
, tasks
, tree
} _ = pure $ H.ul { className: "tree " <> if handed == GT.RightHanded
then "flex-start"
else "flex-end"
}
[ toHtml { asyncTasks
, frontends
, handed
, mCurrentRoute
, openNodes
, reload
, session
, tasks
, tree
}
} _ = pure $ H.ul { className: "tree"
}
[ H.div { className: if handed == GT.RightHanded
then "righthanded"
else "lefthanded"
}
[ toHtml { asyncTasks
, frontends
, handed
, mCurrentRoute
, openNodes
, reload
, session
, tasks
, tree
}
]
]
------------------------------------------------------------------------
...
...
src/Gargantext/Components/Forest/Tree/Node.purs
View file @
12404dee
...
...
@@ -68,44 +68,46 @@ nodeMainSpan p@{ dispatch, folderOpen, frontends, handed, session } = R.createEl
pure $ H.span (dropProps droppedFile isDragOver)
$ ordering
[ chevronIcon nodeType folderOpen
, folderIcon nodeType folderOpen
, if showBox then
Popover.popover { arrow: false
, open: false
, onClose: \_ -> pure unit
, onOpen: \_ -> pure unit
, ref: popoverRef } [
popOverIcon
, mNodePopupView props (onPopoverClose popoverRef)
]
else H.div {} []
, nodeLink { frontends
, id
, isSelected: mCurrentRoute == Routes.nodeTypeAppRoute nodeType (sessionId session) id
, name: name' props
, nodeType
, session }
, nodeActions { id
, nodeType
, refreshTree: const $ dispatch RefreshTree
, session }
, fileTypeView { dispatch, droppedFile, id, isDragOver, nodeType }
, H.div {} (map (\t -> asyncProgressBar { asyncTask: t
, barType: Pie
, corpusId: id
, onFinish: const $ onTaskFinish t
, session
}
) tasks
)
, if nodeType == GT.NodeUser
then GV.versionView {session}
else H.div {} []
]
where
SettingsBox {show: showBox} = settingsBox nodeType
onPopoverClose popoverRef _ = Popover.setOpen popoverRef false
[ chevronIcon nodeType folderOpen
, folderIcon nodeType folderOpen
, if showBox then
Popover.popover { arrow: false
, open: false
, onClose: \_ -> pure unit
, onOpen: \_ -> pure unit
, ref: popoverRef } [
popOverIcon
, mNodePopupView props (onPopoverClose popoverRef)
]
else H.div {} []
, nodeLink { frontends
, id
, isSelected: mCurrentRoute == Routes.nodeTypeAppRoute nodeType (sessionId session) id
, name: name' props
, nodeType
, session }
, nodeActions { id
, nodeType
, refreshTree: const $ dispatch RefreshTree
, session
}
, fileTypeView { dispatch, droppedFile, id, isDragOver, nodeType }
, H.div {} (map (\t -> asyncProgressBar { asyncTask: t
, barType: Pie
, corpusId: id
, onFinish: const $ onTaskFinish t
, session
}
) tasks
)
, if nodeType == GT.NodeUser
then GV.versionView {session}
else H.div {} []
]
where
SettingsBox {show: showBox} = settingsBox nodeType
onPopoverClose popoverRef _ = Popover.setOpen popoverRef false
name' {name, nodeType} = if nodeType == GT.NodeUser
then show session
...
...
@@ -143,7 +145,8 @@ nodeMainSpan p@{ dispatch, folderOpen, frontends, handed, session } = R.createEl
{ className: "leaf " <> (dropClass droppedFile isDragOver)
, on: { drop: dropHandler droppedFile
, dragOver: onDragOverHandler isDragOver
, dragLeave: onDragLeave isDragOver } }
, dragLeave: onDragLeave isDragOver }
}
where
dropClass (Just _ /\ _) _ = "file-dropped"
dropClass _ (true /\ _) = "file-dropped"
...
...
src/Gargantext/Components/Nodes/File.purs
View file @
12404dee
...
...
@@ -3,12 +3,12 @@ module Gargantext.Components.Nodes.File where
import Data.Argonaut (class DecodeJson, decodeJson, (.:))
import Data.Maybe (Maybe(..))
import DOM.Simple.Console (log2)
import Effect.Aff (Aff
, launchAff_
)
import Effect.Aff (Aff)
import Reactix as R
import Reactix.DOM.HTML as H
import Gargantext.Prelude
import Gargantext.Ends (toUrl)
import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Routes (SessionRoute(..))
import Gargantext.Sessions (Session, get)
...
...
@@ -101,7 +101,7 @@ fileLayoutLoadedCpt = R.hooksComponent "G.C.N.F.fileLayoutLoaded" cpt
]
, H.div { className: "row" } [
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"
} [ H.text "Download" ]
]
...
...
src/Gargantext/Types.purs
View file @
12404dee
...
...
@@ -126,7 +126,7 @@ instance optionalInstance :: Union r t s => Optional r s
showTabType' :: TabType -> String
showTabType' (TabCorpus t) = show t
showTabType' (TabDocument t) = show t
showTabType' (TabPairing t) = show t
showTabType' (TabPairing
t) = show t
data TabPostQuery = TabPostQuery {
offset :: Int
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment