frontend: display issues related to the team

This commit is contained in:
nemunaire 2020-01-23 16:03:31 +01:00
commit a3ffdeae17
12 changed files with 238 additions and 12 deletions

View file

@ -108,6 +108,7 @@ angular.module("FICApp", ["ngRoute", "ngSanitize"])
$rootScope.current_exercice = 0;
$rootScope.current_tag = undefined;
$rootScope.notify_field = 0;
$rootScope.issues_known_responses = 0;
if ('Notification' in window)
Notification.requestPermission(function(result) {
@ -219,6 +220,23 @@ angular.module("FICApp", ["ngRoute", "ngSanitize"])
});
}
var refreshIssuesInterval
var refreshIssues = function() {
if (refreshIssuesInterval)
$interval.cancel(refreshIssuesInterval);
refreshIssuesInterval = $interval(refreshIssues, Math.floor(Math.random() * 24000) + 32000);
$http.get("issues.json").then(function(response) {
$rootScope.issues_nb_responses = 0;
$rootScope.issues_need_info = 0;
$rootScope.issues = response.data;
$rootScope.issues.forEach(function(issue) {
$rootScope.issues_nb_responses += issue.texts.length;
if (issue.state == 'need-info') $rootScope.issues_need_info++;
})
});
}
var refreshThemesInterval
var refreshThemes = function() {
if (refreshThemesInterval)
@ -443,6 +461,7 @@ angular.module("FICApp", ["ngRoute", "ngSanitize"])
refreshThemes();
$rootScope.refreshTeams();
refreshEvents();
refreshIssues();
}
else if (justSettings) {
refreshSettings();
@ -647,6 +666,7 @@ angular.module("FICApp", ["ngRoute", "ngSanitize"])
.controller("IssueController", function($scope, $http, $rootScope, $routeParams) {
$rootScope.current_tag = undefined;
$rootScope.current_exercice = $routeParams.eid;
$rootScope.issues_known_responses = $rootScope.issues_nb_responses;
$scope.issue = {
id_exercice: parseInt($routeParams.eid, 10),