Commit 2e3c113c authored by Mael NICOLAS's avatar Mael NICOLAS

keep refactoring, put files in folders and things

parent b53c931d
......@@ -33,7 +33,7 @@ import SearchForm as S
import Tabview as TV
import Thermite (PerformAction, Render, Spec, _render, cotransform, defaultPerformAction, defaultRender, focus, modifyState, simpleSpec, withState)
import Unsafe.Coerce (unsafeCoerce)
import Users.Info as UI
import Users as U
import GraphExplorer as GE
type E e = (dom :: DOM, ajax :: AJAX, console :: CONSOLE | e)
......@@ -45,7 +45,7 @@ type AppState =
, addCorpusState :: AC.State
, docViewState :: DV.State
, searchState :: S.State
, userPage :: UI.State
, userPage :: U.State
, annotationdocumentView :: D.State
, ntreeView :: NT.State
, tabview :: TV.State
......@@ -64,7 +64,7 @@ initAppState =
, addCorpusState : AC.initialState
, docViewState : DV.tdata
, searchState : S.initialState
, userPage : UI.initialState
, userPage : U.initialState
, annotationdocumentView : D.initialState
, ntreeView : NT.exampleTree
, tabview : TV.initialState
......@@ -83,7 +83,7 @@ data Action
| AddCorpusA AC.Action
| DocViewA DV.Action
| SearchA S.Action
| UserPageA UI.Action
| UserPageA U.Action
| AnnotationDocumentViewA D.Action
| TreeViewA NT.Action
| TabViewA TV.Action
......@@ -180,11 +180,11 @@ _searchAction = prism SearchA \action ->
_-> Left action
_userPageState :: Lens' AppState UI.State
_userPageState :: Lens' AppState U.State
_userPageState = lens (\s -> s.userPage) (\s ss -> s{userPage = ss})
_userPageAction :: Prism' Action UI.Action
_userPageAction :: Prism' Action U.Action
_userPageAction = prism UserPageA \action ->
case action of
UserPageA caction -> Right caction
......@@ -264,7 +264,7 @@ pagesComponent s =
selectSpec Home = layout0 $ focus _landingState _landingAction (L.layoutLanding EN)
-- selectSpec AddCorpus = layout0 $ focus _addCorpusState _addCorpusAction AC.layoutAddcorpus
selectSpec DocView = layout0 $ focus _docViewState _docViewAction DV.layoutDocview
selectSpec UserPage = layout0 $ focus _userPageState _userPageAction UI.layoutUser
selectSpec UserPage = layout0 $ focus _userPageState _userPageAction U.layoutUser
selectSpec (AnnotationDocumentView i) = layout0 $ focus _annotationdocumentviewState _annotationdocumentviewAction D.docview
selectSpec Tabview = layout0 $ focus _tabviewState _tabviewAction TV.tab1
-- To be removed
......@@ -574,7 +574,7 @@ dispatchAction dispatcher _ SearchView = do
dispatchAction dispatcher _ UserPage = do
_ <- dispatcher $ SetRoute $ UserPage
_ <- dispatcher $ UserPageA $ UI.NoOp
_ <- dispatcher $ UserPageA $ U.NoOp
pure unit
dispatchAction dispatcher _ (AnnotationDocumentView i) = do
......
module UserPage where
module Users
(module Users.Types,
module Users.Info)
where
import Users.Types
import Users.Info
module Users.Info
(layoutUser,
brevetSpec,
projectSpec,
facets,
module Users.Types.Types,
module Users.Types.Lens
(layoutUser
)
where
......@@ -27,6 +22,7 @@ import React.DOM.Props (_data, _id, aria, className, href, role, scope, src)
import Tab (tabs)
import Thermite (PerformAction, Render, Spec, focus, modifyState, simpleSpec)
layoutUser :: forall props eff . Spec ( console :: CONSOLE
, ajax :: AJAX
, dom :: DOM
......@@ -101,18 +97,3 @@ layoutUser = simpleSpec performAction render
]
]
]
brevetSpec :: forall eff props. Spec (dom :: DOM, console::CONSOLE, ajax :: AJAX | eff) State props Action
brevetSpec = focus _brevetslens _brevetsAction B.brevetsSpec
projectSpec :: forall eff props. Spec (dom :: DOM, console :: CONSOLE, ajax :: AJAX | eff) State props Action
projectSpec = focus _projectslens _projectsAction PS.projets
facets :: forall eff props. Spec ( dom :: DOM, console :: CONSOLE, ajax :: AJAX| eff) State props Action
facets = tabs _tablens _tabAction $ fromFoldable
[ Tuple "Publications(12)" publicationSpec
, Tuple "Brevets (2)" brevetSpec
, Tuple "Projets IMT (5)" projectSpec
]
module Users.Types
(module Users.Types.Types,
module Users.Types.Lens,
brevetSpec,
projectSpec,
facets
)
where
import Users.Types.Lens
import Users.Types.Types
import Brevets as B
import Control.Monad.Aff.Console (CONSOLE)
import DOM (DOM)
import Data.List (fromFoldable)
import Data.Tuple (Tuple(..))
import Network.HTTP.Affjax (AJAX)
import Prelude (($))
import Projects as PS
import Tab (tabs)
import Thermite (Spec, focus)
brevetSpec :: forall eff props. Spec (dom :: DOM, console::CONSOLE, ajax :: AJAX | eff) State props Action
brevetSpec = focus _brevetslens _brevetsAction B.brevetsSpec
projectSpec :: forall eff props. Spec (dom :: DOM, console :: CONSOLE, ajax :: AJAX | eff) State props Action
projectSpec = focus _projectslens _projectsAction PS.projets
facets :: forall eff props. Spec ( dom :: DOM, console :: CONSOLE, ajax :: AJAX| eff) State props Action
facets = tabs _tablens _tabAction $ fromFoldable
[ Tuple "Publications(12)" publicationSpec
, Tuple "Brevets (2)" brevetSpec
, Tuple "Projets IMT (5)" projectSpec
]
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