mirror of
https://github.com/nasa/openmct.git
synced 2024-12-30 01:48:51 +00:00
[Timeline] Show progress notification during export
This commit is contained in:
parent
14b8e02f27
commit
c4f1c4ad1f
@ -93,7 +93,7 @@ define([
|
||||
"name": "Export Timeline as CSV",
|
||||
"category": "contextual",
|
||||
"implementation": ExportTimelineAsCSVAction,
|
||||
"depends": [ "exportService" ]
|
||||
"depends": [ "exportService", "notificationService" ]
|
||||
}
|
||||
],
|
||||
"constants": [
|
||||
|
@ -24,17 +24,29 @@
|
||||
define(["./ExportTimelineAsCSVTask"], function (ExportTimelineAsCSVTask) {
|
||||
'use strict';
|
||||
|
||||
function ExportTimelineAsCSVAction(exportService, context) {
|
||||
function ExportTimelineAsCSVAction(exportService, notificationService, context) {
|
||||
this.task = new ExportTimelineAsCSVTask(
|
||||
exportService,
|
||||
context.domainObject
|
||||
);
|
||||
//this.taskService = taskService;
|
||||
this.notificationService = notificationService;
|
||||
}
|
||||
|
||||
ExportTimelineAsCSVAction.prototype.perform = function () {
|
||||
return this.task.run();
|
||||
//return this.taskService.run(this.task);
|
||||
var notificationService = this.notificationService,
|
||||
notification = notificationService.notify({
|
||||
title: "Exporting CSV",
|
||||
unknownProgress: true
|
||||
});
|
||||
|
||||
return this.task.run()
|
||||
.then(function () {
|
||||
notification.dismiss();
|
||||
})
|
||||
.catch(function () {
|
||||
notification.dismiss();
|
||||
notificationService.error("Error exporting CSV");
|
||||
});
|
||||
};
|
||||
|
||||
ExportTimelineAsCSVAction.appliesTo = function (context) {
|
||||
|
Loading…
Reference in New Issue
Block a user