mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 00:33:44 +00:00
@@ -3,8 +3,6 @@ import {
|
||||
OnInit,
|
||||
} from '@angular/core';
|
||||
|
||||
import { ToasterService } from 'angular2-toaster';
|
||||
import { Angulartics2 } from 'angulartics2';
|
||||
import Swal from 'sweetalert2/src/sweetalert2.js';
|
||||
|
||||
import { DeviceType } from 'jslib/enums/deviceType';
|
||||
@@ -66,8 +64,7 @@ export class SettingsComponent implements OnInit {
|
||||
startToTrayText: string;
|
||||
startToTrayDescText: string;
|
||||
|
||||
constructor(private analytics: Angulartics2, private toasterService: ToasterService,
|
||||
private i18nService: I18nService, private platformUtilsService: PlatformUtilsService,
|
||||
constructor(private i18nService: I18nService, private platformUtilsService: PlatformUtilsService,
|
||||
private storageService: StorageService, private vaultTimeoutService: VaultTimeoutService,
|
||||
private stateService: StateService, private messagingService: MessagingService,
|
||||
private userService: UserService, private cryptoService: CryptoService) {
|
||||
@@ -267,12 +264,10 @@ export class SettingsComponent implements OnInit {
|
||||
await this.storageService.save(ConstantsService.disableFaviconKey, this.disableFavicons);
|
||||
await this.stateService.save(ConstantsService.disableFaviconKey, this.disableFavicons);
|
||||
this.messagingService.send('refreshCiphers');
|
||||
this.callAnalytics('Favicons', !this.disableFavicons);
|
||||
}
|
||||
|
||||
async saveMinToTray() {
|
||||
await this.storageService.save(ElectronConstants.enableMinimizeToTrayKey, this.enableMinToTray);
|
||||
this.callAnalytics('MinimizeToTray', this.enableMinToTray);
|
||||
}
|
||||
|
||||
async saveCloseToTray() {
|
||||
@@ -282,7 +277,6 @@ export class SettingsComponent implements OnInit {
|
||||
}
|
||||
|
||||
await this.storageService.save(ElectronConstants.enableCloseToTrayKey, this.enableCloseToTray);
|
||||
this.callAnalytics('CloseToTray', this.enableCloseToTray);
|
||||
}
|
||||
|
||||
async saveTray() {
|
||||
@@ -304,7 +298,6 @@ export class SettingsComponent implements OnInit {
|
||||
}
|
||||
|
||||
await this.storageService.save(ElectronConstants.enableTrayKey, this.enableTray);
|
||||
this.callAnalytics('Tray', this.enableTray);
|
||||
this.messagingService.send(this.enableTray ? 'showTray' : 'removeTray');
|
||||
}
|
||||
|
||||
@@ -315,30 +308,23 @@ export class SettingsComponent implements OnInit {
|
||||
}
|
||||
|
||||
await this.storageService.save(ElectronConstants.enableStartToTrayKey, this.startToTray);
|
||||
this.callAnalytics('StartToTray', this.startToTray);
|
||||
}
|
||||
|
||||
async saveLocale() {
|
||||
await this.storageService.save(ConstantsService.localeKey, this.locale);
|
||||
this.analytics.eventTrack.next({ action: 'Set Locale ' + this.locale });
|
||||
}
|
||||
|
||||
async saveTheme() {
|
||||
await this.storageService.save(ConstantsService.themeKey, this.theme);
|
||||
this.analytics.eventTrack.next({ action: 'Set Theme ' + this.theme });
|
||||
window.setTimeout(() => window.location.reload(), 200);
|
||||
}
|
||||
|
||||
async saveMinOnCopyToClipboard() {
|
||||
await this.storageService.save(ElectronConstants.minimizeOnCopyToClipboardKey, this.minimizeOnCopyToClipboard);
|
||||
this.callAnalytics('MinOnCopyToClipboard', this.minimizeOnCopyToClipboard);
|
||||
}
|
||||
|
||||
async saveClearClipboard() {
|
||||
await this.storageService.save(ConstantsService.clearClipboardKey, this.clearClipboard);
|
||||
this.analytics.eventTrack.next({
|
||||
action: 'Set Clear Clipboard ' + (this.clearClipboard == null ? 'Disabled' : this.clearClipboard),
|
||||
});
|
||||
}
|
||||
|
||||
async saveAlwaysShowDock() {
|
||||
@@ -381,9 +367,4 @@ export class SettingsComponent implements OnInit {
|
||||
async saveBrowserIntegrationFingerprint() {
|
||||
await this.storageService.save(ElectronConstants.enableBrowserIntegrationFingerprint, this.enableBrowserIntegrationFingerprint);
|
||||
}
|
||||
|
||||
private callAnalytics(name: string, enabled: boolean) {
|
||||
const status = enabled ? 'Enabled' : 'Disabled';
|
||||
this.analytics.eventTrack.next({ action: `${status} ${name}` });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ import {
|
||||
ToasterConfig,
|
||||
ToasterService,
|
||||
} from 'angular2-toaster';
|
||||
import { Angulartics2 } from 'angulartics2';
|
||||
|
||||
import {
|
||||
Component,
|
||||
@@ -100,7 +99,7 @@ export class AppComponent implements OnInit {
|
||||
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 sanitizer: DomSanitizer, private ngZone: NgZone,
|
||||
private vaultTimeoutService: VaultTimeoutService, private storageService: StorageService,
|
||||
@@ -195,12 +194,6 @@ export class AppComponent implements OnInit {
|
||||
case 'showToast':
|
||||
this.showToast(message);
|
||||
break;
|
||||
case 'analyticsEventTrack':
|
||||
this.analytics.eventTrack.next({
|
||||
action: message.action,
|
||||
properties: { label: message.label },
|
||||
});
|
||||
break;
|
||||
case 'copiedToClipboard':
|
||||
if (!message.clearing) {
|
||||
this.systemService.clearClipboard(message.clipboardValue, message.clearMs);
|
||||
@@ -230,7 +223,6 @@ export class AppComponent implements OnInit {
|
||||
try {
|
||||
await this.syncService.fullSync(true, true);
|
||||
this.toasterService.popAsync('success', null, this.i18nService.t('syncingComplete'));
|
||||
this.analytics.eventTrack.next({ action: 'Synced Full' });
|
||||
} catch {
|
||||
this.toasterService.popAsync('error', null, this.i18nService.t('syncingFailed'));
|
||||
}
|
||||
@@ -367,7 +359,6 @@ export class AppComponent implements OnInit {
|
||||
this.vaultTimeoutService.biometricLocked = true;
|
||||
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'));
|
||||
|
||||
@@ -2,8 +2,6 @@ import 'core-js';
|
||||
import 'zone.js/dist/zone';
|
||||
|
||||
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';
|
||||
@@ -150,11 +148,6 @@ registerLocaleData(localeZhTw, 'zh-TW');
|
||||
FormsModule,
|
||||
AppRoutingModule,
|
||||
ServicesModule,
|
||||
Angulartics2Module.forRoot({
|
||||
pageTracking: {
|
||||
clearQueryParams: true,
|
||||
},
|
||||
}),
|
||||
ToasterModule.forRoot(),
|
||||
InfiniteScrollModule,
|
||||
DragDropModule,
|
||||
|
||||
@@ -22,8 +22,6 @@ import { AuthGuardService } from 'jslib/angular/services/auth-guard.service';
|
||||
import { BroadcasterService } from 'jslib/angular/services/broadcaster.service';
|
||||
import { ValidationService } from 'jslib/angular/services/validation.service';
|
||||
|
||||
import { Analytics } from 'jslib/misc/analytics';
|
||||
|
||||
import { ApiService } from 'jslib/services/api.service';
|
||||
import { AppIdService } from 'jslib/services/appId.service';
|
||||
import { AuditService } from 'jslib/services/audit.service';
|
||||
@@ -138,7 +136,6 @@ const systemService = new SystemService(storageService, vaultTimeoutService, mes
|
||||
const nativeMessagingService = new NativeMessagingService(cryptoFunctionService, cryptoService, platformUtilsService,
|
||||
logService, i18nService, userService, messagingService, vaultTimeoutService, storageService);
|
||||
|
||||
const analytics = new Analytics(window, () => isDev(), platformUtilsService, storageService, appIdService);
|
||||
containerService.attachToGlobal(window);
|
||||
|
||||
export function initFactory(): Function {
|
||||
@@ -177,10 +174,6 @@ export function initFactory(): Function {
|
||||
|
||||
if (installAction != null) {
|
||||
await storageService.save(ConstantsService.installedVersionKey, currentVersion);
|
||||
analytics.ga('send', {
|
||||
hitType: 'event',
|
||||
eventAction: installAction,
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ import {
|
||||
} from '@angular/router';
|
||||
|
||||
import { ToasterService } from 'angular2-toaster';
|
||||
import { Angulartics2 } from 'angulartics2';
|
||||
|
||||
import { BroadcasterService } from 'jslib/angular/services/broadcaster.service';
|
||||
|
||||
@@ -82,7 +81,7 @@ export class VaultComponent implements OnInit, OnDestroy {
|
||||
constructor(private route: ActivatedRoute, private router: Router,
|
||||
private componentFactoryResolver: ComponentFactoryResolver, private i18nService: I18nService,
|
||||
private broadcasterService: BroadcasterService, private changeDetectorRef: ChangeDetectorRef,
|
||||
private ngZone: NgZone, private syncService: SyncService, private analytics: Angulartics2,
|
||||
private ngZone: NgZone, private syncService: SyncService,
|
||||
private toasterService: ToasterService, private messagingService: MessagingService,
|
||||
private platformUtilsService: PlatformUtilsService, private eventService: EventService,
|
||||
private totpService: TotpService, private userService: UserService) { }
|
||||
|
||||
@@ -68,7 +68,6 @@ export class ViewComponent extends BaseViewComponent implements OnChanges {
|
||||
}
|
||||
|
||||
viewHistory() {
|
||||
this.platformUtilsService.eventTrack('View Password History');
|
||||
this.onViewCipherPasswordHistory.emit(this.cipher);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user