diff --git a/platform/features/timeline/bundle.js b/platform/features/timeline/bundle.js index a791fc4fb0..3cf2935bc6 100644 --- a/platform/features/timeline/bundle.js +++ b/platform/features/timeline/bundle.js @@ -22,6 +22,7 @@ /*global define*/ define([ + "./src/actions/ExportTimelineAsCSVAction", "./src/controllers/TimelineController", "./src/controllers/TimelineGraphController", "./src/controllers/TimelineDateTimeController", @@ -40,6 +41,7 @@ define([ "./src/services/ObjectLoader", 'legacyRegistry' ], function ( + ExportTimelineAsCSVAction, TimelineController, TimelineGraphController, TimelineDateTimeController, @@ -65,6 +67,15 @@ define([ "description": "Resources, templates, CSS, and code for Timelines.", "resources": "res", "extensions": { + "actions": [ + { + "key": "timeline.export", + "name": "Export Timeline as CSV", + "category": "contextual", + "implementation": ExportTimelineAsCSVAction, + "depends": [ "exportService" ] + } + ], "constants": [ { "key": "TIMELINE_MINIMUM_DURATION", diff --git a/platform/features/timeline/src/actions/ExportTimelineAsCSVAction.js b/platform/features/timeline/src/actions/ExportTimelineAsCSVAction.js index 2e0dc71589..099261256f 100644 --- a/platform/features/timeline/src/actions/ExportTimelineAsCSVAction.js +++ b/platform/features/timeline/src/actions/ExportTimelineAsCSVAction.js @@ -24,13 +24,17 @@ define(["./ExportTimelineAsCSVTask"], function (ExportTimelineAsCSVTask) { 'use strict'; - function ExportTimelineAsCSVAction(taskService, context) { - this.task = new ExportTimelineAsCSVTask(context.domainObject); - this.taskService = taskService; + function ExportTimelineAsCSVAction(exportService, context) { + this.task = new ExportTimelineAsCSVTask( + exportService, + context.domainObject + ); + //this.taskService = taskService; } ExportTimelineAsCSVAction.prototype.perform = function () { - return this.taskService.run(this.task); + return this.task.run(); + //return this.taskService.run(this.task); }; ExportTimelineAsCSVAction.appliesTo = function (context) { diff --git a/platform/features/timeline/src/actions/ExportTimelineAsCSVTask.js b/platform/features/timeline/src/actions/ExportTimelineAsCSVTask.js index 45ebdffd2f..a854716367 100644 --- a/platform/features/timeline/src/actions/ExportTimelineAsCSVTask.js +++ b/platform/features/timeline/src/actions/ExportTimelineAsCSVTask.js @@ -25,7 +25,8 @@ * Module defining ExportTimelineAsCSVTask. Created by vwoeltje on 2/8/16. */ define([ - "TimelineTraverser" + "./TimelineTraverser", + "./TimelineCSVExporter" ], function (TimelineTraverser, TimelineCSVExporter) { "use strict"; diff --git a/platform/features/timeline/src/actions/TimelineCSVExporter.js b/platform/features/timeline/src/actions/TimelineCSVExporter.js index b42debad93..8364ab2c01 100644 --- a/platform/features/timeline/src/actions/TimelineCSVExporter.js +++ b/platform/features/timeline/src/actions/TimelineCSVExporter.js @@ -22,9 +22,9 @@ /*global define,Promise*/ define([ - "ModeColumn", - "CompositionColumn", - "MetadataColumn" + "./ModeColumn", + "./CompositionColumn", + "./MetadataColumn" ], function (ModeColumn, CompositionColumn, MetadataColumn) { 'use strict'; diff --git a/platform/features/timeline/src/actions/TimelineTraverser.js b/platform/features/timeline/src/actions/TimelineTraverser.js index 0f701a4799..48817b6963 100644 --- a/platform/features/timeline/src/actions/TimelineTraverser.js +++ b/platform/features/timeline/src/actions/TimelineTraverser.js @@ -22,6 +22,7 @@ /*global define,Promise*/ define([], function () { + "use strict"; function TimelineTraverser(domainObject) { this.domainObject = domainObject;