only show editor support buttons if support enabled

GitOrigin-RevId: 8b5cb3c08eefa89673e5f1f16ba98ab57cad4788
This commit is contained in:
Tim Alby 2019-12-02 13:28:15 +05:30 committed by sharelatex
parent 154f1c9235
commit eb13ceafd5
3 changed files with 17 additions and 10 deletions

View file

@ -801,7 +801,8 @@ const ProjectController = {
Boolean(project.overleaf.history.display),
brandVariation,
allowedImageNames: Settings.allowedImageNames || [],
gitBridgePublicBaseUrl: Settings.gitBridgePublicBaseUrl
gitBridgePublicBaseUrl: Settings.gitBridgePublicBaseUrl,
showSupport: Features.hasFeature('support')
})
timer.done()
}

View file

@ -17,6 +17,10 @@ const publicRegistrationModuleAvailable = fs.existsSync(
`${__dirname}/../../../modules/public-registration`
)
const supportModuleAvailable = fs.existsSync(
`${__dirname}/../../../modules/support`
)
module.exports = Features = {
externalAuthenticationSystemUsed() {
return (
@ -61,9 +65,10 @@ module.exports = Features = {
return Settings.enableSaml
case 'link-url':
return Settings.apis.linkedUrlProxy && Settings.apis.linkedUrlProxy.url
case 'public-registration':
return publicRegistrationModuleAvailable
case 'support':
return supportModuleAvailable
default:
throw new Error(`unknown feature: ${feature}`)
}

View file

@ -208,14 +208,15 @@ aside#left-menu.full-size(
a(ng-click="openHotkeysModal()")
i.fa.fa-keyboard-o.fa-fw
|    #{translate("show_hotkeys")}
li
a(href='/learn', target="_blank")
i.fa.fa-book.fa-fw
|    #{translate('documentation')}
li
a(ng-controller="ContactModal", ng-click="contactUsModal()")
i.fa.fa-question.fa-fw
|    #{translate("contact_us")}
if showSupport
li
a(href='/learn', target="_blank")
i.fa.fa-book.fa-fw
|    #{translate('documentation')}
li
a(ng-controller="ContactModal", ng-click="contactUsModal()")
i.fa.fa-question.fa-fw
|    #{translate("contact_us")}
#left-menu-mask(
ng-show="ui.leftMenuShown",