mirror of
https://github.com/nasa/openmct.git
synced 2025-01-02 03:16:41 +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",
|
"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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user