added getTypes to types api, modifying which tabs are shown, working on annoatation tab

This commit is contained in:
Jamie V 2024-12-20 14:22:18 -08:00
parent 5be103ea72
commit e1969585f9
3 changed files with 21 additions and 0 deletions

View File

@ -89,6 +89,17 @@ export default class TypeRegistry {
get(typeKey) {
return this.types[typeKey] || UNKNOWN_TYPE;
}
/**
* List all registered types.
* @returns {Type[]} all registered types
*/
getTypes() {
return Object.values(this.types);
}
/**
* Import legacy types.
* @param {TypeDefinition[]} types the types to import
*/
importLegacyTypes(types) {
types
.filter((t) => this.get(t.key) === UNKNOWN_TYPE)

View File

@ -91,6 +91,15 @@ export default function StylesInspectorViewProvider(openmct) {
);
_destroy = destroy;
},
showTab: function () {
const objectSelection = selection?.[0];
const objectContext = objectSelection?.[0]?.context;
const layoutItem = objectContext?.layoutItem;
const domainObject = objectContext?.item;
const hasStyles = domainObject?.configuration?.objectStyles;
return layoutItem || hasStyles;
},
priority: function () {
return openmct.priority.DEFAULT;
},

View File

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