Commit 325b9b41 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[Tree] Download Graph.gexf in Tree (next refacto).

parent 53df92e1
......@@ -385,7 +385,9 @@ nodePopupCpt = R.hooksComponent "G.C.F.T.N.B.nodePopupView" cpt
]
editIcon (true /\ _) = H.div {} []
panelBody :: R.State (Record ActionState) -> Record NodePopupProps -> R.Element
panelBody :: R.State (Record ActionState)
-> Record NodePopupProps
-> R.Element
panelBody nodePopupState {dispatch: d, nodeType} =
H.div {className: "panel-body flex-space-between"}
[ H.div {className: "flex-center"} [buttonClick {action: doc, state: nodePopupState}]
......@@ -533,6 +535,16 @@ panelActionCpt = R.hooksComponent "G.C.F.T.N.B.panelAction" cpt
, target: "_blank" } [ H.text "Download file" ]
]
]
cpt {action: Download, id, nodeType: GT.Graph, session} _ = do
pure $ R.fragment [ H.div { className: "gexf" } [
H.a { className: "btn btn-default"
, href: url session $ Routes.NodeAPI GT.Graph (Just id) "gexf"
, target: "_blank" } [ H.text "Download GEXF" ]
]
]
cpt {action: Download} _ = do
pure $ fragmentPT "Soon, you will be able to dowload your file here"
cpt props@{action: SearchBox, search, session} _ = do
......
......@@ -69,11 +69,6 @@ sidebarCpt = R.hooksComponent "Sidebar" cpt
[ RH.div { className: "", role: "tabpanel" }
(Seq.toUnfoldable $ (Seq.map (badge props.selectedNodeIds) (badges props.graph props.selectedNodeIds)))
]
, RH.div { className: "gexf" } [
RH.a { className: "btn btn-default"
, href: gexfHref props.session props.graphId
, target: "_blank" } [ RH.text "Download GEXF" ]
]
, RH.div { className: "tab-content" }
[
removeButton "Remove candidate" CandidateTerm props nodesMap
......@@ -138,9 +133,6 @@ sidebarCpt = R.hooksComponent "Sidebar" cpt
snd props.removedNodeIds $ const $ fst props.selectedNodeIds
snd props.selectedNodeIds $ const SigmaxT.emptyNodeIds
gexfHref :: Session -> Int -> String
gexfHref session graphId = url session $ Routes.NodeAPI GT.Graph (Just graphId) "gexf"
badge :: R.State SigmaxT.NodeIds -> Record SigmaxT.Node -> R.Element
badge (_ /\ setNodeIds) {id, label} =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment