From a9ef011cf38532d17766f1e997ffe3700b1e7db9 Mon Sep 17 00:00:00 2001 From: Oscar Hinton Date: Wed, 14 Apr 2021 23:43:40 +0200 Subject: [PATCH] Remove dead code (#930) * Remove last remnants of old analytics code --- jslib | 2 +- package-lock.json | 5 ----- package.json | 1 - src/app/accounts/recover-delete.component.ts | 5 +---- src/app/accounts/recover-two-factor.component.ts | 7 ++----- .../accounts/verify-recover-delete.component.ts | 6 ++---- src/app/app.component.ts | 14 ++------------ src/app/app.module.ts | 7 ------- .../manage/collection-add-edit.component.ts | 8 ++------ .../manage/collections.component.ts | 8 +++----- .../manage/entity-users.component.ts | 6 +----- .../manage/group-add-edit.component.ts | 7 ++----- src/app/organizations/manage/groups.component.ts | 8 +++----- src/app/organizations/manage/people.component.ts | 9 ++------- .../manage/policy-edit.component.ts | 4 +--- .../manage/user-add-edit.component.ts | 7 ++----- .../manage/user-groups.component.ts | 4 +--- .../organizations/settings/account.component.ts | 8 ++------ .../settings/adjust-seats.component.ts | 6 ++---- .../settings/change-plan.component.ts | 1 - .../settings/delete-organization.component.ts | 6 ++---- .../settings/download-license.component.ts | 1 - .../settings/organization-billing.component.ts | 6 ++---- .../organization-subscription.component.ts | 8 ++------ src/app/organizations/tools/import.component.ts | 8 +++----- src/app/organizations/vault/ciphers.component.ts | 8 +++----- src/app/settings/add-credit.component.ts | 7 ------- src/app/settings/adjust-payment.component.ts | 6 +----- src/app/settings/adjust-storage.component.ts | 6 ++---- src/app/settings/api-key.component.ts | 6 ++---- src/app/settings/change-email.component.ts | 7 ++----- src/app/settings/change-kdf.component.ts | 7 ++----- .../settings/deauthorize-sessions.component.ts | 6 ++---- src/app/settings/delete-account.component.ts | 6 ++---- src/app/settings/domain-rules.component.ts | 4 +--- src/app/settings/options.component.ts | 8 +++----- src/app/settings/organization-plans.component.ts | 8 ++------ src/app/settings/organizations.component.ts | 7 ++----- src/app/settings/premium.component.ts | 10 ++++------ src/app/settings/profile.component.ts | 6 ++---- src/app/settings/purge-vault.component.ts | 8 ++------ .../two-factor-authenticator.component.ts | 7 +++---- src/app/settings/two-factor-base.component.ts | 10 +--------- src/app/settings/two-factor-duo.component.ts | 6 ++---- src/app/settings/two-factor-email.component.ts | 7 +++---- .../settings/two-factor-webauthn.component.ts | 7 +++---- src/app/settings/two-factor-yubikey.component.ts | 6 ++---- src/app/settings/update-key.component.ts | 9 +++------ src/app/settings/update-license.component.ts | 4 +--- src/app/settings/user-billing.component.ts | 5 +---- src/app/settings/user-subscription.component.ts | 6 +----- src/app/settings/verify-email.component.ts | 4 +--- src/app/tools/import.component.ts | 16 +++------------- src/app/vault/add-edit.component.ts | 2 -- src/app/vault/bulk-delete.component.ts | 7 ++----- src/app/vault/bulk-move.component.ts | 7 ++----- src/app/vault/bulk-restore.component.ts | 6 ++---- src/app/vault/bulk-share.component.ts | 8 +++----- src/app/vault/ciphers.component.ts | 13 ++++--------- src/services/webPlatformUtils.service.ts | 14 -------------- 60 files changed, 107 insertions(+), 299 deletions(-) diff --git a/jslib b/jslib index 0a0cdaa7..92df6330 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 0a0cdaa7fdfb7322c73258b270105c8fb6552b99 +Subproject commit 92df63304029049891a46d575612222fb9b6c325 diff --git a/package-lock.json b/package-lock.json index 2079adf0..2fbb3ae5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -890,11 +890,6 @@ "resolved": "https://registry.npmjs.org/angular2-toaster/-/angular2-toaster-8.0.0.tgz", "integrity": "sha512-MRDswCmhqFLBiot7C7SIq96NyU5aT9pwIVdYgmYJtXHp7N6fXk6QzuMSMhVvK12edUJntgmUft+SZfh45Oq0Wg==" }, - "angulartics2": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/angulartics2/-/angulartics2-9.1.0.tgz", - "integrity": "sha512-RAfHJSHyeRe834e5qCYLtp7fdFuKnz/myFTSVEUZV6nLp4cUotvX8XQhewUEpFv6gkrzJwcuY32JZxstDlNiXQ==" - }, "ansi-colors": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", diff --git a/package.json b/package.json index 09358f3a..bcd82133 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,6 @@ "@microsoft/signalr": "3.1.13", "@microsoft/signalr-protocol-msgpack": "3.1.13", "angular2-toaster": "8.0.0", - "angulartics2": "9.1.0", "big-integer": "1.6.48", "bootstrap": "4.3.1", "braintree-web-drop-in": "1.13.0", diff --git a/src/app/accounts/recover-delete.component.ts b/src/app/accounts/recover-delete.component.ts index c1f36160..a9835b09 100644 --- a/src/app/accounts/recover-delete.component.ts +++ b/src/app/accounts/recover-delete.component.ts @@ -2,7 +2,6 @@ import { Component } from '@angular/core'; import { Router } from '@angular/router'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { ApiService } from 'jslib/abstractions/api.service'; import { I18nService } from 'jslib/abstractions/i18n.service'; @@ -18,8 +17,7 @@ export class RecoverDeleteComponent { formPromise: Promise; constructor(private router: Router, private apiService: ApiService, - private analytics: Angulartics2, private toasterService: ToasterService, - private i18nService: I18nService) { + private toasterService: ToasterService, private i18nService: I18nService) { } async submit() { @@ -28,7 +26,6 @@ export class RecoverDeleteComponent { request.email = this.email.trim().toLowerCase(); this.formPromise = this.apiService.postAccountRecoverDelete(request); await this.formPromise; - this.analytics.eventTrack.next({ action: 'Started Delete Recovery' }); this.toasterService.popAsync('success', null, this.i18nService.t('deleteRecoverEmailSent')); this.router.navigate(['/']); } catch { } diff --git a/src/app/accounts/recover-two-factor.component.ts b/src/app/accounts/recover-two-factor.component.ts index 02f77d86..400e3d1c 100644 --- a/src/app/accounts/recover-two-factor.component.ts +++ b/src/app/accounts/recover-two-factor.component.ts @@ -2,7 +2,6 @@ import { Component } from '@angular/core'; import { Router } from '@angular/router'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { ApiService } from 'jslib/abstractions/api.service'; import { AuthService } from 'jslib/abstractions/auth.service'; @@ -22,9 +21,8 @@ export class RecoverTwoFactorComponent { formPromise: Promise; constructor(private router: Router, private apiService: ApiService, - private analytics: Angulartics2, private toasterService: ToasterService, - private i18nService: I18nService, private cryptoService: CryptoService, - private authService: AuthService) { } + private toasterService: ToasterService, private i18nService: I18nService, + private cryptoService: CryptoService, private authService: AuthService) { } async submit() { try { @@ -35,7 +33,6 @@ export class RecoverTwoFactorComponent { request.masterPasswordHash = await this.cryptoService.hashPassword(this.masterPassword, key); this.formPromise = this.apiService.postTwoFactorRecover(request); await this.formPromise; - this.analytics.eventTrack.next({ action: 'Recovered 2FA' }); this.toasterService.popAsync('success', null, this.i18nService.t('twoStepRecoverDisabled')); this.router.navigate(['/']); } catch { } diff --git a/src/app/accounts/verify-recover-delete.component.ts b/src/app/accounts/verify-recover-delete.component.ts index 9ee81c40..114701c1 100644 --- a/src/app/accounts/verify-recover-delete.component.ts +++ b/src/app/accounts/verify-recover-delete.component.ts @@ -8,7 +8,6 @@ import { } from '@angular/router'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { ApiService } from 'jslib/abstractions/api.service'; import { I18nService } from 'jslib/abstractions/i18n.service'; @@ -27,8 +26,8 @@ export class VerifyRecoverDeleteComponent implements OnInit { private token: string; constructor(private router: Router, private apiService: ApiService, - private analytics: Angulartics2, private toasterService: ToasterService, - private i18nService: I18nService, private route: ActivatedRoute) { + private toasterService: ToasterService, private i18nService: I18nService, + private route: ActivatedRoute) { } ngOnInit() { @@ -53,7 +52,6 @@ export class VerifyRecoverDeleteComponent implements OnInit { const request = new VerifyDeleteRecoverRequest(this.userId, this.token); this.formPromise = this.apiService.postAccountRecoverDeleteToken(request); await this.formPromise; - this.analytics.eventTrack.next({ action: 'Recovered Delete' }); this.toasterService.popAsync('success', this.i18nService.t('accountDeleted'), this.i18nService.t('accountDeletedDesc')); this.router.navigate(['/']); diff --git a/src/app/app.component.ts b/src/app/app.component.ts index df3edee0..9b11af23 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -5,11 +5,8 @@ import { BodyOutputType, Toast, ToasterConfig, - ToasterContainerComponent, ToasterService, } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; -import { Angulartics2GoogleAnalytics } from 'angulartics2/ga'; import { Component, @@ -70,12 +67,12 @@ export class AppComponent implements OnDestroy, OnInit { private idleTimer: number = null; private isIdle = false; - constructor(private angulartics2GoogleAnalytics: Angulartics2GoogleAnalytics, + constructor( private broadcasterService: BroadcasterService, private userService: UserService, private tokenService: TokenService, private folderService: FolderService, private settingsService: SettingsService, private syncService: SyncService, private passwordGenerationService: PasswordGenerationService, private cipherService: CipherService, - private authService: AuthService, private router: Router, private analytics: Angulartics2, + private authService: AuthService, private router: Router, private toasterService: ToasterService, private i18nService: I18nService, private platformUtilsService: PlatformUtilsService, private ngZone: NgZone, private vaultTimeoutService: VaultTimeoutService, private storageService: StorageService, @@ -151,12 +148,6 @@ export class AppComponent implements OnDestroy, OnInit { case 'showToast': this.showToast(message); break; - case 'analyticsEventTrack': - this.analytics.eventTrack.next({ - action: message.action, - properties: { label: message.label }, - }); - break; case 'setFullWidth': this.setFullWidth(); break; @@ -207,7 +198,6 @@ export class AppComponent implements OnDestroy, OnInit { this.searchService.clearIndex(); this.authService.logOut(async () => { - this.analytics.eventTrack.next({ action: 'Logged Out' }); if (expired) { this.toasterService.popAsync('warning', this.i18nService.t('loggedOut'), this.i18nService.t('loginExpired')); diff --git a/src/app/app.module.ts b/src/app/app.module.ts index df1b5420..2719d3f5 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,8 +1,6 @@ import 'core-js'; import { ToasterModule } from 'angular2-toaster'; -import { Angulartics2Module } from 'angulartics2'; -import { Angulartics2GoogleAnalytics } from 'angulartics2/ga'; import { InfiniteScrollModule } from 'ngx-infinite-scroll'; import { AppRoutingModule } from './app-routing.module'; @@ -256,11 +254,6 @@ registerLocaleData(localeZhTw, 'zh-TW'); FormsModule, AppRoutingModule, ServicesModule, - Angulartics2Module.forRoot({ - pageTracking: { - clearQueryParams: true, - }, - }), ToasterModule.forRoot(), InfiniteScrollModule, DragDropModule, diff --git a/src/app/organizations/manage/collection-add-edit.component.ts b/src/app/organizations/manage/collection-add-edit.component.ts index 3d185707..9fbec974 100644 --- a/src/app/organizations/manage/collection-add-edit.component.ts +++ b/src/app/organizations/manage/collection-add-edit.component.ts @@ -7,7 +7,6 @@ import { } from '@angular/core'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { ApiService } from 'jslib/abstractions/api.service'; import { CryptoService } from 'jslib/abstractions/crypto.service'; @@ -46,9 +45,8 @@ export class CollectionAddEditComponent implements OnInit { private orgKey: SymmetricCryptoKey; constructor(private apiService: ApiService, private i18nService: I18nService, - private analytics: Angulartics2, private toasterService: ToasterService, - private platformUtilsService: PlatformUtilsService, private cryptoService: CryptoService, - private userService: UserService) { } + private toasterService: ToasterService, private platformUtilsService: PlatformUtilsService, + private cryptoService: CryptoService, private userService: UserService) { } async ngOnInit() { const organization = await this.userService.getOrganization(this.organizationId); @@ -124,7 +122,6 @@ export class CollectionAddEditComponent implements OnInit { this.formPromise = this.apiService.postCollection(this.organizationId, request); } await this.formPromise; - this.analytics.eventTrack.next({ action: this.editMode ? 'Edited Collection' : 'Created Collection' }); this.toasterService.popAsync('success', null, this.i18nService.t(this.editMode ? 'editedCollectionId' : 'createdCollectionId', this.name)); this.onSavedCollection.emit(); @@ -146,7 +143,6 @@ export class CollectionAddEditComponent implements OnInit { try { this.deletePromise = this.apiService.deleteCollection(this.organizationId, this.collectionId); await this.deletePromise; - this.analytics.eventTrack.next({ action: 'Deleted Collection' }); this.toasterService.popAsync('success', null, this.i18nService.t('deletedCollectionId', this.name)); this.onDeletedCollection.emit(); } catch { } diff --git a/src/app/organizations/manage/collections.component.ts b/src/app/organizations/manage/collections.component.ts index 6c393004..83a1a955 100644 --- a/src/app/organizations/manage/collections.component.ts +++ b/src/app/organizations/manage/collections.component.ts @@ -8,7 +8,6 @@ import { import { ActivatedRoute } from '@angular/router'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { ApiService } from 'jslib/abstractions/api.service'; import { CollectionService } from 'jslib/abstractions/collection.service'; @@ -52,9 +51,9 @@ export class CollectionsComponent implements OnInit { constructor(private apiService: ApiService, private route: ActivatedRoute, private collectionService: CollectionService, private componentFactoryResolver: ComponentFactoryResolver, - private analytics: Angulartics2, private toasterService: ToasterService, - private i18nService: I18nService, private platformUtilsService: PlatformUtilsService, - private userService: UserService, private searchService: SearchService) { } + private toasterService: ToasterService, private i18nService: I18nService, + private platformUtilsService: PlatformUtilsService, private userService: UserService, + private searchService: SearchService) { } async ngOnInit() { this.route.parent.parent.params.subscribe(async params => { @@ -141,7 +140,6 @@ export class CollectionsComponent implements OnInit { try { await this.apiService.deleteCollection(this.organizationId, collection.id); - this.analytics.eventTrack.next({ action: 'Deleted Collection' }); this.toasterService.popAsync('success', null, this.i18nService.t('deletedCollectionId', collection.name)); this.removeCollection(collection); } catch { } diff --git a/src/app/organizations/manage/entity-users.component.ts b/src/app/organizations/manage/entity-users.component.ts index 1ec5fa85..f208d34e 100644 --- a/src/app/organizations/manage/entity-users.component.ts +++ b/src/app/organizations/manage/entity-users.component.ts @@ -7,7 +7,6 @@ import { } from '@angular/core'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { ApiService } from 'jslib/abstractions/api.service'; import { I18nService } from 'jslib/abstractions/i18n.service'; @@ -42,7 +41,7 @@ export class EntityUsersComponent implements OnInit { private allUsers: OrganizationUserUserDetailsResponse[] = []; constructor(private apiService: ApiService, private i18nService: I18nService, - private analytics: Angulartics2, private toasterService: ToasterService) { } + private toasterService: ToasterService) { } async ngOnInit() { await this.loadUsers(); @@ -129,9 +128,6 @@ export class EntityUsersComponent implements OnInit { this.formPromise = this.apiService.putCollectionUsers(this.organizationId, this.entityId, selections); } await this.formPromise; - this.analytics.eventTrack.next({ - action: this.entity === 'group' ? 'Edited Group Users' : 'Edited Collection Users', - }); this.toasterService.popAsync('success', null, this.i18nService.t('updatedUsers')); this.onEditedUsers.emit(); } catch { } diff --git a/src/app/organizations/manage/group-add-edit.component.ts b/src/app/organizations/manage/group-add-edit.component.ts index 0a8f2cf1..3850a27b 100644 --- a/src/app/organizations/manage/group-add-edit.component.ts +++ b/src/app/organizations/manage/group-add-edit.component.ts @@ -7,7 +7,6 @@ import { } from '@angular/core'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { ApiService } from 'jslib/abstractions/api.service'; import { CollectionService } from 'jslib/abstractions/collection.service'; @@ -42,8 +41,8 @@ export class GroupAddEditComponent implements OnInit { deletePromise: Promise; constructor(private apiService: ApiService, private i18nService: I18nService, - private analytics: Angulartics2, private toasterService: ToasterService, - private collectionService: CollectionService, private platformUtilsService: PlatformUtilsService) { } + private toasterService: ToasterService, private collectionService: CollectionService, + private platformUtilsService: PlatformUtilsService) { } async ngOnInit() { this.editMode = this.loading = this.groupId != null; @@ -110,7 +109,6 @@ export class GroupAddEditComponent implements OnInit { this.formPromise = this.apiService.postGroup(this.organizationId, request); } await this.formPromise; - this.analytics.eventTrack.next({ action: this.editMode ? 'Edited Group' : 'Created Group' }); this.toasterService.popAsync('success', null, this.i18nService.t(this.editMode ? 'editedGroupId' : 'createdGroupId', this.name)); this.onSavedGroup.emit(); @@ -132,7 +130,6 @@ export class GroupAddEditComponent implements OnInit { try { this.deletePromise = this.apiService.deleteGroup(this.organizationId, this.groupId); await this.deletePromise; - this.analytics.eventTrack.next({ action: 'Deleted Group' }); this.toasterService.popAsync('success', null, this.i18nService.t('deletedGroupId', this.name)); this.onDeletedGroup.emit(); } catch { } diff --git a/src/app/organizations/manage/groups.component.ts b/src/app/organizations/manage/groups.component.ts index c8b97ad8..e2f13ba8 100644 --- a/src/app/organizations/manage/groups.component.ts +++ b/src/app/organizations/manage/groups.component.ts @@ -11,7 +11,6 @@ import { } from '@angular/router'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { ApiService } from 'jslib/abstractions/api.service'; import { I18nService } from 'jslib/abstractions/i18n.service'; @@ -49,9 +48,9 @@ export class GroupsComponent implements OnInit { constructor(private apiService: ApiService, private route: ActivatedRoute, private i18nService: I18nService, private componentFactoryResolver: ComponentFactoryResolver, - private analytics: Angulartics2, private toasterService: ToasterService, - private platformUtilsService: PlatformUtilsService, private userService: UserService, - private router: Router, private searchService: SearchService) { } + private toasterService: ToasterService, private platformUtilsService: PlatformUtilsService, + private userService: UserService, private router: Router, + private searchService: SearchService) { } async ngOnInit() { this.route.parent.parent.params.subscribe(async params => { @@ -136,7 +135,6 @@ export class GroupsComponent implements OnInit { try { await this.apiService.deleteGroup(this.organizationId, group.id); - this.analytics.eventTrack.next({ action: 'Deleted Group' }); this.toasterService.popAsync('success', null, this.i18nService.t('deletedGroupId', group.name)); this.removeGroup(group); } catch { } diff --git a/src/app/organizations/manage/people.component.ts b/src/app/organizations/manage/people.component.ts index da52e128..2f6343f3 100644 --- a/src/app/organizations/manage/people.component.ts +++ b/src/app/organizations/manage/people.component.ts @@ -11,7 +11,6 @@ import { } from '@angular/router'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { ValidationService } from 'jslib/angular/services/validation.service'; import { ConstantsService } from 'jslib/services/constants.service'; @@ -71,9 +70,8 @@ export class PeopleComponent implements OnInit { constructor(private apiService: ApiService, private route: ActivatedRoute, private i18nService: I18nService, private componentFactoryResolver: ComponentFactoryResolver, - private platformUtilsService: PlatformUtilsService, private analytics: Angulartics2, - private toasterService: ToasterService, private cryptoService: CryptoService, - private userService: UserService, private router: Router, + private platformUtilsService: PlatformUtilsService, private toasterService: ToasterService, + private cryptoService: CryptoService, private userService: UserService, private router: Router, private storageService: StorageService, private searchService: SearchService, private validationService: ValidationService) { } @@ -233,7 +231,6 @@ export class PeopleComponent implements OnInit { try { await this.apiService.deleteOrganizationUser(this.organizationId, user.id); - this.analytics.eventTrack.next({ action: 'Deleted User' }); this.toasterService.popAsync('success', null, this.i18nService.t('removedUserId', user.name || user.email)); this.removeUser(user); } catch { } @@ -245,7 +242,6 @@ export class PeopleComponent implements OnInit { } this.actionPromise = this.apiService.postOrganizationUserReinvite(this.organizationId, user.id); await this.actionPromise; - this.analytics.eventTrack.next({ action: 'Reinvited User' }); this.toasterService.popAsync('success', null, this.i18nService.t('hasBeenReinvited', user.name || user.email)); this.actionPromise = null; } @@ -265,7 +261,6 @@ export class PeopleComponent implements OnInit { this.actionPromise = this.doConfirmation(user, publicKey); await this.actionPromise; updateUser(this); - this.analytics.eventTrack.next({ action: 'Confirmed User' }); this.toasterService.popAsync('success', null, this.i18nService.t('hasBeenConfirmed', user.name || user.email)); } catch (e) { this.validationService.showError(e); diff --git a/src/app/organizations/manage/policy-edit.component.ts b/src/app/organizations/manage/policy-edit.component.ts index fde034d7..62cdc9a1 100644 --- a/src/app/organizations/manage/policy-edit.component.ts +++ b/src/app/organizations/manage/policy-edit.component.ts @@ -7,7 +7,6 @@ import { } from '@angular/core'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { ApiService } from 'jslib/abstractions/api.service'; import { I18nService } from 'jslib/abstractions/i18n.service'; @@ -64,7 +63,7 @@ export class PolicyEditComponent implements OnInit { private policy: PolicyResponse; constructor(private apiService: ApiService, private i18nService: I18nService, - private analytics: Angulartics2, private toasterService: ToasterService) { + private toasterService: ToasterService) { this.passwordScores = [ { name: '-- ' + i18nService.t('select') + ' --', value: null }, { name: i18nService.t('weak') + ' (0)', value: 0 }, @@ -174,7 +173,6 @@ export class PolicyEditComponent implements OnInit { try { this.formPromise = this.apiService.putPolicy(this.organizationId, this.type, request); await this.formPromise; - this.analytics.eventTrack.next({ action: 'Edited Policy' }); this.toasterService.popAsync('success', null, this.i18nService.t('editedPolicyId', this.name)); this.onSavedPolicy.emit(); } catch { } diff --git a/src/app/organizations/manage/user-add-edit.component.ts b/src/app/organizations/manage/user-add-edit.component.ts index 791f5d96..15980677 100644 --- a/src/app/organizations/manage/user-add-edit.component.ts +++ b/src/app/organizations/manage/user-add-edit.component.ts @@ -7,7 +7,6 @@ import { } from '@angular/core'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { ApiService } from 'jslib/abstractions/api.service'; import { CollectionService } from 'jslib/abstractions/collection.service'; @@ -54,8 +53,8 @@ export class UserAddEditComponent implements OnInit { } constructor(private apiService: ApiService, private i18nService: I18nService, - private analytics: Angulartics2, private toasterService: ToasterService, - private collectionService: CollectionService, private platformUtilsService: PlatformUtilsService) { } + private toasterService: ToasterService, private collectionService: CollectionService, + private platformUtilsService: PlatformUtilsService) { } async ngOnInit() { this.editMode = this.loading = this.organizationUserId != null; @@ -170,7 +169,6 @@ export class UserAddEditComponent implements OnInit { this.formPromise = this.apiService.postOrganizationUserInvite(this.organizationId, request); } await this.formPromise; - this.analytics.eventTrack.next({ action: this.editMode ? 'Edited User' : 'Invited User' }); this.toasterService.popAsync('success', null, this.i18nService.t(this.editMode ? 'editedUserId' : 'invitedUsers', this.name)); this.onSavedUser.emit(); @@ -192,7 +190,6 @@ export class UserAddEditComponent implements OnInit { try { this.deletePromise = this.apiService.deleteOrganizationUser(this.organizationId, this.organizationUserId); await this.deletePromise; - this.analytics.eventTrack.next({ action: 'Deleted User' }); this.toasterService.popAsync('success', null, this.i18nService.t('removedUserId', this.name)); this.onDeletedUser.emit(); } catch { } diff --git a/src/app/organizations/manage/user-groups.component.ts b/src/app/organizations/manage/user-groups.component.ts index 0b209911..bcb48dd3 100644 --- a/src/app/organizations/manage/user-groups.component.ts +++ b/src/app/organizations/manage/user-groups.component.ts @@ -7,7 +7,6 @@ import { } from '@angular/core'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { ApiService } from 'jslib/abstractions/api.service'; import { I18nService } from 'jslib/abstractions/i18n.service'; @@ -32,7 +31,7 @@ export class UserGroupsComponent implements OnInit { formPromise: Promise; constructor(private apiService: ApiService, private i18nService: I18nService, - private analytics: Angulartics2, private toasterService: ToasterService) { } + private toasterService: ToasterService) { } async ngOnInit() { const groupsResponse = await this.apiService.getGroups(this.organizationId); @@ -75,7 +74,6 @@ export class UserGroupsComponent implements OnInit { this.formPromise = this.apiService.putOrganizationUserGroups(this.organizationId, this.organizationUserId, request); await this.formPromise; - this.analytics.eventTrack.next({ action: 'Edited User Groups' }); this.toasterService.popAsync('success', null, this.i18nService.t('editedGroupsForUser', this.name)); this.onSavedUser.emit(); } catch { } diff --git a/src/app/organizations/settings/account.component.ts b/src/app/organizations/settings/account.component.ts index 63cb84a0..2011de08 100644 --- a/src/app/organizations/settings/account.component.ts +++ b/src/app/organizations/settings/account.component.ts @@ -7,7 +7,6 @@ import { import { ActivatedRoute } from '@angular/router'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { ApiService } from 'jslib/abstractions/api.service'; import { I18nService } from 'jslib/abstractions/i18n.service'; @@ -46,9 +45,8 @@ export class AccountComponent { constructor(private componentFactoryResolver: ComponentFactoryResolver, private apiService: ApiService, private i18nService: I18nService, - private analytics: Angulartics2, private toasterService: ToasterService, - private route: ActivatedRoute, private syncService: SyncService, - private platformUtilsService: PlatformUtilsService) { } + private toasterService: ToasterService, private route: ActivatedRoute, + private syncService: SyncService, private platformUtilsService: PlatformUtilsService) { } async ngOnInit() { this.selfHosted = this.platformUtilsService.isSelfHost(); @@ -73,7 +71,6 @@ export class AccountComponent { return this.syncService.fullSync(true); }); await this.formPromise; - this.analytics.eventTrack.next({ action: 'Updated Organization Settings' }); this.toasterService.popAsync('success', null, this.i18nService.t('organizationUpdated')); } catch { } } @@ -81,7 +78,6 @@ export class AccountComponent { async submitTaxInfo() { this.taxFormPromise = this.taxInfo.submitTaxInfo(); await this.taxFormPromise; - this.analytics.eventTrack.next({ action: 'Updated Organization Tax Info' }); this.toasterService.popAsync('success', null, this.i18nService.t('taxInfoUpdated')); } diff --git a/src/app/organizations/settings/adjust-seats.component.ts b/src/app/organizations/settings/adjust-seats.component.ts index 70cc1fd0..1d2b3a9f 100644 --- a/src/app/organizations/settings/adjust-seats.component.ts +++ b/src/app/organizations/settings/adjust-seats.component.ts @@ -12,7 +12,6 @@ import { } from '@angular/router'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { ApiService } from 'jslib/abstractions/api.service'; import { I18nService } from 'jslib/abstractions/i18n.service'; @@ -39,8 +38,8 @@ export class AdjustSeatsComponent { formPromise: Promise; constructor(private apiService: ApiService, private i18nService: I18nService, - private analytics: Angulartics2, private toasterService: ToasterService, - private router: Router, private activatedRoute: ActivatedRoute) { } + private toasterService: ToasterService, private router: Router, + private activatedRoute: ActivatedRoute) { } async submit() { try { @@ -63,7 +62,6 @@ export class AdjustSeatsComponent { }; this.formPromise = action(); await this.formPromise; - this.analytics.eventTrack.next({ action: this.add ? 'Added Seats' : 'Removed Seats' }); this.onAdjusted.emit(this.seatAdjustment); if (paymentFailed) { this.toasterService.popAsync({ diff --git a/src/app/organizations/settings/change-plan.component.ts b/src/app/organizations/settings/change-plan.component.ts index 8b9f487f..9063aff7 100644 --- a/src/app/organizations/settings/change-plan.component.ts +++ b/src/app/organizations/settings/change-plan.component.ts @@ -28,7 +28,6 @@ export class ChangePlanComponent { async submit() { try { - this.platformUtilsService.eventTrack('Changed Plan'); this.onChanged.emit(); } catch { } } diff --git a/src/app/organizations/settings/delete-organization.component.ts b/src/app/organizations/settings/delete-organization.component.ts index b8a584c1..ef493095 100644 --- a/src/app/organizations/settings/delete-organization.component.ts +++ b/src/app/organizations/settings/delete-organization.component.ts @@ -2,7 +2,6 @@ import { Component } from '@angular/core'; import { Router } from '@angular/router'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { ApiService } from 'jslib/abstractions/api.service'; import { CryptoService } from 'jslib/abstractions/crypto.service'; @@ -21,8 +20,8 @@ export class DeleteOrganizationComponent { formPromise: Promise; constructor(private apiService: ApiService, private i18nService: I18nService, - private analytics: Angulartics2, private toasterService: ToasterService, - private cryptoService: CryptoService, private router: Router) { } + private toasterService: ToasterService, private cryptoService: CryptoService, + private router: Router) { } async submit() { if (this.masterPassword == null || this.masterPassword === '') { @@ -36,7 +35,6 @@ export class DeleteOrganizationComponent { try { this.formPromise = this.apiService.deleteOrganization(this.organizationId, request); await this.formPromise; - this.analytics.eventTrack.next({ action: 'Deleted Organization' }); this.toasterService.popAsync('success', this.i18nService.t('organizationDeleted'), this.i18nService.t('organizationDeletedDesc')); this.router.navigate(['/']); diff --git a/src/app/organizations/settings/download-license.component.ts b/src/app/organizations/settings/download-license.component.ts index 4e7dbb89..3710b55b 100644 --- a/src/app/organizations/settings/download-license.component.ts +++ b/src/app/organizations/settings/download-license.component.ts @@ -32,7 +32,6 @@ export class DownloadLicenseComponent { const license = await this.formPromise; const licenseString = JSON.stringify(license, null, 2); this.platformUtilsService.saveFile(window, licenseString, null, 'bitwarden_organization_license.json'); - this.platformUtilsService.eventTrack('Downloaded License'); this.onDownloaded.emit(); } catch { } } diff --git a/src/app/organizations/settings/organization-billing.component.ts b/src/app/organizations/settings/organization-billing.component.ts index f54d0548..c0cd87f1 100644 --- a/src/app/organizations/settings/organization-billing.component.ts +++ b/src/app/organizations/settings/organization-billing.component.ts @@ -5,7 +5,6 @@ import { import { ActivatedRoute } from '@angular/router'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { ApiService } from 'jslib/abstractions/api.service'; import { I18nService } from 'jslib/abstractions/i18n.service'; @@ -18,10 +17,9 @@ import { UserBillingComponent } from '../../settings/user-billing.component'; templateUrl: '../../settings/user-billing.component.html', }) export class OrganizationBillingComponent extends UserBillingComponent implements OnInit { - constructor(apiService: ApiService, i18nService: I18nService, - analytics: Angulartics2, toasterService: ToasterService, + constructor(apiService: ApiService, i18nService: I18nService, toasterService: ToasterService, private route: ActivatedRoute, platformUtilsService: PlatformUtilsService) { - super(apiService, i18nService, analytics, toasterService, platformUtilsService); + super(apiService, i18nService, toasterService, platformUtilsService); } async ngOnInit() { diff --git a/src/app/organizations/settings/organization-subscription.component.ts b/src/app/organizations/settings/organization-subscription.component.ts index e5caf468..d8c2e6cf 100644 --- a/src/app/organizations/settings/organization-subscription.component.ts +++ b/src/app/organizations/settings/organization-subscription.component.ts @@ -5,7 +5,6 @@ import { import { ActivatedRoute } from '@angular/router'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { OrganizationSubscriptionResponse } from 'jslib/models/response/organizationSubscriptionResponse'; @@ -38,9 +37,8 @@ export class OrganizationSubscriptionComponent implements OnInit { reinstatePromise: Promise; constructor(private apiService: ApiService, private platformUtilsService: PlatformUtilsService, - private i18nService: I18nService, private analytics: Angulartics2, - private toasterService: ToasterService, private messagingService: MessagingService, - private route: ActivatedRoute) { + private i18nService: I18nService, private toasterService: ToasterService, + private messagingService: MessagingService, private route: ActivatedRoute) { this.selfHosted = platformUtilsService.isSelfHost(); } @@ -75,7 +73,6 @@ export class OrganizationSubscriptionComponent implements OnInit { try { this.reinstatePromise = this.apiService.postOrganizationReinstate(this.organizationId); await this.reinstatePromise; - this.analytics.eventTrack.next({ action: 'Reinstated Plan' }); this.toasterService.popAsync('success', null, this.i18nService.t('reinstated')); this.load(); } catch { } @@ -95,7 +92,6 @@ export class OrganizationSubscriptionComponent implements OnInit { try { this.cancelPromise = this.apiService.postOrganizationCancel(this.organizationId); await this.cancelPromise; - this.analytics.eventTrack.next({ action: 'Canceled Plan' }); this.toasterService.popAsync('success', null, this.i18nService.t('canceledSubscription')); this.load(); } catch { } diff --git a/src/app/organizations/tools/import.component.ts b/src/app/organizations/tools/import.component.ts index db202190..1b698f83 100644 --- a/src/app/organizations/tools/import.component.ts +++ b/src/app/organizations/tools/import.component.ts @@ -5,7 +5,6 @@ import { } from '@angular/router'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { I18nService } from 'jslib/abstractions/i18n.service'; import { ImportService } from 'jslib/abstractions/import.service'; @@ -21,12 +20,11 @@ import { ImportComponent as BaseImportComponent } from '../../tools/import.compo export class ImportComponent extends BaseImportComponent { organizationName: string; - constructor(i18nService: I18nService, analytics: Angulartics2, - toasterService: ToasterService, importService: ImportService, - router: Router, private route: ActivatedRoute, + constructor(i18nService: I18nService, toasterService: ToasterService, + importService: ImportService, router: Router, private route: ActivatedRoute, platformUtilsService: PlatformUtilsService, private userService: UserService) { - super(i18nService, analytics, toasterService, importService, router, platformUtilsService); + super(i18nService, toasterService, importService, router, platformUtilsService); } async ngOnInit() { diff --git a/src/app/organizations/vault/ciphers.component.ts b/src/app/organizations/vault/ciphers.component.ts index 02262a75..efa3d80d 100644 --- a/src/app/organizations/vault/ciphers.component.ts +++ b/src/app/organizations/vault/ciphers.component.ts @@ -5,7 +5,6 @@ import { } from '@angular/core'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { ApiService } from 'jslib/abstractions/api.service'; import { CipherService } from 'jslib/abstractions/cipher.service'; @@ -33,12 +32,11 @@ export class CiphersComponent extends BaseCiphersComponent { protected allCiphers: CipherView[] = []; - constructor(searchService: SearchService, analytics: Angulartics2, - toasterService: ToasterService, i18nService: I18nService, + constructor(searchService: SearchService, toasterService: ToasterService, i18nService: I18nService, platformUtilsService: PlatformUtilsService, cipherService: CipherService, private apiService: ApiService, eventService: EventService, totpService: TotpService, userService: UserService) { - super(searchService, analytics, toasterService, i18nService, platformUtilsService, - cipherService, eventService, totpService, userService); + super(searchService, toasterService, i18nService, platformUtilsService, cipherService, + eventService, totpService, userService); } async load(filter: (cipher: CipherView) => boolean = null) { diff --git a/src/app/settings/add-credit.component.ts b/src/app/settings/add-credit.component.ts index 217c3d6c..da28c95e 100644 --- a/src/app/settings/add-credit.component.ts +++ b/src/app/settings/add-credit.component.ts @@ -8,9 +8,6 @@ import { ViewChild, } from '@angular/core'; -import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; - import { ApiService } from 'jslib/abstractions/api.service'; import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service'; import { UserService } from 'jslib/abstractions/user.service'; @@ -49,7 +46,6 @@ export class AddCreditComponent implements OnInit { private email: string; constructor(private userService: UserService, private apiService: ApiService, - private analytics: Angulartics2, private toasterService: ToasterService, private platformUtilsService: PlatformUtilsService) { if (platformUtilsService.isDev()) { this.ppButtonFormAction = WebConstants.paypal.buttonActionSandbox; @@ -108,9 +104,6 @@ export class AddCreditComponent implements OnInit { return; } try { - this.analytics.eventTrack.next({ - action: 'Added Credit', - }); this.onAdded.emit(); } catch { } } diff --git a/src/app/settings/adjust-payment.component.ts b/src/app/settings/adjust-payment.component.ts index 43a7bf03..c867dd17 100644 --- a/src/app/settings/adjust-payment.component.ts +++ b/src/app/settings/adjust-payment.component.ts @@ -7,7 +7,6 @@ import { } from '@angular/core'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { ApiService } from 'jslib/abstractions/api.service'; import { I18nService } from 'jslib/abstractions/i18n.service'; @@ -36,7 +35,7 @@ export class AdjustPaymentComponent { formPromise: Promise; constructor(private apiService: ApiService, private i18nService: I18nService, - private analytics: Angulartics2, private toasterService: ToasterService) { } + private toasterService: ToasterService) { } async submit() { try { @@ -59,9 +58,6 @@ export class AdjustPaymentComponent { } }); await this.formPromise; - this.analytics.eventTrack.next({ - action: this.currentType == null ? 'Added Payment Method' : 'Changed Payment Method', - }); this.toasterService.popAsync('success', null, this.i18nService.t('updatedPaymentMethod')); this.onAdjusted.emit(); } catch { } diff --git a/src/app/settings/adjust-storage.component.ts b/src/app/settings/adjust-storage.component.ts index 63dec504..1b9daca7 100644 --- a/src/app/settings/adjust-storage.component.ts +++ b/src/app/settings/adjust-storage.component.ts @@ -12,7 +12,6 @@ import { } from '@angular/router'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { ApiService } from 'jslib/abstractions/api.service'; import { I18nService } from 'jslib/abstractions/i18n.service'; @@ -41,8 +40,8 @@ export class AdjustStorageComponent { formPromise: Promise; constructor(private apiService: ApiService, private i18nService: I18nService, - private analytics: Angulartics2, private toasterService: ToasterService, - private router: Router, private activatedRoute: ActivatedRoute) { } + private toasterService: ToasterService, private router: Router, + private activatedRoute: ActivatedRoute) { } async submit() { try { @@ -71,7 +70,6 @@ export class AdjustStorageComponent { }; this.formPromise = action(); await this.formPromise; - this.analytics.eventTrack.next({ action: this.add ? 'Added Storage' : 'Removed Storage' }); this.onAdjusted.emit(this.storageAdjustment); if (paymentFailed) { this.toasterService.popAsync({ diff --git a/src/app/settings/api-key.component.ts b/src/app/settings/api-key.component.ts index fa1be6af..d5f168b1 100644 --- a/src/app/settings/api-key.component.ts +++ b/src/app/settings/api-key.component.ts @@ -1,7 +1,6 @@ import { Component } from '@angular/core'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { CryptoService } from 'jslib/abstractions/crypto.service'; import { I18nService } from 'jslib/abstractions/i18n.service'; @@ -30,8 +29,8 @@ export class ApiKeyComponent { clientId: string; clientSecret: string; - constructor(private i18nService: I18nService, private analytics: Angulartics2, - private toasterService: ToasterService, private cryptoService: CryptoService) { } + constructor(private i18nService: I18nService, private toasterService: ToasterService, + private cryptoService: CryptoService) { } async submit() { if (this.masterPassword == null || this.masterPassword === '') { @@ -47,7 +46,6 @@ export class ApiKeyComponent { const response = await this.formPromise; this.clientSecret = response.apiKey; this.clientId = `${this.keyType}.${this.entityId}`; - this.analytics.eventTrack.next({ action: `Viewed ${this.keyType} API Key` }); } catch { } } } diff --git a/src/app/settings/change-email.component.ts b/src/app/settings/change-email.component.ts index 1e4bd496..b9c3a323 100644 --- a/src/app/settings/change-email.component.ts +++ b/src/app/settings/change-email.component.ts @@ -3,7 +3,6 @@ import { } from '@angular/core'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { ApiService } from 'jslib/abstractions/api.service'; import { CryptoService } from 'jslib/abstractions/crypto.service'; @@ -27,9 +26,8 @@ export class ChangeEmailComponent { formPromise: Promise; constructor(private apiService: ApiService, private i18nService: I18nService, - private analytics: Angulartics2, private toasterService: ToasterService, - private cryptoService: CryptoService, private messagingService: MessagingService, - private userService: UserService) { } + private toasterService: ToasterService, private cryptoService: CryptoService, + private messagingService: MessagingService, private userService: UserService) { } async submit() { const hasEncKey = await this.cryptoService.hasEncKey(); @@ -63,7 +61,6 @@ export class ChangeEmailComponent { this.formPromise = this.apiService.postEmail(request); await this.formPromise; this.reset(); - this.analytics.eventTrack.next({ action: 'Changed Email' }); this.toasterService.popAsync('success', this.i18nService.t('emailChanged'), this.i18nService.t('logBackIn')); this.messagingService.send('logout'); diff --git a/src/app/settings/change-kdf.component.ts b/src/app/settings/change-kdf.component.ts index f5449ae1..e6f416fd 100644 --- a/src/app/settings/change-kdf.component.ts +++ b/src/app/settings/change-kdf.component.ts @@ -4,7 +4,6 @@ import { } from '@angular/core'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { ApiService } from 'jslib/abstractions/api.service'; import { CryptoService } from 'jslib/abstractions/crypto.service'; @@ -28,9 +27,8 @@ export class ChangeKdfComponent implements OnInit { formPromise: Promise; constructor(private apiService: ApiService, private i18nService: I18nService, - private analytics: Angulartics2, private toasterService: ToasterService, - private cryptoService: CryptoService, private messagingService: MessagingService, - private userService: UserService) { + private toasterService: ToasterService, private cryptoService: CryptoService, + private messagingService: MessagingService, private userService: UserService) { this.kdfOptions = [ { name: 'PBKDF2 SHA-256', value: KdfType.PBKDF2_SHA256 }, ]; @@ -60,7 +58,6 @@ export class ChangeKdfComponent implements OnInit { try { this.formPromise = this.apiService.postAccountKdf(request); await this.formPromise; - this.analytics.eventTrack.next({ action: 'Changed KDF' }); this.toasterService.popAsync('success', this.i18nService.t('encKeySettingsChanged'), this.i18nService.t('logBackIn')); this.messagingService.send('logout'); diff --git a/src/app/settings/deauthorize-sessions.component.ts b/src/app/settings/deauthorize-sessions.component.ts index 2a6ca26a..e994c7b8 100644 --- a/src/app/settings/deauthorize-sessions.component.ts +++ b/src/app/settings/deauthorize-sessions.component.ts @@ -1,7 +1,6 @@ import { Component } from '@angular/core'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { ApiService } from 'jslib/abstractions/api.service'; import { CryptoService } from 'jslib/abstractions/crypto.service'; @@ -19,8 +18,8 @@ export class DeauthorizeSessionsComponent { formPromise: Promise; constructor(private apiService: ApiService, private i18nService: I18nService, - private analytics: Angulartics2, private toasterService: ToasterService, - private cryptoService: CryptoService, private messagingService: MessagingService) { } + private toasterService: ToasterService, private cryptoService: CryptoService, + private messagingService: MessagingService) { } async submit() { if (this.masterPassword == null || this.masterPassword === '') { @@ -34,7 +33,6 @@ export class DeauthorizeSessionsComponent { try { this.formPromise = this.apiService.postSecurityStamp(request); await this.formPromise; - this.analytics.eventTrack.next({ action: 'Deauthorized Sessions' }); this.toasterService.popAsync('success', this.i18nService.t('sessionsDeauthorized'), this.i18nService.t('logBackIn')); this.messagingService.send('logout'); diff --git a/src/app/settings/delete-account.component.ts b/src/app/settings/delete-account.component.ts index 492e8524..4c907859 100644 --- a/src/app/settings/delete-account.component.ts +++ b/src/app/settings/delete-account.component.ts @@ -1,7 +1,6 @@ import { Component } from '@angular/core'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { ApiService } from 'jslib/abstractions/api.service'; import { CryptoService } from 'jslib/abstractions/crypto.service'; @@ -19,8 +18,8 @@ export class DeleteAccountComponent { formPromise: Promise; constructor(private apiService: ApiService, private i18nService: I18nService, - private analytics: Angulartics2, private toasterService: ToasterService, - private cryptoService: CryptoService, private messagingService: MessagingService) { } + private toasterService: ToasterService, private cryptoService: CryptoService, + private messagingService: MessagingService) { } async submit() { if (this.masterPassword == null || this.masterPassword === '') { @@ -34,7 +33,6 @@ export class DeleteAccountComponent { try { this.formPromise = this.apiService.deleteAccount(request); await this.formPromise; - this.analytics.eventTrack.next({ action: 'Deleted Account' }); this.toasterService.popAsync('success', this.i18nService.t('accountDeleted'), this.i18nService.t('accountDeletedDesc')); this.messagingService.send('logout'); diff --git a/src/app/settings/domain-rules.component.ts b/src/app/settings/domain-rules.component.ts index 22f404a6..35235249 100644 --- a/src/app/settings/domain-rules.component.ts +++ b/src/app/settings/domain-rules.component.ts @@ -4,7 +4,6 @@ import { } from '@angular/core'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { ApiService } from 'jslib/abstractions/api.service'; import { I18nService } from 'jslib/abstractions/i18n.service'; @@ -22,7 +21,7 @@ export class DomainRulesComponent implements OnInit { formPromise: Promise; constructor(private apiService: ApiService, private i18nService: I18nService, - private analytics: Angulartics2, private toasterService: ToasterService) { } + private toasterService: ToasterService) { } async ngOnInit() { const response = await this.apiService.getSettingsDomains(); @@ -74,7 +73,6 @@ export class DomainRulesComponent implements OnInit { try { this.formPromise = this.apiService.putSettingsDomains(request); await this.formPromise; - this.analytics.eventTrack.next({ action: 'Saved Equivalent Domains' }); this.toasterService.popAsync('success', null, this.i18nService.t('domainsUpdated')); } catch { } } diff --git a/src/app/settings/options.component.ts b/src/app/settings/options.component.ts index 4999dbc1..3ad8be69 100644 --- a/src/app/settings/options.component.ts +++ b/src/app/settings/options.component.ts @@ -4,7 +4,6 @@ import { } from '@angular/core'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { I18nService } from 'jslib/abstractions/i18n.service'; import { MessagingService } from 'jslib/abstractions/messaging.service'; @@ -34,9 +33,9 @@ export class OptionsComponent implements OnInit { private startingLocale: string; constructor(private storageService: StorageService, private stateService: StateService, - private analytics: Angulartics2, private i18nService: I18nService, - private toasterService: ToasterService, private vaultTimeoutService: VaultTimeoutService, - private platformUtilsService: PlatformUtilsService, private messagingService: MessagingService) { + private i18nService: I18nService, private toasterService: ToasterService, + private vaultTimeoutService: VaultTimeoutService, private platformUtilsService: PlatformUtilsService, + private messagingService: MessagingService) { this.vaultTimeouts = [ { name: i18nService.t('oneMinute'), value: 1 }, { name: i18nService.t('fiveMinutes'), value: 5 }, @@ -82,7 +81,6 @@ export class OptionsComponent implements OnInit { await this.storageService.save('enableFullWidth', this.enableFullWidth); this.messagingService.send('setFullWidth'); await this.storageService.save(ConstantsService.localeKey, this.locale); - this.analytics.eventTrack.next({ action: 'Saved Options' }); if (this.locale !== this.startingLocale) { window.location.reload(); } else { diff --git a/src/app/settings/organization-plans.component.ts b/src/app/settings/organization-plans.component.ts index 2e9b28c8..0d14eba3 100644 --- a/src/app/settings/organization-plans.component.ts +++ b/src/app/settings/organization-plans.component.ts @@ -9,7 +9,6 @@ import { import { Router } from '@angular/router'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { PaymentMethodType } from 'jslib/enums/paymentMethodType'; @@ -66,9 +65,8 @@ export class OrganizationPlansComponent implements OnInit { plans: PlanResponse[]; constructor(private apiService: ApiService, private i18nService: I18nService, - private analytics: Angulartics2, private toasterService: ToasterService, - platformUtilsService: PlatformUtilsService, private cryptoService: CryptoService, - private router: Router, private syncService: SyncService, + private toasterService: ToasterService, platformUtilsService: PlatformUtilsService, + private cryptoService: CryptoService, private router: Router, private syncService: SyncService, private policyService: PolicyService, private userService: UserService) { this.selfHosted = platformUtilsService.isSelfHost(); } @@ -320,11 +318,9 @@ export class OrganizationPlansComponent implements OnInit { await this.apiService.refreshIdentityToken(); await this.syncService.fullSync(true); if (this.createOrganization) { - this.analytics.eventTrack.next({ action: 'Created Organization' }); this.toasterService.popAsync('success', this.i18nService.t('organizationCreated'), this.i18nService.t('organizationReadyToGo')); } else { - this.analytics.eventTrack.next({ action: 'Upgraded Organization' }); this.toasterService.popAsync('success', null, this.i18nService.t('organizationUpgraded')); } this.router.navigate(['/organizations/' + orgId]); diff --git a/src/app/settings/organizations.component.ts b/src/app/settings/organizations.component.ts index 5ef8917c..bee7b74d 100644 --- a/src/app/settings/organizations.component.ts +++ b/src/app/settings/organizations.component.ts @@ -5,7 +5,6 @@ import { } from '@angular/core'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { ApiService } from 'jslib/abstractions/api.service'; import { CryptoService } from 'jslib/abstractions/crypto.service'; @@ -33,8 +32,8 @@ export class OrganizationsComponent implements OnInit { constructor(private userService: UserService, private platformUtilsService: PlatformUtilsService, private i18nService: I18nService, private apiService: ApiService, - private analytics: Angulartics2, private toasterService: ToasterService, - private syncService: SyncService, private cryptoService: CryptoService) { } + private toasterService: ToasterService, private syncService: SyncService, + private cryptoService: CryptoService) { } async ngOnInit() { if (!this.vault) { @@ -63,7 +62,6 @@ export class OrganizationsComponent implements OnInit { return this.syncService.fullSync(true); }); await this.actionPromise; - this.analytics.eventTrack.next({ action: 'Unlinked SSO' }); this.toasterService.popAsync('success', null, 'Unlinked SSO'); await this.load(); } catch { } @@ -82,7 +80,6 @@ export class OrganizationsComponent implements OnInit { return this.syncService.fullSync(true); }); await this.actionPromise; - this.analytics.eventTrack.next({ action: 'Left Organization' }); this.toasterService.popAsync('success', null, this.i18nService.t('leftOrganization')); await this.load(); } catch { } diff --git a/src/app/settings/premium.component.ts b/src/app/settings/premium.component.ts index fbd2c80b..4d1c88c6 100644 --- a/src/app/settings/premium.component.ts +++ b/src/app/settings/premium.component.ts @@ -6,7 +6,6 @@ import { import { Router } from '@angular/router'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { ApiService } from 'jslib/abstractions/api.service'; import { I18nService } from 'jslib/abstractions/i18n.service'; @@ -36,10 +35,10 @@ export class PremiumComponent implements OnInit { formPromise: Promise; constructor(private apiService: ApiService, private i18nService: I18nService, - private analytics: Angulartics2, private toasterService: ToasterService, - platformUtilsService: PlatformUtilsService, private tokenService: TokenService, - private router: Router, private messagingService: MessagingService, - private syncService: SyncService, private userService: UserService) { + private toasterService: ToasterService, platformUtilsService: PlatformUtilsService, + private tokenService: TokenService, private router: Router, + private messagingService: MessagingService, private syncService: SyncService, + private userService: UserService) { this.selfHosted = platformUtilsService.isSelfHost(); } @@ -104,7 +103,6 @@ export class PremiumComponent implements OnInit { async finalizePremium() { await this.apiService.refreshIdentityToken(); await this.syncService.fullSync(true); - this.analytics.eventTrack.next({ action: 'Signed Up Premium' }); this.toasterService.popAsync('success', null, this.i18nService.t('premiumUpdated')); this.messagingService.send('purchasedPremium'); this.router.navigate(['/settings/subscription']); diff --git a/src/app/settings/profile.component.ts b/src/app/settings/profile.component.ts index fdfb192f..2befd5f5 100644 --- a/src/app/settings/profile.component.ts +++ b/src/app/settings/profile.component.ts @@ -4,7 +4,6 @@ import { } from '@angular/core'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { ApiService } from 'jslib/abstractions/api.service'; import { CryptoService } from 'jslib/abstractions/crypto.service'; @@ -27,8 +26,8 @@ export class ProfileComponent implements OnInit { formPromise: Promise; constructor(private apiService: ApiService, private i18nService: I18nService, - private analytics: Angulartics2, private toasterService: ToasterService, - private userService: UserService, private cryptoService: CryptoService) { } + private toasterService: ToasterService, private userService: UserService, + private cryptoService: CryptoService) { } async ngOnInit() { this.profile = await this.apiService.getProfile(); @@ -44,7 +43,6 @@ export class ProfileComponent implements OnInit { const request = new UpdateProfileRequest(this.profile.name, this.profile.masterPasswordHint); this.formPromise = this.apiService.putProfile(request); await this.formPromise; - this.analytics.eventTrack.next({ action: 'Updated Profile' }); this.toasterService.popAsync('success', null, this.i18nService.t('accountUpdated')); } catch { } } diff --git a/src/app/settings/purge-vault.component.ts b/src/app/settings/purge-vault.component.ts index e03aeaa8..f5fa2def 100644 --- a/src/app/settings/purge-vault.component.ts +++ b/src/app/settings/purge-vault.component.ts @@ -5,7 +5,6 @@ import { import { Router } from '@angular/router'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { ApiService } from 'jslib/abstractions/api.service'; import { CryptoService } from 'jslib/abstractions/crypto.service'; @@ -24,8 +23,8 @@ export class PurgeVaultComponent { formPromise: Promise; constructor(private apiService: ApiService, private i18nService: I18nService, - private analytics: Angulartics2, private toasterService: ToasterService, - private cryptoService: CryptoService, private router: Router) { } + private toasterService: ToasterService, private cryptoService: CryptoService, + private router: Router) { } async submit() { if (this.masterPassword == null || this.masterPassword === '') { @@ -39,9 +38,6 @@ export class PurgeVaultComponent { try { this.formPromise = this.apiService.postPurgeCiphers(request, this.organizationId); await this.formPromise; - this.analytics.eventTrack.next({ - action: this.organizationId != null ? 'Purged Organization Vault' : 'Purged Vault', - }); this.toasterService.popAsync('success', null, this.i18nService.t('vaultPurged')); if (this.organizationId != null) { this.router.navigate(['organizations', this.organizationId, 'vault']); diff --git a/src/app/settings/two-factor-authenticator.component.ts b/src/app/settings/two-factor-authenticator.component.ts index 4888980d..4da9a7cb 100644 --- a/src/app/settings/two-factor-authenticator.component.ts +++ b/src/app/settings/two-factor-authenticator.component.ts @@ -5,7 +5,6 @@ import { } from '@angular/core'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { ApiService } from 'jslib/abstractions/api.service'; import { I18nService } from 'jslib/abstractions/i18n.service'; @@ -32,9 +31,9 @@ export class TwoFactorAuthenticatorComponent extends TwoFactorBaseComponent impl private qrScript: HTMLScriptElement; constructor(apiService: ApiService, i18nService: I18nService, - analytics: Angulartics2, toasterService: ToasterService, - private userService: UserService, platformUtilsService: PlatformUtilsService) { - super(apiService, i18nService, analytics, toasterService, platformUtilsService); + toasterService: ToasterService, private userService: UserService, + platformUtilsService: PlatformUtilsService) { + super(apiService, i18nService, toasterService, platformUtilsService); this.qrScript = window.document.createElement('script'); this.qrScript.src = 'scripts/qrious.min.js'; this.qrScript.async = true; diff --git a/src/app/settings/two-factor-base.component.ts b/src/app/settings/two-factor-base.component.ts index 51d7a0ae..6b318161 100644 --- a/src/app/settings/two-factor-base.component.ts +++ b/src/app/settings/two-factor-base.component.ts @@ -5,7 +5,6 @@ import { } from '@angular/core'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { ApiService } from 'jslib/abstractions/api.service'; import { I18nService } from 'jslib/abstractions/i18n.service'; @@ -27,8 +26,7 @@ export abstract class TwoFactorBaseComponent { protected masterPasswordHash: string; constructor(protected apiService: ApiService, protected i18nService: I18nService, - protected analytics: Angulartics2, protected toasterService: ToasterService, - protected platformUtilsService: PlatformUtilsService) { } + protected toasterService: ToasterService, protected platformUtilsService: PlatformUtilsService) { } protected auth(authResponse: any) { this.masterPasswordHash = authResponse.masterPasswordHash; @@ -38,9 +36,6 @@ export abstract class TwoFactorBaseComponent { protected async enable(enableFunction: () => Promise) { try { await enableFunction(); - this.analytics.eventTrack.next({ - action: 'Enabled Two-step ' + TwoFactorProviderType[this.type].toString(), - }); this.onUpdated.emit(true); } catch { } } @@ -63,9 +58,6 @@ export abstract class TwoFactorBaseComponent { } await promise; this.enabled = false; - this.analytics.eventTrack.next({ - action: 'Disabled Two-step ' + TwoFactorProviderType[this.type].toString(), - }); this.toasterService.popAsync('success', null, this.i18nService.t('twoStepDisabled')); this.onUpdated.emit(false); } catch { } diff --git a/src/app/settings/two-factor-duo.component.ts b/src/app/settings/two-factor-duo.component.ts index f1c6f7f1..04319e4c 100644 --- a/src/app/settings/two-factor-duo.component.ts +++ b/src/app/settings/two-factor-duo.component.ts @@ -1,7 +1,6 @@ import { Component } from '@angular/core'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { ApiService } from 'jslib/abstractions/api.service'; import { I18nService } from 'jslib/abstractions/i18n.service'; @@ -25,9 +24,8 @@ export class TwoFactorDuoComponent extends TwoFactorBaseComponent { formPromise: Promise; constructor(apiService: ApiService, i18nService: I18nService, - analytics: Angulartics2, toasterService: ToasterService, - platformUtilsService: PlatformUtilsService) { - super(apiService, i18nService, analytics, toasterService, platformUtilsService); + toasterService: ToasterService, platformUtilsService: PlatformUtilsService) { + super(apiService, i18nService, toasterService, platformUtilsService); } auth(authResponse: any) { diff --git a/src/app/settings/two-factor-email.component.ts b/src/app/settings/two-factor-email.component.ts index 7d559ffe..aaa12e8b 100644 --- a/src/app/settings/two-factor-email.component.ts +++ b/src/app/settings/two-factor-email.component.ts @@ -1,7 +1,6 @@ import { Component } from '@angular/core'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { ApiService } from 'jslib/abstractions/api.service'; import { I18nService } from 'jslib/abstractions/i18n.service'; @@ -29,9 +28,9 @@ export class TwoFactorEmailComponent extends TwoFactorBaseComponent { emailPromise: Promise; constructor(apiService: ApiService, i18nService: I18nService, - analytics: Angulartics2, toasterService: ToasterService, - platformUtilsService: PlatformUtilsService, private userService: UserService) { - super(apiService, i18nService, analytics, toasterService, platformUtilsService); + toasterService: ToasterService, platformUtilsService: PlatformUtilsService, + private userService: UserService) { + super(apiService, i18nService, toasterService, platformUtilsService); } auth(authResponse: any) { diff --git a/src/app/settings/two-factor-webauthn.component.ts b/src/app/settings/two-factor-webauthn.component.ts index de74bbf5..f0e78ed8 100644 --- a/src/app/settings/two-factor-webauthn.component.ts +++ b/src/app/settings/two-factor-webauthn.component.ts @@ -4,7 +4,6 @@ import { } from '@angular/core'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { ApiService } from 'jslib/abstractions/api.service'; import { I18nService } from 'jslib/abstractions/i18n.service'; @@ -39,9 +38,9 @@ export class TwoFactorWebAuthnComponent extends TwoFactorBaseComponent { formPromise: Promise; constructor(apiService: ApiService, i18nService: I18nService, - analytics: Angulartics2, toasterService: ToasterService, - platformUtilsService: PlatformUtilsService, private ngZone: NgZone) { - super(apiService, i18nService, analytics, toasterService, platformUtilsService); + toasterService: ToasterService, platformUtilsService: PlatformUtilsService, + private ngZone: NgZone) { + super(apiService, i18nService, toasterService, platformUtilsService); } auth(authResponse: any) { diff --git a/src/app/settings/two-factor-yubikey.component.ts b/src/app/settings/two-factor-yubikey.component.ts index a0d1029c..2eed914f 100644 --- a/src/app/settings/two-factor-yubikey.component.ts +++ b/src/app/settings/two-factor-yubikey.component.ts @@ -1,7 +1,6 @@ import { Component } from '@angular/core'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { ApiService } from 'jslib/abstractions/api.service'; import { I18nService } from 'jslib/abstractions/i18n.service'; @@ -27,9 +26,8 @@ export class TwoFactorYubiKeyComponent extends TwoFactorBaseComponent { disablePromise: Promise; constructor(apiService: ApiService, i18nService: I18nService, - analytics: Angulartics2, toasterService: ToasterService, - platformUtilsService: PlatformUtilsService) { - super(apiService, i18nService, analytics, toasterService, platformUtilsService); + toasterService: ToasterService, platformUtilsService: PlatformUtilsService) { + super(apiService, i18nService, toasterService, platformUtilsService); } auth(authResponse: any) { diff --git a/src/app/settings/update-key.component.ts b/src/app/settings/update-key.component.ts index 3a1395cb..e3adb614 100644 --- a/src/app/settings/update-key.component.ts +++ b/src/app/settings/update-key.component.ts @@ -4,7 +4,6 @@ import { Toast, ToasterService, } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { ApiService } from 'jslib/abstractions/api.service'; import { CipherService } from 'jslib/abstractions/cipher.service'; @@ -29,10 +28,9 @@ export class UpdateKeyComponent { formPromise: Promise; constructor(private apiService: ApiService, private i18nService: I18nService, - private analytics: Angulartics2, private toasterService: ToasterService, - private cryptoService: CryptoService, private messagingService: MessagingService, - private syncService: SyncService, private folderService: FolderService, - private cipherService: CipherService) { } + private toasterService: ToasterService, private cryptoService: CryptoService, + private messagingService: MessagingService, private syncService: SyncService, + private folderService: FolderService, private cipherService: CipherService) { } async submit() { const hasEncKey = await this.cryptoService.hasEncKey(); @@ -51,7 +49,6 @@ export class UpdateKeyComponent { return this.apiService.postAccountKey(request); }); await this.formPromise; - this.analytics.eventTrack.next({ action: 'Key Updated' }); const toast: Toast = { type: 'success', title: this.i18nService.t('keyUpdated'), diff --git a/src/app/settings/update-license.component.ts b/src/app/settings/update-license.component.ts index e9f5ca07..5db31e59 100644 --- a/src/app/settings/update-license.component.ts +++ b/src/app/settings/update-license.component.ts @@ -6,7 +6,6 @@ import { } from '@angular/core'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { ApiService } from 'jslib/abstractions/api.service'; import { I18nService } from 'jslib/abstractions/i18n.service'; @@ -23,7 +22,7 @@ export class UpdateLicenseComponent { formPromise: Promise; constructor(private apiService: ApiService, private i18nService: I18nService, - private analytics: Angulartics2, private toasterService: ToasterService) { } + private toasterService: ToasterService) { } async submit() { const fileEl = document.getElementById('file') as HTMLInputElement; @@ -50,7 +49,6 @@ export class UpdateLicenseComponent { }); await this.formPromise; - this.analytics.eventTrack.next({ action: 'Updated License' }); this.toasterService.popAsync('success', null, this.i18nService.t('updatedLicense')); this.onUpdated.emit(); } catch { } diff --git a/src/app/settings/user-billing.component.ts b/src/app/settings/user-billing.component.ts index 1cf39c12..1cc56853 100644 --- a/src/app/settings/user-billing.component.ts +++ b/src/app/settings/user-billing.component.ts @@ -4,7 +4,6 @@ import { } from '@angular/core'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { BillingResponse } from 'jslib/models/response/billingResponse'; @@ -35,8 +34,7 @@ export class UserBillingComponent implements OnInit { verifyBankPromise: Promise; constructor(protected apiService: ApiService, protected i18nService: I18nService, - protected analytics: Angulartics2, protected toasterService: ToasterService, - protected platformUtilsService: PlatformUtilsService) { } + protected toasterService: ToasterService, protected platformUtilsService: PlatformUtilsService) { } async ngOnInit() { await this.load(); @@ -67,7 +65,6 @@ export class UserBillingComponent implements OnInit { request.amount2 = this.verifyAmount2; this.verifyBankPromise = this.apiService.postOrganizationVerifyBank(this.organizationId, request); await this.verifyBankPromise; - this.analytics.eventTrack.next({ action: 'Verified Bank Account' }); this.toasterService.popAsync('success', null, this.i18nService.t('verifiedBankAccount')); this.load(); } catch { } diff --git a/src/app/settings/user-subscription.component.ts b/src/app/settings/user-subscription.component.ts index 9d6c0a7f..28643056 100644 --- a/src/app/settings/user-subscription.component.ts +++ b/src/app/settings/user-subscription.component.ts @@ -5,7 +5,6 @@ import { import { Router } from '@angular/router'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { SubscriptionResponse } from 'jslib/models/response/subscriptionResponse'; @@ -32,8 +31,7 @@ export class UserSubscriptionComponent implements OnInit { constructor(private tokenService: TokenService, private apiService: ApiService, private platformUtilsService: PlatformUtilsService, private i18nService: I18nService, - private analytics: Angulartics2, private toasterService: ToasterService, - private router: Router) { + private toasterService: ToasterService, private router: Router) { this.selfHosted = platformUtilsService.isSelfHost(); } @@ -78,7 +76,6 @@ export class UserSubscriptionComponent implements OnInit { try { this.reinstatePromise = this.apiService.postReinstatePremium(); await this.reinstatePromise; - this.analytics.eventTrack.next({ action: 'Reinstated Premium' }); this.toasterService.popAsync('success', null, this.i18nService.t('reinstated')); this.load(); } catch { } @@ -104,7 +101,6 @@ export class UserSubscriptionComponent implements OnInit { try { this.cancelPromise = this.apiService.postCancelPremium(); await this.cancelPromise; - this.analytics.eventTrack.next({ action: 'Canceled Premium' }); this.toasterService.popAsync('success', null, this.i18nService.t('canceledSubscription')); this.load(); } catch { } diff --git a/src/app/settings/verify-email.component.ts b/src/app/settings/verify-email.component.ts index d7a63870..a92d5841 100644 --- a/src/app/settings/verify-email.component.ts +++ b/src/app/settings/verify-email.component.ts @@ -1,7 +1,6 @@ import { Component } from '@angular/core'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { ApiService } from 'jslib/abstractions/api.service'; import { I18nService } from 'jslib/abstractions/i18n.service'; @@ -14,7 +13,7 @@ export class VerifyEmailComponent { actionPromise: Promise; constructor(private apiService: ApiService, private i18nService: I18nService, - private analytics: Angulartics2, private toasterService: ToasterService) { } + private toasterService: ToasterService) { } async send() { if (this.actionPromise != null) { @@ -23,7 +22,6 @@ export class VerifyEmailComponent { try { this.actionPromise = this.apiService.postAccountVerifyEmail(); await this.actionPromise; - this.analytics.eventTrack.next({ action: 'Sent Verification Email' }); this.toasterService.popAsync('success', null, this.i18nService.t('checkInboxForVerification')); } catch { } this.actionPromise = null; diff --git a/src/app/tools/import.component.ts b/src/app/tools/import.component.ts index bf38ce51..783ea311 100644 --- a/src/app/tools/import.component.ts +++ b/src/app/tools/import.component.ts @@ -5,7 +5,6 @@ import { import { Router } from '@angular/router'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { I18nService } from 'jslib/abstractions/i18n.service'; import { ImportOption, ImportService } from 'jslib/abstractions/import.service'; @@ -28,9 +27,9 @@ export class ImportComponent implements OnInit { protected organizationId: string = null; protected successNavigate: any[] = ['vault']; - constructor(protected i18nService: I18nService, protected analytics: Angulartics2, - protected toasterService: ToasterService, protected importService: ImportService, - protected router: Router, protected platformUtilsService: PlatformUtilsService) { } + constructor(protected i18nService: I18nService, protected toasterService: ToasterService, + protected importService: ImportService, protected router: Router, + protected platformUtilsService: PlatformUtilsService) { } ngOnInit() { this.setImportOptions(); @@ -95,10 +94,6 @@ export class ImportComponent implements OnInit { this.loading = false; return; } - this.analytics.eventTrack.next({ - action: 'Imported Data', - properties: { label: this.format }, - }); this.toasterService.popAsync('success', null, this.i18nService.t('importSuccess')); this.router.navigate(this.successNavigate); } catch { } @@ -127,11 +122,6 @@ export class ImportComponent implements OnInit { } private async error(error: Error) { - this.analytics.eventTrack.next({ - action: 'Import Data Failed', - properties: { label: this.format }, - }); - await Swal.fire({ heightAuto: false, buttonsStyling: false, diff --git a/src/app/vault/add-edit.component.ts b/src/app/vault/add-edit.component.ts index a16c9cbd..851a78d2 100644 --- a/src/app/vault/add-edit.component.ts +++ b/src/app/vault/add-edit.component.ts @@ -78,7 +78,6 @@ export class AddEditComponent extends BaseAddEditComponent { return; } - this.platformUtilsService.eventTrack('Launched Login URI'); this.platformUtilsService.launchUri(uri.launchUri); } @@ -87,7 +86,6 @@ export class AddEditComponent extends BaseAddEditComponent { return; } - this.platformUtilsService.eventTrack('Copied ' + aType); this.platformUtilsService.copyToClipboard(value, { window: window }); this.platformUtilsService.showToast('info', null, this.i18nService.t('valueCopied', this.i18nService.t(typeI18nKey))); diff --git a/src/app/vault/bulk-delete.component.ts b/src/app/vault/bulk-delete.component.ts index f4e9ae28..5b8fd183 100644 --- a/src/app/vault/bulk-delete.component.ts +++ b/src/app/vault/bulk-delete.component.ts @@ -5,7 +5,6 @@ import { Output, } from '@angular/core'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { ApiService } from 'jslib/abstractions/api.service'; import { CipherService } from 'jslib/abstractions/cipher.service'; @@ -26,9 +25,8 @@ export class BulkDeleteComponent { formPromise: Promise; - constructor(private analytics: Angulartics2, private cipherService: CipherService, - private toasterService: ToasterService, private i18nService: I18nService, - private apiService: ApiService) { } + constructor(private cipherService: CipherService, private toasterService: ToasterService, + private i18nService: I18nService, private apiService: ApiService) { } async submit() { if (!this.organization || !this.organization.canManageAllCollections) { @@ -40,7 +38,6 @@ export class BulkDeleteComponent { await this.formPromise; this.onDeleted.emit(); - this.analytics.eventTrack.next({ action: 'Bulk Deleted Items' }); this.toasterService.popAsync('success', null, this.i18nService.t(this.permanent ? 'permanentlyDeletedItems' : 'deletedItems')); } diff --git a/src/app/vault/bulk-move.component.ts b/src/app/vault/bulk-move.component.ts index c5b6d628..ad90644a 100644 --- a/src/app/vault/bulk-move.component.ts +++ b/src/app/vault/bulk-move.component.ts @@ -7,7 +7,6 @@ import { } from '@angular/core'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { CipherService } from 'jslib/abstractions/cipher.service'; import { FolderService } from 'jslib/abstractions/folder.service'; @@ -27,9 +26,8 @@ export class BulkMoveComponent implements OnInit { folders: FolderView[] = []; formPromise: Promise; - constructor(private analytics: Angulartics2, private cipherService: CipherService, - private toasterService: ToasterService, private i18nService: I18nService, - private folderService: FolderService) { } + constructor(private cipherService: CipherService, private toasterService: ToasterService, + private i18nService: I18nService, private folderService: FolderService) { } async ngOnInit() { this.folders = await this.folderService.getAllDecrypted(); @@ -40,7 +38,6 @@ export class BulkMoveComponent implements OnInit { this.formPromise = this.cipherService.moveManyWithServer(this.cipherIds, this.folderId); await this.formPromise; this.onMoved.emit(); - this.analytics.eventTrack.next({ action: 'Bulk Moved Items' }); this.toasterService.popAsync('success', null, this.i18nService.t('movedItems')); } } diff --git a/src/app/vault/bulk-restore.component.ts b/src/app/vault/bulk-restore.component.ts index 5e7f5af8..f593ea77 100644 --- a/src/app/vault/bulk-restore.component.ts +++ b/src/app/vault/bulk-restore.component.ts @@ -6,7 +6,6 @@ import { } from '@angular/core'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { CipherService } from 'jslib/abstractions/cipher.service'; import { I18nService } from 'jslib/abstractions/i18n.service'; @@ -21,14 +20,13 @@ export class BulkRestoreComponent { formPromise: Promise; - constructor(private analytics: Angulartics2, private cipherService: CipherService, - private toasterService: ToasterService, private i18nService: I18nService) { } + constructor(private cipherService: CipherService, private toasterService: ToasterService, + private i18nService: I18nService) { } async submit() { this.formPromise = this.cipherService.restoreManyWithServer(this.cipherIds); await this.formPromise; this.onRestored.emit(); - this.analytics.eventTrack.next({ action: 'Bulk Restored Items' }); this.toasterService.popAsync('success', null, this.i18nService.t('restoredItems')); } } diff --git a/src/app/vault/bulk-share.component.ts b/src/app/vault/bulk-share.component.ts index 784436dc..d6335bcc 100644 --- a/src/app/vault/bulk-share.component.ts +++ b/src/app/vault/bulk-share.component.ts @@ -7,7 +7,6 @@ import { } from '@angular/core'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { CipherService } from 'jslib/abstractions/cipher.service'; import { CollectionService } from 'jslib/abstractions/collection.service'; @@ -36,9 +35,9 @@ export class BulkShareComponent implements OnInit { private writeableCollections: CollectionView[] = []; - constructor(private analytics: Angulartics2, private cipherService: CipherService, - private toasterService: ToasterService, private i18nService: I18nService, - private collectionService: CollectionService, private userService: UserService) { } + constructor(private cipherService: CipherService, private toasterService: ToasterService, + private i18nService: I18nService, private collectionService: CollectionService, + private userService: UserService) { } async ngOnInit() { this.shareableCiphers = this.ciphers.filter(c => !c.hasOldAttachments && c.organizationId == null); @@ -72,7 +71,6 @@ export class BulkShareComponent implements OnInit { checkedCollectionIds); await this.formPromise; this.onShared.emit(); - this.analytics.eventTrack.next({ action: 'Bulk Shared Items' }); this.toasterService.popAsync('success', null, this.i18nService.t('sharedItems')); } catch { } } diff --git a/src/app/vault/ciphers.component.ts b/src/app/vault/ciphers.component.ts index bbd32636..587f9eb7 100644 --- a/src/app/vault/ciphers.component.ts +++ b/src/app/vault/ciphers.component.ts @@ -7,7 +7,6 @@ import { } from '@angular/core'; import { ToasterService } from 'angular2-toaster'; -import { Angulartics2 } from 'angulartics2'; import { CipherService } from 'jslib/abstractions/cipher.service'; import { EventService } from 'jslib/abstractions/event.service'; @@ -41,10 +40,10 @@ export class CiphersComponent extends BaseCiphersComponent implements OnDestroy actionPromise: Promise; userHasPremiumAccess = false; - constructor(searchService: SearchService, protected analytics: Angulartics2, - protected toasterService: ToasterService, protected i18nService: I18nService, - protected platformUtilsService: PlatformUtilsService, protected cipherService: CipherService, - protected eventService: EventService, protected totpService: TotpService, protected userService: UserService) { + constructor(searchService: SearchService, protected toasterService: ToasterService, + protected i18nService: I18nService, protected platformUtilsService: PlatformUtilsService, + protected cipherService: CipherService, protected eventService: EventService, + protected totpService: TotpService, protected userService: UserService) { super(searchService); this.pageSize = 200; } @@ -58,7 +57,6 @@ export class CiphersComponent extends BaseCiphersComponent implements OnDestroy } launch(uri: string) { - this.platformUtilsService.eventTrack('Launched Login URI'); this.platformUtilsService.launchUri(uri); } @@ -94,7 +92,6 @@ export class CiphersComponent extends BaseCiphersComponent implements OnDestroy try { this.actionPromise = this.deleteCipher(c.id, permanent); await this.actionPromise; - this.analytics.eventTrack.next({ action: 'Deleted Cipher' }); this.toasterService.popAsync('success', null, this.i18nService.t(permanent ? 'permanentlyDeletedItem' : 'deletedItem')); this.refresh(); @@ -117,7 +114,6 @@ export class CiphersComponent extends BaseCiphersComponent implements OnDestroy try { this.actionPromise = this.cipherService.restoreWithServer(c.id); await this.actionPromise; - this.analytics.eventTrack.next({ action: 'Restored Cipher' }); this.toasterService.popAsync('success', null, this.i18nService.t('restoredItem')); this.refresh(); } catch { } @@ -131,7 +127,6 @@ export class CiphersComponent extends BaseCiphersComponent implements OnDestroy value = await this.totpService.getCode(value); } - this.analytics.eventTrack.next({ action: 'Copied ' + aType.toLowerCase() + ' from listing.' }); this.platformUtilsService.copyToClipboard(value, { window: window }); this.toasterService.popAsync('info', null, this.i18nService.t('valueCopied', this.i18nService.t(typeI18nKey))); diff --git a/src/services/webPlatformUtils.service.ts b/src/services/webPlatformUtils.service.ts index efe003e3..0a443ed3 100644 --- a/src/services/webPlatformUtils.service.ts +++ b/src/services/webPlatformUtils.service.ts @@ -6,8 +6,6 @@ import { I18nService } from 'jslib/abstractions/i18n.service'; import { MessagingService } from 'jslib/abstractions/messaging.service'; import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service'; -import { Utils } from 'jslib/misc/utils'; - export class WebPlatformUtilsService implements PlatformUtilsService { identityClientId: string = 'web'; @@ -78,10 +76,6 @@ export class WebPlatformUtilsService implements PlatformUtilsService { return false; } - analyticsId(): string { - return 'UA-81915606-3'; - } - isViewOpen(): Promise { return Promise.resolve(false); } @@ -217,14 +211,6 @@ export class WebPlatformUtilsService implements PlatformUtilsService { return confirmed.value; } - eventTrack(action: string, label?: string, options?: any) { - this.messagingService.send('analyticsEventTrack', { - action: action, - label: label, - options: options, - }); - } - isDev(): boolean { return process.env.ENV === 'development'; }