Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
32bb87e3
Commit
32bb87e3
authored
Jul 13, 2019
by
Jacopo
Committed by
Mayra Cabrera
Jul 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add execution_messages for EE only quick actions
Add the execution_message text for all the EE only quick actions.
parent
5caa1ddc
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
96 additions
and
17 deletions
+96
-17
ee/lib/ee/gitlab/quick_actions/epic_actions.rb
ee/lib/ee/gitlab/quick_actions/epic_actions.rb
+6
-1
ee/lib/ee/gitlab/quick_actions/issue_actions.rb
ee/lib/ee/gitlab/quick_actions/issue_actions.rb
+10
-7
ee/lib/ee/gitlab/quick_actions/issue_and_merge_request_actions.rb
...e/gitlab/quick_actions/issue_and_merge_request_actions.rb
+8
-4
ee/lib/ee/gitlab/quick_actions/merge_request_actions.rb
ee/lib/ee/gitlab/quick_actions/merge_request_actions.rb
+3
-2
ee/lib/ee/gitlab/quick_actions/relate_actions.rb
ee/lib/ee/gitlab/quick_actions/relate_actions.rb
+3
-0
ee/spec/features/epics/issue_promotion_spec.rb
ee/spec/features/epics/issue_promotion_spec.rb
+3
-3
locale/gitlab.pot
locale/gitlab.pot
+63
-0
No files found.
ee/lib/ee/gitlab/quick_actions/epic_actions.rb
View file @
32bb87e3
...
@@ -22,6 +22,7 @@ module EE
...
@@ -22,6 +22,7 @@ module EE
if
child_epic
&&
!
quick_action_target
.
child?
(
child_epic
.
id
)
if
child_epic
&&
!
quick_action_target
.
child?
(
child_epic
.
id
)
EpicLinks
::
CreateService
.
new
(
quick_action_target
,
current_user
,
{
target_issuable:
child_epic
}).
execute
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
end
end
...
@@ -29,7 +30,7 @@ module EE
...
@@ -29,7 +30,7 @@ module EE
explanation
do
|
epic_param
|
explanation
do
|
epic_param
|
child_epic
=
extract_epic
(
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
end
types
Epic
types
Epic
condition
{
action_allowed?
}
condition
{
action_allowed?
}
...
@@ -39,6 +40,7 @@ module EE
...
@@ -39,6 +40,7 @@ module EE
if
child_epic
&&
quick_action_target
.
child?
(
child_epic
.
id
)
if
child_epic
&&
quick_action_target
.
child?
(
child_epic
.
id
)
EpicLinks
::
DestroyService
.
new
(
child_epic
,
current_user
).
execute
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
end
end
...
@@ -56,6 +58,7 @@ module EE
...
@@ -56,6 +58,7 @@ module EE
if
parent_epic
&&
!
parent_epic
.
child?
(
quick_action_target
.
id
)
if
parent_epic
&&
!
parent_epic
.
child?
(
quick_action_target
.
id
)
EpicLinks
::
CreateService
.
new
(
parent_epic
,
current_user
,
{
target_issuable:
quick_action_target
}).
execute
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
end
end
...
@@ -70,7 +73,9 @@ module EE
...
@@ -70,7 +73,9 @@ module EE
action_allowed?
&&
quick_action_target
.
parent
.
present?
action_allowed?
&&
quick_action_target
.
parent
.
present?
end
end
command
:remove_parent_epic
do
command
:remove_parent_epic
do
parent_epic
=
quick_action_target
.
parent
EpicLinks
::
DestroyService
.
new
(
quick_action_target
,
current_user
).
execute
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
end
private
private
...
...
ee/lib/ee/gitlab/quick_actions/issue_actions.rb
View file @
32bb87e3
...
@@ -8,8 +8,9 @@ module EE
...
@@ -8,8 +8,9 @@ module EE
include
::
Gitlab
::
QuickActions
::
Dsl
include
::
Gitlab
::
QuickActions
::
Dsl
included
do
included
do
desc
'Add to epic'
desc
_
(
'Add to epic'
)
explanation
'Adds an issue to an epic.'
explanation
_
(
'Adds an issue to an epic.'
)
execution_message
_
(
'Added an issue to an epic.'
)
types
Issue
types
Issue
condition
do
condition
do
quick_action_target
.
project
.
group
&
.
feature_available?
(
:epics
)
&&
quick_action_target
.
project
.
group
&
.
feature_available?
(
:epics
)
&&
...
@@ -20,8 +21,9 @@ module EE
...
@@ -20,8 +21,9 @@ module EE
@updates
[
:epic
]
=
extract_epic
(
epic_param
)
@updates
[
:epic
]
=
extract_epic
(
epic_param
)
end
end
desc
'Remove from epic'
desc
_
(
'Remove from epic'
)
explanation
'Removes an issue from an epic.'
explanation
_
(
'Removes an issue from an epic.'
)
execution_message
_
(
'Removed an issue from an epic.'
)
types
Issue
types
Issue
condition
do
condition
do
quick_action_target
.
persisted?
&&
quick_action_target
.
persisted?
&&
...
@@ -32,9 +34,9 @@ module EE
...
@@ -32,9 +34,9 @@ module EE
@updates
[
:epic
]
=
nil
@updates
[
:epic
]
=
nil
end
end
desc
'Promote issue to an epic'
desc
_
(
'Promote issue to an epic'
)
explanation
'Promote issue to an epic.'
explanation
_
(
'Promote issue to an epic.'
)
warning
'may expose confidential information'
warning
_
(
'may expose confidential information'
)
types
Issue
types
Issue
condition
do
condition
do
quick_action_target
.
persisted?
&&
quick_action_target
.
persisted?
&&
...
@@ -43,6 +45,7 @@ module EE
...
@@ -43,6 +45,7 @@ module EE
end
end
command
:promote
do
command
:promote
do
Epics
::
IssuePromoteService
.
new
(
quick_action_target
.
project
,
current_user
).
execute
(
quick_action_target
)
Epics
::
IssuePromoteService
.
new
(
quick_action_target
.
project
,
current_user
).
execute
(
quick_action_target
)
@execution_message
[
:promote
]
=
_
(
'Promoted issue to an epic.'
)
end
end
def
extract_epic
(
params
)
def
extract_epic
(
params
)
...
...
ee/lib/ee/gitlab/quick_actions/issue_and_merge_request_actions.rb
View file @
32bb87e3
...
@@ -9,9 +9,8 @@ module EE
...
@@ -9,9 +9,8 @@ module EE
included
do
included
do
desc
_
(
'Change assignee(s)'
)
desc
_
(
'Change assignee(s)'
)
explanation
do
explanation
_
(
'Change assignee(s).'
)
_
(
'Change assignee(s).'
)
execution_message
_
(
'Changed assignee(s).'
)
end
params
'@user1 @user2'
params
'@user1 @user2'
types
Issue
,
MergeRequest
types
Issue
,
MergeRequest
condition
do
condition
do
...
@@ -27,6 +26,7 @@ module EE
...
@@ -27,6 +26,7 @@ module EE
explanation
do
|
weight
|
explanation
do
|
weight
|
_
(
"Sets weight to %{weight}."
)
%
{
weight:
weight
}
if
weight
_
(
"Sets weight to %{weight}."
)
%
{
weight:
weight
}
if
weight
end
end
params
"0, 1, 2, …"
params
"0, 1, 2, …"
types
Issue
,
MergeRequest
types
Issue
,
MergeRequest
condition
do
condition
do
...
@@ -37,11 +37,15 @@ module EE
...
@@ -37,11 +37,15 @@ module EE
weight
.
to_i
if
weight
.
to_i
>=
0
weight
.
to_i
if
weight
.
to_i
>=
0
end
end
command
:weight
do
|
weight
|
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
end
desc
_
(
'Clear weight'
)
desc
_
(
'Clear weight'
)
explanation
_
(
'Clears weight.'
)
explanation
_
(
'Clears weight.'
)
execution_message
_
(
'Cleared weight.'
)
types
Issue
,
MergeRequest
types
Issue
,
MergeRequest
condition
do
condition
do
quick_action_target
.
persisted?
&&
quick_action_target
.
persisted?
&&
...
...
ee/lib/ee/gitlab/quick_actions/merge_request_actions.rb
View file @
32bb87e3
...
@@ -8,8 +8,8 @@ module EE
...
@@ -8,8 +8,8 @@ module EE
include
::
Gitlab
::
QuickActions
::
Dsl
include
::
Gitlab
::
QuickActions
::
Dsl
included
do
included
do
desc
'Approve a merge request'
desc
_
(
'Approve a merge request'
)
explanation
'Approve the current merge request.'
explanation
_
(
'Approve the current merge request.'
)
types
MergeRequest
types
MergeRequest
condition
do
condition
do
quick_action_target
.
persisted?
&&
quick_action_target
.
can_approve?
(
current_user
)
&&
!
quick_action_target
.
project
.
require_password_to_approve?
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
...
@@ -17,6 +17,7 @@ module EE
command
:approve
do
command
:approve
do
if
quick_action_target
.
can_approve?
(
current_user
)
if
quick_action_target
.
can_approve?
(
current_user
)
::
MergeRequests
::
ApprovalService
.
new
(
quick_action_target
.
project
,
current_user
).
execute
(
quick_action_target
)
::
MergeRequests
::
ApprovalService
.
new
(
quick_action_target
.
project
,
current_user
).
execute
(
quick_action_target
)
@execution_message
[
:approve
]
=
_
(
'Approved the current merge request.'
)
end
end
end
end
end
end
...
...
ee/lib/ee/gitlab/quick_actions/relate_actions.rb
View file @
32bb87e3
...
@@ -12,6 +12,9 @@ module EE
...
@@ -12,6 +12,9 @@ module EE
explanation
do
|
related_reference
|
explanation
do
|
related_reference
|
_
(
'Marks this issue as related to %{issue_ref}.'
)
%
{
issue_ref:
related_reference
}
_
(
'Marks this issue as related to %{issue_ref}.'
)
%
{
issue_ref:
related_reference
}
end
end
execution_message
do
|
related_reference
|
_
(
'Marked this issue as related to %{issue_ref}.'
)
%
{
issue_ref:
related_reference
}
end
params
'#issue'
params
'#issue'
types
Issue
types
Issue
condition
do
condition
do
...
...
ee/spec/features/epics/issue_promotion_spec.rb
View file @
32bb87e3
...
@@ -18,7 +18,7 @@ describe 'Issue promotion', :js do
...
@@ -18,7 +18,7 @@ describe 'Issue promotion', :js do
it
'does not promote the issue'
do
it
'does not promote the issue'
do
visit
project_issue_path
(
project
,
issue
)
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
(
issue
.
reload
).
to
be_open
expect
(
Epic
.
count
).
to
be_zero
expect
(
Epic
.
count
).
to
be_zero
...
@@ -36,7 +36,7 @@ describe 'Issue promotion', :js do
...
@@ -36,7 +36,7 @@ describe 'Issue promotion', :js do
end
end
it
'does not promote the issue'
do
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
(
issue
.
reload
).
to
be_open
expect
(
Epic
.
count
).
to
be_zero
expect
(
Epic
.
count
).
to
be_zero
...
@@ -56,7 +56,7 @@ describe 'Issue promotion', :js do
...
@@ -56,7 +56,7 @@ describe 'Issue promotion', :js do
epic
=
Epic
.
last
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
(
issue
.
reload
).
to
be_closed
expect
(
epic
.
title
).
to
eq
(
issue
.
title
)
expect
(
epic
.
title
).
to
eq
(
issue
.
title
)
expect
(
epic
.
description
).
to
eq
(
issue
.
description
)
expect
(
epic
.
description
).
to
eq
(
issue
.
description
)
...
...
locale/gitlab.pot
View file @
32bb87e3
...
@@ -884,6 +884,9 @@ msgstr ""
...
@@ -884,6 +884,9 @@ msgstr ""
msgid "Add reaction"
msgid "Add reaction"
msgstr ""
msgstr ""
msgid "Add to epic"
msgstr ""
msgid "Add to merge train"
msgid "Add to merge train"
msgstr ""
msgstr ""
...
@@ -914,12 +917,18 @@ msgstr ""
...
@@ -914,12 +917,18 @@ msgstr ""
msgid "Added"
msgid "Added"
msgstr ""
msgstr ""
msgid "Added %{epic_ref} as child epic."
msgstr ""
msgid "Added %{label_references} %{label_text}."
msgid "Added %{label_references} %{label_text}."
msgstr ""
msgstr ""
msgid "Added a todo."
msgid "Added a todo."
msgstr ""
msgstr ""
msgid "Added an issue to an epic."
msgstr ""
msgid "Added at"
msgid "Added at"
msgstr ""
msgstr ""
...
@@ -944,6 +953,9 @@ msgstr ""
...
@@ -944,6 +953,9 @@ msgstr ""
msgid "Adds a todo."
msgid "Adds a todo."
msgstr ""
msgstr ""
msgid "Adds an issue to an epic."
msgstr ""
msgid "Admin Area"
msgid "Admin Area"
msgstr ""
msgstr ""
...
@@ -1596,6 +1608,15 @@ msgstr ""
...
@@ -1596,6 +1608,15 @@ msgstr ""
msgid "Approve"
msgid "Approve"
msgstr ""
msgstr ""
msgid "Approve a merge request"
msgstr ""
msgid "Approve the current merge request."
msgstr ""
msgid "Approved the current merge request."
msgstr ""
msgid "Apr"
msgid "Apr"
msgstr ""
msgstr ""
...
@@ -2609,6 +2630,9 @@ msgstr ""
...
@@ -2609,6 +2630,9 @@ msgstr ""
msgid "ChangeTypeAction|This will create a new commit in order to revert the existing changes."
msgid "ChangeTypeAction|This will create a new commit in order to revert the existing changes."
msgstr ""
msgstr ""
msgid "Changed assignee(s)."
msgstr ""
msgid "Changed the title to \"%{title_param}\"."
msgid "Changed the title to \"%{title_param}\"."
msgstr ""
msgstr ""
...
@@ -2930,6 +2954,9 @@ msgstr ""
...
@@ -2930,6 +2954,9 @@ msgstr ""
msgid "Clear weight"
msgid "Clear weight"
msgstr ""
msgstr ""
msgid "Cleared weight."
msgstr ""
msgid "Clears weight."
msgid "Clears weight."
msgstr ""
msgstr ""
...
@@ -8641,6 +8668,9 @@ msgstr ""
...
@@ -8641,6 +8668,9 @@ msgstr ""
msgid "Marked this issue as a duplicate of %{duplicate_param}."
msgid "Marked this issue as a duplicate of %{duplicate_param}."
msgstr ""
msgstr ""
msgid "Marked this issue as related to %{issue_ref}."
msgstr ""
msgid "Marked to do as done."
msgid "Marked to do as done."
msgstr ""
msgstr ""
...
@@ -11399,6 +11429,12 @@ msgstr ""
...
@@ -11399,6 +11429,12 @@ msgstr ""
msgid "Promote"
msgid "Promote"
msgstr ""
msgstr ""
msgid "Promote issue to an epic"
msgstr ""
msgid "Promote issue to an epic."
msgstr ""
msgid "Promote these project milestones into a group milestone."
msgid "Promote these project milestones into a group milestone."
msgstr ""
msgstr ""
...
@@ -11417,6 +11453,9 @@ msgstr ""
...
@@ -11417,6 +11453,9 @@ msgstr ""
msgid "PromoteMilestone|Promotion failed - %{message}"
msgid "PromoteMilestone|Promotion failed - %{message}"
msgstr ""
msgstr ""
msgid "Promoted issue to an epic."
msgstr ""
msgid "Promotions|Don't show me this again"
msgid "Promotions|Don't show me this again"
msgstr ""
msgstr ""
...
@@ -11788,6 +11827,9 @@ msgstr ""
...
@@ -11788,6 +11827,9 @@ msgstr ""
msgid "Remove from board"
msgid "Remove from board"
msgstr ""
msgstr ""
msgid "Remove from epic"
msgstr ""
msgid "Remove group"
msgid "Remove group"
msgstr ""
msgstr ""
...
@@ -11815,6 +11857,9 @@ msgstr ""
...
@@ -11815,6 +11857,9 @@ msgstr ""
msgid "Removed %{assignee_text} %{assignee_references}."
msgid "Removed %{assignee_text} %{assignee_references}."
msgstr ""
msgstr ""
msgid "Removed %{epic_ref} from child epics."
msgstr ""
msgid "Removed %{label_references} %{label_text}."
msgid "Removed %{label_references} %{label_text}."
msgstr ""
msgstr ""
...
@@ -11827,9 +11872,15 @@ msgstr ""
...
@@ -11827,9 +11872,15 @@ msgstr ""
msgid "Removed all labels."
msgid "Removed all labels."
msgstr ""
msgstr ""
msgid "Removed an issue from an epic."
msgstr ""
msgid "Removed group can not be restored!"
msgid "Removed group can not be restored!"
msgstr ""
msgstr ""
msgid "Removed parent epic %{epic_ref}."
msgstr ""
msgid "Removed projects cannot be restored!"
msgid "Removed projects cannot be restored!"
msgstr ""
msgstr ""
...
@@ -11857,6 +11908,9 @@ msgstr ""
...
@@ -11857,6 +11908,9 @@ msgstr ""
msgid "Removes all labels."
msgid "Removes all labels."
msgstr ""
msgstr ""
msgid "Removes an issue from an epic."
msgstr ""
msgid "Removes parent epic %{epic_ref}."
msgid "Removes parent epic %{epic_ref}."
msgstr ""
msgstr ""
...
@@ -12805,6 +12859,9 @@ msgstr ""
...
@@ -12805,6 +12859,9 @@ msgstr ""
msgid "Session expiration, projects limit and attachment size."
msgid "Session expiration, projects limit and attachment size."
msgstr ""
msgstr ""
msgid "Set %{epic_ref} as parent epic."
msgstr ""
msgid "Set a default template for issue descriptions."
msgid "Set a default template for issue descriptions."
msgstr ""
msgstr ""
...
@@ -12898,6 +12955,9 @@ msgstr ""
...
@@ -12898,6 +12955,9 @@ msgstr ""
msgid "Set weight"
msgid "Set weight"
msgstr ""
msgstr ""
msgid "Set weight to %{weight}."
msgstr ""
msgid "SetPasswordToCloneLink|set a password"
msgid "SetPasswordToCloneLink|set a password"
msgstr ""
msgstr ""
...
@@ -17483,6 +17543,9 @@ msgstr ""
...
@@ -17483,6 +17543,9 @@ msgstr ""
msgid "manual"
msgid "manual"
msgstr ""
msgstr ""
msgid "may expose confidential information"
msgstr ""
msgid "merge request"
msgid "merge request"
msgid_plural "merge requests"
msgid_plural "merge requests"
msgstr[0] ""
msgstr[0] ""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment