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

added back groupsController for rm exps from report

parent 07400103
Branches
Tags
1 merge request!223Reports overhaul
/*
* Copyright (c) 2016 Idiap Research Institute, http://www.idiap.ch/
* Contact: beat.support@idiap.ch
*
* This file is part of the beat.web module of the BEAT platform.
*
* Commercial License Usage
* Licensees holding valid commercial BEAT licenses may use this file in
* accordance with the terms contained in a written agreement between you
* and Idiap. For further information contact tto@idiap.ch
*
* Alternatively, this file may be used under the terms of the GNU Affero
* Public License version 3 as published by the Free Software and appearing
* in the file LICENSE.AGPL included in the packaging of this file.
* The BEAT platform is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero Public License along
* with the BEAT platform. If not, see http://www.gnu.org/licenses/.
*/
/*
* GroupsController
* provides access to the groups data to Django templates,
* used for handling the removal of experiments from the report
*/
angular.module('reportApp').controller('GroupsController', ['$http', 'UrlService', function ($http, UrlService){
let vm = this;
vm.expNamesToRemove = [];
vm.toggleExpName = (expName) => {
console.log(vm.expNamesToRemove);
let idx = vm.expNamesToRemove.indexOf(expName);
if(idx > -1){
vm.expNamesToRemove.splice(idx, 1);
} else {
vm.expNamesToRemove.push(expName);
}
console.log(vm.expNamesToRemove);
};
vm.removeExperiments = () => {
if(vm.expNamesToRemove.length === 0){
return;
}
let url = UrlService.getRemoveExperimentUrl();
return $http({
headers: {'Content-Type': 'application/json'},
url,
method: "POST",
data: {
experiments: [...vm.expNamesToRemove]
}
})
.then(res => location.reload())
;
};
}]);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment