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
ccaf9251
Commit
ccaf9251
authored
Jul 22, 2020
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev-doc-table-optimization' into dev
parents
f1330411
9a014261
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
11 deletions
+12
-11
DocsTable.purs
src/Gargantext/Components/DocsTable.purs
+8
-7
CacheAPI.purs
src/Gargantext/Utils/CacheAPI.purs
+4
-4
No files found.
src/Gargantext/Components/DocsTable.purs
View file @
ccaf9251
...
...
@@ -368,8 +368,7 @@ type PageParams =
getPageHash :: Session -> PageParams -> Aff String
getPageHash session { corpusId, listId, nodeId, query, tabType } = do
let p = NodeAPI Node (Just nodeId) $ "table/hash" <> "?tabType=" <> (showTabType' tabType)
(get session p) :: Aff String
(get session $ tableHashRoute nodeId tabType) :: Aff String
convOrderBy (Just (T.ASC (T.ColumnName "Date"))) = Just DateAsc
...
...
@@ -417,7 +416,7 @@ pageLayoutCpt = R.hooksComponent "G.C.DocsTable.pageLayout" cpt where
mkRequest :: PageParams -> GUC.Request
mkRequest p@{ listId, nodeId, tabType } =
GUC.makeGetRequest session $
NodeAPI Node (Just nodeId) $ "table" <> "?tabType=" <> (showTabType' tabType) <> "&list=" <> (show listId)
GUC.makeGetRequest session $
tableRoute nodeId tabType listId
handleResponse :: HashedResponse (TableResult Response) -> Tuple Int (Array DocumentsView)
handleResponse (HashedResponse { hash, value: res }) = ret
where
...
...
@@ -543,13 +542,15 @@ instance encodeJsonSQuery :: EncodeJson SearchQuery where
~> jsonEmptyObject
searchResults :: SearchQuery -> Aff Int
searchResults squery = pure 42 -- TODO post "http://localhost:8008/count" unit
documentsRoute :: Int -> SessionRoute
documentsRoute nodeId = NodeAPI Node (Just nodeId) "documents"
tableRoute :: Int -> TabType -> Int -> SessionRoute
tableRoute nodeId tabType listId = NodeAPI Node (Just nodeId) $ "table" <> "?tabType=" <> (showTabType' tabType) <> "&list=" <> (show listId)
tableHashRoute :: Int -> TabType -> SessionRoute
tableHashRoute nodeId tabType = NodeAPI Node (Just nodeId) $ "table/hash" <> "?tabType=" <> (showTabType' tabType)
deleteAllDocuments :: Session -> Int -> Aff (Array Int)
deleteAllDocuments session = delete session <<< documentsRoute
...
...
src/Gargantext/Utils/CacheAPI.purs
View file @
ccaf9251
...
...
@@ -78,10 +78,10 @@ cached cache req = do
mRes <- match cache req
case mRes of
Just res -> do
liftEffect $ log2 "[cached] cache hit" req
--
liftEffect $ log2 "[cached] cache hit" req
pure res
Nothing -> do
liftEffect $ log2 "[cached] cache miss" req
--
liftEffect $ log2 "[cached] cache miss" req
_ <- add cache req
mResFresh <- match cache req
case mResFresh of
...
...
@@ -91,8 +91,8 @@ cached cache req = do
cachedJson :: forall a. DecodeJson a => Cache -> Request -> Aff a
cachedJson cache req = do
res <- cached cache req
liftEffect $ do
log2 "[cachedJson] res" res
--
liftEffect $ do
--
log2 "[cachedJson] res" res
j <- M.json res
case decodeJson (F.unsafeFromForeign j) of
...
...
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