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
e7366db6
Unverified
Commit
e7366db6
authored
Sep 17, 2018
by
Nicolas Pouillard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid NoOp actions
parent
42ff8c72
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
63 additions
and
96 deletions
+63
-96
Login.purs
src/Gargantext/Components/Login.purs
+1
-4
Annotation.purs
src/Gargantext/Pages/Corpus/Doc/Annotation.purs
+1
-4
Actions.purs
src/Gargantext/Pages/Corpus/Doc/Facets/Actions.purs
+1
-2
Graph.purs
src/Gargantext/Pages/Corpus/Doc/Facets/Graph.purs
+2
-6
NgramsTable.purs
...Gargantext/Pages/Corpus/Doc/Facets/Terms/NgramsTable.purs
+1
-2
Brevets.purs
src/Gargantext/Pages/Corpus/User/Brevets.purs
+3
-3
Folder.purs
src/Gargantext/Pages/Folder.purs
+1
-2
Actions.purs
src/Gargantext/Pages/Home/Actions.purs
+3
-11
Layout.purs
src/Gargantext/Pages/Layout.purs
+35
-47
Actions.purs
src/Gargantext/Pages/Layout/Actions.purs
+13
-2
Actions.purs
src/Gargantext/Pages/Layout/Specs/AddCorpus/Actions.purs
+1
-5
Search.purs
src/Gargantext/Pages/Layout/Specs/Search.purs
+1
-8
No files found.
src/Gargantext/Components/Login.purs
View file @
e7366db6
...
@@ -46,15 +46,12 @@ initialState = State
...
@@ -46,15 +46,12 @@ initialState = State
}
}
data Action
data Action
= NoOp
= Login
| Login
| SetUserName String
| SetUserName String
| SetPassword String
| SetPassword String
performAction :: PerformAction State {} Action
performAction :: PerformAction State {} Action
performAction NoOp _ _ = void do
modifyState identity
performAction (SetUserName usr) _ _ = void do
performAction (SetUserName usr) _ _ = void do
modifyState \(State state) -> State $ state { username = usr }
modifyState \(State state) -> State $ state { username = usr }
...
...
src/Gargantext/Pages/Corpus/Doc/Annotation.purs
View file @
e7366db6
...
@@ -21,15 +21,12 @@ initialState =
...
@@ -21,15 +21,12 @@ initialState =
data Action
data Action
= NoOp
= ChangeString String
| ChangeString String
| ChangeAnotherString String
| ChangeAnotherString String
| SetInput String
| SetInput String
performAction :: PerformAction State {} Action
performAction :: PerformAction State {} Action
performAction NoOp _ _ = pure unit
performAction (ChangeString ps) _ _ = pure unit
performAction (ChangeString ps) _ _ = pure unit
performAction (ChangeAnotherString ps) _ _ = pure unit
performAction (ChangeAnotherString ps) _ _ = pure unit
...
...
src/Gargantext/Pages/Corpus/Doc/Facets/Actions.purs
View file @
e7366db6
...
@@ -16,7 +16,6 @@ data Action
...
@@ -16,7 +16,6 @@ data Action
| AuthorviewA AV.Action
| AuthorviewA AV.Action
| TermsviewA TV.Action
| TermsviewA TV.Action
| TabViewA Tab.Action
| TabViewA Tab.Action
| NoOp
_docAction :: Prism' Action DV.Action
_docAction :: Prism' Action DV.Action
_docAction = prism DocviewA \ action ->
_docAction = prism DocviewA \ action ->
...
...
src/Gargantext/Pages/Corpus/Doc/Facets/Graph.purs
View file @
e7366db6
...
@@ -28,8 +28,8 @@ import React.DOM.Props (_id, _type, checked, className, href, name, onChange, pl
...
@@ -28,8 +28,8 @@ import React.DOM.Props (_id, _type, checked, className, href, name, onChange, pl
import Thermite (PerformAction, Render, Spec, modifyState, simpleSpec)
import Thermite (PerformAction, Render, Spec, modifyState, simpleSpec)
import Unsafe.Coerce (unsafeCoerce)
import Unsafe.Coerce (unsafeCoerce)
data Action
= NoOp
data Action
|
LoadGraph String
=
LoadGraph String
| SelectNode SelectedNode
| SelectNode SelectedNode
newtype SelectedNode = SelectedNode {id :: String, label :: String}
newtype SelectedNode = SelectedNode {id :: String, label :: String}
...
@@ -75,10 +75,6 @@ performAction (LoadGraph fp) _ _ = void do
...
@@ -75,10 +75,6 @@ performAction (LoadGraph fp) _ _ = void do
performAction (SelectNode node) _ _ = void do
performAction (SelectNode node) _ _ = void do
modifyState $ \(State s) -> State s {selectedNode = pure node}
modifyState $ \(State s) -> State s {selectedNode = pure node}
performAction NoOp _ _ = void do
modifyState identity
convert :: GraphData -> SigmaGraphData
convert :: GraphData -> SigmaGraphData
convert (GraphData r) = SigmaGraphData { nodes, edges}
convert (GraphData r) = SigmaGraphData { nodes, edges}
where
where
...
...
src/Gargantext/Pages/Corpus/Doc/Facets/Terms/NgramsTable.purs
View file @
e7366db6
...
@@ -35,8 +35,7 @@ initialState = State { items : toUnfoldable [NI.initialState]
...
@@ -35,8 +35,7 @@ initialState = State { items : toUnfoldable [NI.initialState]
}
}
data Action
data Action
= NoOp
= ItemAction Int NI.Action
| ItemAction Int NI.Action
| ChangeString String
| ChangeString String
| SetInput String
| SetInput String
| ChangePageSize PageSizes
| ChangePageSize PageSizes
...
...
src/Gargantext/Pages/Corpus/User/Brevets.purs
View file @
e7366db6
module Gargantext.Pages.Corpus.User.Brevets where
module Gargantext.Pages.Corpus.User.Brevets where
import Prelude
import Prelude
import Data.Void
import Thermite (PerformAction, Render, Spec, modifyState, simpleSpec)
import Thermite (PerformAction, Render, Spec, modifyState, simpleSpec)
...
@@ -9,11 +10,10 @@ type State = String
...
@@ -9,11 +10,10 @@ type State = String
initialState :: State
initialState :: State
initialState = ""
initialState = ""
data Action = NoOp
type Action = Void
performAction :: PerformAction State {} Action
performAction :: PerformAction State {} Action
performAction NoOp _ _ = void do
performAction action _ _ = absurd action
modifyState identity
brevetsSpec :: Spec State {} Action
brevetsSpec :: Spec State {} Action
brevetsSpec = simpleSpec performAction render
brevetsSpec = simpleSpec performAction render
...
...
src/Gargantext/Pages/Folder.purs
View file @
e7366db6
...
@@ -13,8 +13,7 @@ initialState = ""
...
@@ -13,8 +13,7 @@ initialState = ""
data Action = NoOp
data Action = NoOp
performAction :: PerformAction State {} Action
performAction :: PerformAction State {} Action
performAction NoOp _ _ = void do
performAction NoOp _ _ = pure unit
modifyState identity
projets :: Spec State {} Action
projets :: Spec State {} Action
projets = simpleSpec performAction render
projets = simpleSpec performAction render
...
...
src/Gargantext/Pages/Home/Actions.purs
View file @
e7366db6
...
@@ -8,27 +8,19 @@ import Routing.Hash (setHash)
...
@@ -8,27 +8,19 @@ import Routing.Hash (setHash)
import Thermite (PerformAction, modifyState)
import Thermite (PerformAction, modifyState)
data Action
data Action
= NoOp
= Documentation
| Documentation
| Enter
| Enter
| Login
| Login
| SignUp
| SignUp
performAction :: PerformAction State {} Action
performAction :: PerformAction State {} Action
performAction NoOp _ _ = void do
performAction Documentation _ _ = pure unit
modifyState \state -> state
performAction Documentation _ _ = void do
modifyState \state -> state
performAction Enter _ _ = void do
performAction Enter _ _ = void do
liftEffect $ setHash "/search"
liftEffect $ setHash "/search"
modifyState \state -> state
performAction Login _ _ = void do
performAction Login _ _ = void do
liftEffect $ setHash "/login"
liftEffect $ setHash "/login"
modifyState \state -> state
performAction SignUp _ _ = void do
performAction SignUp _ _ = pure unit
modifyState \state -> state
src/Gargantext/Pages/Layout.purs
View file @
e7366db6
module Gargantext.Pages.Layout where
module Gargantext.Pages.Layout where
import Prelude hiding (div)
import Prelude hiding (div)
import Gargantext.Components.Login as LN
--
import Gargantext.Components.Login as LN
import Gargantext.Pages.Layout.Actions (Action(..))
import Gargantext.Pages.Layout.Actions (Action(..))
import Gargantext.Pages.Layout.Specs.AddCorpus as AC
import Gargantext.Pages.Layout.Specs.AddCorpus as AC
import Gargantext.Pages.Corpus.Doc.Facets as TV
--
import Gargantext.Pages.Corpus.Doc.Facets as TV
import Gargantext.Pages.Corpus.Doc.Annotation as D
--
import Gargantext.Pages.Corpus.Doc.Annotation as D
import Gargantext.Pages.Corpus.Doc.Facets.Documents as DV
import Gargantext.Pages.Corpus.Doc.Facets.Documents as DV
import Gargantext.Pages.Corpus.Doc.Facets.Graph as GE
import Gargantext.Pages.Corpus.Doc.Facets.Graph as GE
import Gargantext.Pages.Corpus.Doc.Facets.Terms.NgramsTable as NG
--
import Gargantext.Pages.Corpus.Doc.Facets.Terms.NgramsTable as NG
import Gargantext.Pages.Corpus.User.Users as U
import Gargantext.Pages.Corpus.User.Users as U
import Gargantext.Pages.Home as L
--
import Gargantext.Pages.Home as L
import Gargantext.Pages.Layout.Specs.Search as S
--
import Gargantext.Pages.Layout.Specs.Search as S
import Gargantext.Router (Routes(..))
import Gargantext.Router (Routes(..))
dispatchAction :: forall
t115 t445 t447
.
dispatchAction :: forall
ignored m
.
Bind t445 => Applicative t445
=>
Monad m
=>
(Action ->
t445 t447) -> t115 -> Routes -> t445
Unit
(Action ->
m Unit) -> ignored -> Routes -> m
Unit
dispatchAction dispatcher _ Home = do
dispatchAction dispatcher _ Home = do
_ <- dispatcher Initialize
dispatcher Initialize
_ <- dispatcher $ SetRoute Home
dispatcher $ SetRoute Home
_ <- dispatcher $ LandingA L.NoOp
-- dispatcher $ LandingA TODO
pure unit
dispatchAction dispatcher _ Login = do
dispatchAction dispatcher _ Login = do
_ <- dispatcher Initialize
dispatcher Initialize
_ <- dispatcher $ SetRoute Login
dispatcher $ SetRoute Login
_ <- dispatcher $ LoginA LN.NoOp
-- dispatcher $ LoginA TODO
pure unit
dispatchAction dispatcher _ AddCorpus = do
dispatchAction dispatcher _ AddCorpus = do
_ <- dispatcher $ SetRoute AddCorpus
dispatcher $ SetRoute AddCorpus
_ <- dispatcher $ AddCorpusA AC.LoadDatabaseDetails
dispatcher $ AddCorpusA AC.LoadDatabaseDetails
pure unit
dispatchAction dispatcher _ DocView = do
dispatchAction dispatcher _ DocView = do
_ <- dispatcher $ SetRoute $ DocView
dispatcher $ SetRoute DocView
_ <- dispatcher $ DocViewA $ DV.LoadData
dispatcher $ DocViewA $ DV.LoadData
pure unit
dispatchAction dispatcher _ SearchView = do
dispatchAction dispatcher _ SearchView = do
_ <- dispatcher $ SetRoute $ SearchView
dispatcher $ SetRoute SearchView
_ <- dispatcher $ SearchA $ S.NoOp
-- dispatcher $ SearchA TODO
pure unit
dispatchAction dispatcher _ (UserPage id) = do
dispatchAction dispatcher _ (UserPage id) = do
_ <- dispatcher $ SetRoute $ UserPage id
dispatcher $ SetRoute $ UserPage id
_ <- dispatcher $ UserPageA $ U.NoOp
-- dispatcher $ UserPageA TODO
_ <- dispatcher $ UserPageA $ U.FetchUser id
dispatcher $ UserPageA $ U.FetchUser id
pure unit
dispatchAction dispatcher _ (DocAnnotation i) = do
dispatchAction dispatcher _ (DocAnnotation i) = do
_ <- dispatcher $ SetRoute $ DocAnnotation i
dispatcher $ SetRoute $ DocAnnotation i
_ <- dispatcher $ DocAnnotationViewA $ D.NoOp
-- dispatcher $ DocAnnotationViewA TODO
pure unit
dispatchAction dispatcher _ Tabview = do
dispatchAction dispatcher _ Tabview = do
_ <- dispatcher $ SetRoute $ Tabview
dispatcher $ SetRoute Tabview
_ <- dispatcher $ TabViewA $ TV.NoOp
-- dispatcher $ TabViewA TODO
pure unit
dispatchAction dispatcher _ CorpusAnalysis = do
dispatchAction dispatcher _ CorpusAnalysis = do
_ <- dispatcher $ SetRoute $ CorpusAnalysis
dispatcher $ SetRoute CorpusAnalysis
--_ <- dispatcher $ CorpusAnalysisA $ CA.NoOp
-- dispatcher $ CorpusAnalysisA TODO
pure unit
dispatchAction dispatcher _ PGraphExplorer = do
dispatchAction dispatcher _ PGraphExplorer = do
_ <- dispatcher $ SetRoute $ PGraphExplorer
dispatcher $ SetRoute PGraphExplorer
_ <- dispatcher $ GraphExplorerA $ GE.LoadGraph "imtNew.json"
dispatcher $ GraphExplorerA $ GE.LoadGraph "imtNew.json"
pure unit
dispatchAction dispatcher _ NGramsTable = do
dispatchAction dispatcher _ NGramsTable = do
_ <- dispatcher $ SetRoute $ NGramsTable
dispatcher $ SetRoute NGramsTable
_ <- dispatcher $ NgramsA $ NG.NoOp
-- dispatcher $ NgramsA TODO
pure unit
dispatchAction dispatcher _ Dashboard = do
dispatchAction dispatcher _ Dashboard = do
_ <- dispatcher $ SetRoute $ Dashboard
dispatcher $ SetRoute Dashboard
pure unit
src/Gargantext/Pages/Layout/Actions.purs
View file @
e7366db6
...
@@ -96,8 +96,19 @@ performAction Initialize _ state = void do
...
@@ -96,8 +96,19 @@ performAction Initialize _ state = void do
_ -> do
_ -> do
modifyState identity
modifyState identity
performAction _ _ _ = void do
performAction (LandingA _) _ _ = pure unit
modifyState identity
performAction (LoginA _) _ _ = pure unit
performAction (AddCorpusA _) _ _ = pure unit
performAction (DocViewA _) _ _ = pure unit
performAction (SearchA _) _ _ = pure unit
performAction (UserPageA _) _ _ = pure unit
performAction (DocAnnotationViewA _) _ _ = pure unit
performAction (TreeViewA _) _ _ = pure unit
performAction (TabViewA _) _ _ = pure unit
performAction (GraphExplorerA _) _ _ = pure unit
performAction (DashboardA _) _ _ = pure unit
performAction (NgramsA _) _ _ = pure unit
performAction (CorpusAnalysisA _) _ _ = pure unit
----------------------------------------------------------
----------------------------------------------------------
...
...
src/Gargantext/Pages/Layout/Specs/AddCorpus/Actions.purs
View file @
e7366db6
...
@@ -21,16 +21,12 @@ import Routing.Hash (setHash)
...
@@ -21,16 +21,12 @@ import Routing.Hash (setHash)
import Thermite (PerformAction, modifyState)
import Thermite (PerformAction, modifyState)
data Action
data Action
= NoOp
= SelectDatabase Boolean
| SelectDatabase Boolean
| UnselectDatabase Boolean
| UnselectDatabase Boolean
| LoadDatabaseDetails
| LoadDatabaseDetails
| GO
| GO
performAction :: PerformAction State {} Action
performAction :: PerformAction State {} Action
performAction NoOp _ _ = void do
modifyState identity
performAction (SelectDatabase selected) _ _ = void do
performAction (SelectDatabase selected) _ _ = void do
modifyState \( state) -> state { select_database = selected }
modifyState \( state) -> state { select_database = selected }
...
...
src/Gargantext/Pages/Layout/Specs/Search.purs
View file @
e7366db6
...
@@ -23,24 +23,17 @@ initialState =
...
@@ -23,24 +23,17 @@ initialState =
data Action
data Action
= NoOp
= GO
| GO
| SetQuery String
| SetQuery String
performAction :: PerformAction State {} Action
performAction :: PerformAction State {} Action
performAction NoOp _ _ = void do
modifyState identity
performAction (SetQuery q) _ _ = void do
performAction (SetQuery q) _ _ = void do
modifyState \( state) -> state { query = q }
modifyState \( state) -> state { query = q }
performAction GO _ _ = void do
performAction GO _ _ = void do
liftEffect $ setHash "/addCorpus"
liftEffect $ setHash "/addCorpus"
modifyState identity
unsafeEventValue :: forall event. event -> String
unsafeEventValue :: forall event. event -> String
unsafeEventValue e = (unsafeCoerce e).target.value
unsafeEventValue e = (unsafeCoerce e).target.value
...
...
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