Type fixes

parent 9bc65e7e
......@@ -3,14 +3,15 @@ module Gargantext.Pages.Corpus.Tabs.Actions where
import Data.Lens (Prism', prism)
import Data.Either (Either(..))
import Data.Void (Void)
import Gargantext.Pages.Corpus.Tabs.Documents as DV
import Gargantext.Pages.Corpus.Tabs.Ngrams as NG
import Gargantext.Pages.Corpus.Tabs.Ngrams.NgramsTable as NG
import Gargantext.Components.Tab as Tab
data Action
= DocViewA DV.Action -- = Void
| NgramViewA NG.Action -- = Void
| NgramViewA Void -- NG.Action TODO needed ?
| TabViewA Tab.Action -- = ChangeTab which is only used locally
_docAction :: Prism' Action DV.Action
......@@ -19,7 +20,7 @@ _docAction = prism DocViewA \ action ->
DocViewA laction -> Right laction
_-> Left action
_NgramViewA :: Prism' Action NG.Action
_NgramViewA :: Prism' Action Void -- NG.Action
_NgramViewA = prism NgramViewA \ action ->
case action of
NgramViewA laction -> Right laction
......
......@@ -187,7 +187,7 @@ data Action
| SetTermTypeFilter (Maybe TermType)
| SetSearchQuery String
data Mode = Authors | Sources | Terms
data Mode = Authors | Sources | Terms | Trash
type Dispatch = Action -> Effect Unit
......
......@@ -2,27 +2,27 @@ module Gargantext.Pages.Corpus.Tabs.States where
import Data.Lens (Lens', lens)
import Gargantext.Pages.Corpus.Tabs.Documents as D
import Gargantext.Pages.Corpus.Tabs.Ngrams as N
import Gargantext.Pages.Corpus.Tabs.Ngrams.NgramsTable as N
import Gargantext.Components.Tab as Tab
type State =
{ docsView :: D.State
, ngramsView :: N.State
, ngramsView :: {} -- N.State TODO needed
, activeTab :: Int
}
initialState :: State
initialState =
{ docsView : {}
, ngramsView : N.initialState
, 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' State {} -- N.State
_ngramsView = lens (\s -> s.ngramsView) (\s ss -> s {ngramsView = ss})
_tablens :: Lens' State Tab.State
......
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