Commit 0038b247 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[FEAT] Adding Annuaire and Folder components.

parent 5dbdd5f1
...@@ -111,7 +111,6 @@ data NodeType = NodeUser ...@@ -111,7 +111,6 @@ data NodeType = NodeUser
| Folder | Folder
| Graph | Graph
| Individu | Individu
| Project
| Tree | Tree
| Error | Error
data End = Back | Front data End = Back | Front
...@@ -132,7 +131,6 @@ urlConfig Document = show Document ...@@ -132,7 +131,6 @@ urlConfig Document = show Document
urlConfig Folder = show Folder urlConfig Folder = show Folder
urlConfig Graph = show Graph urlConfig Graph = show Graph
urlConfig Individu = show Individu urlConfig Individu = show Individu
urlConfig Project = show Project
urlConfig Tree = show Tree urlConfig Tree = show Tree
urlConfig Error = show Error urlConfig Error = show Error
------------------------------------------------------------ ------------------------------------------------------------
...@@ -145,7 +143,6 @@ instance showNodeType :: Show NodeType where ...@@ -145,7 +143,6 @@ instance showNodeType :: Show NodeType where
show Folder = "folder" show Folder = "folder"
show Graph = "graph" show Graph = "graph"
show Individu = "individu" show Individu = "individu"
show Project = "project"
show Tree = "tree" show Tree = "tree"
show Error = "ErrorNodeType" show Error = "ErrorNodeType"
...@@ -157,11 +154,10 @@ readNodeType "NodeCorpus" = Corpus ...@@ -157,11 +154,10 @@ readNodeType "NodeCorpus" = Corpus
readNodeType "Annuaire" = Annuaire readNodeType "Annuaire" = Annuaire
readNodeType "Dashboard" = Dashboard readNodeType "Dashboard" = Dashboard
readNodeType "Document" = Document readNodeType "Document" = Document
readNodeType "Folder" = Folder
readNodeType "Graph" = Graph readNodeType "Graph" = Graph
readNodeType "Individu" = Individu readNodeType "Individu" = Individu
readNodeType "Project" = Project
readNodeType "Tree" = Tree readNodeType "Tree" = Tree
readNodeType "Folder" = Folder
readNodeType _ = Error readNodeType _ = Error
------------------------------------------------------------ ------------------------------------------------------------
instance ordNodeType :: Ord NodeType where instance ordNodeType :: Ord NodeType where
......
module Gargantext.Folder where
import Prelude
import React.DOM (div, h1, text)
import Thermite (Render, Spec, simpleSpec, defaultPerformAction)
render :: Render {} {} Void
render dispatch _ state _ = [h1 [] [text "Folder"]]
layoutFolder :: Spec {} {} Void
layoutFolder = simpleSpec defaultPerformAction render
module Gargantext.Pages.Corpus.Annuaire where
import Prelude
import React.DOM (div, h1, text)
import Thermite (Render, Spec, simpleSpec, defaultPerformAction)
render :: Render {} {} Void
render dispatch _ state _ = [h1 [] [text "Annuaire"]]
layoutAnnuaire :: Spec {} {} Void
layoutAnnuaire = simpleSpec defaultPerformAction render
...@@ -8,7 +8,7 @@ module Gargantext.Pages.Corpus.User.Users.Types ...@@ -8,7 +8,7 @@ module Gargantext.Pages.Corpus.User.Users.Types
) )
where where
import Prelude (($)) import Prelude
import Gargantext.Pages.Corpus.User.Users.Types.Lens import Gargantext.Pages.Corpus.User.Users.Types.Lens
import Gargantext.Pages.Corpus.User.Users.Types.Types import Gargantext.Pages.Corpus.User.Users.Types.Types
...@@ -16,15 +16,21 @@ import Gargantext.Pages.Corpus.User.Users.Types.States ...@@ -16,15 +16,21 @@ import Gargantext.Pages.Corpus.User.Users.Types.States
import Gargantext.Pages.Corpus.User.Brevets as B import Gargantext.Pages.Corpus.User.Brevets as B
import Data.List (fromFoldable) import Data.List (fromFoldable)
import Data.Tuple (Tuple(..)) import Data.Tuple (Tuple(..))
import Gargantext.Pages.Folder as PS
import Gargantext.Components.Tab (tabs) import Gargantext.Components.Tab (tabs)
import Thermite (Spec, focus, noState) import Thermite (Render, Spec, focus, noState, defaultPerformAction, simpleSpec)
brevetSpec :: Spec State {} Action brevetSpec :: Spec State {} Action
brevetSpec = noState B.brevetsSpec brevetSpec = noState B.brevetsSpec
projets :: Spec {} {} Void
projets = simpleSpec defaultPerformAction render
where
render :: Render {} {} Void
render dispatch _ state _ =
[]
projectSpec :: Spec State {} Action projectSpec :: Spec State {} Action
projectSpec = noState PS.projets projectSpec = noState projets
facets :: Spec State {} Action facets :: Spec State {} Action
facets = tabs _tablens _tabAction $ fromFoldable facets = tabs _tablens _tabAction $ fromFoldable
......
module Gargantext.Pages.Folder where
import Prelude
import Thermite (Render, Spec, defaultPerformAction, simpleSpec)
projets :: Spec {} {} Void
projets = simpleSpec defaultPerformAction render
where
render :: Render {} {} Void
render dispatch _ state _ =
[]
...@@ -47,6 +47,12 @@ dispatchAction dispatcher _ (UserPage id) = do ...@@ -47,6 +47,12 @@ dispatchAction dispatcher _ (UserPage id) = do
-- dispatcher $ UserPageA TODO -- dispatcher $ UserPageA TODO
dispatcher $ UserPageA $ U.FetchUser id dispatcher $ UserPageA $ U.FetchUser id
dispatchAction dispatcher _ (Annuaire id) = do
dispatcher $ SetRoute $ Annuaire id
dispatchAction dispatcher _ (Folder id) = do
dispatcher $ SetRoute $ Folder id
dispatchAction dispatcher _ (DocAnnotation i) = do dispatchAction dispatcher _ (DocAnnotation i) = do
dispatcher $ SetRoute $ DocAnnotation i dispatcher $ SetRoute $ DocAnnotation i
-- dispatcher $ DocAnnotationViewA TODO -- dispatcher $ DocAnnotationViewA TODO
......
...@@ -8,8 +8,10 @@ import Data.Maybe (Maybe(Nothing, Just)) ...@@ -8,8 +8,10 @@ import Data.Maybe (Maybe(Nothing, Just))
import Effect (Effect) import Effect (Effect)
import Gargantext.Components.Data.Lang (Lang(..)) import Gargantext.Components.Data.Lang (Lang(..))
import Gargantext.Components.Login as LN import Gargantext.Components.Login as LN
import Gargantext.Components.Tree as Tree import Gargantext.Components.Tree as Tree
import Gargantext.Pages.Corpus as CA import Gargantext.Pages.Corpus.Annuaire as A
import Gargantext.Folder as F
import Gargantext.Pages.Corpus as CA
import Gargantext.Pages.Corpus.Doc.Annotation as D import Gargantext.Pages.Corpus.Doc.Annotation as D
import Gargantext.Pages.Corpus.Doc.Facets as TV import Gargantext.Pages.Corpus.Doc.Facets as TV
import Gargantext.Pages.Corpus.Doc.Facets.Dashboard as Dsh import Gargantext.Pages.Corpus.Doc.Facets.Dashboard as Dsh
...@@ -65,6 +67,8 @@ pagesComponent s = ...@@ -65,6 +67,8 @@ pagesComponent s =
selectSpec NGramsTable = layout0 $ noState NG.ngramsTableSpec selectSpec NGramsTable = layout0 $ noState NG.ngramsTableSpec
selectSpec PGraphExplorer = focus _graphExplorerState _graphExplorerAction GE.specOld selectSpec PGraphExplorer = focus _graphExplorerState _graphExplorerAction GE.specOld
selectSpec Dashboard = layout0 $ noState Dsh.layoutDashboard selectSpec Dashboard = layout0 $ noState Dsh.layoutDashboard
selectSpec (Annuaire i) = layout0 $ noState A.layoutAnnuaire
selectSpec (Folder i) = layout0 $ noState F.layoutFolder
-- selectSpec _ = simpleSpec defaultPerformAction defaultRender -- selectSpec _ = simpleSpec defaultPerformAction defaultRender
......
...@@ -26,6 +26,8 @@ data Routes ...@@ -26,6 +26,8 @@ data Routes
| PGraphExplorer | PGraphExplorer
| NGramsTable | NGramsTable
| Dashboard | Dashboard
| Annuaire Int
| Folder Int
instance showRoutes :: Show Routes where instance showRoutes :: Show Routes where
...@@ -40,6 +42,8 @@ instance showRoutes :: Show Routes where ...@@ -40,6 +42,8 @@ instance showRoutes :: Show Routes where
show PGraphExplorer = "graphExplorer" show PGraphExplorer = "graphExplorer"
show NGramsTable = "NGramsTable" show NGramsTable = "NGramsTable"
show Dashboard = "Dashboard" show Dashboard = "Dashboard"
show (Annuaire i) = "Annuaire"
show (Folder i) = "Folder"
show Home = "Home" show Home = "Home"
int :: Match Int int :: Match Int
...@@ -58,6 +62,8 @@ routing = ...@@ -58,6 +62,8 @@ routing =
<|> PGraphExplorer <$ route "graph" <|> PGraphExplorer <$ route "graph"
<|> NGramsTable <$ route "ngrams" <|> NGramsTable <$ route "ngrams"
<|> Dashboard <$ route "dashboard" <|> Dashboard <$ route "dashboard"
<|> Annuaire <$> (route "annuaire" *> int)
<|> Folder <$> (route "folder" *> int)
<|> Home <$ lit "" <|> Home <$ lit ""
where where
route str = lit "" *> lit str route str = lit "" *> lit str
......
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