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 showLegacySourceEditor =
|
||||
!Features.hasFeature('saas') ||
|
||||
legacySourceEditorAssignment.variant === 'default' ||
|
||||
// Also allow override via legacy_source_editor=true in query string
|
||||
shouldDisplayFeature('legacy_source_editor')
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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() {
|
|||
<fieldset className="toggle-switch">
|
||||
<legend className="sr-only">Editor mode.</legend>
|
||||
|
||||
<input
|
||||
type="radio"
|
||||
name="editor"
|
||||
value="cm6"
|
||||
id="editor-switch-cm6"
|
||||
className="toggle-switch-input"
|
||||
checked={!richTextOrVisual && !!newSourceEditor}
|
||||
onChange={handleChange}
|
||||
/>
|
||||
<label htmlFor="editor-switch-cm6" className="toggle-switch-label">
|
||||
<span>Source</span>
|
||||
</label>
|
||||
{hasNewSourceEditor && (
|
||||
<>
|
||||
<input
|
||||
type="radio"
|
||||
name="editor"
|
||||
value="cm6"
|
||||
id="editor-switch-cm6"
|
||||
className="toggle-switch-input"
|
||||
checked={!richTextOrVisual && !!newSourceEditor}
|
||||
onChange={handleChange}
|
||||
/>
|
||||
<label htmlFor="editor-switch-cm6" className="toggle-switch-label">
|
||||
<span>Source</span>
|
||||
</label>
|
||||
</>
|
||||
)}
|
||||
|
||||
{showLegacySourceEditor ? (
|
||||
<>
|
||||
|
@ -120,7 +125,7 @@ function EditorSwitch() {
|
|||
onChange={handleChange}
|
||||
/>
|
||||
<label htmlFor="editor-switch-ace" className="toggle-switch-label">
|
||||
<span>Source (legacy)</span>
|
||||
<span>{hasNewSourceEditor ? 'Source (legacy)' : 'Source'}</span>
|
||||
</label>
|
||||
</>
|
||||
) : null}
|
||||
|
|
Loading…
Reference in a new issue