mirror of
https://github.com/nasa/openmct.git
synced 2025-02-20 17:33:23 +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:
parent
311ad0b87a
commit
de3dad02b5
@ -40,6 +40,8 @@ export default class TelemetryTableConfiguration extends EventEmitter {
|
||||
'configuration',
|
||||
this.objectMutated
|
||||
);
|
||||
|
||||
this.notPersistable = !this.openmct.objects.isPersistable(this.domainObject.identifier);
|
||||
}
|
||||
|
||||
getConfiguration() {
|
||||
@ -52,14 +54,19 @@ export default class TelemetryTableConfiguration extends EventEmitter {
|
||||
// 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
|
||||
configuration.telemetryMode = configuration.telemetryMode ?? this.defaultOptions.telemetryMode;
|
||||
configuration.persistModeChange =
|
||||
configuration.persistModeChange ?? this.defaultOptions.persistModeChange;
|
||||
configuration.persistModeChange = this.notPersistable
|
||||
? false
|
||||
: configuration.persistModeChange ?? this.defaultOptions.persistModeChange;
|
||||
configuration.rowLimit = configuration.rowLimit ?? this.defaultOptions.rowLimit;
|
||||
|
||||
return configuration;
|
||||
}
|
||||
|
||||
updateConfiguration(configuration) {
|
||||
if (this.notPersistable) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.openmct.objects.mutate(this.domainObject, 'configuration', configuration);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user