Commit e441fc2d authored by Alexandre Delanoë's avatar Alexandre Delanoë

[RENAME] AnnotationDocumentView -> DocAnnotaiton

parent 51577839
module AnnotationDocumentView where
module DocAnnotation where
import Prelude hiding (div)
import React (ReactElement)
......
......@@ -4,7 +4,7 @@ import DOM
import Gargantext.Data.Lang
import AddCorpusview as AC
import AnnotationDocumentView as D
import DocAnnotation as D
import Control.Monad.Cont.Trans (lift)
import Control.Monad.Eff (Eff)
import Control.Monad.Eff.Class (liftEff)
......@@ -47,7 +47,7 @@ type AppState =
, docViewState :: DV.State
, searchState :: S.State
, userPage :: UP.State
, annotationdocumentView :: D.State
, docAnnotationView :: D.State
, ntreeView :: NT.State
, tabview :: TV.State
, search :: String
......@@ -67,7 +67,7 @@ initAppState =
, docViewState : DV.tdata
, searchState : S.initialState
, userPage : UP.initialState
, annotationdocumentView : D.initialState
, docAnnotationView : D.initialState
, ntreeView : NT.exampleTree
, tabview : TV.initialState
, search : ""
......@@ -87,7 +87,7 @@ data Action
| DocViewA DV.Action
| SearchA S.Action
| UserPageA UP.Action
| AnnotationDocumentViewA D.Action
| DocAnnotationViewA D.Action
| TreeViewA NT.Action
| TabViewA TV.Action
| GraphExplorerA GE.Action
......@@ -195,14 +195,14 @@ _userPageAction = prism UserPageA \action ->
_-> Left action
_annotationdocumentviewState :: Lens' AppState D.State
_annotationdocumentviewState = lens (\s -> s.annotationdocumentView) (\s ss -> s{annotationdocumentView = ss})
_docAnnotationViewState :: Lens' AppState D.State
_docAnnotationViewState = lens (\s -> s.docAnnotationView) (\s ss -> s{docAnnotationView = ss})
_annotationdocumentviewAction :: Prism' Action D.Action
_annotationdocumentviewAction = prism AnnotationDocumentViewA \action ->
_docAnnotationViewAction :: Prism' Action D.Action
_docAnnotationViewAction = prism DocAnnotationViewA \action ->
case action of
AnnotationDocumentViewA caction -> Right caction
DocAnnotationViewA caction -> Right caction
_-> Left action
......@@ -280,7 +280,7 @@ pagesComponent s =
-- selectSpec AddCorpus = layout0 $ focus _addCorpusState _addCorpusAction AC.layoutAddcorpus
selectSpec DocView = layout0 $ focus _docViewState _docViewAction DV.layoutDocview
selectSpec UserPage = layout0 $ focus _userPageState _userPageAction UP.layoutUser
selectSpec (AnnotationDocumentView i) = layout0 $ focus _annotationdocumentviewState _annotationdocumentviewAction D.docview
selectSpec (DocAnnotation i) = layout0 $ focus _docAnnotationViewState _docAnnotationViewAction D.docview
selectSpec Tabview = layout0 $ focus _tabviewState _tabviewAction TV.tab1
-- To be removed
selectSpec SearchView = layout0 $ focus _searchState _searchAction S.searchSpec
......@@ -594,9 +594,9 @@ dispatchAction dispatcher _ UserPage = do
_ <- dispatcher $ UserPageA $ UP.NoOp
pure unit
dispatchAction dispatcher _ (AnnotationDocumentView i) = do
_ <- dispatcher $ SetRoute $ AnnotationDocumentView i
_ <- dispatcher $ AnnotationDocumentViewA $ D.NoOp
dispatchAction dispatcher _ (DocAnnotation i) = do
_ <- dispatcher $ SetRoute $ DocAnnotation i
_ <- dispatcher $ DocAnnotationViewA $ D.NoOp
pure unit
......
......@@ -22,7 +22,7 @@ data Routes
| DocView
| SearchView
| UserPage
| AnnotationDocumentView Int
| DocAnnotation Int
| Tabview
| CorpusAnalysis
| PGraphExplorer
......@@ -35,7 +35,7 @@ instance showRoutes :: Show Routes where
show DocView = "DocView"
show SearchView = "SearchView"
show UserPage = "UserPage"
show (AnnotationDocumentView i) = "DocumentView"
show (DocAnnotation i)= "DocumentView"
show Tabview = "Tabview"
show CorpusAnalysis = "corpus"
show PGraphExplorer = "graphExplorer"
......@@ -46,17 +46,17 @@ int = floor <$> num
routing :: Match Routes
routing =
Login <$ route "login"
<|> Tabview <$ route "tabview"
<|> AnnotationDocumentView <$> (route "documentView" *> int)
<|> UserPage <$ route "userPage"
<|> SearchView <$ route "search"
<|> DocView <$ route "docView"
<|> AddCorpus <$ route "addCorpus"
<|> CorpusAnalysis <$ route "corpus"
<|> PGraphExplorer <$ route "graphExplorer"
<|> NGramsTable <$ route "ngrams"
<|> Home <$ lit ""
Login <$ route "login"
<|> Tabview <$ route "tabview"
<|> DocAnnotation <$> (route "documentView" *> int)
<|> UserPage <$ route "userPage"
<|> SearchView <$ route "search"
<|> DocView <$ route "docView"
<|> AddCorpus <$ route "addCorpus"
<|> CorpusAnalysis <$ route "corpus"
<|> PGraphExplorer <$ route "graphExplorer"
<|> NGramsTable <$ route "ngrams"
<|> Home <$ lit ""
where
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