mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-05 07:09:02 +02:00
Add Writefull promo banner to project list (#12843)
GitOrigin-RevId: a41746a29dfba867ff60401cfce1478812358644
This commit is contained in:
@@ -21,6 +21,7 @@ const UserPrimaryEmailCheckHandler = require('../User/UserPrimaryEmailCheckHandl
|
||||
const UserController = require('../User/UserController')
|
||||
const LimitationsManager = require('../Subscription/LimitationsManager')
|
||||
const NotificationsBuilder = require('../Notifications/NotificationsBuilder')
|
||||
const SplitTestHandler = require('../SplitTests/SplitTestHandler')
|
||||
|
||||
/** @typedef {import("./types").GetProjectsRequest} GetProjectsRequest */
|
||||
/** @typedef {import("./types").GetProjectsResponse} GetProjectsResponse */
|
||||
@@ -319,6 +320,23 @@ async function projectListPage(req, res, next) {
|
||||
showGroupsAndEnterpriseBanner &&
|
||||
_.sample(['did-you-know', 'on-premise', 'people', 'FOMO'])
|
||||
|
||||
let showWritefullPromoBanner = false
|
||||
if (Features.hasFeature('saas') && !req.session.justRegistered) {
|
||||
try {
|
||||
const { variant } = await SplitTestHandler.promises.getAssignment(
|
||||
req,
|
||||
res,
|
||||
'writefull-promo-banner'
|
||||
)
|
||||
showWritefullPromoBanner = variant === 'enabled'
|
||||
} catch (error) {
|
||||
logger.warn(
|
||||
{ err: error },
|
||||
'failed to get "writefull-promo-banner" split test assignment'
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
res.render('project/list-react', {
|
||||
title: 'your_projects',
|
||||
usersBestSubscription,
|
||||
@@ -335,6 +353,7 @@ async function projectListPage(req, res, next) {
|
||||
prefetchedProjectsBlob,
|
||||
showGroupsAndEnterpriseBanner,
|
||||
groupsAndEnterpriseBannerVariant,
|
||||
showWritefullPromoBanner,
|
||||
projectDashboardReact: true, // used in navbar
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user