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

fixes #30

parent b14630f5
No related branches found
No related tags found
No related merge requests found
......@@ -138,10 +138,7 @@ final class DashboardController extends TracToGitlab\Controller
});
return array_map(function ($issue) {
$mrs = [];
if ($issue['merge_requests_count'] > 0) {
$mrs = $this->gitlab->issues()->relatedMergeRequests($this->gitlabProjectId, $issue['iid']);
}
return new TracToGitlab\GitlabIssue($issue, $mrs);
}, $issues);
}
......
......@@ -59,8 +59,7 @@ final class GitlabIssue implements \JsonSerializable
public function isMerged()
{
return $this->hasMergeRequests()
&& count(array_filter($this->mrs, function ($mr) {
return count(array_filter($this->mrs, function ($mr) {
return $mr['state'] !== 'merged';
})) === 0;
}
......@@ -116,7 +115,7 @@ final class GitlabIssue implements \JsonSerializable
'assignee' => $this->assignee,
'web_url' => $this->web_url,
'closed' => $this->isClosed(),
'merge_requests' => $this->issue['merge_requests_count'],
'merge_requests' => count($this->mrs),
'merged' => $this->isMerged(),
'qm_states' => array_combine(
array_values(self::QM_LABEL_MAPPING),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment