mirror of
https://github.com/nasa/openmct.git
synced 2025-06-22 17:08:57 +00:00
[Telemetry Tables] Don't mutate configuration if object is not able to be persisted (#7626)
* source maps * do not persist if obj is not persistable * nope * prevent mutation of configuration * static roots are read only by nature * helps to use functions correctly * update persistModeChange logic * remove debug * remove unnecessary change
This commit is contained in:
@ -40,6 +40,8 @@ export default class TelemetryTableConfiguration extends EventEmitter {
|
|||||||
'configuration',
|
'configuration',
|
||||||
this.objectMutated
|
this.objectMutated
|
||||||
);
|
);
|
||||||
|
|
||||||
|
this.notPersistable = !this.openmct.objects.isPersistable(this.domainObject.identifier);
|
||||||
}
|
}
|
||||||
|
|
||||||
getConfiguration() {
|
getConfiguration() {
|
||||||
@ -52,14 +54,19 @@ export default class TelemetryTableConfiguration extends EventEmitter {
|
|||||||
// anything that doesn't have a telemetryMode existed before the change and should
|
// anything that doesn't have a telemetryMode existed before the change and should
|
||||||
// take the properties of any passed in defaults or the defaults from the plugin
|
// take the properties of any passed in defaults or the defaults from the plugin
|
||||||
configuration.telemetryMode = configuration.telemetryMode ?? this.defaultOptions.telemetryMode;
|
configuration.telemetryMode = configuration.telemetryMode ?? this.defaultOptions.telemetryMode;
|
||||||
configuration.persistModeChange =
|
configuration.persistModeChange = this.notPersistable
|
||||||
configuration.persistModeChange ?? this.defaultOptions.persistModeChange;
|
? false
|
||||||
|
: configuration.persistModeChange ?? this.defaultOptions.persistModeChange;
|
||||||
configuration.rowLimit = configuration.rowLimit ?? this.defaultOptions.rowLimit;
|
configuration.rowLimit = configuration.rowLimit ?? this.defaultOptions.rowLimit;
|
||||||
|
|
||||||
return configuration;
|
return configuration;
|
||||||
}
|
}
|
||||||
|
|
||||||
updateConfiguration(configuration) {
|
updateConfiguration(configuration) {
|
||||||
|
if (this.notPersistable) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.openmct.objects.mutate(this.domainObject, 'configuration', configuration);
|
this.openmct.objects.mutate(this.domainObject, 'configuration', configuration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user