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
fa862485
Commit
fa862485
authored
Nov 22, 2021
by
Jacques
Committed by
Jacques Erasmus
Nov 23, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add highlight_js feature flag
Add a feature flag for syntax highlighting using HighlightJS
parent
79ff98fb
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
4 deletions
+12
-4
app/assets/javascripts/repository/components/blob_viewers/index.js
...s/javascripts/repository/components/blob_viewers/index.js
+1
-1
app/controllers/projects/blob_controller.rb
app/controllers/projects/blob_controller.rb
+1
-1
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+1
-1
config/feature_flags/development/highlight_js.yml
config/feature_flags/development/highlight_js.yml
+8
-0
spec/frontend/repository/components/blob_content_viewer_spec.js
...rontend/repository/components/blob_content_viewer_spec.js
+1
-1
No files found.
app/assets/javascripts/repository/components/blob_viewers/index.js
View file @
fa862485
...
@@ -3,7 +3,7 @@ export const loadViewer = (type) => {
...
@@ -3,7 +3,7 @@ export const loadViewer = (type) => {
case
'
empty
'
:
case
'
empty
'
:
return
()
=>
import
(
/* webpackChunkName: 'blob_empty_viewer' */
'
./empty_viewer.vue
'
);
return
()
=>
import
(
/* webpackChunkName: 'blob_empty_viewer' */
'
./empty_viewer.vue
'
);
case
'
text
'
:
case
'
text
'
:
return
gon
.
features
.
refactorTextViewer
return
gon
.
features
.
highlightJs
?
()
=>
import
(
/* webpackChunkName: 'blob_text_viewer' */
'
./text_viewer.vue
'
)
?
()
=>
import
(
/* webpackChunkName: 'blob_text_viewer' */
'
./text_viewer.vue
'
)
:
null
;
:
null
;
case
'
download
'
:
case
'
download
'
:
...
...
app/controllers/projects/blob_controller.rb
View file @
fa862485
...
@@ -44,7 +44,7 @@ class Projects::BlobController < Projects::ApplicationController
...
@@ -44,7 +44,7 @@ class Projects::BlobController < Projects::ApplicationController
before_action
do
before_action
do
push_frontend_feature_flag
(
:refactor_blob_viewer
,
@project
,
default_enabled: :yaml
)
push_frontend_feature_flag
(
:refactor_blob_viewer
,
@project
,
default_enabled: :yaml
)
push_frontend_feature_flag
(
:
refactor_text_viewer
,
@project
,
default_enabled: :yaml
)
push_frontend_feature_flag
(
:
highlight_js
,
@project
,
default_enabled: :yaml
)
push_frontend_feature_flag
(
:consolidated_edit_button
,
@project
,
default_enabled: :yaml
)
push_frontend_feature_flag
(
:consolidated_edit_button
,
@project
,
default_enabled: :yaml
)
push_licensed_feature
(
:file_locks
)
if
@project
.
licensed_feature_available?
(
:file_locks
)
push_licensed_feature
(
:file_locks
)
if
@project
.
licensed_feature_available?
(
:file_locks
)
end
end
...
...
app/controllers/projects_controller.rb
View file @
fa862485
...
@@ -35,7 +35,7 @@ class ProjectsController < Projects::ApplicationController
...
@@ -35,7 +35,7 @@ class ProjectsController < Projects::ApplicationController
before_action
do
before_action
do
push_frontend_feature_flag
(
:lazy_load_commits
,
@project
,
default_enabled: :yaml
)
push_frontend_feature_flag
(
:lazy_load_commits
,
@project
,
default_enabled: :yaml
)
push_frontend_feature_flag
(
:refactor_blob_viewer
,
@project
,
default_enabled: :yaml
)
push_frontend_feature_flag
(
:refactor_blob_viewer
,
@project
,
default_enabled: :yaml
)
push_frontend_feature_flag
(
:
refactor_text_viewer
,
@project
,
default_enabled: :yaml
)
push_frontend_feature_flag
(
:
highlight_js
,
@project
,
default_enabled: :yaml
)
push_frontend_feature_flag
(
:increase_page_size_exponentially
,
@project
,
default_enabled: :yaml
)
push_frontend_feature_flag
(
:increase_page_size_exponentially
,
@project
,
default_enabled: :yaml
)
push_frontend_feature_flag
(
:new_dir_modal
,
@project
,
default_enabled: :yaml
)
push_frontend_feature_flag
(
:new_dir_modal
,
@project
,
default_enabled: :yaml
)
end
end
...
...
config/feature_flags/development/
refactor_text_viewer
.yml
→
config/feature_flags/development/
highlight_js
.yml
View file @
fa862485
---
---
name
:
refactor_text_viewer
name
:
highlight_js
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/7
0909
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/7
5005
rollout_issue_url
:
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/346257
milestone
:
'
14.
4
'
milestone
:
'
14.
6
'
type
:
development
type
:
development
group
:
'
group::source
code'
group
:
group::source code
default_enabled
:
false
default_enabled
:
false
spec/frontend/repository/components/blob_content_viewer_spec.js
View file @
fa862485
...
@@ -98,7 +98,7 @@ describe('Blob content viewer component', () => {
...
@@ -98,7 +98,7 @@ describe('Blob content viewer component', () => {
const
findForkSuggestion
=
()
=>
wrapper
.
findComponent
(
ForkSuggestion
);
const
findForkSuggestion
=
()
=>
wrapper
.
findComponent
(
ForkSuggestion
);
beforeEach
(()
=>
{
beforeEach
(()
=>
{
gon
.
features
=
{
refactorTextViewer
:
true
};
gon
.
features
=
{
highlightJs
:
true
};
isLoggedIn
.
mockReturnValue
(
true
);
isLoggedIn
.
mockReturnValue
(
true
);
});
});
...
...
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