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
128
Issues
128
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
gargantext
purescript-gargantext
Commits
13ea1281
Commit
13ea1281
authored
Feb 04, 2021
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ngramsTable] fixes to graph refreshing
Components are simplified, some duplicated props are removed.
parent
20bdba69
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
41 deletions
+20
-41
NgramsTable.purs
src/Gargantext/Components/NgramsTable.purs
+6
-12
Tabs.purs
src/Gargantext/Components/Nodes/Annuaire/Tabs.purs
+2
-5
Tabs.purs
...gantext/Components/Nodes/Annuaire/User/Contacts/Tabs.purs
+2
-5
Tabs.purs
src/Gargantext/Components/Nodes/Lists/Tabs.purs
+10
-19
No files found.
src/Gargantext/Components/NgramsTable.purs
View file @
13ea1281
...
...
@@ -513,11 +513,8 @@ selectNgramsOnFirstPage rows = Set.fromFoldable $ (view $ _NgramsElement <<< _ng
type MainNgramsTableProps = (
cacheState :: R.State NT.CacheState
, defaultListId :: Int
, nodeId :: Int
-- ^ This node can be a corpus or contact.
, pathS :: R.State PageParams
, session :: Session
, tabType :: TabType
, path :: PageParams
| CommonProps
)
...
...
@@ -531,12 +528,9 @@ mainNgramsTableCpt = R.hooksComponentWithModule thisModule "mainNgramsTable" cpt
, asyncTasksRef
, cacheState
, defaultListId
, nodeId
, pathS
, session
, path
, sidePanelTriggers
, tabNgramType
, tabType
, treeReloadRef
, withAutoUpdate } _ = do
...
...
@@ -548,7 +542,7 @@ mainNgramsTableCpt = R.hooksComponentWithModule thisModule "mainNgramsTable" cpt
, appReload
, asyncTasksRef
, cacheState: fst cacheState
, path
: fst pathS
, path
, sidePanelTriggers
, tabNgramType
, treeReloadRef
...
...
@@ -558,11 +552,11 @@ mainNgramsTableCpt = R.hooksComponentWithModule thisModule "mainNgramsTable" cpt
cacheEndpoint: versionEndpoint props
, handleResponse
, mkRequest
, path
: fst pathS
, path
, renderer: render
}
(NT.CacheOff /\ _) -> do
--
pathS <- R.useState' path
pathS <- R.useState' path
let render versionedWithCount = mainNgramsTablePaintNoCache { afterSync
, appReload
, asyncTasksRef
...
...
@@ -577,7 +571,7 @@ mainNgramsTableCpt = R.hooksComponentWithModule thisModule "mainNgramsTable" cpt
-- NOTE With cache on
versionEndpoint :: Record MainNgramsTableProps -> PageParams -> Aff Version
versionEndpoint { defaultListId,
nodeId, session, tabType
} _ = get session $ R.GetNgramsTableVersion { listId: defaultListId, tabType } (Just nodeId)
versionEndpoint { defaultListId,
path: { nodeId, tabType, session }
} _ = get session $ R.GetNgramsTableVersion { listId: defaultListId, tabType } (Just nodeId)
-- NOTE With cache off
loader :: PageParams -> Aff VersionedWithCountNgramsTable
...
...
src/Gargantext/Components/Nodes/Annuaire/Tabs.purs
View file @
13ea1281
...
...
@@ -157,7 +157,7 @@ ngramsViewCpt = R.hooksComponentWithModule thisModule "ngramsView" cpt
, session
, sidePanelTriggers
, treeReloadRef } _ = do
pathS <- R.useState' $
NTC.initialPageParams session nodeId [defaultListId] (TabDocument TabDocs)
let path =
NTC.initialPageParams session nodeId [defaultListId] (TabDocument TabDocs)
pure $ NT.mainNgramsTable {
appReload
...
...
@@ -165,10 +165,7 @@ ngramsViewCpt = R.hooksComponentWithModule thisModule "ngramsView" cpt
, asyncTasksRef
, cacheState
, defaultListId
, nodeId
, pathS
, tabType
, session
, path
, sidePanelTriggers
, tabNgramType
, treeReloadRef
...
...
src/Gargantext/Components/Nodes/Annuaire/User/Contacts/Tabs.purs
View file @
13ea1281
...
...
@@ -157,7 +157,7 @@ ngramsViewCpt = R.hooksComponentWithModule thisModule "ngramsView" cpt
, session
, sidePanelTriggers
, treeReloadRef } _ = do
pathS <- R.useState' $
NTC.initialPageParams session nodeId [defaultListId] (TabDocument TabDocs)
let path =
NTC.initialPageParams session nodeId [defaultListId] (TabDocument TabDocs)
pure $ NT.mainNgramsTable {
appReload
...
...
@@ -165,10 +165,7 @@ ngramsViewCpt = R.hooksComponentWithModule thisModule "ngramsView" cpt
, asyncTasksRef
, cacheState
, defaultListId
, nodeId
, pathS
, tabType
, session
, path
, sidePanelTriggers
, tabNgramType
, treeReloadRef
...
...
src/Gargantext/Components/Nodes/Lists/Tabs.purs
View file @
13ea1281
...
...
@@ -21,6 +21,7 @@ import Gargantext.Components.Nodes.Corpus.Chart.Tree (tree)
import Gargantext.Components.Nodes.Corpus.Chart (getChartFunction)
import Gargantext.Components.Nodes.Corpus.Chart.Utils (mNgramsTypeFromTabType)
import Gargantext.Components.Nodes.Lists.Types
import Gargantext.Components.Search as S
import Gargantext.Components.Tab as Tab
import Gargantext.Sessions (Session)
import Gargantext.Types (ChartType(..), CTabNgramType(..), Mode(..), TabSubType(..), TabType(..), chartTypeFromString, modeTabType)
...
...
@@ -77,12 +78,12 @@ tabsCpt = R.hooksComponentWithModule thisModule "tabs" cpt
, mode
, session
, sidePanelTriggers
, treeReloadRef }
, treeReloadRef }
[]
type NgramsViewProps = ( mode :: Mode | Props )
ngramsView :: R
ecord NgramsViewProps -> R.Element
ngramsView
props = R.createElement ngramsViewCpt props []
ngramsView :: R
2.Component NgramsViewProps
ngramsView
= R.createElement ngramsViewCpt
ngramsViewCpt :: R.Component NgramsViewProps
ngramsViewCpt = R.hooksComponentWithModule thisModule "ngramsView" cpt
...
...
@@ -100,19 +101,12 @@ ngramsViewCpt = R.hooksComponentWithModule thisModule "ngramsView" cpt
chartType <- R.useState' Histo
chartsReload <- GUR.new
pathS <- R.useState' $ NTC.initialPageParams session initialPath.corpusId [initialPath.listId] initialPath.tabType
let listId' = fromMaybe defaultListId $ A.head (fst pathS).listIds
let path = {
corpusId: (fst pathS).nodeId
, limit: (fst pathS).params.limit
, listId: listId'
, tabType: (fst pathS).tabType
}
let path = NTC.initialPageParams session corpusId [listId] tabType
let chartParams = {
corpusId
: path.corpusId
, limit: Just path.limit
, listId
: path.listId
, tabType
: path.tabType
corpusId
, limit: Just path.
params.
limit
, listId
, tabType
}
pure $ R.fragment
...
...
@@ -122,12 +116,9 @@ ngramsViewCpt = R.hooksComponentWithModule thisModule "ngramsView" cpt
, asyncTasksRef
, cacheState
, defaultListId
, nodeId: corpusId
, pathS
, session
, path
, sidePanelTriggers
, tabNgramType
, tabType
, treeReloadRef
, withAutoUpdate: false
} []
...
...
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