1
0
Fork 0
mirror of https://github.com/overleaf/overleaf.git synced 2025-04-22 12:58:13 +00:00

pass new compile features to client side, don't show timeout upgrade for premium users

This commit is contained in:
Henry Oswald 2014-10-20 12:21:40 +01:00
parent fc4bc08fc2
commit 3cf64ce34f
4 changed files with 13 additions and 1 deletions
services/web
app
coffee/Features/Project
views/project/editor
public/coffee/ide/pdf/controllers
test/UnitTests/coffee/Project

View file

@ -22,6 +22,8 @@ module.exports = ProjectEditorHandler =
collaborators: -1 # Infinite
versioning: false
dropbox:false
compileTimeout: 60
compileGroup:"standard"
if project.owner_ref.features?
if project.owner_ref.features.collaborators?
@ -30,6 +32,11 @@ module.exports = ProjectEditorHandler =
result.features.versioning = project.owner_ref.features.versioning
if project.owner_ref.features.dropbox?
result.features.dropbox = project.owner_ref.features.dropbox
if project.owner_ref.features.compileTimeout?
result.features.compileTimeout = project.owner_ref.features.compileTimeout
if project.owner_ref.features.compileGroup?
result.features.compileGroup = project.owner_ref.features.compileGroup
result.owner = @buildUserModelView project.owner_ref, "owner"
result.members = []

View file

@ -92,7 +92,7 @@ div.full-size.pdf(ng-controller="PdfController")
a.text-info(href="https://www.sharelatex.com/learn/Debugging_Compilation_timeout_errors", target="_blank")
| #{translate("learn_how_to_make_documents_compile_quickly")}
.alert.alert-success(ng-show="pdf.timedout")
.alert.alert-success(ng-show="pdf.timedout && !hasPremiumCompile")
p
strong #{translate("upgrade_for_faster_compiles")}
p #{translate("free_accounts_have_timeout_upgrade_to_increase")}

View file

@ -8,6 +8,7 @@ define [
return if !autoCompile
autoCompile = false
$scope.recompile(isAutoCompile: true)
$scope.hasPremiumCompile = $scope.project.features.compileGroup == "priority"
sendCompileRequest = (options = {}) ->
url = "/project/#{$scope.project_id}/compile"

View file

@ -157,11 +157,15 @@ describe "ProjectEditorHandler", ->
@project.owner_ref.features =
versioning: true
collaborators: 3
compileGroup:"priority"
compileTimeout: 96
@result = @handler.buildProjectModelView @project
it "should copy the owner features to the project", ->
@result.features.versioning.should.equal @project.owner_ref.features.versioning
@result.features.collaborators.should.equal @project.owner_ref.features.collaborators
@result.features.compileGroup.should.equal @project.owner_ref.features.compileGroup
@result.features.compileTimeout.should.equal @project.owner_ref.features.compileTimeout
describe "without owners and members", ->