Merge "New change summary - metrics"

This commit is contained in:
Milutin Kristofic
2021-02-26 10:24:22 +00:00
committed by Gerrit Code Review
6 changed files with 33 additions and 1 deletions

View File

@@ -210,6 +210,8 @@ export class GrChangeMetadata extends GestureEventListeners(
restApiService = appContext.restApiService;
private readonly reporting = appContext.reportingService;
/** @override */
ready() {
super.ready();
@@ -567,6 +569,10 @@ export class GrChangeMetadata extends GestureEventListeners(
_onShowAllClick() {
this._showAllSections = !this._showAllSections;
this.reporting.reportInteraction('toggle show all button', {
sectionName: 'metadata',
toState: this._showAllSections ? 'Show all' : 'Show less',
});
}
/**

View File

@@ -94,6 +94,8 @@ class GrChangeRequirements extends GestureEventListeners(
KnownExperimentId.NEW_CHANGE_SUMMARY_UI
);
private readonly reporting = appContext.reportingService;
_computeShowWip(change: ChangeInfo) {
return change.work_in_progress;
}
@@ -193,6 +195,10 @@ class GrChangeRequirements extends GestureEventListeners(
_handleShowHide() {
this._showOptionalLabels = !this._showOptionalLabels;
this.reporting.reportInteraction('toggle show all button', {
sectionName: 'optional labels',
toState: this._showOptionalLabels ? 'Show all' : 'Show less',
});
}
_computeSubmitRequirementEndpoint(item: ChangeRequirement | ChangeWIP) {

View File

@@ -77,6 +77,8 @@ export class GrSummaryChip extends GrLitElement {
@property()
category?: CommentTabState;
private readonly reporting = appContext.reportingService;
static get styles() {
return [
sharedStyles,
@@ -131,6 +133,9 @@ export class GrSummaryChip extends GrLitElement {
private handleClick(e: MouseEvent) {
e.stopPropagation();
e.preventDefault();
this.reporting.reportInteraction('comment chip click', {
category: this.category,
});
fireShowPrimaryTab(this, PrimaryTab.COMMENT_THREADS, true, {
commentTab: this.category,
});

View File

@@ -825,8 +825,11 @@ export class GrChangeView extends KeyboardShortcutMixin(
paperTabs.scrollIntoView();
}
if (paperTabs.selected !== activeIndex) {
// paperTabs.selected is undefined during rendering
if (paperTabs.selected !== undefined) {
this.reporting.reportInteraction('show-tab', {tabName});
}
paperTabs.selected = activeIndex;
this.reporting.reportInteraction('show-tab', {tabName});
}
return tabName;
}

View File

@@ -429,6 +429,8 @@ export class GrRelatedCollapse extends GrLitElement {
@property()
length = 0;
private readonly reporting = appContext.reportingService;
static get styles() {
return [
sharedStyles,
@@ -509,6 +511,10 @@ export class GrRelatedCollapse extends GrLitElement {
private toggle(e: MouseEvent) {
e.stopPropagation();
this.showAll = !this.showAll;
this.reporting.reportInteraction('toggle show all button', {
sectionName: this.title,
toState: this.showAll ? 'Show all' : 'Show less',
});
}
}

View File

@@ -120,6 +120,8 @@ export class GrEditableContent extends GestureEventListeners(
private readonly flagsService = appContext.flagsService;
private readonly reporting = appContext.reportingService;
/** @override */
ready() {
super.ready();
@@ -238,6 +240,10 @@ export class GrEditableContent extends GestureEventListeners(
_toggleCommitCollapsed() {
this._commitCollapsed = !this._commitCollapsed;
this.reporting.reportInteraction('toggle show all button', {
sectionName: 'Commit message',
toState: !this._commitCollapsed ? 'Show all' : 'Show less',
});
if (this._commitCollapsed) {
window.scrollTo(0, 0);
}