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
6abd6697
Commit
6abd6697
authored
Nov 05, 2020
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ngrams] asyncTasksRef
parent
bcc6aaa6
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
102 additions
and
93 deletions
+102
-93
App.purs
src/Gargantext/Components/App.purs
+21
-20
Forest.purs
src/Gargantext/Components/Forest.purs
+17
-12
GraphExplorer.purs
src/Gargantext/Components/GraphExplorer.purs
+6
-6
NgramsTable.purs
src/Gargantext/Components/NgramsTable.purs
+22
-20
Contacts.purs
src/Gargantext/Components/Nodes/Annuaire/User/Contacts.purs
+10
-10
Tabs.purs
...gantext/Components/Nodes/Annuaire/User/Contacts/Tabs.purs
+13
-13
Lists.purs
src/Gargantext/Components/Nodes/Lists.purs
+4
-3
Tabs.purs
src/Gargantext/Components/Nodes/Lists/Tabs.purs
+9
-9
No files found.
src/Gargantext/Components/App.purs
View file @
6abd6697
...
...
@@ -52,20 +52,20 @@ appCpt = R.hooksComponentWithModule thisModule "app" cpt where
sessions <- useSessions
route <- useHashRouter router Home
asyncTasksRef <- R.useRef Nothing
showLogin <- R.useState' false
backend <- R.useState' Nothing
treeReload <- R.useState' 0
asyncTasks <- GAT.useTasks treeReload
showCorpus <- R.useState' false
handed <- R.useState' GT.RightHanded
let backends = fromFoldable defaultBackends
let ff f session = R.fragment [ f session, footer { session } ]
let forested child = forestLayout { asyncTasks
let forested child = forestLayout { asyncTasks
Ref
, child
, frontends
, handed
...
...
@@ -93,12 +93,13 @@ appCpt = R.hooksComponentWithModule thisModule "app" cpt where
Annuaire sid nodeId -> withSession sid $ \session -> forested $ annuaireLayout { frontends, nodeId, session }
ContactPage sid aId nodeId -> withSession sid $ \session -> forested $ annuaireUserLayout {
annuaireId: aId
, asyncTasks: snd asyncTasks, frontends
, asyncTasksRef
, frontends
, nodeId
, session
}
Corpus sid nodeId -> withSession sid $ \session -> forested $ corpusLayout { nodeId, session }
CorpusDocument sid corpusId listId nodeId -> withSession sid $ \session -> forested $ documentLayout {
nodeId, listId, session, corpusId: Just corpusId
}
CorpusDocument sid corpusId listId nodeId -> withSession sid $ \session -> forested $ documentLayout {
corpusId: Just corpusId, nodeId, listId, session
}
Dashboard sid nodeId -> withSession sid $ \session -> forested $ dashboardLayout { nodeId, session }
Document sid listId nodeId ->
withSession sid $
...
...
@@ -109,7 +110,7 @@ appCpt = R.hooksComponentWithModule thisModule "app" cpt where
FolderShared sid nodeId -> withSession sid $ \session -> forested $ corpusLayout { nodeId, session }
Home -> forested $ homeLayout { backend, lang:LL_EN, publicBackend, sessions, visible: showLogin }
Lists sid nodeId -> withSession sid $ \session -> forested $ listsLayout {
asyncTasks
: snd asyncTasks
asyncTasks
Ref
, nodeId
, session
, sessionUpdate
...
...
@@ -119,7 +120,7 @@ appCpt = R.hooksComponentWithModule thisModule "app" cpt where
withSession sid $
\session ->
simpleLayout handed $
explorerLayout { asyncTasks
explorerLayout { asyncTasks
Ref
, backend
, frontends
, graphId
...
...
@@ -137,22 +138,22 @@ appCpt = R.hooksComponentWithModule thisModule "app" cpt where
Team sid nodeId -> withSession sid $ \session -> forested $ corpusLayout { nodeId, session }
Texts sid nodeId -> withSession sid $ \session -> forested $ textsLayout { frontends, nodeId, session, sessionUpdate }
UserPage sid nodeId -> withSession sid $ \session -> forested $ userLayout {
asyncTasks
: snd asyncTasks
asyncTasks
Ref
, frontends
, nodeId
, session
}
type ForestLayoutProps =
( asyncTasks :: GAT.Reductor
, backend :: R.State (Maybe Backend)
, child :: R.Element
, frontends :: Frontends
, handed :: R.State GT.Handed
, reload :: R.State Int
, route :: AppRoute
, sessions :: Sessions
, showLogin :: R.Setter Boolean
type ForestLayoutProps =
(
asyncTasksRef :: R.Ref (Maybe GAT.Reductor)
, backend
:: R.State (Maybe Backend)
, child
:: R.Element
, frontends
:: Frontends
, handed
:: R.State GT.Handed
, reload
:: R.State Int
, route
:: AppRoute
, sessions
:: Sessions
, showLogin
:: R.Setter Boolean
)
forestLayout :: Record ForestLayoutProps -> R.Element
...
...
@@ -170,7 +171,7 @@ forestLayoutMain props = R.createElement forestLayoutMainCpt props []
forestLayoutMainCpt :: R.Component ForestLayoutProps
forestLayoutMainCpt = R.hooksComponentWithModule thisModule "forestLayoutMain" cpt
where
cpt { asyncTasks, child, frontends, handed, reload, route, sessions, showLogin, backend} _ = do
cpt { asyncTasks
Ref
, child, frontends, handed, reload, route, sessions, showLogin, backend} _ = do
let ordering =
case fst handed of
GT.LeftHanded -> reverse
...
...
@@ -178,7 +179,7 @@ forestLayoutMainCpt = R.hooksComponentWithModule thisModule "forestLayoutMain" c
pure $ R2.row $ ordering [
H.div { className: "col-md-2", style: { paddingTop: "60px" } }
[ forest { asyncTasks, backend, frontends, handed: fst handed, reload, route, sessions, showLogin } ]
[ forest { asyncTasks
Ref
, backend, frontends, handed: fst handed, reload, route, sessions, showLogin } ]
, mainPage child
]
...
...
src/Gargantext/Components/Forest.purs
View file @
6abd6697
...
...
@@ -21,15 +21,15 @@ import Gargantext.Utils.Reactix as R2
thisModule :: String
thisModule = "Gargantext.Components.Forest"
type Props =
( asyncTasks :: GAT.Reductor
, backend :: R.State (Maybe Backend)
, frontends :: Frontends
, handed :: Handed
, reload :: R.State Int
, route :: AppRoute
, sessions :: Sessions
, showLogin :: R.Setter Boolean
type Props =
(
asyncTasksRef :: R.Ref (Maybe GAT.Reductor)
, backend
:: R.State (Maybe Backend)
, frontends
:: Frontends
, handed
:: Handed
, reload
:: R.State Int
, route
:: AppRoute
, sessions
:: Sessions
, showLogin
:: R.Setter Boolean
)
forest :: Record Props -> R.Element
...
...
@@ -37,12 +37,17 @@ forest props = R.createElement forestCpt props []
forestCpt :: R.Component Props
forestCpt = R.hooksComponentWithModule thisModule "forest" cpt where
cpt { asyncTasks, frontends, handed, reload: extReload, route, sessions, showLogin, backend} _ = do
cpt { asyncTasks
Ref
, frontends, handed, reload: extReload, route, sessions, showLogin, backend} _ = do
-- NOTE: this is a hack to reload the tree view on demand
asyncTasks <- GAT.useTasks extReload
reload <- R.useState' (0 :: Reload)
openNodes <- R2.useLocalStorageState R2.openNodesKey (Set.empty :: OpenNodes)
R2.useCache
( frontends
R.useEffect' $ do
R.setRef asyncTasksRef $ Just asyncTasks
R2.useCache (
frontends
/\ route
/\ sessions
/\ fst openNodes
...
...
src/Gargantext/Components/GraphExplorer.purs
View file @
6abd6697
...
...
@@ -42,7 +42,7 @@ thisModule :: String
thisModule = "Gargantext.Components.GraphExplorer"
type LayoutProps = (
asyncTasks
:: GAT.Reductor
asyncTasks
Ref :: R.Ref (Maybe GAT.Reductor)
, backend :: R.State (Maybe Backend)
, frontends :: Frontends
, graphId :: GET.GraphId
...
...
@@ -92,7 +92,7 @@ explorer props = R.createElement explorerCpt props []
explorerCpt :: R.Component Props
explorerCpt = R.hooksComponentWithModule thisModule "explorer" cpt
where
cpt props@{ asyncTasks
cpt props@{ asyncTasks
Ref
, frontends
, graph
, graphId
...
...
@@ -157,7 +157,7 @@ explorerCpt = R.hooksComponentWithModule thisModule "explorer" cpt
[ inner handed
[ rowControls [ Controls.controls controls ]
, R2.row $ mainLayout handed $
tree { asyncTasks
tree { asyncTasks
Ref
, backend
, frontends
, handed
...
...
@@ -212,9 +212,9 @@ explorerCpt = R.hooksComponentWithModule thisModule "explorer" cpt
tree :: Record TreeProps -> R.Element
tree { show: false } = RH.div { id: "tree" } []
tree { asyncTasks, backend, frontends, handed, mCurrentRoute: route, reload, sessions, showLogin } =
tree { asyncTasks
Ref
, backend, frontends, handed, mCurrentRoute: route, reload, sessions, showLogin } =
RH.div {className: "col-md-2 graph-tree"} [
forest { asyncTasks, backend, frontends, handed, reload, route, sessions, showLogin }
forest { asyncTasks
Ref
, backend, frontends, handed, reload, route, sessions, showLogin }
]
mSidebar :: Maybe GET.MetaData
...
...
@@ -226,7 +226,7 @@ explorerCpt = R.hooksComponentWithModule thisModule "explorer" cpt
type TreeProps =
(
asyncTasks
:: GAT.Reductor
asyncTasks
Ref :: R.Ref (Maybe GAT.Reductor)
, backend :: R.State (Maybe Backend)
, frontends :: Frontends
, handed :: Types.Handed
...
...
src/Gargantext/Components/NgramsTable.purs
View file @
6abd6697
...
...
@@ -22,7 +22,7 @@ import Data.Set as Set
import Data.Symbol (SProxy(..))
import Data.Tuple (Tuple(..), fst, snd)
import Data.Tuple.Nested ((/\))
import DOM.Simple.Console (log2)
import DOM.Simple.Console (log
, log
2)
import Effect (Effect)
import Effect.Aff (Aff, launchAff_)
import Effect.Class (liftEffect)
...
...
@@ -280,7 +280,7 @@ tableContainerCpt { dispatch
-- NEXT
type Props = (
afterSync :: Unit -> Aff Unit
, asyncTasks
:: GAT.ReductorAction
, asyncTasks
Ref :: R.Ref (Maybe GAT.Reductor)
, path :: R.State PageParams
, state :: R.State State
, tabNgramType :: CTabNgramType
...
...
@@ -295,7 +295,7 @@ loadedNgramsTableCpt :: R.Component Props
loadedNgramsTableCpt = R.hooksComponentWithModule thisModule "loadedNgramsTable" cpt
where
cpt { afterSync
, asyncTasks
, asyncTasks
Ref
, path: path@(path'@{ listIds, nodeId, params, searchQuery, scoreType, termListFilter, termSizeFilter } /\ setPath)
, state: (state@{ ngramsChildren
, ngramsLocalPatch
...
...
@@ -341,7 +341,9 @@ loadedNgramsTableCpt = R.hooksComponentWithModule thisModule "loadedNgramsTable"
task <- postNgramsChartsAsync path'
liftEffect $ do
log2 "[performAction] Synchronize task" task
asyncTasks $ GAT.Insert nodeId task
case R.readRef asyncTasksRef of
Nothing -> log "[performAction] asyncTasksRef is Nothing"
Just asyncTasks -> snd asyncTasks $ GAT.Insert nodeId task
autoUpdate :: Array R.Element
autoUpdate = if withAutoUpdate then
...
...
@@ -494,15 +496,15 @@ selectNgramsOnFirstPage rows = Set.fromFoldable $ (view $ _NgramsElement <<< _ng
type MainNgramsTableProps = (
afterSync :: Unit -> Aff Unit
, asyncTasks
:: GAT.ReductorAction
, cacheState :: R.State NT.CacheState
, defaultListId :: Int
, nodeId :: Int
afterSync
:: Unit -> Aff Unit
, asyncTasks
Ref :: R.Ref (Maybe GAT.Reductor)
, cacheState
:: R.State NT.CacheState
, defaultListId
:: Int
, nodeId
:: Int
-- ^ This node can be a corpus or contact.
, session :: Session
, tabNgramType :: CTabNgramType
, tabType :: TabType
, session
:: Session
, tabNgramType
:: CTabNgramType
, tabType
:: TabType
, withAutoUpdate :: Boolean
)
...
...
@@ -513,7 +515,7 @@ mainNgramsTableCpt :: R.Component MainNgramsTableProps
mainNgramsTableCpt = R.hooksComponentWithModule thisModule "mainNgramsTable" cpt
where
cpt props@{ afterSync
, asyncTasks
, asyncTasks
Ref
, cacheState
, defaultListId
, nodeId
...
...
@@ -523,7 +525,7 @@ mainNgramsTableCpt = R.hooksComponentWithModule thisModule "mainNgramsTable" cpt
, withAutoUpdate } _ = do
let path = initialPageParams session nodeId [defaultListId] tabType
let render versioned = mainNgramsTablePaint { afterSync
, asyncTasks
, asyncTasks
Ref
, path
, tabNgramType
, versioned
...
...
@@ -587,7 +589,7 @@ mainNgramsTableCpt = R.hooksComponentWithModule thisModule "mainNgramsTable" cpt
type MainNgramsTablePaintProps = (
afterSync :: Unit -> Aff Unit
, asyncTasks
:: GAT.ReductorAction
, asyncTasks
Ref :: R.Ref (Maybe GAT.Reductor)
, path :: PageParams
, tabNgramType :: CTabNgramType
, versioned :: VersionedNgramsTable
...
...
@@ -600,13 +602,13 @@ mainNgramsTablePaint p = R.createElement mainNgramsTablePaintCpt p []
mainNgramsTablePaintCpt :: R.Component MainNgramsTablePaintProps
mainNgramsTablePaintCpt = R.hooksComponentWithModule thisModule "mainNgramsTablePaint" cpt
where
cpt props@{ afterSync, asyncTasks, path, tabNgramType, versioned, withAutoUpdate } _ = do
cpt props@{ afterSync, asyncTasks
Ref
, path, tabNgramType, versioned, withAutoUpdate } _ = do
pathS <- R.useState' path
state <- R.useState' $ initialState versioned
pure $ loadedNgramsTable {
afterSync
, asyncTasks
, asyncTasks
Ref
, path: pathS
, state
, tabNgramType
...
...
@@ -616,7 +618,7 @@ mainNgramsTablePaintCpt = R.hooksComponentWithModule thisModule "mainNgramsTable
-- type MainNgramsTablePaintWithStateProps = (
-- afterSync :: Unit -> Aff Unit
-- , asyncTasks
:: GAT.Reductor
-- , asyncTasks
Ref :: R.Ref (Maybe GAT.Reductor)
-- , path :: R.State PageParams
-- , tabNgramType :: CTabNgramType
-- , versioned :: VersionedNgramsTable
...
...
@@ -629,12 +631,12 @@ mainNgramsTablePaintCpt = R.hooksComponentWithModule thisModule "mainNgramsTable
-- mainNgramsTablePaintWithStateCpt :: R.Component MainNgramsTablePaintWithStateProps
-- mainNgramsTablePaintWithStateCpt = R.hooksComponentWithModule thisModule "mainNgramsTablePaintWithState" cpt
-- where
-- cpt { afterSync, asyncTasks, path, tabNgramType, versioned, withAutoUpdate } _ = do
-- cpt { afterSync, asyncTasks
Ref
, path, tabNgramType, versioned, withAutoUpdate } _ = do
-- state <- R.useState' $ initialState versioned
-- pure $ loadedNgramsTable {
-- afterSync
-- , asyncTasks
-- , asyncTasks
Ref
-- , path
-- , state
-- , tabNgramType
...
...
src/Gargantext/Components/Nodes/Annuaire/User/Contacts.purs
View file @
6abd6697
...
...
@@ -145,10 +145,10 @@ infoRender (Tuple title content) =
, H.span {} [H.text content] ]
type LayoutProps = (
asyncTasks
:: GAT.ReductorAction
, frontends :: Frontends
, nodeId :: Int
, session :: Session
asyncTasks
Ref :: R.Ref (Maybe GAT.Reductor)
, frontends
:: Frontends
, nodeId
:: Int
, session
:: Session
)
type KeyLayoutProps = (
...
...
@@ -162,10 +162,10 @@ userLayout props = R.createElement userLayoutCpt props []
userLayoutCpt :: R.Component LayoutProps
userLayoutCpt = R.hooksComponentWithModule thisModule "userLayout" cpt
where
cpt { asyncTasks, frontends, nodeId, session } _ = do
cpt { asyncTasks
Ref
, frontends, nodeId, session } _ = do
let sid = sessionId session
pure $ userLayoutWithKey { asyncTasks, frontends, key: show sid <> "-" <> show nodeId, nodeId, session }
pure $ userLayoutWithKey { asyncTasks
Ref
, frontends, key: show sid <> "-" <> show nodeId, nodeId, session }
userLayoutWithKey :: Record KeyLayoutProps -> R.Element
userLayoutWithKey props = R.createElement userLayoutWithKeyCpt props []
...
...
@@ -173,7 +173,7 @@ userLayoutWithKey props = R.createElement userLayoutWithKeyCpt props []
userLayoutWithKeyCpt :: R.Component KeyLayoutProps
userLayoutWithKeyCpt = R.hooksComponentWithModule thisModule "userLayoutWithKey" cpt
where
cpt { asyncTasks, frontends, nodeId, session } _ = do
cpt { asyncTasks
Ref
, frontends, nodeId, session } _ = do
reload <- R.useState' 0
cacheState <- R.useState' NT.CacheOn
...
...
@@ -182,7 +182,7 @@ userLayoutWithKeyCpt = R.hooksComponentWithModule thisModule "userLayoutWithKey"
\contactData@{contactNode: Contact {name, hyperdata}} ->
H.ul { className: "col-md-12 list-group" } [
display (fromMaybe "no name" name) (contactInfos hyperdata (onUpdateHyperdata reload))
, Tabs.tabs { asyncTasks, cacheState, contactData, frontends, nodeId, session }
, Tabs.tabs { asyncTasks
Ref
, cacheState, contactData, frontends, nodeId, session }
]
where
onUpdateHyperdata :: R.State Int -> HyperdataUser -> Effect Unit
...
...
@@ -224,14 +224,14 @@ annuaireUserLayout props = R.createElement annuaireUserLayoutCpt props []
annuaireUserLayoutCpt :: R.Component AnnuaireLayoutProps
annuaireUserLayoutCpt = R.hooksComponentWithModule thisModule "annuaireUserLayout" cpt
where
cpt { annuaireId, asyncTasks, frontends, nodeId, session } _ = do
cpt { annuaireId, asyncTasks
Ref
, frontends, nodeId, session } _ = do
cacheState <- R.useState' NT.CacheOn
useLoader nodeId (getAnnuaireContact session annuaireId) $
\contactData@{contactNode: Contact {name, hyperdata}} ->
H.ul { className: "col-md-12 list-group" }
[ display (fromMaybe "no name" name) (contactInfos hyperdata onUpdateHyperdata)
, Tabs.tabs { asyncTasks, cacheState, contactData, frontends, nodeId, session } ]
, Tabs.tabs { asyncTasks
Ref
, cacheState, contactData, frontends, nodeId, session } ]
where
onUpdateHyperdata :: HyperdataUser -> Effect Unit
...
...
src/Gargantext/Components/Nodes/Annuaire/User/Contacts/Tabs.purs
View file @
6abd6697
...
...
@@ -44,12 +44,12 @@ modeTabType' Books = CTabAuthors
modeTabType' Communication = CTabAuthors
type TabsProps = (
asyncTasks
:: GAT.ReductorAction
, cacheState :: R.State NTypes.CacheState
, contactData :: ContactData
, frontends :: Frontends
, nodeId :: Int
, session :: Session
asyncTasks
Ref :: R.Ref (Maybe GAT.Reductor)
, cacheState
:: R.State NTypes.CacheState
, contactData
:: ContactData
, frontends
:: Frontends
, nodeId
:: Int
, session
:: Session
)
tabs :: Record TabsProps -> R.Element
...
...
@@ -58,7 +58,7 @@ tabs props = R.createElement tabsCpt props []
tabsCpt :: R.Component TabsProps
tabsCpt = R.hooksComponentWithModule thisModule "tabs" cpt
where
cpt { asyncTasks, cacheState, contactData: {defaultListId}, frontends, nodeId, session} _ = do
cpt { asyncTasks
Ref
, cacheState, contactData: {defaultListId}, frontends, nodeId, session} _ = do
active <- R.useState' 0
pure $
Tab.tabs { selected: fst active, tabs: tabs' }
...
...
@@ -71,9 +71,9 @@ tabsCpt = R.hooksComponentWithModule thisModule "tabs" cpt
, "Trash" /\ docs -- TODO pass-in trash mode
]
where
patentsView = { asyncTasks, cacheState, defaultListId, mode: Patents, nodeId, session }
booksView = { asyncTasks, cacheState, defaultListId, mode: Books, nodeId, session }
commView = { asyncTasks, cacheState, defaultListId, mode: Communication, nodeId, session }
patentsView = { asyncTasks
Ref
, cacheState, defaultListId, mode: Patents, nodeId, session }
booksView = { asyncTasks
Ref
, cacheState, defaultListId, mode: Books, nodeId, session }
commView = { asyncTasks
Ref
, cacheState, defaultListId, mode: Communication, nodeId, session }
chart = mempty
totalRecords = 4736 -- TODO
docs = DT.docViewLayout
...
...
@@ -91,7 +91,7 @@ tabsCpt = R.hooksComponentWithModule thisModule "tabs" cpt
type NgramsViewTabsProps = (
asyncTasks
:: GAT.ReductorAction
asyncTasks
Ref :: R.Ref (Maybe GAT.Reductor)
, cacheState :: R.State NTypes.CacheState
, defaultListId :: Int
, mode :: Mode
...
...
@@ -100,10 +100,10 @@ type NgramsViewTabsProps = (
)
ngramsView :: Record NgramsViewTabsProps -> R.Element
ngramsView { asyncTasks, cacheState, defaultListId, mode, nodeId, session } =
ngramsView { asyncTasks
Ref
, cacheState, defaultListId, mode, nodeId, session } =
NT.mainNgramsTable {
afterSync: \_ -> pure unit
, asyncTasks
, asyncTasks
Ref
, cacheState
, defaultListId
, nodeId
...
...
src/Gargantext/Components/Nodes/Lists.purs
View file @
6abd6697
module Gargantext.Components.Nodes.Lists where
import Data.Maybe (Maybe(..))
import Data.Tuple (fst)
import Effect (Effect)
import Effect.Aff (launchAff_)
...
...
@@ -25,7 +26,7 @@ thisModule = "Gargantext.Components.Nodes.Lists"
------------------------------------------------------------------------
type Props = (
asyncTasks
:: GAT.ReductorAction
asyncTasks
Ref :: R.Ref (Maybe GAT.Reductor)
, nodeId :: Int
, session :: Session
, sessionUpdate :: Session -> Effect Unit
...
...
@@ -53,7 +54,7 @@ listsLayoutWithKey props = R.createElement listsLayoutWithKeyCpt props []
listsLayoutWithKeyCpt :: R.Component KeyProps
listsLayoutWithKeyCpt = R.hooksComponentWithModule thisModule "listsLayoutWithKey" cpt
where
cpt { asyncTasks, nodeId, session, sessionUpdate } _ = do
cpt { asyncTasks
Ref
, nodeId, session, sessionUpdate } _ = do
let path = { nodeId, session }
cacheState <- R.useState' $ getCacheState NT.CacheOn session nodeId
...
...
@@ -74,7 +75,7 @@ listsLayoutWithKeyCpt = R.hooksComponentWithModule thisModule "listsLayoutWithKe
, title: "Corpus " <> name
, user: authors }
, Tabs.tabs {
asyncTasks
asyncTasks
Ref
, cacheState
, corpusData
, corpusId
...
...
src/Gargantext/Components/Nodes/Lists/Tabs.purs
View file @
6abd6697
...
...
@@ -26,11 +26,11 @@ thisModule :: String
thisModule = "Gargantext.Components.Nodes.Lists.Tabs"
type Props = (
asyncTasks
:: GAT.ReductorAction
, cacheState :: R.State NTypes.CacheState
, corpusData :: CorpusData
, corpusId :: Int
, session :: Session
asyncTasks
Ref :: R.Ref (Maybe GAT.Reductor)
, cacheState
:: R.State NTypes.CacheState
, corpusData
:: CorpusData
, corpusId
:: Int
, session
:: Session
)
type PropsWithKey = (
...
...
@@ -44,7 +44,7 @@ tabs props = R.createElement tabsCpt props []
tabsCpt :: R.Component PropsWithKey
tabsCpt = R.hooksComponentWithModule thisModule "tabs" cpt
where
cpt { asyncTasks, cacheState, corpusData: corpusData@{ defaultListId }, corpusId, session } _ = do
cpt { asyncTasks
Ref
, cacheState, corpusData: corpusData@{ defaultListId }, corpusId, session } _ = do
(selected /\ setSelected) <- R.useState' 0
pure $ Tab.tabs { selected, tabs: tabs' }
...
...
@@ -53,7 +53,7 @@ tabsCpt = R.hooksComponentWithModule thisModule "tabs" cpt
, "Institutes" /\ view Institutes
, "Sources" /\ view Sources
, "Terms" /\ view Terms ]
view mode = ngramsView { asyncTasks, cacheState, corpusData, corpusId, mode, session }
view mode = ngramsView { asyncTasks
Ref
, cacheState, corpusData, corpusId, mode, session }
type NgramsViewProps = ( mode :: Mode | Props )
...
...
@@ -63,7 +63,7 @@ ngramsView props = R.createElement ngramsViewCpt props []
ngramsViewCpt :: R.Component NgramsViewProps
ngramsViewCpt = R.hooksComponentWithModule thisModule "ngramsView" cpt
where
cpt { asyncTasks
cpt { asyncTasks
Ref
, cacheState
, corpusData: { defaultListId }
, corpusId
...
...
@@ -76,7 +76,7 @@ ngramsViewCpt = R.hooksComponentWithModule thisModule "ngramsView" cpt
pure $ R.fragment
( charts tabNgramType chartType chartsReload
<> [ NT.mainNgramsTable { afterSync: afterSync chartsReload
, asyncTasks
, asyncTasks
Ref
, cacheState
, defaultListId
, nodeId: corpusId
...
...
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