diff --git a/src/angular/components/export.component.ts b/src/angular/components/export.component.ts index f85d4ef018..f7d3a0d31d 100644 --- a/src/angular/components/export.component.ts +++ b/src/angular/components/export.component.ts @@ -4,9 +4,11 @@ import { } from '@angular/core'; import { CryptoService } from '../../abstractions/crypto.service'; +import { EventService } from '../../abstractions/event.service'; import { ExportService } from '../../abstractions/export.service'; import { I18nService } from '../../abstractions/i18n.service'; import { PlatformUtilsService } from '../../abstractions/platformUtils.service'; +import { EventType } from '../../enums/eventType'; export class ExportComponent { @Output() onSaved = new EventEmitter(); @@ -18,7 +20,7 @@ export class ExportComponent { constructor(protected cryptoService: CryptoService, protected i18nService: I18nService, protected platformUtilsService: PlatformUtilsService, protected exportService: ExportService, - protected win: Window) { } + protected eventService: EventService, protected win: Window) { } async submit() { if (this.masterPassword == null || this.masterPassword === '') { @@ -36,6 +38,7 @@ export class ExportComponent { this.platformUtilsService.eventTrack('Exported Data'); this.downloadFile(data); this.saved(); + await this.collectEvent(); } catch { } } else { this.platformUtilsService.showToast('error', this.i18nService.t('errorOccurred'), @@ -61,6 +64,10 @@ export class ExportComponent { return this.exportService.getFileName(prefix, this.format); } + protected async collectEvent(): Promise { + await this.eventService.collect(EventType.User_ClientExportedVault); + } + private downloadFile(csv: string): void { const fileName = this.getFileName(); this.platformUtilsService.saveFile(this.win, csv, { type: 'text/plain' }, fileName); diff --git a/src/enums/eventType.ts b/src/enums/eventType.ts index f133148742..3df5b693b7 100644 --- a/src/enums/eventType.ts +++ b/src/enums/eventType.ts @@ -40,4 +40,5 @@ export enum EventType { Organization_Updated = 1600, Organization_PurgedVault = 1601, + Organization_ClientExportedVault = 1602, }