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
}
data Action
= NoOp
| Login
= Login
| SetUserName String
| SetPassword String
performAction :: PerformAction State {} Action
performAction NoOp _ _ = void do
modifyState identity
performAction (SetUserName usr) _ _ = void do
modifyState \(State state) -> State $ state { username = usr }
...
...
src/Gargantext/Pages/Corpus/Doc/Annotation.purs
View file @
e7366db6
...
...
@@ -21,15 +21,12 @@ initialState =
data Action
= NoOp
| ChangeString String
= ChangeString String
| ChangeAnotherString String
| SetInput String
performAction :: PerformAction State {} Action
performAction NoOp _ _ = pure unit
performAction (ChangeString 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
| AuthorviewA AV.Action
| TermsviewA TV.Action
| TabViewA Tab.Action
| NoOp
_docAction :: Prism' Action DV.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
import Thermite (PerformAction, Render, Spec, modifyState, simpleSpec)
import Unsafe.Coerce (unsafeCoerce)
data Action
= NoOp
|
LoadGraph String
data Action
=
LoadGraph String
| SelectNode SelectedNode
newtype SelectedNode = SelectedNode {id :: String, label :: String}
...
...
@@ -75,10 +75,6 @@ performAction (LoadGraph fp) _ _ = void do
performAction (SelectNode node) _ _ = void do
modifyState $ \(State s) -> State s {selectedNode = pure node}
performAction NoOp _ _ = void do
modifyState identity
convert :: GraphData -> SigmaGraphData
convert (GraphData r) = SigmaGraphData { nodes, edges}
where
...
...
src/Gargantext/Pages/Corpus/Doc/Facets/Terms/NgramsTable.purs
View file @
e7366db6
...
...
@@ -35,8 +35,7 @@ initialState = State { items : toUnfoldable [NI.initialState]
}
data Action
= NoOp
| ItemAction Int NI.Action
= ItemAction Int NI.Action
| ChangeString String
| SetInput String
| ChangePageSize PageSizes
...
...
src/Gargantext/Pages/Corpus/User/Brevets.purs
View file @
e7366db6
module Gargantext.Pages.Corpus.User.Brevets where
import Prelude
import Data.Void
import Thermite (PerformAction, Render, Spec, modifyState, simpleSpec)
...
...
@@ -9,11 +10,10 @@ type State = String
initialState :: State
initialState = ""
data Action = NoOp
type Action = Void
performAction :: PerformAction State {} Action
performAction NoOp _ _ = void do
modifyState identity
performAction action _ _ = absurd action
brevetsSpec :: Spec State {} Action
brevetsSpec = simpleSpec performAction render
...
...
src/Gargantext/Pages/Folder.purs
View file @
e7366db6
...
...
@@ -13,8 +13,7 @@ initialState = ""
data Action = NoOp
performAction :: PerformAction State {} Action
performAction NoOp _ _ = void do
modifyState identity
performAction NoOp _ _ = pure unit
projets :: Spec State {} Action
projets = simpleSpec performAction render
...
...
src/Gargantext/Pages/Home/Actions.purs
View file @
e7366db6
...
...
@@ -8,27 +8,19 @@ import Routing.Hash (setHash)
import Thermite (PerformAction, modifyState)
data Action
= NoOp
| Documentation
= Documentation
| Enter
| Login
| SignUp
performAction :: PerformAction State {} Action
performAction NoOp _ _ = void do
modifyState \state -> state
performAction Documentation _ _ = void do
modifyState \state -> state
performAction Documentation _ _ = pure unit
performAction Enter _ _ = void do
liftEffect $ setHash "/search"
modifyState \state -> state
performAction Login _ _ = void do
liftEffect $ setHash "/login"
modifyState \state -> state
performAction SignUp _ _ = void do
modifyState \state -> state
performAction SignUp _ _ = pure unit
src/Gargantext/Pages/Layout.purs
View file @
e7366db6
module Gargantext.Pages.Layout where
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.Specs.AddCorpus as AC
import Gargantext.Pages.Corpus.Doc.Facets as TV
import Gargantext.Pages.Corpus.Doc.Annotation as D
--
import Gargantext.Pages.Corpus.Doc.Facets as TV
--
import Gargantext.Pages.Corpus.Doc.Annotation as D
import Gargantext.Pages.Corpus.Doc.Facets.Documents as DV
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.Home as L
import Gargantext.Pages.Layout.Specs.Search as S
--
import Gargantext.Pages.Home as L
--
import Gargantext.Pages.Layout.Specs.Search as S
import Gargantext.Router (Routes(..))
dispatchAction :: forall
t115 t445 t447
.
Bind t445 => Applicative t445
=>
(Action ->
t445 t447) -> t115 -> Routes -> t445
Unit
dispatchAction :: forall
ignored m
.
Monad m
=>
(Action ->
m Unit) -> ignored -> Routes -> m
Unit
dispatchAction dispatcher _ Home = do
_ <- dispatcher Initialize
_ <- dispatcher $ SetRoute Home
_ <- dispatcher $ LandingA L.NoOp
pure unit
dispatcher Initialize
dispatcher $ SetRoute Home
-- dispatcher $ LandingA TODO
dispatchAction dispatcher _ Login = do
_ <- dispatcher Initialize
_ <- dispatcher $ SetRoute Login
_ <- dispatcher $ LoginA LN.NoOp
pure unit
dispatcher Initialize
dispatcher $ SetRoute Login
-- dispatcher $ LoginA TODO
dispatchAction dispatcher _ AddCorpus = do
_ <- dispatcher $ SetRoute AddCorpus
_ <- dispatcher $ AddCorpusA AC.LoadDatabaseDetails
pure unit
dispatcher $ SetRoute AddCorpus
dispatcher $ AddCorpusA AC.LoadDatabaseDetails
dispatchAction dispatcher _ DocView = do
_ <- dispatcher $ SetRoute $ DocView
_ <- dispatcher $ DocViewA $ DV.LoadData
pure unit
dispatcher $ SetRoute DocView
dispatcher $ DocViewA $ DV.LoadData
dispatchAction dispatcher _ SearchView = do
_ <- dispatcher $ SetRoute $ SearchView
_ <- dispatcher $ SearchA $ S.NoOp
pure unit
dispatcher $ SetRoute SearchView
-- dispatcher $ SearchA TODO
dispatchAction dispatcher _ (UserPage id) = do
_ <- dispatcher $ SetRoute $ UserPage id
_ <- dispatcher $ UserPageA $ U.NoOp
_ <- dispatcher $ UserPageA $ U.FetchUser id
pure unit
dispatcher $ SetRoute $ UserPage id
-- dispatcher $ UserPageA TODO
dispatcher $ UserPageA $ U.FetchUser id
dispatchAction dispatcher _ (DocAnnotation i) = do
_ <- dispatcher $ SetRoute $ DocAnnotation i
_ <- dispatcher $ DocAnnotationViewA $ D.NoOp
pure unit
dispatcher $ SetRoute $ DocAnnotation i
-- dispatcher $ DocAnnotationViewA TODO
dispatchAction dispatcher _ Tabview = do
_ <- dispatcher $ SetRoute $ Tabview
_ <- dispatcher $ TabViewA $ TV.NoOp
pure unit
dispatcher $ SetRoute Tabview
-- dispatcher $ TabViewA TODO
dispatchAction dispatcher _ CorpusAnalysis = do
_ <- dispatcher $ SetRoute $ CorpusAnalysis
--_ <- dispatcher $ CorpusAnalysisA $ CA.NoOp
pure unit
dispatcher $ SetRoute CorpusAnalysis
-- dispatcher $ CorpusAnalysisA TODO
dispatchAction dispatcher _ PGraphExplorer = do
_ <- dispatcher $ SetRoute $ PGraphExplorer
_ <- dispatcher $ GraphExplorerA $ GE.LoadGraph "imtNew.json"
pure unit
dispatcher $ SetRoute PGraphExplorer
dispatcher $ GraphExplorerA $ GE.LoadGraph "imtNew.json"
dispatchAction dispatcher _ NGramsTable = do
_ <- dispatcher $ SetRoute $ NGramsTable
_ <- dispatcher $ NgramsA $ NG.NoOp
pure unit
dispatcher $ SetRoute NGramsTable
-- dispatcher $ NgramsA TODO
dispatchAction dispatcher _ Dashboard = do
_ <- dispatcher $ SetRoute $ Dashboard
pure unit
dispatcher $ SetRoute Dashboard
src/Gargantext/Pages/Layout/Actions.purs
View file @
e7366db6
...
...
@@ -96,8 +96,19 @@ performAction Initialize _ state = void do
_ -> do
modifyState identity
performAction _ _ _ = void do
modifyState identity
performAction (LandingA _) _ _ = pure unit
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)
import Thermite (PerformAction, modifyState)
data Action
= NoOp
| SelectDatabase Boolean
= SelectDatabase Boolean
| UnselectDatabase Boolean
| LoadDatabaseDetails
| GO
performAction :: PerformAction State {} Action
performAction NoOp _ _ = void do
modifyState identity
performAction (SelectDatabase selected) _ _ = void do
modifyState \( state) -> state { select_database = selected }
...
...
src/Gargantext/Pages/Layout/Specs/Search.purs
View file @
e7366db6
...
...
@@ -23,24 +23,17 @@ initialState =
data Action
= NoOp
| GO
= GO
| SetQuery String
performAction :: PerformAction State {} Action
performAction NoOp _ _ = void do
modifyState identity
performAction (SetQuery q) _ _ = void do
modifyState \( state) -> state { query = q }
performAction GO _ _ = void do
liftEffect $ setHash "/addCorpus"
modifyState identity
unsafeEventValue :: forall event. event -> String
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