mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-20 04:34:04 +00:00
Use hasFeature function instead of new standalone function
This commit is contained in:
parent
85313f1b5a
commit
9cd3f32365
2 changed files with 4 additions and 5 deletions
|
@ -345,7 +345,7 @@ module.exports = ProjectController =
|
||||||
themes: THEME_LIST
|
themes: THEME_LIST
|
||||||
maxDocLength: Settings.max_doc_length
|
maxDocLength: Settings.max_doc_length
|
||||||
useV2History: !!project.overleaf?.history?.display
|
useV2History: !!project.overleaf?.history?.display
|
||||||
richTextEnabled: Features.richTextEnabled()
|
richTextEnabled: Features.hasFeature('rich-text')
|
||||||
showTestControls: req.query?.tc == 'true' || user.isAdmin
|
showTestControls: req.query?.tc == 'true' || user.isAdmin
|
||||||
showPublishModal: req.query?.pm == 'true'
|
showPublishModal: req.query?.pm == 'true'
|
||||||
timer.done()
|
timer.done()
|
||||||
|
|
|
@ -4,10 +4,6 @@ module.exports = Features =
|
||||||
externalAuthenticationSystemUsed: ->
|
externalAuthenticationSystemUsed: ->
|
||||||
Settings.ldap? or Settings.saml? or Settings.overleaf?.oauth?
|
Settings.ldap? or Settings.saml? or Settings.overleaf?.oauth?
|
||||||
|
|
||||||
richTextEnabled: ->
|
|
||||||
isEnabled = true # Switch to false to disable
|
|
||||||
Settings.overleaf? and isEnabled
|
|
||||||
|
|
||||||
hasFeature: (feature) ->
|
hasFeature: (feature) ->
|
||||||
switch feature
|
switch feature
|
||||||
when 'homepage'
|
when 'homepage'
|
||||||
|
@ -26,5 +22,8 @@ module.exports = Features =
|
||||||
return !Settings.overleaf?
|
return !Settings.overleaf?
|
||||||
when 'affiliations'
|
when 'affiliations'
|
||||||
return Settings?.apis?.v1?.url?
|
return Settings?.apis?.v1?.url?
|
||||||
|
when 'rich-text'
|
||||||
|
isEnabled = false # Switch to false to disable
|
||||||
|
Settings.overleaf? and isEnabled
|
||||||
else
|
else
|
||||||
throw new Error("unknown feature: #{feature}")
|
throw new Error("unknown feature: #{feature}")
|
||||||
|
|
Loading…
Reference in a new issue