GUI2 Bug fixes to Topo view
Change-Id: Ib40279fec94ffecb1d6c771aa376ad1cded03c02
diff --git a/web/gui2-topo-lib/projects/gui2-topo-lib/src/lib/layer/forcesvg/forcesvg.component.ts b/web/gui2-topo-lib/projects/gui2-topo-lib/src/lib/layer/forcesvg/forcesvg.component.ts
index b759997..b4bff8e 100644
--- a/web/gui2-topo-lib/projects/gui2-topo-lib/src/lib/layer/forcesvg/forcesvg.component.ts
+++ b/web/gui2-topo-lib/projects/gui2-topo-lib/src/lib/layer/forcesvg/forcesvg.component.ts
@@ -321,7 +321,7 @@
*/
updateSelected(selectedNode: SelectedEvent): void {
this.log.debug('Node or link ',
- selectedNode.uiElement,
+ selectedNode.uiElement ? selectedNode.uiElement.id : '--',
selectedNode.deselecting ? 'deselected' : 'selected',
selectedNode.isShift ? 'Multiple' : '');
@@ -336,6 +336,12 @@
this.selectedNodes.push(selectedNode.uiElement);
} else if (selectedNode.deselecting) {
+ this.devices
+ .forEach((d) => d.deselect());
+ this.hosts
+ .forEach((h) => h.deselect());
+ this.links
+ .forEach((l) => l.deselect());
this.selectedNodes = [];
} else {
@@ -495,7 +501,7 @@
* @param hosts - an array of host highlights
* @param links - an array of link highlights
*/
- handleHighlights(devices: Device[], hosts: Host[], links: LinkHighlight[]): void {
+ handleHighlights(devices: Device[], hosts: Host[], links: LinkHighlight[], fadeMs: number = 0): void {
if (devices.length > 0) {
this.log.debug(devices.length, 'Devices highlighted');
@@ -526,12 +532,15 @@
if (links.length > 0) {
this.log.debug(links.length, 'Links highlighted');
links.forEach((lh) => {
- const linkComponent: LinkSvgComponent = this.links.find((l) => l.link.id === lh.id );
+ const linkComponent: LinkSvgComponent =
+ this.links.find((l) => l.link.id === Link.linkIdFromShowHighlights(lh.id) );
if (linkComponent) { // A link might not be present is hosts viewing is switched off
+ if (fadeMs > 0) {
+ lh.fadems = fadeMs;
+ }
linkComponent.ngOnChanges(
{'linkHighlight': new SimpleChange(<LinkHighlight>{}, lh, true)}
);
- // this.log.debug('Highlighting link', linkComponent.link.id, lh.css, lh.label);
}
});
}