Commit 093f519b authored by Filipa Lacerda's avatar Filipa Lacerda

Merge branch '57784-make-closed-duplicate-and-closed-moved-button-a-link-to-target' into 'master'

Add Link from Closed (moved) Issues to Moved Issue

Closes #57784

See merge request gitlab-org/gitlab-ce!25300
parents 885ef319 a0fbfb5a
......@@ -52,6 +52,11 @@
word-break: break-all;
}
.text-underline,
.text-underline:hover {
text-decoration: underline;
}
.hint { font-style: italic; color: $gl-gray-400; }
.light { color: $gl-text-color; }
......
......@@ -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)}\" class=\"text-white text-underline\">".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