summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2019-02-28 10:47:10 +0000
committerNick Thomas <nick@gitlab.com>2019-02-28 10:47:10 +0000
commit40ec172f75c0c2161c74414c387c802396563ca8 (patch)
treed8dc81461120ec5dc88457266c1e72363ac836cc
parent56e6dac72781041fe54a6194ca247d6772f3a29c (diff)
parent8e5911353bcb48155dc5dffab6a732bbba49cd37 (diff)
downloadgitlab-ce-40ec172f75c0c2161c74414c387c802396563ca8.tar.gz
Merge branch 'web-ide-default-merge-request' into 'master'
Use Web IDE path for merge request edit buttons See merge request gitlab-org/gitlab-ce!25595
-rw-r--r--app/helpers/blob_helper.rb2
-rw-r--r--app/serializers/diff_file_base_entity.rb10
-rw-r--r--spec/features/merge_request/maintainer_edits_fork_spec.rb2
3 files changed, 10 insertions, 4 deletions
diff --git a/app/helpers/blob_helper.rb b/app/helpers/blob_helper.rb
index 06beeebe2ba..3e1bb9af5cc 100644
--- a/app/helpers/blob_helper.rb
+++ b/app/helpers/blob_helper.rb
@@ -37,7 +37,7 @@ module BlobHelper
end
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)
edit_button_tag(blob,
diff --git a/app/serializers/diff_file_base_entity.rb b/app/serializers/diff_file_base_entity.rb
index ede9e04b722..d8630165e49 100644
--- a/app/serializers/diff_file_base_entity.rb
+++ b/app/serializers/diff_file_base_entity.rb
@@ -27,9 +27,13 @@ class DiffFileBaseEntity < Grape::Entity
next unless merge_request.source_project
- project_edit_blob_path(merge_request.source_project,
- tree_join(merge_request.source_branch, diff_file.new_path),
- options)
+ 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,
+ tree_join(merge_request.source_branch, diff_file.new_path),
+ options)
+ end
end
expose :old_path_html do |diff_file|
diff --git a/spec/features/merge_request/maintainer_edits_fork_spec.rb b/spec/features/merge_request/maintainer_edits_fork_spec.rb
index 7839b97122c..aead98dae23 100644
--- a/spec/features/merge_request/maintainer_edits_fork_spec.rb
+++ b/spec/features/merge_request/maintainer_edits_fork_spec.rb
@@ -18,6 +18,8 @@ describe 'a maintainer edits files on a source-branch of an MR from a fork', :js
end
before do
+ stub_feature_flags(web_ide_default: false)
+
target_project.add_maintainer(user)
sign_in(user)