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

show approval

parent 47f4b434
No related branches found
No related tags found
No related merge requests found
......@@ -54,27 +54,16 @@ final class MergerequestsController extends TracToGitlab\GitlabController
}
return true;
// foreach (['worksforme', 'wontfix', 'Duplicate', 'invalid'] as $label) {
// if (in_array($label, $issue['labels'])) {
// return false;
// }
// }
//
// $has_version = array_reduce($issue['labels'], function ($has_version, $label) {
// return $has_version || strpos($label, 'Version::') === 0;
// }, false);
// return $has_version;
});
// var_dump($mrs);die;
//
// $issues = array_map(function ($issue) {
// $issue['studip_version'] = $this->extractVersion($issue['labels']);
// $issue['mr'] = $this->fetchRelatedMergeRequest($issue['iid']);
// return $issue;
// }, $issues);
//
$mrs = array_map(function ($mr) {
$mr['approvals'] = $this->gitlab->mergeRequests()->approvals(
$this->gitlabProjectId,
$mr['iid']
);
return $mr;
}, $mrs);
usort($mrs, function ($a, $b) {
return strcmp($b['updated_at'], $a['updated_at']);
});
......
......@@ -30,6 +30,12 @@
<a href="<?= htmlReady($mr['web_url']) ?>" target="_blank">
#<?= htmlReady($mr['iid']) ?>:
<?= htmlReady($mr['title']) ?>
</a>
<? if ($mr['approvals']['approved']): ?>
<?= Icon::create('check-circle', Icon::ROLE_STATUS_GREEN)->asImg([
'class' => 'text-bottom',
]) ?>
<? endif; ?>
</td>
<td>
<? if ($mr['task_completion_status']['count'] === $mr['task_completion_status']['completed_count']): ?>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment