Use Web IDE path for merge request edit buttons

This commit is contained in:
Phil Hughes 2019-02-27 12:44:24 +00:00
parent d6696f819b
commit 8e5911353b
No known key found for this signature in database
GPG Key ID: 32245528C52E0F9F
3 changed files with 10 additions and 4 deletions

View File

@ -37,7 +37,7 @@ module BlobHelper
end end
def ide_edit_button(project = @project, ref = @ref, path = @path, options = {}) def ide_edit_button(project = @project, ref = @ref, path = @path, options = {})
return unless Feature.enabled?(:web_ide_default) return if Feature.enabled?(:web_ide_default)
return unless blob = readable_blob(options, path, project, ref) return unless blob = readable_blob(options, path, project, ref)
edit_button_tag(blob, edit_button_tag(blob,

View File

@ -27,10 +27,14 @@ class DiffFileBaseEntity < Grape::Entity
next unless merge_request.source_project next unless merge_request.source_project
if Feature.enabled?(:web_ide_default)
ide_edit_path(merge_request.source_project, merge_request.source_branch, diff_file.new_path)
else
project_edit_blob_path(merge_request.source_project, project_edit_blob_path(merge_request.source_project,
tree_join(merge_request.source_branch, diff_file.new_path), tree_join(merge_request.source_branch, diff_file.new_path),
options) options)
end end
end
expose :old_path_html do |diff_file| expose :old_path_html do |diff_file|
old_path, _ = mark_inline_diffs(diff_file.old_path, diff_file.new_path) old_path, _ = mark_inline_diffs(diff_file.old_path, diff_file.new_path)

View File

@ -18,6 +18,8 @@ describe 'a maintainer edits files on a source-branch of an MR from a fork', :js
end end
before do before do
stub_feature_flags(web_ide_default: false)
target_project.add_maintainer(user) target_project.add_maintainer(user)
sign_in(user) sign_in(user)