mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-23 08:38:06 +02:00
[Editor] Add some telemetry for the signature editor (bug 1945827)
This commit is contained in:
parent
fef706233d
commit
9e672ff05e
4 changed files with 100 additions and 16 deletions
|
@ -111,6 +111,22 @@ class SignatureEditor extends DrawingEditor {
|
|||
return false;
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
get telemetryFinalData() {
|
||||
return {
|
||||
type: "signature",
|
||||
hasDescription: !!this.#description,
|
||||
};
|
||||
}
|
||||
|
||||
static computeTelemetryFinalData(data) {
|
||||
const hasDescriptionStats = data.get("hasDescription");
|
||||
return {
|
||||
hasAltText: hasDescriptionStats.get(true) ?? 0,
|
||||
hasNoAltText: hasDescriptionStats.get(false) ?? 0,
|
||||
};
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
get isResizable() {
|
||||
return true;
|
||||
|
@ -279,6 +295,14 @@ class SignatureEditor extends DrawingEditor {
|
|||
this._uiManager.addToAnnotationStorage(this);
|
||||
this.setUuid(uuid);
|
||||
|
||||
this._reportTelemetry({
|
||||
action: "pdfjs.signature.inserted",
|
||||
data: {
|
||||
hasBeenSaved: !!uuid,
|
||||
hasDescription: !!description,
|
||||
},
|
||||
});
|
||||
|
||||
this.div.hidden = false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue