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
131
Issues
131
List
Board
Labels
Milestones
Merge Requests
3
Merge Requests
3
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
d179d061
Commit
d179d061
authored
Jul 30, 2019
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TEMP: endConfig work
parent
2d2e2b7b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
11 deletions
+21
-11
Tree.purs
src/Gargantext/Components/Tree.purs
+7
-3
Graph.purs
src/Gargantext/Pages/Corpus/Graph.purs
+3
-2
Specs.purs
src/Gargantext/Pages/Layout/Specs.purs
+8
-6
States.purs
src/Gargantext/Pages/Layout/States.purs
+3
-0
No files found.
src/Gargantext/Components/Tree.purs
View file @
d179d061
...
@@ -26,7 +26,7 @@ import React.DOM.Props (className, style)
...
@@ -26,7 +26,7 @@ import React.DOM.Props (className, style)
import React.SyntheticEvent as E
import React.SyntheticEvent as E
import Reactix as R
import Reactix as R
import Reactix.DOM.HTML as H
import Reactix.DOM.HTML as H
import Thermite
(Spec)
import Thermite
as T
import URI.Extra.QueryPairs as QP
import URI.Extra.QueryPairs as QP
import URI.Query as Q
import URI.Query as Q
import Unsafe.Coerce (unsafeCoerce)
import Unsafe.Coerce (unsafeCoerce)
...
@@ -37,6 +37,7 @@ import Web.File.FileReader.Aff (readAsText)
...
@@ -37,6 +37,7 @@ import Web.File.FileReader.Aff (readAsText)
import Gargantext.Components.Loader2 (useLoader)
import Gargantext.Components.Loader2 (useLoader)
import Gargantext.Config (toUrl, endConfigStateful, End(..), NodeType(..), readNodeType)
import Gargantext.Config (toUrl, endConfigStateful, End(..), NodeType(..), readNodeType)
import Gargantext.Config.REST (get, put, post, postWwwUrlencoded, delete)
import Gargantext.Config.REST (get, put, post, postWwwUrlencoded, delete)
import Gargantext.Pages.Layout.States (AppState)
import Gargantext.Router as Router
import Gargantext.Router as Router
import Gargantext.Types (class ToQuery, toQuery)
import Gargantext.Types (class ToQuery, toQuery)
import Gargantext.Utils (id)
import Gargantext.Utils (id)
...
@@ -178,9 +179,12 @@ treeLoadView setReload p = R.createElement el p []
...
@@ -178,9 +179,12 @@ treeLoadView setReload p = R.createElement el p []
useLoader root loadNode $ \{loaded} ->
useLoader root loadNode $ \{loaded} ->
loadedTreeView setReload {tree: loaded, mCurrentRoute}
loadedTreeView setReload {tree: loaded, mCurrentRoute}
treeview :: Spec {} Props Void
treeview :: T.Spec AppState Props Void
treeview = R2.elSpec $ R.hooksComponent "TreeView" cpt
--treeview = R2.elSpec $ R.hooksComponent "TreeView" cpt
treeview = T.simpleSpec T.defaultPerformAction render
where
where
render :: T.Render AppState Props Void
render _ props _ children = [R2.scuff $ R.createElement (R.hooksComponent "TreeView" cpt) props (R2.buff <$> children)]
cpt {root, mCurrentRoute} _children = do
cpt {root, mCurrentRoute} _children = do
-- NOTE: this is a hack to reload the tree view on demand
-- NOTE: this is a hack to reload the tree view on demand
setReload <- R.useState' 0
setReload <- R.useState' 0
...
...
src/Gargantext/Pages/Corpus/Graph.purs
View file @
d179d061
...
@@ -23,7 +23,7 @@ import Gargantext.Components.GraphExplorer.Sigmajs (Color(Color), SigmaEasing, S
...
@@ -23,7 +23,7 @@ import Gargantext.Components.GraphExplorer.Sigmajs (Color(Color), SigmaEasing, S
import Gargantext.Components.GraphExplorer.Types (Cluster(..), MetaData(..), Edge(..), GraphData(..), Legend(..), Node(..), getLegendData)
import Gargantext.Components.GraphExplorer.Types (Cluster(..), MetaData(..), Edge(..), GraphData(..), Legend(..), Node(..), getLegendData)
import Gargantext.Components.Login.Types (AuthData(..), TreeId)
import Gargantext.Components.Login.Types (AuthData(..), TreeId)
import Gargantext.Components.RandomText (words)
import Gargantext.Components.RandomText (words)
import Gargantext.Components.Tree as Tree
--
import Gargantext.Components.Tree as Tree
import Gargantext.Config as Config
import Gargantext.Config as Config
import Gargantext.Config.REST (get)
import Gargantext.Config.REST (get)
import Gargantext.Pages.Corpus.Graph.Tabs as GT
import Gargantext.Pages.Corpus.Graph.Tabs as GT
...
@@ -419,7 +419,8 @@ specOld = fold [treespec treeSpec, graphspec $ simpleSpec performAction render']
...
@@ -419,7 +419,8 @@ specOld = fold [treespec treeSpec, graphspec $ simpleSpec performAction render']
Nothing ->
Nothing ->
simpleSpec defaultPerformAction defaultRender
simpleSpec defaultPerformAction defaultRender
Just treeId ->
Just treeId ->
(cmapProps (const {root: treeId, mCurrentRoute: Nothing}) (noState Tree.treeview))
simpleSpec defaultPerformAction defaultRender
--cmapProps (const {root: treeId, mCurrentRoute: Nothing}) (noState $ Tree.treeview Config.endConfigStateful)
render' :: Render State {} Action
render' :: Render State {} Action
...
...
src/Gargantext/Pages/Layout/Specs.purs
View file @
d179d061
...
@@ -29,10 +29,14 @@ import Gargantext.Pages.Layout.Actions (Action(..), _addCorpusAction, _graphExpl
...
@@ -29,10 +29,14 @@ import Gargantext.Pages.Layout.Actions (Action(..), _addCorpusAction, _graphExpl
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.Specs.SearchBar as SB
import Gargantext.Pages.Layout.Specs.SearchBar as SB
import Gargantext.Pages.Layout.States (AppState, _
addCorpusState, _graphExplorerState, _loginState, _search
State)
import Gargantext.Pages.Layout.States (AppState, _
graphExplorerState, _searchState, _loginState, _addCorpus
State)
import Gargantext.Router (Routes(..))
import Gargantext.Router (Routes(..))
import Gargantext.Utils.Reactix (scuff)
import Gargantext.Utils.Reactix (scuff)
-- TODO
-- rewrite layoutSpec to use state (with EndConfig)
-- tree changes endConfig state => trigger endConfig change in outerLayout, layoutFooter etc
layoutSpec :: Spec AppState {} Action
layoutSpec :: Spec AppState {} Action
layoutSpec =
layoutSpec =
fold
fold
...
@@ -94,7 +98,7 @@ layout0 layout =
...
@@ -94,7 +98,7 @@ layout0 layout =
withState \st ->
withState \st ->
case st.loginState.authData of
case st.loginState.authData of
Just (AuthData {tree_id}) ->
Just (AuthData {tree_id}) ->
ls $ cmapProps (const {root: tree_id, mCurrentRoute: st.currentRoute})
as
ls $ cmapProps (const {root: tree_id, mCurrentRoute: st.currentRoute})
$ Tree.treeview
Nothing ->
Nothing ->
outerLayout1
outerLayout1
, rs bs
, rs bs
...
@@ -111,7 +115,7 @@ layout0 layout =
...
@@ -111,7 +115,7 @@ layout0 layout =
] (render d p s c) ]
] (render d p s c) ]
cont = over _render \render d p s c -> [ div [className "row" ] (render d p s c) ]
cont = over _render \render d p s c -> [ div [className "row" ] (render d p s c) ]
as = noState Tree.treeview
--
as = noState Tree.treeview
bs = innerLayout $ layout
bs = innerLayout $ layout
...
@@ -142,7 +146,7 @@ layout1 layout =
...
@@ -142,7 +146,7 @@ layout1 layout =
[ withState \st ->
[ withState \st ->
case st.loginState.authData of
case st.loginState.authData of
Just (AuthData {tree_id}) ->
Just (AuthData {tree_id}) ->
ls $ cmapProps (const {root: tree_id, mCurrentRoute: st.currentRoute})
as
ls $ cmapProps (const {root: tree_id, mCurrentRoute: st.currentRoute})
$ Tree.treeview
Nothing ->
Nothing ->
outerLayout1
outerLayout1
, rs bs
, rs bs
...
@@ -156,8 +160,6 @@ layout1 layout =
...
@@ -156,8 +160,6 @@ layout1 layout =
rs = over _render \render d p s c -> [ div [if (s.showTree) then className "col-md-10" else className "col-md-12"] (render d p s c) ]
rs = over _render \render d p s c -> [ div [if (s.showTree) then className "col-md-10" else className "col-md-12"] (render d p s c) ]
cont = over _render \render d p s c -> [ div [className "row" ] (render d p s c) ]
cont = over _render \render d p s c -> [ div [className "row" ] (render d p s c) ]
as = noState Tree.treeview
bs = innerLayout $ layout
bs = innerLayout $ layout
innerLayout :: Spec AppState {} Action
innerLayout :: Spec AppState {} Action
...
...
src/Gargantext/Pages/Layout/States.purs
View file @
d179d061
...
@@ -6,6 +6,7 @@ import Data.Lens (Lens', lens)
...
@@ -6,6 +6,7 @@ import Data.Lens (Lens', lens)
import Data.Maybe (Maybe(Just))
import Data.Maybe (Maybe(Just))
import Effect (Effect)
import Effect (Effect)
import Gargantext.Components.Login as LN
import Gargantext.Components.Login as LN
import Gargantext.Config (EndConfig, endConfigStateful)
import Gargantext.Pages.Corpus.Graph as GE
import Gargantext.Pages.Corpus.Graph as GE
import Gargantext.Pages.Layout.Specs.AddCorpus as AC
import Gargantext.Pages.Layout.Specs.AddCorpus as AC
...
@@ -21,6 +22,7 @@ type AppState =
...
@@ -21,6 +22,7 @@ type AppState =
, showCorpus :: Boolean
, showCorpus :: Boolean
, graphExplorerState :: GE.State
, graphExplorerState :: GE.State
, showTree :: Boolean
, showTree :: Boolean
, endConfig :: EndConfig
}
}
initAppState :: Effect AppState
initAppState :: Effect AppState
...
@@ -35,6 +37,7 @@ initAppState = do
...
@@ -35,6 +37,7 @@ initAppState = do
, showCorpus : false
, showCorpus : false
, graphExplorerState : GE.initialState
, graphExplorerState : GE.initialState
, showTree : false
, showTree : false
, endConfig : endConfigStateful
}
}
...
...
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