ソースを参照

Merge pull request #11583 from overleaf/msm-ace-ce

[web] Force ACE when `modules/source-editor` not available

GitOrigin-RevId: 2b43a048e882d99aa52ee8ead6c67152d4080eb2
Miguel Serrano 3 年 前
親
コミット
55bdcf7664

+ 1 - 0
services/web/app/views/project/editor/meta.pug

@@ -23,6 +23,7 @@ meta(name="ol-wsRetryHandshake" data-type="json" content=settings.wsRetryHandsha
 meta(name="ol-pdfjsVariant" content=pdfjsVariant)
 meta(name="ol-pdfjsVariant" content=pdfjsVariant)
 meta(name="ol-debugPdfDetach" data-type="boolean" content=debugPdfDetach)
 meta(name="ol-debugPdfDetach" data-type="boolean" content=debugPdfDetach)
 meta(name="ol-showLegacySourceEditor", data-type="boolean" content=showLegacySourceEditor)
 meta(name="ol-showLegacySourceEditor", data-type="boolean" content=showLegacySourceEditor)
+meta(name="ol-hasNewSourceEditor", data-type="boolean" content=moduleIncludesAvailable('editor:source-editor'))
 meta(name="ol-showSymbolPalette" data-type="boolean" content=showSymbolPalette)
 meta(name="ol-showSymbolPalette" data-type="boolean" content=showSymbolPalette)
 meta(name="ol-galileoEnabled" data-type="string" content=galileoEnabled)
 meta(name="ol-galileoEnabled" data-type="string" content=galileoEnabled)
 meta(name="ol-galileoPromptWords" data-type="string" content=galileoPromptWords)
 meta(name="ol-galileoPromptWords" data-type="string" content=galileoPromptWords)

+ 5 - 0
services/web/frontend/js/ide/editor/EditorManager.js

@@ -195,6 +195,11 @@ export default EditorManager = (function () {
     }
     }
 
 
     newSourceEditor() {
     newSourceEditor() {
+      // the new source editor is not available at the moment in CE
+      if (!getMeta('ol-hasNewSourceEditor')) {
+        return false
+      }
+
       // Use the new source editor if the legacy editor is disabled
       // Use the new source editor if the legacy editor is disabled
       if (!getMeta('ol-showLegacySourceEditor')) {
       if (!getMeta('ol-showLegacySourceEditor')) {
         return true
         return true