[web] Enable history ranges support behind feature flag (#18429)

GitOrigin-RevId: 2f3b2352d2c157248da350eaf7b1784a605ebf20
This commit is contained in:
Mathias Jakobsen 2024-05-28 15:42:52 +01:00 committed by Copybot
parent f14fdc7b7c
commit d95910fc71
2 changed files with 14 additions and 1 deletions

View file

@ -15,6 +15,7 @@ const { callbackify } = require('util')
const _ = require('lodash')
const AnalyticsManager = require('../Analytics/AnalyticsManager')
const TpdsUpdateSender = require('../ThirdPartyDataStore/TpdsUpdateSender')
const SplitTestHandler = require('../SplitTests/SplitTestHandler')
const MONTH_NAMES = [
'January',
@ -180,8 +181,19 @@ async function _createBlankProject(
}
}
project.rootFolder[0] = rootFolder
const user = await User.findById(ownerId, 'ace.spellCheckLanguage')
const user = await User.findById(ownerId, {
'ace.spellCheckLanguage': 1,
_id: 1,
})
project.spellCheckLanguage = user.ace.spellCheckLanguage
const historyRangesSupportAssignment =
await SplitTestHandler.promises.getAssignmentForUser(
user._id,
'history-ranges-support'
)
if (historyRangesSupportAssignment.variant === 'enabled') {
project.overleaf.history.rangesSupportEnabled = true
}
await project.save()
if (!skipCreatingInTPDS) {
await TpdsUpdateSender.promises.createProject({

View file

@ -94,6 +94,7 @@ const ProjectSchema = new Schema(
upgradedAt: { type: Date },
allowDowngrade: { type: Boolean },
zipFileArchivedInProject: { type: Boolean },
rangesSupportEnabled: { type: Boolean },
},
},
collabratecUsers: [