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 ...@@ -55,7 +55,8 @@ module Epics
def params def params
{ {
title: original_entity.title, title: original_entity.title,
parent: issue_epic parent: issue_epic,
confidential: issue.confidential
} }
end end
......
...@@ -52,21 +52,11 @@ module EE ...@@ -52,21 +52,11 @@ module EE
end end
promote_message = _('Promote issue to an epic') promote_message = _('Promote issue to an epic')
promote_message_confidential = _('Promote confidential issue to a non-confidential epic')
desc do desc do
if quick_action_target.confidential? promote_message
promote_message_confidential
else
promote_message
end
end end
explanation promote_message explanation promote_message
warning do
if quick_action_target.confidential?
promote_message_confidential
end
end
icon 'confidential' icon 'confidential'
types Issue types Issue
condition do condition do
...@@ -75,11 +65,7 @@ module EE ...@@ -75,11 +65,7 @@ module EE
command :promote do command :promote do
@updates[:promote_to_epic] = true @updates[:promote_to_epic] = true
@execution_message[:promote] = if quick_action_target.confidential? @execution_message[:promote] = _('Promoted issue to an epic.')
_('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
end end
desc _('Set iteration') desc _('Set iteration')
......
...@@ -89,33 +89,6 @@ RSpec.describe 'Issue promotion', :js do ...@@ -89,33 +89,6 @@ RSpec.describe 'Issue promotion', :js do
end end
end 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 end
private private
......
...@@ -204,6 +204,21 @@ RSpec.describe Epics::IssuePromoteService, :aggregate_failures do ...@@ -204,6 +204,21 @@ RSpec.describe Epics::IssuePromoteService, :aggregate_failures do
expect(epic.parent).to eq(parent_epic) expect(epic.parent).to eq(parent_epic)
end end
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 end
context 'when issue was already promoted' do context 'when issue was already promoted' do
......
...@@ -26177,9 +26177,6 @@ msgstr "" ...@@ -26177,9 +26177,6 @@ msgstr ""
msgid "Promote" msgid "Promote"
msgstr "" msgstr ""
msgid "Promote confidential issue to a non-confidential epic"
msgstr ""
msgid "Promote issue to an epic" msgid "Promote issue to an epic"
msgstr "" msgstr ""
...@@ -26198,9 +26195,6 @@ msgstr "" ...@@ -26198,9 +26195,6 @@ msgstr ""
msgid "PromoteMilestone|Promotion failed - %{message}" msgid "PromoteMilestone|Promotion failed - %{message}"
msgstr "" 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." msgid "Promoted issue to an epic."
msgstr "" 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