mirror of
https://github.com/nasa/openmct.git
synced 2025-03-21 03:25:44 +00:00
make sure older objects not initialized with object styles are checked
This commit is contained in:
parent
1d4353b45f
commit
91a9fa5c15
@ -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;
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
},
|
||||
|
@ -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);
|
||||
|
@ -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)
|
||||
);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user