Merge pull request #9012 from overleaf/ab-dictionary-editor-query-override-fix

[web] Remove usage of shouldDisplayFeature superseding split test query param override

GitOrigin-RevId: 6e046e7fd26140b2bd721e2f2ec9303cc2e604b8
This commit is contained in:
Thomas 2022-08-08 10:55:11 +02:00 committed by Copybot
parent 4198eb2789
commit 2aef71b0b8

View file

@ -1111,6 +1111,7 @@ const ProjectController = {
})
}
// should not be used in place of split tests query param overrides (?my-split-test-name=my-variant)
function shouldDisplayFeature(name, variantFlag) {
if (req.query && req.query[name]) {
return req.query[name] === 'true'
@ -1135,8 +1136,7 @@ const ProjectController = {
}
const showNewSourceEditorOption =
(newSourceEditorAssignment &&
newSourceEditorAssignment.variant === 'codemirror') ||
newSourceEditorAssignment?.variant === 'codemirror' ||
user.betaProgram ||
shouldDisplayFeature('new_source_editor', false) // also allow override via ?new_source_editor=true
@ -1146,10 +1146,7 @@ const ProjectController = {
const dictionaryEditorEnabled =
!Features.hasFeature('saas') ||
shouldDisplayFeature(
'dictionary-editor',
dictionaryEditorAssignment.variant === 'enabled'
)
dictionaryEditorAssignment?.variant === 'enabled'
// Persistent upgrade prompts
// in header & in share project modal