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
121d10cb
Commit
121d10cb
authored
Sep 11, 2020
by
David O'Regan
Committed by
Heinrich Lee Yu
Sep 11, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove iteration quick actions
parent
f174031b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
2 deletions
+48
-2
ee/app/models/ee/issue.rb
ee/app/models/ee/issue.rb
+4
-0
ee/lib/ee/gitlab/quick_actions/issue_actions.rb
ee/lib/ee/gitlab/quick_actions/issue_actions.rb
+4
-2
ee/spec/models/issue_spec.rb
ee/spec/models/issue_spec.rb
+20
-0
ee/spec/services/quick_actions/interpret_service_spec.rb
ee/spec/services/quick_actions/interpret_service_spec.rb
+20
-0
No files found.
ee/app/models/ee/issue.rb
View file @
121d10cb
...
...
@@ -137,6 +137,10 @@ module EE
!
incident?
end
def
supports_iterations?
!
incident?
end
def
can_assign_epic?
(
user
)
user
&
.
can?
(
:admin_epic
,
project
.
group
)
end
...
...
ee/lib/ee/gitlab/quick_actions/issue_actions.rb
View file @
121d10cb
...
...
@@ -96,7 +96,8 @@ module EE
params
'*iteration:"iteration name"'
types
Issue
condition
do
current_user
.
can?
(
:"admin_
#{
quick_action_target
.
to_ability_name
}
"
,
project
)
&&
quick_action_target
.
supports_iterations?
&&
current_user
.
can?
(
:"admin_
#{
quick_action_target
.
to_ability_name
}
"
,
project
)
&&
quick_action_target
.
project
.
group
&
.
feature_available?
(
:iterations
)
&&
find_iterations
(
project
,
state:
'active'
).
any?
end
...
...
@@ -117,7 +118,8 @@ module EE
end
types
Issue
condition
do
quick_action_target
.
persisted?
&&
quick_action_target
.
supports_iterations?
&&
quick_action_target
.
persisted?
&&
quick_action_target
.
sprint_id?
&&
quick_action_target
.
project
.
group
&
.
feature_available?
(
:iterations
)
&&
current_user
.
can?
(
:"admin_
#{
quick_action_target
.
to_ability_name
}
"
,
project
)
...
...
ee/spec/models/issue_spec.rb
View file @
121d10cb
...
...
@@ -739,4 +739,24 @@ RSpec.describe Issue do
end
end
end
describe
'#supports_iterations?'
do
let
(
:group
)
{
build_stubbed
(
:group
)
}
let
(
:project_with_group
)
{
build_stubbed
(
:project
,
group:
group
)
}
where
(
:issuable_type
,
:project
,
:supports_iterations
)
do
[
[
:issue
,
:project_with_group
,
true
],
[
:incident
,
:project_with_group
,
false
]
]
end
with_them
do
let
(
:issue
)
{
build_stubbed
(
issuable_type
,
project:
send
(
project
))
}
subject
{
issue
.
supports_iterations?
}
it
{
is_expected
.
to
eq
(
supports_iterations
)
}
end
end
end
ee/spec/services/quick_actions/interpret_service_spec.rb
View file @
121d10cb
...
...
@@ -272,6 +272,16 @@ RSpec.describe QuickActions::InterpretService do
expect
(
updates
).
to
be_empty
end
end
context
'when issuable does not support iterations'
do
it
'does not assign an iteration to an incident'
do
incident
=
create
(
:incident
,
project:
project
)
_
,
updates
=
service
.
execute
(
content
,
incident
)
expect
(
updates
).
to
be_empty
end
end
end
context
'remove_iteration command'
do
...
...
@@ -318,6 +328,16 @@ RSpec.describe QuickActions::InterpretService do
expect
(
updates
).
to
be_empty
end
end
context
'when issuable does not support iterations'
do
it
'does not assign an iteration to an incident'
do
incident
=
create
(
:incident
,
project:
project
)
_
,
updates
=
service
.
execute
(
content
,
incident
)
expect
(
updates
).
to
be_empty
end
end
end
context
'epic command'
do
...
...
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