This is an automated email from the ASF dual-hosted git repository. eallen pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git
The following commit(s) were added to refs/heads/master by this push: new 50a4b68 DISPATCH-1587 Escape link ids in case they contain special characters 50a4b68 is described below commit 50a4b68215bb20f9bf9362b10ea658a3ddaa30fe Author: Ernest Allen <eal...@redhat.com> AuthorDate: Wed Mar 4 16:28:41 2020 -0500 DISPATCH-1587 Escape link ids in case they contain special characters --- console/react/src/topology/topoUtils.js | 12 +++++++++--- console/react/src/topology/traffic.js | 9 +++++++-- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/console/react/src/topology/topoUtils.js b/console/react/src/topology/topoUtils.js index a3ed52c..9acaa4b 100644 --- a/console/react/src/topology/topoUtils.js +++ b/console/react/src/topology/topoUtils.js @@ -255,7 +255,7 @@ export function connectionPopupHTML(d, nodeInfo) { export function getSizes(id) { const gap = 5; - const sel = d3.select(`#${id}`); + const sel = d3.select(CSS.escape(`#${id}`)); if (!sel.empty()) { const brect = sel.node().getBoundingClientRect(); return { width: brect.width - gap, height: brect.height - gap }; @@ -331,7 +331,10 @@ function getNearestRouter(node, nodes, links) { if (link) { node.highlighted = true; link.highlighted = true; - d3.select(`path[id='hitpath-${link.uid()}']`).classed("highlighted", true); + d3.select(CSS.escape(`path[id='hitpath-${link.uid()}']`)).classed( + "highlighted", + true + ); } } return node; @@ -361,7 +364,10 @@ export function nextHopHighlight(selected_node, d, nodes, links, nodeInfo) { selected_node, (link, fnode, tnode) => { link.highlighted = true; - d3.select(`path[id='hitpath-${link.uid()}']`).classed("highlighted", true); + d3.select(CSS.escape(`path[id='hitpath-${link.uid()}']`)).classed( + "highlighted", + true + ); fnode.highlighted = true; tnode.highlighted = true; } diff --git a/console/react/src/topology/traffic.js b/console/react/src/topology/traffic.js index 14fc172..ca613a3 100644 --- a/console/react/src/topology/traffic.js +++ b/console/react/src/topology/traffic.js @@ -237,7 +237,7 @@ class Congestion extends TrafficAnimation { // accumulate the colors/directions to be used for (let key in links) { let congestion = self.congestion(links[key]); - let pathId = key.replace(/\./g, "\\.").replace(/ /g, "\\ "); + let pathId = CSS.escape(key); //key.replace(/\./g, "\\.").replace(/ /g, "\\ "); let path = d3.select(pathId); if (path && !path.empty()) { // start the path with transparent white @@ -474,12 +474,17 @@ class Dots extends TrafficAnimation { let foreIndex = 0; for (let h = 0; h < hop.length; h++) { let ahop = hop[h]; - let pathId = id.replace(/\./g, "\\.").replace(/ /g, "\\ "); + let pathId = CSS.escape(id); //id.replace(/\./g, "\\.").replace(/ /g, "\\ "); + /* let flowId = id.replace(/\./g, "").replace(/ /g, "") + "-" + this.addressIndex(ahop.address) + (ahop.back ? "b" : ""); + */ + let flowId = CSS.escape( + `${id}-${this.addressIndex(ahop.address)}${ahop.back ? "b" : ""}` + ); let path = d3.select("#path" + pathId); if (!path.empty()) { if (ahop.back) { --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org For additional commands, e-mail: commits-h...@qpid.apache.org