diff --git a/services/web/app/src/Features/Project/ProjectController.js b/services/web/app/src/Features/Project/ProjectController.js index 4227e8bc44..c62098a274 100644 --- a/services/web/app/src/Features/Project/ProjectController.js +++ b/services/web/app/src/Features/Project/ProjectController.js @@ -1204,6 +1204,7 @@ const ProjectController = { const detachRole = req.params.detachRole const showLegacySourceEditor = + !Features.hasFeature('saas') || legacySourceEditorAssignment.variant === 'default' || // Also allow override via legacy_source_editor=true in query string shouldDisplayFeature('legacy_source_editor') diff --git a/services/web/app/views/project/editor/editor-pane.pug b/services/web/app/views/project/editor/editor-pane.pug index c42ce84e30..a67e7eb377 100644 --- a/services/web/app/views/project/editor/editor-pane.pug +++ b/services/web/app/views/project/editor/editor-pane.pug @@ -49,11 +49,13 @@ else .toolbar.toolbar-editor - div(ng-if="editor.newSourceEditor") - if moduleIncludesAvailable('editor:source-editor') - != moduleIncludes('editor:source-editor', locals) - div(ng-if="!editor.newSourceEditor") + if !moduleIncludesAvailable('editor:source-editor') include ./source-editor + else + div(ng-if="editor.newSourceEditor") + != moduleIncludes('editor:source-editor', locals) + div(ng-if="!editor.newSourceEditor") + include ./source-editor if !isRestrictedTokenMember include ./review-panel diff --git a/services/web/frontend/js/features/source-editor/components/editor-switch.tsx b/services/web/frontend/js/features/source-editor/components/editor-switch.tsx index b54491292f..db69bf9f18 100644 --- a/services/web/frontend/js/features/source-editor/components/editor-switch.tsx +++ b/services/web/frontend/js/features/source-editor/components/editor-switch.tsx @@ -40,6 +40,7 @@ function Badge() { } const showLegacySourceEditor: boolean = getMeta('ol-showLegacySourceEditor') +const hasNewSourceEditor: boolean = getMeta('ol-hasNewSourceEditor') function EditorSwitch() { const [newSourceEditor, setNewSourceEditor] = useScopeValue( @@ -95,18 +96,22 @@ function EditorSwitch() {
Editor mode. - - + {hasNewSourceEditor && ( + <> + + + + )} {showLegacySourceEditor ? ( <> @@ -120,7 +125,7 @@ function EditorSwitch() { onChange={handleChange} /> ) : null}