Remove legacy formats (#4531)

* Remove legacy bundles

* Replace legacy format management with vanilla JS

* Redefine legacy formats in plugins instead of bundles

* Remove 'draft' from API documentation

* Remove focus from test spec

* Register local time system using new API

* Fixed broken custom formatter test spec

* Make capitalization consistent

* Rewrite test for terse formatting for time conductor

* Make dependency on UTCTimeFormat explicit

Co-authored-by: John Hill <john.c.hill@nasa.gov>
This commit is contained in:
Andrew Henry
2021-12-17 09:11:13 -08:00
committed by GitHub
parent 01d02642e8
commit fd0e89ca05
22 changed files with 191 additions and 537 deletions

View File

@ -144,6 +144,7 @@ define([
this.metadataCache = new WeakMap();
this.formatMapCache = new WeakMap();
this.valueFormatterCache = new WeakMap();
this.formatters = new Map();
this.requestAbortControllers = new Set();
}
@ -445,17 +446,6 @@ define([
return _.sortBy(options, sortKeys);
};
/**
* @private
*/
TelemetryAPI.prototype.getFormatService = function () {
if (!this.formatService) {
this.formatService = this.openmct.$injector.get('formatService');
}
return this.formatService;
};
/**
* Get a value formatter for a given valueMetadata.
*
@ -465,7 +455,7 @@ define([
if (!this.valueFormatterCache.has(valueMetadata)) {
this.valueFormatterCache.set(
valueMetadata,
new TelemetryValueFormatter(valueMetadata, this.getFormatService())
new TelemetryValueFormatter(valueMetadata, this.formatters)
);
}
@ -479,9 +469,7 @@ define([
* @returns {Format}
*/
TelemetryAPI.prototype.getFormatter = function (key) {
const formatMap = this.getFormatService().formatMap;
return formatMap[key];
return this.formatters.get(key);
};
/**
@ -512,12 +500,7 @@ define([
* @param {Format} format the
*/
TelemetryAPI.prototype.addFormat = function (format) {
this.openmct.legacyExtension('formats', {
key: format.key,
implementation: function () {
return format;
}
});
this.formatters.set(format.key, format);
};
/**