Notebook should only show Annotations tab when an entry is selected, and as the first tab

This commit is contained in:
Jamie V 2025-01-22 14:37:29 -08:00
parent f7d78c1223
commit 1d4353b45f
2 changed files with 6 additions and 4 deletions

View File

@ -41,14 +41,17 @@ export default function AnnotationsViewProvider(openmct) {
const isAnnotatableType = openmct.annotation.isAnnotatableType(domainObject.type);
const metadata = openmct.telemetry.getMetadata(domainObject);
const hasImagery = metadata?.valuesForHints(['image']).length > 0;
const isNotebookEntry = selectionContext?.type === 'notebook-entry-selection';
const hasNumericTelemetry = openmct.telemetry.hasNumericTelemetry(domainObject);
return isAnnotatableType || hasImagery || hasNumericTelemetry;
return isAnnotatableType || hasImagery || hasNumericTelemetry || isNotebookEntry;
},
view: function (selection) {
let _destroy = null;
const domainObject = selection?.[0]?.[0]?.context?.item;
const selectionContext = selection?.[0]?.[0]?.context;
const domainObject = selectionContext?.item;
const isNotebookEntry = selectionContext?.type === 'notebook-entry-selection';
return {
show: function (element) {
@ -72,7 +75,7 @@ export default function AnnotationsViewProvider(openmct) {
_destroy = destroy;
},
priority: function () {
return openmct.priority.DEFAULT;
return isNotebookEntry ? openmct.priority.HIGH + 1 : openmct.priority.DEFAULT;
},
destroy: function () {
if (_destroy) {

View File

@ -28,7 +28,6 @@ export default class NotebookType {
this.description = description;
this.cssClass = icon;
this.creatable = true;
this.annotatable = true;
this.form = [
{
key: 'defaultSort',