Commit 856c22eb authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre 🔴

Merge branch 'master' into 'master'

Changed confidential quick action to only be available on non confidential issues

See merge request !16902
parents 643d4fad 0147efae
Pipeline #83011696 passed with stages
in 43 minutes and 36 seconds
---
title: Changed confidential quick action to only be available on non confidential issues
merge_request: 16902
author: Marc Schwede
type: fixed
......@@ -135,7 +135,8 @@ module Gitlab
end
types Issue
condition do
current_user.can?(:"admin_#{quick_action_target.to_ability_name}", quick_action_target)
!quick_action_target.confidential? &&
current_user.can?(:"admin_#{quick_action_target.to_ability_name}", quick_action_target)
end
command :confidential do
@updates[:confidential] = true
......
......@@ -586,6 +586,22 @@ describe QuickActions::InterpretService do
expect(message).to eq('Made this issue confidential.')
end
context 'when issuable is already confidential' do
before do
issuable.update(confidential: true)
end
it 'does not return the success message' do
_, _, message = service.execute(content, issuable)
expect(message).to be_empty
end
it 'is not part of the available commands' do
expect(service.available_commands(issuable)).not_to include(a_hash_including(name: :confidential))
end
end
end
shared_examples 'shrug command' do
......
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