mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-24 21:41:50 +00:00
force gallery items to use legacy OL v1 texlive image
This commit is contained in:
parent
a451a0b3f8
commit
c0b32f031e
2 changed files with 22 additions and 10 deletions
|
@ -45,6 +45,7 @@ module.exports = TemplatesController =
|
|||
docId: req.body.docId
|
||||
templateId: req.body.templateId
|
||||
templateVersionId: req.body.templateVersionId
|
||||
image: 'wl_texlive:2018.1'
|
||||
},
|
||||
req,
|
||||
res
|
||||
|
@ -63,18 +64,26 @@ module.exports = TemplatesController =
|
|||
logger.err err:err, zipReq:zipReq, "problem building project from zip"
|
||||
return res.sendStatus 500
|
||||
setCompiler project._id, options.compiler, ->
|
||||
fs.unlink dumpPath, ->
|
||||
delete req.session.templateData
|
||||
conditions = {_id:project._id}
|
||||
update = {
|
||||
fromV1TemplateId:options.templateId,
|
||||
fromV1TemplateVersionId:options.templateVersionId
|
||||
}
|
||||
Project.update conditions, update, {}, (err)->
|
||||
res.redirect "/project/#{project._id}"
|
||||
setImage project._id, options.image, ->
|
||||
fs.unlink dumpPath, ->
|
||||
delete req.session.templateData
|
||||
conditions = {_id:project._id}
|
||||
update = {
|
||||
fromV1TemplateId:options.templateId,
|
||||
fromV1TemplateVersionId:options.templateVersionId
|
||||
}
|
||||
Project.update conditions, update, {}, (err)->
|
||||
res.redirect "/project/#{project._id}"
|
||||
|
||||
setCompiler = (project_id, compiler, callback)->
|
||||
if compiler?
|
||||
ProjectOptionsHandler.setCompiler project_id, compiler, callback
|
||||
else
|
||||
callback()
|
||||
|
||||
setImage = (project_id, imageName, callback)->
|
||||
console.log(project_id, imageName)
|
||||
if imageName?
|
||||
ProjectOptionsHandler.setImageName project_id, imageName, callback
|
||||
else
|
||||
callback()
|
||||
|
|
|
@ -22,7 +22,10 @@ describe 'TemplatesController', ->
|
|||
}
|
||||
@ProjectUploadManager = {createProjectFromZipArchive : sinon.stub().callsArgWith(3, null, {_id:project_id})}
|
||||
@dumpFolder = "dump/path"
|
||||
@ProjectOptionsHandler = {setCompiler:sinon.stub().callsArgWith(2)}
|
||||
@ProjectOptionsHandler = {
|
||||
setCompiler:sinon.stub().callsArgWith(2)
|
||||
setImageName:sinon.stub().callsArgWith(2)
|
||||
}
|
||||
@uuid = "1234"
|
||||
@ProjectDetailsHandler =
|
||||
getProjectDescription:sinon.stub()
|
||||
|
|
Loading…
Reference in a new issue