[Timeline] Show progress notification during export
This commit is contained in:
@@ -93,7 +93,7 @@ define([
|
|||||||
"name": "Export Timeline as CSV",
|
"name": "Export Timeline as CSV",
|
||||||
"category": "contextual",
|
"category": "contextual",
|
||||||
"implementation": ExportTimelineAsCSVAction,
|
"implementation": ExportTimelineAsCSVAction,
|
||||||
"depends": [ "exportService" ]
|
"depends": [ "exportService", "notificationService" ]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"constants": [
|
"constants": [
|
||||||
|
|||||||
@@ -24,17 +24,29 @@
|
|||||||
define(["./ExportTimelineAsCSVTask"], function (ExportTimelineAsCSVTask) {
|
define(["./ExportTimelineAsCSVTask"], function (ExportTimelineAsCSVTask) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
function ExportTimelineAsCSVAction(exportService, context) {
|
function ExportTimelineAsCSVAction(exportService, notificationService, context) {
|
||||||
this.task = new ExportTimelineAsCSVTask(
|
this.task = new ExportTimelineAsCSVTask(
|
||||||
exportService,
|
exportService,
|
||||||
context.domainObject
|
context.domainObject
|
||||||
);
|
);
|
||||||
//this.taskService = taskService;
|
this.notificationService = notificationService;
|
||||||
}
|
}
|
||||||
|
|
||||||
ExportTimelineAsCSVAction.prototype.perform = function () {
|
ExportTimelineAsCSVAction.prototype.perform = function () {
|
||||||
return this.task.run();
|
var notificationService = this.notificationService,
|
||||||
//return this.taskService.run(this.task);
|
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) {
|
ExportTimelineAsCSVAction.appliesTo = function (context) {
|
||||||
|
|||||||
Reference in New Issue
Block a user