mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-04 22:59:01 +02:00
Implement new users micro survey for project dashboard page on react and non-react version (#11347)
* Implement new users micro survey for project dashboard page on react and non-react version * Add 'new-users-micro-survey-click' and 'new-users-micro-survey-prompt' new event for the analytics GitOrigin-RevId: 9aabe931987638b38995d404aa90ac4d40b2f3b5
This commit is contained in:
@@ -312,6 +312,32 @@ async function projectListReactPage(req, res, next) {
|
||||
!userIsMemberOfGroupSubscription &&
|
||||
!hasPaidAffiliation
|
||||
|
||||
let newUsersMicroSurveyAssignment
|
||||
|
||||
try {
|
||||
newUsersMicroSurveyAssignment =
|
||||
await SplitTestHandler.promises.getAssignment(
|
||||
req,
|
||||
res,
|
||||
'new-users-micro-survey'
|
||||
)
|
||||
} catch (error) {
|
||||
logger.error(
|
||||
{ err: error },
|
||||
'failed to get "new-users-micro-survey" split test assignment'
|
||||
)
|
||||
}
|
||||
|
||||
const SEVEN_DAYS = 1000 * 60 * 60 * 24 * 7
|
||||
|
||||
const isUserLessThanSevenDaysOld =
|
||||
user.signUpDate && Date.now() - user.signUpDate.getTime() < SEVEN_DAYS
|
||||
|
||||
const showNewUsersMicroSurvey =
|
||||
Features.hasFeature('saas') &&
|
||||
(newUsersMicroSurveyAssignment?.variant ?? 'default') === 'enabled' &&
|
||||
isUserLessThanSevenDaysOld
|
||||
|
||||
res.render('project/list-react', {
|
||||
title: 'your_projects',
|
||||
usersBestSubscription,
|
||||
@@ -329,6 +355,7 @@ async function projectListReactPage(req, res, next) {
|
||||
showGroupsAndEnterpriseBanner,
|
||||
groupsAndEnterpriseBannerVariant:
|
||||
groupsAndEnterpriseBannerAssignment?.variant ?? 'default',
|
||||
showNewUsersMicroSurvey,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user