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
7f6f4410
Commit
7f6f4410
authored
Dec 18, 2018
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
7147f050
58ee1746
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
4 additions
and
20 deletions
+4
-20
app/models/merge_request.rb
app/models/merge_request.rb
+1
-2
app/models/suggestion.rb
app/models/suggestion.rb
+0
-6
app/views/projects/merge_requests/show.html.haml
app/views/projects/merge_requests/show.html.haml
+3
-2
lib/banzai/filter/suggestion_filter.rb
lib/banzai/filter/suggestion_filter.rb
+0
-1
spec/lib/banzai/filter/suggestion_filter_spec.rb
spec/lib/banzai/filter/suggestion_filter_spec.rb
+0
-9
No files found.
app/models/merge_request.rb
View file @
7f6f4410
...
...
@@ -366,8 +366,7 @@ class MergeRequest < ActiveRecord::Base
end
def
supports_suggestion?
# Should be `true` when removing the FF.
Suggestion
.
feature_enabled?
true
end
# Calls `MergeWorker` to proceed with the merge process and
...
...
app/models/suggestion.rb
View file @
7f6f4410
# frozen_string_literal: true
class
Suggestion
<
ApplicationRecord
FEATURE_FLAG
=
:diff_suggestions
belongs_to
:note
,
inverse_of: :suggestions
validates
:note
,
presence:
true
validates
:commit_id
,
presence:
true
,
if: :applied?
...
...
@@ -10,10 +8,6 @@ class Suggestion < ApplicationRecord
delegate
:original_position
,
:position
,
:diff_file
,
:noteable
,
to: :note
def
self
.
feature_enabled?
Feature
.
enabled?
(
FEATURE_FLAG
)
end
def
project
noteable
.
source_project
end
...
...
app/views/projects/merge_requests/show.html.haml
View file @
7f6f4410
...
...
@@ -5,6 +5,7 @@
-
page_title
"
#{
@merge_request
.
title
}
(
#{
@merge_request
.
to_reference
}
)"
,
"Merge Requests"
-
page_description
@merge_request
.
description
-
page_card_attributes
@merge_request
.
card_attributes
-
suggest_changes_help_path
=
help_page_path
(
'user/discussions/index.md'
,
anchor:
'suggest-changes'
)
.merge-request
{
data:
{
mr_action:
j
(
params
[
:tab
].
presence
||
'show'
),
url:
merge_request_path
(
@merge_request
,
format: :json
),
project_path:
project_path
(
@merge_request
.
project
)
}
}
=
render
"projects/merge_requests/mr_title"
...
...
@@ -67,7 +68,7 @@
noteable_data:
serialize_issuable
(
@merge_request
),
noteable_type:
'MergeRequest'
,
target_type:
'merge_request'
,
help_page_path:
nil
,
help_page_path:
suggest_changes_help_path
,
current_user_data:
UserSerializer
.
new
(
project:
@project
).
represent
(
current_user
,
{},
MergeRequestUserEntity
).
to_json
}
}
#commits
.commits.tab-pane
...
...
@@ -77,7 +78,7 @@
=
render
'projects/commit/pipelines_list'
,
disable_initialization:
true
,
endpoint:
pipelines_project_merge_request_path
(
@project
,
@merge_request
)
#js-diffs-app
.diffs.tab-pane
{
data:
{
"is-locked"
=>
@merge_request
.
discussion_locked?
,
endpoint:
diffs_project_merge_request_path
(
@project
,
@merge_request
,
'json'
,
request
.
query_parameters
),
help_page_path:
nil
,
help_page_path:
suggest_changes_help_path
,
current_user_data:
UserSerializer
.
new
(
project:
@project
).
represent
(
current_user
,
{},
MergeRequestUserEntity
).
to_json
,
project_path:
project_path
(
@merge_request
.
project
),
changes_empty_state_illustration:
image_path
(
'illustrations/merge_request_changes_empty.svg'
)
}
}
...
...
lib/banzai/filter/suggestion_filter.rb
View file @
7f6f4410
...
...
@@ -7,7 +7,6 @@ module Banzai
TAG_CLASS
=
'js-render-suggestion'
.
freeze
def
call
return
doc
unless
Suggestion
.
feature_enabled?
return
doc
unless
suggestions_filter_enabled?
doc
.
search
(
'pre.suggestion > code'
).
each
do
|
node
|
...
...
spec/lib/banzai/filter/suggestion_filter_spec.rb
View file @
7f6f4410
...
...
@@ -17,15 +17,6 @@ describe Banzai::Filter::SuggestionFilter do
expect
(
result
[
:class
]).
to
include
(
'js-render-suggestion'
)
end
it
'includes no `js-render-suggestion` when feature disabled'
do
stub_feature_flags
(
diff_suggestions:
false
)
doc
=
filter
(
input
,
default_context
)
result
=
doc
.
css
(
'code'
).
first
expect
(
result
[
:class
]).
to
be_nil
end
it
'includes no `js-render-suggestion` when filter is disabled'
do
doc
=
filter
(
input
)
result
=
doc
.
css
(
'code'
).
first
...
...
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