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
e9b28a28
Commit
e9b28a28
authored
Feb 12, 2019
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Makes the Web IDE the default editor
Closes
https://gitlab.com/gitlab-org/gitlab-ce/issues/42382
parent
b0097199
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
1 deletion
+23
-1
app/helpers/blob_helper.rb
app/helpers/blob_helper.rb
+2
-1
changelogs/unreleased/web-ide-default-editor.yml
changelogs/unreleased/web-ide-default-editor.yml
+5
-0
spec/features/projects/blobs/edit_spec.rb
spec/features/projects/blobs/edit_spec.rb
+4
-0
spec/features/projects/files/user_creates_files_spec.rb
spec/features/projects/files/user_creates_files_spec.rb
+2
-0
spec/features/projects/files/user_edits_files_spec.rb
spec/features/projects/files/user_edits_files_spec.rb
+2
-0
spec/helpers/blob_helper_spec.rb
spec/helpers/blob_helper_spec.rb
+8
-0
No files found.
app/helpers/blob_helper.rb
View file @
e9b28a28
...
...
@@ -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
,
...
...
changelogs/unreleased/web-ide-default-editor.yml
0 → 100644
View file @
e9b28a28
---
title
:
Make the Web IDE the default editor
merge_request
:
author
:
type
:
added
spec/features/projects/blobs/edit_spec.rb
View file @
e9b28a28
...
...
@@ -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
}
...
...
spec/features/projects/files/user_creates_files_spec.rb
View file @
e9b28a28
...
...
@@ -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
...
...
spec/features/projects/files/user_edits_files_spec.rb
View file @
e9b28a28
...
...
@@ -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
...
...
spec/helpers/blob_helper_spec.rb
View file @
e9b28a28
...
...
@@ -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"
)
...
...
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