mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-10 17:53:04 +00:00
Make project list react as the default in main router (#12047)
* Make project list react as the default in the main router * Remove angular controller check-in project list smoke test GitOrigin-RevId: 586a14afd9888d6f18e3cfa64aeebc5975bb43d5
This commit is contained in:
parent
488c6ff919
commit
01c504109b
4 changed files with 4 additions and 35 deletions
|
@ -43,8 +43,6 @@ const { hasAdminAccess } = require('../Helpers/AdminAuthorizationHelper')
|
|||
const InstitutionsFeatures = require('../Institutions/InstitutionsFeatures')
|
||||
const SubscriptionViewModelBuilder = require('../Subscription/SubscriptionViewModelBuilder')
|
||||
const SurveyHandler = require('../Survey/SurveyHandler')
|
||||
const { expressify } = require('../../util/promises')
|
||||
const ProjectListController = require('./ProjectListController')
|
||||
const ProjectAuditLogHandler = require('./ProjectAuditLogHandler')
|
||||
const PublicAccessLevels = require('../Authorization/PublicAccessLevels')
|
||||
|
||||
|
@ -408,28 +406,7 @@ const ProjectController = {
|
|||
})
|
||||
},
|
||||
|
||||
async projectListPage(req, res, next) {
|
||||
try {
|
||||
const assignment = await SplitTestHandler.promises.getAssignment(
|
||||
req,
|
||||
res,
|
||||
'project-dashboard-react'
|
||||
)
|
||||
if (assignment.variant === 'enabled') {
|
||||
ProjectListController.projectListReactPage(req, res, next)
|
||||
} else {
|
||||
ProjectController._projectListAngularPage(req, res, next)
|
||||
}
|
||||
} catch (error) {
|
||||
logger.warn(
|
||||
{ err: error },
|
||||
'failed to get "project-dashboard-react" split test assignment'
|
||||
)
|
||||
ProjectController._projectListAngularPage(req, res, next)
|
||||
}
|
||||
},
|
||||
|
||||
_projectListAngularPage(req, res, next) {
|
||||
projectListPage(req, res, next) {
|
||||
const timer = new metrics.Timer('project-list')
|
||||
const userId = SessionManager.getLoggedInUserId(req.session)
|
||||
const currentUser = SessionManager.getSessionUser(req.session)
|
||||
|
@ -1637,8 +1614,4 @@ const LEGACY_THEME_LIST = [
|
|||
'xcode',
|
||||
]
|
||||
|
||||
ProjectController.projectListPage = expressify(
|
||||
ProjectController.projectListPage
|
||||
)
|
||||
|
||||
module.exports = ProjectController
|
||||
|
|
|
@ -82,7 +82,7 @@ const _buildPortalTemplatesList = affiliations => {
|
|||
* @param {import("express").NextFunction} next
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async function projectListReactPage(req, res, next) {
|
||||
async function projectListPage(req, res, next) {
|
||||
// can have two values:
|
||||
// - undefined - when there's no "saas" feature or couldn't get subscription data
|
||||
// - object - the subscription data object
|
||||
|
@ -601,6 +601,6 @@ function _hasActiveFilter(filters) {
|
|||
}
|
||||
|
||||
module.exports = {
|
||||
projectListReactPage: expressify(projectListReactPage),
|
||||
projectListPage: expressify(projectListPage),
|
||||
getProjectsJson: expressify(getProjectsJson),
|
||||
}
|
||||
|
|
|
@ -464,7 +464,7 @@ function initialize(webRouter, privateApiRouter, publicApiRouter) {
|
|||
'/project',
|
||||
AuthenticationController.requireLogin(),
|
||||
RateLimiterMiddleware.rateLimit(rateLimiters.openDashboard),
|
||||
ProjectController.projectListPage
|
||||
ProjectListController.projectListPage
|
||||
)
|
||||
webRouter.post(
|
||||
'/project/new',
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
const ANGULAR_PROJECT_CONTROLLER_REGEX = /controller="ProjectPageController"/
|
||||
const TITLE_REGEX = /<title>Your Projects - .*, Online LaTeX Editor<\/title>/
|
||||
|
||||
async function run({ request, assertHasStatusCode }) {
|
||||
|
@ -9,9 +8,6 @@ async function run({ request, assertHasStatusCode }) {
|
|||
if (!TITLE_REGEX.test(response.body)) {
|
||||
throw new Error('body does not have correct title')
|
||||
}
|
||||
if (!ANGULAR_PROJECT_CONTROLLER_REGEX.test(response.body)) {
|
||||
throw new Error('body does not have correct angular controller')
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { run }
|
||||
|
|
Loading…
Reference in a new issue