make sure older objects not initialized with object styles are checked

This commit is contained in:
Jamie V 2025-01-23 15:48:24 -08:00
parent 1d4353b45f
commit 91a9fa5c15
7 changed files with 36 additions and 6 deletions

View File

@ -41,9 +41,10 @@ export default class LADTableConfiguration extends EventEmitter {
}
getConfiguration() {
const configuration = this.domainObject.configuration || {};
configuration.hiddenColumns = configuration.hiddenColumns || {};
const configuration = this.domainObject.configuration ?? {};
configuration.hiddenColumns = configuration.hiddenColumns ?? {};
configuration.isFixedLayout = configuration.isFixedLayout ?? true;
configuration.objectStyles = configuration.objectStyles ?? {};
return configuration;
}

View File

@ -79,6 +79,13 @@ export default {
},
mounted() {
if (this.domainObject) {
if (!this.domainObject.configuration) {
// older versions didn't initialize configuration
this.domainObject.configuration = {
objectStyles: {}
};
}
this.listenToConditionSetChanges();
}
},

View File

@ -553,6 +553,11 @@ export default {
this.openmct.time.on('boundsChanged', this.refreshData);
this.openmct.time.on('timeSystem', this.setTimeSystem);
// Initialize objectStyles if it doesn't exist
if (!this.domainObject.configuration.objectStyles) {
this.domainObject.configuration.objectStyles = {};
}
this.setupClockChangedEvent((domainObject) => {
this.triggerUnsubscribeFromStaleness(domainObject);
this.subscribeToStaleness(domainObject);

View File

@ -54,19 +54,17 @@ export default function StylesInspectorViewProvider(openmct) {
);
const isLayoutItem = objectContext?.layoutItem;
if (isLayoutItem) {
if (isLayoutItem || hasStyles) {
return true;
}
if (!domainObject || isFlexibleLayoutContainer || !hasStyles) {
if (!domainObject || isFlexibleLayoutContainer) {
return false;
}
const typeObject = openmct.types.get(domainObject.type);
return (
hasStyles ||
isLayoutItem ||
isLayoutObject(objectSelection, domainObject.type) ||
isCreatableObject(domainObject, typeObject)
);

View File

@ -173,6 +173,15 @@ export default {
created() {
eventHelpers.extend(this);
this.imageExporter = new ImageExporter(this.openmct);
// Initialize objectStyles for overlay plot if it doesn't exist
if (
this.domainObject.type === 'telemetry.plot.overlay' &&
!this.domainObject.configuration.objectStyles
) {
this.domainObject.configuration.objectStyles = {};
}
this.loadComposition();
this.setupClockChangedEvent((domainObject) => {
this.triggerUnsubscribeFromStaleness(domainObject);

View File

@ -147,6 +147,11 @@ export default {
this.config = this.getConfig(configId);
this.showLegendsForChildren = this.config.legend.get('showLegendsForChildren');
// Initialize objectStyles if it doesn't exist
if (!this.domainObject.configuration.objectStyles) {
this.domainObject.configuration.objectStyles = {};
}
this.loaded = true;
this.imageExporter = new ImageExporter(this.openmct);

View File

@ -36,6 +36,11 @@ export default class TelemetryTableConfiguration extends EventEmitter {
this.defaultOptions = options;
this.columns = {};
// Initialize objectStyles if it doesn't exist
if (!this.domainObject.configuration.objectStyles) {
this.domainObject.configuration.objectStyles = {};
}
this.removeColumnsForObject = this.removeColumnsForObject.bind(this);
this.objectMutated = this.objectMutated.bind(this);