Commit 2d9afdf7 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[Corpus] Adding V3 Corpus type and some fixes (cosmetics).

parent 72c016a0
...@@ -35,7 +35,7 @@ data Action = ShowPopOver ...@@ -35,7 +35,7 @@ data Action = ShowPopOver
| ToggleFolder ID | ToggleFolder ID
| RenameNode String | RenameNode String
| Submit | Submit
--| Initialize -- | Initialize
type State = FTree type State = FTree
......
...@@ -112,6 +112,7 @@ data NodeType = NodeUser ...@@ -112,6 +112,7 @@ data NodeType = NodeUser
| Annuaire | Annuaire
| Children | Children
| Corpus | Corpus
| CorpusV3
| Dashboard | Dashboard
| Document | Document
| Error | Error
...@@ -133,6 +134,7 @@ urlConfig :: NodeType -> Url ...@@ -133,6 +134,7 @@ urlConfig :: NodeType -> Url
urlConfig Annuaire = show Annuaire urlConfig Annuaire = show Annuaire
urlConfig Children = show Children urlConfig Children = show Children
urlConfig Corpus = show Corpus urlConfig Corpus = show Corpus
urlConfig CorpusV3 = show CorpusV3
urlConfig Dashboard = show Dashboard urlConfig Dashboard = show Dashboard
urlConfig Document = show Document urlConfig Document = show Document
urlConfig Error = show Error urlConfig Error = show Error
...@@ -147,6 +149,7 @@ instance showNodeType :: Show NodeType where ...@@ -147,6 +149,7 @@ instance showNodeType :: Show NodeType where
show Annuaire = "annuaire" show Annuaire = "annuaire"
show Children = "children" show Children = "children"
show Corpus = "corpus" show Corpus = "corpus"
show CorpusV3 = "corpus"
show Dashboard = "dashboard" show Dashboard = "dashboard"
show Document = "document" show Document = "document"
show Error = "ErrorNodeType" show Error = "ErrorNodeType"
...@@ -169,6 +172,7 @@ readNodeType "Graph" = Graph ...@@ -169,6 +172,7 @@ readNodeType "Graph" = Graph
readNodeType "Individu" = Individu readNodeType "Individu" = Individu
readNodeType "Node" = Node readNodeType "Node" = Node
readNodeType "NodeCorpus" = Corpus readNodeType "NodeCorpus" = Corpus
readNodeType "NodeCorpusV3" = CorpusV3
readNodeType "NodeUser" = NodeUser readNodeType "NodeUser" = NodeUser
readNodeType "Tree" = Tree readNodeType "Tree" = Tree
readNodeType _ = Error readNodeType _ = Error
......
...@@ -65,10 +65,6 @@ dispatchAction dispatcher _ (DocAnnotation i) = do ...@@ -65,10 +65,6 @@ dispatchAction dispatcher _ (DocAnnotation i) = do
dispatcher $ SetRoute $ DocAnnotation i dispatcher $ SetRoute $ DocAnnotation i
-- dispatcher $ DocAnnotationViewA TODO -- dispatcher $ DocAnnotationViewA TODO
dispatchAction dispatcher _ Tabview = do
dispatcher $ SetRoute Tabview
-- dispatcher $ TabViewA TODO
dispatchAction dispatcher _ PGraphExplorer = do dispatchAction dispatcher _ PGraphExplorer = do
dispatcher $ SetRoute PGraphExplorer dispatcher $ SetRoute PGraphExplorer
dispatcher $ GraphExplorerA $ GE.LoadGraph "imtNew.json" dispatcher $ GraphExplorerA $ GE.LoadGraph "imtNew.json"
......
module Gargantext.Pages.Layout.Specs where module Gargantext.Pages.Layout.Specs where
import Prelude hiding (div)
import Data.Foldable (fold, intercalate) import Data.Foldable (fold, intercalate)
import Data.Lens (over) import Data.Lens (over)
import Data.Maybe (Maybe(Nothing, Just)) import Data.Maybe (Maybe(Nothing, Just))
import Effect (Effect) import Effect (Effect)
import React (ReactElement)
import React.DOM (a, button, div, footer, hr', img, input, li, p, span, text, ul)
import React.DOM.Props (_data, _id, _type, aria, className, href, onChange, onClick, placeholder, role, src, style, tabIndex, target, title)
import Thermite (Render, Spec, _render, defaultPerformAction, defaultRender, focus, simpleSpec, withState, noState)
import Unsafe.Coerce (unsafeCoerce)
import Gargantext.Prelude
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.Annuaire as A
import Gargantext.Folder as F import Gargantext.Folder as F
import Gargantext.Pages.Annuaire as A
import Gargantext.Pages.Annuaire.User.Users as U
import Gargantext.Pages.Corpus as Corpus import Gargantext.Pages.Corpus as Corpus
import Gargantext.Pages.Corpus.Doc.Annotation as Annotation import Gargantext.Pages.Corpus.Doc.Annotation as Annotation
import Gargantext.Pages.Corpus.Doc.Facets as TV import Gargantext.Pages.Corpus.Doc.Facets as TV
...@@ -18,18 +24,12 @@ import Gargantext.Pages.Corpus.Doc.Facets.Dashboard as Dsh ...@@ -18,18 +24,12 @@ import Gargantext.Pages.Corpus.Doc.Facets.Dashboard as Dsh
import Gargantext.Pages.Corpus.Doc.Facets.Documents as DV import Gargantext.Pages.Corpus.Doc.Facets.Documents as DV
import Gargantext.Pages.Corpus.Doc.Facets.Graph as GE import Gargantext.Pages.Corpus.Doc.Facets.Graph as GE
import Gargantext.Pages.Corpus.Doc.Facets.Terms.NgramsTable as NG import Gargantext.Pages.Corpus.Doc.Facets.Terms.NgramsTable as NG
import Gargantext.Pages.Annuaire.User.Users as U
import Gargantext.Pages.Home as L import Gargantext.Pages.Home as L
import Gargantext.Pages.Layout.Actions (Action(..), _corpusAction, _addCorpusAction, _docAnnotationViewAction, _docViewAction, _graphExplorerAction, _loginAction, _searchAction, _treeAction, _userPageAction, performAction, _annuaireAction) import Gargantext.Pages.Layout.Actions (Action(..), _corpusAction, _addCorpusAction, _docAnnotationViewAction, _docViewAction, _graphExplorerAction, _loginAction, _searchAction, _treeAction, _userPageAction, performAction, _annuaireAction)
import Gargantext.Pages.Layout.Specs.AddCorpus as AC import Gargantext.Pages.Layout.Specs.AddCorpus as AC
import Gargantext.Pages.Layout.Specs.Search as S import Gargantext.Pages.Layout.Specs.Search as S
import Gargantext.Pages.Layout.States (AppState, _corpusState, _addCorpusState, _docAnnotationViewState, _docViewState, _graphExplorerState, _loginState, _searchState, _treeState, _userPageState, _annuaireState) import Gargantext.Pages.Layout.States (AppState, _corpusState, _addCorpusState, _docAnnotationViewState, _docViewState, _graphExplorerState, _loginState, _searchState, _treeState, _userPageState, _annuaireState)
import Gargantext.Router (Routes(..)) import Gargantext.Router (Routes(..))
import React (ReactElement)
import React.DOM (a, button, div, footer, hr', img, input, li, p, span, text, ul)
import React.DOM.Props (_data, _id, _type, aria, className, href, onChange, onClick, placeholder, role, src, style, tabIndex, target, title)
import Thermite (Render, Spec, _render, defaultPerformAction, defaultRender, focus, simpleSpec, withState, noState)
import Unsafe.Coerce (unsafeCoerce)
layoutSpec :: Spec AppState {} Action layoutSpec :: Spec AppState {} Action
layoutSpec = layoutSpec =
...@@ -63,7 +63,6 @@ pagesComponent s = ...@@ -63,7 +63,6 @@ pagesComponent s =
selectSpec (DocAnnotation i) = layout0 $ focus _docAnnotationViewState selectSpec (DocAnnotation i) = layout0 $ focus _docAnnotationViewState
_docAnnotationViewAction Annotation.docview _docAnnotationViewAction Annotation.docview
-- To be removed -- To be removed
selectSpec Tabview = layout0 $ noState TV.pureTab1
selectSpec SearchView = layout0 $ focus _searchState _searchAction S.searchSpec selectSpec SearchView = layout0 $ focus _searchState _searchAction S.searchSpec
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
......
...@@ -19,7 +19,6 @@ data Routes ...@@ -19,7 +19,6 @@ data Routes
| Folder Int | Folder Int
| Corpus Int | Corpus Int
| AddCorpus | AddCorpus
| Tabview
| DocView Int | DocView Int
| DocAnnotation Int | DocAnnotation Int
| PGraphExplorer | PGraphExplorer
...@@ -35,9 +34,8 @@ routing = ...@@ -35,9 +34,8 @@ routing =
<|> AddCorpus <$ route "addCorpus" <|> AddCorpus <$ route "addCorpus"
<|> Folder <$> (route "folder" *> int) <|> Folder <$> (route "folder" *> int)
<|> Corpus <$> (route "corpus" *> int) <|> Corpus <$> (route "corpus" *> int)
<|> Tabview <$ route "tabview" <|> DocView <$> (route "docView" *> int)
<|> DocView <$> (route "docView" *> int) <|> NGramsTable <$ route "ngrams"
<|> NGramsTable <$ route "ngrams"
<|> DocAnnotation <$> (route "document" *> int) <|> DocAnnotation <$> (route "document" *> int)
<|> Dashboard <$ route "dashboard" <|> Dashboard <$ route "dashboard"
<|> PGraphExplorer <$ route "graph" <|> PGraphExplorer <$ route "graph"
...@@ -58,7 +56,6 @@ instance showRoutes :: Show Routes where ...@@ -58,7 +56,6 @@ instance showRoutes :: Show Routes where
show (UserPage i) = "User" <> show i show (UserPage i) = "User" <> show i
show (DocAnnotation i)= "Document" show (DocAnnotation i)= "Document"
show (Corpus i) = "Corpus" <> show i show (Corpus i) = "Corpus" <> show i
show Tabview = "Tabview"
show (DocView i) = "DocView" show (DocView i) = "DocView"
show NGramsTable = "NGramsTable" show NGramsTable = "NGramsTable"
show (Annuaire i) = "Annuaire" <> show i show (Annuaire i) = "Annuaire" <> show i
......
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