Открыть боковую панель
nt_test133
nt_project_uxpg8lvcuq8w
Коммиты
6639aa3f
Коммит
6639aa3f
создал
Сен 06, 2019
по автору
Lee Tickett
Зафиксировано автором
Douglas Barbosa Alexandre
Сен 06, 2019
Просмотр файлов
Only show `/copy_metadata` when usable
владелец
af0eb56e
Изменения
3
Скрыть пробелы
Построчно
Рядом
changelogs/unreleased/31735-only-show-copy_metadata-when-usable.yml
0 → 100644
Просмотр файла @
6639aa3f
---
title
:
Only show /copy_metadata quick action when usable
merge_request
:
31735
author
:
Lee Tickett
type
:
fixed
lib/gitlab/quick_actions/issue_and_merge_request_actions.rb
Просмотр файла @
6639aa3f
...
...
@@ -122,7 +122,7 @@ module IssueAndMergeRequestActions
params
'#issue | !merge_request'
types
Issue
,
MergeRequest
condition
do
current_user
.
can?
(
:"
update
_
#{
quick_action_target
.
to_ability_name
}
"
,
quick_action_target
)
current_user
.
can?
(
:"
admin
_
#{
quick_action_target
.
to_ability_name
}
"
,
quick_action_target
)
end
parse_params
do
|
issuable_param
|
extract_references
(
issuable_param
,
:issue
).
first
||
...
...
spec/services/quick_actions/interpret_service_spec.rb
Просмотр файла @
6639aa3f
...
...
@@ -1140,6 +1140,19 @@
let
(
:todo_label
)
{
create
(
:label
,
project:
project
,
title:
'To Do'
)
}
let
(
:inreview_label
)
{
create
(
:label
,
project:
project
,
title:
'In Review'
)
}
it
'is available when the user is a developer'
do
expect
(
service
.
available_commands
(
issue
)).
to
include
(
a_hash_including
(
name: :copy_metadata
))
end
context
'when the user does not have permission'
do
let
(
:guest
)
{
create
(
:user
)
}
let
(
:service
)
{
described_class
.
new
(
project
,
guest
)
}
it
'is not available'
do
expect
(
service
.
available_commands
(
issue
)).
not_to
include
(
a_hash_including
(
name: :copy_metadata
))
end
end
it_behaves_like
'empty command'
do
let
(
:content
)
{
'/copy_metadata'
}
let
(
:issuable
)
{
issue
}
...
...
Редактирование
Предварительный просмотр
Поддерживает Markdown
0%
Попробовать снова
или
прикрепить новый файл
.
Отмена
You are about to add
0
people
to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Отмена
Пожалуйста,
зарегистрируйтесь
или
войдите
чтобы прокомментировать