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
733b0f61
Unverified
Commit
733b0f61
authored
Feb 26, 2019
by
Nicolas Pouillard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[NGRAMS-TABLE] loadPage with more params
parent
4a16a891
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
15 deletions
+49
-15
Config.purs
src/Gargantext/Config.purs
+24
-6
NgramsTable.purs
...Pages/Annuaire/User/Contacts/Tabs/Ngrams/NgramsTable.purs
+13
-5
NgramsTable.purs
src/Gargantext/Pages/Corpus/Tabs/Ngrams/NgramsTable.purs
+12
-4
No files found.
src/Gargantext/Config.purs
View file @
733b0f61
...
...
@@ -127,12 +127,21 @@ pathUrl c (Tab t o l s) i =
pathUrl c (Children n o l s) i =
pathUrl c (NodeAPI Node) i <>
"/" <> "children?type=" <> show n <> offsetUrl o <> limitUrl l <> orderUrl s
pathUrl c (GetNgrams t o l listIds listTypeId) i =
pathUrl c (GetNgrams
{ tabType: t
, offset: o
, limit: l
, listIds
, termListFilter: tlf
, termTypeFilter: ttf
, searchQuery: q
}) i =
pathUrl c (NodeAPI Node) i <> "/" <> tabTypeNgramsGet t
<> offsetUrl o <> limitUrl l <> listIds' <> listTypeId'
where
listIds' = foldMap (\x -> "&list=" <> show x) listIds
listTypeId' = foldMap (\x -> "&listType=" <> show x) listTypeId
<> offsetUrl o <> limitUrl l
<> foldMap (\x -> "&list=" <> show x) listIds
<> foldMap (\x -> "&listType=" <> show x) tlf
<> foldMap (\x -> "&termType=" <> show x) ttf
<> if q == "" then "" else ("&search=" <> q)
pathUrl c (PutNgrams t listid) i =
pathUrl c (NodeAPI Node) i <> "/" <> tabTypeNgramsPut t <> listid'
where
...
...
@@ -203,7 +212,16 @@ data Path
= Auth
| Tab TabType Offset Limit (Maybe OrderBy)
| Children NodeType Offset Limit (Maybe OrderBy)
| GetNgrams TabType Offset Limit (Array ListId) (Maybe TermList)
| GetNgrams
{ tabType :: TabType
, offset :: Offset
, limit :: Limit
, orderBy :: Maybe OrderBy
, listIds :: Array ListId
, termListFilter :: Maybe TermList
, termTypeFilter :: Maybe TermType
, searchQuery :: String
}
| PutNgrams TabType (Maybe ListId)
| NodeAPI NodeType
| Search { {-id :: Int
...
...
src/Gargantext/Pages/Annuaire/User/Contacts/Tabs/Ngrams/NgramsTable.purs
View file @
733b0f61
...
...
@@ -13,7 +13,7 @@ import Thermite (Render, Spec, createClass, defaultPerformAction, simpleSpec)
import Gargantext.Components.NgramsTable as NT
import Gargantext.Prelude
import Gargantext.Config (PTabNgramType(..), Offset, Limit, End(..), Path(..), TabSubType(..), TabType(..), toUrl)
import Gargantext.Config (PTabNgramType(..), Offset, Limit,
OrderBy(..),
End(..), Path(..), TabSubType(..), TabType(..), toUrl)
import Gargantext.Config.REST (get)
import Gargantext.Components.Loader as Loader
import Gargantext.Pages.Annuaire.User.Contacts.Types (Contact)
...
...
@@ -34,11 +34,19 @@ modeTabType Communication = PTabCommunication
type Props = NT.Props Contact Mode
-- TODO: Move to Components.NgramsTable
-- TODO: Move to Components.NgramsTable
?
loadPage :: NT.PageParams -> Aff NT.VersionedNgramsTable
loadPage {nodeId, listIds, tabType, params: {offset, limit}} =
get $ toUrl Back (GetNgrams tabType offset limit listIds Nothing) (Just nodeId)
-- TODO this ignores orderBy
loadPage { nodeId, listIds, termListFilter, termTypeFilter
, searchQuery, tabType, params: {offset, limit, orderBy}} =
get $ toUrl Back
(GetNgrams { tabType, offset, limit, listIds
, orderBy: convOrderBy <$> orderBy
, termListFilter, termTypeFilter
, searchQuery
})
(Just nodeId)
where
convOrderBy _ = DateAsc -- TODO
-- TODO: Move to Components.NgramsTable?
ngramsLoaderClass :: Loader.LoaderClass NT.PageParams NT.VersionedNgramsTable
...
...
src/Gargantext/Pages/Corpus/Tabs/Ngrams/NgramsTable.purs
View file @
733b0f61
...
...
@@ -13,7 +13,7 @@ import Thermite (Render, Spec, createClass, defaultPerformAction, simpleSpec)
import Gargantext.Components.Node (NodePoly)
import Gargantext.Components.NgramsTable as NT
import Gargantext.Prelude
import Gargantext.Config (CTabNgramType(..), End(..), Offset, Limit, Path(..), TabSubType(..), TabType(..), toUrl)
import Gargantext.Config (CTabNgramType(..), End(..), Offset, Limit,
OrderBy(..),
Path(..), TabSubType(..), TabType(..), toUrl)
import Gargantext.Config.REST (get)
import Gargantext.Components.Loader as Loader
import Gargantext.Pages.Corpus.Tabs.Types (CorpusData)
...
...
@@ -37,9 +37,17 @@ modeTabType Terms = CTabTerms
-- TODO: Move to Components.NgramsTable?
loadPage :: NT.PageParams -> Aff NT.VersionedNgramsTable
loadPage {nodeId, listIds, tabType, params: {offset, limit}} =
get $ toUrl Back (GetNgrams tabType offset limit listIds Nothing) (Just nodeId)
-- TODO this ignores orderBy
loadPage { nodeId, listIds, termListFilter, termTypeFilter
, searchQuery, tabType, params: {offset, limit, orderBy}} =
get $ toUrl Back
(GetNgrams { tabType, offset, limit, listIds
, orderBy: convOrderBy <$> orderBy
, termListFilter, termTypeFilter
, searchQuery
})
(Just nodeId)
where
convOrderBy _ = DateAsc -- TODO
-- TODO: Move to Components.NgramsTable?
ngramsLoaderClass :: Loader.LoaderClass NT.PageParams NT.VersionedNgramsTable
...
...
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