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
e720ab50
Unverified
Commit
e720ab50
authored
Sep 17, 2018
by
Nicolas Pouillard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hide corpusState and tabviewState
parent
3dde046d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
60 deletions
+22
-60
Corpus.purs
src/Gargantext/Pages/Corpus.purs
+5
-15
Specs.purs
src/Gargantext/Pages/Corpus/Doc/Facets/Specs.purs
+12
-10
Actions.purs
src/Gargantext/Pages/Layout/Actions.purs
+0
-18
Specs.purs
src/Gargantext/Pages/Layout/Specs.purs
+5
-5
States.purs
src/Gargantext/Pages/Layout/States.purs
+0
-12
No files found.
src/Gargantext/Pages/Corpus.purs
View file @
e720ab50
...
@@ -2,7 +2,6 @@ module Gargantext.Pages.Corpus where
...
@@ -2,7 +2,6 @@ module Gargantext.Pages.Corpus where
import Prelude hiding (div)
import Prelude hiding (div)
import Data.Array (fold)
import Gargantext.Components.Charts.Options.ECharts (chart)
import Gargantext.Components.Charts.Options.ECharts (chart)
import Gargantext.Pages.Corpus.Doc.Facets.Dashboard (globalPublis)
import Gargantext.Pages.Corpus.Doc.Facets.Dashboard (globalPublis)
import Gargantext.Pages.Corpus.Doc.Facets as Tab
import Gargantext.Pages.Corpus.Doc.Facets as Tab
...
@@ -10,10 +9,6 @@ import React.DOM (div, h3, hr, i, p, text)
...
@@ -10,10 +9,6 @@ import React.DOM (div, h3, hr, i, p, text)
import React.DOM.Props (className, style)
import React.DOM.Props (className, style)
import Thermite (Render, Spec, defaultPerformAction, simpleSpec)
import Thermite (Render, Spec, defaultPerformAction, simpleSpec)
type State = Tab.State
type Action = Tab.Action
type Corpus = { title :: String
type Corpus = { title :: String
, desc :: String
, desc :: String
, query :: String
, query :: String
...
@@ -21,19 +16,14 @@ type Corpus = { title :: String
...
@@ -21,19 +16,14 @@ type Corpus = { title :: String
, authors :: String
, authors :: String
}
}
initialState :: State
spec' :: Spec {} {} Void
initialState = Tab.initialState
spec' = corpusSpec <> Tab.pureTab1
spec' :: Spec Tab.State {} Tab.Action
spec' = fold [ corpusSpec
, Tab.tab1
]
corpusSpec :: Spec
Tab.State {} Tab.Action
corpusSpec :: Spec
{} {} Void
corpusSpec = simpleSpec defaultPerformAction render
corpusSpec = simpleSpec defaultPerformAction render
where
where
render :: Render
Tab.State {} Tab.Action
render :: Render
{} {} Void
render
dispatch _ state
_ =
render
_ _ _
_ =
[ div [className "row"]
[ div [className "row"]
[ div [className "col-md-3"] [ h3 [] [text corpus.title] ]
[ div [className "col-md-3"] [ h3 [] [text corpus.title] ]
, div [className "col-md-9"] [ hr [style {height : "2px",backgroundColor : "black"}] ]
, div [className "col-md-9"] [ hr [style {height : "2px",backgroundColor : "black"}] ]
...
...
src/Gargantext/Pages/Corpus/Doc/Facets/Specs.purs
View file @
e720ab50
...
@@ -2,12 +2,11 @@ module Gargantext.Pages.Corpus.Doc.Facets.Specs where
...
@@ -2,12 +2,11 @@ module Gargantext.Pages.Corpus.Doc.Facets.Specs where
import Prelude hiding (div)
import Prelude hiding (div)
import Data.Lens (Lens', Prism', lens, prism)
import Data.List (fromFoldable)
import Data.List (fromFoldable)
import Data.Tuple (Tuple(..))
import Data.Tuple (Tuple(..))
import Gargantext.Pages.Corpus.Doc.Facets.States (State(
..), _doclens, _sourcelens, _authorlens, _termslens, _tablens
)
import Gargantext.Pages.Corpus.Doc.Facets.States (State(
), _doclens, _sourcelens, _authorlens, _termslens, _tablens, initialState
)
import Gargantext.Pages.Corpus.Doc.Facets.Actions (Action(
..
), _docAction, _sourceAction, _authorAction, _termsAction, _tabAction)
import Gargantext.Pages.Corpus.Doc.Facets.Actions (Action(), _docAction, _sourceAction, _authorAction, _termsAction, _tabAction)
import Gargantext.Pages.Corpus.Doc.Facets.Documents as DV
import Gargantext.Pages.Corpus.Doc.Facets.Documents as DV
import Gargantext.Pages.Corpus.Doc.Facets.Sources as SV
import Gargantext.Pages.Corpus.Doc.Facets.Sources as SV
...
@@ -15,16 +14,19 @@ import Gargantext.Pages.Corpus.Doc.Facets.Authors as AV
...
@@ -15,16 +14,19 @@ import Gargantext.Pages.Corpus.Doc.Facets.Authors as AV
import Gargantext.Pages.Corpus.Doc.Facets.Terms as TV
import Gargantext.Pages.Corpus.Doc.Facets.Terms as TV
import Gargantext.Components.Tab as Tab
import Gargantext.Components.Tab as Tab
import Thermite (Spec, focus)
import Thermite (Spec, focus
, hide
)
pureTab1 :: Spec {} {} Void
pureTab1 = hide initialState statefulTab1
tab1 :: Spec State {} Action
statefulTab1 :: Spec State {} Action
tab1 = Tab.tabs _tablens _tabAction $ fromFoldable [ Tuple "Doc View" docPageSpec
statefulTab1 =
, Tuple "Author View" authorPageSpec
Tab.tabs _tablens _tabAction $ fromFoldable [ Tuple "Doc View" docPageSpec
, Tuple "Source View" sourcePageSpec
, Tuple "Author View" authorPageSpec
, Tuple "Terms View" termsPageSpec
, Tuple "Source View" sourcePageSpec
]
, Tuple "Terms View" termsPageSpec
]
docPageSpec :: Spec State {} Action
docPageSpec :: Spec State {} Action
docPageSpec = focus _doclens _docAction DV.layoutDocview
docPageSpec = focus _doclens _docAction DV.layoutDocview
...
...
src/Gargantext/Pages/Layout/Actions.purs
View file @
e720ab50
...
@@ -10,9 +10,7 @@ import Effect.Console (log)
...
@@ -10,9 +10,7 @@ import Effect.Console (log)
import Gargantext.Components.Login as LN
import Gargantext.Components.Login as LN
import Gargantext.Components.Modals.Modal (modalShow)
import Gargantext.Components.Modals.Modal (modalShow)
import Gargantext.Components.Tree as Tree
import Gargantext.Components.Tree as Tree
import Gargantext.Pages.Corpus as CA
import Gargantext.Pages.Corpus.Doc.Annotation as D
import Gargantext.Pages.Corpus.Doc.Annotation as D
import Gargantext.Pages.Corpus.Doc.Facets as TV
import Gargantext.Pages.Corpus.Doc.Facets.Dashboard as Dsh
import Gargantext.Pages.Corpus.Doc.Facets.Dashboard as Dsh
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
...
@@ -37,12 +35,10 @@ data Action
...
@@ -37,12 +35,10 @@ data Action
| UserPageA U.Action
| UserPageA U.Action
| DocAnnotationViewA D.Action
| DocAnnotationViewA D.Action
| TreeViewA Tree.Action
| TreeViewA Tree.Action
| TabViewA TV.Action
| GraphExplorerA GE.Action
| GraphExplorerA GE.Action
| DashboardA Dsh.Action
| DashboardA Dsh.Action
| Search String
| Search String
| Go
| Go
| CorpusAnalysisA CA.Action
| ShowLogin
| ShowLogin
| ShowAddcorpus
| ShowAddcorpus
| NgramsA NG.Action
| NgramsA NG.Action
...
@@ -105,11 +101,9 @@ performAction (SearchA _) _ _ = pure unit
...
@@ -105,11 +101,9 @@ performAction (SearchA _) _ _ = pure unit
performAction (UserPageA _) _ _ = pure unit
performAction (UserPageA _) _ _ = pure unit
performAction (DocAnnotationViewA _) _ _ = pure unit
performAction (DocAnnotationViewA _) _ _ = pure unit
performAction (TreeViewA _) _ _ = pure unit
performAction (TreeViewA _) _ _ = pure unit
performAction (TabViewA _) _ _ = pure unit
performAction (GraphExplorerA _) _ _ = pure unit
performAction (GraphExplorerA _) _ _ = pure unit
performAction (DashboardA _) _ _ = pure unit
performAction (DashboardA _) _ _ = pure unit
performAction (NgramsA _) _ _ = pure unit
performAction (NgramsA _) _ _ = pure unit
performAction (CorpusAnalysisA _) _ _ = pure unit
----------------------------------------------------------
----------------------------------------------------------
...
@@ -167,18 +161,6 @@ _treeAction = prism TreeViewA \action ->
...
@@ -167,18 +161,6 @@ _treeAction = prism TreeViewA \action ->
TreeViewA caction -> Right caction
TreeViewA caction -> Right caction
_-> Left action
_-> Left action
_tabviewAction :: Prism' Action TV.Action
_tabviewAction = prism TabViewA \action ->
case action of
TabViewA caction -> Right caction
_-> Left action
_corpusAction :: Prism' Action CA.Action
_corpusAction = prism CorpusAnalysisA \action ->
case action of
CorpusAnalysisA caction -> Right caction
_-> Left action
_graphExplorerAction :: Prism' Action GE.Action
_graphExplorerAction :: Prism' Action GE.Action
_graphExplorerAction = prism GraphExplorerA \action ->
_graphExplorerAction = prism GraphExplorerA \action ->
case action of
case action of
...
...
src/Gargantext/Pages/Layout/Specs.purs
View file @
e720ab50
...
@@ -18,15 +18,15 @@ import Gargantext.Pages.Corpus.Doc.Facets.Graph as GE
...
@@ -18,15 +18,15 @@ 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.Actions (Action(..), _LandingA, _NgramsA, _addCorpusAction, _
corpusAction, _dashBoardAction, _docAnnotationViewAction, _docViewAction, _graphExplorerAction, _loginAction, _searchAction, _tabview
Action, _treeAction, _userPageAction, performAction)
import Gargantext.Pages.Layout.Actions (Action(..), _LandingA, _NgramsA, _addCorpusAction, _
dashBoardAction, _docAnnotationViewAction, _docViewAction, _graphExplorerAction, _loginAction, _search
Action, _treeAction, _userPageAction, performAction)
import Gargantext.Pages.Layout.Specs.AddCorpus as AC
import Gargantext.Pages.Layout.Specs.AddCorpus as AC
import Gargantext.Pages.Layout.Specs.Search as S
import Gargantext.Pages.Layout.Specs.Search as S
import Gargantext.Pages.Layout.States (AppState, _addCorpusState, _
corpusState, _dashBoardSate, _docAnnotationViewState, _docViewState, _graphExplorerState, _landingState, _loginState, _ngramState, _searchState, _tabview
State, _treeState, _userPageState)
import Gargantext.Pages.Layout.States (AppState, _addCorpusState, _
dashBoardSate, _docAnnotationViewState, _docViewState, _graphExplorerState, _landingState, _loginState, _ngramState, _search
State, _treeState, _userPageState)
import Gargantext.Router (Routes(..))
import Gargantext.Router (Routes(..))
import React (ReactElement)
import React (ReactElement)
import React.DOM (a, button, div, footer, hr', img, input, li, p, span, text, ul)
import React.DOM (a, button, div, footer, hr', img, input, li, p, span, text, ul)
import React.DOM.Props (_data, _id, _type, aria, className, href, onChange, onClick, placeholder, role, src, style, tabIndex, target, title)
import React.DOM.Props (_data, _id, _type, aria, className, href, onChange, onClick, placeholder, role, src, style, tabIndex, target, title)
import Thermite (Render, Spec, _render, defaultPerformAction, defaultRender, focus, simpleSpec, withState)
import Thermite (Render, Spec, _render, defaultPerformAction, defaultRender, focus, simpleSpec, withState
, noState
)
import Unsafe.Coerce (unsafeCoerce)
import Unsafe.Coerce (unsafeCoerce)
layoutSpec :: Spec AppState {} Action
layoutSpec :: Spec AppState {} Action
...
@@ -53,14 +53,14 @@ pagesComponent s =
...
@@ -53,14 +53,14 @@ pagesComponent s =
Nothing -> selectSpec Home
Nothing -> selectSpec Home
where
where
selectSpec :: Routes -> Spec AppState {} Action
selectSpec :: Routes -> Spec AppState {} Action
selectSpec CorpusAnalysis = layout0 $
focus _corpusState _corpusAction
CA.spec'
selectSpec CorpusAnalysis = layout0 $
noState
CA.spec'
selectSpec Login = focus _loginState _loginAction LN.renderSpec
selectSpec Login = focus _loginState _loginAction LN.renderSpec
selectSpec Home = layout0 $ focus _landingState _LandingA (L.layoutLanding EN)
selectSpec Home = layout0 $ focus _landingState _LandingA (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 i) = 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.t
ab1
selectSpec Tabview = layout0 $
noState TV.pureT
ab1
-- To be removed
-- To be removed
selectSpec SearchView = layout0 $ focus _searchState _searchAction S.searchSpec
selectSpec SearchView = layout0 $ focus _searchState _searchAction S.searchSpec
selectSpec NGramsTable = layout0 $ focus _ngramState _NgramsA NG.ngramsTableSpec
selectSpec NGramsTable = layout0 $ focus _ngramState _NgramsA NG.ngramsTableSpec
...
...
src/Gargantext/Pages/Layout/States.purs
View file @
e720ab50
...
@@ -6,9 +6,7 @@ import Data.Lens (Lens', lens)
...
@@ -6,9 +6,7 @@ import Data.Lens (Lens', lens)
import Data.Maybe (Maybe(Just))
import Data.Maybe (Maybe(Just))
import Gargantext.Components.Login as LN
import Gargantext.Components.Login as LN
import Gargantext.Components.Tree as Tree
import Gargantext.Components.Tree as Tree
import Gargantext.Pages.Corpus as CA
import Gargantext.Pages.Corpus.Doc.Annotation as D
import Gargantext.Pages.Corpus.Doc.Annotation as D
import Gargantext.Pages.Corpus.Doc.Facets as TV
import Gargantext.Pages.Corpus.Doc.Facets.Dashboard as Dsh
import Gargantext.Pages.Corpus.Doc.Facets.Dashboard as Dsh
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
...
@@ -29,9 +27,7 @@ type AppState =
...
@@ -29,9 +27,7 @@ type AppState =
, userPageState :: U.State
, userPageState :: U.State
, docAnnotationState :: D.State
, docAnnotationState :: D.State
, ntreeState :: Tree.State
, ntreeState :: Tree.State
, tabviewState :: TV.State
, search :: String
, search :: String
, corpusState :: CA.State
, showLogin :: Boolean
, showLogin :: Boolean
, showCorpus :: Boolean
, showCorpus :: Boolean
, graphExplorerState :: GE.State
, graphExplorerState :: GE.State
...
@@ -51,9 +47,7 @@ initAppState =
...
@@ -51,9 +47,7 @@ initAppState =
, userPageState : U.initialState
, userPageState : U.initialState
, docAnnotationState : D.initialState
, docAnnotationState : D.initialState
, ntreeState : Tree.exampleTree
, ntreeState : Tree.exampleTree
, tabviewState : TV.initialState
, search : ""
, search : ""
, corpusState : CA.initialState
, showLogin : false
, showLogin : false
, showCorpus : false
, showCorpus : false
, graphExplorerState : GE.initialState
, graphExplorerState : GE.initialState
...
@@ -87,12 +81,6 @@ _docAnnotationViewState = lens (\s -> s.docAnnotationState) (\s ss -> s{docAnnot
...
@@ -87,12 +81,6 @@ _docAnnotationViewState = lens (\s -> s.docAnnotationState) (\s ss -> s{docAnnot
_treeState :: Lens' AppState Tree.State
_treeState :: Lens' AppState Tree.State
_treeState = lens (\s -> s.ntreeState) (\s ss -> s {ntreeState = ss})
_treeState = lens (\s -> s.ntreeState) (\s ss -> s {ntreeState = ss})
_tabviewState :: Lens' AppState TV.State
_tabviewState = lens (\s -> s.tabviewState) (\s ss -> s {tabviewState = ss})
_corpusState :: Lens' AppState CA.State
_corpusState = lens (\s -> s.corpusState) (\s ss -> s {corpusState = ss})
_dashBoardSate :: Lens' AppState Dsh.State
_dashBoardSate :: Lens' AppState Dsh.State
_dashBoardSate = lens (\s -> s.dashboardState) (\s ss -> s {dashboardState = ss})
_dashBoardSate = lens (\s -> s.dashboardState) (\s ss -> s {dashboardState = ss})
...
...
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