소스 검색

HUE-7227 [frontend] Log usage of popular values in the autocomplete

Johan Ahlen 8 년 전
부모
커밋
76e17c7
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  1. 5 2
      desktop/core/src/desktop/templates/hue_ace_autocompleter.mako

+ 5 - 2
desktop/core/src/desktop/templates/hue_ace_autocompleter.mako

@@ -505,8 +505,11 @@ from desktop.views import _ko
           }
           return;
         }
-        var valueToInsert = self.suggestions.filtered()[self.selectedIndex()].value;
-
+        var selectedSuggestion = self.suggestions.filtered()[self.selectedIndex()];
+        var valueToInsert = selectedSuggestion.value;
+        if (selectedSuggestion.popular() && selectedSuggestion.category) {
+          hueAnalytics.convert('editor', 'popularAutocomplete/' + self.suggestions.filtered()[self.selectedIndex()].category.id)
+        }
         // Not always the case as we also match in comments
         if (valueToInsert.toLowerCase() === self.suggestions.filter().toLowerCase()) {
           // Close the autocompleter when the user has typed a complete suggestion