mirror of
https://github.com/nasa/openmct.git
synced 2025-04-21 17:41:43 +00:00
Build columns from union of telemetry value metadata. (#2075)
* Build columns from union of telemetry value metadata. Do not manually clean up scope. Fixes #2027. Fixes #1884. Fixes #1817. * Fixed tests that are failing on circle-ci * Inlined getMetadataValues function
This commit is contained in:
parent
a3e78bbf91
commit
45a152df86
platform
commonUI/formats/src
features/table
src/controllers
test/controllers
@ -115,8 +115,10 @@ define([
|
||||
UTCTimeFormat.prototype.format = function (value) {
|
||||
if (arguments.length > 1) {
|
||||
return getScaledFormat(value);
|
||||
} else {
|
||||
} else if (value !== undefined) {
|
||||
return moment.utc(value).format(DATE_FORMAT) + "Z";
|
||||
} else {
|
||||
return value;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -180,10 +180,6 @@ define(
|
||||
this.scrollable.off('scroll', this.onScroll);
|
||||
this.destroyConductorListeners();
|
||||
|
||||
// In case for some reason this controller instance lingers around,
|
||||
// destroy scope as it can be extremely large for large tables.
|
||||
delete this.$scope;
|
||||
|
||||
}.bind(this));
|
||||
}
|
||||
|
||||
|
@ -226,12 +226,6 @@ define(
|
||||
if (this.timeoutHandle) {
|
||||
this.$timeout.cancel(this.timeoutHandle);
|
||||
}
|
||||
|
||||
// In case controller instance lingers around (currently there is a
|
||||
// temporary memory leak with PlotController), clean up scope as it
|
||||
// can be extremely large.
|
||||
this.$scope = null;
|
||||
this.table = null;
|
||||
};
|
||||
|
||||
/**
|
||||
@ -246,12 +240,16 @@ define(
|
||||
this.$scope.headers = [];
|
||||
|
||||
if (objects.length > 0) {
|
||||
var metadatas = objects.map(telemetryApi.getMetadata.bind(telemetryApi));
|
||||
var allColumns = telemetryApi.commonValuesForHints(metadatas, []);
|
||||
var allMetadata = objects.map(telemetryApi.getMetadata.bind(telemetryApi));
|
||||
var allValueMetadata = _.flatten(allMetadata.map(
|
||||
function getMetadataValues(metadata) {
|
||||
return metadata.values();
|
||||
}
|
||||
));
|
||||
|
||||
this.table.populateColumns(allColumns);
|
||||
this.table.populateColumns(allValueMetadata);
|
||||
|
||||
var domainColumns = telemetryApi.commonValuesForHints(metadatas, ['domain']);
|
||||
var domainColumns = telemetryApi.commonValuesForHints(allMetadata, ['domain']);
|
||||
this.timeColumns = domainColumns.map(function (metadatum) {
|
||||
return metadatum.name;
|
||||
});
|
||||
@ -269,6 +267,7 @@ define(
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return objects;
|
||||
};
|
||||
|
||||
|
@ -116,7 +116,11 @@ define(
|
||||
formatter.parse.andCallFake(getter);
|
||||
return formatter;
|
||||
});
|
||||
|
||||
mockTelemetryAPI.getMetadata.andReturn({
|
||||
values: function () {
|
||||
return [];
|
||||
}
|
||||
});
|
||||
mockTelemetryAPI.isTelemetryObject.andReturn(false);
|
||||
|
||||
mockTimeout = jasmine.createSpy("timeout");
|
||||
@ -363,7 +367,11 @@ define(
|
||||
mockTelemetryAPI.commonValuesForHints.andCallFake(function (metadata, hints) {
|
||||
if (_.eq(hints, ["domain"])) {
|
||||
return domainMetadata;
|
||||
} else if (_.eq(hints, [])) {
|
||||
}
|
||||
});
|
||||
|
||||
mockTelemetryAPI.getMetadata.andReturn({
|
||||
values: function () {
|
||||
return allMetadata;
|
||||
}
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user