Skip to content
Snippets Groups Projects
Commit f88438ed authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

fixes #31

parent a89ae094
No related branches found
No related tags found
No related merge requests found
......@@ -60,7 +60,7 @@
const dashboard = document.getElementById('dashboard');
const issues = JSON.parse(dashboard.dataset.issues);
const qmLabels = JSON.parse(dashboard.dataset.qmLabels);
const filters = JSON.parse(dashboard.dataset.filters);
const filters = JSON.parse(dashboard.dataset.filters) || {};
const filterStoreUrl = dashboard.dataset.filterStoreUrl;
Object.values(qmLabels).forEach(abbr => {
......@@ -85,7 +85,7 @@
},
computed: {
colspan() {
return 7 + Object.values(qmLabels).length;
return 8 + Object.values(qmLabels).length;
},
filteredIssues() {
return this.issues.filter(issue => {
......
......@@ -117,6 +117,19 @@ final class GitlabIssue implements \JsonSerializable
'closed' => $this->isClosed(),
'merge_requests' => count($this->mrs),
'merged' => $this->isMerged(),
'reviewers' => array_reduce($this->mrs, function ($reviewers, $mr) {
if (!isset($mr['reviewers'])) {
return $reviewers;
}
foreach ($mr['reviewers'] as $reviewer) {
if (!in_array($reviewer['username'], $reviewers)) {
$reviewers[] = $reviewer['username'];
}
}
return $reviewers;
}, []),
'qm_states' => array_combine(
array_values(self::QM_LABEL_MAPPING),
array_map(function ($qm) {
......
......@@ -9,12 +9,18 @@
$attributes = [
'data-issues' => json_encode($issues),
'data-qm-labels' => json_encode($mapping),
'data-filters' => json_encode($filters),
'data-filters' => json_encode($filters ?: null),
'data-filter-store-url' => $controller->store_filtersURL(),
];
?>
<div id="dashboard" v-cloak <?= arrayToHtmlAttributes($attributes) ?>>
<table class="default">
<caption>
<span v-if="filteredIssues.length !== issues.length">
{{ filteredIssues.length }} <?= _('von') ?>
</span>
{{ issues.length }} Issues
</caption>
<thead>
<tr>
<th><?= _('Issue') ?></th>
......@@ -24,6 +30,7 @@ $attributes = [
<th><?= _('Titel') ?></th>
<th><?= _('Autor') ?></th>
<th><?= _('Bearbeiter') ?></th>
<th><?= _('Reviewer') ?></th>
<th v-for="(abbr, label) in qmLabels">
<abbr :title="label">{{ abbr }}</abbr>
</th>
......@@ -70,6 +77,11 @@ $attributes = [
</td>
<td>{{ issue.author }}</td>
<td>{{ issue.assignee }}</td>
<td>
<ul v-if="issue.reviewers.length > 0" class="list-csv">
<li v-for="username in issue.reviewers" :key="`reviewer-${issue.iid}-${username}`">{{ username }}</li>
</ul>
</td>
<td v-for="(abbr, label) in qmLabels">
<studip-icon shape="accept" role="status-green" v-if="getStateForIssueAndQmLabel(issue, abbr) === '+'"></studip-icon>
<studip-icon shape="question" role="status-yellow" v-else-if="getStateForIssueAndQmLabel(issue, abbr) === '?'"></studip-icon>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment