Skip to content
Snippets Groups Projects
Commit 91c7fd20 authored by Jaden Diefenbaugh's avatar Jaden Diefenbaugh
Browse files

dont dep on globals, misc style fixes for factories

parent b87bd32b
No related branches found
No related tags found
2 merge requests!223Reports overhaul,!220WIP: Experiment groups
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
* with the BEAT platform. If not, see http://www.gnu.org/licenses/. * with the BEAT platform. If not, see http://www.gnu.org/licenses/.
*/ */
//This factory retrieves data from the static files and associates it with the $scope //This factory retrieves data from the static files and associates it with the $scope
app.factory('dataFactory', function($http){ angular.module('reportApp').factory('dataFactory', function($http){
var getData = function (URL) { var getData = function (URL) {
//return $http.get(URL + 'itemcontent.json'); //return $http.get(URL + 'itemcontent.json');
var obj = {content:null}; var obj = {content:null};
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
* with the BEAT platform. If not, see http://www.gnu.org/licenses/. * with the BEAT platform. If not, see http://www.gnu.org/licenses/.
*/ */
//This factory retrieves data from the REST API and associates it with the $scope //This factory retrieves data from the REST API and associates it with the $scope
app.factory('experimentFactory', function($http, $q){ angular.module('reportApp').factory('experimentFactory', function($http, $q){
return { return {
getExperimentInformation: function (url_prefix, experiment_id){ getExperimentInformation: function (url_prefix, experiment_id){
urlBase = url_prefix + '/api/v1/experiments'; urlBase = url_prefix + '/api/v1/experiments';
...@@ -45,6 +45,5 @@ app.factory('experimentFactory', function($http, $q){ ...@@ -45,6 +45,5 @@ app.factory('experimentFactory', function($http, $q){
return response.data; return response.data;
}); });
} }
};
}
}); });
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
* with the BEAT platform. If not, see http://www.gnu.org/licenses/. * with the BEAT platform. If not, see http://www.gnu.org/licenses/.
*/ */
//This factory retrieves data from the REST API and associates it with the $scope //This factory retrieves data from the REST API and associates it with the $scope
app.factory('plotterFactory', ['$http', function($http){ angular.module('reportApp').factory('plotterFactory', ['$http', function($http){
var plotterFactory = {}; var plotterFactory = {};
plotterFactory.getPlotters = function (url_prefix){ plotterFactory.getPlotters = function (url_prefix){
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
* with the BEAT platform. If not, see http://www.gnu.org/licenses/. * with the BEAT platform. If not, see http://www.gnu.org/licenses/.
*/ */
//This factory retrieves data from the REST API and associates it with the $scope //This factory retrieves data from the REST API and associates it with the $scope
app.factory('reportFactory', ['$http', 'experimentFactory', function($http, experimentFactory) { angular.module('reportApp').factory('reportFactory', ['$http', 'experimentFactory', function($http, experimentFactory) {
var urlBase = '/api/v1/reports'; var urlBase = '/api/v1/reports';
var reportFactory = {}; var reportFactory = {};
...@@ -43,8 +43,7 @@ app.factory('reportFactory', ['$http', 'experimentFactory', function($http, expe ...@@ -43,8 +43,7 @@ app.factory('reportFactory', ['$http', 'experimentFactory', function($http, expe
url: urlBase + '/' + user + '/' + report_id + '/', url: urlBase + '/' + user + '/' + report_id + '/',
method: "PUT", method: "PUT",
data: reportData, data: reportData,
}) });
}; };
reportFactory.lockReport = function (user, report_id, url_prefix){ reportFactory.lockReport = function (user, report_id, url_prefix){
...@@ -56,8 +55,7 @@ app.factory('reportFactory', ['$http', 'experimentFactory', function($http, expe ...@@ -56,8 +55,7 @@ app.factory('reportFactory', ['$http', 'experimentFactory', function($http, expe
url: urlBase + '/' + user + '/' + report_id + '/lock/', url: urlBase + '/' + user + '/' + report_id + '/lock/',
method: "POST", method: "POST",
//data: reportData, //data: reportData,
}) });
}; };
reportFactory.publishReport = function (url_prefix, user, report_id, reportData){ reportFactory.publishReport = function (url_prefix, user, report_id, reportData){
...@@ -69,8 +67,7 @@ app.factory('reportFactory', ['$http', 'experimentFactory', function($http, expe ...@@ -69,8 +67,7 @@ app.factory('reportFactory', ['$http', 'experimentFactory', function($http, expe
url: urlBase + '/' + user + '/' + report_id + '/publish/', url: urlBase + '/' + user + '/' + report_id + '/publish/',
method: "POST", method: "POST",
data: reportData, data: reportData,
}) });
}; };
reportFactory.publishReportAlgorithms = function (user, report_id, url_prefix){ reportFactory.publishReportAlgorithms = function (user, report_id, url_prefix){
...@@ -82,8 +79,7 @@ app.factory('reportFactory', ['$http', 'experimentFactory', function($http, expe ...@@ -82,8 +79,7 @@ app.factory('reportFactory', ['$http', 'experimentFactory', function($http, expe
url: urlBase + '/' + user + '/' + report_id + '/algorithms/', url: urlBase + '/' + user + '/' + report_id + '/algorithms/',
method: "GET", method: "GET",
//data: reportData, //data: reportData,
}) });
}; };
reportFactory.removeExperiment = function (user, report_id, experiment, url_prefix){ reportFactory.removeExperiment = function (user, report_id, experiment, url_prefix){
...@@ -95,8 +91,7 @@ app.factory('reportFactory', ['$http', 'experimentFactory', function($http, expe ...@@ -95,8 +91,7 @@ app.factory('reportFactory', ['$http', 'experimentFactory', function($http, expe
url: urlBase + '/' + user + '/' + report_id + '/remove/', url: urlBase + '/' + user + '/' + report_id + '/remove/',
method: "POST", method: "POST",
data: experiment, data: experiment,
}) });
}; };
return reportFactory; return reportFactory;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment