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
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
...
@@ -513,11 +513,8 @@ selectNgramsOnFirstPage rows = Set.fromFoldable $ (view $ _NgramsElement <<< _ng
type MainNgramsTableProps = (
type MainNgramsTableProps = (
cacheState :: R.State NT.CacheState
cacheState :: R.State NT.CacheState
, defaultListId :: Int
, defaultListId :: Int
, nodeId :: Int
-- ^ This node can be a corpus or contact.
-- ^ This node can be a corpus or contact.
, pathS :: R.State PageParams
, path :: PageParams
, session :: Session
, tabType :: TabType
| CommonProps
| CommonProps
)
)
...
@@ -531,12 +528,9 @@ mainNgramsTableCpt = R.hooksComponentWithModule thisModule "mainNgramsTable" cpt
...
@@ -531,12 +528,9 @@ mainNgramsTableCpt = R.hooksComponentWithModule thisModule "mainNgramsTable" cpt
, asyncTasksRef
, asyncTasksRef
, cacheState
, cacheState
, defaultListId
, defaultListId
, nodeId
, path
, pathS
, session
, sidePanelTriggers
, sidePanelTriggers
, tabNgramType
, tabNgramType
, tabType
, treeReloadRef
, treeReloadRef
, withAutoUpdate } _ = do
, withAutoUpdate } _ = do
...
@@ -548,7 +542,7 @@ mainNgramsTableCpt = R.hooksComponentWithModule thisModule "mainNgramsTable" cpt
...
@@ -548,7 +542,7 @@ mainNgramsTableCpt = R.hooksComponentWithModule thisModule "mainNgramsTable" cpt
, appReload
, appReload
, asyncTasksRef
, asyncTasksRef
, cacheState: fst cacheState
, cacheState: fst cacheState
, path
: fst pathS
, path
, sidePanelTriggers
, sidePanelTriggers
, tabNgramType
, tabNgramType
, treeReloadRef
, treeReloadRef
...
@@ -558,11 +552,11 @@ mainNgramsTableCpt = R.hooksComponentWithModule thisModule "mainNgramsTable" cpt
...
@@ -558,11 +552,11 @@ mainNgramsTableCpt = R.hooksComponentWithModule thisModule "mainNgramsTable" cpt
cacheEndpoint: versionEndpoint props
cacheEndpoint: versionEndpoint props
, handleResponse
, handleResponse
, mkRequest
, mkRequest
, path
: fst pathS
, path
, renderer: render
, renderer: render
}
}
(NT.CacheOff /\ _) -> do
(NT.CacheOff /\ _) -> do
--
pathS <- R.useState' path
pathS <- R.useState' path
let render versionedWithCount = mainNgramsTablePaintNoCache { afterSync
let render versionedWithCount = mainNgramsTablePaintNoCache { afterSync
, appReload
, appReload
, asyncTasksRef
, asyncTasksRef
...
@@ -577,7 +571,7 @@ mainNgramsTableCpt = R.hooksComponentWithModule thisModule "mainNgramsTable" cpt
...
@@ -577,7 +571,7 @@ mainNgramsTableCpt = R.hooksComponentWithModule thisModule "mainNgramsTable" cpt
-- NOTE With cache on
-- NOTE With cache on
versionEndpoint :: Record MainNgramsTableProps -> PageParams -> Aff Version
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
-- NOTE With cache off
loader :: PageParams -> Aff VersionedWithCountNgramsTable
loader :: PageParams -> Aff VersionedWithCountNgramsTable
...
...
src/Gargantext/Components/Nodes/Annuaire/Tabs.purs
View file @
13ea1281
...
@@ -157,7 +157,7 @@ ngramsViewCpt = R.hooksComponentWithModule thisModule "ngramsView" cpt
...
@@ -157,7 +157,7 @@ ngramsViewCpt = R.hooksComponentWithModule thisModule "ngramsView" cpt
, session
, session
, sidePanelTriggers
, sidePanelTriggers
, treeReloadRef } _ = do
, treeReloadRef } _ = do
pathS <- R.useState' $
NTC.initialPageParams session nodeId [defaultListId] (TabDocument TabDocs)
let path =
NTC.initialPageParams session nodeId [defaultListId] (TabDocument TabDocs)
pure $ NT.mainNgramsTable {
pure $ NT.mainNgramsTable {
appReload
appReload
...
@@ -165,10 +165,7 @@ ngramsViewCpt = R.hooksComponentWithModule thisModule "ngramsView" cpt
...
@@ -165,10 +165,7 @@ ngramsViewCpt = R.hooksComponentWithModule thisModule "ngramsView" cpt
, asyncTasksRef
, asyncTasksRef
, cacheState
, cacheState
, defaultListId
, defaultListId
, nodeId
, path
, pathS
, tabType
, session
, sidePanelTriggers
, sidePanelTriggers
, tabNgramType
, tabNgramType
, treeReloadRef
, treeReloadRef
...
...
src/Gargantext/Components/Nodes/Annuaire/User/Contacts/Tabs.purs
View file @
13ea1281
...
@@ -157,7 +157,7 @@ ngramsViewCpt = R.hooksComponentWithModule thisModule "ngramsView" cpt
...
@@ -157,7 +157,7 @@ ngramsViewCpt = R.hooksComponentWithModule thisModule "ngramsView" cpt
, session
, session
, sidePanelTriggers
, sidePanelTriggers
, treeReloadRef } _ = do
, treeReloadRef } _ = do
pathS <- R.useState' $
NTC.initialPageParams session nodeId [defaultListId] (TabDocument TabDocs)
let path =
NTC.initialPageParams session nodeId [defaultListId] (TabDocument TabDocs)
pure $ NT.mainNgramsTable {
pure $ NT.mainNgramsTable {
appReload
appReload
...
@@ -165,10 +165,7 @@ ngramsViewCpt = R.hooksComponentWithModule thisModule "ngramsView" cpt
...
@@ -165,10 +165,7 @@ ngramsViewCpt = R.hooksComponentWithModule thisModule "ngramsView" cpt
, asyncTasksRef
, asyncTasksRef
, cacheState
, cacheState
, defaultListId
, defaultListId
, nodeId
, path
, pathS
, tabType
, session
, sidePanelTriggers
, sidePanelTriggers
, tabNgramType
, tabNgramType
, treeReloadRef
, treeReloadRef
...
...
src/Gargantext/Components/Nodes/Lists/Tabs.purs
View file @
13ea1281
...
@@ -21,6 +21,7 @@ import Gargantext.Components.Nodes.Corpus.Chart.Tree (tree)
...
@@ -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 (getChartFunction)
import Gargantext.Components.Nodes.Corpus.Chart.Utils (mNgramsTypeFromTabType)
import Gargantext.Components.Nodes.Corpus.Chart.Utils (mNgramsTypeFromTabType)
import Gargantext.Components.Nodes.Lists.Types
import Gargantext.Components.Nodes.Lists.Types
import Gargantext.Components.Search as S
import Gargantext.Components.Tab as Tab
import Gargantext.Components.Tab as Tab
import Gargantext.Sessions (Session)
import Gargantext.Sessions (Session)
import Gargantext.Types (ChartType(..), CTabNgramType(..), Mode(..), TabSubType(..), TabType(..), chartTypeFromString, modeTabType)
import Gargantext.Types (ChartType(..), CTabNgramType(..), Mode(..), TabSubType(..), TabType(..), chartTypeFromString, modeTabType)
...
@@ -77,12 +78,12 @@ tabsCpt = R.hooksComponentWithModule thisModule "tabs" cpt
...
@@ -77,12 +78,12 @@ tabsCpt = R.hooksComponentWithModule thisModule "tabs" cpt
, mode
, mode
, session
, session
, sidePanelTriggers
, sidePanelTriggers
, treeReloadRef }
, treeReloadRef }
[]
type NgramsViewProps = ( mode :: Mode | Props )
type NgramsViewProps = ( mode :: Mode | Props )
ngramsView :: R
ecord NgramsViewProps -> R.Element
ngramsView :: R
2.Component NgramsViewProps
ngramsView
props = R.createElement ngramsViewCpt props []
ngramsView
= R.createElement ngramsViewCpt
ngramsViewCpt :: R.Component NgramsViewProps
ngramsViewCpt :: R.Component NgramsViewProps
ngramsViewCpt = R.hooksComponentWithModule thisModule "ngramsView" cpt
ngramsViewCpt = R.hooksComponentWithModule thisModule "ngramsView" cpt
...
@@ -100,19 +101,12 @@ ngramsViewCpt = R.hooksComponentWithModule thisModule "ngramsView" cpt
...
@@ -100,19 +101,12 @@ ngramsViewCpt = R.hooksComponentWithModule thisModule "ngramsView" cpt
chartType <- R.useState' Histo
chartType <- R.useState' Histo
chartsReload <- GUR.new
chartsReload <- GUR.new
pathS <- R.useState' $ NTC.initialPageParams session initialPath.corpusId [initialPath.listId] initialPath.tabType
let path = NTC.initialPageParams session corpusId [listId] 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 chartParams = {
let chartParams = {
corpusId
: path.corpusId
corpusId
, limit: Just path.limit
, limit: Just path.
params.
limit
, listId
: path.listId
, listId
, tabType
: path.tabType
, tabType
}
}
pure $ R.fragment
pure $ R.fragment
...
@@ -122,12 +116,9 @@ ngramsViewCpt = R.hooksComponentWithModule thisModule "ngramsView" cpt
...
@@ -122,12 +116,9 @@ ngramsViewCpt = R.hooksComponentWithModule thisModule "ngramsView" cpt
, asyncTasksRef
, asyncTasksRef
, cacheState
, cacheState
, defaultListId
, defaultListId
, nodeId: corpusId
, path
, pathS
, session
, sidePanelTriggers
, sidePanelTriggers
, tabNgramType
, tabNgramType
, tabType
, treeReloadRef
, treeReloadRef
, withAutoUpdate: false
, 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