fix(overlay plot): legend updates correctly when removing element via remove action (#7531)

* fix: remove duplicate listeners
* fix: if no series found, don't splice
* test(e2e): update legend a11y and add test
This commit is contained in:
Jesse Mazzella
2024-03-04 18:07:44 -08:00
committed by GitHub
parent 0bdd0963a4
commit 39ab81c3d0
3 changed files with 29 additions and 15 deletions

View File

@ -165,7 +165,6 @@ export default {
this.registerListeners(this.config);
}
this.listenTo(this.config.legend, 'change:expandByDefault', this.changeExpandDefault, this);
this.initialize();
},
mounted() {
this.loaded = true;
@ -182,16 +181,6 @@ export default {
this.stopListening();
},
methods: {
initialize() {
if (this.domainObject.type === 'telemetry.plot.stacked') {
this.objectComposition = this.openmct.composition.get(this.domainObject);
this.objectComposition.on('add', this.addTelemetryObject);
this.objectComposition.on('remove', this.removeTelemetryObject);
this.objectComposition.load();
} else {
this.registerListeners(this.config);
}
},
changeExpandDefault() {
this.isLegendExpanded = this.config.legend.model.expandByDefault;
this.legend.set('expanded', this.isLegendExpanded);