Optionally provide list of object types to show as views rather than telemetry in Display Layouts (#2339)

* Optionally provide list of object types to show as views rather than alpha numerics to display layouts

* Only make table view available for objects that have telemetry to show
This commit is contained in:
Andrew Henry
2019-03-28 22:21:27 -07:00
committed by Deep Tailor
parent 57efef3160
commit bc5e300ba9
5 changed files with 25 additions and 10 deletions

View File

@@ -32,12 +32,20 @@ define([
Vue
) {
function TelemetryTableViewProvider(openmct) {
function hasTelemetry(domainObject) {
if (!domainObject.hasOwnProperty('telemetry')) {
return false;
}
let metadata = openmct.telemetry.getMetadata(domainObject);
return metadata.values().length > 0;
}
return {
key: 'table',
name: 'Telemetry Table',
cssClass: 'icon-tabular-realtime',
canView(domainObject) {
return domainObject.type === 'table' || domainObject.hasOwnProperty('telemetry');
return domainObject.type === 'table' ||
hasTelemetry(domainObject)
},
canEdit(domainObject) {
return domainObject.type === 'table';