Commit aa8034b9 authored by Felipe Artur's avatar Felipe Artur

Allow to promote confidential issues into confidential epics

Changed previous behaviour where confidential issues were
promoted into non confidential epics.

Changelog: changed
parent e53be38e
......@@ -55,7 +55,8 @@ module Epics
def params
{
title: original_entity.title,
parent: issue_epic
parent: issue_epic,
confidential: issue.confidential
}
end
......
......@@ -52,21 +52,11 @@ module EE
end
promote_message = _('Promote issue to an epic')
promote_message_confidential = _('Promote confidential issue to a non-confidential epic')
desc do
if quick_action_target.confidential?
promote_message_confidential
else
promote_message
end
promote_message
end
explanation promote_message
warning do
if quick_action_target.confidential?
promote_message_confidential
end
end
icon 'confidential'
types Issue
condition do
......@@ -75,11 +65,7 @@ module EE
command :promote do
@updates[:promote_to_epic] = true
@execution_message[:promote] = if quick_action_target.confidential?
_('Promoted confidential issue to a non-confidential epic. Information in this issue is no longer confidential as epics are public to group members.')
else
_('Promoted issue to an epic.')
end
@execution_message[:promote] = _('Promoted issue to an epic.')
end
desc _('Set iteration')
......
......@@ -89,33 +89,6 @@ RSpec.describe 'Issue promotion', :js do
end
end
end
context 'when issue is confidential' do
let(:confidential_issue) { create(:issue, :confidential, project: project) }
before do
group.add_developer(user)
visit project_issue_path(project, confidential_issue)
end
it 'displays warning' do
fill_in 'Comment', with: '/promote'
expect(find_autocomplete_menu).to have_text 'Promote confidential issue to a non-confidential epic'
end
it 'promotes the issue' do
add_note('/promote')
epic = Epic.last
expect(page).to have_content 'Promoted confidential issue to a non-confidential epic. Information in this issue is no longer confidential as epics are public to group members.'
expect(confidential_issue.reload).to be_closed
expect(epic.title).to eq(confidential_issue.title)
expect(epic.description).to eq(confidential_issue.description)
expect(epic.author).to eq(user)
end
end
end
private
......
......@@ -204,6 +204,21 @@ RSpec.describe Epics::IssuePromoteService, :aggregate_failures do
expect(epic.parent).to eq(parent_epic)
end
end
context 'when issue and epic are confidential' do
before do
issue.update_attribute(:confidential, true)
parent_epic.update_attribute(:confidential, true)
end
it 'promotes issue to epic' do
epic = subject.execute(issue, group)
expect(issue.reload.promoted_to_epic_id).to eq(epic.id)
expect(epic.confidential).to eq(true)
expect(epic.parent).to eq(parent_epic)
end
end
end
context 'when issue was already promoted' do
......
......@@ -26177,9 +26177,6 @@ msgstr ""
msgid "Promote"
msgstr ""
msgid "Promote confidential issue to a non-confidential epic"
msgstr ""
msgid "Promote issue to an epic"
msgstr ""
......@@ -26198,9 +26195,6 @@ msgstr ""
msgid "PromoteMilestone|Promotion failed - %{message}"
msgstr ""
msgid "Promoted confidential issue to a non-confidential epic. Information in this issue is no longer confidential as epics are public to group members."
msgstr ""
msgid "Promoted issue to an epic."
msgstr ""
......
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