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
28f1450d
Unverified
Commit
28f1450d
authored
Sep 20, 2018
by
Nicolas Pouillard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Less modifyState identity
parent
6a64b6e0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
20 deletions
+18
-20
Documents.purs
src/Gargantext/Pages/Corpus/Doc/Facets/Documents.purs
+3
-3
API.purs
src/Gargantext/Pages/Corpus/User/Users/API.purs
+4
-6
Actions.purs
src/Gargantext/Pages/Layout/Actions.purs
+4
-4
Actions.purs
src/Gargantext/Pages/Layout/Specs/AddCorpus/Actions.purs
+7
-7
No files found.
src/Gargantext/Pages/Corpus/Doc/Facets/Documents.purs
View file @
28f1450d
...
@@ -186,11 +186,11 @@ performAction (ChangePageSize ps) _ _ = void (cotransform (\state -> changePage
...
@@ -186,11 +186,11 @@ performAction (ChangePageSize ps) _ _ = void (cotransform (\state -> changePage
performAction (ChangePage p) _ _ = void (cotransform (\(TableData td) -> TableData $ td { currentPage = p} ))
performAction (ChangePage p) _ _ = void (cotransform (\(TableData td) -> TableData $ td { currentPage = p} ))
performAction LoadData _ _ =
void
do
performAction LoadData _ _ = do
res <- lift $ loadPage
res <- lift $ loadPage
case res of
case res of
Left err ->
cotransform $ \state -> state
Left err ->
pure unit
Right resData -> modifyState (\s -> resData)
Right resData ->
void $
modifyState (\s -> resData)
loadPage :: Aff (Either String CorpusTableData)
loadPage :: Aff (Either String CorpusTableData)
...
...
src/Gargantext/Pages/Corpus/User/Users/API.purs
View file @
28f1450d
...
@@ -18,13 +18,11 @@ getUser id = get $ "http://localhost:8008/node/" <> show id
...
@@ -18,13 +18,11 @@ getUser id = get $ "http://localhost:8008/node/" <> show id
performAction :: PerformAction State {} Action
performAction :: PerformAction State {} Action
performAction (FetchUser userId) _ _ =
void
do
performAction (FetchUser userId) _ _ = do
value <- lift $ getUser userId
value <- lift $ getUser userId
_ <- case value of
_ <- case value of
(Right user) -> modifyState \state -> set _user (Just user) state
(Right user) ->
void $
modifyState \state -> set _user (Just user) state
(Left err) -> do
(Left err) -> do
_ <- liftEffect $ log err
liftEffect $ log err
modifyState identity
liftEffect <<< log $ "Fetching user..."
liftEffect <<< log $ "Fetching user..."
performAction _ _ _ = void do
performAction _ _ _ = pure unit
modifyState identity
src/Gargantext/Pages/Layout/Actions.purs
View file @
28f1450d
...
@@ -67,14 +67,14 @@ performAction Initialize _ state = void do
...
@@ -67,14 +67,14 @@ performAction Initialize _ state = void do
case lnodes of
case lnodes of
Left err -> do
Left err -> do
modifyState identity
pure unit
Right d -> do
Right d -> do
_ <- modifyState $ _ { initialized = true, ntreeState = d}
_ <- modifyState $ _ { initialized = true, ntreeState = d}
page <- lift $ DV.loadPage
page <- lift $ DV.loadPage
case page of
case page of
Left err -> do
Left err -> do
modifyState identity
pure unit
Right docs -> do
Right docs ->
void
do
modifyState $ _ { initialized = true
modifyState $ _ { initialized = true
, ntreeState = d
, ntreeState = d
-- if length d > 0
-- if length d > 0
...
@@ -85,7 +85,7 @@ performAction Initialize _ state = void do
...
@@ -85,7 +85,7 @@ performAction Initialize _ state = void do
, docViewState = docs
, docViewState = docs
}
}
_ -> do
_ -> do
modifyState identity
pure unit
performAction (LoginA _) _ _ = pure unit
performAction (LoginA _) _ _ = pure unit
performAction (AddCorpusA _) _ _ = pure unit
performAction (AddCorpusA _) _ _ = pure unit
...
...
src/Gargantext/Pages/Layout/Specs/AddCorpus/Actions.purs
View file @
28f1450d
...
@@ -33,17 +33,17 @@ performAction (SelectDatabase selected) _ _ = void do
...
@@ -33,17 +33,17 @@ performAction (SelectDatabase selected) _ _ = void do
performAction (UnselectDatabase unselected) _ _ = void do
performAction (UnselectDatabase unselected) _ _ = void do
modifyState \( state) -> state { unselect_database = unselected }
modifyState \( state) -> state { unselect_database = unselected }
performAction (LoadDatabaseDetails) _ _ =
void
do
performAction (LoadDatabaseDetails) _ _ = do
res <- lift $ getDatabaseDetails $ QueryString { query_query: "string",query_name: ["Pubmed"]}
res <- lift $ getDatabaseDetails $ QueryString { query_query: "string",query_name: ["Pubmed"]}
case res of
case res of
Left err ->
modifyState $ \(state) -> state
Left err ->
pure unit
Right resData -> do
Right resData -> do
modifyState $ \(state) -> state {response = resData}
void $
modifyState $ \(state) -> state {response = resData}
performAction GO _ _ =
void
do
performAction GO _ _ = do
_ <-
liftEffect $ setHash "/corpus"
liftEffect $ setHash "/corpus"
_ <-
liftEffect $ modalHide "addCorpus"
liftEffect $ modalHide "addCorpus"
modifyState identity
pure unit
newtype QueryString = QueryString
newtype QueryString = QueryString
...
...
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