From f0e3e3b6f9f8582a9719c97b22e9fe2a19a87305 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 12 Jul 2019 10:41:18 -0400 Subject: [PATCH] client events for edit page --- jslib | 2 +- src/app/vault/add-edit.component.html | 3 ++- src/app/vault/add-edit.component.ts | 16 ++++++++++++++-- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/jslib b/jslib index 21e3026f04..803dec26e7 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 21e3026f048d4d834be9a53b1ecf31e890dcfaac +Subproject commit 803dec26e7dbc1a31906349e7b2c9ddd67ef6c8a diff --git a/src/app/vault/add-edit.component.html b/src/app/vault/add-edit.component.html index 2235930528..110577022e 100644 --- a/src/app/vault/add-edit.component.html +++ b/src/app/vault/add-edit.component.html @@ -401,7 +401,8 @@ diff --git a/src/app/vault/add-edit.component.ts b/src/app/vault/add-edit.component.ts index 2cd04ec2fa..b5348f47d4 100644 --- a/src/app/vault/add-edit.component.ts +++ b/src/app/vault/add-edit.component.ts @@ -1,10 +1,12 @@ import { Component } from '@angular/core'; import { CipherType } from 'jslib/enums/cipherType'; +import { EventType } from 'jslib/enums/eventType'; import { AuditService } from 'jslib/abstractions/audit.service'; import { CipherService } from 'jslib/abstractions/cipher.service'; import { CollectionService } from 'jslib/abstractions/collection.service'; +import { EventService } from 'jslib/abstractions/event.service'; import { FolderService } from 'jslib/abstractions/folder.service'; import { I18nService } from 'jslib/abstractions/i18n.service'; import { MessagingService } from 'jslib/abstractions/messaging.service'; @@ -39,9 +41,9 @@ export class AddEditComponent extends BaseAddEditComponent { auditService: AuditService, stateService: StateService, userService: UserService, collectionService: CollectionService, protected totpService: TotpService, protected passwordGenerationService: PasswordGenerationService, - protected messagingService: MessagingService) { + protected messagingService: MessagingService, eventService: EventService) { super(cipherService, folderService, i18nService, platformUtilsService, auditService, stateService, - userService, collectionService, messagingService); + userService, collectionService, messagingService, eventService); } async ngOnInit() { @@ -86,6 +88,16 @@ export class AddEditComponent extends BaseAddEditComponent { this.platformUtilsService.copyToClipboard(value, { window: window }); this.platformUtilsService.showToast('info', null, this.i18nService.t('valueCopied', this.i18nService.t(typeI18nKey))); + + if (this.editMode) { + if (typeI18nKey === 'password') { + this.eventService.collect(EventType.Cipher_ClientToggledHiddenFieldVisible, this.cipherId); + } else if (typeI18nKey === 'securityCode') { + this.eventService.collect(EventType.Cipher_ClientCopiedCardCode, this.cipherId); + } else if (aType === 'H_Field') { + this.eventService.collect(EventType.Cipher_ClientCopiedHiddenField, this.cipherId); + } + } } async generatePassword(): Promise {