Merge pull request #34394 from overleaf/as-link-sharing-groups-split-test

[web] Move group link sharing behind a separate split test

GitOrigin-RevId: c973a9bccb88f427a9f51d121b58a8799993e7c9
This commit is contained in:
MoxAmber
2026-06-18 08:06:39 +00:00
committed by Copybot
parent 62c2523aec
commit bd8a156908
4 changed files with 15 additions and 5 deletions
@@ -43,7 +43,6 @@ async function encryptToken(token) {
if (!accessTokenEncryptor) {
throw new Error('Token encryption not configured, could not encrypt token')
}
logger.debug({ settings: Settings.projectInviteEncryptorOptions })
return accessTokenEncryptor.promises.encryptJson(token)
}
@@ -51,7 +50,6 @@ async function decryptToken(encryptedToken) {
if (!accessTokenEncryptor) {
throw new Error('Token encryption not configured, could not encrypt token')
}
logger.debug({ settings: Settings.projectInviteEncryptorOptions })
return accessTokenEncryptor.promises.decryptToJson(encryptedToken)
}
@@ -495,6 +495,7 @@ const _ProjectController = {
'editor-upgrade-button-relocation',
'markdown-visual',
'ai-disabled-collaborators',
'group-link-sharing',
].filter(Boolean)
const getUserValues = async userId =>
@@ -29,6 +29,7 @@ import {
} from '@/features/share-project-modal/components/share-project-modal'
import { ExcludeStrict } from '@ol-types/utils'
import getMeta from '@/utils/meta'
import { useFeatureFlag } from '@/shared/context/split-test-context'
type ProjectAccessProps = {
setIsInvitedPeopleScreen: React.Dispatch<React.SetStateAction<boolean>>
@@ -50,6 +51,7 @@ function ProjectAccess({
)
const { isProjectOwner } = useEditorContext()
const { activeGroupSubscriptions } = getMeta('ol-user')
const groupSharingEnabled = useFeatureFlag('group-link-sharing')
const {
monitorRequest,
@@ -235,7 +237,8 @@ function ProjectAccess({
{t('only_invited_people')}
</DropdownItem>
</DropdownListItem>
{activeGroupSubscriptions &&
{groupSharingEnabled &&
activeGroupSubscriptions &&
activeGroupSubscriptions.map(subscription => (
<DropdownListItem
className="d-flex align-items-center"
@@ -7,7 +7,10 @@ import React, {
} from 'react'
import ShareProjectModalContent from './share-project-modal-content'
import { useProjectContext } from '@/shared/context/project-context'
import { useSplitTestContext } from '@/shared/context/split-test-context'
import {
useFeatureFlag,
useSplitTestContext,
} from '@/shared/context/split-test-context'
import { sendMB } from '@/infrastructure/event-tracking'
import { useEditorContext } from '@/shared/context/editor-context'
import customLocalStorage from '@/infrastructure/local-storage'
@@ -93,6 +96,7 @@ const ShareProjectModal = React.memo(function ShareProjectModal({
const { publicAccessLevel } = project || {}
const { splitTestVariants } = useSplitTestContext()
const isSharingUpdatesEnabled = useFeatureFlag('sharing-updates')
// show the new share modal if project owner
// is over collaborator limit or has pending editors (once every 24 hours)
@@ -147,6 +151,10 @@ const ShareProjectModal = React.memo(function ShareProjectModal({
}, [show])
const handleShow = useCallback(async () => {
if (!isSharingUpdatesEnabled || !isProjectOwner) {
return
}
if (publicAccessLevel === 'tokenBased') {
setSharingLinkData(null)
setProjectAccess('legacyLinkSharing')
@@ -179,7 +187,7 @@ const ShareProjectModal = React.memo(function ShareProjectModal({
'generic_something_went_wrong'
)
}
}, [publicAccessLevel, projectId])
}, [publicAccessLevel, projectId, isSharingUpdatesEnabled, isProjectOwner])
// close the modal if not in flight
const cancel = useCallback(() => {