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
Hide 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
module Gargantext.Components.GraphExplorer.Sidebar
(Props, sidebar)
--
(Props, sidebar)
where
where
import Control.Parallel (parTraverse)
import Control.Parallel (parTraverse)
...
@@ -89,43 +89,19 @@ sideTab (Opened SideTabLegend) props@{metaData} =
...
@@ -89,43 +89,19 @@ sideTab (Opened SideTabLegend) props@{metaData} =
in Legend.legend { items: Seq.fromFoldable legend}
in Legend.legend { items: Seq.fromFoldable legend}
sideTab (Opened SideTabData) props =
sideTab (Opened SideTabData) props =
RH.div {} [ R2.row [ R2.col 12
RH.div {} [ selectedNodes props (SigmaxT.nodesGraphMap props.graph)
[ RH.ul { id: "myTab", className: "nav nav-tabs", role: "tablist"}
, neighborhood props
[ RH.div { className: "tab-content" }
[ RH.div { className: "", role: "tabpanel" }
( Seq.toUnfoldable
$ ( Seq.map (badge props.selectedNodeIds)
(badges props.graph props.selectedNodeIds)
)
)
]
, RH.div { className: "tab-content flex-space-between" }
[ removeButton "Move as candidate" CandidateTerm props nodesMap
, removeButton "Move as stop" StopTerm props nodesMap
]
]
]
]
, 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" }
, RH.div { className: "col-md-12", id: "query" }
[ query SearchDoc
[ query SearchDoc
props.frontends
props.frontends
props.metaData
props.metaData
props.session
props.session
nodesMap
(SigmaxT.nodesGraphMap props.graph)
props.selectedNodeIds
props.selectedNodeIds
]
]
]
]
where
where
nodesMap = SigmaxT.nodesGraphMap props.graph
checkbox text =
checkbox text =
RH.li {}
RH.li {}
[ RH.span {} [ RH.text text ]
[ RH.span {} [ RH.text text ]
...
@@ -134,31 +110,12 @@ sideTab (Opened SideTabData) props =
...
@@ -134,31 +110,12 @@ sideTab (Opened SideTabData) props =
, checked: true
, checked: true
, title: "Mark as completed" } ]
, title: "Mark as completed" } ]
removeButton text rType props' nodesMap' =
if Set.isEmpty $ fst props'.selectedNodeIds then
RH.div {} []
else
RH.button { className: "btn btn-info"
, on: { click: onClickRemove rType props' nodesMap' }
}
[ RH.text text ]
onClickRemove rType props' nodesMap' e = do
let nodes = mapMaybe (\id -> Map.lookup id nodesMap')
$ Set.toUnfoldable $ fst props'.selectedNodeIds
deleteNodes { graphId: props'.graphId
, metaData: props'.metaData
, nodes
, session: props'.session
, termList: rType
, treeReload: props'.treeReload }
snd props'.removedNodeIds $ const $ fst props'.selectedNodeIds
snd props'.selectedNodeIds $ const SigmaxT.emptyNodeIds
sideTab (Opened SideTabCommunity) props =
sideTab (Opened SideTabCommunity) props =
RH.div { className: "col-md-12", id: "query" }
RH.div { className: "col-md-12", id: "query" }
[ query SearchContact
[ selectedNodes props (SigmaxT.nodesGraphMap props.graph)
, neighborhood props
, query SearchContact
props.frontends
props.frontends
props.metaData
props.metaData
props.session
props.session
...
@@ -170,6 +127,56 @@ sideTab _ _ = H.div {} []
...
@@ -170,6 +127,56 @@ 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" }
( Seq.toUnfoldable
$ ( Seq.map (badge props.selectedNodeIds)
(badges props.graph props.selectedNodeIds)
)
)
]
, RH.div { className: "tab-content flex-space-between" }
[ removeButton "Move as candidate" CandidateTerm props nodesMap
, removeButton "Move as stop" StopTerm props nodesMap
]
]
]
]
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
)
]
removeButton text rType props' nodesMap' =
if Set.isEmpty $ fst props'.selectedNodeIds then
RH.div {} []
else
RH.button { className: "btn btn-info"
, on: { click: onClickRemove rType props' nodesMap' }
}
[ RH.text text ]
onClickRemove rType props' nodesMap' e = do
let nodes = mapMaybe (\id -> Map.lookup id nodesMap')
$ Set.toUnfoldable $ fst props'.selectedNodeIds
deleteNodes { graphId: props'.graphId
, metaData: props'.metaData
, nodes
, session: props'.session
, termList: rType
, treeReload: props'.treeReload }
snd props'.removedNodeIds $ const $ fst props'.selectedNodeIds
snd props'.selectedNodeIds $ const SigmaxT.emptyNodeIds
badge :: R.State SigmaxT.NodeIds -> Record SigmaxT.Node -> R.Element
badge :: R.State SigmaxT.NodeIds -> Record SigmaxT.Node -> R.Element
badge (_ /\ setNodeIds) {id, label} =
badge (_ /\ setNodeIds) {id, label} =
RH.a { className: "badge badge-light"
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