mirror of
https://github.com/nasa/openmct.git
synced 2025-05-29 05:34:18 +00:00
Don't initialize the selected condition style when a view is loaded (#6478)
* Don't initialize the selected condition style when a view is loaded * Ensure selection of styles in Edit mode works as expected. When out of edit mode, only a computed style should be chosen to display.
This commit is contained in:
parent
8cf12db104
commit
e174f075df
@ -35,7 +35,9 @@ export default class StyleRuleManager extends EventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (styleConfiguration) {
|
if (styleConfiguration) {
|
||||||
this.initialize(styleConfiguration);
|
// We don't set the selectedConditionId here because we want condition set computation to happen before we apply any selected style
|
||||||
|
const styleConfigurationWithNoSelection = Object.assign(styleConfiguration, {selectedConditionId: ''});
|
||||||
|
this.initialize(styleConfigurationWithNoSelection);
|
||||||
if (styleConfiguration.conditionSetIdentifier) {
|
if (styleConfiguration.conditionSetIdentifier) {
|
||||||
this.openmct.time.on("bounds", this.refreshData);
|
this.openmct.time.on("bounds", this.refreshData);
|
||||||
this.subscribeToConditionSet();
|
this.subscribeToConditionSet();
|
||||||
@ -57,14 +59,18 @@ export default class StyleRuleManager extends EventEmitter {
|
|||||||
this.applySelectedConditionStyle();
|
this.applySelectedConditionStyle();
|
||||||
}
|
}
|
||||||
} else if (this.conditionSetIdentifier) {
|
} else if (this.conditionSetIdentifier) {
|
||||||
|
//reset the selected style and let the condition set output determine what it should be
|
||||||
|
this.selectedConditionId = undefined;
|
||||||
|
this.currentStyle = undefined;
|
||||||
|
this.updateDomainObjectStyle();
|
||||||
this.subscribeToConditionSet();
|
this.subscribeToConditionSet();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
initialize(styleConfiguration) {
|
initialize(styleConfiguration) {
|
||||||
this.conditionSetIdentifier = styleConfiguration.conditionSetIdentifier;
|
this.conditionSetIdentifier = styleConfiguration.conditionSetIdentifier;
|
||||||
this.staticStyle = styleConfiguration.staticStyle;
|
|
||||||
this.selectedConditionId = styleConfiguration.selectedConditionId;
|
this.selectedConditionId = styleConfiguration.selectedConditionId;
|
||||||
|
this.staticStyle = styleConfiguration.staticStyle;
|
||||||
this.defaultConditionId = styleConfiguration.defaultConditionId;
|
this.defaultConditionId = styleConfiguration.defaultConditionId;
|
||||||
this.updateConditionStylesMap(styleConfiguration.styles || []);
|
this.updateConditionStylesMap(styleConfiguration.styles || []);
|
||||||
}
|
}
|
||||||
|
@ -307,6 +307,8 @@ export default {
|
|||||||
delete this.stopProvidingTelemetry;
|
delete this.stopProvidingTelemetry;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
//reset the selectedConditionID so that the condition set computation can drive it.
|
||||||
|
this.applySelectedConditionStyle('');
|
||||||
this.subscribeToConditionSet();
|
this.subscribeToConditionSet();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user