Add some telemetry to know how often the buttons in the secondary toolbar are used (bug 1789883)

This commit is contained in:
Calixte Denizet 2022-09-08 19:23:41 +02:00
parent b0a021d2cc
commit 05e4aed787
2 changed files with 12 additions and 2 deletions

View file

@ -51,7 +51,7 @@ class SecondaryToolbar {
* @param {SecondaryToolbarOptions} options
* @param {EventBus} eventBus
*/
constructor(options, eventBus) {
constructor(options, eventBus, externalServices) {
this.toolbar = options.toolbar;
this.toggleButton = options.toggleButton;
this.buttons = [
@ -150,6 +150,7 @@ class SecondaryToolbar {
};
this.eventBus = eventBus;
this.externalServices = externalServices;
this.opened = false;
// Bind the event listeners for click, cursor tool, and scroll/spread mode
@ -212,6 +213,10 @@ class SecondaryToolbar {
if (close) {
this.close();
}
this.externalServices.reportTelemetry({
type: "buttons",
data: { id: element.id },
});
});
}
}