mirror of
https://github.com/nasa/openmct.git
synced 2025-02-21 17:57:04 +00:00
Merge pull request #2137 from nasa/prevent-plot-accidental-remove
[Plot] Update formDomainObject on mutate
This commit is contained in:
commit
9582fb2b06
@ -83,6 +83,7 @@ define([
|
|||||||
|
|
||||||
this.listenTo(this, 'change:xKey', this.onXKeyChange, this);
|
this.listenTo(this, 'change:xKey', this.onXKeyChange, this);
|
||||||
this.listenTo(this, 'change:yKey', this.onYKeyChange, this);
|
this.listenTo(this, 'change:yKey', this.onYKeyChange, this);
|
||||||
|
this.persistedConfig = options.persistedConfig;
|
||||||
|
|
||||||
Model.apply(this, arguments);
|
Model.apply(this, arguments);
|
||||||
this.onXKeyChange(this.get('xKey'));
|
this.onXKeyChange(this.get('xKey'));
|
||||||
@ -176,8 +177,7 @@ define([
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var valueMetadata = this.metadata.value(newKey);
|
var valueMetadata = this.metadata.value(newKey);
|
||||||
var persistedConfig = this.get('persistedConfiguration');
|
if (!this.persistedConfig || !this.persistedConfig.interpolate) {
|
||||||
if (!persistedConfig || !persistedConfig.interpolate) {
|
|
||||||
if (valueMetadata.format === 'enum') {
|
if (valueMetadata.format === 'enum') {
|
||||||
this.set('interpolate', 'stepAfter');
|
this.set('interpolate', 'stepAfter');
|
||||||
} else {
|
} else {
|
||||||
|
@ -54,7 +54,7 @@ define([
|
|||||||
domainObject.configuration.series.forEach(function (seriesConfig) {
|
domainObject.configuration.series.forEach(function (seriesConfig) {
|
||||||
var series = this.byIdentifier(seriesConfig.identifier);
|
var series = this.byIdentifier(seriesConfig.identifier);
|
||||||
if (series) {
|
if (series) {
|
||||||
series.set('persistedConfiguration', seriesConfig);
|
series.persistedConfig = seriesConfig;
|
||||||
}
|
}
|
||||||
}, this);
|
}, this);
|
||||||
},
|
},
|
||||||
@ -90,7 +90,9 @@ define([
|
|||||||
model: seriesConfig,
|
model: seriesConfig,
|
||||||
domainObject: domainObject,
|
domainObject: domainObject,
|
||||||
collection: this,
|
collection: this,
|
||||||
openmct: this.openmct
|
openmct: this.openmct,
|
||||||
|
persistedConfig: this.plot
|
||||||
|
.getPersistedSeriesConfig(domainObject.identifier)
|
||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
removeTelemetryObject: function (identifier) {
|
removeTelemetryObject: function (identifier) {
|
||||||
|
@ -45,6 +45,7 @@ define([
|
|||||||
|
|
||||||
PlotOptionsController.prototype.updateDomainObject = function (domainObject) {
|
PlotOptionsController.prototype.updateDomainObject = function (domainObject) {
|
||||||
this.domainObject = domainObject;
|
this.domainObject = domainObject;
|
||||||
|
this.$scope.formDomainObject = domainObject;
|
||||||
};
|
};
|
||||||
|
|
||||||
PlotOptionsController.prototype.destroy = function () {
|
PlotOptionsController.prototype.destroy = function () {
|
||||||
@ -63,8 +64,7 @@ define([
|
|||||||
this.config = this.$scope.config = config;
|
this.config = this.$scope.config = config;
|
||||||
this.$scope.plotSeries = [];
|
this.$scope.plotSeries = [];
|
||||||
|
|
||||||
this.domainObject = this.config.get('domainObject');
|
this.updateDomainObject(this.config.get('domainObject'));
|
||||||
this.$scope.formDomainObject = this.domainObject;
|
|
||||||
this.unlisten = this.openmct.objects.observe(this.domainObject, '*', this.updateDomainObject.bind(this));
|
this.unlisten = this.openmct.objects.observe(this.domainObject, '*', this.updateDomainObject.bind(this));
|
||||||
|
|
||||||
this.listenTo(this.$scope, '$destroy', this.destroy, this);
|
this.listenTo(this.$scope, '$destroy', this.destroy, this);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user