mirror of
https://github.com/nasa/openmct.git
synced 2025-04-15 15:06:47 +00:00
[Timeline] Simplify interface
...such that responsibility for knowing exportService interface is more localized.
This commit is contained in:
parent
75d6803c9f
commit
43db52fd70
@ -45,9 +45,10 @@ define([
|
||||
var exportService = this.exportService;
|
||||
|
||||
function doExport(objects) {
|
||||
var exporter = new TimelineCSVExporter(objects);
|
||||
var exporter = new TimelineCSVExporter(objects),
|
||||
options = { headers: exporter.headers() };
|
||||
return exporter.rows().then(function (rows) {
|
||||
return exportService.exportCSV(rows, exporter.options());
|
||||
return exportService.exportCSV(rows, options);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -93,12 +93,10 @@ define([
|
||||
return Promise.all(this.domainObjects.map(toRow));
|
||||
};
|
||||
|
||||
TimelineCSVExporter.prototype.options = function () {
|
||||
return {
|
||||
headers: this.columns.map(function (column) {
|
||||
return column.name();
|
||||
})
|
||||
};
|
||||
TimelineCSVExporter.prototype.headers = function () {
|
||||
return this.columns.map(function (column) {
|
||||
return column.name();
|
||||
});
|
||||
};
|
||||
|
||||
return TimelineCSVExporter;
|
||||
|
Loading…
x
Reference in New Issue
Block a user