Use {} instead of forall props in specs

parent 246ab19a
...@@ -52,7 +52,7 @@ data Action ...@@ -52,7 +52,7 @@ data Action
| SetPassword String | SetPassword String
performAction :: forall props. PerformAction State props Action performAction :: PerformAction State {} Action
performAction NoOp _ _ = void do performAction NoOp _ _ = void do
modifyState identity modifyState identity
...@@ -107,13 +107,13 @@ modalSpec sm t = over _render \render d p s c -> ...@@ -107,13 +107,13 @@ modalSpec sm t = over _render \render d p s c ->
] ]
] ]
spec' :: forall props. Spec State props Action spec' :: Spec State {} Action
spec' = modalSpec true "Login" renderSpec spec' = modalSpec true "Login" renderSpec
renderSpec :: forall props. Spec State props Action renderSpec :: Spec State {} Action
renderSpec = simpleSpec performAction render renderSpec = simpleSpec performAction render
where where
render :: Render State props Action render :: Render State {} Action
render dispatch _ (State state) _ = render dispatch _ (State state) _ =
[ [
div [className "row"] div [className "row"]
......
...@@ -33,7 +33,7 @@ type State = FTree ...@@ -33,7 +33,7 @@ type State = FTree
initialState :: State initialState :: State
initialState = NLeaf (Tuple "" "") initialState = NLeaf (Tuple "" "")
performAction :: forall props. PerformAction State props Action performAction :: PerformAction State {} Action
performAction (ToggleFolder i) _ _ = void $ performAction (ToggleFolder i) _ _ = void $
cotransform (\td -> toggleNode i td) cotransform (\td -> toggleNode i td)
...@@ -89,10 +89,10 @@ nodeOptionsView activated = case activated of ...@@ -89,10 +89,10 @@ nodeOptionsView activated = case activated of
false -> [] false -> []
treeview :: forall props. Spec State props Action treeview :: Spec State {} Action
treeview = simpleSpec performAction render treeview = simpleSpec performAction render
where where
render :: Render State props Action render :: Render State {} Action
render dispatch _ state _ = render dispatch _ state _ =
[div [className "tree"] [toHtml dispatch state]] [div [className "tree"] [toHtml dispatch state]]
......
...@@ -24,15 +24,15 @@ type Corpus = { title :: String ...@@ -24,15 +24,15 @@ type Corpus = { title :: String
initialState :: State initialState :: State
initialState = Tab.initialState initialState = Tab.initialState
spec' :: forall props. Spec Tab.State props Tab.Action spec' :: Spec Tab.State {} Tab.Action
spec' = fold [ corpusSpec spec' = fold [ corpusSpec
, Tab.tab1 , Tab.tab1
] ]
corpusSpec :: forall props. Spec Tab.State props Tab.Action corpusSpec :: Spec Tab.State {} Tab.Action
corpusSpec = simpleSpec defaultPerformAction render corpusSpec = simpleSpec defaultPerformAction render
where where
render :: Render Tab.State props Tab.Action render :: Render Tab.State {} Tab.Action
render dispatch _ state _ = render dispatch _ state _ =
[ div [className "row"] [ div [className "row"]
[ div [className "col-md-3"] [ h3 [] [text corpus.title] ] [ div [className "col-md-3"] [ h3 [] [text corpus.title] ]
......
...@@ -27,7 +27,7 @@ data Action ...@@ -27,7 +27,7 @@ data Action
| SetInput String | SetInput String
performAction :: forall props. PerformAction State props Action performAction :: PerformAction State {} Action
performAction NoOp _ _ = pure unit performAction NoOp _ _ = pure unit
performAction (ChangeString ps) _ _ = pure unit performAction (ChangeString ps) _ _ = pure unit
...@@ -39,10 +39,10 @@ performAction (SetInput ps) _ _ = void do ...@@ -39,10 +39,10 @@ performAction (SetInput ps) _ _ = void do
docview :: forall props. Spec State props Action docview :: Spec State {} Action
docview = simpleSpec performAction render docview = simpleSpec performAction render
where where
render :: Render State props Action render :: Render State {} Action
render dispatch _ state _ = render dispatch _ state _ =
[ [
div [className "container1"] div [className "container1"]
......
...@@ -14,13 +14,12 @@ initialState = D.tdata ...@@ -14,13 +14,12 @@ initialState = D.tdata
type Action = D.Action type Action = D.Action
authorSpec :: Spec State {} Action
authorSpec :: forall props. Spec State props Action
authorSpec = simpleSpec defaultPerformAction render authorSpec = simpleSpec defaultPerformAction render
where where
render :: Render State props Action render :: Render State {} Action
render dispatch _ state _ = render dispatch _ state _ =
[ h3 [] [text "AuthorView"]] [ h3 [] [text "AuthorView"]]
authorspec' :: forall props. Spec State props Action authorspec' :: Spec State {} Action
authorspec' = fold [authorSpec, D.layoutDocview] authorspec' = fold [authorSpec, D.layoutDocview]
...@@ -19,10 +19,10 @@ data Action = None ...@@ -19,10 +19,10 @@ data Action = None
initialState :: State initialState :: State
initialState = unit initialState = unit
performAction :: forall props. PerformAction State props Action performAction :: PerformAction State {} Action
performAction _ _ _ = pure unit performAction _ _ _ = pure unit
render :: forall props. Render State props Action render :: Render State {} Action
render dispatch _ state _ = [ render dispatch _ state _ = [
h1 [] [text "IMT DashBoard"] h1 [] [text "IMT DashBoard"]
, div [className "row"] [ div [className "col-md-9 content"] [chart globalPublis] , div [className "row"] [ div [className "col-md-9 content"] [chart globalPublis]
...@@ -104,5 +104,5 @@ distriBySchool = Options { mainTitle : "School production in 2017" ...@@ -104,5 +104,5 @@ distriBySchool = Options { mainTitle : "School production in 2017"
} }
layoutDashboard :: forall props. Spec State props Action layoutDashboard :: Spec State {} Action
layoutDashboard = simpleSpec performAction render layoutDashboard = simpleSpec performAction render
...@@ -133,17 +133,17 @@ instance decodeResponse :: DecodeJson Response where ...@@ -133,17 +133,17 @@ instance decodeResponse :: DecodeJson Response where
-- | Filter -- | Filter
filterSpec :: forall props. Spec State props Action filterSpec :: Spec State {} Action
filterSpec = simpleSpec defaultPerformAction render filterSpec = simpleSpec defaultPerformAction render
where where
render d p s c = [div [] [ text " Filter " render d p s c = [div [] [ text " Filter "
, input [] , input []
]] ]]
layoutDocview :: forall props. Spec State props Action layoutDocview :: Spec State {} Action
layoutDocview = simpleSpec performAction render layoutDocview = simpleSpec performAction render
where where
render :: Render State props Action render :: Render State {} Action
render dispatch _ state@(TableData d) _ = render dispatch _ state@(TableData d) _ =
[ div [className "container1"] [ div [className "container1"]
[ div [className "row"] [ div [className "row"]
...@@ -177,7 +177,7 @@ layoutDocview = simpleSpec performAction render ...@@ -177,7 +177,7 @@ layoutDocview = simpleSpec performAction render
] ]
performAction :: forall props. PerformAction State props Action performAction :: PerformAction State {} Action
performAction (ChangePageSize ps) _ _ = void (cotransform (\state -> changePageSize ps state )) performAction (ChangePageSize ps) _ _ = void (cotransform (\state -> changePageSize ps state ))
performAction (ChangePage p) _ _ = void (cotransform (\(TableData td) -> TableData $ td { currentPage = p} )) performAction (ChangePage p) _ _ = void (cotransform (\(TableData td) -> TableData $ td { currentPage = p} ))
......
...@@ -54,10 +54,10 @@ initialState = State ...@@ -54,10 +54,10 @@ initialState = State
, selectedNode : Nothing , selectedNode : Nothing
} }
graphSpec :: forall props. Spec State props Action graphSpec :: Spec State {} Action
graphSpec = simpleSpec performAction render graphSpec = simpleSpec performAction render
performAction :: forall props. PerformAction State props Action performAction :: PerformAction State {} Action
performAction (LoadGraph fp) _ _ = void do performAction (LoadGraph fp) _ _ = void do
_ <- liftEffect $ log fp _ <- liftEffect $ log fp
case fp of case fp of
...@@ -97,7 +97,7 @@ convert (GraphData r) = SigmaGraphData { nodes, edges} ...@@ -97,7 +97,7 @@ convert (GraphData r) = SigmaGraphData { nodes, edges}
edges = map edgeFn r.edges edges = map edgeFn r.edges
edgeFn (Edge e) = sigmaEdge {id : e.id_, source : e.source, target : e.target} edgeFn (Edge e) = sigmaEdge {id : e.id_, source : e.source, target : e.target}
render :: forall props. Render State props Action render :: Render State {} Action
render d p (State s) c = render d p (State s) c =
[ select [ onChange $ \e -> d $ LoadGraph (unsafeCoerce e).target.value, value s.filePath] [ select [ onChange $ \e -> d $ LoadGraph (unsafeCoerce e).target.value, value s.filePath]
[ option [value ""] [text ""] [ option [value ""] [text ""]
...@@ -296,10 +296,10 @@ dispLegend ary = div [] $ map dl ary ...@@ -296,10 +296,10 @@ dispLegend ary = div [] $ map dl ary
] ]
specOld :: forall props. Spec State props Action specOld :: Spec State {} Action
specOld = simpleSpec performAction render' specOld = simpleSpec performAction render'
where where
render' :: Render State props Action render' :: Render State {} Action
render' d _ (State st) _ = render' d _ (State st) _ =
[ div [className "row"] [ [ div [className "row"] [
div [className "col-md-12", style {marginTop : "21px", marginBottom : "21px"}] div [className "col-md-12", style {marginTop : "21px", marginBottom : "21px"}]
......
...@@ -16,12 +16,12 @@ initialState = D.tdata ...@@ -16,12 +16,12 @@ initialState = D.tdata
type Action = D.Action type Action = D.Action
sourceSpec :: forall props. Spec State props Action sourceSpec :: Spec State {} Action
sourceSpec = simpleSpec defaultPerformAction render sourceSpec = simpleSpec defaultPerformAction render
where where
render :: Render State props Action render :: Render State {} Action
render dispatch _ state _ = render dispatch _ state _ =
[ h3 [] [text "Source view"]] [ h3 [] [text "Source view"]]
sourcespec' :: forall props. Spec State props Action sourcespec' :: Spec State {} Action
sourcespec' = fold [sourceSpec, D.layoutDocview] sourcespec' = fold [sourceSpec, D.layoutDocview]
...@@ -19,21 +19,21 @@ import Thermite (Spec, focus) ...@@ -19,21 +19,21 @@ import Thermite (Spec, focus)
tab1 :: forall props. Spec State props Action tab1 :: Spec State {} Action
tab1 = Tab.tabs _tablens _tabAction $ fromFoldable [ Tuple "Doc View" docPageSpec tab1 = Tab.tabs _tablens _tabAction $ fromFoldable [ Tuple "Doc View" docPageSpec
, Tuple "Author View" authorPageSpec , Tuple "Author View" authorPageSpec
, Tuple "Source View" sourcePageSpec , Tuple "Source View" sourcePageSpec
, Tuple "Terms View" termsPageSpec , Tuple "Terms View" termsPageSpec
] ]
docPageSpec :: forall props. Spec State props Action docPageSpec :: Spec State {} Action
docPageSpec = focus _doclens _docAction DV.layoutDocview docPageSpec = focus _doclens _docAction DV.layoutDocview
authorPageSpec :: forall props. Spec State props Action authorPageSpec :: Spec State {} Action
authorPageSpec = focus _authorlens _authorAction AV.authorspec' authorPageSpec = focus _authorlens _authorAction AV.authorspec'
sourcePageSpec :: forall props. Spec State props Action sourcePageSpec :: Spec State {} Action
sourcePageSpec = focus _sourcelens _sourceAction SV.sourcespec' sourcePageSpec = focus _sourcelens _sourceAction SV.sourcespec'
termsPageSpec :: forall props. Spec State props Action termsPageSpec :: Spec State {} Action
termsPageSpec = focus _termslens _termsAction TV.termSpec' termsPageSpec = focus _termslens _termsAction TV.termSpec'
...@@ -17,12 +17,12 @@ initialState = D.tdata ...@@ -17,12 +17,12 @@ initialState = D.tdata
type Action = D.Action type Action = D.Action
termsSpec :: forall props. Spec State props Action termsSpec :: Spec State {} Action
termsSpec = simpleSpec defaultPerformAction render termsSpec = simpleSpec defaultPerformAction render
where where
render :: Render State props Action render :: Render State {} Action
render dispatch _ state _ = render dispatch _ state _ =
[ h3 [] [text "Terms view"]] [ h3 [] [text "Terms view"]]
termSpec' :: forall props. Spec State props Action termSpec' :: Spec State {} Action
termSpec' = fold [termsSpec, D.layoutDocview] termSpec' = fold [termsSpec, D.layoutDocview]
...@@ -33,17 +33,17 @@ data Action ...@@ -33,17 +33,17 @@ data Action
= SetMap Boolean = SetMap Boolean
| SetStop Boolean | SetStop Boolean
performAction :: forall props. PerformAction State props Action performAction :: PerformAction State {} Action
performAction (SetMap b) _ _ = void do performAction (SetMap b) _ _ = void do
modifyState \(State s) -> State s {term = setter (_{_type = (if b then MapTerm else None)}) s.term} modifyState \(State s) -> State s {term = setter (_{_type = (if b then MapTerm else None)}) s.term}
performAction (SetStop b) _ _ = void do performAction (SetStop b) _ _ = void do
modifyState \(State s) -> State s {term = setter (_{_type = (if b then StopTerm else None)}) s.term} modifyState \(State s) -> State s {term = setter (_{_type = (if b then StopTerm else None)}) s.term}
ngramsItemSpec :: forall props. Spec State props Action ngramsItemSpec :: Spec State {} Action
ngramsItemSpec = simpleSpec performAction render ngramsItemSpec = simpleSpec performAction render
where where
render :: Render State props Action render :: Render State {} Action
render dispatch _ (State state) _ = render dispatch _ (State state) _ =
[ [
tr [] tr []
......
...@@ -51,7 +51,7 @@ _ItemAction = prism (uncurry ItemAction) \ta -> ...@@ -51,7 +51,7 @@ _ItemAction = prism (uncurry ItemAction) \ta ->
ItemAction i a -> Right (Tuple i a) ItemAction i a -> Right (Tuple i a)
_ -> Left ta _ -> Left ta
performAction :: forall props. PerformAction State props Action performAction :: PerformAction State {} Action
performAction (ChangePageSize ps) _ _ = void (cotransform (\state -> changePageSize ps state )) performAction (ChangePageSize ps) _ _ = void (cotransform (\state -> changePageSize ps state ))
...@@ -70,7 +70,7 @@ performAction (SetInput s) _ _ = void do ...@@ -70,7 +70,7 @@ performAction (SetInput s) _ _ = void do
performAction _ _ _ = void do performAction _ _ _ = void do
modifyState \(State state) -> State $ state modifyState \(State state) -> State $ state
tableSpec :: forall props .Spec State props Action -> Spec State props Action tableSpec :: Spec State {} Action -> Spec State {} Action
tableSpec = over _render \render dispatch p (State s) c -> tableSpec = over _render \render dispatch p (State s) c ->
[div [className "container-fluid"] [div [className "container-fluid"]
[ [
...@@ -147,7 +147,7 @@ tableSpec = over _render \render dispatch p (State s) c -> ...@@ -147,7 +147,7 @@ tableSpec = over _render \render dispatch p (State s) c ->
] ]
] ]
ngramsTableSpec :: forall props . Spec State props Action ngramsTableSpec :: Spec State {} Action
ngramsTableSpec = container $ fold ngramsTableSpec = container $ fold
[ tableSpec $ withState \st -> [ tableSpec $ withState \st ->
focus _itemsList _ItemAction $ focus _itemsList _ItemAction $
......
...@@ -11,13 +11,13 @@ initialState = "" ...@@ -11,13 +11,13 @@ initialState = ""
data Action = NoOp data Action = NoOp
performAction :: forall props. PerformAction State props Action performAction :: PerformAction State {} Action
performAction NoOp _ _ = void do performAction NoOp _ _ = void do
modifyState identity modifyState identity
brevetsSpec :: forall props. Spec State props Action brevetsSpec :: Spec State {} Action
brevetsSpec = simpleSpec performAction render brevetsSpec = simpleSpec performAction render
where where
render :: Render State props Action render :: Render State {} Action
render dispatch _ state _ = render dispatch _ state _ =
[] []
...@@ -17,7 +17,7 @@ getUser :: Int -> Aff (Either String User) ...@@ -17,7 +17,7 @@ getUser :: Int -> Aff (Either String User)
getUser id = get $ "http://localhost:8008/node/" <> show id getUser id = get $ "http://localhost:8008/node/" <> show id
performAction :: forall props. PerformAction State props Action performAction :: PerformAction State {} Action
performAction NoOp _ _ = void do performAction NoOp _ _ = void do
modifyState identity modifyState identity
performAction (FetchUser userId) _ _ = void do performAction (FetchUser userId) _ _ = void do
......
...@@ -9,5 +9,5 @@ import Thermite (Spec, simpleSpec) ...@@ -9,5 +9,5 @@ import Thermite (Spec, simpleSpec)
import Gargantext.Pages.Corpus.User.Users.Types (Action, State) import Gargantext.Pages.Corpus.User.Users.Types (Action, State)
import Gargantext.Pages.Corpus.User.Users.API (performAction) import Gargantext.Pages.Corpus.User.Users.API (performAction)
layoutUser :: forall props. Spec State props Action layoutUser :: Spec State {} Action
layoutUser = simpleSpec performAction render layoutUser = simpleSpec performAction render
...@@ -13,14 +13,14 @@ initialState = "" ...@@ -13,14 +13,14 @@ initialState = ""
data Action = NoOp data Action = NoOp
performAction :: forall props. PerformAction State props Action performAction :: PerformAction State {} Action
performAction NoOp _ _ = void do performAction NoOp _ _ = void do
modifyState identity modifyState identity
publicationSpec :: forall props. Spec State props Action publicationSpec :: Spec State {} Action
publicationSpec = simpleSpec performAction render publicationSpec = simpleSpec performAction render
where where
render :: Render State props Action render :: Render State {} Action
render dispatch _ state _ = render dispatch _ state _ =
[ table [ className "table"] [ table [ className "table"]
[ thead [ className "thead-dark"] [ thead [ className "thead-dark"]
......
...@@ -12,7 +12,7 @@ import React.DOM.Props (_id, className, src) ...@@ -12,7 +12,7 @@ import React.DOM.Props (_id, className, src)
import Thermite (Render) import Thermite (Render)
render :: forall props. Render State props Action render :: Render State {} Action
render dispatch _ state _ = render dispatch _ state _ =
[ [
div [className "col-md-12"] div [className "col-md-12"]
......
...@@ -20,16 +20,15 @@ import Gargantext.Pages.Folder as PS ...@@ -20,16 +20,15 @@ import Gargantext.Pages.Folder as PS
import Gargantext.Components.Tab (tabs) import Gargantext.Components.Tab (tabs)
import Thermite (Spec, focus) import Thermite (Spec, focus)
brevetSpec :: forall props. Spec State props Action brevetSpec :: Spec State {} Action
brevetSpec = focus _brevetslens _brevetsAction B.brevetsSpec brevetSpec = focus _brevetslens _brevetsAction B.brevetsSpec
projectSpec :: forall props. Spec State props Action projectSpec :: Spec State {} Action
projectSpec = focus _projectslens _projectsAction PS.projets projectSpec = focus _projectslens _projectsAction PS.projets
facets :: Spec State {} Action
facets :: forall props. Spec State props Action
facets = tabs _tablens _tabAction $ fromFoldable facets = tabs _tablens _tabAction $ fromFoldable
[ Tuple "Publications (12)" publicationSpec [ Tuple "Publications (12)" publicationSpec
, Tuple "Brevets (2)" brevetSpec , Tuple "Brevets (2)" brevetSpec
, Tuple "Projets IMT (5)" projectSpec , Tuple "Projets IMT (5)" projectSpec
] ]
...@@ -32,7 +32,7 @@ _pubAction = prism PublicationA \ action -> ...@@ -32,7 +32,7 @@ _pubAction = prism PublicationA \ action ->
PublicationA laction -> Right laction PublicationA laction -> Right laction
_-> Left action _-> Left action
publicationSpec :: forall props. Spec State props Action publicationSpec :: Spec State {} Action
publicationSpec = focus _publens _pubAction P.publicationSpec publicationSpec = focus _publens _pubAction P.publicationSpec
_brevetslens :: Lens' State B.State _brevetslens :: Lens' State B.State
......
...@@ -12,13 +12,13 @@ initialState = "" ...@@ -12,13 +12,13 @@ initialState = ""
data Action = NoOp data Action = NoOp
performAction :: forall props. PerformAction State props Action performAction :: PerformAction State {} Action
performAction NoOp _ _ = void do performAction NoOp _ _ = void do
modifyState identity modifyState identity
projets :: forall props. Spec State props Action projets :: Spec State {} Action
projets = simpleSpec performAction render projets = simpleSpec performAction render
where where
render :: Render State props Action render :: Render State {} Action
render dispatch _ state _ = render dispatch _ state _ =
[] []
...@@ -15,7 +15,7 @@ data Action ...@@ -15,7 +15,7 @@ data Action
| SignUp | SignUp
performAction :: forall props. PerformAction State props Action performAction :: PerformAction State {} Action
performAction NoOp _ _ = void do performAction NoOp _ _ = void do
modifyState \state -> state modifyState \state -> state
......
...@@ -17,16 +17,16 @@ import Thermite (Render, Spec, simpleSpec) ...@@ -17,16 +17,16 @@ import Thermite (Render, Spec, simpleSpec)
-- Layout | -- Layout |
layoutLanding :: forall props. Lang -> Spec State props Action layoutLanding :: Lang -> Spec State {} Action
layoutLanding FR = layoutLanding' Fr.landingData layoutLanding FR = layoutLanding' Fr.landingData
layoutLanding EN = layoutLanding' En.landingData layoutLanding EN = layoutLanding' En.landingData
------------------------------------------------------------------------ ------------------------------------------------------------------------
layoutLanding' :: forall props. LandingData -> Spec State props Action layoutLanding' :: LandingData -> Spec State {} Action
layoutLanding' hd = simpleSpec performAction render layoutLanding' hd = simpleSpec performAction render
where where
render :: Render State props Action render :: Render State {} Action
render dispatch _ state _ = render dispatch _ state _ =
[ div [ className "container1" ] [ jumboTitle hd false ] [ div [ className "container1" ] [ jumboTitle hd false ]
, div [ className "container1" ] [] -- put research here , div [ className "container1" ] [] -- put research here
......
...@@ -49,7 +49,7 @@ data Action ...@@ -49,7 +49,7 @@ data Action
| NgramsA NG.Action | NgramsA NG.Action
performAction :: forall props. PerformAction AppState props Action performAction :: PerformAction AppState {} Action
performAction (SetRoute route) _ _ = void do performAction (SetRoute route) _ _ = void do
modifyState $ _ {currentRoute = pure route} modifyState $ _ {currentRoute = pure route}
performAction (Search s) _ _ = void do performAction (Search s) _ _ = void do
......
...@@ -29,7 +29,7 @@ import React.DOM.Props (_data, _id, _type, aria, className, href, onChange, onCl ...@@ -29,7 +29,7 @@ import React.DOM.Props (_data, _id, _type, aria, className, href, onChange, onCl
import Thermite (Render, Spec, _render, defaultPerformAction, defaultRender, focus, simpleSpec, withState) import Thermite (Render, Spec, _render, defaultPerformAction, defaultRender, focus, simpleSpec, withState)
import Unsafe.Coerce (unsafeCoerce) import Unsafe.Coerce (unsafeCoerce)
layoutSpec :: forall props. Spec AppState props Action layoutSpec :: Spec AppState {} Action
layoutSpec = layoutSpec =
fold fold
[ routingSpec [ routingSpec
...@@ -40,18 +40,19 @@ layoutSpec = ...@@ -40,18 +40,19 @@ layoutSpec =
] ]
] ]
where where
container :: Spec AppState props Action -> Spec AppState props Action -- NP: what is it for ?
container :: Spec AppState {} Action -> Spec AppState {} Action
container = over _render \render d p s c -> container = over _render \render d p s c ->
(render d p s c) (render d p s c)
pagesComponent :: forall props. AppState -> Spec AppState props Action pagesComponent :: AppState -> Spec AppState {} Action
pagesComponent s = pagesComponent s =
case s.currentRoute of case s.currentRoute of
Just route -> selectSpec route Just route -> selectSpec route
Nothing -> selectSpec Home Nothing -> selectSpec Home
where where
selectSpec :: Routes -> Spec AppState props Action selectSpec :: Routes -> Spec AppState {} Action
selectSpec CorpusAnalysis = layout0 $ focus _corpusState _corpusAction CA.spec' selectSpec CorpusAnalysis = layout0 $ focus _corpusState _corpusAction CA.spec'
selectSpec Login = focus _loginState _loginAction LN.renderSpec selectSpec Login = focus _loginState _loginAction LN.renderSpec
selectSpec Home = layout0 $ focus _landingState _LandingA (L.layoutLanding EN) selectSpec Home = layout0 $ focus _landingState _LandingA (L.layoutLanding EN)
...@@ -68,11 +69,11 @@ pagesComponent s = ...@@ -68,11 +69,11 @@ pagesComponent s =
-- selectSpec _ = simpleSpec defaultPerformAction defaultRender -- selectSpec _ = simpleSpec defaultPerformAction defaultRender
routingSpec :: forall props. Spec AppState props Action routingSpec :: Spec AppState {} Action
routingSpec = simpleSpec performAction defaultRender routingSpec = simpleSpec performAction defaultRender
layout0 :: forall props. Spec AppState props Action layout0 :: Spec AppState {} Action
-> Spec AppState props Action -> Spec AppState {} Action
layout0 layout = layout0 layout =
fold fold
[ layoutSidebar divSearchBar [ layoutSidebar divSearchBar
...@@ -81,7 +82,7 @@ layout0 layout = ...@@ -81,7 +82,7 @@ layout0 layout =
] ]
where where
outerLayout1 = simpleSpec defaultPerformAction defaultRender outerLayout1 = simpleSpec defaultPerformAction defaultRender
outerLayout :: Spec AppState props Action outerLayout :: Spec AppState {} Action
outerLayout = outerLayout =
cont $ fold cont $ fold
[ withState \st -> [ withState \st ->
...@@ -97,8 +98,8 @@ layout0 layout = ...@@ -97,8 +98,8 @@ layout0 layout =
bs = innerLayout $ layout bs = innerLayout $ layout
innerLayout :: Spec AppState props Action innerLayout :: Spec AppState {} Action
-> Spec AppState props Action -> Spec AppState {} Action
innerLayout = over _render \render d p s c -> innerLayout = over _render \render d p s c ->
[ div [_id "page-wrapper"] [ div [_id "page-wrapper"]
[ [
...@@ -106,8 +107,8 @@ layout0 layout = ...@@ -106,8 +107,8 @@ layout0 layout =
] ]
] ]
layoutSidebar :: forall props. Spec AppState props Action layoutSidebar :: Spec AppState {} Action
-> Spec AppState props Action -> Spec AppState {} Action
layoutSidebar = over _render \render d p s c -> layoutSidebar = over _render \render d p s c ->
[ div [ _id "dafixedtop" [ div [ _id "dafixedtop"
, className "navbar navbar-inverse navbar-fixed-top" , className "navbar navbar-inverse navbar-fixed-top"
...@@ -241,10 +242,10 @@ liNav (LiNav { title : title' ...@@ -241,10 +242,10 @@ liNav (LiNav { title : title'
] ]
-- TODO put the search form in the center of the navBar -- TODO put the search form in the center of the navBar
divSearchBar :: forall props. Spec AppState props Action divSearchBar :: Spec AppState {} Action
divSearchBar = simpleSpec performAction render divSearchBar = simpleSpec performAction render
where where
render :: Render AppState props Action render :: Render AppState {} Action
render dispatch _ state _ = [div [ className "" ] [ searchbar']] render dispatch _ state _ = [div [ className "" ] [ searchbar']]
where where
searchbar' = ul [ className "nav navbar-nav col-md-6 col-md-offset-3" searchbar' = ul [ className "nav navbar-nav col-md-6 col-md-offset-3"
...@@ -262,7 +263,7 @@ divSearchBar = simpleSpec performAction render ...@@ -262,7 +263,7 @@ divSearchBar = simpleSpec performAction render
] ]
] ]
--divDropdownRight :: Render AppState props Action --divDropdownRight :: Render AppState {} Action
divDropdownRight :: (Action -> Effect Unit) -> ReactElement divDropdownRight :: (Action -> Effect Unit) -> ReactElement
divDropdownRight d = divDropdownRight d =
ul [className "nav navbar-nav pull-right"] ul [className "nav navbar-nav pull-right"]
...@@ -285,10 +286,10 @@ divDropdownRight d = ...@@ -285,10 +286,10 @@ divDropdownRight d =
] ]
] ]
layoutFooter :: forall props. Spec AppState props Action layoutFooter :: Spec AppState {} Action
layoutFooter = simpleSpec performAction render layoutFooter = simpleSpec performAction render
where where
render :: Render AppState props Action render :: Render AppState {} Action
render dispatch _ state _ = [div [ className "container1" ] [ hr', footerLegalInfo']] render dispatch _ state _ = [div [ className "container1" ] [ hr', footerLegalInfo']]
where where
footerLegalInfo' = footer [] [ p [] [ text "Gargantext " footerLegalInfo' = footer [] [ p [] [ text "Gargantext "
......
...@@ -27,7 +27,7 @@ data Action ...@@ -27,7 +27,7 @@ data Action
| LoadDatabaseDetails | LoadDatabaseDetails
| GO | GO
performAction :: forall props. PerformAction State props Action performAction :: PerformAction State {} Action
performAction NoOp _ _ = void do performAction NoOp _ _ = void do
modifyState identity modifyState identity
......
...@@ -21,7 +21,7 @@ import React.DOM.Props (_data, _id, _type, aria, className, onClick, role) ...@@ -21,7 +21,7 @@ import React.DOM.Props (_data, _id, _type, aria, className, onClick, role)
import Thermite (PerformAction, Render, Spec, _render, cotransform, modifyState, simpleSpec) import Thermite (PerformAction, Render, Spec, _render, cotransform, modifyState, simpleSpec)
modalSpec :: forall props. Boolean -> String -> Spec State props Action -> Spec State props Action modalSpec :: Boolean -> String -> Spec State {} Action -> Spec State {} Action
modalSpec sm t = over _render \render d p s c -> modalSpec sm t = over _render \render d p s c ->
[ div [ _id "addCorpus", className $ "modal myModal" <> if sm then "" else " fade" [ div [ _id "addCorpus", className $ "modal myModal" <> if sm then "" else " fade"
, role "dialog" , role "dialog"
...@@ -43,7 +43,7 @@ modalSpec sm t = over _render \render d p s c -> ...@@ -43,7 +43,7 @@ modalSpec sm t = over _render \render d p s c ->
] ]
spec' :: forall props. Spec State props Action spec' :: Spec State {} Action
spec' = modalSpec true "Search Results" layoutAddcorpus spec' = modalSpec true "Search Results" layoutAddcorpus
...@@ -93,10 +93,10 @@ layoutModal state = ...@@ -93,10 +93,10 @@ layoutModal state =
] ]
layoutAddcorpus :: forall props. Spec State props Action layoutAddcorpus :: Spec State {} Action
layoutAddcorpus = simpleSpec performAction render layoutAddcorpus = simpleSpec performAction render
where where
render :: Render State props Action render :: Render State {} Action
render dispatch _ state _ = render dispatch _ state _ =
[ div [className "container1"] [] [ div [className "container1"] []
, div [className "container1"] , div [className "container1"]
......
...@@ -28,7 +28,7 @@ data Action ...@@ -28,7 +28,7 @@ data Action
| SetQuery String | SetQuery String
performAction :: forall props. PerformAction State props Action performAction :: PerformAction State {} Action
performAction NoOp _ _ = void do performAction NoOp _ _ = void do
modifyState identity modifyState identity
...@@ -45,10 +45,10 @@ performAction GO _ _ = void do ...@@ -45,10 +45,10 @@ performAction GO _ _ = void do
unsafeEventValue :: forall event. event -> String unsafeEventValue :: forall event. event -> String
unsafeEventValue e = (unsafeCoerce e).target.value unsafeEventValue e = (unsafeCoerce e).target.value
searchSpec :: forall props. Spec State props Action searchSpec :: Spec State {} Action
searchSpec = simpleSpec performAction render searchSpec = simpleSpec performAction render
where where
render :: Render State props Action render :: Render State {} Action
render dispatch _ state _ = render dispatch _ state _ =
[ div [className "container1"] [] [ div [className "container1"] []
, div [className "container1"] , div [className "container1"]
......
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