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
da6e6797
Commit
da6e6797
authored
Sep 15, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] GraphExplorer: adding selected nodes to community query tab
parent
7d4da0dd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
51 deletions
+58
-51
Sidebar.purs
src/Gargantext/Components/GraphExplorer/Sidebar.purs
+58
-51
No files found.
src/Gargantext/Components/GraphExplorer/Sidebar.purs
View file @
da6e6797
module Gargantext.Components.GraphExplorer.Sidebar
(Props, sidebar)
--
(Props, sidebar)
where
import Control.Parallel (parTraverse)
...
...
@@ -89,7 +89,47 @@ sideTab (Opened SideTabLegend) props@{metaData} =
in Legend.legend { items: Seq.fromFoldable legend}
sideTab (Opened SideTabData) props =
RH.div {} [ R2.row [ R2.col 12
RH.div {} [ selectedNodes props (SigmaxT.nodesGraphMap props.graph)
, neighborhood props
, RH.div { className: "col-md-12", id: "query" }
[ query SearchDoc
props.frontends
props.metaData
props.session
(SigmaxT.nodesGraphMap props.graph)
props.selectedNodeIds
]
]
where
checkbox text =
RH.li {}
[ RH.span {} [ RH.text text ]
, RH.input { type: "checkbox"
, className: "checkbox"
, checked: true
, title: "Mark as completed" } ]
sideTab (Opened SideTabCommunity) props =
RH.div { className: "col-md-12", id: "query" }
[ selectedNodes props (SigmaxT.nodesGraphMap props.graph)
, neighborhood props
, query SearchContact
props.frontends
props.metaData
props.session
(SigmaxT.nodesGraphMap props.graph)
props.selectedNodeIds
]
sideTab _ _ = H.div {} []
-------------------------------------------
-- TODO
-- selectedNodes :: Record Props -> Map.Map String Nodes -> R.Element
selectedNodes props nodesMap = R2.row [ R2.col 12
[ RH.ul { id: "myTab", className: "nav nav-tabs", role: "tablist"}
[ RH.div { className: "tab-content" }
[ RH.div { className: "", role: "tabpanel" }
...
...
@@ -106,35 +146,15 @@ sideTab (Opened SideTabData) props =
]
]
]
,
RH.div { className: "tab-content", id: "myTabContent" }
neighborhood props =
RH.div { className: "tab-content", id: "myTabContent" }
[ RH.div { className: "", id: "home", role: "tabpanel" }
(Seq.toUnfoldable $ Seq.map (badge props.selectedNodeIds)
$ neighbourBadges props.graph props.selectedNodeIds
)
]
, RH.div { className: "col-md-12", id: "query" }
[ query SearchDoc
props.frontends
props.metaData
props.session
nodesMap
props.selectedNodeIds
]
]
where
nodesMap = SigmaxT.nodesGraphMap props.graph
checkbox text =
RH.li {}
[ RH.span {} [ RH.text text ]
, RH.input { type: "checkbox"
, className: "checkbox"
, checked: true
, title: "Mark as completed" } ]
removeButton text rType props' nodesMap' =
removeButton text rType props' nodesMap' =
if Set.isEmpty $ fst props'.selectedNodeIds then
RH.div {} []
else
...
...
@@ -143,7 +163,7 @@ sideTab (Opened SideTabData) props =
}
[ RH.text text ]
onClickRemove rType props' nodesMap' e = do
onClickRemove rType props' nodesMap' e = do
let nodes = mapMaybe (\id -> Map.lookup id nodesMap')
$ Set.toUnfoldable $ fst props'.selectedNodeIds
deleteNodes { graphId: props'.graphId
...
...
@@ -156,20 +176,7 @@ sideTab (Opened SideTabData) props =
snd props'.selectedNodeIds $ const SigmaxT.emptyNodeIds
sideTab (Opened SideTabCommunity) props =
RH.div { className: "col-md-12", id: "query" }
[ query SearchContact
props.frontends
props.metaData
props.session
(SigmaxT.nodesGraphMap props.graph)
props.selectedNodeIds
]
sideTab _ _ = H.div {} []
-------------------------------------------
badge :: R.State SigmaxT.NodeIds -> Record SigmaxT.Node -> R.Element
badge (_ /\ setNodeIds) {id, label} =
RH.a { className: "badge badge-light"
...
...
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