Commit 220b2d00 authored by Dylan Griffith's avatar Dylan Griffith

Merge branch...

Merge branch '20917-do-not-show-button-to-resolve-discussion-opening-an-issue-when-issues-are-disabled-or-not' into 'master'

Do not show button to resolve discussion opening an issue when issues are disabled or not visible to user

See merge request gitlab-org/gitlab!54263
parents d4036b14 ed09aa33
...@@ -40,7 +40,7 @@ class BaseDiscussionEntity < Grape::Entity ...@@ -40,7 +40,7 @@ class BaseDiscussionEntity < Grape::Entity
end end
expose :resolve_with_issue_path do |discussion| expose :resolve_with_issue_path do |discussion|
new_project_issue_path(discussion.project, merge_request_to_resolve_discussions_of: discussion.noteable.iid, discussion_to_resolve: discussion.id) new_project_issue_path(discussion.project, merge_request_to_resolve_discussions_of: discussion.noteable.iid, discussion_to_resolve: discussion.id) if discussion&.project&.issues_enabled?
end end
end end
......
---
title: Do not show button to resolve discussion opening an issue when issues are disabled
merge_request: 54263
author:
type: fixed
...@@ -66,4 +66,13 @@ RSpec.describe BaseDiscussionEntity do ...@@ -66,4 +66,13 @@ RSpec.describe BaseDiscussionEntity do
) )
end end
end end
context 'when issues are disabled in a project' do
let(:project) { create(:project, :issues_disabled) }
let(:note) { create(:discussion_note_on_merge_request, project: project) }
it 'does not show a new issues path' do
expect(entity.as_json[:resolve_with_issue_path]).to be_nil
end
end
end end
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