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
43edcadb
Commit
43edcadb
authored
Mar 02, 2018
by
Abinaya Sudhir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Addcorpusview page added to navigation
parent
a12881eb
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
5 deletions
+44
-5
AddCorpusview.purs
src/AddCorpusview.purs
+19
-2
Navigation.purs
src/Navigation.purs
+21
-3
PageRouter.purs
src/PageRouter.purs
+4
-0
No files found.
src/AddCorpusview.purs
View file @
43edcadb
...
...
@@ -19,7 +19,7 @@ import Data.MediaType.Common (applicationJSON)
import Network.HTTP.Affjax (AJAX, affjax, defaultRequest)
import Network.HTTP.RequestHeader (RequestHeader(..))
import Prelude hiding (div)
import React.DOM (a, button, div, form, h2, h4, i, input, label, p, span, text)
import React.DOM (a, button, div, form, h2, h
3, h
4, i, input, label, p, span, text)
import React.DOM.Props (_id, _type, className, href, maxLength, name, onClick, onInput, placeholder, target, value)
import Routing.Hash.Aff (setHash)
import Thermite (PerformAction, Render, Spec, modifyState, simpleSpec)
...
...
@@ -63,4 +63,21 @@ addcorpusviewSpec = simpleSpec performAction render
where
render :: Render State props Action
render dispatch _ state _ =
[ ]
[
div [className "container"]
[
div [className "row"]
[
div [className "col align-self-start"]
[
h3 [] [text "Treeview"]
]
, div [className "col align-self-center"]
[
]
]
]
]
src/Navigation.purs
View file @
43edcadb
...
...
@@ -14,6 +14,7 @@ import React.DOM (div)
import React.DOM.Props (_id, className)
import Landing as L
import Login as LN
import AddCorpusview as AC
type E e = (dom :: DOM, ajax :: AJAX, console :: CONSOLE | e)
...
...
@@ -21,7 +22,7 @@ type AppState =
{ currentRoute :: Maybe Routes
, landingState :: L.State
, loginState :: LN.State
, addCorpusState :: AC.State
}
initAppState :: AppState
...
...
@@ -29,7 +30,7 @@ initAppState =
{ currentRoute : Nothing
, landingState : L.initialState
, loginState : LN.initialState
, addCorpusState : AC.initialState
}
...
...
@@ -38,7 +39,7 @@ data Action
| LandingA L.Action
| LoginA LN.Action
| SetRoute Routes
| AddCorpusA AC.Action
performAction :: forall eff props. PerformAction (dom :: DOM |eff) AppState props Action
...
...
@@ -75,6 +76,18 @@ _loginAction = prism LoginA \action ->
_addCorpusState:: Lens' AppState AC.State
_addCorpusState = lens (\s -> s.addCorpusState) (\s ss -> s{addCorpusState = ss})
_addCorpusAction :: Prism' Action AC.Action
_addCorpusAction = prism AddCorpusA \action ->
case action of
AddCorpusA caction -> Right caction
_-> Left action
pagesComponent :: forall props eff. AppState -> Spec (E eff) AppState props Action
pagesComponent s =
case s.currentRoute of
...
...
@@ -135,3 +148,8 @@ dispatchAction dispatcher _ Login = do
_ <- dispatcher $ SetRoute $ Login
_ <- dispatcher $ LoginA $ LN.NoOp
pure unit
dispatchAction dispatcher _ AddCorpus = do
_ <- dispatcher $ SetRoute $ AddCorpus
_ <- dispatcher $ AddCorpusA $ AC.NoOp
pure unit
src/PageRouter.purs
View file @
43edcadb
...
...
@@ -17,10 +17,12 @@ import Routing.Match.Class (lit, num)
data Routes
= Home
| Login
| AddCorpus
instance showRoutes :: Show Routes where
show Home = "Home"
show Login = "Login"
show AddCorpus = "AddCorpus"
int :: Match Int
int = floor <$> num
...
...
@@ -28,8 +30,10 @@ int = floor <$> num
routing :: Match Routes
routing =
loginRoute
<|> addcorpusRoute
<|> home
where
addcorpusRoute = AddCorpus <$ route "AddCorpus"
loginRoute = Login <$ route "login"
home = Home <$ lit ""
route str = lit "" *> lit str
...
...
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