mirror of
https://github.com/nasa/openmct.git
synced 2025-05-31 06:31:04 +00:00
Notebook should only show Annotations tab when an entry is selected, and as the first tab
This commit is contained in:
parent
f7d78c1223
commit
1d4353b45f
@ -41,14 +41,17 @@ export default function AnnotationsViewProvider(openmct) {
|
|||||||
const isAnnotatableType = openmct.annotation.isAnnotatableType(domainObject.type);
|
const isAnnotatableType = openmct.annotation.isAnnotatableType(domainObject.type);
|
||||||
const metadata = openmct.telemetry.getMetadata(domainObject);
|
const metadata = openmct.telemetry.getMetadata(domainObject);
|
||||||
const hasImagery = metadata?.valuesForHints(['image']).length > 0;
|
const hasImagery = metadata?.valuesForHints(['image']).length > 0;
|
||||||
|
const isNotebookEntry = selectionContext?.type === 'notebook-entry-selection';
|
||||||
const hasNumericTelemetry = openmct.telemetry.hasNumericTelemetry(domainObject);
|
const hasNumericTelemetry = openmct.telemetry.hasNumericTelemetry(domainObject);
|
||||||
|
|
||||||
return isAnnotatableType || hasImagery || hasNumericTelemetry;
|
return isAnnotatableType || hasImagery || hasNumericTelemetry || isNotebookEntry;
|
||||||
},
|
},
|
||||||
view: function (selection) {
|
view: function (selection) {
|
||||||
let _destroy = null;
|
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 {
|
return {
|
||||||
show: function (element) {
|
show: function (element) {
|
||||||
@ -72,7 +75,7 @@ export default function AnnotationsViewProvider(openmct) {
|
|||||||
_destroy = destroy;
|
_destroy = destroy;
|
||||||
},
|
},
|
||||||
priority: function () {
|
priority: function () {
|
||||||
return openmct.priority.DEFAULT;
|
return isNotebookEntry ? openmct.priority.HIGH + 1 : openmct.priority.DEFAULT;
|
||||||
},
|
},
|
||||||
destroy: function () {
|
destroy: function () {
|
||||||
if (_destroy) {
|
if (_destroy) {
|
||||||
|
@ -28,7 +28,6 @@ export default class NotebookType {
|
|||||||
this.description = description;
|
this.description = description;
|
||||||
this.cssClass = icon;
|
this.cssClass = icon;
|
||||||
this.creatable = true;
|
this.creatable = true;
|
||||||
this.annotatable = true;
|
|
||||||
this.form = [
|
this.form = [
|
||||||
{
|
{
|
||||||
key: 'defaultSort',
|
key: 'defaultSort',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user