Skip to content

[Telemetry Tables] Don't mutate configuration if object is not able to be persisted #7626

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Apr 4, 2024
11 changes: 9 additions & 2 deletions src/plugins/telemetryTable/TelemetryTableConfiguration.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
'configuration',
this.objectMutated
);

this.notPersistable = !this.openmct.objects.isPersistable(this.domainObject.identifier);
}

getConfiguration() {
Expand All @@ -52,14 +54,19 @@
// 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;

Check warning on line 67 in src/plugins/telemetryTable/TelemetryTableConfiguration.js

View check run for this annotation

Codecov / codecov/patch

src/plugins/telemetryTable/TelemetryTableConfiguration.js#L67

Added line #L67 was not covered by tests
}

this.openmct.objects.mutate(this.domainObject, 'configuration', configuration);
}

Expand Down
Loading