Commit 7f6f4410 authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab-ce master

parents 7147f050 58ee1746
......@@ -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
......
# 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
......
......@@ -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') } }
......
......@@ -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|
......
......@@ -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
......
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