mirror of
https://github.com/nasa/openmct.git
synced 2025-06-04 16:40:53 +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() {
|
getConfiguration() {
|
||||||
const configuration = this.domainObject.configuration || {};
|
const configuration = this.domainObject.configuration ?? {};
|
||||||
configuration.hiddenColumns = configuration.hiddenColumns || {};
|
configuration.hiddenColumns = configuration.hiddenColumns ?? {};
|
||||||
configuration.isFixedLayout = configuration.isFixedLayout ?? true;
|
configuration.isFixedLayout = configuration.isFixedLayout ?? true;
|
||||||
|
configuration.objectStyles = configuration.objectStyles ?? {};
|
||||||
|
|
||||||
return configuration;
|
return configuration;
|
||||||
}
|
}
|
||||||
|
@ -79,6 +79,13 @@ export default {
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
if (this.domainObject) {
|
if (this.domainObject) {
|
||||||
|
if (!this.domainObject.configuration) {
|
||||||
|
// older versions didn't initialize configuration
|
||||||
|
this.domainObject.configuration = {
|
||||||
|
objectStyles: {}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
this.listenToConditionSetChanges();
|
this.listenToConditionSetChanges();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -553,6 +553,11 @@ export default {
|
|||||||
this.openmct.time.on('boundsChanged', this.refreshData);
|
this.openmct.time.on('boundsChanged', this.refreshData);
|
||||||
this.openmct.time.on('timeSystem', this.setTimeSystem);
|
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.setupClockChangedEvent((domainObject) => {
|
||||||
this.triggerUnsubscribeFromStaleness(domainObject);
|
this.triggerUnsubscribeFromStaleness(domainObject);
|
||||||
this.subscribeToStaleness(domainObject);
|
this.subscribeToStaleness(domainObject);
|
||||||
|
@ -54,19 +54,17 @@ export default function StylesInspectorViewProvider(openmct) {
|
|||||||
);
|
);
|
||||||
const isLayoutItem = objectContext?.layoutItem;
|
const isLayoutItem = objectContext?.layoutItem;
|
||||||
|
|
||||||
if (isLayoutItem) {
|
if (isLayoutItem || hasStyles) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!domainObject || isFlexibleLayoutContainer || !hasStyles) {
|
if (!domainObject || isFlexibleLayoutContainer) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const typeObject = openmct.types.get(domainObject.type);
|
const typeObject = openmct.types.get(domainObject.type);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
hasStyles ||
|
|
||||||
isLayoutItem ||
|
|
||||||
isLayoutObject(objectSelection, domainObject.type) ||
|
isLayoutObject(objectSelection, domainObject.type) ||
|
||||||
isCreatableObject(domainObject, typeObject)
|
isCreatableObject(domainObject, typeObject)
|
||||||
);
|
);
|
||||||
|
@ -173,6 +173,15 @@ export default {
|
|||||||
created() {
|
created() {
|
||||||
eventHelpers.extend(this);
|
eventHelpers.extend(this);
|
||||||
this.imageExporter = new ImageExporter(this.openmct);
|
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.loadComposition();
|
||||||
this.setupClockChangedEvent((domainObject) => {
|
this.setupClockChangedEvent((domainObject) => {
|
||||||
this.triggerUnsubscribeFromStaleness(domainObject);
|
this.triggerUnsubscribeFromStaleness(domainObject);
|
||||||
|
@ -147,6 +147,11 @@ export default {
|
|||||||
this.config = this.getConfig(configId);
|
this.config = this.getConfig(configId);
|
||||||
this.showLegendsForChildren = this.config.legend.get('showLegendsForChildren');
|
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.loaded = true;
|
||||||
this.imageExporter = new ImageExporter(this.openmct);
|
this.imageExporter = new ImageExporter(this.openmct);
|
||||||
|
|
||||||
|
@ -36,6 +36,11 @@ export default class TelemetryTableConfiguration extends EventEmitter {
|
|||||||
this.defaultOptions = options;
|
this.defaultOptions = options;
|
||||||
this.columns = {};
|
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.removeColumnsForObject = this.removeColumnsForObject.bind(this);
|
||||||
this.objectMutated = this.objectMutated.bind(this);
|
this.objectMutated = this.objectMutated.bind(this);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user