mirror of
https://github.com/bitwarden/browser
synced 2026-01-04 17:43:39 +00:00
Match linter rules
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import {
|
||||
Component,
|
||||
OnDestroy,
|
||||
NgZone,
|
||||
OnDestroy,
|
||||
} from '@angular/core';
|
||||
import {
|
||||
ActivatedRoute,
|
||||
@@ -43,7 +43,7 @@ export class LockComponent extends BaseLockComponent implements OnDestroy {
|
||||
|
||||
async ngOnInit() {
|
||||
await super.ngOnInit();
|
||||
this.route.queryParams.subscribe((params) => {
|
||||
this.route.queryParams.subscribe(params => {
|
||||
if (this.supportsBiometric && params.promptBiometric) {
|
||||
setTimeout(() => this.unlockBiometric(), 1000);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import {
|
||||
Component,
|
||||
ComponentFactoryResolver,
|
||||
OnDestroy,
|
||||
NgZone,
|
||||
OnDestroy,
|
||||
ViewChild,
|
||||
ViewContainerRef,
|
||||
} from '@angular/core';
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import {
|
||||
Component,
|
||||
NgZone,
|
||||
OnDestroy,
|
||||
OnInit,
|
||||
NgZone,
|
||||
} from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {
|
||||
Component,
|
||||
OnDestroy,
|
||||
NgZone,
|
||||
OnDestroy,
|
||||
} from '@angular/core';
|
||||
|
||||
import {
|
||||
|
||||
@@ -22,8 +22,8 @@ import { ConstantsService } from 'jslib/services/constants.service';
|
||||
|
||||
import { ElectronConstants } from 'jslib/electron/electronConstants';
|
||||
|
||||
import { Utils } from 'jslib/misc/utils';
|
||||
import { isWindowsStore } from 'jslib/electron/utils';
|
||||
import { Utils } from 'jslib/misc/utils';
|
||||
|
||||
@Component({
|
||||
selector: 'app-settings',
|
||||
@@ -81,15 +81,15 @@ export class SettingsComponent implements OnInit {
|
||||
this.enableTrayDescText = this.i18nService.t(trayKey + 'Desc');
|
||||
|
||||
const minToTrayKey = isMac ? 'enableMinToMenuBar' : 'enableMinToTray';
|
||||
this.enableMinToTrayText = this.i18nService.t(minToTrayKey)
|
||||
this.enableMinToTrayText = this.i18nService.t(minToTrayKey);
|
||||
this.enableMinToTrayDescText = this.i18nService.t(minToTrayKey + 'Desc');
|
||||
|
||||
const closeToTrayKey = isMac ? 'enableCloseToMenuBar' : 'enableCloseToTray';
|
||||
this.enableCloseToTrayText = this.i18nService.t(closeToTrayKey)
|
||||
this.enableCloseToTrayText = this.i18nService.t(closeToTrayKey);
|
||||
this.enableCloseToTrayDescText = this.i18nService.t(closeToTrayKey + 'Desc');
|
||||
|
||||
const startToTrayKey = isMac ? 'startToMenuBar' : 'startToTray';
|
||||
this.startToTrayText = this.i18nService.t(startToTrayKey)
|
||||
this.startToTrayText = this.i18nService.t(startToTrayKey);
|
||||
this.startToTrayDescText = this.i18nService.t(startToTrayKey + 'Desc');
|
||||
|
||||
this.vaultTimeouts = [
|
||||
@@ -114,7 +114,7 @@ export class SettingsComponent implements OnInit {
|
||||
]);
|
||||
|
||||
const localeOptions: any[] = [];
|
||||
i18nService.supportedTranslationLocales.forEach((locale) => {
|
||||
i18nService.supportedTranslationLocales.forEach(locale => {
|
||||
let name = locale;
|
||||
if (i18nService.localeNames.has(locale)) {
|
||||
name += (' - ' + i18nService.localeNames.get(locale));
|
||||
|
||||
@@ -90,8 +90,8 @@ import localePtBr from '@angular/common/locales/pt';
|
||||
import localePtPt from '@angular/common/locales/pt-PT';
|
||||
import localeRo from '@angular/common/locales/ro';
|
||||
import localeRu from '@angular/common/locales/ru';
|
||||
import localeSr from '@angular/common/locales/sr';
|
||||
import localeSk from '@angular/common/locales/sk';
|
||||
import localeSr from '@angular/common/locales/sr';
|
||||
import localeSv from '@angular/common/locales/sv';
|
||||
import localeTh from '@angular/common/locales/th';
|
||||
import localeTr from '@angular/common/locales/tr';
|
||||
|
||||
@@ -15,5 +15,5 @@ if (!isDev()) {
|
||||
platformBrowserDynamic().bootstrapModule(AppModule, { preserveWhitespaces: true });
|
||||
|
||||
// Disable drag and drop to prevent malicious links from executing in the context of the app
|
||||
document.addEventListener('dragover', (event) => event.preventDefault());
|
||||
document.addEventListener('drop', (event) => event.preventDefault());
|
||||
document.addEventListener('dragover', event => event.preventDefault());
|
||||
document.addEventListener('drop', event => event.preventDefault());
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import {
|
||||
Component,
|
||||
NgZone,
|
||||
OnChanges,
|
||||
OnDestroy,
|
||||
NgZone,
|
||||
} from '@angular/core';
|
||||
|
||||
import { AuditService } from 'jslib/abstractions/audit.service';
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import {
|
||||
Component,
|
||||
NgZone,
|
||||
OnDestroy,
|
||||
OnInit,
|
||||
NgZone,
|
||||
} from '@angular/core';
|
||||
|
||||
import { CryptoService } from 'jslib/abstractions/crypto.service';
|
||||
|
||||
@@ -194,7 +194,7 @@ export class VaultComponent implements OnInit, OnDestroy {
|
||||
|
||||
async load() {
|
||||
let loaded = false;
|
||||
const queryParamsSub = this.route.queryParams.subscribe(async (params) => {
|
||||
const queryParamsSub = this.route.queryParams.subscribe(async params => {
|
||||
if (loaded) {
|
||||
return;
|
||||
}
|
||||
@@ -423,7 +423,7 @@ export class VaultComponent implements OnInit, OnDestroy {
|
||||
const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);
|
||||
this.modal = this.attachmentsModalRef.createComponent(factory).instance;
|
||||
const childComponent = this.modal.show<AttachmentsComponent>(AttachmentsComponent, this.attachmentsModalRef,
|
||||
true, (comp) => comp.cipherId = cipher.id);
|
||||
true, comp => comp.cipherId = cipher.id);
|
||||
let madeAttachmentChanges = false;
|
||||
childComponent.onUploadedAttachment.subscribe(() => madeAttachmentChanges = true);
|
||||
childComponent.onDeletedAttachment.subscribe(() => madeAttachmentChanges = true);
|
||||
@@ -445,7 +445,7 @@ export class VaultComponent implements OnInit, OnDestroy {
|
||||
const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);
|
||||
this.modal = this.shareModalRef.createComponent(factory).instance;
|
||||
const childComponent = this.modal.show<ShareComponent>(ShareComponent, this.shareModalRef, true,
|
||||
(comp) => comp.cipherId = cipher.id);
|
||||
comp => comp.cipherId = cipher.id);
|
||||
|
||||
childComponent.onSharedCipher.subscribe(async () => {
|
||||
this.modal.close();
|
||||
@@ -465,7 +465,7 @@ export class VaultComponent implements OnInit, OnDestroy {
|
||||
const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);
|
||||
this.modal = this.collectionsModalRef.createComponent(factory).instance;
|
||||
const childComponent = this.modal.show<CollectionsComponent>(CollectionsComponent, this.collectionsModalRef,
|
||||
true, (comp) => comp.cipherId = cipher.id);
|
||||
true, comp => comp.cipherId = cipher.id);
|
||||
|
||||
childComponent.onSavedCollections.subscribe(() => {
|
||||
this.modal.close();
|
||||
@@ -484,7 +484,7 @@ export class VaultComponent implements OnInit, OnDestroy {
|
||||
const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);
|
||||
this.modal = this.passwordHistoryModalRef.createComponent(factory).instance;
|
||||
this.modal.show<PasswordHistoryComponent>(PasswordHistoryComponent,
|
||||
this.passwordHistoryModalRef, true, (comp) => comp.cipherId = cipher.id);
|
||||
this.passwordHistoryModalRef, true, comp => comp.cipherId = cipher.id);
|
||||
this.modal.onClosed.subscribe(async () => {
|
||||
this.modal = null;
|
||||
});
|
||||
@@ -505,7 +505,7 @@ export class VaultComponent implements OnInit, OnDestroy {
|
||||
|
||||
async filterFavorites() {
|
||||
this.ciphersComponent.searchPlaceholder = this.i18nService.t('searchFavorites');
|
||||
await this.ciphersComponent.reload((c) => c.favorite);
|
||||
await this.ciphersComponent.reload(c => c.favorite);
|
||||
this.clearFilters();
|
||||
this.favorites = true;
|
||||
this.go();
|
||||
@@ -522,7 +522,7 @@ export class VaultComponent implements OnInit, OnDestroy {
|
||||
|
||||
async filterCipherType(type: CipherType) {
|
||||
this.ciphersComponent.searchPlaceholder = this.i18nService.t('searchType');
|
||||
await this.ciphersComponent.reload((c) => c.type === type);
|
||||
await this.ciphersComponent.reload(c => c.type === type);
|
||||
this.clearFilters();
|
||||
this.type = type;
|
||||
this.go();
|
||||
@@ -531,7 +531,7 @@ export class VaultComponent implements OnInit, OnDestroy {
|
||||
async filterFolder(folderId: string) {
|
||||
folderId = folderId === 'none' ? null : folderId;
|
||||
this.ciphersComponent.searchPlaceholder = this.i18nService.t('searchFolder');
|
||||
await this.ciphersComponent.reload((c) => c.folderId === folderId);
|
||||
await this.ciphersComponent.reload(c => c.folderId === folderId);
|
||||
this.clearFilters();
|
||||
this.folderId = folderId == null ? 'none' : folderId;
|
||||
this.go();
|
||||
@@ -539,7 +539,7 @@ export class VaultComponent implements OnInit, OnDestroy {
|
||||
|
||||
async filterCollection(collectionId: string) {
|
||||
this.ciphersComponent.searchPlaceholder = this.i18nService.t('searchCollection');
|
||||
await this.ciphersComponent.reload((c) => c.collectionIds != null &&
|
||||
await this.ciphersComponent.reload(c => c.collectionIds != null &&
|
||||
c.collectionIds.indexOf(collectionId) > -1);
|
||||
this.clearFilters();
|
||||
this.collectionId = collectionId;
|
||||
@@ -555,7 +555,7 @@ export class VaultComponent implements OnInit, OnDestroy {
|
||||
const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);
|
||||
this.modal = this.passwordGeneratorModalRef.createComponent(factory).instance;
|
||||
const childComponent = this.modal.show<PasswordGeneratorComponent>(PasswordGeneratorComponent,
|
||||
this.passwordGeneratorModalRef, true, (comp) => comp.showSelect = showSelect);
|
||||
this.passwordGeneratorModalRef, true, comp => comp.showSelect = showSelect);
|
||||
|
||||
childComponent.onSelected.subscribe((password: string) => {
|
||||
this.modal.close();
|
||||
@@ -596,7 +596,7 @@ export class VaultComponent implements OnInit, OnDestroy {
|
||||
const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);
|
||||
this.modal = this.folderAddEditModalRef.createComponent(factory).instance;
|
||||
const childComponent = this.modal.show<FolderAddEditComponent>(
|
||||
FolderAddEditComponent, this.folderAddEditModalRef, true, (comp) => comp.folderId = null);
|
||||
FolderAddEditComponent, this.folderAddEditModalRef, true, comp => comp.folderId = null);
|
||||
|
||||
childComponent.onSavedFolder.subscribe(async (folder: FolderView) => {
|
||||
this.modal.close();
|
||||
@@ -616,7 +616,7 @@ export class VaultComponent implements OnInit, OnDestroy {
|
||||
const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);
|
||||
this.modal = this.folderAddEditModalRef.createComponent(factory).instance;
|
||||
const childComponent = this.modal.show<FolderAddEditComponent>(
|
||||
FolderAddEditComponent, this.folderAddEditModalRef, true, (comp) => comp.folderId = folderId);
|
||||
FolderAddEditComponent, this.folderAddEditModalRef, true, comp => comp.folderId = folderId);
|
||||
|
||||
childComponent.onSavedFolder.subscribe(async (folder: FolderView) => {
|
||||
this.modal.close();
|
||||
@@ -699,7 +699,7 @@ export class VaultComponent implements OnInit, OnDestroy {
|
||||
|
||||
private updateCollectionProperties() {
|
||||
if (this.collectionId != null) {
|
||||
const collection = this.groupingsComponent.collections.filter((c) => c.id === this.collectionId);
|
||||
const collection = this.groupingsComponent.collections.filter(c => c.id === this.collectionId);
|
||||
if (collection.length > 0) {
|
||||
this.addOrganizationId = collection[0].organizationId;
|
||||
this.addCollectionIds = [this.collectionId];
|
||||
|
||||
Reference in New Issue
Block a user