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
db7bcbe3
Commit
db7bcbe3
authored
Mar 31, 2021
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[toestand] avoid refresh of tree when login modal shown
parent
4a7918bf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
14 deletions
+27
-14
Forest.purs
src/Gargantext/Components/Forest.purs
+3
-3
Tree.purs
src/Gargantext/Components/Forest/Tree.purs
+7
-9
Router.purs
src/Gargantext/Components/Router.purs
+17
-2
No files found.
src/Gargantext/Components/Forest.purs
View file @
db7bcbe3
...
...
@@ -91,7 +91,7 @@ forestCpt = here.component "forest" cpt where
common = RX.pick props :: Record Common
cp handed' sessions' _ =
pure $ H.div { className: "forest" }
(A.cons (plus handed' showLogin
backend
) (trees handed' sessions'))
(A.cons (plus handed' showLogin) (trees handed' sessions'))
trees handed' sessions' = (tree handed') <$> unSessions sessions'
tree handed' s@(Session {treeId}) =
treeLoader { forestOpen
...
...
@@ -104,8 +104,8 @@ forestCpt = here.component "forest" cpt where
, session: s
, tasks } []
plus :: Handed -> T.Box Boolean ->
T.Box (Maybe Backend) ->
R.Element
plus handed showLogin
backend
= H.div { className: "row" }
plus :: Handed -> T.Box Boolean -> R.Element
plus handed showLogin = H.div { className: "row" }
[ H.button { className: buttonClass
, on: { click }
, title }
...
...
src/Gargantext/Components/Forest/Tree.purs
View file @
db7bcbe3
...
...
@@ -54,7 +54,7 @@ type Global =
( frontends :: Frontends
, handed :: Handed
, route :: T.Box AppRoute
, tasks :: T.Box GAT.Storage
, tasks :: T.Box GAT.Storage
| Universal )
-- Shared by every component here
...
...
@@ -102,20 +102,18 @@ treeCpt = here.component "tree" cpt where
cpt p@{ session, tree: NTree (LNode { id, name, nodeType }) children } _ = do
setPopoverRef <- R.useRef Nothing
folderOpen <- T2.useMemberBox nodeId p.forestOpen
open <- T.useLive T.unequal folderOpen
pure $ H.ul { className: ulClass }
[ H.div { className: divClass } -- TODO: naughty div should not be in a ul
[ H.li { className: childrenClass children }
[ nodeSpan (nsprops { folderOpen, name, id, nodeType, setPopoverRef, isLeaf })
(renderChildren open)
]
folderOpen' <- T.useLive T.unequal folderOpen
pure $ H.ul { className: ulClass <> " " <> handedClass }
[ H.li { className: childrenClass children }
[ nodeSpan (nsprops { folderOpen, name, id, nodeType, setPopoverRef, isLeaf })
(renderChildren folderOpen')
]
]
where
isLeaf = A.null children
nodeId = mkNodeId session id
ulClass = switchHanded "ml" "mr" p.handed <> "-auto tree"
div
Class = switchHanded "left" "right" p.handed <> "handed"
handed
Class = switchHanded "left" "right" p.handed <> "handed"
children' = A.sortWith fTreeID pubChildren
pubChildren = if isPublic nodeType then map (map pub) children else children
renderChildren false = []
...
...
src/Gargantext/Components/Router.purs
View file @
db7bcbe3
...
...
@@ -59,11 +59,10 @@ routerCpt = here.component "router" cpt where
let sessionProps sId = Record.merge { session, sessionId: sId } props
let sessionNodeProps sId nId = Record.merge { nodeId: nId } $ sessionProps sId
showLogin <- T.useLive T.unequal boxes.showLogin
route' <- T.useLive T.unequal boxes.route
pure $ R.fragment
[
if showLogin then login' boxes else H.div {
} []
[
loginModal { boxes
} []
, case route' of
GR.Annuaire s n -> annuaire (sessionNodeProps s n) []
GR.ContactPage s a n -> contact (Record.merge { annuaireId: a } $ sessionNodeProps s n) []
...
...
@@ -88,6 +87,22 @@ routerCpt = here.component "router" cpt where
GR.UserPage s n -> user (sessionNodeProps s n) []
]
type LoginModalProps = (
boxes :: Boxes
)
loginModal :: R2.Component LoginModalProps
loginModal = R.createElement loginModalCpt
loginModalCpt :: R.Component LoginModalProps
loginModalCpt = here.component "loginModal" cpt
where
cpt { boxes: boxes@{ showLogin } } _ = do
showLogin' <- T.useLive T.unequal showLogin
pure $ if showLogin' then login' boxes else H.div {} []
forested :: R2.Component Props
forested = R.createElement forestedCpt
...
...
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