mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Release new navigation toolbar to alpha + feature flag refactoring (#3931)
* release new navigation toolbar to alpha and refactor flags GitOrigin-RevId: d6ff9a3740423510457247882169b7d5aae2b843
This commit is contained in:
parent
e9b93a6ef2
commit
0874fcb8ca
1 changed files with 25 additions and 14 deletions
|
@ -739,10 +739,6 @@ const ProjectController = {
|
|||
const allowedImageNames = ProjectHelper.getAllowedImagesForUser(
|
||||
sessionUser
|
||||
)
|
||||
const wantsOldShareModalUI =
|
||||
req.query && req.query.new_share_modal_ui === 'false'
|
||||
const wantsOldGithubSyncUI =
|
||||
req.query && req.query.new_github_sync_ui === 'false'
|
||||
|
||||
AuthorizationManager.getPrivilegeLevelForProject(
|
||||
userId,
|
||||
|
@ -796,9 +792,14 @@ const ProjectController = {
|
|||
}
|
||||
|
||||
const logsUIVariant = getNewLogsUIVariantForUser(user)
|
||||
const userShouldSeeNewLogsUI = logsUIVariant.newLogsUI
|
||||
const wantsOldLogsUI =
|
||||
req.query && req.query.new_logs_ui === 'false'
|
||||
|
||||
function shouldDisplayFeature(name, variantFlag) {
|
||||
if (req.query && req.query[name]) {
|
||||
return req.query[name] === 'true'
|
||||
} else {
|
||||
return variantFlag === true
|
||||
}
|
||||
}
|
||||
|
||||
res.render('project/editor', {
|
||||
title: project.name,
|
||||
|
@ -854,14 +855,24 @@ const ProjectController = {
|
|||
gitBridgePublicBaseUrl: Settings.gitBridgePublicBaseUrl,
|
||||
wsUrl,
|
||||
showSupport: Features.hasFeature('support'),
|
||||
showNewLogsUI: userShouldSeeNewLogsUI && !wantsOldLogsUI,
|
||||
showNewLogsUI: shouldDisplayFeature(
|
||||
'new_logs_ui',
|
||||
logsUIVariant.newLogsUI
|
||||
),
|
||||
logsUISubvariant: logsUIVariant.subvariant,
|
||||
showNewNavigationUI:
|
||||
req.query && req.query.new_navigation_ui === 'true',
|
||||
showReactShareModal: !wantsOldShareModalUI,
|
||||
showReactGithubSync: !wantsOldGithubSyncUI && user.alphaProgram,
|
||||
showNewBinaryFileUI:
|
||||
req.query && req.query.new_binary_file === 'true',
|
||||
showNewNavigationUI: shouldDisplayFeature(
|
||||
'new_navigation_ui',
|
||||
user.alphaProgram
|
||||
),
|
||||
showReactShareModal: shouldDisplayFeature(
|
||||
'new_share_modal_ui',
|
||||
true
|
||||
),
|
||||
showReactGithubSync: shouldDisplayFeature(
|
||||
'new_github_sync_ui',
|
||||
user.alphaProgram
|
||||
),
|
||||
showNewBinaryFileUI: shouldDisplayFeature('new_binary_file'),
|
||||
})
|
||||
timer.done()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue