Эх сурвалжийг харах

only show editor support buttons if support enabled

GitOrigin-RevId: 8b5cb3c08eefa89673e5f1f16ba98ab57cad4788
Tim Alby 6 жил өмнө
parent
commit
eb13ceafd5

+ 2 - 1
services/web/app/src/Features/Project/ProjectController.js

@@ -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()
           }

+ 6 - 1
services/web/app/src/infrastructure/Features.js

@@ -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}`)
     }

+ 9 - 8
services/web/app/views/project/editor/left-menu.pug

@@ -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",