GitLab steht Mittwoch, den 23. September, zwischen 10:00 und 12:00 Uhr aufgrund von Wartungsarbeiten nicht zur Verfügung.

Commit e9b28a28 authored by Phil Hughes's avatar Phil Hughes

Makes the Web IDE the default editor

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/42382
parent b0097199
......@@ -31,12 +31,13 @@ module BlobHelper
edit_button_tag(blob,
common_classes,
_('Edit'),
edit_blob_path(project, ref, path, options),
Feature.enabled?(:web_ide_default) ? ide_edit_path(project, ref, path, options) : edit_blob_path(project, ref, path, options),
project,
ref)
end
def ide_edit_button(project = @project, ref = @ref, path = @path, options = {})
return unless Feature.enabled?(:web_ide_default)
return unless blob = readable_blob(options, path, project, ref)
edit_button_tag(blob,
......
---
title: Make the Web IDE the default editor
merge_request:
author:
type: added
......@@ -9,6 +9,10 @@ describe 'Editing file blob', :js do
let(:file_path) { project.repository.ls_files(project.repository.root_ref)[1] }
let(:readme_file_path) { 'README.md' }
before do
stub_feature_flags(web_ide_default: false)
end
context 'as a developer' do
let(:user) { create(:user) }
let(:role) { :developer }
......
......@@ -12,6 +12,8 @@ describe 'Projects > Files > User creates files' do
let(:user) { create(:user) }
before do
stub_feature_flags(web_ide_default: false)
project.add_maintainer(user)
sign_in(user)
end
......
......@@ -9,6 +9,8 @@ describe 'Projects > Files > User edits files', :js do
let(:user) { create(:user) }
before do
stub_feature_flags(web_ide_default: false)
sign_in(user)
end
......
......@@ -50,12 +50,20 @@ describe BlobHelper do
end
it 'returns a link with the proper route' do
stub_feature_flags(web_ide_default: false)
link = edit_blob_button(project, 'master', 'README.md')
expect(Capybara.string(link).find_link('Edit')[:href]).to eq("/#{project.full_path}/edit/master/README.md")
end
it 'returns a link with a Web IDE route' do
link = edit_blob_button(project, 'master', 'README.md')
expect(Capybara.string(link).find_link('Edit')[:href]).to eq("/-/ide/project/#{project.full_path}/edit/master/-/README.md")
end
it 'returns a link with the passed link_opts on the expected route' do
stub_feature_flags(web_ide_default: false)
link = edit_blob_button(project, 'master', 'README.md', link_opts: { mr_id: 10 })
expect(Capybara.string(link).find_link('Edit')[:href]).to eq("/#{project.full_path}/edit/master/README.md?mr_id=10")
......
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