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
8b928cc9
Commit
8b928cc9
authored
Dec 05, 2019
by
Michael Kozono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Merge branch '34820-snippets-view-vue-feature-flag' into 'master'"
This reverts merge request !21088
parent
ebef2f50
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
13 additions
and
65 deletions
+13
-65
app/assets/javascripts/pages/snippets/show/index.js
app/assets/javascripts/pages/snippets/show/index.js
+5
-7
app/views/snippets/show.html.haml
app/views/snippets/show.html.haml
+7
-10
lib/gitlab/gon_helper.rb
lib/gitlab/gon_helper.rb
+0
-1
spec/features/snippets/internal_snippet_spec.rb
spec/features/snippets/internal_snippet_spec.rb
+0
-4
spec/features/snippets/notes_on_personal_snippets_spec.rb
spec/features/snippets/notes_on_personal_snippets_spec.rb
+0
-1
spec/features/snippets/private_snippets_spec.rb
spec/features/snippets/private_snippets_spec.rb
+0
-1
spec/features/snippets/public_snippets_spec.rb
spec/features/snippets/public_snippets_spec.rb
+0
-4
spec/features/snippets/show_spec.rb
spec/features/snippets/show_spec.rb
+0
-4
spec/features/snippets/spam_snippets_spec.rb
spec/features/snippets/spam_snippets_spec.rb
+0
-1
spec/features/snippets/user_creates_snippet_spec.rb
spec/features/snippets/user_creates_snippet_spec.rb
+0
-1
spec/features/snippets/user_deletes_snippet_spec.rb
spec/features/snippets/user_deletes_snippet_spec.rb
+0
-2
spec/features/snippets/user_edits_snippet_spec.rb
spec/features/snippets/user_edits_snippet_spec.rb
+0
-1
spec/features/snippets_spec.rb
spec/features/snippets_spec.rb
+1
-28
No files found.
app/assets/javascripts/pages/snippets/show/index.js
View file @
8b928cc9
...
@@ -5,11 +5,9 @@ import initNotes from '~/init_notes';
...
@@ -5,11 +5,9 @@ import initNotes from '~/init_notes';
import
snippetEmbed
from
'
~/snippet/snippet_embed
'
;
import
snippetEmbed
from
'
~/snippet/snippet_embed
'
;
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
if
(
!
gon
.
features
.
snippetsVue
)
{
new
LineHighlighter
();
// eslint-disable-line no-new
new
LineHighlighter
();
// eslint-disable-line no-new
new
BlobViewer
();
// eslint-disable-line no-new
new
BlobViewer
();
// eslint-disable-line no-new
initNotes
();
initNotes
();
new
ZenMode
();
// eslint-disable-line no-new
new
ZenMode
();
// eslint-disable-line no-new
snippetEmbed
();
snippetEmbed
();
}
});
});
app/views/snippets/show.html.haml
View file @
8b928cc9
...
@@ -4,16 +4,13 @@
...
@@ -4,16 +4,13 @@
-
breadcrumb_title
@snippet
.
to_reference
-
breadcrumb_title
@snippet
.
to_reference
-
page_title
"
#{
@snippet
.
title
}
(
#{
@snippet
.
to_reference
}
)"
,
_
(
"Snippets"
)
-
page_title
"
#{
@snippet
.
title
}
(
#{
@snippet
.
to_reference
}
)"
,
_
(
"Snippets"
)
-
if
Feature
.
enabled?
(
:snippets_vue
)
=
render
'shared/snippets/header'
#js-snippet-view
{
'data-qa-selector'
:
'snippet_view'
}
-
else
=
render
'shared/snippets/header'
.personal-snippets
.personal-snippets
%article
.file-holder.snippet-file-content
%article
.file-holder.snippet-file-content
=
render
'shared/snippets/blob'
=
render
'shared/snippets/blob'
.row-content-block.top-block.content-component-block
.row-content-block.top-block.content-component-block
=
render
'award_emoji/awards_block'
,
awardable:
@snippet
,
inline:
true
=
render
'award_emoji/awards_block'
,
awardable:
@snippet
,
inline:
true
#notes
.limited-width-notes
=
render
"shared/notes/notes_with_form"
,
:autocomplete
=>
false
#notes
.limited-width-notes
=
render
"shared/notes/notes_with_form"
,
:autocomplete
=>
false
lib/gitlab/gon_helper.rb
View file @
8b928cc9
...
@@ -42,7 +42,6 @@ module Gitlab
...
@@ -42,7 +42,6 @@ module Gitlab
# Initialize gon.features with any flags that should be
# Initialize gon.features with any flags that should be
# made globally available to the frontend
# made globally available to the frontend
push_frontend_feature_flag
(
:suppress_ajax_navigation_errors
,
default_enabled:
true
)
push_frontend_feature_flag
(
:suppress_ajax_navigation_errors
,
default_enabled:
true
)
push_frontend_feature_flag
(
:snippets_vue
,
default_enabled:
false
)
end
end
# Exposes the state of a feature flag to the frontend code.
# Exposes the state of a feature flag to the frontend code.
...
...
spec/features/snippets/internal_snippet_spec.rb
View file @
8b928cc9
...
@@ -5,10 +5,6 @@ require 'spec_helper'
...
@@ -5,10 +5,6 @@ require 'spec_helper'
describe
'Internal Snippets'
,
:js
do
describe
'Internal Snippets'
,
:js
do
let
(
:internal_snippet
)
{
create
(
:personal_snippet
,
:internal
)
}
let
(
:internal_snippet
)
{
create
(
:personal_snippet
,
:internal
)
}
before
do
stub_feature_flags
(
snippets_vue:
false
)
end
describe
'normal user'
do
describe
'normal user'
do
before
do
before
do
sign_in
(
create
(
:user
))
sign_in
(
create
(
:user
))
...
...
spec/features/snippets/notes_on_personal_snippets_spec.rb
View file @
8b928cc9
...
@@ -16,7 +16,6 @@ describe 'Comments on personal snippets', :js do
...
@@ -16,7 +16,6 @@ describe 'Comments on personal snippets', :js do
let!
(
:other_note
)
{
create
(
:note_on_personal_snippet
)
}
let!
(
:other_note
)
{
create
(
:note_on_personal_snippet
)
}
before
do
before
do
stub_feature_flags
(
snippets_vue:
false
)
sign_in
user
sign_in
user
visit
snippet_path
(
snippet
)
visit
snippet_path
(
snippet
)
...
...
spec/features/snippets/private_snippets_spec.rb
View file @
8b928cc9
...
@@ -6,7 +6,6 @@ describe 'Private Snippets', :js do
...
@@ -6,7 +6,6 @@ describe 'Private Snippets', :js do
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
before
do
before
do
stub_feature_flags
(
snippets_vue:
false
)
sign_in
(
user
)
sign_in
(
user
)
end
end
...
...
spec/features/snippets/public_snippets_spec.rb
View file @
8b928cc9
...
@@ -3,10 +3,6 @@
...
@@ -3,10 +3,6 @@
require
'spec_helper'
require
'spec_helper'
describe
'Public Snippets'
,
:js
do
describe
'Public Snippets'
,
:js
do
before
do
stub_feature_flags
(
snippets_vue:
false
)
end
it
'Unauthenticated user should see public snippets'
do
it
'Unauthenticated user should see public snippets'
do
public_snippet
=
create
(
:personal_snippet
,
:public
)
public_snippet
=
create
(
:personal_snippet
,
:public
)
...
...
spec/features/snippets/show_spec.rb
View file @
8b928cc9
...
@@ -6,10 +6,6 @@ describe 'Snippet', :js do
...
@@ -6,10 +6,6 @@ describe 'Snippet', :js do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:snippet
)
{
create
(
:personal_snippet
,
:public
,
file_name:
file_name
,
content:
content
)
}
let
(
:snippet
)
{
create
(
:personal_snippet
,
:public
,
file_name:
file_name
,
content:
content
)
}
before
do
stub_feature_flags
(
snippets_vue:
false
)
end
context
'Ruby file'
do
context
'Ruby file'
do
let
(
:file_name
)
{
'popen.rb'
}
let
(
:file_name
)
{
'popen.rb'
}
let
(
:content
)
{
project
.
repository
.
blob_at
(
'master'
,
'files/ruby/popen.rb'
).
data
}
let
(
:content
)
{
project
.
repository
.
blob_at
(
'master'
,
'files/ruby/popen.rb'
).
data
}
...
...
spec/features/snippets/spam_snippets_spec.rb
View file @
8b928cc9
...
@@ -7,7 +7,6 @@ describe 'User creates snippet', :js do
...
@@ -7,7 +7,6 @@ describe 'User creates snippet', :js do
before
do
before
do
stub_feature_flags
(
allow_possible_spam:
false
)
stub_feature_flags
(
allow_possible_spam:
false
)
stub_feature_flags
(
snippets_vue:
false
)
stub_env
(
'IN_MEMORY_APPLICATION_SETTINGS'
,
'false'
)
stub_env
(
'IN_MEMORY_APPLICATION_SETTINGS'
,
'false'
)
Gitlab
::
CurrentSettings
.
update!
(
Gitlab
::
CurrentSettings
.
update!
(
...
...
spec/features/snippets/user_creates_snippet_spec.rb
View file @
8b928cc9
...
@@ -8,7 +8,6 @@ describe 'User creates snippet', :js do
...
@@ -8,7 +8,6 @@ describe 'User creates snippet', :js do
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
before
do
before
do
stub_feature_flags
(
snippets_vue:
false
)
sign_in
(
user
)
sign_in
(
user
)
visit
new_snippet_path
visit
new_snippet_path
end
end
...
...
spec/features/snippets/user_deletes_snippet_spec.rb
View file @
8b928cc9
...
@@ -10,8 +10,6 @@ describe 'User deletes snippet' do
...
@@ -10,8 +10,6 @@ describe 'User deletes snippet' do
before
do
before
do
sign_in
(
user
)
sign_in
(
user
)
stub_feature_flags
(
snippets_vue:
false
)
visit
snippet_path
(
snippet
)
visit
snippet_path
(
snippet
)
end
end
...
...
spec/features/snippets/user_edits_snippet_spec.rb
View file @
8b928cc9
...
@@ -12,7 +12,6 @@ describe 'User edits snippet', :js do
...
@@ -12,7 +12,6 @@ describe 'User edits snippet', :js do
let
(
:snippet
)
{
create
(
:personal_snippet
,
:public
,
file_name:
file_name
,
content:
content
,
author:
user
)
}
let
(
:snippet
)
{
create
(
:personal_snippet
,
:public
,
file_name:
file_name
,
content:
content
,
author:
user
)
}
before
do
before
do
stub_feature_flags
(
snippets_vue:
false
)
sign_in
(
user
)
sign_in
(
user
)
visit
edit_snippet_path
(
snippet
)
visit
edit_snippet_path
(
snippet
)
...
...
spec/features/snippets_spec.rb
View file @
8b928cc9
...
@@ -6,38 +6,11 @@ describe 'Snippets' do
...
@@ -6,38 +6,11 @@ describe 'Snippets' do
context
'when the project has snippets'
do
context
'when the project has snippets'
do
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:project
)
{
create
(
:project
,
:public
)
}
let!
(
:snippets
)
{
create_list
(
:project_snippet
,
2
,
:public
,
author:
project
.
owner
,
project:
project
)
}
let!
(
:snippets
)
{
create_list
(
:project_snippet
,
2
,
:public
,
author:
project
.
owner
,
project:
project
)
}
before
do
before
do
allow
(
Snippet
).
to
receive
(
:default_per_page
).
and_return
(
1
)
allow
(
Snippet
).
to
receive
(
:default_per_page
).
and_return
(
1
)
visit
snippets_path
(
username:
project
.
owner
.
username
)
visit
project_snippets_path
(
project
)
end
end
it_behaves_like
'paginated snippets'
it_behaves_like
'paginated snippets'
end
end
describe
'rendering engine'
do
let_it_be
(
:snippet
)
{
create
(
:personal_snippet
,
:public
)
}
let
(
:snippets_vue_feature_flag_enabled
)
{
true
}
before
do
stub_feature_flags
(
snippets_vue:
snippets_vue_feature_flag_enabled
)
visit
snippet_path
(
snippet
)
end
it
'renders Vue application'
do
expect
(
page
).
to
have_selector
(
'#js-snippet-view'
)
expect
(
page
).
not_to
have_selector
(
'.personal-snippets'
)
end
context
'when feature flag is disabled'
do
let
(
:snippets_vue_feature_flag_enabled
)
{
false
}
it
'renders HAML application and not Vue'
do
expect
(
page
).
not_to
have_selector
(
'#js-snippet-view'
)
expect
(
page
).
to
have_selector
(
'.personal-snippets'
)
end
end
end
end
end
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