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
1
Merge Requests
1
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
Przemyslaw Kaminski
purescript-gargantext
Commits
b04fd6a8
Commit
b04fd6a8
authored
Jul 30, 2019
by
Przemyslaw Kaminski
Committed by
James Laver
Sep 20, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TEMP: endConfig work
parent
d2018b69
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
3 deletions
+13
-3
Tree.purs
src/Gargantext/Components/Tree.purs
+2
-2
Specs.purs
src/Gargantext/Pages/Layout/Specs.purs
+7
-1
States.purs
src/Gargantext/Pages/Layout/States.purs
+4
-0
No files found.
src/Gargantext/Components/Tree.purs
View file @
b04fd6a8
...
@@ -20,7 +20,7 @@ import Partial.Unsafe (unsafePartial)
...
@@ -20,7 +20,7 @@ import Partial.Unsafe (unsafePartial)
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 Web.File.File (toBlob)
import Web.File.File (toBlob)
...
@@ -30,6 +30,7 @@ import Web.File.FileReader.Aff (readAsText)
...
@@ -30,6 +30,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)
...
@@ -180,7 +181,6 @@ elTreeview props = R.createElement el props []
...
@@ -180,7 +181,6 @@ elTreeview props = R.createElement el props []
treeview :: Spec {} Props Void
treeview :: Spec {} Props Void
treeview = R2.elSpec $ R.hooksComponent "TreeView" treeviewCpt
treeview = R2.elSpec $ R.hooksComponent "TreeView" treeviewCpt
treeviewCpt {root, mCurrentRoute} _children = do
treeviewCpt {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/Layout/Specs.purs
View file @
b04fd6a8
...
@@ -28,10 +28,14 @@ import Gargantext.Pages.Texts as Texts
...
@@ -28,10 +28,14 @@ import Gargantext.Pages.Texts as Texts
import Gargantext.Pages.Home as L
import Gargantext.Pages.Home as L
import Gargantext.Pages.Layout.Actions (Action(..), _graphExplorerAction, _loginAction, performAction)
import Gargantext.Pages.Layout.Actions (Action(..), _graphExplorerAction, _loginAction, performAction)
import Gargantext.Pages.Layout.Specs.SearchBar as SB
import Gargantext.Pages.Layout.Specs.SearchBar as SB
import Gargantext.Pages.Layout.States (AppState, _
loginState, _graphExplorer
State)
import Gargantext.Pages.Layout.States (AppState, _
graphExplorerState, _searchState, _loginState, _addCorpus
State)
import Gargantext.Router (Routes(..))
import Gargantext.Router (Routes(..))
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Reactix as R2
-- 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
...
@@ -101,6 +105,7 @@ layout0 layout =
...
@@ -101,6 +105,7 @@ layout0 layout =
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}) $ noState $ Tree.treeview
ls $ cmapProps (const {root: tree_id, mCurrentRoute: st.currentRoute}) $ noState $ Tree.treeview
ls $ cmapProps (const {root: tree_id, mCurrentRoute: st.currentRoute}) $ Tree.treeview
Nothing ->
Nothing ->
outerLayout1
outerLayout1
, rs bs
, rs bs
...
@@ -117,6 +122,7 @@ layout0 layout =
...
@@ -117,6 +122,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
bs = innerLayout $ layout
bs = innerLayout $ layout
innerLayout :: Spec AppState {} Action
innerLayout :: Spec AppState {} Action
...
...
src/Gargantext/Pages/Layout/States.purs
View file @
b04fd6a8
...
@@ -5,6 +5,8 @@ import Prelude hiding (div)
...
@@ -5,6 +5,8 @@ import Prelude hiding (div)
import Data.Lens (Lens', lens)
import Data.Lens (Lens', lens)
import Data.Maybe (Maybe(..))
import Data.Maybe (Maybe(..))
import Effect (Effect)
import Effect (Effect)
import Gargantext.Components.Login as LN
import Gargantext.Config (EndConfig, endConfigStateful)
import Gargantext.Components.Login as LN
import Gargantext.Components.Login as LN
--import Gargantext.Components.Login.Types as LNT
--import Gargantext.Components.Login.Types as LNT
...
@@ -19,6 +21,7 @@ type AppState =
...
@@ -19,6 +21,7 @@ type AppState =
, showCorpus :: Boolean
, showCorpus :: Boolean
--, graphExplorerState :: Record GET.StateGlue
--, graphExplorerState :: Record GET.StateGlue
, showTree :: Boolean
, showTree :: Boolean
, endConfig :: EndConfig
}
}
initAppState :: Effect AppState
initAppState :: Effect AppState
...
@@ -32,6 +35,7 @@ initAppState = do
...
@@ -32,6 +35,7 @@ initAppState = do
, showCorpus : false
, showCorpus : false
--, graphExplorerState : GET.initialStateGlue
--, graphExplorerState : GET.initialStateGlue
, 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