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
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Grégoire Locqueville
purescript-gargantext
Commits
79100b8c
Commit
79100b8c
authored
Jul 05, 2018
by
Mael NICOLAS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fetch without button
parent
02007da2
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
34 deletions
+33
-34
Renders.purs
src/Gargantext/Users/Specs/Renders.purs
+5
-7
Navigation.purs
src/Navigation.purs
+6
-5
PageRouter.purs
src/PageRouter.purs
+22
-22
No files found.
src/Gargantext/Users/Specs/Renders.purs
View file @
79100b8c
...
@@ -7,19 +7,18 @@ import Data.Maybe (Maybe(..))
...
@@ -7,19 +7,18 @@ import Data.Maybe (Maybe(..))
import Data.Tuple (Tuple(..))
import Data.Tuple (Tuple(..))
import Prelude (($), (<<<))
import Prelude (($), (<<<))
import React (ReactElement)
import React (ReactElement)
import React.DOM (
button, div, h4, h3
, li, span, text, ul, img)
import React.DOM (
div, h3, h1
, li, span, text, ul, img)
import React.DOM.Props (_id, className, src)
import React.DOM.Props (_id, className, src)
import React.DOM.Props as RP
import Thermite (Render)
import Thermite (Render)
render :: forall props. Render State props Action
render :: forall props. Render State props Action
render dispatch _ state _ =
render dispatch _ state _ =
[
button [RP.onClick \_ -> dispatch $ FetchUser 473593] [ text "Fetch User"],
[
div [className "col-md-12"]
div [className "col-md-12"]
$ case state.user of
$ case state.user of
(Just (User user)) -> display user.name [userInfos user.hyperdata]
(Just (User user)) -> display user.name [userInfos user.hyperdata]
Nothing -> display "
No user" [
]
Nothing -> display "
User not found" [h1 [] [text "¯\\_(ツ)_/¯"]
]
]
]
display :: forall props. String -> Array ReactElement -> Array ReactElement
display :: forall props. String -> Array ReactElement -> Array ReactElement
...
@@ -67,4 +66,3 @@ userInfos (HyperData user) =
...
@@ -67,4 +66,3 @@ userInfos (HyperData user) =
[ span [] [text title]
[ span [] [text title]
, span [className "badge badge-default badge-pill"] [text content]
, span [className "badge badge-default badge-pill"] [text content]
]
]
src/Navigation.purs
View file @
79100b8c
...
@@ -323,7 +323,7 @@ pagesComponent s =
...
@@ -323,7 +323,7 @@ pagesComponent s =
selectSpec Home = layout0 $ focus _landingState _landingAction (L.layoutLanding EN)
selectSpec Home = layout0 $ focus _landingState _landingAction (L.layoutLanding EN)
selectSpec AddCorpus = layout0 $ focus _addCorpusState _addCorpusAction AC.layoutAddcorpus
selectSpec AddCorpus = layout0 $ focus _addCorpusState _addCorpusAction AC.layoutAddcorpus
selectSpec DocView = layout0 $ focus _docViewState _docViewAction DV.layoutDocview
selectSpec DocView = layout0 $ focus _docViewState _docViewAction DV.layoutDocview
selectSpec
UserPage
= layout0 $ focus _userPageState _userPageAction U.layoutUser
selectSpec
(UserPage i)
= layout0 $ focus _userPageState _userPageAction U.layoutUser
selectSpec (DocAnnotation i) = layout0 $ focus _docAnnotationViewState _docAnnotationViewAction D.docview
selectSpec (DocAnnotation i) = layout0 $ focus _docAnnotationViewState _docAnnotationViewAction D.docview
selectSpec Tabview = layout0 $ focus _tabviewState _tabviewAction TV.tab1
selectSpec Tabview = layout0 $ focus _tabviewState _tabviewAction TV.tab1
-- To be removed
-- To be removed
...
@@ -637,9 +637,10 @@ dispatchAction dispatcher _ SearchView = do
...
@@ -637,9 +637,10 @@ dispatchAction dispatcher _ SearchView = do
_ <- dispatcher $ SearchA $ S.NoOp
_ <- dispatcher $ SearchA $ S.NoOp
pure unit
pure unit
dispatchAction dispatcher _
UserPage
= do
dispatchAction dispatcher _
(UserPage id)
= do
_ <- dispatcher $ SetRoute $ UserPage
_ <- dispatcher $ SetRoute $ UserPage
id
_ <- dispatcher $ UserPageA $ U.NoOp
_ <- dispatcher $ UserPageA $ U.NoOp
_ <- dispatcher $ UserPageA $ U.FetchUser id
pure unit
pure unit
dispatchAction dispatcher _ (DocAnnotation i) = do
dispatchAction dispatcher _ (DocAnnotation i) = do
...
...
src/PageRouter.purs
View file @
79100b8c
...
@@ -21,7 +21,7 @@ data Routes
...
@@ -21,7 +21,7 @@ data Routes
| AddCorpus
| AddCorpus
| DocView
| DocView
| SearchView
| SearchView
| UserPage
| UserPage
Int
| DocAnnotation Int
| DocAnnotation Int
| Tabview
| Tabview
| CorpusAnalysis
| CorpusAnalysis
...
@@ -35,7 +35,7 @@ instance showRoutes :: Show Routes where
...
@@ -35,7 +35,7 @@ instance showRoutes :: Show Routes where
show AddCorpus = "AddCorpus"
show AddCorpus = "AddCorpus"
show DocView = "DocView"
show DocView = "DocView"
show SearchView = "SearchView"
show SearchView = "SearchView"
show
UserPage
= "UserPage"
show
(UserPage i)
= "UserPage"
show (DocAnnotation i)= "DocumentView"
show (DocAnnotation i)= "DocumentView"
show Tabview = "Tabview"
show Tabview = "Tabview"
show CorpusAnalysis = "corpus"
show CorpusAnalysis = "corpus"
...
@@ -52,7 +52,7 @@ routing =
...
@@ -52,7 +52,7 @@ routing =
Login <$ route "login"
Login <$ route "login"
<|> Tabview <$ route "tabview"
<|> Tabview <$ route "tabview"
<|> DocAnnotation <$> (route "documentView" *> int)
<|> DocAnnotation <$> (route "documentView" *> int)
<|> UserPage <$
route "userPage"
<|> UserPage <$
> (route "user" *> int)
<|> SearchView <$ route "search"
<|> SearchView <$ route "search"
<|> DocView <$ route "docView"
<|> DocView <$ route "docView"
<|> AddCorpus <$ route "addCorpus"
<|> AddCorpus <$ route "addCorpus"
...
...
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