Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Trac2Gitlab
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stud.IP
Plugins
Trac2Gitlab
Commits
a89ae094
Commit
a89ae094
authored
2 years ago
by
Jan-Hendrik Willms
Browse files
Options
Downloads
Patches
Plain Diff
fixes
#30
parent
b14630f5
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
controllers/dashboard.php
+1
-4
1 addition, 4 deletions
controllers/dashboard.php
lib/GitlabIssue.php
+4
-5
4 additions, 5 deletions
lib/GitlabIssue.php
with
5 additions
and
9 deletions
controllers/dashboard.php
+
1
−
4
View file @
a89ae094
...
@@ -138,10 +138,7 @@ final class DashboardController extends TracToGitlab\Controller
...
@@ -138,10 +138,7 @@ final class DashboardController extends TracToGitlab\Controller
});
});
return
array_map
(
function
(
$issue
)
{
return
array_map
(
function
(
$issue
)
{
$mrs
=
[];
$mrs
=
$this
->
gitlab
->
issues
()
->
relatedMergeRequests
(
$this
->
gitlabProjectId
,
$issue
[
'iid'
]);
if
(
$issue
[
'merge_requests_count'
]
>
0
)
{
$mrs
=
$this
->
gitlab
->
issues
()
->
relatedMergeRequests
(
$this
->
gitlabProjectId
,
$issue
[
'iid'
]);
}
return
new
TracToGitlab\GitlabIssue
(
$issue
,
$mrs
);
return
new
TracToGitlab\GitlabIssue
(
$issue
,
$mrs
);
},
$issues
);
},
$issues
);
}
}
...
...
This diff is collapsed.
Click to expand it.
lib/GitlabIssue.php
+
4
−
5
View file @
a89ae094
...
@@ -59,10 +59,9 @@ final class GitlabIssue implements \JsonSerializable
...
@@ -59,10 +59,9 @@ final class GitlabIssue implements \JsonSerializable
public
function
isMerged
()
public
function
isMerged
()
{
{
return
$this
->
hasMergeRequests
()
return
count
(
array_filter
(
$this
->
mrs
,
function
(
$mr
)
{
&&
count
(
array_filter
(
$this
->
mrs
,
function
(
$mr
)
{
return
$mr
[
'state'
]
!==
'merged'
;
return
$mr
[
'state'
]
!==
'merged'
;
}))
===
0
;
}))
===
0
;
}
}
public
function
isBiest
()
public
function
isBiest
()
...
@@ -116,7 +115,7 @@ final class GitlabIssue implements \JsonSerializable
...
@@ -116,7 +115,7 @@ final class GitlabIssue implements \JsonSerializable
'assignee'
=>
$this
->
assignee
,
'assignee'
=>
$this
->
assignee
,
'web_url'
=>
$this
->
web_url
,
'web_url'
=>
$this
->
web_url
,
'closed'
=>
$this
->
isClosed
(),
'closed'
=>
$this
->
isClosed
(),
'merge_requests'
=>
$this
->
issue
[
'merge_requests_count'
]
,
'merge_requests'
=>
count
(
$this
->
mrs
)
,
'merged'
=>
$this
->
isMerged
(),
'merged'
=>
$this
->
isMerged
(),
'qm_states'
=>
array_combine
(
'qm_states'
=>
array_combine
(
array_values
(
self
::
QM_LABEL_MAPPING
),
array_values
(
self
::
QM_LABEL_MAPPING
),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment