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
140
Issues
140
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
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
11568684
Commit
11568684
authored
May 27, 2024
by
Fabien Maniere
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding an option to open or not the tree levels
parent
53800640
Pipeline
#6142
passed with stages
in 15 minutes and 6 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
10 deletions
+24
-10
Breadcrumb.purs
src/Gargantext/Components/Forest/Breadcrumb.purs
+21
-9
Login.purs
src/Gargantext/Components/Login.purs
+1
-1
TreeSearch.purs
src/Gargantext/Components/TreeSearch.purs
+2
-0
No files found.
src/Gargantext/Components/Forest/Breadcrumb.purs
View file @
11568684
...
...
@@ -88,6 +88,7 @@ componentCpt = here.component "breadcrumb" cpt where
breadcrumbView { format: "default"
, route: route'
, session: session''
, openTreeNodes: true
}
]
-- ,
...
...
@@ -141,9 +142,10 @@ componentCpt = here.component "breadcrumb" cpt where
]
type BreadcrumbViewProps =
( format :: String
, route :: AppRoute
, session :: Session
( format :: String
, route :: AppRoute
, session :: Session
, openTreeNodes :: Boolean
)
...
...
@@ -151,7 +153,7 @@ breadcrumbView :: R2.Leaf BreadcrumbViewProps
breadcrumbView = R2.leaf breadcrumbViewCpt
breadcrumbViewCpt :: R.Component BreadcrumbViewProps
breadcrumbViewCpt = R2.hereComponent here "breadcrumbViewCpt" hCpt where
hCpt hp { format, route, session } _ = do
hCpt hp { format, route, session
, openTreeNodes
} _ = do
useLoader { errorHandler: Nothing
, herePrefix: hp
...
...
@@ -163,6 +165,7 @@ breadcrumbViewCpt = R2.hereComponent here "breadcrumbViewCpt" hCpt where
, items
, session
-- , reload: reload
, openTreeNodes
} []
}
...
...
@@ -171,16 +174,17 @@ type BreadcrumbViewMainProps =
, items :: BreadcrumbInfo
, session :: Session
-- , reload :: T.Box T2.Reload
, openTreeNodes :: Boolean
)
breadcrumbViewMain :: R2.Component BreadcrumbViewMainProps
breadcrumbViewMain = R.createElement breadcrumbViewMainCpt
breadcrumbViewMainCpt :: R.Component BreadcrumbViewMainProps
breadcrumbViewMainCpt = here.component "breadcrumbViewMainCpt" cpt where
cpt { items: { parents }, session, format } _ = do
cpt { items: { parents }, session, format
, openTreeNodes
} _ = do
-- session' <- T.useLive T.unequal session
let items = makeBreadcrumbElements parents session format
let items = makeBreadcrumbElements parents session format
openTreeNodes
-- case session of
-- Nothing -> pure $ H.div {} []
...
...
@@ -190,8 +194,8 @@ breadcrumbViewMainCpt = here.component "breadcrumbViewMainCpt" cpt where
R.fragment items
makeBreadcrumbElements :: Array TreeNode -> Session -> String -> Array R.Element
makeBreadcrumbElements items' session format = makeBreadcrumbElementsMap <$> items' where
makeBreadcrumbElements :: Array TreeNode -> Session -> String ->
Boolean ->
Array R.Element
makeBreadcrumbElements items' session format
openTreeNodes
= makeBreadcrumbElementsMap <$> items' where
makeBreadcrumbElementsMap :: TreeNode -> R.Element
makeBreadcrumbElementsMap node = breadcrumbItem { linkId: node.id
, linkNodeType: node.node_type
...
...
@@ -201,6 +205,7 @@ breadcrumbViewMainCpt = here.component "breadcrumbViewMainCpt" cpt where
-- , reload: props.reload
-- , style: FolderUp
, format: format
, openTreeNodes: openTreeNodes
}
type BreadcrumbItemProps =
...
...
@@ -212,6 +217,7 @@ type BreadcrumbItemProps =
-- , style :: FolderStyle
, text :: String
, format :: String
, openTreeNodes :: Boolean
)
breadcrumbItem :: R2.Leaf BreadcrumbItemProps
...
...
@@ -226,15 +232,21 @@ breadcrumbItemCpt = here.component "breadcrumbItemCpt" cpt where
-- , reload
-- , style
, format
, openTreeNodes
} _ = do
boxes@{ forestOpen } <- Store.use
boxes@{ route } <- Store.use
let sid = sessionId session
let rootId = treeId session
let currentNodeIdFromUrl = mkNodeId session linkId
-- R.unsafeHooksEffect $ T.modify_ (openNodesInsert (currentNodeIdFromUrl)) forestOpen
if openTreeNodes then
R.unsafeHooksEffect $ T.modify_ (openNodesInsert (currentNodeIdFromUrl)) forestOpen
else
pure unit
pure $
...
...
src/Gargantext/Components/Login.purs
View file @
11568684
...
...
@@ -359,7 +359,7 @@ renderBackendCpt = here.component "renderBackend" cpt where
{}
[
B.icon
{ name: "
database
"
{ name: "
server
"
}
]
,
...
...
src/Gargantext/Components/TreeSearch.purs
View file @
11568684
...
...
@@ -197,6 +197,7 @@ treeSearchRenderCpt = here.component "treeSearchRenderCpt" cpt where
, breadcrumbView { format: "text"
, route: getRouteFromSearchResult sd session
, session
, openTreeNodes: false
}
]
]
...
...
@@ -220,6 +221,7 @@ treeSearchRenderCpt = here.component "treeSearchRenderCpt" cpt where
, breadcrumbView { format: "text"
, route: getRouteFromSearchResult sd session
, session: session
, openTreeNodes: false
}
]
]
...
...
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