1
0
mirror of https://github.com/bitwarden/browser synced 2026-01-06 18:43:25 +00:00

lint fixes

This commit is contained in:
Kyle Spearrin
2018-02-08 10:37:54 -05:00
parent 7d8b00904a
commit 58e39c0c81
22 changed files with 100 additions and 90 deletions

View File

@@ -8,8 +8,8 @@ import {
Output,
} from '@angular/core';
import { Angulartics2 } from 'angulartics2';
import { ToasterService } from 'angular2-toaster';
import { Angulartics2 } from 'angulartics2';
import { CipherType } from 'jslib/enums/cipherType';
import { FieldType } from 'jslib/enums/fieldType';
@@ -144,7 +144,8 @@ export class AddEditComponent implements OnChanges {
await this.formPromise;
this.cipher.id = cipher.id;
this.analytics.eventTrack.next({ action: this.editMode ? 'Edited Cipher' : 'Added Cipher' });
this.toasterService.popAsync('success', null, this.i18nService.t(this.editMode ? 'editedItem' : 'addedItem'));
this.toasterService.popAsync('success', null,
this.i18nService.t(this.editMode ? 'editedItem' : 'addedItem'));
this.onSavedCipher.emit(this.cipher);
} catch { }
}
@@ -177,7 +178,7 @@ export class AddEditComponent implements OnChanges {
async delete() {
const confirmed = await this.platformUtilsService.showDialog(
this.i18nService.t('deleteItemConfirmation'), this.i18nService.t('deleteItem'),
this.i18nService.t('yes'), this.i18nService.t('no'), 'warning')
this.i18nService.t('yes'), this.i18nService.t('no'), 'warning');
if (!confirmed) {
return;
}
@@ -195,7 +196,7 @@ export class AddEditComponent implements OnChanges {
if (this.cipher.login != null && this.cipher.login.password != null && this.cipher.login.password.length) {
const confirmed = await this.platformUtilsService.showDialog(
this.i18nService.t('overwritePasswordConfirmation'), this.i18nService.t('overwritePassword'),
this.i18nService.t('yes'), this.i18nService.t('no'))
this.i18nService.t('yes'), this.i18nService.t('no'));
if (!confirmed) {
return;
}

View File

@@ -8,8 +8,8 @@ import {
Output,
} from '@angular/core';
import { Angulartics2 } from 'angulartics2';
import { ToasterService } from 'angular2-toaster';
import { Angulartics2 } from 'angulartics2';
import { CipherService } from 'jslib/abstractions/cipher.service';
import { CryptoService } from 'jslib/abstractions/crypto.service';
@@ -19,8 +19,8 @@ import { TokenService } from 'jslib/abstractions/token.service';
import { Cipher } from 'jslib/models/domain/cipher';
import { CipherView } from 'jslib/models/view/cipherView';
import { AttachmentView } from 'jslib/models/view/attachmentView';
import { CipherView } from 'jslib/models/view/cipherView';
@Component({
selector: 'app-vault-attachments',
@@ -53,14 +53,14 @@ export class AttachmentsComponent implements OnInit {
if (!this.canAccessAttachments) {
const confirmed = await this.platformUtilsService.showDialog(
this.i18nService.t('premiumRequiredDesc'), this.i18nService.t('premiumRequired'),
this.i18nService.t('learnMore'), this.i18nService.t('cancel'))
this.i18nService.t('learnMore'), this.i18nService.t('cancel'));
if (confirmed) {
this.platformUtilsService.launchUri('https://vault.bitwarden.com/#/?premium=purchase');
}
} else if (!this.hasUpdatedKey) {
const confirmed = await this.platformUtilsService.showDialog(
this.i18nService.t('updateKey'), this.i18nService.t('featureUnavailable'),
this.i18nService.t('learnMore'), this.i18nService.t('cancel'), 'warning')
this.i18nService.t('learnMore'), this.i18nService.t('cancel'), 'warning');
if (confirmed) {
this.platformUtilsService.launchUri('https://help.bitwarden.com/article/update-encryption-key/');
}
@@ -110,7 +110,7 @@ export class AttachmentsComponent implements OnInit {
const confirmed = await this.platformUtilsService.showDialog(
this.i18nService.t('deleteAttachmentConfirmation'), this.i18nService.t('deleteAttachment'),
this.i18nService.t('yes'), this.i18nService.t('no'), 'warning')
this.i18nService.t('yes'), this.i18nService.t('no'), 'warning');
if (!confirmed) {
return;
}

View File

@@ -7,10 +7,10 @@ import {
Output,
} from '@angular/core';
import { CipherView } from 'jslib/models/view/cipherView';
import { CipherService } from 'jslib/abstractions/cipher.service';
import { CipherView } from 'jslib/models/view/cipherView';
@Component({
selector: 'app-vault-ciphers',
template: template,
@@ -30,7 +30,7 @@ export class CiphersComponent {
async load(filter: (cipher: CipherView) => boolean = null) {
this.filter = filter;
let ciphers = await this.cipherService.getAllDecrypted();
const ciphers = await this.cipherService.getAllDecrypted();
if (this.filter == null) {
this.ciphers = ciphers;

View File

@@ -8,8 +8,8 @@ import {
Output,
} from '@angular/core';
import { Angulartics2 } from 'angulartics2';
import { ToasterService } from 'angular2-toaster';
import { Angulartics2 } from 'angulartics2';
import { FolderService } from 'jslib/abstractions/folder.service';
import { I18nService } from 'jslib/abstractions/i18n.service';
@@ -58,7 +58,7 @@ export class FolderAddEditComponent implements OnInit {
try {
const folder = await this.folderService.encrypt(this.folder);
this.formPromise = this.folderService.saveWithServer(folder);;
this.formPromise = this.folderService.saveWithServer(folder);
await this.formPromise;
this.analytics.eventTrack.next({ action: this.editMode ? 'Edited Folder' : 'Added Folder' });
this.toasterService.popAsync('success', null,
@@ -70,7 +70,7 @@ export class FolderAddEditComponent implements OnInit {
async delete() {
const confirmed = await this.platformUtilsService.showDialog(
this.i18nService.t('deleteFolderConfirmation'), this.i18nService.t('deleteFolder'),
this.i18nService.t('yes'), this.i18nService.t('no'), 'warning')
this.i18nService.t('yes'), this.i18nService.t('no'), 'warning');
if (!confirmed) {
return;
}

View File

@@ -10,8 +10,8 @@ import {
import { CipherType } from 'jslib/enums/cipherType';
import { FolderView } from 'jslib/models/view/folderView';
import { CollectionView } from 'jslib/models/view/collectionView';
import { FolderView } from 'jslib/models/view/folderView';
import { CollectionService } from 'jslib/abstractions/collection.service';
import { FolderService } from 'jslib/abstractions/folder.service';

View File

@@ -1,7 +1,7 @@
import * as template from './password-generator.component.html';
import { Angulartics2 } from 'angulartics2';
import { ToasterService } from 'angular2-toaster';
import { Angulartics2 } from 'angulartics2';
import {
Component,

View File

@@ -1,5 +1,6 @@
import * as template from './vault.component.html';
import { Location } from '@angular/common';
import {
Component,
ComponentFactoryResolver,
@@ -7,21 +8,19 @@ import {
ViewChild,
ViewContainerRef,
} from '@angular/core';
import {
ActivatedRoute,
Router,
} from '@angular/router';
import { Location } from '@angular/common';
import { ModalComponent } from '../modal.component';
import { AttachmentsComponent } from './attachments.component';
import { AddEditComponent } from './add-edit.component';
import { AttachmentsComponent } from './attachments.component';
import { CiphersComponent } from './ciphers.component';
import { FolderAddEditComponent } from './folder-add-edit.component';
import { GroupingsComponent } from './groupings.component';
import { PasswordGeneratorComponent } from './password-generator.component';
import { ModalComponent } from '../modal.component';
import { CipherType } from 'jslib/enums/cipherType';
@@ -56,32 +55,32 @@ export class VaultComponent implements OnInit {
async ngOnInit() {
this.route.queryParams.subscribe(async (params) => {
if (params['cipherId']) {
if (params.cipherId) {
const cipherView = new CipherView();
cipherView.id = params['cipherId'];
if (params['action'] === 'edit') {
cipherView.id = params.cipherId;
if (params.action === 'edit') {
this.editCipher(cipherView);
} else {
this.viewCipher(cipherView);
}
} else if (params['action'] === 'add') {
} else if (params.action === 'add') {
this.addCipher();
}
if (params['favorites']) {
if (params.favorites) {
this.groupingsComponent.selectedFavorites = true;
await this.filterFavorites();
} else if (params['type']) {
const t = parseInt(params['type']);
} else if (params.type) {
const t = parseInt(params.type, null);
this.groupingsComponent.selectedType = t;
await this.filterCipherType(t);
} else if (params['folderId']) {
} else if (params.folderId) {
this.groupingsComponent.selectedFolder = true;
this.groupingsComponent.selectedFolderId = params['folderId'];
await this.filterFolder(params['folderId']);
} else if (params['collectionId']) {
this.groupingsComponent.selectedCollectionId = params['collectionId'];
await this.filterCollection(params['collectionId']);
this.groupingsComponent.selectedFolderId = params.folderId;
await this.filterFolder(params.folderId);
} else if (params.collectionId) {
this.groupingsComponent.selectedCollectionId = params.collectionId;
await this.filterCollection(params.collectionId);
} else {
this.groupingsComponent.selectedAll = true;
await this.ciphersComponent.load();

View File

@@ -9,8 +9,8 @@ import {
Output,
} from '@angular/core';
import { Angulartics2 } from 'angulartics2';
import { ToasterService } from 'angular2-toaster';
import { Angulartics2 } from 'angulartics2';
import { CipherType } from 'jslib/enums/cipherType';
import { FieldType } from 'jslib/enums/fieldType';