mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Split project_history.enable in initializeHistoryForNewProjects and sendProjectStructureOps
This commit is contained in:
parent
dfe6e26946
commit
8311101ec0
2 changed files with 5 additions and 4 deletions
|
@ -205,7 +205,7 @@ module.exports = DocumentUpdaterHandler =
|
|||
callback new Error("doc updater returned a non-success status code: #{res.statusCode}")
|
||||
|
||||
updateProjectStructure : (project_id, userId, changes, callback = (error) ->)->
|
||||
return callback() if !settings.apis.project_history?.enabled
|
||||
return callback() if !settings.apis.project_history?.sendProjectStructureOps
|
||||
|
||||
docUpdates = DocumentUpdaterHandler._getRenameUpdates('doc', changes.oldDocs, changes.newDocs)
|
||||
fileUpdates = DocumentUpdaterHandler._getRenameUpdates('file', changes.oldFiles, changes.newFiles)
|
||||
|
|
|
@ -6,7 +6,7 @@ ProjectDetailsHandler = require "../Project/ProjectDetailsHandler"
|
|||
|
||||
module.exports = HistoryController =
|
||||
initializeProject: (callback = (error, history_id) ->) ->
|
||||
return callback() if !settings.apis.project_history?.enabled
|
||||
return callback() if !settings.apis.project_history?.initializeHistoryForNewProjects
|
||||
request.post {
|
||||
url: "#{settings.apis.project_history.url}/project"
|
||||
}, (error, res, body)->
|
||||
|
@ -33,7 +33,8 @@ module.exports = HistoryController =
|
|||
# find out which type of history service this project uses
|
||||
ProjectDetailsHandler.getDetails project_id, (err, project) ->
|
||||
return next(err) if err?
|
||||
if project?.overleaf?.history?.display
|
||||
history = project.overleaf?.history
|
||||
if history?.id? and history?.display
|
||||
req.useProjectHistory = true
|
||||
else
|
||||
req.useProjectHistory = false
|
||||
|
@ -58,7 +59,7 @@ module.exports = HistoryController =
|
|||
buildHistoryServiceUrl: (useProjectHistory) ->
|
||||
# choose a history service, either document-level (trackchanges)
|
||||
# or project-level (project_history)
|
||||
if settings.apis.project_history?.enabled && useProjectHistory
|
||||
if useProjectHistory
|
||||
return settings.apis.project_history.url
|
||||
else
|
||||
return settings.apis.trackchanges.url
|
||||
|
|
Loading…
Reference in a new issue