[Tooltips] Add tooltips on hover (#6756)
* Add tooltip api, extend object api to add telemetry composition lookups, and add tooltips to gauges/notebook embeds/plot legends/object frames/object names/time strips/recent objects/search results/object tree * Add tooltips to telemetry/lad tables * Styling normalization, sanding and polishing. * Add tooltips for Conditional widgets and Tab Views * Add tests * Switch to using enum-ish consts for tooltip locations * Trim LAD table row name to account for spacing required by linting rules --------- Co-authored-by: Charles Hacskaylo <charlesh88@gmail.com>
This commit is contained in:
@@ -540,6 +540,40 @@ export default class ObjectAPI {
|
||||
.join('/');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return path of telemetry objects in the object composition
|
||||
* @param {object} identifier the identifier for the domain object to query for
|
||||
* @param {object} [telemetryIdentifier] the specific identifier for the telemetry
|
||||
* to look for in the composition, uses first object in composition otherwise
|
||||
* @returns {Array} path of telemetry object in object composition
|
||||
*/
|
||||
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 (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);
|
||||
});
|
||||
}
|
||||
return telemetryPath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Modify a domain object. Internal to ObjectAPI, won't call save after.
|
||||
* @private
|
||||
|
||||
Reference in New Issue
Block a user