Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
0272f274
Commit
0272f274
authored
Dec 04, 2015
by
Greg Smethells
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
display referenced merge requests in issue description with CI status
parent
a2a68858
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
59 additions
and
1 deletion
+59
-1
app/assets/stylesheets/pages/issues.scss
app/assets/stylesheets/pages/issues.scss
+20
-0
app/controllers/projects/issues_controller.rb
app/controllers/projects/issues_controller.rb
+1
-0
app/helpers/ci_status_helper.rb
app/helpers/ci_status_helper.rb
+1
-1
app/models/issue.rb
app/models/issue.rb
+8
-0
app/views/projects/issues/_merge_requests.html.haml
app/views/projects/issues/_merge_requests.html.haml
+25
-0
app/views/projects/issues/show.html.haml
app/views/projects/issues/show.html.haml
+4
-0
No files found.
app/assets/stylesheets/pages/issues.scss
View file @
0272f274
...
@@ -60,6 +60,26 @@ form.edit-issue {
...
@@ -60,6 +60,26 @@ form.edit-issue {
margin
:
0
;
margin
:
0
;
}
}
.merge-requests-title
{
font-size
:
16px
;
font-weight
:
600
;
}
.merge-request-id
{
display
:
inline-block
;
width
:
3em
;
}
.merge-request-info
{
padding-left
:
5px
;
}
.merge-request-status
{
color
:
$gl-gray
;
font-size
:
15px
;
font-weight
:
bold
;
}
.merge-request
,
.merge-request
,
.issue
{
.issue
{
&
.today
{
&
.today
{
...
...
app/controllers/projects/issues_controller.rb
View file @
0272f274
...
@@ -62,6 +62,7 @@ class Projects::IssuesController < Projects::ApplicationController
...
@@ -62,6 +62,7 @@ class Projects::IssuesController < Projects::ApplicationController
@note
=
@project
.
notes
.
new
(
noteable:
@issue
)
@note
=
@project
.
notes
.
new
(
noteable:
@issue
)
@notes
=
@issue
.
notes
.
nonawards
.
with_associations
.
fresh
@notes
=
@issue
.
notes
.
nonawards
.
with_associations
.
fresh
@noteable
=
@issue
@noteable
=
@issue
@merge_requests
=
@issue
.
referenced_merge_requests
respond_with
(
@issue
)
respond_with
(
@issue
)
end
end
...
...
app/helpers/ci_status_helper.rb
View file @
0272f274
...
@@ -52,7 +52,7 @@ module CiStatusHelper
...
@@ -52,7 +52,7 @@ module CiStatusHelper
'circle'
'circle'
end
end
icon
(
icon_name
)
icon
(
icon_name
+
' fw'
)
end
end
def
render_ci_status
(
ci_commit
)
def
render_ci_status
(
ci_commit
)
...
...
app/models/issue.rb
View file @
0272f274
...
@@ -83,6 +83,14 @@ class Issue < ActiveRecord::Base
...
@@ -83,6 +83,14 @@ class Issue < ActiveRecord::Base
reference
reference
end
end
def
referenced_merge_requests
references
=
[
self
,
*
notes
].
flat_map
do
|
note
|
note
.
all_references
(
load_lazy_references:
false
).
merge_requests
end
.
uniq
Gitlab
::
Markdown
::
ReferenceFilter
::
LazyReference
.
load
(
references
).
uniq
.
sort_by
(
&
:iid
)
end
# Reset issue events cache
# Reset issue events cache
#
#
# Since we do cache @event we need to reset cache in special cases:
# Since we do cache @event we need to reset cache in special cases:
...
...
app/views/projects/issues/_merge_requests.html.haml
0 → 100644
View file @
0272f274
-
if
@merge_requests
.
any?
%h2
.merge-requests-title
=
pluralize
(
@merge_requests
.
count
,
'Related Merge Request'
)
%ul
.bordered-list
-
has_any_ci
=
@merge_requests
.
any?
(
&
:ci_commit
)
-
@merge_requests
.
each
do
|
merge_request
|
%li
%span
.merge-request-ci-status
-
if
merge_request
.
ci_commit
=
render_ci_status
(
merge_request
.
ci_commit
)
-
elsif
has_any_ci
=
icon
(
'blank fw'
)
%span
.merge-request-id
\##{merge_request.iid}
%span
.merge-request-info
%strong
=
link_to_gfm
merge_request
.
title
,
merge_request_path
(
merge_request
),
class:
"row_title"
in
-
project
=
merge_request
.
target_project
=
link_to
project
.
name_with_namespace
,
namespace_project_path
(
project
.
namespace
,
project
)
%span
.merge-request-status.prepend-left-10
-
if
merge_request
.
merged?
MERGED
-
elsif
merge_request
.
closed?
CLOSED
app/views/projects/issues/show.html.haml
View file @
0272f274
...
@@ -47,6 +47,10 @@
...
@@ -47,6 +47,10 @@
=
markdown
(
@issue
.
description
,
cache_key:
[
@issue
,
"description"
])
=
markdown
(
@issue
.
description
,
cache_key:
[
@issue
,
"description"
])
%textarea
.hidden.js-task-list-field
%textarea
.hidden.js-task-list-field
=
@issue
.
description
=
@issue
.
description
.merge-requests
=
render
'merge_requests'
-
if
@closed_by_merge_requests
.
present?
-
if
@closed_by_merge_requests
.
present?
=
render
'projects/issues/closed_by_box'
=
render
'projects/issues/closed_by_box'
.issue-discussion
.issue-discussion
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment