Merge pull request #17241 from overleaf/msm-fix-sp-git-settings

[web] Prevent render of Sync section in SP when git is disabled

GitOrigin-RevId: 5bfd1baadaff21db72d84a11d3f926431739dae4
This commit is contained in:
Miguel Serrano 2024-02-21 16:22:02 +01:00 committed by Copybot
parent dc9b0aa8a5
commit 992cb49802
3 changed files with 9 additions and 1 deletions

View file

@ -162,6 +162,8 @@ async function settingsPage(req, res) {
isManagedAccount: !!req.managedBy,
userRestrictions: Array.from(req.userRestrictions || []),
currentManagedUserAdminEmail,
gitBridgeEnabled: Settings.enableGitBridge,
isSaas: Features.hasFeature('saas'),
})
}

View file

@ -27,6 +27,8 @@ block append meta
meta(name="ol-personalAccessTokens", data-type="json" content=personalAccessTokens)
meta(name="ol-emailAddressLimit", data-type="json", content=emailAddressLimit)
meta(name="ol-currentManagedUserAdminEmail" data-type="string" content=currentManagedUserAdminEmail)
meta(name="ol-gitBridgeEnabled" data-type="boolean" content=gitBridgeEnabled)
meta(name="ol-isSaas" data-type="boolean" content=isSaas)
block content
main.content.content-alt#main-content

View file

@ -37,6 +37,9 @@ function LinkingSection() {
path: string
}[]
const renderSyncSection =
getMeta('ol-isSaas') || getMeta('ol-gitBridgeEnabled')
const showPersonalAccessTokenComponents: boolean =
getMeta('ol-showPersonalAccessToken') ||
getMeta('ol-optionalPersonalAccessToken')
@ -62,7 +65,8 @@ function LinkingSection() {
const haslangFeedbackLinkingWidgets =
langFeedbackLinkingWidgets.length && shouldLoadWritefull
const hasIntegrationLinkingSection = allIntegrationLinkingWidgets.length
const hasIntegrationLinkingSection =
renderSyncSection && allIntegrationLinkingWidgets.length
const hasReferencesLinkingSection = referenceLinkingWidgets.length
// Filter out SSO providers that are not allowed to be linked by