summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2019-01-28 20:56:21 +0000
committerRobert Speicher <rspeicher@gmail.com>2019-01-28 20:56:21 +0000
commitbbf6e65dd2874ae1866ee6d87713f45de1f95d55 (patch)
tree1fbf5d9050ffd59d0cb5f6a2381e99933d3301e9
parent58f088e5442dd0929182f1d91a08cf8c7ff1526a (diff)
parent01a713d64c69fb1b1785c614a336f20ad911bbef (diff)
downloadgitlab-ce-bbf6e65dd2874ae1866ee6d87713f45de1f95d55.tar.gz
Merge branch '36445-better-indication-that-an-issue-has-been-moved-or-marked-as-duplicated' into 'master'
Indicate on Issue Status if an Issue was Moved Closes #36445 See merge request gitlab-org/gitlab-ce!24470
-rw-r--r--app/views/projects/issues/show.html.haml5
-rw-r--r--changelogs/unreleased/36445-better-indication-that-an-issue-has-been-moved-or-marked-as-duplicated.yml5
-rw-r--r--locale/gitlab.pot3
-rw-r--r--spec/views/projects/issues/show.html.haml_spec.rb51
4 files changed, 63 insertions, 1 deletions
diff --git a/app/views/projects/issues/show.html.haml b/app/views/projects/issues/show.html.haml
index f048fb91304..653b7d4c6f3 100644
--- a/app/views/projects/issues/show.html.haml
+++ b/app/views/projects/issues/show.html.haml
@@ -15,7 +15,10 @@
.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
- Closed
+ - if @issue.moved?
+ = _("Closed (moved)")
+ - else
+ = _("Closed")
.issuable-status-box.status-box.status-box-open{ class: issue_button_visibility(@issue, true) }
= sprite_icon('issue-open-m', size: 16, css_class: 'd-block d-sm-none')
%span.d-none.d-sm-block Open
diff --git a/changelogs/unreleased/36445-better-indication-that-an-issue-has-been-moved-or-marked-as-duplicated.yml b/changelogs/unreleased/36445-better-indication-that-an-issue-has-been-moved-or-marked-as-duplicated.yml
new file mode 100644
index 00000000000..70b561ccbf6
--- /dev/null
+++ b/changelogs/unreleased/36445-better-indication-that-an-issue-has-been-moved-or-marked-as-duplicated.yml
@@ -0,0 +1,5 @@
+---
+title: Indicate on Issue Status if an Issue was Moved
+merge_request: 24470
+author:
+type: added
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index 0e6cb5ac4ed..76f81303969 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -1497,6 +1497,9 @@ msgstr ""
msgid "Closed"
msgstr ""
+msgid "Closed (moved)"
+msgstr ""
+
msgid "ClusterIntegration| is the default environment scope for this cluster. This means that all jobs, regardless of their environment, will use this cluster. %{environment_scope_start}More information%{environment_scope_end}"
msgstr ""
diff --git a/spec/views/projects/issues/show.html.haml_spec.rb b/spec/views/projects/issues/show.html.haml_spec.rb
new file mode 100644
index 00000000000..ff88efd0e31
--- /dev/null
+++ b/spec/views/projects/issues/show.html.haml_spec.rb
@@ -0,0 +1,51 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+describe 'projects/issues/show' do
+ let(:project) { create(:project, :repository) }
+ let(:issue) { create(:issue, project: project, author: user) }
+ let(:user) { create(:user) }
+
+ before do
+ assign(:project, project)
+ assign(:issue, issue)
+ assign(:noteable, issue)
+ stub_template 'shared/issuable/_sidebar' => ''
+ stub_template 'projects/issues/_discussion' => ''
+ allow(view).to receive(:issuable_meta).and_return('')
+ end
+
+ context 'when the issue is closed' do
+ before 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)
+
+ render
+
+ expect(rendered).to have_selector('.status-box-issue-closed:not(.hidden)', text: 'Closed (moved)')
+ end
+
+ it 'shows "Closed" if an issue has not been moved' do
+ render
+
+ expect(rendered).to have_selector('.status-box-issue-closed:not(.hidden)', text: 'Closed')
+ end
+ end
+
+ context 'when the issue is open' do
+ before do
+ allow(issue).to receive(:closed?).and_return(false)
+ allow(issue).to receive(:disscussion_locked).and_return(false)
+ end
+
+ it 'shows "Open" if an issue has been moved' do
+ render
+
+ expect(rendered).to have_selector('.status-box-open:not(.hidden)', text: 'Open')
+ end
+ end
+end