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
e412c034
Commit
e412c034
authored
Mar 10, 2022
by
Sarah Yasonik
Committed by
Etienne Baqué
Mar 10, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Limit availability of page quick action to relevant incidents
parent
79a3f536
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
5 deletions
+27
-5
ee/lib/ee/gitlab/quick_actions/issue_actions.rb
ee/lib/ee/gitlab/quick_actions/issue_actions.rb
+2
-1
ee/spec/support/shared_examples/quick_actions/issue/page_quick_action_shared_examples.rb
.../quick_actions/issue/page_quick_action_shared_examples.rb
+25
-4
No files found.
ee/lib/ee/gitlab/quick_actions/issue_actions.rb
View file @
e412c034
...
...
@@ -179,7 +179,8 @@ module EE
condition
do
current_user
.
can?
(
:update_escalation_status
,
quick_action_target
)
&&
quick_action_target
.
persisted?
&&
quick_action_target
.
supports_escalation?
quick_action_target
.
escalation_policies_available?
&&
!
quick_action_target
.
alert_management_alert
end
command
:page
do
|
escalation_policy_name
|
...
...
ee/spec/support/shared_examples/quick_actions/issue/page_quick_action_shared_examples.rb
View file @
e412c034
...
...
@@ -11,10 +11,9 @@ RSpec.shared_examples 'page quick action' do
let_it_be
(
:incident
,
reload:
true
)
{
create
(
:incident
,
project:
project
)
}
let_it_be
(
:escalation_status
,
reload:
true
)
{
create
(
:incident_management_issuable_escalation_status
,
issue:
incident
)
}
context
'when feature flag
s and licenses are
disabled'
do
context
'when feature flag
is
disabled'
do
before
do
stub_feature_flags
(
incident_escalations:
false
)
stub_licensed_features
(
oncall_schedules:
false
,
escalation_policies:
false
)
visit
project_issue_path
(
project
,
incident
)
wait_for_all_requests
end
...
...
@@ -26,9 +25,21 @@ RSpec.shared_examples 'page quick action' do
end
end
context
'when feature flags and licenses are enabled'
do
context
'when licensed features are disabled'
do
before
do
visit
project_issue_path
(
project
,
incident
)
wait_for_all_requests
end
it
'does not escalate issue'
do
add_note
(
'/page spec policy'
)
expect
(
page
).
to
have_content
(
'Could not apply page command'
)
end
end
context
'when licensed features are enabled'
do
before
do
stub_feature_flags
(
incident_escalations:
true
)
stub_licensed_features
(
oncall_schedules:
true
,
escalation_policies:
true
)
end
...
...
@@ -65,6 +76,16 @@ RSpec.shared_examples 'page quick action' do
end
end
context
'when issue already has an alert'
do
let_it_be
(
:alert
)
{
create
(
:alert_management_alert
,
issue:
incident
)
}
it
'does not escalate issue'
do
add_note
(
'/page spec policy'
)
expect
(
page
).
to
have_content
(
'Could not apply page command'
)
end
end
context
'when user does not have permissions'
do
before
do
project
.
add_reporter
(
user
)
...
...
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