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),

View file

@ -1,3 +1,31 @@
<div class="card niceborder border-warning bg-primary text-light" ng-if="issues.length > 0">
<table class="table table-hover table-striped">
<thead>
<tr>
<th>Objet</th>
<th>État / Priorité</th>
<th>Géré par</th>
<th>Messages</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="issue in issues">
<td>{{ issue.subject }} <span ng-if="issue.exercice">(challenge {{ issue.exercice }})</span></td>
<td>{{ issue.state }} / {{ issue.priority }}</td>
<td>{{ issue.assignee }}</td>
<td>
<div class="row" ng-repeat="text in issue.texts | orderBy:'date':'reverse'">
<span ng-if="text.assignee == null || text.assignee == '$team'">Vous</span>
<span ng-if="text.assignee != null && text.assignee != '$team'" ng-bind="text.assignee"></span>&nbsp;à {{ text.date | date:"mediumTime" }}&nbsp;:&nbsp;
<span style="white-space: pre-line">{{ text.cnt }}</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div class="card border-warning mt-3" ng-if="!settings.acceptNewIssue">
<div class="card-header bg-warning text-light">Rapporter une anomalie sur un exercice</div>
<div class="card-body">