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
46038d62
Commit
46038d62
authored
Jun 25, 2018
by
Mael NICOLAS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
look like the action is never called dunno why
parent
30998d6f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
9 deletions
+12
-9
API.purs
src/Gargantext/Users/API.purs
+5
-4
Renders.purs
src/Gargantext/Users/Specs/Renders.purs
+6
-4
States.purs
src/Gargantext/Users/Types/States.purs
+1
-1
No files found.
src/Gargantext/Users/API.purs
View file @
46038d62
...
...
@@ -12,7 +12,7 @@ import Data.Lens (set)
import Data.Maybe (Maybe(..))
import Gargantext.REST (get)
import Network.HTTP.Affjax (AJAX)
import Prelude (
id, show, void, ($), (<>), bind
)
import Prelude (
bind, id, pure, show, void, ($), (<<<), (<>)
)
import Thermite (PerformAction, modifyState)
getUser :: forall eff. Int -> Aff
...
...
@@ -26,11 +26,12 @@ performAction :: forall eff props. PerformAction ( console :: CONSOLE
| eff ) State props Action
performAction NoOp _ _ = void do
modifyState id
performAction
FetchUser
_ _ = void do
value <- lift $ getUser
452145
performAction
(FetchUser id)
_ _ = void do
value <- lift $ getUser
id
let user = case value of
(Right user) -> Just user
_ -> Nothing
modifyState \state -> set _user user state
_ <- pure <<< log $ "Fetching user..."
pure $ modifyState \state -> set _user user state
performAction _ _ _ = void do
modifyState id
src/Gargantext/Users/Specs/Renders.purs
View file @
46038d62
module Gargantext.Users.Specs.Renders
where
import Gargantext.Users.Types
import Control.Monad.Aff (attempt)
import Control.Monad.Aff.Class (liftAff)
import Data.Either (Either(..))
import Data.Generic (gShow)
import Data.Maybe (Maybe(..))
import Data.Tuple (Tuple(..))
import Gargantext.Users.API (getUser)
import Gargantext.Users.Types
import Prelude (show, ($), (<<<))
import Prelude (($), (<<<))
import React (ReactElement)
import React.DOM (div, h4, li, span, text, ul)
import React.DOM (
button,
div, h4, li, span, text, ul)
import React.DOM.Props (_id, className)
import React.DOM.Props as RP
import Thermite (Render)
...
...
@@ -71,6 +72,7 @@ render dispatch _ state _ =
[
div [className "row"]
[
button [RP.onClick \_ -> dispatch $ FetchUser 452145] [ text "Fetch User"],
div [className "col-md-8"]
$ card (case state.user of (Just _) -> "Ok"
Nothing -> "Pas Ok")
...
...
src/Gargantext/Users/Types/States.purs
View file @
46038d62
...
...
@@ -14,7 +14,7 @@ data Action
| BrevetsA B.Action
| ProjectsA PS.Action
| TabA Tab.Action
| FetchUser
| FetchUser
Int
type State =
{ activeTab :: 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