Use hard-coded feature flag for rich text

This commit is contained in:
Alasdair Smith 2018-07-16 13:55:07 +01:00
parent fff8e37bc7
commit 4202b9c717
4 changed files with 8 additions and 2 deletions

View file

@ -28,6 +28,7 @@ Modules = require '../../infrastructure/Modules'
ProjectEntityHandler = require './ProjectEntityHandler'
crypto = require 'crypto'
{ V1ConnectionError } = require '../Errors/Errors'
Features = require('../../Infrastructure/Features')
module.exports = ProjectController =
@ -344,7 +345,7 @@ module.exports = ProjectController =
themes: THEME_LIST
maxDocLength: Settings.max_doc_length
useV2History: !!project.overleaf?.history?.display
showRichText: req.query?.rt == 'true'
richTextEnabled: Features.richTextEnabled()
showTestControls: req.query?.tc == 'true' || user.isAdmin
showPublishModal: req.query?.pm == 'true'
timer.done()

View file

@ -4,6 +4,10 @@ module.exports = Features =
externalAuthenticationSystemUsed: ->
Settings.ldap? or Settings.saml? or Settings.overleaf?.oauth?
richTextEnabled: ->
isEnabled = true # Switch to false to disable
Settings.overleaf? and isEnabled
hasFeature: (feature) ->
switch feature
when 'homepage'

View file

@ -133,6 +133,7 @@ block requirejs
window.maxDocLength = #{maxDocLength};
window.trackChangesState = data.trackChangesState;
window.wikiEnabled = #{!!(settings.apis.wiki && settings.apis.wiki.url)};
window.richTextEnabled = #{richTextEnabled}
window.requirejs = {
"paths" : {
"moment": "libs/#{lib('moment')}",

View file

@ -43,7 +43,7 @@ div.full-size(
ace-editor="editor",
ng-if="!editor.showRichText",
ng-show="!!editor.sharejs_doc && !editor.opening",
style=showRichText ? "top: 32px" : "",
style=richTextEnabled ? "top: 32px" : "",
theme="settings.theme",
keybindings="settings.mode",
font-size="settings.fontSize",