mirror of
https://github.com/nasa/openmct.git
synced 2025-04-08 11:54:25 +00:00
[Timeline] Rename TimelineCSVExporter
...to TimelineColumnizer, clarifying its role/responsibilities in the context of the CSV export task; https://github.com/nasa/openmctweb/pull/728#discussion_r56031331
This commit is contained in:
parent
0ff360ced3
commit
f2c040367b
@ -26,8 +26,8 @@
|
||||
*/
|
||||
define([
|
||||
"./TimelineTraverser",
|
||||
"./TimelineCSVExporter"
|
||||
], function (TimelineTraverser, TimelineCSVExporter) {
|
||||
"./TimelineColumnizer"
|
||||
], function (TimelineTraverser, TimelineColumnizer) {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
@ -54,7 +54,7 @@ define([
|
||||
var exportService = this.exportService;
|
||||
|
||||
function doExport(objects) {
|
||||
var exporter = new TimelineCSVExporter(objects),
|
||||
var exporter = new TimelineColumnizer(objects),
|
||||
options = { headers: exporter.headers() };
|
||||
return exporter.rows().then(function (rows) {
|
||||
return exportService.exportCSV(rows, options);
|
||||
|
@ -68,7 +68,7 @@ define([
|
||||
* @constructor
|
||||
* @memberof {platform/features/timeline}
|
||||
*/
|
||||
function TimelineCSVExporter(domainObjects) {
|
||||
function TimelineColumnizer(domainObjects) {
|
||||
var maxComposition = 0,
|
||||
maxRelationships = 0,
|
||||
columnNames = {},
|
||||
@ -134,7 +134,7 @@ define([
|
||||
* the `headers`, correlated by index.
|
||||
* @returns {Promise.<string[][]>} domain object data
|
||||
*/
|
||||
TimelineCSVExporter.prototype.rows = function () {
|
||||
TimelineColumnizer.prototype.rows = function () {
|
||||
var columns = this.columns;
|
||||
|
||||
function toRow(domainObject) {
|
||||
@ -151,11 +151,11 @@ define([
|
||||
* representation of objects.
|
||||
* @returns {string[]} column headers
|
||||
*/
|
||||
TimelineCSVExporter.prototype.headers = function () {
|
||||
TimelineColumnizer.prototype.headers = function () {
|
||||
return this.columns.map(function (column) {
|
||||
return column.name();
|
||||
});
|
||||
};
|
||||
|
||||
return TimelineCSVExporter;
|
||||
return TimelineColumnizer;
|
||||
});
|
@ -22,9 +22,9 @@
|
||||
/*global define,describe,it,expect,beforeEach,waitsFor,jasmine,window,afterEach*/
|
||||
|
||||
define(
|
||||
['../../src/actions/TimelineCSVExporter'],
|
||||
function (TimelineCSVExporter) {
|
||||
describe("TimelineCSVExporter", function () {
|
||||
['../../src/actions/TimelineColumnizer'],
|
||||
function (TimelineColumnizer) {
|
||||
describe("TimelineColumnizer", function () {
|
||||
var mockDomainObjects,
|
||||
testMetadata,
|
||||
exporter;
|
||||
@ -76,7 +76,7 @@ define(
|
||||
return c === 'metadata' && testMetadata;
|
||||
});
|
||||
|
||||
exporter = new TimelineCSVExporter(mockDomainObjects);
|
||||
exporter = new TimelineColumnizer(mockDomainObjects);
|
||||
});
|
||||
|
||||
describe("rows", function () {
|
||||
@ -126,4 +126,4 @@ define(
|
||||
|
||||
});
|
||||
}
|
||||
);
|
||||
);
|
Loading…
x
Reference in New Issue
Block a user