From 1d4353b45fa505909e812a8669b39d3219869576 Mon Sep 17 00:00:00 2001 From: Jamie V Date: Wed, 22 Jan 2025 14:37:29 -0800 Subject: [PATCH] Notebook should only show Annotations tab when an entry is selected, and as the first tab --- .../annotations/AnnotationsViewProvider.js | 9 ++++++--- src/plugins/notebook/NotebookType.js | 1 - 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/plugins/inspectorViews/annotations/AnnotationsViewProvider.js b/src/plugins/inspectorViews/annotations/AnnotationsViewProvider.js index 9cb6f7429f..dd6f12f608 100644 --- a/src/plugins/inspectorViews/annotations/AnnotationsViewProvider.js +++ b/src/plugins/inspectorViews/annotations/AnnotationsViewProvider.js @@ -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) { diff --git a/src/plugins/notebook/NotebookType.js b/src/plugins/notebook/NotebookType.js index ef299fb69c..375c22af8a 100644 --- a/src/plugins/notebook/NotebookType.js +++ b/src/plugins/notebook/NotebookType.js @@ -28,7 +28,6 @@ export default class NotebookType { this.description = description; this.cssClass = icon; this.creatable = true; - this.annotatable = true; this.form = [ { key: 'defaultSort',