Commit 37b9173b authored by Andrew Fontaine's avatar Andrew Fontaine

Make "moved" Link to Moved Issue

The text "moved" now links to the issue the closed issue was moved to.
parent c8bf9f78
......@@ -32,6 +32,11 @@
&.status-box-issue-closed,
&.status-box-mr-merged {
background-color: $blue-500;
a {
color: inherit;
text-decoration: underline;
}
}
&.status-box-open {
......
......@@ -14,9 +14,12 @@
.detail-page-header-body
.issuable-status-box.status-box.status-box-issue-closed{ class: issue_button_visibility(@issue, false) }
= sprite_icon('mobile-issue-close', size: 16, css_class: 'd-block d-sm-none')
%span.d-none.d-sm-block
.d-none.d-sm-block
- if @issue.moved?
= _("Closed (moved)")
- moved_link_start = "<a href=\"#{issue_path(@issue.moved_to)}\">".html_safe
- moved_link_end = '</a>'.html_safe
= s_('IssuableStatus|Closed (%{moved_link_start}moved%{moved_link_end})').html_safe % {moved_link_start: moved_link_start,
moved_link_end: moved_link_end}
- else
= _("Closed")
.issuable-status-box.status-box.status-box-open{ class: issue_button_visibility(@issue, true) }
......
---
title: Add Link from Closed (moved) Issues to Moved Issue
merge_request: 25300
author:
type: added
......@@ -1542,9 +1542,6 @@ msgstr ""
msgid "Closed"
msgstr ""
msgid "Closed (moved)"
msgstr ""
msgid "ClusterIntegration| %{custom_domain_start}More information%{custom_domain_end}."
msgstr ""
......@@ -4097,6 +4094,9 @@ msgstr ""
msgid "Invoke Time"
msgstr ""
msgid "IssuableStatus|Closed (%{moved_link_start}moved%{moved_link_end})"
msgstr ""
msgid "Issue"
msgstr ""
......
......@@ -21,12 +21,24 @@ describe 'projects/issues/show' do
allow(issue).to receive(:closed?).and_return(true)
end
it 'shows "Closed (moved)" if an issue has been moved' do
allow(issue).to receive(:moved?).and_return(true)
context 'when the issue was moved' do
let(:new_issue) { create(:issue, project: project, author: user) }
render
before do
issue.moved_to = new_issue
end
it 'shows "Closed (moved)" if an issue has been moved' do
render
expect(rendered).to have_selector('.status-box-issue-closed:not(.hidden)', text: 'Closed (moved)')
end
it 'links "moved" to the new issue the original issue was moved to' do
render
expect(rendered).to have_selector('.status-box-issue-closed:not(.hidden)', text: 'Closed (moved)')
expect(rendered).to have_selector("a[href=\"#{issue_path(new_issue)}\"]", text: 'moved')
end
end
it 'shows "Closed" if an issue has not been moved' 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