mirror of
https://github.com/nasa/openmct.git
synced 2025-03-20 11:05:19 +00:00
added annotation tab conditions
This commit is contained in:
parent
cded8fc4d0
commit
bac8c80975
src
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user