Преглед изворни кода

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
Thomas пре 4 година
родитељ
комит
2aef71b0b8
1 измењених фајлова са 3 додато и 6 уклоњено
  1. 3 6
      services/web/app/src/Features/Project/ProjectController.js

+ 3 - 6
services/web/app/src/Features/Project/ProjectController.js

@@ -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