mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #6596 from overleaf/bg-initial-cm6-split-test
[web] initial split test for cm6 source editor GitOrigin-RevId: 05d0f9db8abcd93ea66326378854b23f27dc9d73
This commit is contained in:
parent
6ce0df3106
commit
f92e44a261
1 changed files with 21 additions and 4 deletions
|
@ -801,6 +801,21 @@ const ProjectController = {
|
|||
}
|
||||
)
|
||||
},
|
||||
newSourceEditorAssignment(cb) {
|
||||
SplitTestHandler.getAssignment(
|
||||
req,
|
||||
'source-editor',
|
||||
{},
|
||||
(error, assignment) => {
|
||||
// do not fail editor load if assignment fails
|
||||
if (error) {
|
||||
cb(null)
|
||||
} else {
|
||||
cb(null, assignment)
|
||||
}
|
||||
}
|
||||
)
|
||||
},
|
||||
},
|
||||
(
|
||||
err,
|
||||
|
@ -812,6 +827,7 @@ const ProjectController = {
|
|||
isTokenMember,
|
||||
brandVariation,
|
||||
newPdfPreviewAssignment,
|
||||
newSourceEditorAssignment,
|
||||
}
|
||||
) => {
|
||||
if (err != null) {
|
||||
|
@ -916,6 +932,10 @@ const ProjectController = {
|
|||
detachRole = req.params.detachRole
|
||||
}
|
||||
|
||||
const showNewSourceEditor =
|
||||
(newSourceEditorAssignment &&
|
||||
newSourceEditorAssignment.variant === 'codemirror') ||
|
||||
shouldDisplayFeature('new_source_editor', false) // also allow override via ?new_source_editor=true
|
||||
res.render('project/editor', {
|
||||
title: project.name,
|
||||
priority_title: true,
|
||||
|
@ -978,10 +998,7 @@ const ProjectController = {
|
|||
showPdfDetach,
|
||||
debugPdfDetach,
|
||||
showNewPdfPreview,
|
||||
showNewSourceEditor: shouldDisplayFeature(
|
||||
'new_source_editor',
|
||||
false
|
||||
),
|
||||
showNewSourceEditor,
|
||||
trackPdfDownload: partOfPdfCachingRollout('collect-metrics'),
|
||||
enablePdfCaching: partOfPdfCachingRollout('enable-caching'),
|
||||
resetServiceWorker:
|
||||
|
|
Loading…
Reference in a new issue