mirror of
https://github.com/nasa/openmct.git
synced 2025-04-16 15:29:20 +00:00
[Telem] add backwards compat and warning
Add backwards compatibility for x/y hints, and log a warning to console when x/y hints are encountered. Fixes https://github.com/nasa/openmct/issues/1546
This commit is contained in:
parent
81208d617f
commit
0a3d51c6b5
@ -19,7 +19,7 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
|
||||
/*global console*/
|
||||
|
||||
define([
|
||||
'lodash'
|
||||
@ -76,6 +76,30 @@ define([
|
||||
valueMetadata.source = valueMetadata.source || valueMetadata.key;
|
||||
valueMetadata.hints = valueMetadata.hints || {};
|
||||
|
||||
if (valueMetadata.hints.hasOwnProperty('x')) {
|
||||
console.warn(
|
||||
'DEPRECIATION WARNING: `x` hints should be replaced with ' +
|
||||
'`domain` hints moving forward. ' +
|
||||
'https://github.com/nasa/openmct/issues/1546'
|
||||
);
|
||||
if (!valueMetadata.hints.hasOwnProperty('domain')) {
|
||||
valueMetadata.hints.domain = valueMetadata.hints.x;
|
||||
}
|
||||
delete valueMetadata.hints.x;
|
||||
}
|
||||
|
||||
if (valueMetadata.hints.hasOwnProperty('y')) {
|
||||
console.warn(
|
||||
'DEPRECIATION WARNING: `y` hints should be replaced with ' +
|
||||
'`range` hints moving forward. ' +
|
||||
'https://github.com/nasa/openmct/issues/1546'
|
||||
);
|
||||
if (!valueMetadata.hints.hasOwnProperty('range')) {
|
||||
valueMetadata.hints.range = valueMetadata.hints.y;
|
||||
}
|
||||
delete valueMetadata.hints.y;
|
||||
}
|
||||
|
||||
if (!valueMetadata.hints.hasOwnProperty('priority')) {
|
||||
valueMetadata.hints.priority = index;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user