diff --git a/services/web/frontend/js/features/pdf-preview/components/pdf-preview-error.js b/services/web/frontend/js/features/pdf-preview/components/pdf-preview-error.js
index 6ffd1c60a1..de58e18017 100644
--- a/services/web/frontend/js/features/pdf-preview/components/pdf-preview-error.js
+++ b/services/web/frontend/js/features/pdf-preview/components/pdf-preview-error.js
@@ -5,7 +5,6 @@ import { Button } from 'react-bootstrap'
import PdfLogEntry from './pdf-log-entry'
import { useDetachCompileContext as useCompileContext } from '../../../shared/context/detach-compile-context'
import { useStopOnFirstError } from '../../../shared/hooks/use-stop-on-first-error'
-import StopOnFirstErrorBadge from '../../../shared/components/stop-on-first-error-badge'
function PdfPreviewError({ error }) {
const { t } = useTranslation()
@@ -254,7 +253,6 @@ function TimedOutLogEntry() {
/>,
]}
/>{' '}
-
>
)}
diff --git a/services/web/frontend/js/features/pdf-preview/components/stop-on-first-error-prompt.js b/services/web/frontend/js/features/pdf-preview/components/stop-on-first-error-prompt.js
index 3c7a8cbed4..f29d16f97e 100644
--- a/services/web/frontend/js/features/pdf-preview/components/stop-on-first-error-prompt.js
+++ b/services/web/frontend/js/features/pdf-preview/components/stop-on-first-error-prompt.js
@@ -4,7 +4,6 @@ import { Button } from 'react-bootstrap'
import PdfLogEntry from './pdf-log-entry'
import { useDetachCompileContext as useCompileContext } from '../../../shared/context/detach-compile-context'
import { useStopOnFirstError } from '../../../shared/hooks/use-stop-on-first-error'
-import StopOnFirstErrorBadge from '../../../shared/components/stop-on-first-error-badge'
export default function StopOnFirstErrorPrompt() {
const { t } = useTranslation()
@@ -22,7 +21,6 @@ export default function StopOnFirstErrorPrompt() {
return (
}
formattedContent={
<>
{' '}
-
{t('log_entry_maximum_entries_see_full_logs')}
>
diff --git a/services/web/frontend/js/shared/components/stop-on-first-error-badge.tsx b/services/web/frontend/js/shared/components/stop-on-first-error-badge.tsx
deleted file mode 100644
index 3909fe9327..0000000000
--- a/services/web/frontend/js/shared/components/stop-on-first-error-badge.tsx
+++ /dev/null
@@ -1,33 +0,0 @@
-import Tooltip from './tooltip'
-
-type Props = {
- placement: string
-}
-
-export default function StopOnFirstErrorBadge({ placement }: Props) {
- const content = (
- <>
- We are testing the “Stop on first error” compilation mode.
-
- Click to give feedback
- >
- )
-
- return (
-
-
- {content}
-
-
- )
-}
diff --git a/services/web/frontend/js/shared/context/local-compile-context.js b/services/web/frontend/js/shared/context/local-compile-context.js
index b336d9f30d..352d2290c3 100644
--- a/services/web/frontend/js/shared/context/local-compile-context.js
+++ b/services/web/frontend/js/shared/context/local-compile-context.js
@@ -27,8 +27,8 @@ import { useIdeContext } from './ide-context'
import { useProjectContext } from './project-context'
import { useEditorContext } from './editor-context'
import { buildFileList } from '../../features/pdf-preview/util/file-list'
-import { useSplitTestContext } from './split-test-context'
import { useLayoutContext } from './layout-context'
+import { useUserContext } from './user-context'
export const LocalCompileContext = createContext()
@@ -86,10 +86,10 @@ export function LocalCompileProvider({ children }) {
const { _id: projectId, rootDocId } = useProjectContext()
- const { splitTestVariants } = useSplitTestContext()
-
const { pdfPreviewOpen } = useLayoutContext()
+ const { features } = useUserContext()
+
// whether a compile is in progress
const [compiling, setCompiling] = useState(false)
@@ -279,8 +279,7 @@ export function LocalCompileProvider({ children }) {
}, [compiledOnce, currentDoc, compiler])
useEffect(() => {
- const compileTimeWarningEnabled =
- splitTestVariants['compile-time-warning'] === 'show-upgrade-prompt'
+ const compileTimeWarningEnabled = features?.compileTimeout <= 60
if (compileTimeWarningEnabled && compiling && isProjectOwner) {
const timeout = window.setTimeout(() => {
@@ -291,7 +290,7 @@ export function LocalCompileProvider({ children }) {
window.clearTimeout(timeout)
}
}
- }, [compiling, isProjectOwner, splitTestVariants])
+ }, [compiling, isProjectOwner, features])
// handle the data returned from a compile request
// note: this should _only_ run when `data` changes,
diff --git a/services/web/frontend/js/shared/context/user-context.js b/services/web/frontend/js/shared/context/user-context.js
index db0d83d1ba..dba72beaa7 100644
--- a/services/web/frontend/js/shared/context/user-context.js
+++ b/services/web/frontend/js/shared/context/user-context.js
@@ -22,6 +22,7 @@ UserContext.Provider.propTypes = {
mendeley: PropTypes.boolean,
zotero: PropTypes.boolean,
references: PropTypes.boolean,
+ compileTimeout: PropTypes.number,
}),
refProviders: PropTypes.shape({
mendeley: PropTypes.any,
diff --git a/services/web/test/acceptance/src/PrimaryEmailCheckTests.js b/services/web/test/acceptance/src/PrimaryEmailCheckTests.js
index e6aaf1b78e..8a858eb6e9 100644
--- a/services/web/test/acceptance/src/PrimaryEmailCheckTests.js
+++ b/services/web/test/acceptance/src/PrimaryEmailCheckTests.js
@@ -1,36 +1,15 @@
const UserHelper = require('./helpers/UserHelper')
const Settings = require('@overleaf/settings')
const { expect } = require('chai')
-const SplitTestManager = require('../../../app/src/Features/SplitTests/SplitTestManager')
const Features = require('../../../app/src/infrastructure/Features')
-// While the split test is in progress this must be appended to URLs during tests
-const SPLIT_TEST_QUERY = '?primary-email-check=active'
-
describe('PrimaryEmailCheck', function () {
let userHelper
- // Create the primary-email-check split test because this is now required for the query string override to work. See
- // https://github.com/overleaf/internal/pull/7545#discussion_r848575736
before(async function () {
if (!Features.hasFeature('saas')) {
this.skip()
}
-
- await SplitTestManager.createSplitTest({
- name: 'primary-email-check',
- configuration: {
- active: true,
- analyticsEnabled: true,
- phase: 'release',
- variants: [
- {
- name: 'active',
- rolloutPercent: 0,
- },
- ],
- },
- })
})
beforeEach(async function () {
@@ -43,13 +22,13 @@ describe('PrimaryEmailCheck', function () {
describe('redirections', function () {
describe('when the user has signed up recently', function () {
it("shouldn't be redirected from project list to the primary email check page", async function () {
- const response = await userHelper.fetch('/project' + SPLIT_TEST_QUERY)
+ const response = await userHelper.fetch('/project')
expect(response.status).to.equal(200)
})
it('should be redirected from the primary email check page to the project list', async function () {
const response = await userHelper.fetch(
- '/user/emails/primary-email-check' + SPLIT_TEST_QUERY
+ '/user/emails/primary-email-check'
)
expect(response.status).to.equal(302)
expect(response.headers.get('location')).to.equal(
@@ -67,13 +46,13 @@ describe('PrimaryEmailCheck', function () {
})
it("shouldn't be redirected from project list to the primary email check page", async function () {
- const response = await userHelper.fetch('/project' + SPLIT_TEST_QUERY)
+ const response = await userHelper.fetch('/project')
expect(response.status).to.equal(200)
})
it('should be redirected from the primary email check page to the project list', async function () {
const response = await userHelper.fetch(
- '/user/emails/primary-email-check' + SPLIT_TEST_QUERY
+ '/user/emails/primary-email-check'
)
expect(response.status).to.equal(302)
expect(response.headers.get('location')).to.equal(
@@ -98,13 +77,13 @@ describe('PrimaryEmailCheck', function () {
})
it("shouldn't be redirected from project list to the primary email check page", async function () {
- const response = await userHelper.fetch('/project' + SPLIT_TEST_QUERY)
+ const response = await userHelper.fetch('/project')
expect(response.status).to.equal(200)
})
it('should be redirected from the primary email check page to the project list', async function () {
const response = await userHelper.fetch(
- '/user/emails/primary-email-check' + SPLIT_TEST_QUERY
+ '/user/emails/primary-email-check'
)
expect(response.status).to.equal(302)
expect(response.headers.get('location')).to.equal(
@@ -122,7 +101,7 @@ describe('PrimaryEmailCheck', function () {
})
it('should be redirected from project list to the primary email check page', async function () {
- const response = await userHelper.fetch('/project' + SPLIT_TEST_QUERY)
+ const response = await userHelper.fetch('/project')
expect(response.status).to.equal(302)
expect(response.headers.get('location')).to.equal(
UserHelper.url('/user/emails/primary-email-check').toString()
@@ -149,7 +128,7 @@ describe('PrimaryEmailCheck', function () {
})
checkResponse = await userHelper.fetch(
- '/user/emails/primary-email-check' + SPLIT_TEST_QUERY,
+ '/user/emails/primary-email-check',
{ method: 'POST' }
)
})
@@ -162,7 +141,7 @@ describe('PrimaryEmailCheck', function () {
})
it("shouldn't be redirected from project list to the primary email check page any longer", async function () {
- const response = await userHelper.fetch('/project' + SPLIT_TEST_QUERY)
+ const response = await userHelper.fetch('/project')
expect(response.status).to.equal(200)
})
diff --git a/services/web/test/acceptance/src/SessionTests.js b/services/web/test/acceptance/src/SessionTests.js
index bcf538c5c9..2822f784c7 100644
--- a/services/web/test/acceptance/src/SessionTests.js
+++ b/services/web/test/acceptance/src/SessionTests.js
@@ -73,6 +73,7 @@ describe('Sessions', function () {
// set up second session for this user
this.user2 = new User()
this.user2.email = this.user1.email
+ this.user2.emails = this.user1.emails
this.user2.password = this.user1.password
})
@@ -197,9 +198,11 @@ describe('Sessions', function () {
// set up second session for this user
this.user2 = new User()
this.user2.email = this.user1.email
+ this.user2.emails = this.user1.emails
this.user2.password = this.user1.password
this.user3 = new User()
this.user3.email = this.user1.email
+ this.user3.emails = this.user1.emails
this.user3.password = this.user1.password
})
@@ -321,9 +324,11 @@ describe('Sessions', function () {
// set up second session for this user
this.user2 = new User()
this.user2.email = this.user1.email
+ this.user2.emails = this.user1.emails
this.user2.password = this.user1.password
this.user3 = new User()
this.user3.email = this.user1.email
+ this.user3.emails = this.user1.emails
this.user3.password = this.user1.password
async.series([this.user2.login.bind(this.user2)], done)
})
diff --git a/services/web/test/acceptance/src/helpers/User.js b/services/web/test/acceptance/src/helpers/User.js
index 06ef9cbc62..817053ed6f 100644
--- a/services/web/test/acceptance/src/helpers/User.js
+++ b/services/web/test/acceptance/src/helpers/User.js
@@ -19,6 +19,7 @@ class User {
{
email: options.email || `acceptance-test-${count}@example.com`,
createdAt: new Date(),
+ confirmedAt: options.confirmedAt,
},
]
this.email = this.emails[0].email
diff --git a/services/web/test/frontend/helpers/editor-providers.js b/services/web/test/frontend/helpers/editor-providers.js
index 360642732f..a30e400a76 100644
--- a/services/web/test/frontend/helpers/editor-providers.js
+++ b/services/web/test/frontend/helpers/editor-providers.js
@@ -105,6 +105,9 @@ export function EditorProviders({
metadataManager,
}
+ // Add details for useUserContext
+ window.metaAttributesCache.set('ol-user', { ...user, features })
+
return (
diff --git a/services/web/test/unit/src/Project/ProjectControllerTests.js b/services/web/test/unit/src/Project/ProjectControllerTests.js
index d5bc46abc0..15e198200a 100644
--- a/services/web/test/unit/src/Project/ProjectControllerTests.js
+++ b/services/web/test/unit/src/Project/ProjectControllerTests.js
@@ -71,6 +71,9 @@ describe('ProjectController', function () {
this.EditorController = { renameProject: sinon.stub() }
this.InactiveProjectManager = { reactivateProjectIfRequired: sinon.stub() }
this.ProjectUpdateHandler = { markAsOpened: sinon.stub() }
+ this.UserPrimaryEmailCheckHandler = {
+ requiresPrimaryEmailCheck: sinon.stub().returns(false),
+ }
this.ProjectGetter = {
findAllUsersProjects: sinon.stub(),
getProject: sinon.stub(),
@@ -193,6 +196,8 @@ describe('ProjectController', function () {
},
'../Institutions/InstitutionsFeatures': this.InstitutionsFeatures,
'../Survey/SurveyHandler': this.SurveyHandler,
+ '../User/UserPrimaryEmailCheckHandler':
+ this.UserPrimaryEmailCheckHandler,
'./ProjectAuditLogHandler': this.ProjectAuditLogHandler,
},
})
diff --git a/services/web/test/unit/src/Subscription/SubscriptionControllerTests.js b/services/web/test/unit/src/Subscription/SubscriptionControllerTests.js
index d1cb7b27fd..aa9fc8369e 100644
--- a/services/web/test/unit/src/Subscription/SubscriptionControllerTests.js
+++ b/services/web/test/unit/src/Subscription/SubscriptionControllerTests.js
@@ -275,7 +275,7 @@ describe('SubscriptionController', function () {
describe('with a valid plan code', function () {
it('should render the new subscription page', function (done) {
this.res.render = (page, opts) => {
- page.should.equal('subscriptions/new')
+ page.should.equal('subscriptions/new-updated')
done()
}
this.SubscriptionController.paymentPage(this.req, this.res)