mirror of
https://github.com/nasa/openmct.git
synced 2025-06-19 07:38:15 +00:00
New eslint rules auto fix (#3058)
* no-implicit-coercion and no-unneeded-ternary * End every line with a semicolon * Spacing and formatting * Enabled semi-spacing * Applies npm run lint:fix to code after master merge * Fix merge issues * Switched operator-linebreak to 'before' Co-authored-by: Joshi <simplyrender@gmail.com>
This commit is contained in:
@ -33,25 +33,27 @@ define([
|
||||
|
||||
if (valueMetadata.hints.hasOwnProperty('x')) {
|
||||
console.warn(
|
||||
'DEPRECATION WARNING: `x` hints should be replaced with ' +
|
||||
'`domain` hints moving forward. ' +
|
||||
'https://github.com/nasa/openmct/issues/1546'
|
||||
'DEPRECATION 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(
|
||||
'DEPRECATION WARNING: `y` hints should be replaced with ' +
|
||||
'`range` hints moving forward. ' +
|
||||
'https://github.com/nasa/openmct/issues/1546'
|
||||
'DEPRECATION 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;
|
||||
}
|
||||
|
||||
@ -59,9 +61,11 @@ define([
|
||||
if (!valueMetadata.values) {
|
||||
valueMetadata.values = valueMetadata.enumerations.map(e => e.value);
|
||||
}
|
||||
|
||||
if (!valueMetadata.hasOwnProperty('max')) {
|
||||
valueMetadata.max = Math.max(valueMetadata.values) + 1;
|
||||
}
|
||||
|
||||
if (!valueMetadata.hasOwnProperty('min')) {
|
||||
valueMetadata.min = Math.min(valueMetadata.values) - 1;
|
||||
}
|
||||
@ -70,6 +74,7 @@ define([
|
||||
if (!valueMetadata.hints.hasOwnProperty('priority')) {
|
||||
valueMetadata.hints.priority = index;
|
||||
}
|
||||
|
||||
return valueMetadata;
|
||||
}
|
||||
|
||||
@ -112,21 +117,24 @@ define([
|
||||
/*jshint validthis: true */
|
||||
return this.hints.hasOwnProperty(hint);
|
||||
}
|
||||
|
||||
function hasHints(metadata) {
|
||||
return hints.every(hasHint, metadata);
|
||||
}
|
||||
|
||||
var matchingMetadata = this.valueMetadatas.filter(hasHints);
|
||||
let iteratees = hints.map(hint => {
|
||||
return (metadata) => {
|
||||
return metadata.hints[hint];
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
return _.sortBy(matchingMetadata, ...iteratees);
|
||||
};
|
||||
|
||||
TelemetryMetadataManager.prototype.getFilterableValues = function () {
|
||||
return this.valueMetadatas.filter(metadatum => metadatum.filters && metadatum.filters.length > 0);
|
||||
}
|
||||
};
|
||||
|
||||
TelemetryMetadataManager.prototype.getDefaultDisplayValue = function () {
|
||||
let valueMetadata = this.valuesForHints(['range'])[0];
|
||||
@ -144,7 +152,6 @@ define([
|
||||
return valueMetadata.key;
|
||||
};
|
||||
|
||||
|
||||
return TelemetryMetadataManager;
|
||||
|
||||
});
|
||||
|
Reference in New Issue
Block a user