This commit is contained in:
Jamie V 2025-02-14 15:06:49 -08:00
parent 310bd17800
commit efd7369a10
2 changed files with 26 additions and 4 deletions

View File

@ -58,7 +58,7 @@ const viewsTabsMatrix = {
Browse: ['Properties', 'Annotations'] Browse: ['Properties', 'Annotations']
}, },
'Flexible Layout': { 'Flexible Layout': {
Browse: ['Properties', 'Elements', 'Styles'], Browse: ['Properties', 'Elements'],
Edit: ['Elements', 'Styles', 'Properties'] Edit: ['Elements', 'Styles', 'Properties']
}, },
Folder: { Folder: {

View File

@ -33,7 +33,10 @@ const NON_STYLABLE_TYPES = [
'example.imagery', 'example.imagery',
'folder', 'folder',
'gantt-chart', 'gantt-chart',
'generator',
'hyperlink', 'hyperlink',
'notebook',
'restricted-notebook',
'summary-widget', 'summary-widget',
'webPage' 'webPage'
]; ];
@ -60,9 +63,8 @@ export default function StylesInspectorViewProvider(openmct) {
const objectContext = objectSelection?.[0]?.context; const objectContext = objectSelection?.[0]?.context;
const domainObject = objectContext?.item; const domainObject = objectContext?.item;
const hasStyles = domainObject?.configuration?.objectStyles; const hasStyles = domainObject?.configuration?.objectStyles;
const isFlexibleLayoutContainer = ['flexible-layout', 'fixed-layout'].includes( const isFlexibleLayoutContainer =
domainObject?.type domainObject?.type === 'flexible-layout' && objectContext.type === 'container';
);
const isLayoutItem = objectContext?.layoutItem; const isLayoutItem = objectContext?.layoutItem;
if (isLayoutItem || hasStyles) { if (isLayoutItem || hasStyles) {
@ -82,6 +84,19 @@ export default function StylesInspectorViewProvider(openmct) {
}, },
view: function (selection) { view: function (selection) {
let _destroy = null; let _destroy = null;
const objectSelection = selection?.[0];
const objectContext = objectSelection?.[0]?.context;
const domainObject = objectContext?.item;
const onlyEditMode = [
'flexible-layout',
'LadTable',
'LadTableSet',
'table',
'telemetry.plot.bar-graph',
'telemetry.plot.overlay',
'telemetry.plot.stacked',
'telemetry.plot.scatter-plot'
].includes(domainObject?.type);
return { return {
show: function (element) { show: function (element) {
@ -105,6 +120,13 @@ export default function StylesInspectorViewProvider(openmct) {
); );
_destroy = destroy; _destroy = destroy;
}, },
showTab: function (isEditing) {
if (onlyEditMode && !isEditing) {
return false;
}
return true;
},
priority: function () { priority: function () {
return openmct.editor.isEditing() ? openmct.priority.DEFAULT : openmct.priority.LOW; return openmct.editor.isEditing() ? openmct.priority.DEFAULT : openmct.priority.LOW;
}, },