1
0
Fork 0
mirror of https://github.com/overleaf/overleaf.git synced 2025-04-08 22:40:48 +00:00

Merge pull request from overleaf/ds-remove-registration-field-home-page

Remove registration from home page

GitOrigin-RevId: 3bd04f2f2aa62ef5f3fa8a0cdd09e461c38a27e9
This commit is contained in:
Davinder Singh 2022-06-16 14:16:33 +01:00 committed by Copybot
parent b6ab0792a9
commit eba2fe9a3e
4 changed files with 45 additions and 20 deletions
services/web
app/src/Features
frontend/stylesheets/app
locales

View file

@ -50,14 +50,26 @@ module.exports = HomeController = {
res,
'highlight-sso'
)
const homeRegistration = await SplitTestHandler.promises.getAssignment(
req,
res,
'home-registration'
)
const highlightSSO = highlightSSOAssignment.variant === 'active'
return res.render('external/home/v2', { highlightSSO })
const removeRegistration = homeRegistration.variant
return res.render('external/home/v2', {
highlightSSO,
removeRegistration,
})
} catch (err) {
logger.error(
{ err },
"error fetching 'highlight-sso' split test assignment"
)
return res.render('external/home/v2', { highlightSSO: false })
return res.render('external/home/v2', {
highlightSSO: false,
removeRegistration: 'default',
})
}
} else {
return res.redirect('/login')

View file

@ -37,27 +37,28 @@ async function _addAffiliation(user, affiliationOptions) {
}
async function recordRegistrationEvent(user) {
SplitTestHandler.promises
.getAssignmentForUser(user._id, 'highlight-sso')
.then(assignment => {
const segmentation = {
highlightSSO: assignment.variant === 'active',
}
if (user.thirdPartyIdentifiers && user.thirdPartyIdentifiers.length > 0) {
segmentation.provider = user.thirdPartyIdentifiers[0].providerId
}
return Analytics.recordEventForUser(
try {
const highlightSSOAssignment =
await SplitTestHandler.promises.getAssignmentForUser(
user._id,
'user-registered',
segmentation
'highlight-sso'
)
})
.catch(err =>
logger.warn(
{ err },
'there was an error recording `user-registered` event'
const homeRegistrationAssignment =
await SplitTestHandler.promises.getAssignmentForUser(
user._id,
'home-registration'
)
)
const segmentation = {
highlightSSO: highlightSSOAssignment.variant === 'active',
'home-registration': homeRegistrationAssignment.variant,
}
if (user.thirdPartyIdentifiers && user.thirdPartyIdentifiers.length > 0) {
segmentation.provider = user.thirdPartyIdentifiers[0].providerId
}
Analytics.recordEventForUser(user._id, 'user-registered', segmentation)
} catch (err) {
logger.warn({ err }, 'there was an error recording `user-registered` event')
}
}
async function createNewUser(attributes, options = {}) {

View file

@ -228,6 +228,17 @@
}
}
.sign-up-home-page {
display: flex;
justify-content: space-evenly;
align-items: center;
}
.sign-up-btn {
display: flex;
align-items: center;
}
.universities-container {
border-bottom: 1px solid @gray-lighter;
}

View file

@ -1487,6 +1487,7 @@
"dropbox_sync": "Dropbox Sync",
"beta": "Beta",
"sign_up_now": "Sign Up Now",
"sign_up_for_free":"Sign up for free",
"annual": "Annual",
"half_price_student": "Half Price Student Plans",
"about_us": "About Us",