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
142
Issues
142
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
34902e03
Verified
Commit
34902e03
authored
May 27, 2024
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[tree] don't render modal in tree, until it is requested by user
This improves performance of rendering for large trees.
parent
62b5bc6b
Pipeline
#6152
passed with stages
in 9 minutes and 57 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
17 deletions
+39
-17
BaseModal.purs
src/Gargantext/Components/Bootstrap/Floaty/BaseModal.purs
+6
-0
Node.purs
src/Gargantext/Components/Forest/Tree/Node.purs
+33
-17
No files found.
src/Gargantext/Components/Bootstrap/Floaty/BaseModal.purs
View file @
34902e03
...
@@ -140,6 +140,12 @@ component = R.memo' $ R.hooksComponent componentName cpt where
...
@@ -140,6 +140,12 @@ component = R.memo' $ R.hooksComponent componentName cpt where
then showModal window selector modalEvents
then showModal window selector modalEvents
else hideModal window selector
else hideModal window selector
-- | When box is true, show the modal immediately
R.useEffectOnce' $ do
if isVisible
then showModal window selector modalEvents
else hideModal window selector
-- | Behaviors
-- | Behaviors
-- |
-- |
let
let
...
...
src/Gargantext/Components/Forest/Tree/Node.purs
View file @
34902e03
...
@@ -31,6 +31,7 @@ import Gargantext.Components.Nodes.Corpus.Types (CorpusData)
...
@@ -31,6 +31,7 @@ import Gargantext.Components.Nodes.Corpus.Types (CorpusData)
import Gargantext.Context.Progress (asyncContext, asyncProgress)
import Gargantext.Context.Progress (asyncContext, asyncProgress)
import Gargantext.Ends (Frontends, url)
import Gargantext.Ends (Frontends, url)
import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Hooks.UpdateEffect (useUpdateEffect1')
import Gargantext.Hooks.Version (Version, useVersion)
import Gargantext.Hooks.Version (Version, useVersion)
import Gargantext.Routes as Routes
import Gargantext.Routes as Routes
import Gargantext.Sessions (Session, sessionId)
import Gargantext.Sessions (Session, sessionId)
...
@@ -100,6 +101,19 @@ nodeSpanCpt = here.component "nodeSpan" cpt
...
@@ -100,6 +101,19 @@ nodeSpanCpt = here.component "nodeSpan" cpt
folderOpen' <- R2.useLive' folderOpen
folderOpen' <- R2.useLive' folderOpen
isBoxVisible' <- R2.useLive' isBoxVisible
isBoxVisiblePersist <- T.useBox isBoxVisible'
isBoxVisiblePersist' <- R2.useLive' isBoxVisiblePersist
-- | Modal not visible initially, but visible after first user
-- | click. This is to avoid modal loading initially
-- | (optimization for large trees), but persist it after user
-- | opens it.
useUpdateEffect1' isBoxVisible'
if isBoxVisible'
then T.write_ true isBoxVisiblePersist
else pure unit
-- tasks' <- T.read tasks
-- tasks' <- T.read tasks
-- Computed
-- Computed
...
@@ -340,24 +354,25 @@ nodeSpanCpt = here.component "nodeSpan" cpt
...
@@ -340,24 +354,25 @@ nodeSpanCpt = here.component "nodeSpan" cpt
-- // Modals //
-- // Modals //
B.baseModal
R2.when isBoxVisiblePersist' (
{ isVisibleBox: isBoxVisible
B.baseModal
, noBody: true
{ isVisibleBox: isBoxVisible
, noHeader: true
, noBody: true
, modalClassName: "forest-tree-node-modal"
, noHeader: true
}
, modalClassName: "forest-tree-node-modal"
[
nodePopupView
{ boxes
, closeCallback: \_ -> T.write_ false isBoxVisible
, dispatch
, id
, name
, nodeType
, session
}
}
]
[
]
nodePopupView
{ boxes
, closeCallback: \_ -> T.write_ false isBoxVisible
, dispatch
, id
, name
, nodeType
, session
}
]
)
,
,
-- // Mainleaf indicator of selected node //
-- // Mainleaf indicator of selected node //
--
--
...
@@ -372,6 +387,7 @@ nodeSpanCpt = here.component "nodeSpan" cpt
...
@@ -372,6 +387,7 @@ nodeSpanCpt = here.component "nodeSpan" cpt
{ className: "mainleaf-selection-indicator" }
{ className: "mainleaf-selection-indicator" }
[]
[]
]
]
]
---------------------------------------------------------
---------------------------------------------------------
...
...
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