commit | c8df760429b802e1fefc00731299e87634050409 | [log] [tgz] |
---|---|---|
author | Dhruv Srivastava <dhruvsri@google.com> | Fri Jan 15 10:59:00 2021 +0100 |
committer | Dhruv Srivastava <dhruvsri@google.com> | Fri Jan 15 11:25:02 2021 +0100 |
tree | d78e8a80222b0cf41200447b4b8b6ef277208cc1 | |
parent | 5c4ed226e48a3be5ed578095e2cffe2634e66c8f [diff] |
Add tracking when user navigates to original comment Ported comments have a link to navigate to the original comment. Track how many times users click on this message. Change-Id: I5c0d73acc37861416f85c45785c14eddc5ad8169
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 >