mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 13:13:45 +01:00
Merge pull request #35915 from overleaf/ii-project-sharing-admin-page-hide
[web] Gate sharing permissions behind a new feature flag GitOrigin-RevId: 8c6657aca11911e9c2ddcba000a501307184bcaf
This commit is contained in:
@@ -155,6 +155,11 @@ function formatGroupPlansDataForDash() {
|
||||
async function userSubscriptionPage(req, res) {
|
||||
const user = SessionManager.getSessionUser(req.session)
|
||||
await SplitTestHandler.promises.getAssignment(req, res, 'sharing-updates')
|
||||
await SplitTestHandler.promises.getAssignment(
|
||||
req,
|
||||
res,
|
||||
'sharing-updates-sharing-permissions'
|
||||
)
|
||||
await SplitTestHandler.promises.getAssignment(req, res, 'pause-subscription')
|
||||
await SplitTestHandler.promises.getAssignment(
|
||||
req,
|
||||
|
||||
+4
@@ -97,6 +97,9 @@ export default function ManagedGroupSubscriptions() {
|
||||
const combinedUserManagement = useFeatureFlag('combined-user-management')
|
||||
|
||||
const isSharingUpdatesEnabled = useFeatureFlag('sharing-updates')
|
||||
const isSharingPermissionsEnabled = useFeatureFlag(
|
||||
'sharing-updates-sharing-permissions'
|
||||
)
|
||||
|
||||
if (!managedGroupSubscriptions) {
|
||||
return null
|
||||
@@ -161,6 +164,7 @@ export default function ManagedGroupSubscriptions() {
|
||||
{isAdmin && (
|
||||
<>
|
||||
{isSharingUpdatesEnabled &&
|
||||
isSharingPermissionsEnabled &&
|
||||
subscription.planLevelName === 'Pro' && (
|
||||
<RowLink
|
||||
href={`/manage/groups/${subscription._id}/sharing-permissions`}
|
||||
|
||||
+24
-1
@@ -245,7 +245,10 @@ describe('<ManagedGroupSubscriptions />', function () {
|
||||
{ name: 'ol-usersEmail', value: 'you@example.com' },
|
||||
{
|
||||
name: 'ol-splitTestVariants',
|
||||
value: { 'sharing-updates': 'enabled' },
|
||||
value: {
|
||||
'sharing-updates': 'enabled',
|
||||
'sharing-updates-sharing-permissions': 'enabled',
|
||||
},
|
||||
},
|
||||
],
|
||||
})
|
||||
@@ -254,6 +257,26 @@ describe('<ManagedGroupSubscriptions />', function () {
|
||||
await screen.findAllByText(/manage how group members share projects/i)
|
||||
})
|
||||
|
||||
it('does not render the Sharing Permissions settings row when the "sharing-updates-sharing-permissions" feature flag is disabled', function () {
|
||||
renderWithSubscriptionDashContext(<ManagedGroupSubscriptions />, {
|
||||
metaTags: [
|
||||
{
|
||||
name: 'ol-managedGroupSubscriptions',
|
||||
value: managedGroupSubscriptions,
|
||||
},
|
||||
{ name: 'ol-usersEmail', value: 'you@example.com' },
|
||||
{
|
||||
name: 'ol-splitTestVariants',
|
||||
value: { 'sharing-updates': 'enabled' },
|
||||
},
|
||||
],
|
||||
})
|
||||
|
||||
expect(screen.queryByText(/sharing permissions/i)).to.be.null
|
||||
expect(screen.queryByText(/manage how group members share projects/i)).to.be
|
||||
.null
|
||||
})
|
||||
|
||||
it('renders Managed Group / Group SSO settings row when both features are turned on', async function () {
|
||||
renderWithSubscriptionDashContext(<ManagedGroupSubscriptions />, {
|
||||
metaTags: [
|
||||
|
||||
Reference in New Issue
Block a user