[Timeline] Show progress notification during export

This commit is contained in:
Victor Woeltjen 2016-03-07 16:09:23 -08:00
parent 14b8e02f27
commit c4f1c4ad1f
2 changed files with 17 additions and 5 deletions

View File

@ -93,7 +93,7 @@ define([
"name": "Export Timeline as CSV",
"category": "contextual",
"implementation": ExportTimelineAsCSVAction,
"depends": [ "exportService" ]
"depends": [ "exportService", "notificationService" ]
}
],
"constants": [

View File

@ -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) {