Add canView logic for telemetry and composition (#4426)

* Add canView logic for telemtry and compositon

* AUse PriorityAPI to set high priority for LADTable views

* Changed high to constant case

Co-authored-by: Jamie V <jamie.j.vigliotta@nasa.gov>
This commit is contained in:
Michael Rogers 2021-12-06 13:56:17 -06:00 committed by GitHub
parent 63fabe576c
commit 8eba3a81f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,7 +31,11 @@ export default class LADTableViewProvider {
}
canView(domainObject) {
return domainObject.type === 'LadTable';
const supportsComposition = this.openmct.composition.get(domainObject) !== undefined;
const providesTelemetry = this.openmct.telemetry.isTelemetryObject(domainObject);
return domainObject.type === 'LadTable'
|| (providesTelemetry && supportsComposition);
}
canEdit(domainObject) {
@ -43,6 +47,6 @@ export default class LADTableViewProvider {
}
priority(domainObject) {
return 1;
return this.openmct.priority.HIGH;
}
}