From f19129b79b7e8e731f0c61e93a4bcc55102fb487 Mon Sep 17 00:00:00 2001 From: Khalid Adil Date: Thu, 10 Aug 2023 16:15:36 -0500 Subject: [PATCH 1/8] Fix getTelemetryPath to handle cases where parent is the same as the child, handle yamcs aggregate telemetry, and fix how identifiers are passed in --- src/api/objects/ObjectAPI.js | 40 +++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/src/api/objects/ObjectAPI.js b/src/api/objects/ObjectAPI.js index ebc7767371e..73e5b926a94 100644 --- a/src/api/objects/ObjectAPI.js +++ b/src/api/objects/ObjectAPI.js @@ -555,27 +555,39 @@ export default class ObjectAPI { async getTelemetryPath(identifier, telemetryIdentifier) { const objectDetails = await this.get(identifier); const telemetryPath = []; - if (objectDetails.composition && !['folder'].includes(objectDetails.type)) { - let sourceTelemetry = objectDetails.composition[0]; + if (['folder'].includes(objectDetails.type)) { + return telemetryPath; + } + + let sourceTelemetry = null; + let isParentSameAsChild = true; + Object.keys(identifier).forEach((key) => { + if (identifier[key] !== telemetryIdentifier[key]) { + isParentSameAsChild = false; + } + }); + if (isParentSameAsChild) { + sourceTelemetry = identifier; + } else if (objectDetails.composition) { + sourceTelemetry = objectDetails.composition[0]; if (telemetryIdentifier) { sourceTelemetry = objectDetails.composition.find( (telemetrySource) => this.makeKeyString(telemetrySource) === this.makeKeyString(telemetryIdentifier) ); } - const compositionElement = await this.get(sourceTelemetry); - if (!['yamcs.telemetry', 'generator'].includes(compositionElement.type)) { - return telemetryPath; - } - const telemetryKey = compositionElement.identifier.key; - const telemetryPathObjects = await this.getOriginalPath(telemetryKey); - telemetryPathObjects.forEach((pathObject) => { - if (pathObject.type === 'root') { - return; - } - telemetryPath.unshift(pathObject.name); - }); } + const compositionElement = await this.get(sourceTelemetry); + if (!['yamcs.telemetry', 'generator', 'yamcs.aggregate'].includes(compositionElement.type)) { + return telemetryPath; + } + const telemetryPathObjects = await this.getOriginalPath(compositionElement.identifier); + telemetryPathObjects.forEach((pathObject) => { + if (pathObject.type === 'root') { + return; + } + telemetryPath.unshift(pathObject.name); + }); return telemetryPath; } From e40d6a2600d0956cf40bac0deb041eb43b7b4533 Mon Sep 17 00:00:00 2001 From: Khalid Adil Date: Tue, 15 Aug 2023 17:33:25 -0500 Subject: [PATCH 2/8] Cleanup getTelemetryPath --- src/api/objects/ObjectAPI.js | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/api/objects/ObjectAPI.js b/src/api/objects/ObjectAPI.js index e832c487f41..63162eef7e7 100644 --- a/src/api/objects/ObjectAPI.js +++ b/src/api/objects/ObjectAPI.js @@ -555,39 +555,35 @@ export default class ObjectAPI { async getTelemetryPath(identifier, telemetryIdentifier) { const objectDetails = await this.get(identifier); const telemetryPath = []; - if (['folder'].includes(objectDetails.type)) { + if (objectDetails.type === 'folder') { return telemetryPath; } let sourceTelemetry = null; - let isParentSameAsChild = true; - Object.keys(identifier).forEach((key) => { - if (identifier[key] !== telemetryIdentifier[key]) { - isParentSameAsChild = false; - } - }); - if (isParentSameAsChild) { + if (telemetryIdentifier && utils.identifierEquals(identifier, telemetryIdentifier)) { sourceTelemetry = identifier; } else if (objectDetails.composition) { sourceTelemetry = objectDetails.composition[0]; if (telemetryIdentifier) { - sourceTelemetry = objectDetails.composition.find( - (telemetrySource) => - this.makeKeyString(telemetrySource) === this.makeKeyString(telemetryIdentifier) + sourceTelemetry = objectDetails.composition.find((telemetrySource) => + utils.identifierEquals(telemetrySource, telemetryIdentifier) ); } } + const compositionElement = await this.get(sourceTelemetry); if (!['yamcs.telemetry', 'generator', 'yamcs.aggregate'].includes(compositionElement.type)) { return telemetryPath; } + const telemetryPathObjects = await this.getOriginalPath(compositionElement.identifier); - telemetryPathObjects.forEach((pathObject) => { + telemetryPathObjects.reverse().forEach((pathObject) => { if (pathObject.type === 'root') { return; } - telemetryPath.unshift(pathObject.name); + telemetryPath.push(pathObject.name); }); + return telemetryPath; } From 1187204f06b9ad04688490ab2639a124bee6797a Mon Sep 17 00:00:00 2001 From: Khalid Adil Date: Wed, 16 Aug 2023 11:39:50 -0500 Subject: [PATCH 3/8] Switch to filter instead of forEach --- src/api/objects/ObjectAPI.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/api/objects/ObjectAPI.js b/src/api/objects/ObjectAPI.js index 63162eef7e7..981bb6ccd84 100644 --- a/src/api/objects/ObjectAPI.js +++ b/src/api/objects/ObjectAPI.js @@ -554,7 +554,7 @@ export default class ObjectAPI { */ async getTelemetryPath(identifier, telemetryIdentifier) { const objectDetails = await this.get(identifier); - const telemetryPath = []; + let telemetryPath = []; if (objectDetails.type === 'folder') { return telemetryPath; } @@ -577,12 +577,9 @@ export default class ObjectAPI { } const telemetryPathObjects = await this.getOriginalPath(compositionElement.identifier); - telemetryPathObjects.reverse().forEach((pathObject) => { - if (pathObject.type === 'root') { - return; - } - telemetryPath.push(pathObject.name); - }); + telemetryPath = telemetryPathObjects + .reverse() + .filter((pathObject) => pathObject.type !== 'root'); return telemetryPath; } From d11e21b36b48a512e52279633bb179bbed42934d Mon Sep 17 00:00:00 2001 From: Khalid Adil Date: Wed, 16 Aug 2023 11:58:16 -0500 Subject: [PATCH 4/8] Get path item names --- src/api/objects/ObjectAPI.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/api/objects/ObjectAPI.js b/src/api/objects/ObjectAPI.js index 981bb6ccd84..a8ca2717b1a 100644 --- a/src/api/objects/ObjectAPI.js +++ b/src/api/objects/ObjectAPI.js @@ -579,7 +579,8 @@ export default class ObjectAPI { const telemetryPathObjects = await this.getOriginalPath(compositionElement.identifier); telemetryPath = telemetryPathObjects .reverse() - .filter((pathObject) => pathObject.type !== 'root'); + .filter((pathObject) => pathObject.type !== 'root') + .map((pathObject) => pathObject.name); return telemetryPath; } From 6fc541e5b0138a60350a3992321a878985ee99ba Mon Sep 17 00:00:00 2001 From: Khalid Adil Date: Wed, 16 Aug 2023 13:29:02 -0500 Subject: [PATCH 5/8] Remove tooltips on scroll of tree --- src/api/tooltips/ToolTipAPI.js | 15 ++++++++++++--- src/ui/layout/mct-tree.vue | 3 +++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/api/tooltips/ToolTipAPI.js b/src/api/tooltips/ToolTipAPI.js index 425538e23ee..384ac2f1f08 100644 --- a/src/api/tooltips/ToolTipAPI.js +++ b/src/api/tooltips/ToolTipAPI.js @@ -57,13 +57,22 @@ class TooltipAPI { * @private for platform-internal use */ showTooltip(tooltip) { + this.removeAllTooltips(); + this.activeToolTips.push(tooltip); + tooltip.show(); + } + + /** + * API method to allow for removing all tooltips + */ + removeAllTooltips() { + if (!this.activeToolTips?.length) { + return; + } for (let i = this.activeToolTips.length - 1; i > -1; i--) { this.activeToolTips[i].destroy(); this.activeToolTips.splice(i, 1); } - this.activeToolTips.push(tooltip); - - tooltip.show(); } /** diff --git a/src/ui/layout/mct-tree.vue b/src/ui/layout/mct-tree.vue index 14822fb1386..9ef3f7d05d3 100644 --- a/src/ui/layout/mct-tree.vue +++ b/src/ui/layout/mct-tree.vue @@ -26,6 +26,7 @@ :class="{ 'c-selector': isSelectorTree }" + @scroll="" >