added annotation tab conditions

This commit is contained in:
Jamie V 2024-12-30 15:19:10 -08:00
parent cded8fc4d0
commit bac8c80975
2 changed files with 7 additions and 2 deletions
src
api/annotation
plugins/inspectorViews/annotations

@ -601,7 +601,6 @@ export default class AnnotationAPI extends EventEmitter {
* @returns {boolean} Returns true if the type is annotatable
*/
isAnnotatableType(type) {
console.log('type', type, this.annotatableTypes);
return this.annotatableTypes.some((annotatableType) => annotatableType === type);
}
}

@ -40,7 +40,9 @@ export default function AnnotationsViewProvider(openmct) {
view: function (selection) {
let _destroy = null;
const domainObject = selection?.[0]?.[0]?.context?.item;
const selectionContext = selection?.[0]?.[0]?.context;
const domainObject = selectionContext?.item;
const isLayoutItem = selectionContext?.layoutItem;
return {
show: function (element) {
@ -64,6 +66,10 @@ export default function AnnotationsViewProvider(openmct) {
_destroy = destroy;
},
showTab: function () {
if (isLayoutItem) {
return false;
}
const isAnnotatableType = openmct.annotation.isAnnotatableType(domainObject.type);
const metadata = openmct.telemetry.getMetadata(domainObject);
const hasImagery = metadata?.valuesForHints(['image']).length > 0;