mirror of
https://github.com/nasa/openmct.git
synced 2025-06-19 07:38:15 +00:00
[Timelines] Remove excessive ternaries
...to improve readability of logic to determine which columns are needed for a given group of domain objects for CSV export, as requested during code review, https://github.com/nasa/openmctweb/pull/728#discussion_r55910477
This commit is contained in:
@ -88,21 +88,26 @@ define([
|
|||||||
|
|
||||||
domainObjects.forEach(function (domainObject) {
|
domainObjects.forEach(function (domainObject) {
|
||||||
var model = domainObject.getModel(),
|
var model = domainObject.getModel(),
|
||||||
compositionLength = model.composition ?
|
composition = model.composition,
|
||||||
model.composition.length : 0,
|
relationships = model.relationships,
|
||||||
relationshipLength = (model.relationships || {}).modes ?
|
modes = relationships && relationships.modes,
|
||||||
model.relationships.modes.length :
|
metadataProperties = domainObject.useCapability('metadata');
|
||||||
0,
|
|
||||||
metadataProperties =
|
|
||||||
domainObject.useCapability('metadata') || [];
|
|
||||||
|
|
||||||
maxComposition = Math.max(maxComposition, compositionLength);
|
if (composition) {
|
||||||
maxRelationships = Math.max(maxRelationships, relationshipLength);
|
maxComposition = Math.max(maxComposition, composition.length);
|
||||||
|
}
|
||||||
|
|
||||||
foundTimespan =
|
if (modes) {
|
||||||
foundTimespan || domainObject.hasCapability('timespan');
|
maxRelationships = Math.max(maxRelationships, modes.length);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (domainObject.hasCapability('timespan')) {
|
||||||
|
foundTimespan = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (metadataProperties) {
|
||||||
metadataProperties.forEach(addMetadataProperty);
|
metadataProperties.forEach(addMetadataProperty);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (foundTimespan) {
|
if (foundTimespan) {
|
||||||
|
Reference in New Issue
Block a user