Remove ngramview from global state

parent 7f7e4ea2
......@@ -11,7 +11,6 @@ import Gargantext.Components.Tab as Tab
data Action
= DocViewA DV.Action -- = Void
| NgramViewA Void -- NG.Action TODO needed ?
| TabViewA Tab.Action -- = ChangeTab which is only used locally
_docAction :: Prism' Action DV.Action
......@@ -20,12 +19,6 @@ _docAction = prism DocViewA \ action ->
DocViewA laction -> Right laction
_-> Left action
_NgramViewA :: Prism' Action Void -- NG.Action
_NgramViewA = prism NgramViewA \ action ->
case action of
NgramViewA laction -> Right laction
_-> Left action
_tabAction :: Prism' Action Tab.Action
_tabAction = prism TabViewA \ action ->
case action of
......
......@@ -6,13 +6,13 @@ import Data.List (fromFoldable)
import Data.Tuple (Tuple(..))
import Gargantext.Pages.Corpus.Tabs.Types (Props)
import Gargantext.Pages.Corpus.Tabs.States (State(), _doclens, _ngramsView, _tablens, initialState)
import Gargantext.Pages.Corpus.Tabs.Actions (Action(), _docAction, _NgramViewA, _tabAction)
import Gargantext.Pages.Corpus.Tabs.States (State(), _doclens, _tablens, initialState)
import Gargantext.Pages.Corpus.Tabs.Actions (Action(), _docAction, _tabAction)
import Gargantext.Pages.Corpus.Tabs.Documents as DV
import Gargantext.Pages.Corpus.Tabs.Ngrams.NgramsTable as NV
import Gargantext.Components.Tab as Tab
import Thermite (Spec, focus, hideState, cmapProps)
import Thermite (Spec, focus, hideState, noState, cmapProps)
-- pureTabs :: Spec {} Props Void
......@@ -34,7 +34,7 @@ docPageSpec = focus _doclens _docAction DV.layoutDocview
ngramsViewSpec :: {mode :: NV.Mode} -> Spec State Props Action
ngramsViewSpec {mode} =
cmapProps (\{loaded, path, dispatch} -> {mode,loaded,path, dispatch})
(focus _ngramsView _NgramViewA NV.ngramsTableSpec)
(noState NV.ngramsTableSpec)
authorPageSpec :: Spec State Props Action
authorPageSpec = ngramsViewSpec {mode: NV.Authors}
......
......@@ -9,7 +9,6 @@ import Gargantext.Components.Tab as Tab
type State =
{ docsView :: D.State
, ngramsView :: {} -- N.State TODO needed
, activeTab :: Int
}
......@@ -18,15 +17,11 @@ initialState _ =
{ docsView :
{ documentIdsToDelete : mempty
}
, ngramsView : {} -- N.initialState
, activeTab : 0
}
_doclens :: Lens' State D.State
_doclens = lens (\s -> s.docsView) (\s ss -> s {docsView = ss})
_ngramsView :: Lens' State {} -- N.State
_ngramsView = lens (\s -> s.ngramsView) (\s ss -> s {ngramsView = ss})
_tablens :: Lens' State Tab.State
_tablens = lens (\s -> s.activeTab) (\s ss -> s {activeTab = ss})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment