Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2019-02-21 19:54:34 +0300
committerFilipa Lacerda <filipa@gitlab.com>2019-02-21 19:54:34 +0300
commit093f519b2263dec41743c059e8960a2b12289677 (patch)
tree89034c703c61db84858e89613066af06644c8ccc
parent885ef319cd8f6b0ad6c12a9b53b64797e8305dcb (diff)
parenta0fbfb5a5343269849cbaaff8b62c0698b254bd6 (diff)
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
-rw-r--r--app/assets/stylesheets/framework/common.scss5
-rw-r--r--app/views/projects/issues/show.html.haml7
-rw-r--r--changelogs/unreleased/57784-make-closed-duplicate-and-closed-moved-button-a-link-to-target.yml5
-rw-r--r--locale/gitlab.pot6
-rw-r--r--spec/views/projects/issues/show.html.haml_spec.rb20
5 files changed, 34 insertions, 9 deletions
diff --git a/app/assets/stylesheets/framework/common.scss b/app/assets/stylesheets/framework/common.scss
index c1f2f5f8c6a..fa424532879 100644
--- a/app/assets/stylesheets/framework/common.scss
+++ b/app/assets/stylesheets/framework/common.scss
@@ -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; }
diff --git a/app/views/projects/issues/show.html.haml b/app/views/projects/issues/show.html.haml
index ca03a3ce75e..3a674da6e87 100644
--- a/app/views/projects/issues/show.html.haml
+++ b/app/views/projects/issues/show.html.haml
@@ -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) }
diff --git a/changelogs/unreleased/57784-make-closed-duplicate-and-closed-moved-button-a-link-to-target.yml b/changelogs/unreleased/57784-make-closed-duplicate-and-closed-moved-button-a-link-to-target.yml
new file mode 100644
index 00000000000..2775d9f4e36
--- /dev/null
+++ b/changelogs/unreleased/57784-make-closed-duplicate-and-closed-moved-button-a-link-to-target.yml
@@ -0,0 +1,5 @@
+---
+title: Add Link from Closed (moved) Issues to Moved Issue
+merge_request: 25300
+author:
+type: added
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index 4c064b7741a..fa680cd5ef0 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -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 ""
diff --git a/spec/views/projects/issues/show.html.haml_spec.rb b/spec/views/projects/issues/show.html.haml_spec.rb
index ff88efd0e31..1d9c6d36ad7 100644
--- a/spec/views/projects/issues/show.html.haml_spec.rb
+++ b/spec/views/projects/issues/show.html.haml_spec.rb
@@ -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