diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-06-09 11:11:52 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2017-06-09 11:11:52 +0000 |
commit | e80df8f234a26271c77358c36662b957b23cbcaf (patch) | |
tree | 5de3b5e824a74fe517b579853485773033639e35 | |
parent | 95138a9c16a2d1905354d0f46381b3822b37863d (diff) | |
parent | 4bfd06e60e22a8100eddc2391d4842a8b6e53a6f (diff) | |
download | gitlab-ce-e80df8f234a26271c77358c36662b957b23cbcaf.tar.gz |
Merge branch '33381-display-issue-state-in-mr-widget-issue-links' into 'master'
Display issue state in issue links section of merge request widget
Closes #33381
See merge request !12021
3 files changed, 28 insertions, 2 deletions
diff --git a/app/presenters/merge_request_presenter.rb b/app/presenters/merge_request_presenter.rb index 0db9e31031c..8bf35953d29 100644 --- a/app/presenters/merge_request_presenter.rb +++ b/app/presenters/merge_request_presenter.rb @@ -110,12 +110,24 @@ class MergeRequestPresenter < Gitlab::View::Presenter::Delegated end def closing_issues_links - markdown issues_sentence(project, closing_issues), pipeline: :gfm, author: author, project: project + markdown( + issues_sentence(project, closing_issues), + pipeline: :gfm, + author: author, + project: project, + issuable_state_filter_enabled: true + ) end def mentioned_issues_links mentioned_issues = issues_mentioned_but_not_closing(current_user) - markdown issues_sentence(project, mentioned_issues), pipeline: :gfm, author: author, project: project + markdown( + issues_sentence(project, mentioned_issues), + pipeline: :gfm, + author: author, + project: project, + issuable_state_filter_enabled: true + ) end def assign_to_closing_issues_link diff --git a/changelogs/unreleased/33381-display-issue-state-in-mr-widget-issue-links.yml b/changelogs/unreleased/33381-display-issue-state-in-mr-widget-issue-links.yml new file mode 100644 index 00000000000..4a7b02fec94 --- /dev/null +++ b/changelogs/unreleased/33381-display-issue-state-in-mr-widget-issue-links.yml @@ -0,0 +1,4 @@ +--- +title: Display issue state in issue links section of merge request widget +merge_request: 12021 +author: diff --git a/spec/presenters/merge_request_presenter_spec.rb b/spec/presenters/merge_request_presenter_spec.rb index 44720fc4448..f5a14b1d04d 100644 --- a/spec/presenters/merge_request_presenter_spec.rb +++ b/spec/presenters/merge_request_presenter_spec.rb @@ -132,6 +132,11 @@ describe MergeRequestPresenter do it 'does not present related issues links' do is_expected.not_to match("#{project.full_path}/issues/#{issue_b.iid}") end + + it 'appends status when closing issue is already closed' do + issue_a.close + is_expected.to match('(closed)') + end end describe '#mentioned_issues_links' do @@ -147,6 +152,11 @@ describe MergeRequestPresenter do it 'does not present closing issues links' do is_expected.not_to match("#{project.full_path}/issues/#{issue_a.iid}") end + + it 'appends status when mentioned issue is already closed' do + issue_b.close + is_expected.to match('(closed)') + end end describe '#assign_to_closing_issues_link' do |