Integrate feedback UI with wufoo service.

This commit is contained in:
Paulo Reis 2016-07-25 16:12:56 +01:00
parent c083b42487
commit 32b57f228c
2 changed files with 13 additions and 7 deletions

View file

@ -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 didnt understand the hint
.radio: label
input(
type="radio"
ng-model="negFeedbackReason"
value="not_applicable"
value="{{ logHintsNegFeedbackValues.NOT_APPLICABLE }}"
)
| I cant apply this solution to my document
.radio: label
input(
type="radio"
ng-model="negFeedbackReason"
value="incorrect"
value="{{ logHintsNegFeedbackValues.INCORRECT }}"
)
| This doesnt 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

View file

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