Commit 01a713d6 authored by Andrew Fontaine's avatar Andrew Fontaine

Indicate on Status if Issue was Moved

Add the text `(moved)` to the `Closed` status indicator on a closed
issue if the reason the issue was closed was due to moving it.

This only applies to closed issues. Issues that were closed and moved
then later re-opened only show `Open`. This makes it more immidately
clear why the issue was closed.
parent 2b8f1943
...@@ -15,7 +15,10 @@ ...@@ -15,7 +15,10 @@
.issuable-status-box.status-box.status-box-issue-closed{ class: issue_button_visibility(@issue, false) } .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') = sprite_icon('mobile-issue-close', size: 16, css_class: 'd-block d-sm-none')
%span.d-none.d-sm-block %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) } .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') = sprite_icon('issue-open-m', size: 16, css_class: 'd-block d-sm-none')
%span.d-none.d-sm-block Open %span.d-none.d-sm-block Open
......
---
title: Indicate on Issue Status if an Issue was Moved
merge_request: 24470
author:
type: added
...@@ -1488,6 +1488,9 @@ msgstr "" ...@@ -1488,6 +1488,9 @@ msgstr ""
msgid "Closed" msgid "Closed"
msgstr "" 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}" 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 "" msgstr ""
......
# 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
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