[Plot] Update formDomainObject on mutate

When a new series is added to a plot, a plot series form controller
is instantiated and passed in a domain object via scope that it will
mutate upon changes.  If a mutation results in a composition add, then
the plot series form controller needs to get a version of the domain
object with the updated composition array, which it was not previously
doing.

This fixes #2120.
This commit is contained in:
Pete Richards 2018-07-31 12:03:49 -07:00
parent a1d206bfc3
commit 04cc8f7aa2

View File

@ -45,6 +45,7 @@ define([
PlotOptionsController.prototype.updateDomainObject = function (domainObject) {
this.domainObject = domainObject;
this.$scope.formDomainObject = domainObject;
};
PlotOptionsController.prototype.destroy = function () {
@ -63,8 +64,7 @@ define([
this.config = this.$scope.config = config;
this.$scope.plotSeries = [];
this.domainObject = this.config.get('domainObject');
this.$scope.formDomainObject = this.domainObject;
this.updateDomainObject(this.config.get('domainObject'));
this.unlisten = this.openmct.objects.observe(this.domainObject, '*', this.updateDomainObject.bind(this));
this.listenTo(this.$scope, '$destroy', this.destroy, this);