diff --git a/services/web/app/src/Features/Project/ProjectController.js b/services/web/app/src/Features/Project/ProjectController.js index 5016651119..77e7a44af6 100644 --- a/services/web/app/src/Features/Project/ProjectController.js +++ b/services/web/app/src/Features/Project/ProjectController.js @@ -1041,6 +1041,21 @@ const ProjectController = { } ) }, + editorLeftMenuAssignment(cb) { + SplitTestHandler.getAssignment( + req, + res, + 'editor-left-menu', + (error, assignment) => { + // do not fail editor load if assignment fails + if (error) { + cb(null, { variant: 'default' }) + } else { + cb(null, assignment) + } + } + ) + }, }, ( err, @@ -1057,6 +1072,7 @@ const ProjectController = { newSourceEditorAssignment, pdfjsAssignment, dictionaryEditorAssignment, + editorLeftMenuAssignment, } ) => { if (err != null) { @@ -1138,6 +1154,9 @@ const ProjectController = { user.betaProgram || shouldDisplayFeature('new_source_editor', false) // also allow override via ?new_source_editor=true + const editorLeftMenuReact = + editorLeftMenuAssignment?.variant === 'react' + const showSymbolPalette = !Features.hasFeature('saas') || (user.features && user.features.symbolPalette) @@ -1173,6 +1192,7 @@ const ProjectController = { bodyClasses: ['editor'], project_id: project._id, projectName: project.name, + editorLeftMenuReact, user: { id: userId, email: user.email, diff --git a/services/web/app/views/project/editor/left-menu-react.pug b/services/web/app/views/project/editor/left-menu-react.pug new file mode 100644 index 0000000000..d6376250a6 --- /dev/null +++ b/services/web/app/views/project/editor/left-menu-react.pug @@ -0,0 +1 @@ +editor-left-menu() \ No newline at end of file diff --git a/services/web/app/views/project/editor/main.pug b/services/web/app/views/project/editor/main.pug index 5d118ad5ea..d8b2df79b9 100644 --- a/services/web/app/views/project/editor/main.pug +++ b/services/web/app/views/project/editor/main.pug @@ -1,4 +1,7 @@ -include ./left-menu +if editorLeftMenuReact + include ./left-menu-react +else + include ./left-menu #chat-wrapper.full-size( layout="chat", diff --git a/services/web/frontend/extracted-translations.json b/services/web/frontend/extracted-translations.json index 46a713e0c9..a1f90a936f 100644 --- a/services/web/frontend/extracted-translations.json +++ b/services/web/frontend/extracted-translations.json @@ -593,6 +593,7 @@ "somthing_went_wrong_compiling": "", "sort_by": "", "sort_by_x": "", + "source": "", "sso_link_error": "", "start_by_adding_your_email": "", "start_free_trial": "", diff --git a/services/web/frontend/js/features/editor-left-menu/components/download-menu.tsx b/services/web/frontend/js/features/editor-left-menu/components/download-menu.tsx new file mode 100644 index 0000000000..e0bb6c453e --- /dev/null +++ b/services/web/frontend/js/features/editor-left-menu/components/download-menu.tsx @@ -0,0 +1,21 @@ +import { useTranslation } from 'react-i18next' +import DownloadPDF from './download-pdf' +import DownloadSource from './download-source' + +export default function DownloadMenu() { + const { t } = useTranslation() + + return ( + <> +