From 32b57f228c805ce844bcce2789d9f23907771796 Mon Sep 17 00:00:00 2001 From: Paulo Reis Date: Mon, 25 Jul 2016 16:12:56 +0100 Subject: [PATCH] Integrate feedback UI with wufoo service. --- services/web/app/views/project/editor/pdf.jade | 12 ++++++------ .../coffee/ide/pdf/controllers/PdfController.coffee | 8 +++++++- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/services/web/app/views/project/editor/pdf.jade b/services/web/app/views/project/editor/pdf.jade index 8c9c0f434c..6ae20fde55 100644 --- a/services/web/app/views/project/editor/pdf.jade +++ b/services/web/app/views/project/editor/pdf.jade @@ -108,7 +108,7 @@ div.full-size.pdf(ng-controller="PdfController") 'alert-info': entry.level == 'typesetting'\ }" ng-click="openInEditor(entry)" - ng-init="feedbackSent = false; showNegFeedbackUI = false; negFeedbackReason = '';" + ng-init="feedbackSent = false; showNegFeedbackUI = false; negFeedbackReason = ''; negFeedbackReasonFreeText = ''" ) span.line-no i.fa.fa-link(aria-hidden="true") @@ -154,32 +154,32 @@ div.full-size.pdf(ng-controller="PdfController") input( type="radio" ng-model="negFeedbackReason" - value="didnt_understand" + value="{{ logHintsNegFeedbackValues.DIDNT_UNDERSTAND }}" ) | I didn’t understand the hint .radio: label input( type="radio" ng-model="negFeedbackReason" - value="not_applicable" + value="{{ logHintsNegFeedbackValues.NOT_APPLICABLE }}" ) | I can’t apply this solution to my document .radio: label input( type="radio" ng-model="negFeedbackReason" - value="incorrect" + value="{{ logHintsNegFeedbackValues.INCORRECT }}" ) | This doesn’t fix the error .radio: label input( type="radio" ng-model="negFeedbackReason" - value="other" + value="{{ logHintsNegFeedbackValues.OTHER }}" ) | Other: textarea.form-control( - ng-show="negFeedbackReason === 'other'" + ng-show="negFeedbackReason === logHintsNegFeedbackValues.OTHER" rows="2" ) .clearfix diff --git a/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee b/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee index 57b06b3bb1..eb549c983d 100644 --- a/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee +++ b/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee @@ -3,8 +3,9 @@ define [ "ace/ace" "ide/human-readable-logs/HumanReadableLogs" "libs/bib-log-parser" + "services/log-hints-feedback" ], (App, Ace, HumanReadableLogs, BibLogParser) -> - App.controller "PdfController", ($scope, $http, ide, $modal, synctex, event_tracking, localStorage) -> + App.controller "PdfController", ($scope, $http, ide, $modal, synctex, event_tracking, logHintsFeedback, localStorage) -> # enable per-user containers by default perUserCompile = true @@ -32,6 +33,8 @@ define [ $scope.shouldDropUp = getFilesDropdownTopCoordAsRatio() > 0.65 # log hints tracking + $scope.logHintsNegFeedbackValues = logHintsFeedback.feedbackOpts + $scope.trackLogHintsLearnMore = () -> event_tracking.sendCountly "logs-hints-learn-more" @@ -39,6 +42,9 @@ define [ event_tracking.send "log-hints", (if isPositive then "feedback-positive" else "feedback-negative"), hintId event_tracking.sendCountly (if isPositive then "log-hints-feedback-positive" else "log-hints-feedback-negative"), { hintId } + trackLogHintsNegFeedbackDetails = (hintId, feedbackOpt, feedbackOtherVal) + logHintsFeedback.submitFeedback + $scope.trackLogHintsPositiveFeedback = (hintId) -> trackLogHintsFeedback true, hintId $scope.trackLogHintsNegativeFeedback = (hintId) -> trackLogHintsFeedback false, hintId