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
50bd539c
Commit
50bd539c
authored
Jul 24, 2020
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[forest] fix rendering selected entries in tree, for multi backends
parent
ccaf9251
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
41 deletions
+36
-41
Forest.purs
src/Gargantext/Components/Forest.purs
+1
-1
Tree.purs
src/Gargantext/Components/Forest/Tree.purs
+9
-9
Node.purs
src/Gargantext/Components/Forest/Tree/Node.purs
+9
-30
Router.purs
src/Gargantext/Router.purs
+1
-0
Routes.purs
src/Gargantext/Routes.purs
+16
-1
No files found.
src/Gargantext/Components/Forest.purs
View file @
50bd539c
...
...
@@ -55,9 +55,9 @@ forestCpt = R.hooksComponent "G.C.Forest.forest" cpt where
, asyncTasks
, frontends
, mCurrentRoute: Just route
, session: s
, openNodes
, reload
, session: s
}
plus :: R2.Setter Boolean -> R.Element
...
...
src/Gargantext/Components/Forest/Tree.purs
View file @
50bd539c
...
...
@@ -59,20 +59,20 @@ treeView props = R.createElement treeViewCpt props []
treeViewCpt = R.hooksComponent "G.C.Tree.treeView" cpt
where
cpt { root
, mCurrentRoute
, session
, asyncTasks
, frontends
, mCurrentRoute
, openNodes
, reload
,
asyncTasks
,
session
} _children = pure
$ treeLoadView { root
, mCurrentRoute
, session
, asyncTasks
, frontends
, mCurrentRoute
, openNodes
, reload
,
asyncTasks
,
session
}
treeLoadView :: Record Props -> R.Element
...
...
@@ -83,11 +83,11 @@ treeLoadView p = R.createElement treeLoadViewCpt p []
where
cpt { root
, asyncTasks
, mCurrentRoute
, session
, frontends
, mCurrentRoute
, openNodes
, reload
, session
} _children = do
let fetch _ = getNodeTree session root
let paint loaded = loadedTreeView { asyncTasks
...
...
@@ -123,9 +123,9 @@ loadedTreeView p = R.createElement loadedTreeViewCpt p []
, mCurrentRoute
, openNodes
, reload
, session
, tasks
, tree
, session
} _ = pure $ H.ul { className: "tree"}
[ toHtml { asyncTasks
, frontends
...
...
src/Gargantext/Components/Forest/Tree/Node.purs
View file @
50bd539c
...
...
@@ -5,6 +5,11 @@ import Data.Nullable (null)
import Data.Tuple.Nested ((/\))
import Effect.Aff (Aff, launchAff)
import Effect.Class (liftEffect)
import React.SyntheticEvent as E
import Reactix as R
import Reactix.DOM.HTML as H
import Web.File.FileReader.Aff (readAsText)
import Gargantext.Components.Forest.Tree.Node.Settings (SettingsBox(..), settingsBox)
import Gargantext.Components.Forest.Tree.Node.Action (Action(..))
import Gargantext.Components.Forest.Tree.Node.Action.Upload.Types (FileType(..), UploadFileContents(..))
...
...
@@ -28,10 +33,6 @@ import Gargantext.Types (Name, ID)
import Gargantext.Types as GT
import Gargantext.Utils.Popover as Popover
import Gargantext.Utils.Reactix as R2
import React.SyntheticEvent as E
import Reactix as R
import Reactix.DOM.HTML as H
import Web.File.FileReader.Aff (readAsText)
-- Main Node
...
...
@@ -50,7 +51,7 @@ nodeMainSpan :: Record NodeMainSpanProps
-> R.Element
nodeMainSpan p@{ dispatch, folderOpen, frontends, session } = R.createElement el p []
where
el = R.hooksComponent "G.C.F.T.N.
B.
NodeMainSpan" cpt
el = R.hooksComponent "G.C.F.T.N.NodeMainSpan" cpt
cpt props@{id, mCurrentRoute, name, nodeType, tasks: { onTaskFinish, tasks }} _ = do
-- only 1 popup at a time is allowed to be opened
droppedFile <- R.useState' (Nothing :: Maybe DroppedFile)
...
...
@@ -71,16 +72,15 @@ nodeMainSpan p@{ dispatch, folderOpen, frontends, session } = R.createElement el
, mNodePopupView props (onPopoverClose popoverRef)
]
else H.div {} []
, H.a { href: (url frontends (GT.NodePath (sessionId session) nodeType (Just id)))
}
[ nodeText { isSelected: mAppRouteId mCurrentRoute == Just id
, H.a { href: url frontends $ GT.NodePath (sessionId session) nodeType (Just id) }
[ nodeText { isSelected: mCurrentRoute == Routes.nodeTypeAppRoute nodeType (sessionId session) id
, name: name' props
} ]
, nodeActions { id
, nodeType
, refreshTree: const $ dispatch RefreshTree
, session }
, fileTypeView {
dispatch, droppedFile, id, isDragOver, nodeType
}
, fileTypeView {
dispatch, droppedFile, id, isDragOver, nodeType
}
, H.div {} (map (\t -> asyncProgressBar { asyncTask: t
, barType: Pie
, corpusId: id
...
...
@@ -221,24 +221,3 @@ nodeActionsCpt = R.hooksComponent "G.C.F.T.N.B.nodeActions" cpt
-- END nodeActions
mAppRouteId :: Maybe Routes.AppRoute -> Maybe Int
mAppRouteId (Just (Routes.Folder _ id)) = Just id
mAppRouteId (Just (Routes.FolderPrivate _ id)) = Just id
mAppRouteId (Just (Routes.FolderPublic _ id)) = Just id
mAppRouteId (Just (Routes.FolderShared _ id)) = Just id
mAppRouteId (Just (Routes.Team _ id)) = Just id
mAppRouteId (Just (Routes.Corpus _ id)) = Just id
mAppRouteId (Just (Routes.PGraphExplorer _ id)) = Just id
mAppRouteId (Just (Routes.Dashboard _ id)) = Just id
mAppRouteId (Just (Routes.Texts _ id)) = Just id
mAppRouteId (Just (Routes.Lists _ id)) = Just id
mAppRouteId (Just (Routes.Annuaire _ id)) = Just id
mAppRouteId (Just (Routes.UserPage _ id)) = Just id
mAppRouteId (Just (Routes.RouteFrameWrite _ id)) = Just id
mAppRouteId (Just (Routes.RouteFrameCalc _ id)) = Just id
mAppRouteId (Just (Routes.Document _ id _ )) = Just id
mAppRouteId (Just (Routes.ContactPage _ id _ )) = Just id
mAppRouteId (Just (Routes.CorpusDocument _ id _ _)) = Just id
mAppRouteId _ = Nothing
src/Gargantext/Router.purs
View file @
50bd539c
...
...
@@ -4,6 +4,7 @@ import Prelude
import Data.Foldable (oneOf)
import Data.Int (floor)
import Routing.Match (Match, lit, num, str)
import Gargantext.Routes (AppRoute(..))
import Gargantext.Types (SessionId(..))
...
...
src/Gargantext/Routes.purs
View file @
50bd539c
...
...
@@ -2,8 +2,10 @@ module Gargantext.Routes where
import Prelude
import Data.Maybe (Maybe)
import Data.Maybe (Maybe(..))
import Gargantext.Types (ChartOpts, ChartType, CorpusMetricOpts, CTabNgramType, Id, Limit, ListId, NgramsGetOpts, NodeType, Offset, OrderBy, SearchOpts, SessionId, TabSubType, TabType, TermList, NgramsGetTableAllOpts)
import Gargantext.Types as GT
data AppRoute
= Home
...
...
@@ -95,3 +97,16 @@ appPath (ContactPage s a i) = "annuaire/" <> show s <> "/" <> show a <> "/con
appPath (RouteFrameWrite s i) = "write/" <> show s <> "/" <> show i
appPath (RouteFrameCalc s i) = "calc/" <> show s <> "/" <> show i
nodeTypeAppRoute :: NodeType -> SessionId -> Int -> Maybe AppRoute
nodeTypeAppRoute GT.Annuaire s i = Just $ Annuaire s i
nodeTypeAppRoute GT.NodeContact s i = Just $ Annuaire s i
nodeTypeAppRoute GT.Corpus s i = Just $ Corpus s i
nodeTypeAppRoute GT.Dashboard s i = Just $ Dashboard s i
nodeTypeAppRoute GT.Graph s i = Just $ PGraphExplorer s i
nodeTypeAppRoute GT.NodeList s i = Just $ Lists s i
nodeTypeAppRoute GT.FolderPrivate s i = Just $ FolderPrivate s i
nodeTypeAppRoute GT.FolderPublic s i = Just $ FolderPublic s i
nodeTypeAppRoute GT.FolderShared s i = Just $ FolderShared s i
nodeTypeAppRoute GT.NodeUser s i = Just $ UserPage s i
nodeTypeAppRoute GT.Texts s i = Just $ Texts s i
nodeTypeAppRoute _ _ _ = Nothing
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