Merge pull request #17432 from overleaf/jpa-wf-switch-split-test

[web] fully adopt writefull-oauth-promotion split-test

GitOrigin-RevId: b37491bc18e7cc65ec2fc8e8ced140df9f8a6048
This commit is contained in:
Jakob Ackermann
2024-03-06 13:09:28 +00:00
committed by Copybot
parent 53e9212063
commit cf0ca1226e
5 changed files with 12 additions and 12 deletions

View File

@@ -360,7 +360,7 @@ async function projectListPage(req, res, next) {
await SplitTestHandler.promises.getAssignment(
req,
res,
'writefull-integration'
'writefull-oauth-promotion'
)
let showInrGeoBanner = false

View File

@@ -86,7 +86,7 @@ async function settingsPage(req, res) {
await SplitTestHandler.promises.getAssignment(
req,
res,
'writefull-integration'
'writefull-oauth-promotion'
)
let personalAccessTokens

View File

@@ -45,8 +45,8 @@ function UserNotifications() {
)
const showInrGeoBanner = getMeta('ol-showInrGeoBanner', false)
const showBrlGeoBanner = getMeta('ol-showBrlGeoBanner', false)
const writefullIntegrationSplitTestEnabled = isSplitTestEnabled(
'writefull-integration'
const writefullOauthPromotionSplitTestEnabled = isSplitTestEnabled(
'writefull-oauth-promotion'
)
const user = getMeta('ol-user')
@@ -61,7 +61,7 @@ function UserNotifications() {
const show =
user?.writefull?.enabled === true || // show to any users who have writefull enabled regardless of split test
(!writefullIntegrationSplitTestEnabled && // show old banner to users who are not in the split test, who are on chrome and havent dismissed
(!writefullOauthPromotionSplitTestEnabled && // show old banner to users who are not in the split test, who are on chrome and havent dismissed
isChromium() &&
getMeta('ol-showWritefullPromoBanner'))
@@ -71,7 +71,7 @@ function UserNotifications() {
page: '/project',
name:
user?.writefull?.enabled === true ||
writefullIntegrationSplitTestEnabled
writefullOauthPromotionSplitTestEnabled
? 'writefull-premium'
: 'writefull',
})
@@ -84,7 +84,7 @@ function UserNotifications() {
const hasWritefullExtensionAlreadyInstalled =
window.writefull?.type === 'extension'
const usesWritefullIntegration =
writefullIntegrationSplitTestEnabled || user?.writefull?.enabled
writefullOauthPromotionSplitTestEnabled || user?.writefull?.enabled
const writefullBannerVariant =
hasWritefullExtensionAlreadyInstalled || usesWritefullIntegration
? 'plans-page'

View File

@@ -59,7 +59,7 @@ function LinkingSection() {
// even if they arent in the split test, if they have it enabled let them toggle it off
const user = getMeta('ol-user')
const shouldLoadWritefull =
(splitTestVariants['writefull-integration'] === 'enabled' ||
(splitTestVariants['writefull-oauth-promotion'] === 'enabled' ||
user.writefull?.enabled === true) &&
!window.writefull // check if the writefull extension is installed, in which case we dont handle the integration

View File

@@ -977,10 +977,10 @@ describe('<UserNotifications />', function () {
window.metaAttributesCache = window.metaAttributesCache || new Map()
})
describe('when writefull-integration split test is not enabled', function () {
describe('when writefull-oauth-promotion split test is not enabled', function () {
beforeEach(function () {
window.metaAttributesCache.set('ol-splitTestVariants', {
'writefull-integration': 'default',
'writefull-oauth-promotion': 'default',
})
window.metaAttributesCache.set('ol-user', {
writefull: { enabled: false },
@@ -1017,10 +1017,10 @@ describe('<UserNotifications />', function () {
})
})
describe('when writefull-integration split test is enabled', function () {
describe('when writefull-oauth-promotion split test is enabled', function () {
beforeEach(function () {
window.metaAttributesCache.set('ol-splitTestVariants', {
'writefull-integration': 'enabled',
'writefull-oauth-promotion': 'enabled',
})
})