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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
6c796702
Commit
6c796702
authored
Nov 14, 2018
by
Oswaldo Ferreira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove 'comment_on_any_diff_line' feature flag
parent
f76b3106
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
28 deletions
+1
-28
app/controllers/projects/blob_controller.rb
app/controllers/projects/blob_controller.rb
+1
-6
spec/controllers/projects/blob_controller_spec.rb
spec/controllers/projects/blob_controller_spec.rb
+0
-22
No files found.
app/controllers/projects/blob_controller.rb
View file @
6c796702
...
...
@@ -122,7 +122,7 @@ class Projects::BlobController < Projects::ApplicationController
@lines
.
map!
do
|
line
|
# These are marked as context lines but are loaded from blobs.
# We also have context lines loaded from diffs in other places.
diff_line
=
Gitlab
::
Diff
::
Line
.
new
(
line
,
expanded_diff_line_type
,
nil
,
nil
,
nil
)
diff_line
=
Gitlab
::
Diff
::
Line
.
new
(
line
,
nil
,
nil
,
nil
,
nil
)
diff_line
.
rich_text
=
line
diff_line
end
...
...
@@ -132,11 +132,6 @@ class Projects::BlobController < Projects::ApplicationController
render
json:
DiffLineSerializer
.
new
.
represent
(
@lines
)
end
def
expanded_diff_line_type
# Context lines can't receive comments.
Feature
.
enabled?
(
:comment_in_any_diff_line
,
@project
)
?
nil
:
'context'
end
def
add_match_line
return
unless
@form
.
unfold?
...
...
spec/controllers/projects/blob_controller_spec.rb
View file @
6c796702
...
...
@@ -141,28 +141,6 @@ describe Projects::BlobController do
expect
(
lines
.
first
).
to
have_key
(
'rich_text'
)
end
context
'comment in any diff line feature flag'
do
it
'renders context lines when feature disabled'
do
stub_feature_flags
(
comment_in_any_diff_line:
false
)
do_get
(
since:
1
,
to:
5
,
offset:
10
,
from_merge_request:
true
)
lines
=
JSON
.
parse
(
response
.
body
)
all_context
=
lines
.
all?
{
|
line
|
line
[
'type'
]
==
'context'
}
expect
(
all_context
).
to
be
(
true
)
end
it
'renders unchanged lines when feature enabled'
do
stub_feature_flags
(
comment_in_any_diff_line:
true
)
do_get
(
since:
1
,
to:
5
,
offset:
10
,
from_merge_request:
true
)
lines
=
JSON
.
parse
(
response
.
body
)
all_unchanged
=
lines
.
all?
{
|
line
|
line
[
'type'
].
nil?
}
expect
(
all_unchanged
).
to
be
(
true
)
end
end
context
'when rendering match lines'
do
it
'adds top match line when "since" is less than 1'
do
do_get
(
since:
5
,
to:
10
,
offset:
10
,
from_merge_request:
true
)
...
...
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