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