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
7
Merge Requests
7
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
c6d891bb
Commit
c6d891bb
authored
Apr 29, 2024
by
Fabien Manière
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix a systematic path in the search results
parent
4a302ff2
Pipeline
#6020
failed with stage
in 18 minutes and 47 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
TreeSearch.purs
src/Gargantext/Components/TreeSearch.purs
+8
-7
No files found.
src/Gargantext/Components/TreeSearch.purs
View file @
c6d891bb
...
...
@@ -172,12 +172,10 @@ treeSearchRender = R2.leaf treeSearchRenderCpt
treeSearchRenderCpt :: R.Component RenderProps
treeSearchRenderCpt = here.component "treeSearchRenderCpt" cpt where
cpt { visible, session, searchData, goToRoute } _ = do
{ route } <- AppStore.use
route' <- T.useLive T.unequal route
pure $ H.div {className: "search-modal__results"} (results
route'
searchData)
pure $ H.div {className: "search-modal__results"} (results searchData)
where
results
route'
s = map searchResult s
results s = map searchResult s
where
searchResult sd = H.div
{ className: "result py-1"}
...
...
@@ -197,7 +195,7 @@ treeSearchRenderCpt = here.component "treeSearchRenderCpt" cpt where
[
H.text " Path: "
, breadcrumbView { format: "text"
, route:
route'
, route:
getRouteFromSearchResult sd session
, session
}
]
...
...
@@ -207,7 +205,7 @@ treeSearchRenderCpt = here.component "treeSearchRenderCpt" cpt where
{ className: "result__button"
, callback: \_ -> do
T.write_ false visible
goToRoute $
fromMaybe Home $ nodeTypeAppRoute sd.type (sessionId session) sd.id
goToRoute $
getRouteFromSearchResult sd session
, variant: ButtonVariant Light }
[
B.icon {name: getIcon sd.type true}
...
...
@@ -220,7 +218,7 @@ treeSearchRenderCpt = here.component "treeSearchRenderCpt" cpt where
[
H.text " — "
, breadcrumbView { format: "text"
, route:
route'
, route:
getRouteFromSearchResult sd session
, session: session
}
]
...
...
@@ -231,3 +229,6 @@ type LoadProps = ( session :: Session, query :: String )
loadSearch :: Record LoadProps -> AffRESTError (Array SearchData)
loadSearch { session: s, query: q} = get s $ appPath (TreeFlat (sessionId s) (sessionRoot s) q)
where sessionRoot (Session {treeId}) = treeId
getRouteFromSearchResult :: SearchData -> Session -> AppRoute
getRouteFromSearchResult sd session = fromMaybe Home $ nodeTypeAppRoute sd.type (sessionId session) sd.id
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