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
2fe6d030
Commit
2fe6d030
authored
Feb 15, 2021
by
Gary Holtz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding a conditional to resolve_with_issue_path
parent
8d95b015
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
1 deletion
+15
-1
app/serializers/base_discussion_entity.rb
app/serializers/base_discussion_entity.rb
+1
-1
changelogs/unreleased/20917-do-not-show-button-to-resolve-discussion-opening-an-issue-when-issu.yml
...tton-to-resolve-discussion-opening-an-issue-when-issu.yml
+5
-0
spec/serializers/base_discussion_entity_spec.rb
spec/serializers/base_discussion_entity_spec.rb
+9
-0
No files found.
app/serializers/base_discussion_entity.rb
View file @
2fe6d030
...
@@ -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
...
...
changelogs/unreleased/20917-do-not-show-button-to-resolve-discussion-opening-an-issue-when-issu.yml
0 → 100644
View file @
2fe6d030
---
title
:
Do not show button to resolve discussion opening an issue when issues are disabled
merge_request
:
54263
author
:
type
:
fixed
spec/serializers/base_discussion_entity_spec.rb
View file @
2fe6d030
...
@@ -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
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