From ec085a08075179809fc7f8c12f3181d4e8e43ac6 Mon Sep 17 00:00:00 2001 From: Tim Down <158919+timdown@users.noreply.github.com> Date: Wed, 18 Oct 2023 10:13:20 +0100 Subject: [PATCH] Merge pull request #15262 from overleaf/td-ide-page-feature-flag Add IDE page split test handling GitOrigin-RevId: 911e6d842ad473fcdb99d9715aeea18f02907a99 --- .../src/Features/Project/ProjectController.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/services/web/app/src/Features/Project/ProjectController.js b/services/web/app/src/Features/Project/ProjectController.js index 845c6be782..6c59b47931 100644 --- a/services/web/app/src/Features/Project/ProjectController.js +++ b/services/web/app/src/Features/Project/ProjectController.js @@ -678,6 +678,21 @@ const ProjectController = { } ) }, + idePageAssignment(cb) { + SplitTestHandler.getAssignment( + req, + res, + 'ide-page', + (error, assignment) => { + // do not fail editor load if assignment fails + if (error) { + cb(null, { variant: 'default' }) + } else { + cb(null, assignment) + } + } + ) + }, projectTags(cb) { if (!userId) { return cb(null, []) @@ -700,6 +715,7 @@ const ProjectController = { pdfjsAssignment, historyViewAssignment, reviewPanelAssignment, + idePageAssignment, projectTags, } ) => { @@ -805,7 +821,7 @@ const ProjectController = { !Features.hasFeature('saas') || req.query?.personal_access_token === 'true' - const idePageReact = req.query?.['ide-page'] === 'react' + const idePageReact = idePageAssignment.variant === 'react' const template = detachRole === 'detached' @@ -885,6 +901,7 @@ const ProjectController = { showCM6SwitchAwaySurvey: Settings.showCM6SwitchAwaySurvey, historyViewReact: historyViewAssignment.variant === 'react', isReviewPanelReact: reviewPanelAssignment.variant === 'react', + idePageReact, showPersonalAccessToken, hasTrackChangesFeature: Features.hasFeature('track-changes'), projectTags,