1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 09:13:33 +00:00

Remove last remnants of old analytics code (#345)

This commit is contained in:
Oscar Hinton
2021-04-14 21:34:30 +02:00
committed by GitHub
parent 0a0cdaa7fd
commit 92df633040
26 changed files with 1 additions and 202 deletions

View File

@@ -286,7 +286,6 @@ export class AddEditComponent implements OnInit {
this.formPromise = this.saveCipher(cipher);
await this.formPromise;
this.cipher.id = cipher.id;
this.platformUtilsService.eventTrack(this.editMode && !this.cloneMode ? 'Edited Cipher' : 'Added Cipher');
this.platformUtilsService.showToast('success', null,
this.i18nService.t(this.editMode && !this.cloneMode ? 'editedItem' : 'addedItem'));
this.onSavedCipher.emit(this.cipher);
@@ -369,7 +368,6 @@ export class AddEditComponent implements OnInit {
try {
this.deletePromise = this.deleteCipher();
await this.deletePromise;
this.platformUtilsService.eventTrack((this.cipher.isDeleted ? 'Permanently ' : '') + 'Deleted Cipher');
this.platformUtilsService.showToast('success', null,
this.i18nService.t(this.cipher.isDeleted ? 'permanentlyDeletedItem' : 'deletedItem'));
this.onDeletedCipher.emit(this.cipher);
@@ -394,7 +392,6 @@ export class AddEditComponent implements OnInit {
try {
this.restorePromise = this.restoreCipher();
await this.restorePromise;
this.platformUtilsService.eventTrack('Restored Cipher');
this.platformUtilsService.showToast('success', null, this.i18nService.t('restoredItem'));
this.onRestoredCipher.emit(this.cipher);
this.messagingService.send('restoredCipher');
@@ -418,7 +415,6 @@ export class AddEditComponent implements OnInit {
}
togglePassword() {
this.platformUtilsService.eventTrack('Toggled Password on Edit');
this.showPassword = !this.showPassword;
document.getElementById('loginPassword').focus();
if (this.editMode && this.showPassword) {
@@ -427,7 +423,6 @@ export class AddEditComponent implements OnInit {
}
toggleCardCode() {
this.platformUtilsService.eventTrack('Toggled CardCode on Edit');
this.showCardCode = !this.showCardCode;
document.getElementById('cardCode').focus();
if (this.editMode && this.showCardCode) {
@@ -481,7 +476,6 @@ export class AddEditComponent implements OnInit {
return;
}
this.platformUtilsService.eventTrack('Check Password');
this.checkPasswordPromise = this.auditService.passwordLeaked(this.cipher.login.password);
const matches = await this.checkPasswordPromise;
this.checkPasswordPromise = null;

View File

@@ -69,7 +69,6 @@ export class AttachmentsComponent implements OnInit {
this.formPromise = this.saveCipherAttachment(files[0]);
this.cipherDomain = await this.formPromise;
this.cipher = await this.cipherDomain.decrypt();
this.platformUtilsService.eventTrack('Added Attachment');
this.platformUtilsService.showToast('success', null, this.i18nService.t('attachmentSaved'));
this.onUploadedAttachment.emit();
} catch { }
@@ -96,7 +95,6 @@ export class AttachmentsComponent implements OnInit {
try {
this.deletePromises[attachment.id] = this.deleteCipherAttachment(attachment.id);
await this.deletePromises[attachment.id];
this.platformUtilsService.eventTrack('Deleted Attachment');
this.platformUtilsService.showToast('success', null, this.i18nService.t('deletedAttachment'));
const i = this.cipher.attachments.indexOf(attachment);
if (i > -1) {
@@ -219,7 +217,6 @@ export class AttachmentsComponent implements OnInit {
}
}
this.platformUtilsService.eventTrack('Reuploaded Attachment');
this.platformUtilsService.showToast('success', null, this.i18nService.t('attachmentSaved'));
this.onReuploadedAttachment.emit();
} catch (e) {

View File

@@ -64,7 +64,6 @@ export class CollectionsComponent implements OnInit {
this.formPromise = this.saveCollections();
await this.formPromise;
this.onSavedCollections.emit();
this.platformUtilsService.eventTrack('Edited Cipher Collections');
this.platformUtilsService.showToast('success', null, this.i18nService.t('editedItem'));
} catch { }
}

View File

@@ -52,7 +52,6 @@ export class EnvironmentComponent {
this.notificationsUrl = resUrls.notifications;
this.enterpriseUrl = resUrls.enterprise;
this.platformUtilsService.eventTrack('Set Environment URLs');
this.platformUtilsService.showToast('success', null, this.i18nService.t('environmentSaved'));
this.saved();
}

View File

@@ -46,7 +46,6 @@ export class ExportComponent {
try {
this.formPromise = this.getExportData();
const data = await this.formPromise;
this.platformUtilsService.eventTrack('Exported Data');
this.downloadFile(data);
this.saved();
await this.collectEvent();
@@ -74,7 +73,6 @@ export class ExportComponent {
}
togglePassword() {
this.platformUtilsService.eventTrack('Toggled Master Password on Export');
this.showPassword = !this.showPassword;
document.getElementById('masterPassword').focus();
}

View File

@@ -42,7 +42,6 @@ export class FolderAddEditComponent implements OnInit {
const folder = await this.folderService.encrypt(this.folder);
this.formPromise = this.folderService.saveWithServer(folder);
await this.formPromise;
this.platformUtilsService.eventTrack(this.editMode ? 'Edited Folder' : 'Added Folder');
this.platformUtilsService.showToast('success', null,
this.i18nService.t(this.editMode ? 'editedFolder' : 'addedFolder'));
this.onSavedFolder.emit(this.folder);
@@ -63,7 +62,6 @@ export class FolderAddEditComponent implements OnInit {
try {
this.deletePromise = this.folderService.deleteWithServer(this.folder.id);
await this.deletePromise;
this.platformUtilsService.eventTrack('Deleted Folder');
this.platformUtilsService.showToast('success', null, this.i18nService.t('deletedFolder'));
this.onDeletedFolder.emit(this.folder);
} catch { }

View File

@@ -31,7 +31,6 @@ export class HintComponent {
try {
this.formPromise = this.apiService.postPasswordHint(new PasswordHintRequest(this.email));
await this.formPromise;
this.platformUtilsService.eventTrack('Requested Hint');
this.platformUtilsService.showToast('success', null, this.i18nService.t('masterPassSent'));
if (this.onSuccessfulSubmit != null) {
this.onSuccessfulSubmit();

View File

@@ -164,7 +164,6 @@ export class LockComponent implements OnInit {
}
togglePassword() {
this.platformUtilsService.eventTrack('Toggled Master Password on Unlock');
this.showPassword = !this.showPassword;
document.getElementById(this.pinLock ? 'pin' : 'masterPassword').focus();
}

View File

@@ -90,7 +90,6 @@ export class LoginComponent implements OnInit {
await this.storageService.remove(Keys.rememberedEmail);
}
if (response.twoFactor) {
this.platformUtilsService.eventTrack('Logged In To Two-step');
if (this.onSuccessfulLoginTwoFactorNavigate != null) {
this.onSuccessfulLoginTwoFactorNavigate();
} else {
@@ -102,7 +101,6 @@ export class LoginComponent implements OnInit {
if (this.onSuccessfulLogin != null) {
this.onSuccessfulLogin();
}
this.platformUtilsService.eventTrack('Logged In');
if (this.onSuccessfulLoginNavigate != null) {
this.onSuccessfulLoginNavigate();
} else {
@@ -113,7 +111,6 @@ export class LoginComponent implements OnInit {
}
togglePassword() {
this.platformUtilsService.eventTrack('Toggled Master Password on Login');
this.showPassword = !this.showPassword;
document.getElementById('masterPassword').focus();
}

View File

@@ -23,7 +23,6 @@ export class PasswordGeneratorHistoryComponent implements OnInit {
}
copy(password: string) {
this.platformUtilsService.eventTrack('Copied Historical Password');
const copyOptions = this.win != null ? { window: this.win } : null;
this.platformUtilsService.copyToClipboard(password, copyOptions);
this.platformUtilsService.showToast('info', null,

View File

@@ -34,14 +34,12 @@ export class PasswordGeneratorComponent implements OnInit {
this.avoidAmbiguous = !this.options.ambiguous;
this.options.type = this.options.type === 'passphrase' ? 'passphrase' : 'password';
this.password = await this.passwordGenerationService.generatePassword(this.options);
this.platformUtilsService.eventTrack('Generated Password');
await this.passwordGenerationService.addHistory(this.password);
}
async sliderChanged() {
this.saveOptions(false);
await this.passwordGenerationService.addHistory(this.password);
this.platformUtilsService.eventTrack('Regenerated Password');
}
async sliderInput() {
@@ -61,11 +59,9 @@ export class PasswordGeneratorComponent implements OnInit {
async regenerate() {
this.password = await this.passwordGenerationService.generatePassword(this.options);
await this.passwordGenerationService.addHistory(this.password);
this.platformUtilsService.eventTrack('Regenerated Password');
}
copy() {
this.platformUtilsService.eventTrack('Copied Generated Password');
const copyOptions = this.win != null ? { window: this.win } : null;
this.platformUtilsService.copyToClipboard(this.password, copyOptions);
this.platformUtilsService.showToast('info', null,
@@ -73,7 +69,6 @@ export class PasswordGeneratorComponent implements OnInit {
}
select() {
this.platformUtilsService.eventTrack('Selected Generated Password');
this.onSelected.emit(this.password);
}

View File

@@ -18,7 +18,6 @@ export class PasswordHistoryComponent implements OnInit {
}
copy(password: string) {
this.platformUtilsService.eventTrack('Copied Password History');
const copyOptions = this.win != null ? { window: this.win } : null;
this.platformUtilsService.copyToClipboard(password, copyOptions);
this.platformUtilsService.showToast('info', null,

View File

@@ -31,7 +31,6 @@ export class PremiumComponent implements OnInit {
const confirmed = await this.platformUtilsService.showDialog(this.i18nService.t('premiumPurchaseAlert'),
this.i18nService.t('premiumPurchase'), this.i18nService.t('yes'), this.i18nService.t('cancel'));
if (confirmed) {
this.platformUtilsService.eventTrack('Clicked Purchase Premium');
this.platformUtilsService.launchUri('https://vault.bitwarden.com/#/?premium=purchase');
}
}
@@ -40,7 +39,6 @@ export class PremiumComponent implements OnInit {
const confirmed = await this.platformUtilsService.showDialog(this.i18nService.t('premiumManageAlert'),
this.i18nService.t('premiumManage'), this.i18nService.t('yes'), this.i18nService.t('cancel'));
if (confirmed) {
this.platformUtilsService.eventTrack('Clicked Manage Membership');
this.platformUtilsService.launchUri('https://vault.bitwarden.com/#/?premium=manage');
}
}

View File

@@ -138,14 +138,12 @@ export class RegisterComponent {
try {
this.formPromise = this.apiService.postRegister(request);
await this.formPromise;
this.platformUtilsService.eventTrack('Registered');
this.platformUtilsService.showToast('success', null, this.i18nService.t('newAccountCreated'));
this.router.navigate([this.successRoute], { queryParams: { email: this.email } });
} catch { }
}
togglePassword(confirmField: boolean) {
this.platformUtilsService.eventTrack('Toggled Master Password on Register');
this.showPassword = !this.showPassword;
document.getElementById(confirmField ? 'masterPasswordRetype' : 'masterPassword').focus();
}

View File

@@ -99,7 +99,6 @@ export class SetPasswordComponent extends BaseChangePasswordComponent {
}
togglePassword(confirmField: boolean) {
this.platformUtilsService.eventTrack('Toggled Master Password on Set Password');
this.showPassword = !this.showPassword;
document.getElementById(confirmField ? 'masterPasswordRetype' : 'masterPassword').focus();
}

View File

@@ -82,7 +82,6 @@ export class ShareComponent implements OnInit {
this.formPromise = this.cipherService.shareWithServer(cipherView, this.organizationId,
selectedCollectionIds).then(async () => {
this.onSharedCipher.emit();
this.platformUtilsService.eventTrack('Shared Cipher');
this.platformUtilsService.showToast('success', null, this.i18nService.t('sharedItem'));
});
await this.formPromise;

View File

@@ -138,7 +138,6 @@ export class SsoComponent {
this.formPromise = this.authService.logInSso(code, codeVerifier, this.redirectUri);
const response = await this.formPromise;
if (response.twoFactor) {
this.platformUtilsService.eventTrack('SSO Logged In To Two-step');
if (this.onSuccessfulLoginTwoFactorNavigate != null) {
this.onSuccessfulLoginTwoFactorNavigate();
} else {
@@ -150,7 +149,6 @@ export class SsoComponent {
});
}
} else if (response.resetMasterPassword) {
this.platformUtilsService.eventTrack('SSO - routing to complete registration');
if (this.onSuccessfulLoginChangePasswordNavigate != null) {
this.onSuccessfulLoginChangePasswordNavigate();
} else {
@@ -166,7 +164,6 @@ export class SsoComponent {
if (this.onSuccessfulLogin != null) {
this.onSuccessfulLogin();
}
this.platformUtilsService.eventTrack('SSO Logged In');
if (this.onSuccessfulLoginNavigate != null) {
this.onSuccessfulLoginNavigate();
} else {

View File

@@ -32,7 +32,6 @@ export class TwoFactorOptionsComponent implements OnInit {
}
recover() {
this.platformUtilsService.eventTrack('Selected Recover');
this.platformUtilsService.launchUri('https://help.bitwarden.com/article/lost-two-step-device/');
this.onRecoverSelected.emit();
}

View File

@@ -187,7 +187,6 @@ export class TwoFactorComponent implements OnInit, OnDestroy {
if (this.onSuccessfulLogin != null) {
this.onSuccessfulLogin();
}
this.platformUtilsService.eventTrack('Logged In From Two-step');
if (response.resetMasterPassword) {
this.successRoute = 'set-password';
}

View File

@@ -129,7 +129,6 @@ export class ViewComponent implements OnDestroy, OnInit {
try {
await this.deleteCipher();
this.platformUtilsService.eventTrack((this.cipher.isDeleted ? 'Permanently ' : '') + 'Deleted Cipher');
this.platformUtilsService.showToast('success', null,
this.i18nService.t(this.cipher.isDeleted ? 'permanentlyDeletedItem' : 'deletedItem'));
this.onDeletedCipher.emit(this.cipher);
@@ -152,7 +151,6 @@ export class ViewComponent implements OnDestroy, OnInit {
try {
await this.restoreCipher();
this.platformUtilsService.eventTrack('Restored Cipher');
this.platformUtilsService.showToast('success', null, this.i18nService.t('restoredItem'));
this.onRestoredCipher.emit(this.cipher);
} catch { }
@@ -161,7 +159,6 @@ export class ViewComponent implements OnDestroy, OnInit {
}
togglePassword() {
this.platformUtilsService.eventTrack('Toggled Password');
this.showPassword = !this.showPassword;
if (this.showPassword) {
this.eventService.collect(EventType.Cipher_ClientToggledPasswordVisible, this.cipherId);
@@ -169,7 +166,6 @@ export class ViewComponent implements OnDestroy, OnInit {
}
toggleCardCode() {
this.platformUtilsService.eventTrack('Toggled Card Code');
this.showCardCode = !this.showCardCode;
if (this.showCardCode) {
this.eventService.collect(EventType.Cipher_ClientToggledCardCodeVisible, this.cipherId);
@@ -181,7 +177,6 @@ export class ViewComponent implements OnDestroy, OnInit {
return;
}
this.platformUtilsService.eventTrack('Check Password');
this.checkPasswordPromise = this.auditService.passwordLeaked(this.cipher.login.password);
const matches = await this.checkPasswordPromise;
@@ -210,7 +205,6 @@ export class ViewComponent implements OnDestroy, OnInit {
this.cipherService.updateLastLaunchedDate(cipherId);
}
this.platformUtilsService.eventTrack('Launched Login URI');
this.platformUtilsService.launchUri(uri.launchUri);
}
@@ -219,7 +213,6 @@ export class ViewComponent implements OnDestroy, OnInit {
return;
}
this.platformUtilsService.eventTrack('Copied ' + aType);
const copyOptions = this.win != null ? { window: this.win } : null;
this.platformUtilsService.copyToClipboard(value, copyOptions);
this.platformUtilsService.showToast('info', null,