mirror of
https://github.com/nasa/openmct.git
synced 2025-06-10 19:31:42 +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;
|
var exportService = this.exportService;
|
||||||
|
|
||||||
function doExport(objects) {
|
function doExport(objects) {
|
||||||
var exporter = new TimelineCSVExporter(objects);
|
var exporter = new TimelineCSVExporter(objects),
|
||||||
|
options = { headers: exporter.headers() };
|
||||||
return exporter.rows().then(function (rows) {
|
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));
|
return Promise.all(this.domainObjects.map(toRow));
|
||||||
};
|
};
|
||||||
|
|
||||||
TimelineCSVExporter.prototype.options = function () {
|
TimelineCSVExporter.prototype.headers = function () {
|
||||||
return {
|
return this.columns.map(function (column) {
|
||||||
headers: this.columns.map(function (column) {
|
|
||||||
return column.name();
|
return column.name();
|
||||||
})
|
});
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return TimelineCSVExporter;
|
return TimelineCSVExporter;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user