فهرست منبع

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

Henry Oswald 12 سال پیش
والد
کامیت
3cf64ce34f

+ 7 - 0
services/web/app/coffee/Features/Project/ProjectEditorHandler.coffee

@@ -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 = []

+ 1 - 1
services/web/app/views/project/editor/pdf.jade

@@ -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")}

+ 1 - 0
services/web/public/coffee/ide/pdf/controllers/PdfController.coffee

@@ -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"

+ 4 - 0
services/web/test/UnitTests/coffee/Project/ProjectEditorHandlerTests.coffee

@@ -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", ->