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
e6f129de
Commit
e6f129de
authored
Jul 29, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[API] Graph Sidebar : search Data | Community ok
parent
e51a41bb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
18 deletions
+26
-18
FacetsTable.purs
src/Gargantext/Components/FacetsTable.purs
+5
-4
Sidebar.purs
src/Gargantext/Components/GraphExplorer/Sidebar.purs
+18
-11
Tabs.purs
src/Gargantext/Components/Nodes/Corpus/Graph/Tabs.purs
+3
-3
No files found.
src/Gargantext/Components/FacetsTable.purs
View file @
e6f129de
...
...
@@ -40,7 +40,7 @@ type Props =
, frontends :: Frontends
, listId :: Int
, nodeId :: Int
, query ::
Text
Query
, query ::
Search
Query
, session :: Session
, totalRecords :: Int
)
...
...
@@ -171,12 +171,12 @@ docViewGraphCpt = R.hooksComponent "FacetsDocViewGraph" cpt
type PagePath = { nodeId :: Int
, listId :: Int
, query ::
Text
Query
, query ::
Search
Query
, params :: T.Params
, session :: Session
}
initialPagePath :: {session :: Session, nodeId :: Int, listId :: Int, query ::
Text
Query} -> PagePath
initialPagePath :: {session :: Session, nodeId :: Int, listId :: Int, query ::
Search
Query} -> PagePath
initialPagePath {session, nodeId, listId, query} = {session, nodeId, listId, query, params: T.initialParams}
loadPage :: PagePath -> Aff (Array DocumentsView)
...
...
@@ -193,7 +193,8 @@ loadPage {session, nodeId, listId, query, params: {limit, offset, orderBy, searc
p = Search { listId, offset, limit, orderBy: convOrderBy <$> orderBy } (Just nodeId)
--SearchResult {result} <- post session p $ SearchQuery {query: concat query, expected:searchType}
SearchResult {result} <- post session p $ SearchQuery {query: concat query, expected:SearchContact}
SearchResult {result} <- post session p query
-- $ SearchQuery {query: concat query, expected: SearchDoc}
pure $ case result of
SearchResultDoc {docs} -> docs2view docs
SearchResultContact {contacts} -> contacts2view contacts
...
...
src/Gargantext/Components/GraphExplorer/Sidebar.purs
View file @
e6f129de
...
...
@@ -3,7 +3,7 @@ module Gargantext.Components.GraphExplorer.Sidebar
where
import Control.Parallel (parTraverse)
import Data.Array (head, last)
import Data.Array (head, last
, concat
)
import Data.Int (fromString)
import Data.Map as Map
import Data.Maybe (Maybe(..), fromJust)
...
...
@@ -14,6 +14,7 @@ import Data.Tuple.Nested ((/\))
import Effect (Effect)
import Effect.Aff (Aff, launchAff_)
import Effect.Class (liftEffect)
import Gargantext.Components.Search (SearchType(..), SearchQuery(..))
import Gargantext.Components.GraphExplorer.Types as GET
import Gargantext.Components.GraphExplorer.Types (SidePanelState(..), SideTab(..))
import Gargantext.Components.GraphExplorer.Legend as Legend
...
...
@@ -102,7 +103,8 @@ sideTab (Opened SideTabData) props =
]
, RH.div { className: "col-md-12", id: "query" }
[ query props.frontends
[ query SearchDoc
props.frontends
props.metaData
props.session
nodesMap
...
...
@@ -151,7 +153,8 @@ sideTab (Opened SideTabData) props =
sideTab (Opened SideTabCommunity) props =
RH.div { className: "col-md-12", id: "query" }
[ query props.frontends
[ query SearchContact
props.frontends
props.metaData
props.session
(SigmaxT.nodesGraphMap props.graph)
...
...
@@ -233,22 +236,26 @@ deleteNode termList session (GET.MetaData metaData) node = NTC.putNgramsPatches
patch_list :: NTC.Replace TermList
patch_list = NTC.Replace { new: termList, old: MapTerm }
query :: Frontends
query :: SearchType
-> Frontends
-> GET.MetaData
-> Session
-> SigmaxT.NodesMap
-> R.State SigmaxT.NodeIds
-> R.Element
query _ _ _ _ (selectedNodeIds /\ _) | Set.isEmpty selectedNodeIds = RH.div {} []
query frontends (GET.MetaData metaData) session nodesMap (selectedNodeIds /\ _) =
query _ _ _ _
_
(selectedNodeIds /\ _) | Set.isEmpty selectedNodeIds = RH.div {} []
query
searchType
frontends (GET.MetaData metaData) session nodesMap (selectedNodeIds /\ _) =
query' (head metaData.corpusId)
where
query' Nothing = RH.div {} []
query' (Just corpusId) = CGT.tabs { frontends
, session
, query: toQuery <$> Set.toUnfoldable selectedNodeIds
, sides: [side corpusId]
}
query' (Just corpusId) =
CGT.tabs { frontends
, session
, query: SearchQuery { query : concat $ toQuery <$> Set.toUnfoldable selectedNodeIds
, expected: searchType
}
, sides: [side corpusId]
}
toQuery id = case Map.lookup id nodesMap of
Nothing -> []
...
...
src/Gargantext/Components/Nodes/Corpus/Graph/Tabs.purs
View file @
e6f129de
...
...
@@ -6,7 +6,7 @@ import Data.Tuple (Tuple(..), fst)
import Reactix as R
import Gargantext.Components.GraphExplorer.Types (GraphSideCorpus(..))
import Gargantext.Components.FacetsTable (docView)
import Gargantext.Components.Search (
Text
Query)
import Gargantext.Components.Search (
Search
Query)
import Gargantext.Components.Table as T
import Gargantext.Components.Tab as Tab
import Gargantext.Ends (Frontends)
...
...
@@ -14,7 +14,7 @@ import Gargantext.Sessions (Session)
type Props =
( frontends :: Frontends
, query ::
Text
Query
, query ::
Search
Query
, session :: Session
, sides :: Array GraphSideCorpus
)
...
...
@@ -32,7 +32,7 @@ tabsCpt = R.hooksComponent "G.P.Corpus.Graph.Tabs.tabs" cpt
where
tabs' = fromFoldable $ tab frontends session query <$> sides
tab :: Frontends -> Session ->
Text
Query -> GraphSideCorpus -> Tuple String R.Element
tab :: Frontends -> Session ->
Search
Query -> GraphSideCorpus -> Tuple String R.Element
tab frontends session query (GraphSideCorpus {corpusId: nodeId, corpusLabel, listId}) =
Tuple corpusLabel (docView dvProps)
where
...
...
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