1
0
mirror of https://github.com/bitwarden/browser synced 2026-01-06 10:33:57 +00:00

Remove dead code (#930)

* Remove last remnants of old analytics code
This commit is contained in:
Oscar Hinton
2021-04-14 23:43:40 +02:00
committed by GitHub
parent 53bd9a3b14
commit a9ef011cf3
60 changed files with 107 additions and 299 deletions

View File

@@ -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 { }
}

View File

@@ -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<any>;
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 { }

View File

@@ -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<any>;
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({

View File

@@ -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 { }
}
}

View File

@@ -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<any>;
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');

View File

@@ -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<any>;
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');

View File

@@ -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<any>;
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');

View File

@@ -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<any>;
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');

View File

@@ -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<any>;
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 { }
}

View File

@@ -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 {

View File

@@ -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]);

View File

@@ -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 { }

View File

@@ -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<any>;
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']);

View File

@@ -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<any>;
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 { }
}

View File

@@ -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<any>;
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']);

View File

@@ -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;

View File

@@ -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<void>) {
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 { }

View File

@@ -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<any>;
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) {

View File

@@ -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<any>;
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) {

View File

@@ -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<any>;
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) {

View File

@@ -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<any>;
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) {

View File

@@ -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<any>;
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'),

View File

@@ -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<any>;
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 { }

View File

@@ -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<any>;
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 { }

View File

@@ -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 { }

View File

@@ -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<any>;
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;