Bläddra i källkod

Wire-up AB test for adding comments.

Paulo Reis 9 år sedan
förälder
incheckning
254e4953cb

+ 6 - 0
services/web/public/coffee/ide.coffee

@@ -81,6 +81,12 @@ define [
 		if $scope.user.signUpDate >= '2016-10-27'
 		if $scope.user.signUpDate >= '2016-10-27'
 			$scope.shouldABTestPlans = true
 			$scope.shouldABTestPlans = true
 
 
+		$scope.shouldABAddCommentBtn = false
+		if $scope.user.signUpDate >= '2016-03-22'
+			$scope.shouldABAddCommentBtn = true
+			sixpack.participate "add-comment-btn", [ "default", "editor-corner" ], (variation) ->
+				$scope.variationABAddCommentBtn = variation
+
 		$scope.settings = window.userSettings
 		$scope.settings = window.userSettings
 		$scope.anonymous = window.anonymous
 		$scope.anonymous = window.anonymous
 
 

+ 6 - 1
services/web/public/coffee/ide/review-panel/controllers/ReviewPanelController.coffee

@@ -29,8 +29,13 @@ define [
 			loadingThreads: false
 			loadingThreads: false
 			newAddCommentUI: false # Test new UI for adding comments; remove afterwards.
 			newAddCommentUI: false # Test new UI for adding comments; remove afterwards.
 
 
-		if window.location.search.match /new-comments=true/
+		if $scope.shouldABAddCommentBtn and $scope.variationABAddCommentBtn? == "editor-corner"
 			$scope.reviewPanel.newAddCommentUI = true
 			$scope.reviewPanel.newAddCommentUI = true
+			console.log "editor corner"
+		else
+			console.log "default"
+
+		console.log $scope.shouldABAddCommentBtn
 
 
 		window.addEventListener "beforeunload", () ->
 		window.addEventListener "beforeunload", () ->
 			collapsedStates = {}
 			collapsedStates = {}