Explorar o código

Merge pull request #841 from sharelatex/ns-remove-wufoo-log-links

remove wufoo latex error response logging
Jessica Lawshe %!s(int64=8) %!d(string=hai) anos
pai
achega
3a2400b212

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

@@ -161,7 +161,6 @@ div.full-size.pdf(ng-controller="PdfController")
 					'alert-info':    entry.level == 'typesetting'\
 					'alert-info':    entry.level == 'typesetting'\
 				}"
 				}"
 				ng-click="openInEditor(entry)"
 				ng-click="openInEditor(entry)"
-				ng-init="feedbackSent = false; showNegFeedbackUI = false; negFeedbackReason = ''; negFeedbackReasonFreeText = ''"
 			)
 			)
 				span.line-no
 				span.line-no
 					i.fa.fa-link(aria-hidden="true")
 					i.fa.fa-link(aria-hidden="true")
@@ -179,7 +178,7 @@ div.full-size.pdf(ng-controller="PdfController")
 					p.card-hint-text(
 					p.card-hint-text(
 						ng-show="entry.humanReadableHint",
 						ng-show="entry.humanReadableHint",
 						ng-bind-html="wikiEnabled ? entry.humanReadableHint : stripHTMLFromString(entry.humanReadableHint)")
 						ng-bind-html="wikiEnabled ? entry.humanReadableHint : stripHTMLFromString(entry.humanReadableHint)")
-					.card-hint-actions.clearfix
+					.card-hint-footer.clearfix
 						.card-hint-ext-link(ng-if="wikiEnabled && entry.extraInfoURL")
 						.card-hint-ext-link(ng-if="wikiEnabled && entry.extraInfoURL")
 							a(
 							a(
 								ng-href="{{ entry.extraInfoURL }}",
 								ng-href="{{ entry.extraInfoURL }}",
@@ -188,67 +187,6 @@ div.full-size.pdf(ng-controller="PdfController")
 							)
 							)
 								i.fa.fa-external-link
 								i.fa.fa-external-link
 								| #{translate("log_hint_extra_info")}
 								| #{translate("log_hint_extra_info")}
-						.card-hint-feedback(
-							ng-hide="feedbackSent || showNegFeedbackUI"
-							ng-class="entry.ruleId"
-						)
-							label.card-hint-feedback-label #{translate("log_hint_feedback_label")}
-							a.card-hint-feedback-positive(
-								ng-click="trackLogHintsPositiveFeedback(entry.ruleId); feedbackSent = true;"
-								href
-							) #{translate("answer_yes")}
-							span  / 
-							a.card-hint-feedback-negative(
-								ng-click="trackLogHintsNegativeFeedback(entry.ruleId); showNegFeedbackUI = true;"
-								href
-							) #{translate("answer_no")}
-						.card-hint-extra-feedback(ng-hide="!showNegFeedbackUI || feedbackSent")
-							p.card-hint-extra-feedback-label #{translate("log_hint_ask_extra_feedback")}
-							.radio: label
-								input(
-									type="radio"
-									name="{{ 'neg-feedback-reason-' + $index }}"
-									ng-model="negFeedbackReason"
-									value="{{ logHintsNegFeedbackValues.DIDNT_UNDERSTAND }}"
-								)
-								| #{translate("log_hint_extra_feedback_didnt_understand")}
-							.radio: label
-								input(
-									type="radio"
-									name="{{ 'neg-feedback-reason-' + $index }}"
-									ng-model="negFeedbackReason"
-									value="{{ logHintsNegFeedbackValues.NOT_APPLICABLE }}"
-								)
-								| #{translate("log_hint_extra_feedback_not_applicable")}
-							.radio: label
-								input(
-									type="radio"
-									name="{{ 'neg-feedback-reason-' + $index }}"
-									ng-model="negFeedbackReason"
-									value="{{ logHintsNegFeedbackValues.INCORRECT }}"
-								)
-								| #{translate("log_hint_extra_feedback_incorrect")}
-							.radio: label
-								input(
-									type="radio"
-									name="{{ 'neg-feedback-reason-' + $index }}"
-									ng-model="negFeedbackReason"
-									value="{{ logHintsNegFeedbackValues.OTHER }}"
-								)
-								| #{translate("log_hint_extra_feedback_other")}
-							textarea.form-control(
-								ng-show="negFeedbackReason === logHintsNegFeedbackValues.OTHER"
-								ng-model="negFeedbackReasonFreeText"
-								rows="2"
-							)
-							.clearfix
-								button.btn.btn-default.btn-sm.pull-right(
-									ng-disabled="!negFeedbackReason"
-									ng-click="trackLogHintsNegFeedbackDetails(entry.ruleId, negFeedbackReason, negFeedbackReasonFreeText); feedbackSent = true;"
-								) #{translate("log_hint_extra_feedback_submit")}
-
-						.card-hint-feedback(ng-show="feedbackSent")
-							label.card-hint-feedback-label #{translate("log_hint_feedback_gratitude")}
 
 
 				p.entry-content(ng-show="entry.content") {{ entry.content.trim() }}
 				p.entry-content(ng-show="entry.content") {{ entry.content.trim() }}
 
 

+ 4 - 18
services/web/public/coffee/ide/pdf/controllers/PdfController.coffee

@@ -3,7 +3,6 @@ define [
 	"ace/ace"
 	"ace/ace"
 	"ide/human-readable-logs/HumanReadableLogs"
 	"ide/human-readable-logs/HumanReadableLogs"
 	"libs/bib-log-parser"
 	"libs/bib-log-parser"
-	"services/log-hints-feedback"
 ], (App, Ace, HumanReadableLogs, BibLogParser) ->
 ], (App, Ace, HumanReadableLogs, BibLogParser) ->
 	AUTO_COMPILE_MAX_WAIT = 5000
 	AUTO_COMPILE_MAX_WAIT = 5000
 	# We add a 1 second debounce to sending user changes to server if they aren't
 	# We add a 1 second debounce to sending user changes to server if they aren't
@@ -16,7 +15,7 @@ define [
 		return (url)-> return $sce.trustAsResourceUrl(url);
 		return (url)-> return $sce.trustAsResourceUrl(url);
 	])
 	])
 
 
-	App.controller "PdfController", ($scope, $http, ide, $modal, synctex, event_tracking, logHintsFeedback, localStorage) ->
+	App.controller "PdfController", ($scope, $http, ide, $modal, synctex, event_tracking, localStorage) ->
 		# enable per-user containers by default
 		# enable per-user containers by default
 		perUserCompile = true
 		perUserCompile = true
 		autoCompile = true
 		autoCompile = true
@@ -42,22 +41,9 @@ define [
 				$scope.$applyAsync () ->
 				$scope.$applyAsync () ->
 					$scope.shouldDropUp = getFilesDropdownTopCoordAsRatio() > 0.65
 					$scope.shouldDropUp = getFilesDropdownTopCoordAsRatio() > 0.65
 
 
-		# log hints tracking
-		$scope.logHintsNegFeedbackValues = logHintsFeedback.feedbackOpts
-
 		$scope.trackLogHintsLearnMore = () ->
 		$scope.trackLogHintsLearnMore = () ->
 			event_tracking.sendMB "logs-hints-learn-more"
 			event_tracking.sendMB "logs-hints-learn-more"
 
 
-		trackLogHintsFeedback = (isPositive, hintId) ->
-			event_tracking.send "log-hints", (if isPositive then "feedback-positive" else "feedback-negative"), hintId
-			event_tracking.sendMB (if isPositive then "log-hints-feedback-positive" else "log-hints-feedback-negative"), { hintId }
-
-		$scope.trackLogHintsNegFeedbackDetails = (hintId, feedbackOpt, feedbackOtherVal) ->
-			logHintsFeedback.submitFeedback hintId, feedbackOpt, feedbackOtherVal
-
-		$scope.trackLogHintsPositiveFeedback = (hintId) -> trackLogHintsFeedback true, hintId
-		$scope.trackLogHintsNegativeFeedback = (hintId) -> trackLogHintsFeedback false, hintId
-
 		if ace.require("ace/lib/useragent").isMac
 		if ace.require("ace/lib/useragent").isMac
 			$scope.modifierKey = "Cmd"
 			$scope.modifierKey = "Cmd"
 		else
 		else
@@ -69,9 +55,9 @@ define [
 			if qs_args.length then "?" + qs_args.join("&") else ""
 			if qs_args.length then "?" + qs_args.join("&") else ""
 
 
 		$scope.stripHTMLFromString = (htmlStr) ->
 		$scope.stripHTMLFromString = (htmlStr) ->
-   			tmp = document.createElement("DIV")
-   			tmp.innerHTML = htmlStr
-   			return tmp.textContent || tmp.innerText || ""
+			tmp = document.createElement("DIV")
+			tmp.innerHTML = htmlStr
+			return tmp.textContent || tmp.innerText || ""
 
 
 		$scope.$on "project:joined", () ->
 		$scope.$on "project:joined", () ->
 			return if !autoCompile
 			return if !autoCompile

+ 0 - 58
services/web/public/coffee/services/log-hints-feedback.coffee

@@ -1,58 +0,0 @@
-define [
-	"base"
-], (App) ->
-	App.factory "logHintsFeedback", ($http, $q) ->
-		hintsFeedbackFormAPIHash = "rl4xgvr1v5t64a"
-		idStampVal = "OPkEWEFHUFAm7hKlraQMhiOXQabafWo8NipRvLT397w="
-		hintFieldAPIId = "3"
-		reasonFieldAPIId = "1"
-		reasonOtherFieldAPIId = "1_other_other"
-		submitEndpoint = "https://sharelatex.wufoo.eu/forms/#{ hintsFeedbackFormAPIHash }/#public"
-
-		feedbackOpts =
-			DIDNT_UNDERSTAND: "didnt_understand"
-			NOT_APPLICABLE: "not_applicable"
-			INCORRECT: "incorrect"
-			OTHER: "other"
-
-		createRequest = (hintId, feedbackOpt, feedbackOtherVal = "") ->
-			formData = new FormData()
-
-			formData.append "Field#{ hintFieldAPIId }", hintId
-			formData.append "Field#{ reasonFieldAPIId }", feedbackOpt
-			formData.append "idstamp", idStampVal
-
-			# Allow user to specify "other" without any extra details; an empty string 
-			# would trigger an error submitting.
-			if feedbackOpt == feedbackOpts.OTHER and feedbackOtherVal == ""
-				formData.append "Field#{ reasonOtherFieldAPIId }", "#{ feedbackOpts.OTHER } empty"
-			else
-				formData.append "Field#{ reasonOtherFieldAPIId }", feedbackOtherVal
-
-			req =
-				method: 'POST'
-				url: submitEndpoint
-				# This will effectively disable Angular's default serialization mechanisms,
-				# forcing the XHR to be done with whatever data we provide (in this case,
-				# form data). Without this, Angular will forcefully try to serialize data
-				# to JSON.
-				transformRequest: angular.identity
-				data: formData
-				headers : 
-					# This will tell Angular to use the browser-provided value, which is
-					# computed according to the data being sent (in this case, multipart
-					# form + browser-specific multipart boundary). Without this, Angular
-					# will set JSON.
-					"Content-Type": undefined
-
-			return req
-
-		submitFeedback = (hintId, feedbackOpt, feedbackOtherVal = "") ->
-			submitRequest = createRequest hintId, feedbackOpt, feedbackOtherVal
-			$http(submitRequest)
-
-		service =
-			feedbackOpts: feedbackOpts
-			submitFeedback: submitFeedback
-		
-		return service

+ 10 - 10
services/web/public/stylesheets/app/editor/pdf.less

@@ -305,25 +305,25 @@
 		line-height: 1.3;
 		line-height: 1.3;
 		padding: 0 2px;
 		padding: 0 2px;
 	}
 	}
-	
+
 	.synctex-control-goto-pdf > .synctex-control-icon when (@is-overleaf = true) {
 	.synctex-control-goto-pdf > .synctex-control-icon when (@is-overleaf = true) {
 		text-indent: 1px; // "Optical" adjustment.
 		text-indent: 1px; // "Optical" adjustment.
 		&::before {
 		&::before {
-			content: "\f061";		
+			content: "\f061";
 		}
 		}
 	}
 	}
 	.synctex-control-goto-code > .synctex-control-icon when (@is-overleaf = true) {
 	.synctex-control-goto-code > .synctex-control-icon when (@is-overleaf = true) {
 		text-indent: -1px; // "Optical" adjustment.
 		text-indent: -1px; // "Optical" adjustment.
 		&::before {
 		&::before {
-			content: "\f060";		
+			content: "\f060";
 		}
 		}
 	}
 	}
-	
+
 	.synctex-control-goto-pdf > .synctex-control-icon::before when (@is-overleaf = false) {
 	.synctex-control-goto-pdf > .synctex-control-icon::before when (@is-overleaf = false) {
-		content: "\f178";		
+		content: "\f178";
 	}
 	}
 	.synctex-control-goto-code > .synctex-control-icon::before when (@is-overleaf = false) {
 	.synctex-control-goto-code > .synctex-control-icon::before when (@is-overleaf = false) {
-		content: "\f177";		
+		content: "\f177";
 	}
 	}
 
 
 .editor-dark {
 .editor-dark {
@@ -401,7 +401,7 @@
 
 
 	}
 	}
 
 
-	&-text, 
+	&-text,
 	&-feedback-label {
 	&-feedback-label {
 		color: @log-hints-color;
 		color: @log-hints-color;
 		font-size: 0.9rem;
 		font-size: 0.9rem;
@@ -424,8 +424,8 @@
 		display: inline-block;
 		display: inline-block;
 		font-size: 0.8rem;
 		font-size: 0.8rem;
 	}
 	}
-	
-	&-actions a,
+
+	&-footer a,
 	&-text a {
 	&-text a {
 		.alert-danger & {
 		.alert-danger & {
 			color: @state-danger-text;
 			color: @state-danger-text;
@@ -492,7 +492,7 @@
 .plv-text-layer {
 .plv-text-layer {
 	display: none;
 	display: none;
 	user-select: text;
 	user-select: text;
-	
+
 	.pdf-page-container:hover &,
 	.pdf-page-container:hover &,
 	.pdfjs-viewer-show-text & {
 	.pdfjs-viewer-show-text & {
 		display: block;
 		display: block;