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
1
Merge Requests
1
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
Przemyslaw Kaminski
purescript-gargantext
Commits
696e4321
Unverified
Commit
696e4321
authored
Jun 27, 2019
by
Nicolas Pouillard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FacetTable/Search] Pass the listId param at some places
parent
0dfc506b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
17 deletions
+19
-17
FacetsTable.purs
src/Gargantext/Components/FacetsTable.purs
+13
-12
Config.purs
src/Gargantext/Config.purs
+5
-4
Tabs.purs
src/Gargantext/Pages/Corpus/Graph/Tabs.purs
+1
-1
No files found.
src/Gargantext/Components/FacetsTable.purs
View file @
696e4321
...
@@ -64,6 +64,7 @@ instance decodeSearchResults :: DecodeJson SearchResults where
...
@@ -64,6 +64,7 @@ instance decodeSearchResults :: DecodeJson SearchResults where
type Props =
type Props =
{ nodeId :: Int
{ nodeId :: Int
, listId :: Int
, query :: TextQuery
, query :: TextQuery
, totalRecords :: Int
, totalRecords :: Int
, chart :: ReactElement
, chart :: ReactElement
...
@@ -206,7 +207,7 @@ layoutDocview = simpleSpec performAction render
...
@@ -206,7 +207,7 @@ layoutDocview = simpleSpec performAction render
}
}
render :: Render State Props Action
render :: Render State Props Action
render dispatch {nodeId, query, totalRecords, chart, container} deletionState _ =
render dispatch {nodeId,
listId,
query, totalRecords, chart, container} deletionState _ =
[ {- br'
[ {- br'
, div [ style {textAlign : "center"}] [ text " Filter "
, div [ style {textAlign : "center"}] [ text " Filter "
, input [className "form-control", style {width : "120px", display : "inline-block"}, placeholder "Filter here"]
, input [className "form-control", style {width : "120px", display : "inline-block"}, placeholder "Filter here"]
...
@@ -219,7 +220,7 @@ layoutDocview = simpleSpec performAction render
...
@@ -219,7 +220,7 @@ layoutDocview = simpleSpec performAction render
[ chart
[ chart
, div [className "col-md-12"]
, div [className "col-md-12"]
[ pageLoader
[ pageLoader
{ path: initialPageParams {nodeId, query}
{ path: initialPageParams {nodeId,
listId,
query}
, totalRecords
, totalRecords
, deletionState
, deletionState
, dispatch
, dispatch
...
@@ -257,7 +258,7 @@ layoutDocviewGraph = simpleSpec performAction render
...
@@ -257,7 +258,7 @@ layoutDocviewGraph = simpleSpec performAction render
}
}
render :: Render State Props Action
render :: Render State Props Action
render dispatch {nodeId, query, totalRecords, chart, container} deletionState _ =
render dispatch {nodeId,
listId,
query, totalRecords, chart, container} deletionState _ =
[ br'
[ br'
, p [] [text ""]
, p [] [text ""]
...
@@ -267,7 +268,7 @@ layoutDocviewGraph = simpleSpec performAction render
...
@@ -267,7 +268,7 @@ layoutDocviewGraph = simpleSpec performAction render
[ chart
[ chart
, div [className "col-md-12"]
, div [className "col-md-12"]
[ pageLoader
[ pageLoader
{ path: initialPageParams {nodeId, query}
{ path: initialPageParams {nodeId,
listId,
query}
, totalRecords
, totalRecords
, deletionState
, deletionState
, dispatch
, dispatch
...
@@ -287,15 +288,15 @@ layoutDocviewGraph = simpleSpec performAction render
...
@@ -287,15 +288,15 @@ layoutDocviewGraph = simpleSpec performAction render
type PageParams = {nodeId :: Int, query :: TextQuery, params :: T.Params}
type PageParams = {nodeId :: Int,
listId :: Int,
query :: TextQuery, params :: T.Params}
initialPageParams :: {nodeId :: Int, query :: TextQuery} -> PageParams
initialPageParams :: {nodeId :: Int,
listId :: Int,
query :: TextQuery} -> PageParams
initialPageParams {nodeId,
query} = {node
Id, query, params: T.initialParams}
initialPageParams {nodeId,
listId, query} = {nodeId, list
Id, query, params: T.initialParams}
loadPage :: PageParams -> Aff (Array DocumentsView)
loadPage :: PageParams -> Aff (Array DocumentsView)
loadPage {nodeId, query, params: {limit, offset, orderBy}} = do
loadPage {nodeId,
listId,
query, params: {limit, offset, orderBy}} = do
logs "loading documents page: loadPage with Offset and limit"
logs "loading documents page: loadPage with Offset and limit"
let url = toUrl Back (Search { offset, limit, orderBy: convOrderBy <$> orderBy }) (Just nodeId)
let url = toUrl Back (Search {
listId,
offset, limit, orderBy: convOrderBy <$> orderBy }) (Just nodeId)
SearchResults res <- post url $ SearchQuery {query}
SearchResults res <- post url $ SearchQuery {query}
pure $ res2corpus <$> res.results
pure $ res2corpus <$> res.results
where
where
...
@@ -332,7 +333,7 @@ type PageLoaderProps row =
...
@@ -332,7 +333,7 @@ type PageLoaderProps row =
}
}
renderPage :: forall props path.
renderPage :: forall props path.
Render (Loader.State {nodeId :: Int, query :: TextQuery | path} (Array DocumentsView))
Render (Loader.State {nodeId :: Int,
listId :: Int,
query :: TextQuery | path} (Array DocumentsView))
{ totalRecords :: Int
{ totalRecords :: Int
, dispatch :: Action -> Effect Unit
, dispatch :: Action -> Effect Unit
, deletionState :: State
, deletionState :: State
...
@@ -343,10 +344,10 @@ renderPage :: forall props path.
...
@@ -343,10 +344,10 @@ renderPage :: forall props path.
renderPage _ _ {loaded: Nothing} _ = [] -- TODO loading spinner
renderPage _ _ {loaded: Nothing} _ = [] -- TODO loading spinner
renderPage loaderDispatch { totalRecords, dispatch, container
renderPage loaderDispatch { totalRecords, dispatch, container
, deletionState: {documentIdsToDelete, documentIdsDeleted}}
, deletionState: {documentIdsToDelete, documentIdsDeleted}}
{currentPath: {nodeId, query}, loaded: Just res} _ =
{currentPath: {nodeId,
listId,
query}, loaded: Just res} _ =
[ T.tableElt
[ T.tableElt
{ rows
{ rows
, setParams: \params -> liftEffect $ loaderDispatch (Loader.SetPath {nodeId, query, params})
, setParams: \params -> liftEffect $ loaderDispatch (Loader.SetPath {nodeId,
listId,
query, params})
, container
, container
, colNames:
, colNames:
T.ColumnName <$>
T.ColumnName <$>
...
...
src/Gargantext/Config.purs
View file @
696e4321
...
@@ -174,10 +174,9 @@ pathUrl c (PutNgrams t listid termList) i =
...
@@ -174,10 +174,9 @@ pathUrl c (PutNgrams t listid termList) i =
pathUrl c Auth Nothing = c.prePath <> "auth"
pathUrl c Auth Nothing = c.prePath <> "auth"
pathUrl c Auth (Just _) = "impossible" -- TODO better types
pathUrl c Auth (Just _) = "impossible" -- TODO better types
pathUrl c (NodeAPI nt) i = c.prePath <> nodeTypeUrl nt <> (maybe "" (\i' -> "/" <> show i') i)
pathUrl c (NodeAPI nt) i = c.prePath <> nodeTypeUrl nt <> (maybe "" (\i' -> "/" <> show i') i)
pathUrl c (Search {limit,offset,orderBy}) i =
pathUrl c (Search {li
stId,li
mit,offset,orderBy}) i =
pathUrl c (NodeAPI Corpus) i
pathUrl c (NodeAPI Corpus) i
<> "/search?dummy=dummy"
<> "/search?list_id=" <> show listId
-- dummy is here just because offsetUrl starts with &...
<> offsetUrl offset <> limitUrl limit <> orderUrl orderBy
<> offsetUrl offset <> limitUrl limit <> orderUrl orderBy
pathUrl c (CorpusMetrics {tabType, listId, limit}) i =
pathUrl c (CorpusMetrics {tabType, listId, limit}) i =
pathUrl c (NodeAPI Corpus) i <> "/metrics"
pathUrl c (NodeAPI Corpus) i <> "/metrics"
...
@@ -333,7 +332,9 @@ data Path
...
@@ -333,7 +332,9 @@ data Path
| NodeAPI NodeType
| NodeAPI NodeType
| Search { {-id :: Int
| Search { {-id :: Int
, query :: Array String
, query :: Array String
,-} limit :: Limit
,-}
listId :: Int
, limit :: Limit
, offset :: Offset
, offset :: Offset
, orderBy :: Maybe OrderBy
, orderBy :: Maybe OrderBy
}
}
...
...
src/Gargantext/Pages/Corpus/Graph/Tabs.purs
View file @
696e4321
...
@@ -29,7 +29,7 @@ pureTabs = hideState (const {activeTab: 0}) statefulTabs
...
@@ -29,7 +29,7 @@ pureTabs = hideState (const {activeTab: 0}) statefulTabs
tab :: forall props state. TextQuery -> GraphSideCorpus -> Tuple String (Spec state props Tab.Action)
tab :: forall props state. TextQuery -> GraphSideCorpus -> Tuple String (Spec state props Tab.Action)
tab query (GraphSideCorpus {corpusId: nodeId, corpusLabel}) =
tab query (GraphSideCorpus {corpusId: nodeId, corpusLabel}) =
Tuple corpusLabel $
Tuple corpusLabel $
cmapProps (const {nodeId, query, chart, totalRecords: 4736, container}) $
cmapProps (const {nodeId,
listId: 0,
query, chart, totalRecords: 4736, container}) $
noState docViewSpec
noState docViewSpec
where
where
-- TODO totalRecords: probably need to insert a corpusLoader.
-- TODO totalRecords: probably need to insert a corpusLoader.
...
...
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