diff --git a/unionvms-web/app/partial/activity/tripReportsList/tripReportsList.js b/unionvms-web/app/partial/activity/tripReportsList/tripReportsList.js
index acfba346a..fd1aae900 100644
--- a/unionvms-web/app/partial/activity/tripReportsList/tripReportsList.js
+++ b/unionvms-web/app/partial/activity/tripReportsList/tripReportsList.js
@@ -21,7 +21,7 @@ copy of the GNU General Public License along with the IFDM Suite. If not, see {@link unionvmsWeb.activityRestFactory}
+ * @param activityRestFactory {service} The REST factory for the activity module
{@link unionvmsWeb.activityRestFactory}
* @description
* REST services for the activity module
*/
@@ -170,7 +176,7 @@ angular.module('unionvmsWeb').factory('activityRestFactory', function ($resource
var activityService = {
/**
* Get the user preferences for the activty module
- *
+ *
* @memberof activityRestService
* @public
* @returns {Promise} A promise with either the user preferences of the activity module or reject error
@@ -187,7 +193,7 @@ angular.module('unionvmsWeb').factory('activityRestFactory', function ($resource
},
/**
* Get a list of fishing activity reports according to search criteria
- *
+ *
* @memberof activityRestService
* @public
* @param {Object} data - The search criteria and table pagination data object
@@ -225,7 +231,7 @@ angular.module('unionvmsWeb').factory('activityRestFactory', function ($resource
},
/**
* Get the history for a FA report
- *
+ *
* @memberof activityRestService
* @public
* @param {Number} refId - The reference ID
@@ -261,7 +267,7 @@ angular.module('unionvmsWeb').factory('activityRestFactory', function ($resource
},
/**
* Get the vessel and roles details of a specific trip
- *
+ *
* @memberof activityRestService
* @public
* @param {String} id - The trip id of the selected trip
@@ -278,7 +284,7 @@ angular.module('unionvmsWeb').factory('activityRestFactory', function ($resource
},
/**
* Get the message type count of a specific trip
- *
+ *
* @memberof activityRestService
* @public
* @param {String} id - The trip id of the selected trip
@@ -295,7 +301,7 @@ angular.module('unionvmsWeb').factory('activityRestFactory', function ($resource
},
/**
* Get the trip reports of a specific trip
- *
+ *
* @memberof activityRestService
* @public
* @param {String} id - The trip id of the selected trip
@@ -312,7 +318,7 @@ angular.module('unionvmsWeb').factory('activityRestFactory', function ($resource
},
/**
* Get the trip map data
- *
+ *
* @memberof activityRestService
* @public
* @param {String} id - The trip id of the selected trip
@@ -345,8 +351,8 @@ angular.module('unionvmsWeb').factory('activityRestFactory', function ($resource
return deferred.promise;
},
/**
- * Get the Catches Evolution Details.
- *
+ * Get the Catches Evolution Details.
+ *
* @memberof activityRestService
* @public
* @param {String} id - The trip id of the selected trip
@@ -364,11 +370,11 @@ angular.module('unionvmsWeb').factory('activityRestFactory', function ($resource
},
/**
* Get Fishing Activity details by type
- *
+ *
* @memberof activityRestService
* @public
* @param {String} type - The fisihing activity type (e.g. departure, landing, arrival)
- * @param {Object} payload - The post payload containing the activity id (mandatory) and the trip id (not mandatory and to be used only in the report tab)
+ * @param {Object} payload - The post payload containing the activity id (mandatory) and the trip id (not mandatory and to be used only in the report tab)
* @returns {Promise} A promise with either the fishing activity details or reject error
*/
getFishingActivityDetails: function(type, payload){
@@ -384,7 +390,7 @@ angular.module('unionvmsWeb').factory('activityRestFactory', function ($resource
},
/**
* Get commchannels data
- *
+ *
* @memberof activityRestService
* @public
* @returns {Promise} A promise with either the fishing activity details or reject error
@@ -397,6 +403,24 @@ angular.module('unionvmsWeb').factory('activityRestFactory', function ($resource
deferred.reject(error);
});
return deferred.promise;
+ },
+ exportActivityListToCsv: function (query) {
+ return activityRestFactory.exportActivityListToCsv(query).then(
+ function (response) {
+ return response.data;
+ }, function () {
+ console.error('Failed to export activities to CSV');
+ return {};
+ });
+ },
+ exportTripListToCsv: function (query) {
+ return activityRestFactory.exportTripListToCsv(query).then(
+ function (response) {
+ return response.data;
+ }, function () {
+ console.error('Failed to export trips to CSV');
+ return {};
+ });
}
};
diff --git a/unionvms-web/app/service/activity/activityService.js b/unionvms-web/app/service/activity/activityService.js
index 6f90c0b06..85fd3c27d 100644
--- a/unionvms-web/app/service/activity/activityService.js
+++ b/unionvms-web/app/service/activity/activityService.js
@@ -32,7 +32,7 @@ copy of the GNU General Public License along with the IFDM Suite. If not, see