fix: Do not remove every delegated_QA on dropDelegatedQA

This commit is contained in:
Victor Chartraire 2024-09-18 18:06:23 +02:00 committed by victor.chartraire
parent 3d2606ab9c
commit 3316375cbb

View File

@ -637,16 +637,15 @@ angular.module("FICApp")
} }
} }
$scope.dropDelegatedQA = function (member) { $scope.dropDelegatedQA = function (member) {
if ($scope.config.delegated_qa) { if (!$scope.config.delegated_qa) {
$scope.config.delegated_qa = []; $scope.config.delegated_qa = [];
}
angular.forEach($scope.config.delegated_qa, function (m, k) { angular.forEach($scope.config.delegated_qa, function (m, k) {
if (member == m) if (member == m)
$scope.config.delegated_qa.splice(k, 1); $scope.config.delegated_qa.splice(k, 1);
}); });
$scope.saveSettings(); $scope.saveSettings();
} }
}
$scope.saveChallengeInfo = function () { $scope.saveChallengeInfo = function () {
this.challenge.duration = $scope.duration; this.challenge.duration = $scope.duration;
@ -2800,9 +2799,11 @@ function presenceCal(scope, location, data) {
.attr("width", cellSize) .attr("width", cellSize)
.attr("height", cellSize) .attr("height", cellSize)
.attr("transform", function (d) { return "translate(" + (d.getHours() * cellSize) + "," + (d.getMinutes() / 15 * cellSize) + ")"; }) .attr("transform", function (d) { return "translate(" + (d.getHours() * cellSize) + "," + (d.getMinutes() / 15 * cellSize) + ")"; })
.attr("class", function(d) { if (d >= scope.settings.start && d < scope.settings.start + scope.settings.end - scope.settings.start) return color(data.reduce(function(prev, cur){ .attr("class", function (d) {
if (d >= scope.settings.start && d < scope.settings.start + scope.settings.end - scope.settings.start) return color(data.reduce(function (prev, cur) {
cur = new Date(cur).getTime(); cur = new Date(cur).getTime();
dv = d.getTime(); dv = d.getTime();
return prev + ((dv <= cur && cur < dv + 15 * 60000) ? 1 : 0); return prev + ((dv <= cur && cur < dv + 15 * 60000) ? 1 : 0);
}, 0)); }); }, 0));
});
} }