mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #21212 from overleaf/revert-20969-ac-subscription-layout-react
Revert "[web] Set Subscription pages to have `layout-react`" GitOrigin-RevId: eaf3a651160e278adcb103864c5ea81ea3e35aa7
This commit is contained in:
parent
2c7530a6cf
commit
b2d991d74a
14 changed files with 11 additions and 41 deletions
|
@ -1,12 +1,6 @@
|
|||
const _ = require('lodash')
|
||||
|
||||
/** @typedef {import('../../../../types/user').User} User */
|
||||
|
||||
const SessionManager = {
|
||||
/**
|
||||
* @param session
|
||||
* @returns {User | null}
|
||||
*/
|
||||
getSessionUser(session) {
|
||||
const sessionUser = _.get(session, ['user'])
|
||||
const sessionPassportUser = _.get(session, ['passport', 'user'])
|
||||
|
|
|
@ -169,16 +169,12 @@ async function viewInvite(req, res, next) {
|
|||
invite.email
|
||||
)
|
||||
|
||||
/** @type {import('../../../../types/user').LoggedOutUser} */
|
||||
const userWithoutSensitiveFields = { id: null }
|
||||
|
||||
return res.render('subscriptions/team/invite_logged_out', {
|
||||
inviterName: invite.inviterName,
|
||||
inviteToken: invite.token,
|
||||
appName: settings.appName,
|
||||
accountExists: userByEmail != null,
|
||||
emailAddress: invite.email,
|
||||
userWithoutSensitiveFields,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,7 +37,6 @@ block append meta
|
|||
subdomainLang: settings.i18n.subdomainLang,
|
||||
translatedLanguages: settings.translatedLanguages
|
||||
})
|
||||
meta(name="ol-user" data-type="json" content=(userWithoutSensitiveFields || getSessionUser()))
|
||||
|
||||
block body
|
||||
if (typeof suppressNavbar === "undefined")
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
extends ../layout-react
|
||||
extends ../layout-marketing
|
||||
|
||||
block vars
|
||||
- bootstrap5PageStatus = 'enabled' // One of 'disabled', 'enabled', and 'queryStringOnly'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
extends ../layout-react
|
||||
extends ../layout-marketing
|
||||
|
||||
block vars
|
||||
- bootstrap5PageStatus = 'enabled' // One of 'disabled', 'enabled', and 'queryStringOnly'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
extends ../layout-react
|
||||
extends ../layout-marketing
|
||||
|
||||
block vars
|
||||
- bootstrap5PageStatus = 'enabled' // One of 'disabled', 'enabled', and 'queryStringOnly'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
extends ../../layout-react
|
||||
extends ../../layout-marketing
|
||||
|
||||
block vars
|
||||
- bootstrap5PageStatus = 'enabled' // One of 'disabled', 'enabled', and 'queryStringOnly'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
extends ../../layout-react
|
||||
extends ../../layout-marketing
|
||||
|
||||
block vars
|
||||
- bootstrap5PageStatus = 'enabled' // One of 'disabled', 'enabled', and 'queryStringOnly'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
extends ../../layout-react
|
||||
extends ../../layout-marketing
|
||||
|
||||
block vars
|
||||
- bootstrap5PageStatus = 'enabled' // One of 'disabled', 'enabled', and 'queryStringOnly'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
extends ../../layout-react
|
||||
extends ../../layout-marketing
|
||||
|
||||
block vars
|
||||
- bootstrap5PageStatus = 'enabled' // One of 'disabled', 'enabled', and 'queryStringOnly'
|
||||
|
|
|
@ -6,4 +6,3 @@ import '../../../features/contact-form'
|
|||
import '../../../features/event-tracking'
|
||||
import '../../../features/cookie-banner'
|
||||
import '../../../features/link-helpers/slow-link'
|
||||
import '../../../features/header-footer-react'
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
import { createContext, FC, useContext, useMemo } from 'react'
|
||||
import getMeta from '../../utils/meta'
|
||||
import { LoggedOutUser, User } from '../../../../types/user'
|
||||
import { User } from '../../../../types/user'
|
||||
|
||||
export const UserContext = createContext<User | LoggedOutUser | undefined>(
|
||||
undefined
|
||||
)
|
||||
export const UserContext = createContext<User | undefined>(undefined)
|
||||
|
||||
export const UserProvider: FC = ({ children }) => {
|
||||
const user = useMemo(() => getMeta('ol-user'), [])
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { User, Features, LoggedOutUser } from '../../../types/user'
|
||||
import { User, Features } from '../../../types/user'
|
||||
import { User as MinimalUser } from '../../../types/admin/user'
|
||||
import { User as ManagedUser } from '../../../types/group-management/user'
|
||||
import { UserSettings } from '../../../types/user-settings'
|
||||
|
@ -204,7 +204,7 @@ export interface Meta {
|
|||
'ol-usGovBannerVariant': USGovBannerVariant
|
||||
'ol-useShareJsHash': boolean
|
||||
'ol-usedLatex': 'never' | 'occasionally' | 'often' | undefined
|
||||
'ol-user': User | LoggedOutUser
|
||||
'ol-user': User
|
||||
'ol-userAffiliations': Affiliation[]
|
||||
'ol-userCanExtendTrial': boolean
|
||||
'ol-userCanNotStartRequestedTrial': boolean
|
||||
|
|
|
@ -46,20 +46,4 @@ export type User = {
|
|||
}
|
||||
}
|
||||
|
||||
export type LoggedOutUser = {
|
||||
id: null
|
||||
email?: undefined
|
||||
first_name?: undefined
|
||||
last_name?: undefined
|
||||
signUpDate?: undefined
|
||||
labsProgram?: boolean
|
||||
alphaProgram?: boolean
|
||||
betaProgram?: boolean
|
||||
allowedFreeTrial?: boolean
|
||||
features?: Features
|
||||
refProviders?: RefProviders
|
||||
writefull?: undefined
|
||||
isAdmin?: boolean
|
||||
}
|
||||
|
||||
export type MongoUser = Pick<User, Exclude<keyof User, 'id'>> & { _id: string }
|
||||
|
|
Loading…
Reference in a new issue