From 525de3bfd24cb508dab94ea9e91dcea4f13b7bd8 Mon Sep 17 00:00:00 2001 From: aj-rosado <109146700+aj-rosado@users.noreply.github.com> Date: Thu, 27 Apr 2023 16:46:48 +0100 Subject: [PATCH] [PM-730] Corrected EventType when copying password (#5229) * [PM-730] Corrected EventType when copying password * [PM-730] Corrected copy password and totp events --- .../vault/popup/components/action-buttons.component.ts | 9 ++++----- .../src/app/vault/individual-vault/add-edit.component.ts | 5 +---- .../src/app/vault/individual-vault/vault.component.ts | 9 ++++----- apps/web/src/app/vault/org-vault/vault.component.ts | 9 ++++----- libs/angular/src/vault/components/view.component.ts | 5 +---- 5 files changed, 14 insertions(+), 23 deletions(-) diff --git a/apps/browser/src/vault/popup/components/action-buttons.component.ts b/apps/browser/src/vault/popup/components/action-buttons.component.ts index b587210ca9a..fb6f7d78110 100644 --- a/apps/browser/src/vault/popup/components/action-buttons.component.ts +++ b/apps/browser/src/vault/popup/components/action-buttons.component.ts @@ -67,11 +67,10 @@ export class ActionButtonsComponent { this.i18nService.t("valueCopied", this.i18nService.t(typeI18nKey)) ); - if (typeI18nKey === "password" || typeI18nKey === "verificationCodeTotp") { - this.eventCollectionService.collect( - EventType.Cipher_ClientToggledHiddenFieldVisible, - cipher.id - ); + if (typeI18nKey === "password") { + this.eventCollectionService.collect(EventType.Cipher_ClientCopiedPassword, cipher.id); + } else if (typeI18nKey === "verificationCodeTotp") { + this.eventCollectionService.collect(EventType.Cipher_ClientCopiedHiddenField, cipher.id); } else if (typeI18nKey === "securityCode") { this.eventCollectionService.collect(EventType.Cipher_ClientCopiedCardCode, cipher.id); } diff --git a/apps/web/src/app/vault/individual-vault/add-edit.component.ts b/apps/web/src/app/vault/individual-vault/add-edit.component.ts index a9cb2e20ba9..b938a8948f8 100644 --- a/apps/web/src/app/vault/individual-vault/add-edit.component.ts +++ b/apps/web/src/app/vault/individual-vault/add-edit.component.ts @@ -150,10 +150,7 @@ export class AddEditComponent extends BaseAddEditComponent implements OnInit, On if (this.editMode) { if (typeI18nKey === "password") { - this.eventCollectionService.collect( - EventType.Cipher_ClientToggledHiddenFieldVisible, - this.cipherId - ); + this.eventCollectionService.collect(EventType.Cipher_ClientCopiedPassword, this.cipherId); } else if (typeI18nKey === "securityCode") { this.eventCollectionService.collect(EventType.Cipher_ClientCopiedCardCode, this.cipherId); } else if (aType === "H_Field") { diff --git a/apps/web/src/app/vault/individual-vault/vault.component.ts b/apps/web/src/app/vault/individual-vault/vault.component.ts index c7794180099..9446344cf96 100644 --- a/apps/web/src/app/vault/individual-vault/vault.component.ts +++ b/apps/web/src/app/vault/individual-vault/vault.component.ts @@ -813,11 +813,10 @@ export class VaultComponent implements OnInit, OnDestroy { this.i18nService.t("valueCopied", this.i18nService.t(typeI18nKey)) ); - if (field === "password" || field === "totp") { - this.eventCollectionService.collect( - EventType.Cipher_ClientToggledHiddenFieldVisible, - cipher.id - ); + if (field === "password") { + this.eventCollectionService.collect(EventType.Cipher_ClientCopiedPassword, cipher.id); + } else if (field === "totp") { + this.eventCollectionService.collect(EventType.Cipher_ClientCopiedHiddenField, cipher.id); } } diff --git a/apps/web/src/app/vault/org-vault/vault.component.ts b/apps/web/src/app/vault/org-vault/vault.component.ts index fce2097a581..5db6d25f874 100644 --- a/apps/web/src/app/vault/org-vault/vault.component.ts +++ b/apps/web/src/app/vault/org-vault/vault.component.ts @@ -857,11 +857,10 @@ export class VaultComponent implements OnInit, OnDestroy { this.i18nService.t("valueCopied", this.i18nService.t(typeI18nKey)) ); - if (field === "password" || field === "totp") { - this.eventCollectionService.collect( - EventType.Cipher_ClientToggledHiddenFieldVisible, - cipher.id - ); + if (field === "password") { + this.eventCollectionService.collect(EventType.Cipher_ClientCopiedPassword, cipher.id); + } else if (field === "totp") { + this.eventCollectionService.collect(EventType.Cipher_ClientCopiedHiddenField, cipher.id); } } diff --git a/libs/angular/src/vault/components/view.component.ts b/libs/angular/src/vault/components/view.component.ts index df5241e5495..093d0f40ff1 100644 --- a/libs/angular/src/vault/components/view.component.ts +++ b/libs/angular/src/vault/components/view.component.ts @@ -336,10 +336,7 @@ export class ViewComponent implements OnDestroy, OnInit { ); if (typeI18nKey === "password") { - this.eventCollectionService.collect( - EventType.Cipher_ClientToggledHiddenFieldVisible, - this.cipherId - ); + this.eventCollectionService.collect(EventType.Cipher_ClientCopiedPassword, this.cipherId); } else if (typeI18nKey === "securityCode") { this.eventCollectionService.collect(EventType.Cipher_ClientCopiedCardCode, this.cipherId); } else if (aType === "H_Field") {