Commit e80df8f2 authored by Sean McGivern's avatar Sean McGivern

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
parents 95138a9c 4bfd06e6
...@@ -110,12 +110,24 @@ class MergeRequestPresenter < Gitlab::View::Presenter::Delegated ...@@ -110,12 +110,24 @@ class MergeRequestPresenter < Gitlab::View::Presenter::Delegated
end end
def closing_issues_links 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 end
def mentioned_issues_links def mentioned_issues_links
mentioned_issues = issues_mentioned_but_not_closing(current_user) 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 end
def assign_to_closing_issues_link def assign_to_closing_issues_link
......
---
title: Display issue state in issue links section of merge request widget
merge_request: 12021
author:
...@@ -132,6 +132,11 @@ describe MergeRequestPresenter do ...@@ -132,6 +132,11 @@ describe MergeRequestPresenter do
it 'does not present related issues links' do it 'does not present related issues links' do
is_expected.not_to match("#{project.full_path}/issues/#{issue_b.iid}") is_expected.not_to match("#{project.full_path}/issues/#{issue_b.iid}")
end end
it 'appends status when closing issue is already closed' do
issue_a.close
is_expected.to match('(closed)')
end
end end
describe '#mentioned_issues_links' do describe '#mentioned_issues_links' do
...@@ -147,6 +152,11 @@ describe MergeRequestPresenter do ...@@ -147,6 +152,11 @@ describe MergeRequestPresenter do
it 'does not present closing issues links' do it 'does not present closing issues links' do
is_expected.not_to match("#{project.full_path}/issues/#{issue_a.iid}") is_expected.not_to match("#{project.full_path}/issues/#{issue_a.iid}")
end end
it 'appends status when mentioned issue is already closed' do
issue_b.close
is_expected.to match('(closed)')
end
end end
describe '#assign_to_closing_issues_link' do describe '#assign_to_closing_issues_link' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment