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
141
Issues
141
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
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
gargantext
purescript-gargantext
Commits
ef97d9af
Commit
ef97d9af
authored
3 years ago
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[tree] rout props refactoring
parent
8798c47a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
38 deletions
+38
-38
App.purs
src/Gargantext/Components/App.purs
+5
-5
Forest.purs
src/Gargantext/Components/Forest.purs
+8
-8
Tree.purs
src/Gargantext/Components/Forest/Tree.purs
+16
-16
Node.purs
src/Gargantext/Components/Forest/Tree/Node.purs
+3
-3
GraphExplorer.purs
src/Gargantext/Components/GraphExplorer.purs
+6
-6
No files found.
src/Gargantext/Components/App.purs
View file @
ef97d9af
...
...
@@ -64,9 +64,9 @@ appCpt = R.hooksComponentWithModule thisModule "app" cpt where
let forested = forestLayout { appReload
, asyncTasksRef
, backend
, currentRoute: fst route
, frontends
, handed
, route: fst route
, sessions: fst sessions
, showLogin: snd showLogin
, treeReloadRef
...
...
@@ -74,9 +74,9 @@ appCpt = R.hooksComponentWithModule thisModule "app" cpt where
let forestedTB = forestLayoutWithTopBar { appReload
, asyncTasksRef
, backend
, currentRoute: fst route
, frontends
, handed
, route: fst route
, sessions: fst sessions
, showLogin: snd showLogin
, treeReloadRef
...
...
@@ -138,9 +138,9 @@ appCpt = R.hooksComponentWithModule thisModule "app" cpt where
appReload
, asyncTasksRef
, backend
, currentRoute: fst route
, frontends
, handed
, route: fst route
, sessions: fst sessions
, showLogin: snd showLogin
, treeReloadRef
...
...
@@ -161,10 +161,10 @@ appCpt = R.hooksComponentWithModule thisModule "app" cpt where
simpleLayout { handed } [
explorerLayout { asyncTasksRef
, backend
, currentRoute: fst route
, frontends
, graphId
, handed: fst handed
, mCurrentRoute: fst route
, session
, sessions: (fst sessions)
, showLogin
...
...
@@ -189,9 +189,9 @@ appCpt = R.hooksComponentWithModule thisModule "app" cpt where
appReload
, asyncTasksRef
, backend
, currentRoute: fst route
, frontends
, handed
, route: fst route
, sessions: fst sessions
, showLogin: snd showLogin
, treeReloadRef
...
...
This diff is collapsed.
Click to expand it.
src/Gargantext/Components/Forest.purs
View file @
ef97d9af
...
...
@@ -27,9 +27,9 @@ type Props = (
appReload :: ReloadS
, asyncTasksRef :: R.Ref (Maybe GAT.Reductor)
, backend :: R.State (Maybe Backend)
, currentRoute :: AppRoute
, frontends :: Frontends
, handed :: Handed
, route :: AppRoute
, sessions :: Sessions
, showLogin :: R.Setter Boolean
, treeReloadRef :: R.Ref (Maybe ReloadS)
...
...
@@ -44,9 +44,9 @@ forest = R.createElement forestCpt
cpt { appReload
, asyncTasksRef
, backend
, currentRoute
, frontends
, handed
, route
, sessions
, showLogin
, treeReloadRef } _ = do
...
...
@@ -64,7 +64,7 @@ forest = R.createElement forestCpt
R2.useCache (
frontends
/\
r
oute
/\
currentR
oute
/\ sessions
/\ fst openNodes
/\ fst appReload
...
...
@@ -73,16 +73,16 @@ forest = R.createElement forestCpt
/\ handed
)
(cpt' openNodes asyncTasks appReload reload showLogin backend)
cpt' openNodes asyncTasks appReload reload showLogin backend (frontends /\
r
oute /\ sessions /\ _ /\ _ /\ _ /\ _ /\ handed) = do
cpt' openNodes asyncTasks appReload reload showLogin backend (frontends /\
currentR
oute /\ sessions /\ _ /\ _ /\ _ /\ _ /\ handed) = do
pure $ R2.row $ [plus handed showLogin backend] <> trees
where
trees = tree <$> unSessions sessions
tree s@(Session {treeId}) =
treeView { appReload
, asyncTasks
, currentRoute
, frontends
, handed
, mCurrentRoute: Just route
, openNodes
, reload
, root: treeId
...
...
@@ -120,9 +120,9 @@ type ForestLayoutProps = (
appReload :: ReloadS
, asyncTasksRef :: R.Ref (Maybe GAT.Reductor)
, backend :: R.State (Maybe Backend)
, currentRoute :: AppRoute
, frontends :: Frontends
, handed :: R.State Handed
, route :: AppRoute
, sessions :: Sessions
, showLogin :: R.Setter Boolean
, treeReloadRef :: R.Ref (Maybe ReloadS)
...
...
@@ -173,9 +173,9 @@ forestLayoutRaw props = R.createElement forestLayoutRawCpt props
cpt { appReload
, asyncTasksRef
, backend
, currentRoute
, frontends
, handed
, route
, sessions
, showLogin
, treeReloadRef } children = do
...
...
@@ -189,9 +189,9 @@ forestLayoutRaw props = R.createElement forestLayoutRawCpt props
forest { appReload
, asyncTasksRef
, backend
, currentRoute
, frontends
, handed: fst handed
, route
, sessions
, showLogin
, treeReloadRef } []
...
...
This diff is collapsed.
Click to expand it.
src/Gargantext/Components/Forest/Tree.purs
View file @
ef97d9af
...
...
@@ -46,9 +46,9 @@ thisModule = "Gargantext.Components.Forest.Tree"
------------------------------------------------------------------------
type CommonProps = (
appReload :: GT.ReloadS
, currentRoute :: AppRoute
, frontends :: Frontends
, handed :: GT.Handed
, mCurrentRoute :: Maybe AppRoute
, openNodes :: R.State OpenNodes
, reload :: GT.ReloadS
, session :: Session
...
...
@@ -69,9 +69,9 @@ treeView = R.createElement elCpt
cpt { appReload
, asyncTasks
, currentRoute
, frontends
, handed
, mCurrentRoute
, openNodes
, reload
, root
...
...
@@ -79,9 +79,9 @@ treeView = R.createElement elCpt
} _children = do
pure $ treeLoadView { appReload
, asyncTasks
, currentRoute
, frontends
, handed
, mCurrentRoute
, openNodes
, reload
, root
...
...
@@ -96,9 +96,9 @@ treeLoadView = R.createElement elCpt
cpt { appReload
, asyncTasks
, currentRoute
, frontends
, handed
, mCurrentRoute
, openNodes
, reload
, root
...
...
@@ -106,9 +106,9 @@ treeLoadView = R.createElement elCpt
} _children = do
let fetch _ = getNodeTree session root
-- let paint loaded = loadedTreeView { asyncTasks
-- , currentRoute
-- , frontends
-- , handed
-- , mCurrentRoute
-- , openNodes
-- , reload
-- , session
...
...
@@ -117,9 +117,9 @@ treeLoadView = R.createElement elCpt
-- } []
let paint loaded = loadedTreeViewFirstLevel { appReload
, asyncTasks
, currentRoute
, frontends
, handed
, mCurrentRoute
, openNodes
, reload
, session
...
...
@@ -151,9 +151,9 @@ type TreeViewProps = (
-- cpt { appReload
-- , asyncTasks
-- , currentRoute
-- , frontends
-- , handed
-- , mCurrentRoute
-- , openNodes
-- , reload
-- , session
...
...
@@ -164,9 +164,9 @@ type TreeViewProps = (
-- H.div { className: if handed == GT.RightHanded then "righthanded" else "lefthanded" } [
-- toHtml { appReload
-- , asyncTasks
-- , currentRoute
-- , frontends
-- , handed
-- , mCurrentRoute
-- , openNodes
-- , reload
-- , session
...
...
@@ -184,9 +184,9 @@ loadedTreeViewFirstLevel = R.createElement elCpt
cpt { appReload
, asyncTasks
, currentRoute
, frontends
, handed
, mCurrentRoute
, openNodes
, reload
, session
...
...
@@ -197,9 +197,9 @@ loadedTreeViewFirstLevel = R.createElement elCpt
H.div { className: if handed == GT.RightHanded then "righthanded" else "lefthanded" } [
toHtmlFirstLevel { appReload
, asyncTasks
, currentRoute
, frontends
, handed
, mCurrentRoute
, openNodes
, reload
, reloadTree: reload
...
...
@@ -229,9 +229,9 @@ type ToHtmlProps = (
-- cpt p@{ appReload
-- , asyncTasks
-- , currentRoute
-- , frontends
-- , handed
-- , mCurrentRoute
-- , openNodes
-- , reload: reload@(_ /\ setReload)
-- , session
...
...
@@ -264,13 +264,13 @@ type ToHtmlProps = (
-- pure $ H.li { className: if A.null ary then "no-children" else "with-children" }
-- [ nodeSpan { appReload
-- , asyncTasks
-- , currentRoute
-- , dispatch: pAction
-- , folderOpen
-- , frontends
-- , handed
-- , id
-- , isLeaf: A.null ary
-- , mCurrentRoute
-- , name
-- , nodeType
-- , session
...
...
@@ -301,9 +301,9 @@ toHtmlFirstLevel = R.createElement elCpt
cpt p@{ appReload
, asyncTasks
, currentRoute
, frontends
, handed
, mCurrentRoute
, openNodes
, reload: reload@(_ /\ setReload)
, reloadTree
...
...
@@ -330,13 +330,13 @@ toHtmlFirstLevel = R.createElement elCpt
pure $ H.li { className: if A.null ary then "no-children" else "with-children" } $
[ nodeSpan { appReload
, asyncTasks
, currentRoute
, dispatch: pAction
, folderOpen
, frontends
, handed
, id
, isLeaf: A.null ary
, mCurrentRoute
, name
, nodeType
, session
...
...
@@ -425,11 +425,11 @@ childNodeFirstLevel = R.createElement elCpt
cpt props@{ appReload
, asyncTasks
, currentRoute
, folderOpen
, id
, frontends
, handed
, mCurrentRoute
, openNodes
, reload
, reloadTree
...
...
@@ -439,10 +439,10 @@ childNodeFirstLevel = R.createElement elCpt
let fetch _ = getNodeTreeFirstLevel session id
let paint loaded = childNodeFirstLevelPaint { appReload
, asyncTasks
, currentRoute
, folderOpen
, frontends
, handed
, mCurrentRoute
, openNodes
, reload: cptReload
, reloadTree
...
...
This diff is collapsed.
Click to expand it.
src/Gargantext/Components/Forest/Tree/Node.purs
View file @
ef97d9af
...
...
@@ -44,11 +44,11 @@ thisModule = "Gargantext.Components.Forest.Tree.Node"
type NodeMainSpanProps = (
appReload :: GT.ReloadS
, asyncTasks :: GAT.Reductor
, currentRoute :: Routes.AppRoute
, folderOpen :: R.State Boolean
, frontends :: Frontends
, id :: ID
, isLeaf :: IsLeaf
, mCurrentRoute :: Maybe Routes.AppRoute
, name :: Name
, nodeType :: GT.NodeType
, setPopoverRef :: R.Ref (Maybe (Boolean -> Effect Unit))
...
...
@@ -74,13 +74,13 @@ nodeMainSpan = R.createElement nodeMainSpanCpt
cpt props@{ appReload
, asyncTasks: (asyncTasks /\ dispatchAsyncTasks)
, currentRoute
, dispatch
, folderOpen
, frontends
, handed
, id
, isLeaf
, mCurrentRoute
, name
, nodeType
, session
...
...
@@ -100,7 +100,7 @@ nodeMainSpan = R.createElement nodeMainSpanCpt
GT.LeftHanded -> reverse
GT.RightHanded -> identity
let isSelected =
mC
urrentRoute == Routes.nodeTypeAppRoute nodeType (sessionId session) id
let isSelected =
Just c
urrentRoute == Routes.nodeTypeAppRoute nodeType (sessionId session) id
pure $ H.span (dropProps droppedFile isDragOver)
$ ordering
...
...
This diff is collapsed.
Click to expand it.
src/Gargantext/Components/GraphExplorer.purs
View file @
ef97d9af
...
...
@@ -44,10 +44,10 @@ thisModule = "Gargantext.Components.GraphExplorer"
type LayoutProps = (
asyncTasksRef :: R.Ref (Maybe GAT.Reductor)
, backend :: R.State (Maybe Backend)
, currentRoute :: AppRoute
, frontends :: Frontends
, graphId :: GET.GraphId
, handed :: Types.Handed
, mCurrentRoute :: AppRoute
, session :: Session
, sessions :: Sessions
, showLogin :: R.State Boolean
...
...
@@ -94,13 +94,13 @@ explorerCpt = R.hooksComponentWithModule thisModule "explorer" cpt
where
cpt props@{ asyncTasksRef
, backend
, currentRoute
, frontends
, graph
, graphId
, graphVersion
, handed
, hyperdataGraph
, mCurrentRoute
, mMetaData
, session
, sessions
...
...
@@ -160,9 +160,9 @@ explorerCpt = R.hooksComponentWithModule thisModule "explorer" cpt
, R2.row $ mainLayout handed $
tree { asyncTasksRef
, backend
, currentRoute
, frontends
, handed
, mCurrentRoute
, reload: treeReload
, sessions
, show: fst controls.showTree
...
...
@@ -215,14 +215,14 @@ explorerCpt = R.hooksComponentWithModule thisModule "explorer" cpt
tree :: Record TreeProps -> R.Element
tree { show: false } = RH.div { id: "tree" } []
tree { asyncTasksRef, backend, frontends, handed,
mCurrentRoute: r
oute, reload, sessions, showLogin, treeReloadRef } =
tree { asyncTasksRef, backend, frontends, handed,
currentR
oute, reload, sessions, showLogin, treeReloadRef } =
RH.div {className: "col-md-2 graph-tree"} [
forest { appReload: reload
, asyncTasksRef
, backend
, currentRoute
, frontends
, handed
, route
, sessions
, showLogin
, treeReloadRef } []
...
...
@@ -239,9 +239,9 @@ type TreeProps =
(
asyncTasksRef :: R.Ref (Maybe GAT.Reductor)
, backend :: R.State (Maybe Backend)
, currentRoute :: AppRoute
, frontends :: Frontends
, handed :: Types.Handed
, mCurrentRoute :: AppRoute
, reload :: Types.ReloadS
, sessions :: Sessions
, show :: Boolean
...
...
This diff is collapsed.
Click to expand it.
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