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
...
@@ -31,12 +31,13 @@ module BlobHelper
edit_button_tag
(
blob
,
edit_button_tag
(
blob
,
common_classes
,
common_classes
,
_
(
'Edit'
),
_
(
'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
,
project
,
ref
)
ref
)
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
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
,
...
...
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
...
@@ -9,6 +9,10 @@ describe 'Editing file blob', :js do
let
(
:file_path
)
{
project
.
repository
.
ls_files
(
project
.
repository
.
root_ref
)[
1
]
}
let
(
:file_path
)
{
project
.
repository
.
ls_files
(
project
.
repository
.
root_ref
)[
1
]
}
let
(
:readme_file_path
)
{
'README.md'
}
let
(
:readme_file_path
)
{
'README.md'
}
before
do
stub_feature_flags
(
web_ide_default:
false
)
end
context
'as a developer'
do
context
'as a developer'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:role
)
{
:developer
}
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
...
@@ -12,6 +12,8 @@ describe 'Projects > Files > User creates files' do
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
before
do
before
do
stub_feature_flags
(
web_ide_default:
false
)
project
.
add_maintainer
(
user
)
project
.
add_maintainer
(
user
)
sign_in
(
user
)
sign_in
(
user
)
end
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
...
@@ -9,6 +9,8 @@ describe 'Projects > Files > User edits files', :js do
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
before
do
before
do
stub_feature_flags
(
web_ide_default:
false
)
sign_in
(
user
)
sign_in
(
user
)
end
end
...
...
spec/helpers/blob_helper_spec.rb
View file @
e9b28a28
...
@@ -50,12 +50,20 @@ describe BlobHelper do
...
@@ -50,12 +50,20 @@ describe BlobHelper do
end
end
it
'returns a link with the proper route'
do
it
'returns a link with the proper route'
do
stub_feature_flags
(
web_ide_default:
false
)
link
=
edit_blob_button
(
project
,
'master'
,
'README.md'
)
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"
)
expect
(
Capybara
.
string
(
link
).
find_link
(
'Edit'
)[
:href
]).
to
eq
(
"/
#{
project
.
full_path
}
/edit/master/README.md"
)
end
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
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
})
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"
)
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