mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #11771 from overleaf/msm-force-ace-sp
[web] Force Ace editor in Server Pro GitOrigin-RevId: 1ea5675ad1c64a15dc30566c02d694feb2aaed3c
This commit is contained in:
parent
9cf1373777
commit
286cbc66a8
3 changed files with 25 additions and 17 deletions
|
@ -1204,6 +1204,7 @@ const ProjectController = {
|
||||||
const detachRole = req.params.detachRole
|
const detachRole = req.params.detachRole
|
||||||
|
|
||||||
const showLegacySourceEditor =
|
const showLegacySourceEditor =
|
||||||
|
!Features.hasFeature('saas') ||
|
||||||
legacySourceEditorAssignment.variant === 'default' ||
|
legacySourceEditorAssignment.variant === 'default' ||
|
||||||
// Also allow override via legacy_source_editor=true in query string
|
// Also allow override via legacy_source_editor=true in query string
|
||||||
shouldDisplayFeature('legacy_source_editor')
|
shouldDisplayFeature('legacy_source_editor')
|
||||||
|
|
|
@ -49,11 +49,13 @@
|
||||||
else
|
else
|
||||||
.toolbar.toolbar-editor
|
.toolbar.toolbar-editor
|
||||||
|
|
||||||
div(ng-if="editor.newSourceEditor")
|
if !moduleIncludesAvailable('editor:source-editor')
|
||||||
if moduleIncludesAvailable('editor:source-editor')
|
|
||||||
!= moduleIncludes('editor:source-editor', locals)
|
|
||||||
div(ng-if="!editor.newSourceEditor")
|
|
||||||
include ./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
|
if !isRestrictedTokenMember
|
||||||
include ./review-panel
|
include ./review-panel
|
||||||
|
|
|
@ -40,6 +40,7 @@ function Badge() {
|
||||||
}
|
}
|
||||||
|
|
||||||
const showLegacySourceEditor: boolean = getMeta('ol-showLegacySourceEditor')
|
const showLegacySourceEditor: boolean = getMeta('ol-showLegacySourceEditor')
|
||||||
|
const hasNewSourceEditor: boolean = getMeta('ol-hasNewSourceEditor')
|
||||||
|
|
||||||
function EditorSwitch() {
|
function EditorSwitch() {
|
||||||
const [newSourceEditor, setNewSourceEditor] = useScopeValue(
|
const [newSourceEditor, setNewSourceEditor] = useScopeValue(
|
||||||
|
@ -95,18 +96,22 @@ function EditorSwitch() {
|
||||||
<fieldset className="toggle-switch">
|
<fieldset className="toggle-switch">
|
||||||
<legend className="sr-only">Editor mode.</legend>
|
<legend className="sr-only">Editor mode.</legend>
|
||||||
|
|
||||||
<input
|
{hasNewSourceEditor && (
|
||||||
type="radio"
|
<>
|
||||||
name="editor"
|
<input
|
||||||
value="cm6"
|
type="radio"
|
||||||
id="editor-switch-cm6"
|
name="editor"
|
||||||
className="toggle-switch-input"
|
value="cm6"
|
||||||
checked={!richTextOrVisual && !!newSourceEditor}
|
id="editor-switch-cm6"
|
||||||
onChange={handleChange}
|
className="toggle-switch-input"
|
||||||
/>
|
checked={!richTextOrVisual && !!newSourceEditor}
|
||||||
<label htmlFor="editor-switch-cm6" className="toggle-switch-label">
|
onChange={handleChange}
|
||||||
<span>Source</span>
|
/>
|
||||||
</label>
|
<label htmlFor="editor-switch-cm6" className="toggle-switch-label">
|
||||||
|
<span>Source</span>
|
||||||
|
</label>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
|
||||||
{showLegacySourceEditor ? (
|
{showLegacySourceEditor ? (
|
||||||
<>
|
<>
|
||||||
|
@ -120,7 +125,7 @@ function EditorSwitch() {
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
/>
|
/>
|
||||||
<label htmlFor="editor-switch-ace" className="toggle-switch-label">
|
<label htmlFor="editor-switch-ace" className="toggle-switch-label">
|
||||||
<span>Source (legacy)</span>
|
<span>{hasNewSourceEditor ? 'Source (legacy)' : 'Source'}</span>
|
||||||
</label>
|
</label>
|
||||||
</>
|
</>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
Loading…
Reference in a new issue