diff --git a/src/Gargantext/Config.purs b/src/Gargantext/Config.purs index ab57a5bbb30827f343afd14dcb0b002dd939dfc5..ba30578d9727586f764e0f157b1ca98707aac327 100644 --- a/src/Gargantext/Config.purs +++ b/src/Gargantext/Config.purs @@ -111,7 +111,6 @@ data NodeType = NodeUser | Folder | Graph | Individu - | Project | Tree | Error data End = Back | Front @@ -132,7 +131,6 @@ urlConfig Document = show Document urlConfig Folder = show Folder urlConfig Graph = show Graph urlConfig Individu = show Individu -urlConfig Project = show Project urlConfig Tree = show Tree urlConfig Error = show Error ------------------------------------------------------------ @@ -145,7 +143,6 @@ instance showNodeType :: Show NodeType where show Folder = "folder" show Graph = "graph" show Individu = "individu" - show Project = "project" show Tree = "tree" show Error = "ErrorNodeType" @@ -157,11 +154,10 @@ readNodeType "NodeCorpus" = Corpus readNodeType "Annuaire" = Annuaire readNodeType "Dashboard" = Dashboard readNodeType "Document" = Document -readNodeType "Folder" = Folder readNodeType "Graph" = Graph readNodeType "Individu" = Individu -readNodeType "Project" = Project readNodeType "Tree" = Tree +readNodeType "Folder" = Folder readNodeType _ = Error ------------------------------------------------------------ instance ordNodeType :: Ord NodeType where diff --git a/src/Gargantext/Folder.purs b/src/Gargantext/Folder.purs new file mode 100644 index 0000000000000000000000000000000000000000..3288da3f4f1afff5e3b4cd7c883309a58989a4c6 --- /dev/null +++ b/src/Gargantext/Folder.purs @@ -0,0 +1,12 @@ +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 + diff --git a/src/Gargantext/Pages/Corpus/Annuaire.purs b/src/Gargantext/Pages/Corpus/Annuaire.purs new file mode 100644 index 0000000000000000000000000000000000000000..215c7f6b23c18f385eb6d36b6d8159cd842a3cb2 --- /dev/null +++ b/src/Gargantext/Pages/Corpus/Annuaire.purs @@ -0,0 +1,13 @@ +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 + diff --git a/src/Gargantext/Pages/Corpus/User/Users/Types.purs b/src/Gargantext/Pages/Corpus/User/Users/Types.purs index 2d3fbd26520972f06c49ce265800b8388ebfd04f..08b8977132a0905cfc65dfc29ed5170ecdb564d7 100644 --- a/src/Gargantext/Pages/Corpus/User/Users/Types.purs +++ b/src/Gargantext/Pages/Corpus/User/Users/Types.purs @@ -8,7 +8,7 @@ module Gargantext.Pages.Corpus.User.Users.Types ) where -import Prelude (($)) +import Prelude import Gargantext.Pages.Corpus.User.Users.Types.Lens import Gargantext.Pages.Corpus.User.Users.Types.Types @@ -16,15 +16,21 @@ import Gargantext.Pages.Corpus.User.Users.Types.States import Gargantext.Pages.Corpus.User.Brevets as B import Data.List (fromFoldable) import Data.Tuple (Tuple(..)) -import Gargantext.Pages.Folder as PS import Gargantext.Components.Tab (tabs) -import Thermite (Spec, focus, noState) +import Thermite (Render, Spec, focus, noState, defaultPerformAction, simpleSpec) brevetSpec :: Spec State {} Action brevetSpec = noState B.brevetsSpec +projets :: Spec {} {} Void +projets = simpleSpec defaultPerformAction render + where + render :: Render {} {} Void + render dispatch _ state _ = + [] + projectSpec :: Spec State {} Action -projectSpec = noState PS.projets +projectSpec = noState projets facets :: Spec State {} Action facets = tabs _tablens _tabAction $ fromFoldable diff --git a/src/Gargantext/Pages/Folder.purs b/src/Gargantext/Pages/Folder.purs deleted file mode 100644 index f52e917aef1980225eddc939d0c2ca8367c3f274..0000000000000000000000000000000000000000 --- a/src/Gargantext/Pages/Folder.purs +++ /dev/null @@ -1,13 +0,0 @@ -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 _ = - [] diff --git a/src/Gargantext/Pages/Layout.purs b/src/Gargantext/Pages/Layout.purs index fa601be6255e014e66b2047f7f23b56df56fc5e3..d4aa39a5c0e2842e36c0d766680490f98e81e89e 100644 --- a/src/Gargantext/Pages/Layout.purs +++ b/src/Gargantext/Pages/Layout.purs @@ -47,6 +47,12 @@ dispatchAction dispatcher _ (UserPage id) = do -- dispatcher $ UserPageA TODO 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 dispatcher $ SetRoute $ DocAnnotation i -- dispatcher $ DocAnnotationViewA TODO diff --git a/src/Gargantext/Pages/Layout/Specs.purs b/src/Gargantext/Pages/Layout/Specs.purs index 0c0911076a52f94b6fced1584711475962ca0fad..01911c743f50146361e725e6d0d9a7c6e41af9e4 100644 --- a/src/Gargantext/Pages/Layout/Specs.purs +++ b/src/Gargantext/Pages/Layout/Specs.purs @@ -8,8 +8,10 @@ import Data.Maybe (Maybe(Nothing, Just)) import Effect (Effect) import Gargantext.Components.Data.Lang (Lang(..)) import Gargantext.Components.Login as LN -import Gargantext.Components.Tree as Tree -import Gargantext.Pages.Corpus as CA +import Gargantext.Components.Tree as Tree +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.Facets as TV import Gargantext.Pages.Corpus.Doc.Facets.Dashboard as Dsh @@ -65,6 +67,8 @@ pagesComponent s = selectSpec NGramsTable = layout0 $ noState NG.ngramsTableSpec selectSpec PGraphExplorer = focus _graphExplorerState _graphExplorerAction GE.specOld selectSpec Dashboard = layout0 $ noState Dsh.layoutDashboard + selectSpec (Annuaire i) = layout0 $ noState A.layoutAnnuaire + selectSpec (Folder i) = layout0 $ noState F.layoutFolder -- selectSpec _ = simpleSpec defaultPerformAction defaultRender diff --git a/src/Gargantext/Router.purs b/src/Gargantext/Router.purs index 3670b221322642434461e3c29f74dbe03a580309..749fab3e75f01619394989ce09bf469571f019de 100644 --- a/src/Gargantext/Router.purs +++ b/src/Gargantext/Router.purs @@ -26,6 +26,8 @@ data Routes | PGraphExplorer | NGramsTable | Dashboard + | Annuaire Int + | Folder Int instance showRoutes :: Show Routes where @@ -40,6 +42,8 @@ instance showRoutes :: Show Routes where show PGraphExplorer = "graphExplorer" show NGramsTable = "NGramsTable" show Dashboard = "Dashboard" + show (Annuaire i) = "Annuaire" + show (Folder i) = "Folder" show Home = "Home" int :: Match Int @@ -58,6 +62,8 @@ routing = <|> PGraphExplorer <$ route "graph" <|> NGramsTable <$ route "ngrams" <|> Dashboard <$ route "dashboard" + <|> Annuaire <$> (route "annuaire" *> int) + <|> Folder <$> (route "folder" *> int) <|> Home <$ lit "" where route str = lit "" *> lit str