Commit 32bb87e3 authored by Jacopo's avatar Jacopo Committed by Mayra Cabrera

Add execution_messages for EE only quick actions

Add the execution_message text for all the EE only quick actions.
parent 5caa1ddc
......@@ -22,6 +22,7 @@ module EE
if child_epic && !quick_action_target.child?(child_epic.id)
EpicLinks::CreateService.new(quick_action_target, current_user, { target_issuable: child_epic }).execute
@execution_message[:child_epic] = _("Added %{epic_ref} as child epic.") % { epic_ref: child_epic.to_reference(quick_action_target) }
end
end
......@@ -29,7 +30,7 @@ module EE
explanation do |epic_param|
child_epic = extract_epic(epic_param)
_("Removes %{epic_ref} from child epics.") % { epic_ref: child_epic.to_reference(quick_action_target) } if child_epic
_("Removes %{epic_ref} from child epics.") % { epic_ref: child_epic.to_reference(quick_action_target) }
end
types Epic
condition { action_allowed? }
......@@ -39,6 +40,7 @@ module EE
if child_epic && quick_action_target.child?(child_epic.id)
EpicLinks::DestroyService.new(child_epic, current_user).execute
@execution_message[:remove_child_epic] = _("Removed %{epic_ref} from child epics.") % { epic_ref: child_epic.to_reference(quick_action_target) }
end
end
......@@ -56,6 +58,7 @@ module EE
if parent_epic && !parent_epic.child?(quick_action_target.id)
EpicLinks::CreateService.new(parent_epic, current_user, { target_issuable: quick_action_target }).execute
@execution_message[:parent_epic] = _("Set %{epic_ref} as parent epic.") % { epic_ref: parent_epic.to_reference(quick_action_target) }
end
end
......@@ -70,7 +73,9 @@ module EE
action_allowed? && quick_action_target.parent.present?
end
command :remove_parent_epic do
parent_epic = quick_action_target.parent
EpicLinks::DestroyService.new(quick_action_target, current_user).execute
@execution_message[:remove_parent_epic] = _('Removed parent epic %{epic_ref}.') % { epic_ref: parent_epic.to_reference(quick_action_target) }
end
private
......
......@@ -8,8 +8,9 @@ module EE
include ::Gitlab::QuickActions::Dsl
included do
desc 'Add to epic'
explanation 'Adds an issue to an epic.'
desc _('Add to epic')
explanation _('Adds an issue to an epic.')
execution_message _('Added an issue to an epic.')
types Issue
condition do
quick_action_target.project.group&.feature_available?(:epics) &&
......@@ -20,8 +21,9 @@ module EE
@updates[:epic] = extract_epic(epic_param)
end
desc 'Remove from epic'
explanation 'Removes an issue from an epic.'
desc _('Remove from epic')
explanation _('Removes an issue from an epic.')
execution_message _('Removed an issue from an epic.')
types Issue
condition do
quick_action_target.persisted? &&
......@@ -32,9 +34,9 @@ module EE
@updates[:epic] = nil
end
desc 'Promote issue to an epic'
explanation 'Promote issue to an epic.'
warning 'may expose confidential information'
desc _('Promote issue to an epic')
explanation _('Promote issue to an epic.')
warning _('may expose confidential information')
types Issue
condition do
quick_action_target.persisted? &&
......@@ -43,6 +45,7 @@ module EE
end
command :promote do
Epics::IssuePromoteService.new(quick_action_target.project, current_user).execute(quick_action_target)
@execution_message[:promote] = _('Promoted issue to an epic.')
end
def extract_epic(params)
......
......@@ -9,9 +9,8 @@ module EE
included do
desc _('Change assignee(s)')
explanation do
_('Change assignee(s).')
end
explanation _('Change assignee(s).')
execution_message _('Changed assignee(s).')
params '@user1 @user2'
types Issue, MergeRequest
condition do
......@@ -27,6 +26,7 @@ module EE
explanation do |weight|
_("Sets weight to %{weight}.") % { weight: weight } if weight
end
params "0, 1, 2, …"
types Issue, MergeRequest
condition do
......@@ -37,11 +37,15 @@ module EE
weight.to_i if weight.to_i >= 0
end
command :weight do |weight|
@updates[:weight] = weight if weight
if weight
@updates[:weight] = weight
@execution_message[:weight] = _("Set weight to %{weight}.") % { weight: weight }
end
end
desc _('Clear weight')
explanation _('Clears weight.')
execution_message _('Cleared weight.')
types Issue, MergeRequest
condition do
quick_action_target.persisted? &&
......
......@@ -8,8 +8,8 @@ module EE
include ::Gitlab::QuickActions::Dsl
included do
desc 'Approve a merge request'
explanation 'Approve the current merge request.'
desc _('Approve a merge request')
explanation _('Approve the current merge request.')
types MergeRequest
condition do
quick_action_target.persisted? && quick_action_target.can_approve?(current_user) && !quick_action_target.project.require_password_to_approve?
......@@ -17,6 +17,7 @@ module EE
command :approve do
if quick_action_target.can_approve?(current_user)
::MergeRequests::ApprovalService.new(quick_action_target.project, current_user).execute(quick_action_target)
@execution_message[:approve] = _('Approved the current merge request.')
end
end
end
......
......@@ -12,6 +12,9 @@ module EE
explanation do |related_reference|
_('Marks this issue as related to %{issue_ref}.') % { issue_ref: related_reference }
end
execution_message do |related_reference|
_('Marked this issue as related to %{issue_ref}.') % { issue_ref: related_reference }
end
params '#issue'
types Issue
condition do
......
......@@ -18,7 +18,7 @@ describe 'Issue promotion', :js do
it 'does not promote the issue' do
visit project_issue_path(project, issue)
expect(page).not_to have_content 'Commands applied'
expect(page).not_to have_content 'Promoted issue to an epic.'
expect(issue.reload).to be_open
expect(Epic.count).to be_zero
......@@ -36,7 +36,7 @@ describe 'Issue promotion', :js do
end
it 'does not promote the issue' do
expect(page).not_to have_content 'Commands applied'
expect(page).not_to have_content 'Promoted issue to an epic.'
expect(issue.reload).to be_open
expect(Epic.count).to be_zero
......@@ -56,7 +56,7 @@ describe 'Issue promotion', :js do
epic = Epic.last
expect(page).to have_content 'Commands applied'
expect(page).to have_content 'Promoted issue to an epic.'
expect(issue.reload).to be_closed
expect(epic.title).to eq(issue.title)
expect(epic.description).to eq(issue.description)
......
......@@ -884,6 +884,9 @@ msgstr ""
msgid "Add reaction"
msgstr ""
msgid "Add to epic"
msgstr ""
msgid "Add to merge train"
msgstr ""
......@@ -914,12 +917,18 @@ msgstr ""
msgid "Added"
msgstr ""
msgid "Added %{epic_ref} as child epic."
msgstr ""
msgid "Added %{label_references} %{label_text}."
msgstr ""
msgid "Added a todo."
msgstr ""
msgid "Added an issue to an epic."
msgstr ""
msgid "Added at"
msgstr ""
......@@ -944,6 +953,9 @@ msgstr ""
msgid "Adds a todo."
msgstr ""
msgid "Adds an issue to an epic."
msgstr ""
msgid "Admin Area"
msgstr ""
......@@ -1596,6 +1608,15 @@ msgstr ""
msgid "Approve"
msgstr ""
msgid "Approve a merge request"
msgstr ""
msgid "Approve the current merge request."
msgstr ""
msgid "Approved the current merge request."
msgstr ""
msgid "Apr"
msgstr ""
......@@ -2609,6 +2630,9 @@ msgstr ""
msgid "ChangeTypeAction|This will create a new commit in order to revert the existing changes."
msgstr ""
msgid "Changed assignee(s)."
msgstr ""
msgid "Changed the title to \"%{title_param}\"."
msgstr ""
......@@ -2930,6 +2954,9 @@ msgstr ""
msgid "Clear weight"
msgstr ""
msgid "Cleared weight."
msgstr ""
msgid "Clears weight."
msgstr ""
......@@ -8641,6 +8668,9 @@ msgstr ""
msgid "Marked this issue as a duplicate of %{duplicate_param}."
msgstr ""
msgid "Marked this issue as related to %{issue_ref}."
msgstr ""
msgid "Marked to do as done."
msgstr ""
......@@ -11399,6 +11429,12 @@ msgstr ""
msgid "Promote"
msgstr ""
msgid "Promote issue to an epic"
msgstr ""
msgid "Promote issue to an epic."
msgstr ""
msgid "Promote these project milestones into a group milestone."
msgstr ""
......@@ -11417,6 +11453,9 @@ msgstr ""
msgid "PromoteMilestone|Promotion failed - %{message}"
msgstr ""
msgid "Promoted issue to an epic."
msgstr ""
msgid "Promotions|Don't show me this again"
msgstr ""
......@@ -11788,6 +11827,9 @@ msgstr ""
msgid "Remove from board"
msgstr ""
msgid "Remove from epic"
msgstr ""
msgid "Remove group"
msgstr ""
......@@ -11815,6 +11857,9 @@ msgstr ""
msgid "Removed %{assignee_text} %{assignee_references}."
msgstr ""
msgid "Removed %{epic_ref} from child epics."
msgstr ""
msgid "Removed %{label_references} %{label_text}."
msgstr ""
......@@ -11827,9 +11872,15 @@ msgstr ""
msgid "Removed all labels."
msgstr ""
msgid "Removed an issue from an epic."
msgstr ""
msgid "Removed group can not be restored!"
msgstr ""
msgid "Removed parent epic %{epic_ref}."
msgstr ""
msgid "Removed projects cannot be restored!"
msgstr ""
......@@ -11857,6 +11908,9 @@ msgstr ""
msgid "Removes all labels."
msgstr ""
msgid "Removes an issue from an epic."
msgstr ""
msgid "Removes parent epic %{epic_ref}."
msgstr ""
......@@ -12805,6 +12859,9 @@ msgstr ""
msgid "Session expiration, projects limit and attachment size."
msgstr ""
msgid "Set %{epic_ref} as parent epic."
msgstr ""
msgid "Set a default template for issue descriptions."
msgstr ""
......@@ -12898,6 +12955,9 @@ msgstr ""
msgid "Set weight"
msgstr ""
msgid "Set weight to %{weight}."
msgstr ""
msgid "SetPasswordToCloneLink|set a password"
msgstr ""
......@@ -17483,6 +17543,9 @@ msgstr ""
msgid "manual"
msgstr ""
msgid "may expose confidential information"
msgstr ""
msgid "merge request"
msgid_plural "merge requests"
msgstr[0] ""
......
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