Merge "Add tracking when user navigates to original comment"
diff --git a/polygerrit-ui/app/elements/shared/gr-comment/gr-comment.ts b/polygerrit-ui/app/elements/shared/gr-comment/gr-comment.ts
index 3dd851e..644b0ae 100644
--- a/polygerrit-ui/app/elements/shared/gr-comment/gr-comment.ts
+++ b/polygerrit-ui/app/elements/shared/gr-comment/gr-comment.ts
@@ -312,6 +312,14 @@
     );
   }
 
+  _handlePortedMessageClick() {
+    if (!this.comment) throw new Error('comment not set');
+    this.reporting.reportInteraction('navigate-to-original-comment', {
+      line: this.comment.line,
+      range: this.comment.range,
+    });
+  }
+
   @observe('editing')
   _onEditingChange(editing?: boolean) {
     this.dispatchEvent(
diff --git a/polygerrit-ui/app/elements/shared/gr-comment/gr-comment_html.ts b/polygerrit-ui/app/elements/shared/gr-comment/gr-comment_html.ts
index fbf7f47..02fce5b 100644
--- a/polygerrit-ui/app/elements/shared/gr-comment/gr-comment_html.ts
+++ b/polygerrit-ui/app/elements/shared/gr-comment/gr-comment_html.ts
@@ -265,7 +265,7 @@
         </template>
         <template is="dom-if" if="[[showPortedComment]]">
           <a href="[[_getUrlForComment(comment)]]"
-            ><span class="portedMessage"
+            ><span class="portedMessage" on-click="_handlePortedMessageClick"
               >Ported from patchset [[comment.patch_set]]</span
             ></a
           >