Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
142
Issues
142
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
purescript-gargantext
Commits
0e91fff8
Commit
0e91fff8
authored
Apr 05, 2018
by
Abinaya Sudhir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Navigation for Tabview
parent
408b6f2a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
1 deletion
+30
-1
Navigation.purs
src/Navigation.purs
+25
-1
PageRouter.purs
src/PageRouter.purs
+4
-0
Tabview.purs
src/Tabview.purs
+1
-0
No files found.
src/Navigation.purs
View file @
0e91fff8
...
...
@@ -2,7 +2,7 @@ module Navigation where
import DOM
import Gargantext.Data.Lang
import Prelude
import Prelude
hiding (div)
import AddCorpusview as AC
import AnnotationDocumentView as D
...
...
@@ -24,8 +24,11 @@ import React.DOM (a, button, div, footer, form, hr, i, img, input, li, p, span,
import React.DOM.Props (Props, _data, _id, _type, aria, className, href, name, onClick, placeholder, role, src, style, tabIndex, target, title)
import React.DOM.Props as RP
import SearchForm as S
import Tabview as TV
import Thermite (PerformAction, Render, Spec, _render, cotransform, defaultRender, focus, modifyState, simpleSpec, withState)
import UserPage as UP
type E e = (dom :: DOM, ajax :: AJAX, console :: CONSOLE | e)
type AppState =
...
...
@@ -38,6 +41,7 @@ type AppState =
, userPage :: UP.State
, annotationdocumentView :: D.State
, ntreeView :: NT.State
, tabview :: TV.State
}
initAppState :: AppState
...
...
@@ -51,6 +55,7 @@ initAppState =
, userPage : UP.initialState
, annotationdocumentView : D.initialState
, ntreeView : NT.exampleTree
, tabview : TV.initialState
}
data Action
...
...
@@ -64,6 +69,7 @@ data Action
| UserPageA UP.Action
| AnnotationDocumentViewA D.Action
| TreeViewA NT.Action
| TabViewA TV.Action
performAction :: forall eff props. PerformAction ( dom :: DOM
...
...
@@ -167,6 +173,17 @@ _treeAction = prism TreeViewA \action ->
_-> Left action
_tabviewState :: Lens' AppState TV.State
_tabviewState = lens (\s -> s.tabview) (\s ss -> s {tabview = ss})
_tabviewAction :: Prism' Action TV.Action
_tabviewAction = prism TabViewA \action ->
case action of
TabViewA caction -> Right caction
_-> Left action
pagesComponent :: forall props eff. AppState -> Spec (E eff) AppState props Action
pagesComponent s =
case s.currentRoute of
...
...
@@ -186,6 +203,7 @@ pagesComponent s =
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 Tabview = layout0 $ focus _tabviewState _tabviewAction TV.tabSpec
-- To be removed
selectSpec SearchView = layout0 $ focus _searchState _searchAction S.searchSpec
...
...
@@ -503,3 +521,9 @@ dispatchAction dispatcher _ (AnnotationDocumentView i) = do
_ <- dispatcher $ SetRoute $ AnnotationDocumentView i
_ <- dispatcher $ AnnotationDocumentViewA $ D.NoOp
pure unit
dispatchAction dispatcher _ Tabview = do
_ <- dispatcher $ SetRoute $ Tabview
_ <- dispatcher $ TabViewA $ TV.NoOp
pure unit
src/PageRouter.purs
View file @
0e91fff8
...
...
@@ -23,6 +23,7 @@ data Routes
| SearchView
| UserPage
| AnnotationDocumentView Int
| Tabview
instance showRoutes :: Show Routes where
...
...
@@ -33,6 +34,7 @@ instance showRoutes :: Show Routes where
show SearchView = "SearchView"
show UserPage = "UserPage"
show (AnnotationDocumentView i) = "DocumentView"
show Tabview = "Tabview"
int :: Match Int
int = floor <$> num
...
...
@@ -41,6 +43,7 @@ int = floor <$> num
routing :: Match Routes
routing =
loginRoute
<|> tabview
<|> documentView
<|> userPageRoute
<|> searchRoute
...
...
@@ -48,6 +51,7 @@ routing =
<|> addcorpusRoute
<|> home
where
tabview = Tabview <$ route "tabview"
documentView = AnnotationDocumentView <$> (route "documentView" *> int)
userPageRoute = UserPage <$ route "userPage"
searchRoute = SearchView <$ route "search"
...
...
src/Tabview.purs
View file @
0e91fff8
...
...
@@ -21,6 +21,7 @@ data Action
| AuthorviewA AV.Action
| TermsviewA TV.Action
| ChangeTab
| NoOp
data TabTitle = TabTitle String Int
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment