Remove empty catch blocks, and update tslint rule (#1226)

This commit is contained in:
Oscar Hinton 2021-10-20 18:30:04 +02:00 committed by GitHub
parent 4447b89b05
commit 044ac513ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
90 changed files with 516 additions and 222 deletions

View File

@ -10,6 +10,7 @@ import { ToasterService } from 'angular2-toaster';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { ProviderUserInviteRequest } from 'jslib-common/models/request/provider/providerUserInviteRequest';
@ -43,7 +44,8 @@ export class UserAddEditComponent implements OnInit {
userType = ProviderUserType;
constructor(private apiService: ApiService, private i18nService: I18nService,
private toasterService: ToasterService, private platformUtilsService: PlatformUtilsService) { }
private toasterService: ToasterService, private platformUtilsService: PlatformUtilsService,
private logService: LogService) { }
async ngOnInit() {
this.editMode = this.loading = this.providerUserId != null;
@ -54,7 +56,9 @@ export class UserAddEditComponent implements OnInit {
try {
const user = await this.apiService.getProviderUser(this.providerId, this.providerUserId);
this.type = user.type;
} catch { }
} catch (e) {
this.logService.error(e);
}
} else {
this.title = this.i18nService.t('inviteUser');
}
@ -78,7 +82,9 @@ export class UserAddEditComponent implements OnInit {
this.toasterService.popAsync('success', null,
this.i18nService.t(this.editMode ? 'editedUserId' : 'invitedUsers', this.name));
this.onSavedUser.emit();
} catch { }
} catch (e) {
this.logService.error(e);
}
}
async delete() {
@ -98,7 +104,9 @@ export class UserAddEditComponent implements OnInit {
await this.deletePromise;
this.toasterService.popAsync('success', null, this.i18nService.t('removedUserId', this.name));
this.onDeletedUser.emit();
} catch { }
} catch (e) {
this.logService.error(e);
}
}
}

2
jslib

@ -1 +1 @@
Subproject commit a20e935268c986538ff68f72016bb8c772ea3a1b
Subproject commit f09fb69882525b3be7b2e257e7723eeb79b343d1

View File

@ -12,6 +12,7 @@ import {
import { ApiService } from 'jslib-common/abstractions/api.service';
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PolicyService } from 'jslib-common/abstractions/policy.service';
import { StateService } from 'jslib-common/abstractions/state.service';
import { UserService } from 'jslib-common/abstractions/user.service';
@ -36,7 +37,7 @@ export class AcceptOrganizationComponent extends BaseAcceptComponent {
i18nService: I18nService, route: ActivatedRoute,
private apiService: ApiService, userService: UserService,
stateService: StateService, private cryptoService: CryptoService,
private policyService: PolicyService) {
private policyService: PolicyService, private logService: LogService) {
super(router, toasterService, i18nService, route, userService, stateService);
}
@ -101,7 +102,9 @@ export class AcceptOrganizationComponent extends BaseAcceptComponent {
const policies = await this.apiService.getPoliciesByToken(qParams.organizationId, qParams.token,
qParams.email, qParams.organizationUserId);
policyList = this.policyService.mapPoliciesFromToken(policies);
} catch { }
} catch (e) {
this.logService.error(e);
}
if (policyList != null) {
const result = this.policyService.getResetPasswordPolicyOptions(policyList, qParams.organizationId);

View File

@ -3,6 +3,7 @@ import { Router } from '@angular/router';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { HintComponent as BaseHintComponent } from 'jslib-angular/components/hint.component';
@ -13,7 +14,8 @@ import { HintComponent as BaseHintComponent } from 'jslib-angular/components/hin
})
export class HintComponent extends BaseHintComponent {
constructor(router: Router, i18nService: I18nService,
apiService: ApiService, platformUtilsService: PlatformUtilsService) {
super(router, i18nService, apiService, platformUtilsService);
apiService: ApiService, platformUtilsService: PlatformUtilsService,
logService: LogService) {
super(router, i18nService, apiService, platformUtilsService, logService);
}
}

View File

@ -5,6 +5,7 @@ import { ApiService } from 'jslib-common/abstractions/api.service';
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
import { EnvironmentService } from 'jslib-common/abstractions/environment.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { MessagingService } from 'jslib-common/abstractions/messaging.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { StateService } from 'jslib-common/abstractions/state.service';
@ -26,9 +27,9 @@ export class LockComponent extends BaseLockComponent {
userService: UserService, cryptoService: CryptoService,
storageService: StorageService, vaultTimeoutService: VaultTimeoutService,
environmentService: EnvironmentService, private routerService: RouterService,
stateService: StateService, apiService: ApiService) {
stateService: StateService, apiService: ApiService, logService: LogService) {
super(router, i18nService, platformUtilsService, messagingService, userService, cryptoService,
storageService, vaultTimeoutService, environmentService, stateService, apiService);
storageService, vaultTimeoutService, environmentService, stateService, apiService, logService);
}
async ngOnInit() {

View File

@ -11,6 +11,7 @@ import { AuthService } from 'jslib-common/abstractions/auth.service';
import { CryptoFunctionService } from 'jslib-common/abstractions/cryptoFunction.service';
import { EnvironmentService } from 'jslib-common/abstractions/environment.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PasswordGenerationService } from 'jslib-common/abstractions/passwordGeneration.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { PolicyService } from 'jslib-common/abstractions/policy.service';
@ -34,12 +35,12 @@ export class LoginComponent extends BaseLoginComponent {
storageService: StorageService, stateService: StateService,
platformUtilsService: PlatformUtilsService, environmentService: EnvironmentService,
passwordGenerationService: PasswordGenerationService, cryptoFunctionService: CryptoFunctionService,
private apiService: ApiService, private policyService: PolicyService) {
private apiService: ApiService, private policyService: PolicyService, logService: LogService) {
super(authService, router,
platformUtilsService, i18nService,
stateService, environmentService,
passwordGenerationService, cryptoFunctionService,
storageService);
storageService, logService);
this.onSuccessfulLoginNavigate = this.goAfterLogIn;
}
@ -64,7 +65,9 @@ export class LoginComponent extends BaseLoginComponent {
const policies = await this.apiService.getPoliciesByToken(invite.organizationId, invite.token,
invite.email, invite.organizationUserId);
policyList = this.policyService.mapPoliciesFromToken(policies);
} catch { }
} catch (e) {
this.logService.error(e);
}
if (policyList != null) {
const result = this.policyService.getResetPasswordPolicyOptions(policyList, invite.organizationId);

View File

@ -5,6 +5,7 @@ import { ToasterService } from 'angular2-toaster';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { DeleteRecoverRequest } from 'jslib-common/models/request/deleteRecoverRequest';
@ -17,7 +18,8 @@ export class RecoverDeleteComponent {
formPromise: Promise<any>;
constructor(private router: Router, private apiService: ApiService,
private toasterService: ToasterService, private i18nService: I18nService) {
private toasterService: ToasterService, private i18nService: I18nService,
private logService: LogService) {
}
async submit() {
@ -28,6 +30,8 @@ export class RecoverDeleteComponent {
await this.formPromise;
this.toasterService.popAsync('success', null, this.i18nService.t('deleteRecoverEmailSent'));
this.router.navigate(['/']);
} catch { }
} catch (e) {
this.logService.error(e);
}
}
}

View File

@ -7,6 +7,7 @@ import { ApiService } from 'jslib-common/abstractions/api.service';
import { AuthService } from 'jslib-common/abstractions/auth.service';
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { TwoFactorRecoveryRequest } from 'jslib-common/models/request/twoFactorRecoveryRequest';
@ -22,7 +23,8 @@ export class RecoverTwoFactorComponent {
constructor(private router: Router, private apiService: ApiService,
private toasterService: ToasterService, private i18nService: I18nService,
private cryptoService: CryptoService, private authService: AuthService) { }
private cryptoService: CryptoService, private authService: AuthService,
private logService: LogService) { }
async submit() {
try {
@ -35,6 +37,8 @@ export class RecoverTwoFactorComponent {
await this.formPromise;
this.toasterService.popAsync('success', null, this.i18nService.t('twoStepRecoverDisabled'));
this.router.navigate(['/']);
} catch { }
} catch (e) {
this.logService.error(e);
}
}
}

View File

@ -11,6 +11,7 @@ import { AuthService } from 'jslib-common/abstractions/auth.service';
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
import { EnvironmentService } from 'jslib-common/abstractions/environment.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PasswordGenerationService } from 'jslib-common/abstractions/passwordGeneration.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { PolicyService } from 'jslib-common/abstractions/policy.service';
@ -40,9 +41,9 @@ export class RegisterComponent extends BaseRegisterComponent {
apiService: ApiService, private route: ActivatedRoute,
stateService: StateService, platformUtilsService: PlatformUtilsService,
passwordGenerationService: PasswordGenerationService, private policyService: PolicyService,
environmentService: EnvironmentService) {
environmentService: EnvironmentService, logService: LogService) {
super(authService, router, i18nService, cryptoService, apiService, stateService, platformUtilsService,
passwordGenerationService, environmentService);
passwordGenerationService, environmentService, logService);
}
async ngOnInit() {
@ -80,7 +81,9 @@ export class RegisterComponent extends BaseRegisterComponent {
const policiesData = policies.data.map(p => new PolicyData(p));
this.policies = policiesData.map(p => new Policy(p));
}
} catch { }
} catch (e) {
this.logService.error(e);
}
}
if (this.policies != null) {

View File

@ -11,6 +11,7 @@ import { AuthService } from 'jslib-common/abstractions/auth.service';
import { CryptoFunctionService } from 'jslib-common/abstractions/cryptoFunction.service';
import { EnvironmentService } from 'jslib-common/abstractions/environment.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PasswordGenerationService } from 'jslib-common/abstractions/passwordGeneration.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { StateService } from 'jslib-common/abstractions/state.service';
@ -30,9 +31,9 @@ export class SsoComponent extends BaseSsoComponent {
storageService: StorageService, stateService: StateService,
platformUtilsService: PlatformUtilsService, apiService: ApiService,
cryptoFunctionService: CryptoFunctionService, environmentService: EnvironmentService,
passwordGenerationService: PasswordGenerationService) {
passwordGenerationService: PasswordGenerationService, logService: LogService) {
super(authService, router, i18nService, route, storageService, stateService, platformUtilsService,
apiService, cryptoFunctionService, environmentService, passwordGenerationService);
apiService, cryptoFunctionService, environmentService, passwordGenerationService, logService);
this.redirectUri = window.location.origin + '/sso-connector.html';
this.clientId = 'web';
}

View File

@ -23,6 +23,7 @@ import { TwoFactorProviderType } from 'jslib-common/enums/twoFactorProviderType'
import { TwoFactorComponent as BaseTwoFactorComponent } from 'jslib-angular/components/two-factor.component';
import { LogService } from 'jslib-common/abstractions/log.service';
import { TwoFactorOptionsComponent } from './two-factor-options.component';
@Component({
@ -36,9 +37,9 @@ export class TwoFactorComponent extends BaseTwoFactorComponent {
i18nService: I18nService, apiService: ApiService,
platformUtilsService: PlatformUtilsService, stateService: StateService,
environmentService: EnvironmentService, private modalService: ModalService,
storageService: StorageService, route: ActivatedRoute) {
storageService: StorageService, route: ActivatedRoute, logService: LogService) {
super(authService, router, i18nService, apiService, platformUtilsService, window, environmentService,
stateService, storageService, route);
stateService, storageService, route, logService);
this.onSuccessfulLoginNavigate = this.goAfterLogIn;
}

View File

@ -3,6 +3,7 @@ import { Component } from '@angular/core';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { MessagingService } from 'jslib-common/abstractions/messaging.service';
import { PasswordGenerationService } from 'jslib-common/abstractions/passwordGeneration.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
@ -22,8 +23,8 @@ export class UpdateTempPasswordComponent extends BaseUpdateTempPasswordComponent
passwordGenerationService: PasswordGenerationService, policyService: PolicyService,
cryptoService: CryptoService, userService: UserService,
messagingService: MessagingService, apiService: ApiService,
syncService: SyncService) {
syncService: SyncService, logService: LogService) {
super(i18nService, platformUtilsService, passwordGenerationService, policyService, cryptoService,
userService, messagingService, apiService, syncService);
userService, messagingService, apiService, syncService, logService);
}
}

View File

@ -13,6 +13,7 @@ import { ToasterService } from 'angular2-toaster';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { UserService } from 'jslib-common/abstractions/user.service';
import { VerifyEmailRequest } from 'jslib-common/models/request/verifyEmailRequest';
@ -24,7 +25,8 @@ import { VerifyEmailRequest } from 'jslib-common/models/request/verifyEmailReque
export class VerifyEmailTokenComponent implements OnInit {
constructor(private router: Router, private toasterService: ToasterService,
private i18nService: I18nService, private route: ActivatedRoute,
private apiService: ApiService, private userService: UserService) { }
private apiService: ApiService, private userService: UserService,
private logService: LogService) { }
ngOnInit() {
this.route.queryParams.pipe(first()).subscribe(async qParams => {
@ -39,7 +41,9 @@ export class VerifyEmailTokenComponent implements OnInit {
this.toasterService.popAsync('success', null, this.i18nService.t('emailVerified'));
this.router.navigate(['/']);
return;
} catch { }
} catch (e) {
this.logService.error(e);
}
}
this.toasterService.popAsync('error', null, this.i18nService.t('emailVerifiedFailed'));
this.router.navigate(['/']);

View File

@ -13,6 +13,7 @@ import { ToasterService } from 'angular2-toaster';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { VerifyDeleteRecoverRequest } from 'jslib-common/models/request/verifyDeleteRecoverRequest';
@ -29,7 +30,7 @@ export class VerifyRecoverDeleteComponent implements OnInit {
constructor(private router: Router, private apiService: ApiService,
private toasterService: ToasterService, private i18nService: I18nService,
private route: ActivatedRoute) {
private route: ActivatedRoute, private logService: LogService) {
}
ngOnInit() {
@ -52,6 +53,8 @@ export class VerifyRecoverDeleteComponent implements OnInit {
this.toasterService.popAsync('success', this.i18nService.t('accountDeleted'),
this.i18nService.t('accountDeletedDesc'));
this.router.navigate(['/']);
} catch { }
} catch (e) {
this.logService.error(e);
}
}
}

View File

@ -94,7 +94,7 @@ export abstract class BasePeopleComponent<UserType extends ProviderUserUserDetai
protected toasterService: ToasterService, protected cryptoService: CryptoService,
private storageService: StorageService, protected validationService: ValidationService,
protected modalService: ModalService, private logService: LogService,
private searchPipe: SearchPipe, protected userNamePipe: UserNamePipe) { }
private searchPipe: SearchPipe, protected userNamePipe: UserNamePipe ) { }
abstract edit(user: UserType): void;
abstract getUsers(): Promise<ListResponse<UserType>>;
@ -256,7 +256,9 @@ export abstract class BasePeopleComponent<UserType extends ProviderUserUserDetai
comp.formPromise = confirmUser(publicKey);
await comp.formPromise;
modal.close();
} catch { }
} catch (e) {
this.logService.error(e);
}
});
});
return;
@ -265,7 +267,9 @@ export abstract class BasePeopleComponent<UserType extends ProviderUserUserDetai
try {
const fingerprint = await this.cryptoService.getFingerprint(user.userId, publicKey.buffer);
this.logService.info(`User's fingerprint: ${fingerprint.join('-')}`);
} catch { }
} catch (e) {
this.logService.error(e);
}
await confirmUser(publicKey);
} catch (e) {
this.logService.error(`Handled exception: ${e}`);

View File

@ -11,6 +11,7 @@ import { ToasterService } from 'angular2-toaster';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { UserService } from 'jslib-common/abstractions/user.service';
@ -46,7 +47,8 @@ export class CollectionAddEditComponent implements OnInit {
constructor(private apiService: ApiService, private i18nService: I18nService,
private toasterService: ToasterService, private platformUtilsService: PlatformUtilsService,
private cryptoService: CryptoService, private userService: UserService) { }
private cryptoService: CryptoService, private userService: UserService,
private logService: LogService) { }
async ngOnInit() {
const organization = await this.userService.getOrganization(this.organizationId);
@ -75,7 +77,9 @@ export class CollectionAddEditComponent implements OnInit {
}
});
}
} catch { }
} catch (e) {
this.logService.error(e);
}
} else {
this.title = this.i18nService.t('addCollection');
}
@ -125,7 +129,9 @@ export class CollectionAddEditComponent implements OnInit {
this.toasterService.popAsync('success', null,
this.i18nService.t(this.editMode ? 'editedCollectionId' : 'createdCollectionId', this.name));
this.onSavedCollection.emit();
} catch { }
} catch (e) {
this.logService.error(e);
}
}
async delete() {
@ -145,6 +151,8 @@ export class CollectionAddEditComponent implements OnInit {
await this.deletePromise;
this.toasterService.popAsync('success', null, this.i18nService.t('deletedCollectionId', this.name));
this.onDeletedCollection.emit();
} catch { }
} catch (e) {
this.logService.error(e);
}
}
}

View File

@ -12,6 +12,7 @@ import { first } from 'rxjs/operators';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { CollectionService } from 'jslib-common/abstractions/collection.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { SearchService } from 'jslib-common/abstractions/search.service';
import { UserService } from 'jslib-common/abstractions/user.service';
@ -53,7 +54,7 @@ export class CollectionsComponent implements OnInit {
private collectionService: CollectionService, private modalService: ModalService,
private toasterService: ToasterService, private i18nService: I18nService,
private platformUtilsService: PlatformUtilsService, private userService: UserService,
private searchService: SearchService) { }
private searchService: SearchService, private logService: LogService) { }
async ngOnInit() {
this.route.parent.parent.params.subscribe(async params => {
@ -128,7 +129,9 @@ export class CollectionsComponent implements OnInit {
await this.apiService.deleteCollection(this.organizationId, collection.id);
this.toasterService.popAsync('success', null, this.i18nService.t('deletedCollectionId', collection.name));
this.removeCollection(collection);
} catch { }
} catch (e) {
this.logService.error(e);
}
}
async users(collection: CollectionView) {

View File

@ -8,6 +8,7 @@ import { ToasterService } from 'angular2-toaster';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { EventService } from '../../services/event.service';
@ -42,7 +43,7 @@ export class EntityEventsComponent implements OnInit {
constructor(private apiService: ApiService, private i18nService: I18nService,
private eventService: EventService, private toasterService: ToasterService,
private userNamePipe: UserNamePipe) { }
private userNamePipe: UserNamePipe, private logService: LogService) { }
async ngOnInit() {
const defaultDates = this.eventService.getDefaultDateFilters();
@ -98,7 +99,9 @@ export class EntityEventsComponent implements OnInit {
this.morePromise = promise;
}
response = await promise;
} catch { }
} catch (e) {
this.logService.error(e);
}
this.continuationToken = response.continuationToken;
const events = await Promise.all(response.data.map(async r => {

View File

@ -10,6 +10,7 @@ import { ToasterService } from 'angular2-toaster';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { OrganizationUserStatusType } from 'jslib-common/enums/organizationUserStatusType';
import { OrganizationUserType } from 'jslib-common/enums/organizationUserType';
@ -41,7 +42,7 @@ export class EntityUsersComponent implements OnInit {
private allUsers: OrganizationUserUserDetailsResponse[] = [];
constructor(private apiService: ApiService, private i18nService: I18nService,
private toasterService: ToasterService) { }
private toasterService: ToasterService, private logService: LogService) { }
async ngOnInit() {
await this.loadUsers();
@ -130,6 +131,8 @@ export class EntityUsersComponent implements OnInit {
await this.formPromise;
this.toasterService.popAsync('success', null, this.i18nService.t('updatedUsers'));
this.onEditedUsers.emit();
} catch { }
} catch (e) {
this.logService.error(e);
}
}
}

View File

@ -11,6 +11,7 @@ import { ToasterService } from 'angular2-toaster';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { CollectionService } from 'jslib-common/abstractions/collection.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { CollectionData } from 'jslib-common/models/data/collectionData';
@ -42,7 +43,7 @@ export class GroupAddEditComponent implements OnInit {
constructor(private apiService: ApiService, private i18nService: I18nService,
private toasterService: ToasterService, private collectionService: CollectionService,
private platformUtilsService: PlatformUtilsService) { }
private platformUtilsService: PlatformUtilsService, private logService: LogService) { }
async ngOnInit() {
this.editMode = this.loading = this.groupId != null;
@ -66,7 +67,9 @@ export class GroupAddEditComponent implements OnInit {
}
});
}
} catch { }
} catch (e) {
this.logService.error(e);
}
} else {
this.title = this.i18nService.t('addGroup');
}
@ -112,7 +115,9 @@ export class GroupAddEditComponent implements OnInit {
this.toasterService.popAsync('success', null,
this.i18nService.t(this.editMode ? 'editedGroupId' : 'createdGroupId', this.name));
this.onSavedGroup.emit();
} catch { }
} catch (e) {
this.logService.error(e);
}
}
async delete() {
@ -132,6 +137,8 @@ export class GroupAddEditComponent implements OnInit {
await this.deletePromise;
this.toasterService.popAsync('success', null, this.i18nService.t('deletedGroupId', this.name));
this.onDeletedGroup.emit();
} catch { }
} catch (e) {
this.logService.error(e);
}
}
}

View File

@ -15,6 +15,7 @@ import { ToasterService } from 'angular2-toaster';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { SearchService } from 'jslib-common/abstractions/search.service';
import { UserService } from 'jslib-common/abstractions/user.service';
@ -51,7 +52,7 @@ export class GroupsComponent implements OnInit {
private i18nService: I18nService, private modalService: ModalService,
private toasterService: ToasterService, private platformUtilsService: PlatformUtilsService,
private userService: UserService, private router: Router,
private searchService: SearchService) { }
private searchService: SearchService, private logService: LogService) { }
async ngOnInit() {
this.route.parent.parent.params.subscribe(async params => {
@ -124,7 +125,9 @@ export class GroupsComponent implements OnInit {
await this.apiService.deleteGroup(this.organizationId, group.id);
this.toasterService.popAsync('success', null, this.i18nService.t('deletedGroupId', group.name));
this.removeGroup(group);
} catch { }
} catch (e) {
this.logService.error(e);
}
}
async users(group: GroupResponse) {

View File

@ -13,6 +13,7 @@ import { ToasterService } from 'angular2-toaster';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PolicyType } from 'jslib-common/enums/policyType';
@ -45,7 +46,7 @@ export class PolicyEditComponent {
constructor(private apiService: ApiService, private i18nService: I18nService,
private toasterService: ToasterService, private componentFactoryResolver: ComponentFactoryResolver,
private cdr: ChangeDetectorRef) {
private cdr: ChangeDetectorRef, private logService: LogService) {
}
async ngAfterViewInit() {
@ -86,6 +87,8 @@ export class PolicyEditComponent {
await this.formPromise;
this.toasterService.popAsync('success', null, this.i18nService.t('editedPolicyId', this.i18nService.t(this.policy.name)));
this.onSavedPolicy.emit();
} catch {}
} catch (e) {
this.logService.error(e);
}
}
}

View File

@ -9,6 +9,7 @@ import {
import { ApiService } from 'jslib-common/abstractions/api.service';
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PasswordGenerationService } from 'jslib-common/abstractions/passwordGeneration.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { PolicyService } from 'jslib-common/abstractions/policy.service';
@ -39,7 +40,7 @@ export class ResetPasswordComponent implements OnInit {
constructor(private apiService: ApiService, private i18nService: I18nService,
private platformUtilsService: PlatformUtilsService, private passwordGenerationService: PasswordGenerationService,
private policyService: PolicyService, private cryptoService: CryptoService) { }
private policyService: PolicyService, private cryptoService: CryptoService, private logService: LogService) { }
async ngOnInit() {
// Get Enforced Policy Options
@ -143,7 +144,9 @@ export class ResetPasswordComponent implements OnInit {
await this.formPromise;
this.platformUtilsService.showToast('success', null, this.i18nService.t('resetPasswordSuccess'));
this.onPasswordReset.emit();
} catch { }
} catch (e) {
this.logService.error(e);
}
}
updatePasswordStrength() {

View File

@ -11,6 +11,7 @@ import { ToasterService } from 'angular2-toaster';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { CollectionService } from 'jslib-common/abstractions/collection.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { CollectionData } from 'jslib-common/models/data/collectionData';
@ -85,7 +86,7 @@ export class UserAddEditComponent implements OnInit {
constructor(private apiService: ApiService, private i18nService: I18nService,
private toasterService: ToasterService, private collectionService: CollectionService,
private platformUtilsService: PlatformUtilsService) { }
private platformUtilsService: PlatformUtilsService, private logService: LogService) { }
async ngOnInit() {
this.editMode = this.loading = this.organizationUserId != null;
@ -111,7 +112,9 @@ export class UserAddEditComponent implements OnInit {
}
});
}
} catch { }
} catch (e) {
this.logService.error(e);
}
} else {
this.title = this.i18nService.t('inviteUser');
}
@ -180,7 +183,9 @@ export class UserAddEditComponent implements OnInit {
this.toasterService.popAsync('success', null,
this.i18nService.t(this.editMode ? 'editedUserId' : 'invitedUsers', this.name));
this.onSavedUser.emit();
} catch { }
} catch (e) {
this.logService.error(e);
}
}
async delete() {
@ -200,6 +205,8 @@ export class UserAddEditComponent implements OnInit {
await this.deletePromise;
this.toasterService.popAsync('success', null, this.i18nService.t('removedUserId', this.name));
this.onDeletedUser.emit();
} catch { }
} catch (e) {
this.logService.error(e);
}
}
}

View File

@ -9,6 +9,7 @@ import {
import { ConstantsService } from 'jslib-common/services/constants.service';
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { StorageService } from 'jslib-common/abstractions/storage.service';
@Component({
@ -26,7 +27,8 @@ export class UserConfirmComponent implements OnInit {
fingerprint: string;
formPromise: Promise<any>;
constructor(private cryptoService: CryptoService, private storageService: StorageService) { }
constructor(private cryptoService: CryptoService, private storageService: StorageService,
private logService: LogService) { }
async ngOnInit() {
try {
@ -36,7 +38,9 @@ export class UserConfirmComponent implements OnInit {
this.fingerprint = fingerprint.join('-');
}
}
} catch { }
} catch (e) {
this.logService.error(e);
}
this.loading = false;
}

View File

@ -10,6 +10,7 @@ import { ToasterService } from 'angular2-toaster';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { OrganizationUserUpdateGroupsRequest } from 'jslib-common/models/request/organizationUserUpdateGroupsRequest';
import { GroupResponse } from 'jslib-common/models/response/groupResponse';
@ -31,7 +32,7 @@ export class UserGroupsComponent implements OnInit {
formPromise: Promise<any>;
constructor(private apiService: ApiService, private i18nService: I18nService,
private toasterService: ToasterService) { }
private toasterService: ToasterService, private logService: LogService) { }
async ngOnInit() {
const groupsResponse = await this.apiService.getGroups(this.organizationId);
@ -50,7 +51,9 @@ export class UserGroupsComponent implements OnInit {
}
});
}
} catch { }
} catch (e) {
this.logService.error(e);
}
this.loading = false;
}
@ -76,6 +79,8 @@ export class UserGroupsComponent implements OnInit {
await this.formPromise;
this.toasterService.popAsync('success', null, this.i18nService.t('editedGroupsForUser', this.name));
this.onSavedUser.emit();
} catch { }
} catch (e) {
this.logService.error(e);
}
}
}

View File

@ -12,6 +12,7 @@ import { ModalService } from 'jslib-angular/services/modal.service';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { SyncService } from 'jslib-common/abstractions/sync.service';
@ -50,7 +51,7 @@ export class AccountComponent {
private apiService: ApiService, private i18nService: I18nService,
private toasterService: ToasterService, private route: ActivatedRoute,
private syncService: SyncService, private platformUtilsService: PlatformUtilsService,
private cryptoService: CryptoService) { }
private cryptoService: CryptoService, private logService: LogService) { }
async ngOnInit() {
this.selfHosted = this.platformUtilsService.isSelfHost();
@ -59,7 +60,9 @@ export class AccountComponent {
try {
this.org = await this.apiService.getOrganization(this.organizationId);
this.canUseApi = this.org.useApi;
} catch { }
} catch (e) {
this.logService.error(e);
}
});
this.loading = false;
}
@ -84,7 +87,9 @@ export class AccountComponent {
});
await this.formPromise;
this.toasterService.popAsync('success', null, this.i18nService.t('organizationUpdated'));
} catch { }
} catch (e) {
this.logService.error(e);
}
}
async submitTaxInfo() {

View File

@ -5,12 +5,12 @@ import {
Output,
} from '@angular/core';
import { Router } from '@angular/router';
import { ToasterService } from 'angular2-toaster';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { OrganizationSubscriptionUpdateRequest } from 'jslib-common/models/request/organizationSubscriptionUpdateRequest';
@Component({
@ -31,7 +31,7 @@ export class AdjustSubscription {
newMaxSeats: number;
constructor(private apiService: ApiService, private i18nService: I18nService,
private toasterService: ToasterService) { }
private toasterService: ToasterService, private logService: LogService) { }
ngOnInit() {
this.limitSubscription = this.maxAutoscaleSeats != null;
@ -48,7 +48,9 @@ export class AdjustSubscription {
await this.formPromise;
this.toasterService.popAsync('success', null, this.i18nService.t('subscriptionUpdated'));
} catch { }
} catch (e) {
this.logService.error(e);
}
this.onAdjusted.emit();
}

View File

@ -5,8 +5,7 @@ import {
Output,
} from '@angular/core';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PlanType } from 'jslib-common/enums/planType';
import { ProductType } from 'jslib-common/enums/productType';
@ -24,12 +23,14 @@ export class ChangePlanComponent {
defaultUpgradePlan: PlanType = PlanType.FamiliesAnnually;
defaultUpgradeProduct: ProductType = ProductType.Families;
constructor(private apiService: ApiService, private platformUtilsService: PlatformUtilsService) { }
constructor(private logService: LogService) { }
async submit() {
try {
this.onChanged.emit();
} catch { }
} catch (e) {
this.logService.error(e);
}
}
cancel() {

View File

@ -6,6 +6,7 @@ import { ToasterService } from 'angular2-toaster';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PasswordVerificationRequest } from 'jslib-common/models/request/passwordVerificationRequest';
@ -21,7 +22,7 @@ export class DeleteOrganizationComponent {
constructor(private apiService: ApiService, private i18nService: I18nService,
private toasterService: ToasterService, private cryptoService: CryptoService,
private router: Router) { }
private router: Router, private logService: LogService) { }
async submit() {
if (this.masterPassword == null || this.masterPassword === '') {
@ -38,6 +39,8 @@ export class DeleteOrganizationComponent {
this.toasterService.popAsync('success', this.i18nService.t('organizationDeleted'),
this.i18nService.t('organizationDeletedDesc'));
this.router.navigate(['/']);
} catch { }
} catch (e) {
this.logService.error(e);
}
}
}

View File

@ -6,6 +6,7 @@ import {
} from '@angular/core';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
@Component({
@ -20,7 +21,8 @@ export class DownloadLicenseComponent {
installationId: string;
formPromise: Promise<any>;
constructor(private apiService: ApiService, private platformUtilsService: PlatformUtilsService) { }
constructor(private apiService: ApiService, private platformUtilsService: PlatformUtilsService,
private logService: LogService) { }
async submit() {
if (this.installationId == null || this.installationId === '') {
@ -33,7 +35,9 @@ export class DownloadLicenseComponent {
const licenseString = JSON.stringify(license, null, 2);
this.platformUtilsService.saveFile(window, licenseString, null, 'bitwarden_organization_license.json');
this.onDownloaded.emit();
} catch { }
} catch (e) {
this.logService.error(e);
}
}
cancel() {

View File

@ -8,6 +8,7 @@ import { ToasterService } from 'angular2-toaster';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { UserBillingComponent } from '../../settings/user-billing.component';
@ -18,8 +19,9 @@ import { UserBillingComponent } from '../../settings/user-billing.component';
})
export class OrganizationBillingComponent extends UserBillingComponent implements OnInit {
constructor(apiService: ApiService, i18nService: I18nService, toasterService: ToasterService,
private route: ActivatedRoute, platformUtilsService: PlatformUtilsService) {
super(apiService, i18nService, toasterService, platformUtilsService);
private route: ActivatedRoute, platformUtilsService: PlatformUtilsService,
logService: LogService) {
super(apiService, i18nService, toasterService, platformUtilsService, logService);
}
async ngOnInit() {

View File

@ -10,6 +10,7 @@ import { OrganizationSubscriptionResponse } from 'jslib-common/models/response/o
import { ApiService } from 'jslib-common/abstractions/api.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { MessagingService } from 'jslib-common/abstractions/messaging.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { UserService } from 'jslib-common/abstractions/user.service';
@ -43,7 +44,7 @@ export class OrganizationSubscriptionComponent implements OnInit {
constructor(private apiService: ApiService, private platformUtilsService: PlatformUtilsService,
private i18nService: I18nService, private toasterService: ToasterService,
private messagingService: MessagingService, private route: ActivatedRoute,
private userService: UserService) {
private userService: UserService, private logService: LogService) {
this.selfHosted = platformUtilsService.isSelfHost();
}
@ -82,7 +83,9 @@ export class OrganizationSubscriptionComponent implements OnInit {
await this.reinstatePromise;
this.toasterService.popAsync('success', null, this.i18nService.t('reinstated'));
this.load();
} catch { }
} catch (e) {
this.logService.error(e);
}
}
async cancel() {
@ -101,7 +104,9 @@ export class OrganizationSubscriptionComponent implements OnInit {
await this.cancelPromise;
this.toasterService.popAsync('success', null, this.i18nService.t('canceledSubscription'));
this.load();
} catch { }
} catch (e) {
this.logService.error(e);
}
}
async changePlan() {

View File

@ -5,6 +5,7 @@ import { CryptoService } from 'jslib-common/abstractions/crypto.service';
import { EventService } from 'jslib-common/abstractions/event.service';
import { ExportService } from 'jslib-common/abstractions/export.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { PolicyService } from 'jslib-common/abstractions/policy.service';
@ -17,8 +18,10 @@ import { ExportComponent as BaseExportComponent } from '../../tools/export.compo
export class ExportComponent extends BaseExportComponent {
constructor(cryptoService: CryptoService, i18nService: I18nService,
platformUtilsService: PlatformUtilsService, exportService: ExportService,
eventService: EventService, private route: ActivatedRoute, policyService: PolicyService) {
super(cryptoService, i18nService, platformUtilsService, exportService, eventService, policyService);
eventService: EventService, private route: ActivatedRoute, policyService: PolicyService,
logService: LogService) {
super(cryptoService, i18nService, platformUtilsService, exportService, eventService, policyService,
logService);
}
async ngOnInit() {

View File

@ -8,6 +8,7 @@ import { ToasterService } from 'angular2-toaster';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { ImportService } from 'jslib-common/abstractions/import.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { PolicyService } from 'jslib-common/abstractions/policy.service';
import { UserService } from 'jslib-common/abstractions/user.service';
@ -24,8 +25,8 @@ export class ImportComponent extends BaseImportComponent {
constructor(i18nService: I18nService, toasterService: ToasterService,
importService: ImportService, router: Router, private route: ActivatedRoute,
platformUtilsService: PlatformUtilsService, policyService: PolicyService,
private userService: UserService) {
super(i18nService, toasterService, importService, router, platformUtilsService, policyService);
private userService: UserService, logService: LogService) {
super(i18nService, toasterService, importService, router, platformUtilsService, policyService, logService);
}
async ngOnInit() {

View File

@ -2,6 +2,7 @@ import { Component } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { CipherService } from 'jslib-common/abstractions/cipher.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { MessagingService } from 'jslib-common/abstractions/messaging.service';
import { PasswordRepromptService } from 'jslib-common/abstractions/passwordReprompt.service';
import { UserService } from 'jslib-common/abstractions/user.service';
@ -20,9 +21,9 @@ import { CipherView } from 'jslib-common/models/view/cipherView';
})
export class InactiveTwoFactorReportComponent extends BaseInactiveTwoFactorReportComponent {
constructor(cipherService: CipherService, modalService: ModalService,
messagingService: MessagingService, userService: UserService, passwordRepromptService: PasswordRepromptService,
private route: ActivatedRoute) {
super(cipherService, modalService, messagingService, userService, passwordRepromptService);
messagingService: MessagingService, userService: UserService,
private route: ActivatedRoute, logService: LogService, passwordRepromptService: PasswordRepromptService) {
super(cipherService, modalService, messagingService, userService, logService, passwordRepromptService);
}
async ngOnInit() {

View File

@ -7,6 +7,7 @@ import { CollectionService } from 'jslib-common/abstractions/collection.service'
import { EventService } from 'jslib-common/abstractions/event.service';
import { FolderService } from 'jslib-common/abstractions/folder.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { MessagingService } from 'jslib-common/abstractions/messaging.service';
import { PasswordGenerationService } from 'jslib-common/abstractions/passwordGeneration.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
@ -37,10 +38,10 @@ export class AddEditComponent extends BaseAddEditComponent {
userService: UserService, collectionService: CollectionService,
totpService: TotpService, passwordGenerationService: PasswordGenerationService,
private apiService: ApiService, messagingService: MessagingService,
eventService: EventService, policyService: PolicyService) {
eventService: EventService, policyService: PolicyService, logService: LogService) {
super(cipherService, folderService, i18nService, platformUtilsService, auditService, stateService,
userService, collectionService, totpService, passwordGenerationService, messagingService,
eventService, policyService);
eventService, policyService, logService);
}
protected allowOwnershipAssignment() {

View File

@ -4,6 +4,7 @@ import { ApiService } from 'jslib-common/abstractions/api.service';
import { CipherService } from 'jslib-common/abstractions/cipher.service';
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { UserService } from 'jslib-common/abstractions/user.service';
@ -25,8 +26,10 @@ export class AttachmentsComponent extends BaseAttachmentsComponent {
constructor(cipherService: CipherService, i18nService: I18nService,
cryptoService: CryptoService, userService: UserService,
platformUtilsService: PlatformUtilsService, apiService: ApiService) {
super(cipherService, i18nService, cryptoService, userService, platformUtilsService, apiService);
platformUtilsService: PlatformUtilsService, apiService: ApiService,
logService: LogService) {
super(cipherService, i18nService, cryptoService, userService, platformUtilsService, apiService,
logService);
}
protected async reupload(attachment: AttachmentView) {

View File

@ -10,6 +10,7 @@ import { ApiService } from 'jslib-common/abstractions/api.service';
import { CipherService } from 'jslib-common/abstractions/cipher.service';
import { EventService } from 'jslib-common/abstractions/event.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PasswordRepromptService } from 'jslib-common/abstractions/passwordReprompt.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { SearchService } from 'jslib-common/abstractions/search.service';
@ -36,9 +37,10 @@ export class CiphersComponent extends BaseCiphersComponent {
constructor(searchService: SearchService, toasterService: ToasterService, i18nService: I18nService,
platformUtilsService: PlatformUtilsService, cipherService: CipherService,
private apiService: ApiService, eventService: EventService, totpService: TotpService,
userService: UserService, passwordRepromptService: PasswordRepromptService) {
userService: UserService, passwordRepromptService: PasswordRepromptService,
logService: LogService) {
super(searchService, toasterService, i18nService, platformUtilsService, cipherService,
eventService, totpService, userService, passwordRepromptService);
eventService, totpService, userService, passwordRepromptService, logService);
}
async load(filter: (cipher: CipherView) => boolean = null) {

View File

@ -4,6 +4,7 @@ import { ApiService } from 'jslib-common/abstractions/api.service';
import { CipherService } from 'jslib-common/abstractions/cipher.service';
import { CollectionService } from 'jslib-common/abstractions/collection.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { CipherData } from 'jslib-common/models/data/cipherData';
@ -22,8 +23,8 @@ export class CollectionsComponent extends BaseCollectionsComponent {
constructor(collectionService: CollectionService, platformUtilsService: PlatformUtilsService,
i18nService: I18nService, cipherService: CipherService,
private apiService: ApiService) {
super(collectionService, platformUtilsService, i18nService, cipherService);
private apiService: ApiService, logService: LogService) {
super(collectionService, platformUtilsService, i18nService, cipherService, logService);
this.allowSelectNone = true;
}

View File

@ -11,6 +11,7 @@ import { SendService } from 'jslib-common/abstractions/send.service';
import { UserService } from 'jslib-common/abstractions/user.service';
import { AddEditComponent as BaseAddEditComponent } from 'jslib-angular/components/send/add-edit.component';
import { LogService } from 'jslib-common/abstractions/log.service';
@Component({
selector: 'app-send-add-edit',
@ -20,9 +21,10 @@ export class AddEditComponent extends BaseAddEditComponent {
constructor(i18nService: I18nService, platformUtilsService: PlatformUtilsService,
environmentService: EnvironmentService, datePipe: DatePipe,
sendService: SendService, userService: UserService,
messagingService: MessagingService, policyService: PolicyService) {
messagingService: MessagingService, policyService: PolicyService,
logService: LogService) {
super(i18nService, platformUtilsService, environmentService, datePipe, sendService, userService,
messagingService, policyService);
messagingService, policyService, logService);
}
async copyLinkToClipboard(link: string): Promise<void | boolean> {

View File

@ -13,6 +13,7 @@ import { AddEditComponent } from './add-edit.component';
import { EnvironmentService } from 'jslib-common/abstractions/environment.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { PolicyService } from 'jslib-common/abstractions/policy.service';
import { SearchService } from 'jslib-common/abstractions/search.service';
@ -34,9 +35,10 @@ export class SendComponent extends BaseSendComponent {
constructor(sendService: SendService, i18nService: I18nService,
platformUtilsService: PlatformUtilsService, environmentService: EnvironmentService,
ngZone: NgZone, searchService: SearchService, policyService: PolicyService, userService: UserService,
private modalService: ModalService, private broadcasterService: BroadcasterService) {
private modalService: ModalService, private broadcasterService: BroadcasterService,
logService: LogService) {
super(sendService, i18nService, platformUtilsService, environmentService, ngZone, searchService,
policyService, userService);
policyService, userService, logService);
}
async ngOnInit() {

View File

@ -116,12 +116,12 @@ const settingsService = new SettingsService(userService, storageService);
export let searchService: SearchService = null;
const fileUploadService = new FileUploadService(consoleLogService, apiService);
const cipherService = new CipherService(cryptoService, userService, settingsService,
apiService, fileUploadService, storageService, i18nService, () => searchService);
apiService, fileUploadService, storageService, i18nService, () => searchService, consoleLogService);
const folderService = new FolderService(cryptoService, userService, apiService, storageService,
i18nService, cipherService);
const collectionService = new CollectionService(cryptoService, userService, storageService, i18nService);
searchService = new SearchService(cipherService, consoleLogService, i18nService);
const policyService = new PolicyService(userService, storageService);
const policyService = new PolicyService(userService, storageService, apiService);
const sendService = new SendService(cryptoService, userService, apiService, fileUploadService, storageService,
i18nService, cryptoFunctionService);
const vaultTimeoutService = new VaultTimeoutService(cipherService, folderService, collectionService,
@ -129,9 +129,9 @@ const vaultTimeoutService = new VaultTimeoutService(cipherService, folderService
policyService, null, async () => messagingService.send('logout', { expired: false }));
const syncService = new SyncService(userService, apiService, settingsService,
folderService, cipherService, cryptoService, collectionService, storageService, messagingService, policyService,
sendService, async (expired: boolean) => messagingService.send('logout', { expired: expired }));
sendService, consoleLogService, async (expired: boolean) => messagingService.send('logout', { expired: expired }));
const passwordGenerationService = new PasswordGenerationService(cryptoService, storageService, policyService);
const totpService = new TotpService(storageService, cryptoFunctionService);
const totpService = new TotpService(storageService, cryptoFunctionService, consoleLogService);
const containerService = new ContainerService(cryptoService);
const authService = new AuthService(cryptoService, apiService,
userService, tokenService, appIdService, i18nService, platformUtilsService, messagingService, vaultTimeoutService,
@ -142,7 +142,7 @@ const importService = new ImportService(cipherService, folderService, apiService
const notificationsService = new NotificationsService(userService, syncService, appIdService, apiService, vaultTimeoutService,
environmentService, async () => messagingService.send('logout', { expired: true }), consoleLogService);
const auditService = new AuditService(cryptoFunctionService, apiService);
const eventLoggingService = new EventLoggingService(storageService, apiService, userService, cipherService);
const eventLoggingService = new EventLoggingService(storageService, apiService, userService, cipherService, consoleLogService);
containerService.attachToWindow(window);

View File

@ -10,6 +10,7 @@ import {
import { ApiService } from 'jslib-common/abstractions/api.service';
import { PayPalConfig } from 'jslib-common/abstractions/environment.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { UserService } from 'jslib-common/abstractions/user.service';
@ -45,7 +46,7 @@ export class AddCreditComponent implements OnInit {
private email: string;
constructor(private userService: UserService, private apiService: ApiService,
private platformUtilsService: PlatformUtilsService) {
private platformUtilsService: PlatformUtilsService, private logService: LogService) {
const payPalConfig = process.env.PAYPAL_CONFIG as PayPalConfig;
this.ppButtonFormAction = payPalConfig.buttonAction;
this.ppButtonBusinessId = payPalConfig.businessId;
@ -98,12 +99,16 @@ export class AddCreditComponent implements OnInit {
this.formPromise = this.apiService.postBitPayInvoice(req);
const bitPayUrl: string = await this.formPromise;
this.platformUtilsService.launchUri(bitPayUrl);
} catch { }
} catch (e) {
this.logService.error(e);
}
return;
}
try {
this.onAdded.emit();
} catch { }
} catch (e) {
this.logService.error(e);
}
}
cancel() {
@ -120,7 +125,9 @@ export class AddCreditComponent implements OnInit {
return;
}
}
} catch { }
} catch (e) {
this.logService.error(e);
}
this.creditAmount = '';
}
@ -128,7 +135,9 @@ export class AddCreditComponent implements OnInit {
if (this.creditAmount != null && this.creditAmount !== '') {
try {
return parseFloat(this.creditAmount);
} catch { }
} catch (e) {
this.logService.error(e);
}
}
return null;
}

View File

@ -10,6 +10,7 @@ import { ToasterService } from 'angular2-toaster';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PaymentRequest } from 'jslib-common/models/request/paymentRequest';
@ -35,7 +36,7 @@ export class AdjustPaymentComponent {
formPromise: Promise<any>;
constructor(private apiService: ApiService, private i18nService: I18nService,
private toasterService: ToasterService) { }
private toasterService: ToasterService, private logService: LogService) { }
async submit() {
try {
@ -60,7 +61,9 @@ export class AdjustPaymentComponent {
await this.formPromise;
this.toasterService.popAsync('success', null, this.i18nService.t('updatedPaymentMethod'));
this.onAdjusted.emit();
} catch { }
} catch (e) {
this.logService.error(e);
}
}
cancel() {

View File

@ -15,6 +15,7 @@ import { ToasterService } from 'angular2-toaster';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { StorageRequest } from 'jslib-common/models/request/storageRequest';
@ -41,7 +42,7 @@ export class AdjustStorageComponent {
constructor(private apiService: ApiService, private i18nService: I18nService,
private toasterService: ToasterService, private router: Router,
private activatedRoute: ActivatedRoute) { }
private activatedRoute: ActivatedRoute, private logService: LogService) { }
async submit() {
try {
@ -82,7 +83,9 @@ export class AdjustStorageComponent {
this.toasterService.popAsync('success', null,
this.i18nService.t('adjustedStorage', request.storageGbAdjustment.toString()));
}
} catch { }
} catch (e) {
this.logService.error(e);
}
}
cancel() {

View File

@ -4,6 +4,7 @@ import { ToasterService } from 'angular2-toaster';
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PasswordVerificationRequest } from 'jslib-common/models/request/passwordVerificationRequest';
@ -30,7 +31,7 @@ export class ApiKeyComponent {
clientSecret: string;
constructor(private i18nService: I18nService, private toasterService: ToasterService,
private cryptoService: CryptoService) { }
private cryptoService: CryptoService, private logService: LogService) { }
async submit() {
if (this.masterPassword == null || this.masterPassword === '') {
@ -46,6 +47,8 @@ export class ApiKeyComponent {
const response = await this.formPromise;
this.clientSecret = response.apiKey;
this.clientId = `${this.keyType}.${this.entityId}`;
} catch { }
} catch (e) {
this.logService.error(e);
}
}
}

View File

@ -8,6 +8,7 @@ import { ToasterService } from 'angular2-toaster';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { MessagingService } from 'jslib-common/abstractions/messaging.service';
import { UserService } from 'jslib-common/abstractions/user.service';
@ -31,7 +32,8 @@ export class ChangeEmailComponent implements OnInit {
constructor(private apiService: ApiService, private i18nService: I18nService,
private toasterService: ToasterService, private cryptoService: CryptoService,
private messagingService: MessagingService, private userService: UserService) { }
private messagingService: MessagingService, private userService: UserService,
private logService: LogService) { }
async ngOnInit() {
const twoFactorProviders = await this.apiService.getTwoFactorProviders();
@ -55,7 +57,9 @@ export class ChangeEmailComponent implements OnInit {
this.formPromise = this.apiService.postEmailToken(request);
await this.formPromise;
this.tokenSent = true;
} catch { }
} catch (e) {
this.logService.error(e);
}
} else {
const request = new EmailRequest();
request.token = this.token;
@ -74,7 +78,9 @@ export class ChangeEmailComponent implements OnInit {
this.toasterService.popAsync('success', this.i18nService.t('emailChanged'),
this.i18nService.t('logBackIn'));
this.messagingService.send('logout');
} catch { }
} catch (e) {
this.logService.error(e);
}
}
}

View File

@ -8,6 +8,7 @@ import { ToasterService } from 'angular2-toaster';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { MessagingService } from 'jslib-common/abstractions/messaging.service';
import { UserService } from 'jslib-common/abstractions/user.service';
@ -28,7 +29,8 @@ export class ChangeKdfComponent implements OnInit {
constructor(private apiService: ApiService, private i18nService: I18nService,
private toasterService: ToasterService, private cryptoService: CryptoService,
private messagingService: MessagingService, private userService: UserService) {
private messagingService: MessagingService, private userService: UserService,
private logService: LogService) {
this.kdfOptions = [
{ name: 'PBKDF2 SHA-256', value: KdfType.PBKDF2_SHA256 },
];
@ -61,6 +63,8 @@ export class ChangeKdfComponent implements OnInit {
this.toasterService.popAsync('success', this.i18nService.t('encKeySettingsChanged'),
this.i18nService.t('logBackIn'));
this.messagingService.send('logout');
} catch { }
} catch (e) {
this.logService.error(e);
}
}
}

View File

@ -5,6 +5,7 @@ import { ToasterService } from 'angular2-toaster';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { MessagingService } from 'jslib-common/abstractions/messaging.service';
import { PasswordVerificationRequest } from 'jslib-common/models/request/passwordVerificationRequest';
@ -19,7 +20,7 @@ export class DeauthorizeSessionsComponent {
constructor(private apiService: ApiService, private i18nService: I18nService,
private toasterService: ToasterService, private cryptoService: CryptoService,
private messagingService: MessagingService) { }
private messagingService: MessagingService, private logService: LogService) { }
async submit() {
if (this.masterPassword == null || this.masterPassword === '') {
@ -36,6 +37,8 @@ export class DeauthorizeSessionsComponent {
this.toasterService.popAsync('success', this.i18nService.t('sessionsDeauthorized'),
this.i18nService.t('logBackIn'));
this.messagingService.send('logout');
} catch { }
} catch (e) {
this.logService.error(e);
}
}
}

View File

@ -5,6 +5,7 @@ import { ToasterService } from 'angular2-toaster';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { MessagingService } from 'jslib-common/abstractions/messaging.service';
import { PasswordVerificationRequest } from 'jslib-common/models/request/passwordVerificationRequest';
@ -19,7 +20,7 @@ export class DeleteAccountComponent {
constructor(private apiService: ApiService, private i18nService: I18nService,
private toasterService: ToasterService, private cryptoService: CryptoService,
private messagingService: MessagingService) { }
private messagingService: MessagingService, private logService: LogService) { }
async submit() {
if (this.masterPassword == null || this.masterPassword === '') {
@ -36,6 +37,8 @@ export class DeleteAccountComponent {
this.toasterService.popAsync('success', this.i18nService.t('accountDeleted'),
this.i18nService.t('accountDeletedDesc'));
this.messagingService.send('logout');
} catch { }
} catch (e) {
this.logService.error(e);
}
}
}

View File

@ -7,6 +7,7 @@ import { ToasterService } from 'angular2-toaster';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { UpdateDomainsRequest } from 'jslib-common/models/request/updateDomainsRequest';
@ -21,7 +22,7 @@ export class DomainRulesComponent implements OnInit {
formPromise: Promise<any>;
constructor(private apiService: ApiService, private i18nService: I18nService,
private toasterService: ToasterService) { }
private toasterService: ToasterService, private logService: LogService) { }
async ngOnInit() {
const response = await this.apiService.getSettingsDomains();
@ -74,7 +75,9 @@ export class DomainRulesComponent implements OnInit {
this.formPromise = this.apiService.putSettingsDomains(request);
await this.formPromise;
this.toasterService.popAsync('success', null, this.i18nService.t('domainsUpdated'));
} catch { }
} catch (e) {
this.logService.error(e);
}
}
indexTrackBy(index: number, obj: any): any {

View File

@ -10,6 +10,7 @@ import { ToasterService } from 'angular2-toaster';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { EmergencyAccessType } from 'jslib-common/enums/emergencyAccessType';
import { EmergencyAccessInviteRequest } from 'jslib-common/models/request/emergencyAccessInviteRequest';
@ -39,7 +40,7 @@ export class EmergencyAccessAddEditComponent implements OnInit {
waitTime: number;
constructor(private apiService: ApiService, private i18nService: I18nService,
private toasterService: ToasterService) { }
private toasterService: ToasterService, private logService: LogService) { }
async ngOnInit() {
this.editMode = this.loading = this.emergencyAccessId != null;
@ -60,7 +61,9 @@ export class EmergencyAccessAddEditComponent implements OnInit {
const emergencyAccess = await this.apiService.getEmergencyAccess(this.emergencyAccessId);
this.type = emergencyAccess.type;
this.waitTime = emergencyAccess.waitTimeDays;
} catch { }
} catch (e) {
this.logService.error(e);
}
} else {
this.title = this.i18nService.t('inviteEmergencyContact');
this.waitTime = this.waitTimes[2].value;
@ -90,7 +93,9 @@ export class EmergencyAccessAddEditComponent implements OnInit {
this.toasterService.popAsync('success', null,
this.i18nService.t(this.editMode ? 'editedUserId' : 'invitedUsers', this.name));
this.onSaved.emit();
} catch { }
} catch (e) {
this.logService.error(e);
}
}
async delete() {

View File

@ -4,6 +4,7 @@ import { ApiService } from 'jslib-common/abstractions/api.service';
import { CipherService } from 'jslib-common/abstractions/cipher.service';
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { UserService } from 'jslib-common/abstractions/user.service';
@ -21,8 +22,10 @@ export class EmergencyAccessAttachmentsComponent extends BaseAttachmentsComponen
constructor(cipherService: CipherService, i18nService: I18nService,
cryptoService: CryptoService, userService: UserService,
platformUtilsService: PlatformUtilsService, apiService: ApiService) {
super(cipherService, i18nService, cryptoService, userService, platformUtilsService, apiService, window);
platformUtilsService: PlatformUtilsService, apiService: ApiService,
logService: LogService) {
super(cipherService, i18nService, cryptoService, userService, platformUtilsService, apiService, window,
logService);
}
protected async init() {

View File

@ -10,6 +10,7 @@ import { ConstantsService } from 'jslib-common/services/constants.service';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { StorageService } from 'jslib-common/abstractions/storage.service';
import { Utils } from 'jslib-common/misc/utils';
@ -30,7 +31,7 @@ export class EmergencyAccessConfirmComponent implements OnInit {
fingerprint: string;
constructor(private apiService: ApiService, private cryptoService: CryptoService,
private storageService: StorageService) { }
private storageService: StorageService, private logService: LogService) { }
async ngOnInit() {
try {
@ -42,7 +43,9 @@ export class EmergencyAccessConfirmComponent implements OnInit {
this.fingerprint = fingerprint.join('-');
}
}
} catch { }
} catch (e) {
this.logService.error(e);
}
this.loading = false;
}
@ -57,6 +60,8 @@ export class EmergencyAccessConfirmComponent implements OnInit {
try {
this.onConfirmed.emit();
} catch { }
} catch (e) {
this.logService.error(e);
}
}
}

View File

@ -11,6 +11,7 @@ import { ToasterService } from 'angular2-toaster';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { MessagingService } from 'jslib-common/abstractions/messaging.service';
import { PasswordGenerationService } from 'jslib-common/abstractions/passwordGeneration.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
@ -44,7 +45,7 @@ export class EmergencyAccessTakeoverComponent extends ChangePasswordComponent im
messagingService: MessagingService, userService: UserService,
passwordGenerationService: PasswordGenerationService,
platformUtilsService: PlatformUtilsService, policyService: PolicyService,
private apiService: ApiService, private toasterService: ToasterService) {
private apiService: ApiService, private toasterService: ToasterService, private logService: LogService) {
super(i18nService, cryptoService, messagingService, userService, passwordGenerationService,
platformUtilsService, policyService);
}
@ -85,6 +86,8 @@ export class EmergencyAccessTakeoverComponent extends ChangePasswordComponent im
try {
this.onDone.emit();
} catch { }
} catch (e) {
this.logService.error(e);
}
}
}

View File

@ -9,6 +9,7 @@ import { ToasterService } from 'angular2-toaster';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { MessagingService } from 'jslib-common/abstractions/messaging.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { StorageService } from 'jslib-common/abstractions/storage.service';
@ -50,7 +51,8 @@ export class EmergencyAccessComponent implements OnInit {
private modalService: ModalService, private platformUtilsService: PlatformUtilsService,
private toasterService: ToasterService, private cryptoService: CryptoService,
private storageService: StorageService, private userService: UserService,
private messagingService: MessagingService, private userNamePipe: UserNamePipe) { }
private messagingService: MessagingService, private userNamePipe: UserNamePipe,
private logService: LogService) { }
async ngOnInit() {
this.canAccessPremium = await this.userService.canAccessPremium();
@ -154,7 +156,9 @@ export class EmergencyAccessComponent implements OnInit {
} else {
this.removeGrantor(details);
}
} catch { }
} catch (e) {
this.logService.error(e);
}
}
async requestAccess(details: EmergencyAccessGrantorDetailsResponse) {
@ -238,10 +242,11 @@ export class EmergencyAccessComponent implements OnInit {
const publicKey = Utils.fromB64ToArray(publicKeyResponse.publicKey);
try {
// tslint:disable-next-line
console.log('User\'s fingerprint: ' +
this.logService.debug('User\'s fingerprint: ' +
(await this.cryptoService.getFingerprint(details.granteeId, publicKey.buffer)).join('-'));
} catch { }
} catch {
// Ignore errors since it's just a debug message
}
const encryptedKey = await this.cryptoService.rsaEncrypt(encKey.key, publicKey.buffer);
const request = new EmergencyAccessConfirmRequest();

View File

@ -6,6 +6,7 @@ import { CollectionService } from 'jslib-common/abstractions/collection.service'
import { EventService } from 'jslib-common/abstractions/event.service';
import { FolderService } from 'jslib-common/abstractions/folder.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { MessagingService } from 'jslib-common/abstractions/messaging.service';
import { PasswordGenerationService } from 'jslib-common/abstractions/passwordGeneration.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
@ -31,10 +32,11 @@ export class EmergencyAddEditComponent extends BaseAddEditComponent {
auditService: AuditService, stateService: StateService,
userService: UserService, collectionService: CollectionService,
totpService: TotpService, passwordGenerationService: PasswordGenerationService,
messagingService: MessagingService, eventService: EventService, policyService: PolicyService) {
messagingService: MessagingService, eventService: EventService, policyService: PolicyService,
logService: LogService) {
super(cipherService, folderService, i18nService, platformUtilsService, auditService, stateService,
userService, collectionService, totpService, passwordGenerationService, messagingService,
eventService, policyService);
eventService, policyService, logService);
}
async load() {

View File

@ -10,6 +10,7 @@ import { AuthService } from 'jslib-common/abstractions/auth.service';
import { CryptoFunctionService } from 'jslib-common/abstractions/cryptoFunction.service';
import { EnvironmentService } from 'jslib-common/abstractions/environment.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PasswordGenerationService } from 'jslib-common/abstractions/passwordGeneration.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { StateService } from 'jslib-common/abstractions/state.service';
@ -31,12 +32,13 @@ export class LinkSsoComponent extends SsoComponent implements AfterContentInit {
apiService: ApiService, authService: AuthService,
router: Router, route: ActivatedRoute,
cryptoFunctionService: CryptoFunctionService, passwordGenerationService: PasswordGenerationService,
storageService: StorageService, stateService: StateService, environmentService: EnvironmentService) {
storageService: StorageService, stateService: StateService, environmentService: EnvironmentService,
logService: LogService) {
super(authService, router,
i18nService, route,
storageService, stateService,
platformUtilsService, apiService,
cryptoFunctionService, environmentService, passwordGenerationService);
cryptoFunctionService, environmentService, passwordGenerationService, logService);
this.returnUri = '/settings/organizations';
this.redirectUri = window.location.origin + '/sso-connector.html';

View File

@ -13,6 +13,7 @@ import { ToasterService } from 'angular2-toaster';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { PolicyService } from 'jslib-common/abstractions/policy.service';
import { SyncService } from 'jslib-common/abstractions/sync.service';
@ -24,8 +25,6 @@ import { TaxInfoComponent } from './tax-info.component';
import { EncString } from 'jslib-common/models/domain/encString';
import { SymmetricCryptoKey } from 'jslib-common/models/domain/symmetricCryptoKey';
import { OrganizationUserStatusType } from 'jslib-common/enums/organizationUserStatusType';
import { OrganizationUserType } from 'jslib-common/enums/organizationUserType';
import { PaymentMethodType } from 'jslib-common/enums/paymentMethodType';
import { PlanType } from 'jslib-common/enums/planType';
import { PolicyType } from 'jslib-common/enums/policyType';
@ -75,7 +74,7 @@ export class OrganizationPlansComponent implements OnInit {
constructor(private apiService: ApiService, private i18nService: I18nService,
private toasterService: ToasterService, platformUtilsService: PlatformUtilsService,
private cryptoService: CryptoService, private router: Router, private syncService: SyncService,
private policyService: PolicyService, private userService: UserService) {
private policyService: PolicyService, private userService: UserService, private logService: LogService) {
this.selfHosted = platformUtilsService.isSelfHost();
}
@ -264,7 +263,9 @@ export class OrganizationPlansComponent implements OnInit {
this.formPromise = doSubmit();
await this.formPromise;
this.onSuccess.emit();
} catch { }
} catch (e) {
this.logService.error(e);
}
}
private async userHasBlockingSingleOrgPolicy() {

View File

@ -9,6 +9,7 @@ import { ToasterService } from 'angular2-toaster';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { PolicyService } from 'jslib-common/abstractions/policy.service';
import { SyncService } from 'jslib-common/abstractions/sync.service';
@ -38,7 +39,8 @@ export class OrganizationsComponent implements OnInit {
constructor(private userService: UserService, private platformUtilsService: PlatformUtilsService,
private i18nService: I18nService, private apiService: ApiService,
private toasterService: ToasterService, private syncService: SyncService,
private cryptoService: CryptoService, private policyService: PolicyService) { }
private cryptoService: CryptoService, private policyService: PolicyService,
private logService: LogService) { }
async ngOnInit() {
if (!this.vault) {
@ -85,7 +87,9 @@ export class OrganizationsComponent implements OnInit {
await this.actionPromise;
this.toasterService.popAsync('success', null, 'Unlinked SSO');
await this.load();
} catch { }
} catch (e) {
this.logService.error(e);
}
}
async leave(org: Organization) {
@ -103,7 +107,9 @@ export class OrganizationsComponent implements OnInit {
await this.actionPromise;
this.toasterService.popAsync('success', null, this.i18nService.t('leftOrganization'));
await this.load();
} catch { }
} catch (e) {
this.logService.error(e);
}
}
async toggleResetPasswordEnrollment(org: Organization) {
@ -158,6 +164,8 @@ export class OrganizationsComponent implements OnInit {
await this.actionPromise;
this.platformUtilsService.showToast('success', null, this.i18nService.t(toastStringRef));
await this.load();
} catch { }
} catch (e) {
this.logService.error(e);
}
}
}

View File

@ -7,6 +7,7 @@ import {
import { PaymentMethodType } from 'jslib-common/enums/paymentMethodType';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { ThemeType } from 'jslib-common/enums/themeType';
@ -52,7 +53,8 @@ export class PaymentComponent implements OnInit {
private StripeElementStyle: any;
private StripeElementClasses: any;
constructor(private platformUtilsService: PlatformUtilsService, private apiService: ApiService) {
constructor(private platformUtilsService: PlatformUtilsService, private apiService: ApiService,
private logService: LogService) {
this.stripeScript = window.document.createElement('script');
this.stripeScript.src = 'https://js.stripe.com/v3/';
this.stripeScript.async = true;
@ -107,7 +109,9 @@ export class PaymentComponent implements OnInit {
if (el.src != null && el.src.indexOf('stripe') > -1) {
try {
window.document.body.removeChild(el);
} catch { }
} catch (e) {
this.logService.error(e);
}
}
});
}, 500);
@ -118,14 +122,18 @@ export class PaymentComponent implements OnInit {
if (el.src != null && el.src.indexOf('paypal') > -1) {
try {
window.document.head.removeChild(el);
} catch { }
} catch (e) {
this.logService.error(e);
}
}
});
const btStylesheet = window.document.head.querySelector('#braintree-dropin-stylesheet');
if (btStylesheet != null) {
try {
window.document.head.removeChild(btStylesheet);
} catch { }
} catch (e) {
this.logService.error(e);
}
}
}, 500);
}

View File

@ -9,6 +9,7 @@ import { ToasterService } from 'angular2-toaster';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { MessagingService } from 'jslib-common/abstractions/messaging.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { SyncService } from 'jslib-common/abstractions/sync.service';
@ -38,7 +39,7 @@ export class PremiumComponent implements OnInit {
private toasterService: ToasterService, platformUtilsService: PlatformUtilsService,
private tokenService: TokenService, private router: Router,
private messagingService: MessagingService, private syncService: SyncService,
private userService: UserService) {
private userService: UserService, private logService: LogService) {
this.selfHosted = platformUtilsService.isSelfHost();
}
@ -97,7 +98,9 @@ export class PremiumComponent implements OnInit {
});
}
await this.formPromise;
} catch { }
} catch (e) {
this.logService.error(e);
}
}
async finalizePremium() {

View File

@ -8,6 +8,7 @@ import { ToasterService } from 'angular2-toaster';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { UserService } from 'jslib-common/abstractions/user.service';
import { UpdateProfileRequest } from 'jslib-common/models/request/updateProfileRequest';
@ -27,7 +28,7 @@ export class ProfileComponent implements OnInit {
constructor(private apiService: ApiService, private i18nService: I18nService,
private toasterService: ToasterService, private userService: UserService,
private cryptoService: CryptoService) { }
private cryptoService: CryptoService, private logService: LogService) { }
async ngOnInit() {
this.profile = await this.apiService.getProfile();
@ -44,6 +45,8 @@ export class ProfileComponent implements OnInit {
this.formPromise = this.apiService.putProfile(request);
await this.formPromise;
this.toasterService.popAsync('success', null, this.i18nService.t('accountUpdated'));
} catch { }
} catch (e) {
this.logService.error(e);
}
}
}

View File

@ -9,6 +9,7 @@ import { ToasterService } from 'angular2-toaster';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PasswordVerificationRequest } from 'jslib-common/models/request/passwordVerificationRequest';
@ -24,7 +25,7 @@ export class PurgeVaultComponent {
constructor(private apiService: ApiService, private i18nService: I18nService,
private toasterService: ToasterService, private cryptoService: CryptoService,
private router: Router) { }
private router: Router, private logService: LogService) { }
async submit() {
if (this.masterPassword == null || this.masterPassword === '') {
@ -44,6 +45,8 @@ export class PurgeVaultComponent {
} else {
this.router.navigate(['vault']);
}
} catch { }
} catch (e) {
this.logService.error(e);
}
}
}

View File

@ -5,6 +5,7 @@ import {
} from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { OrganizationTaxInfoUpdateRequest } from 'jslib-common/models/request/organizationTaxInfoUpdateRequest';
import { TaxInfoUpdateRequest } from 'jslib-common/models/request/taxInfoUpdateRequest';
import { TaxRateResponse } from 'jslib-common/models/response/taxRateResponse';
@ -42,7 +43,7 @@ export class TaxInfoComponent {
includeTaxId: false,
};
constructor(private apiService: ApiService, private route: ActivatedRoute) { }
constructor(private apiService: ApiService, private route: ActivatedRoute, private logService: LogService) { }
async ngOnInit() {
this.route.parent.parent.params.subscribe(async params => {
@ -66,7 +67,9 @@ export class TaxInfoComponent {
|| !!taxInfo.city
|| !!taxInfo.state);
}
} catch { }
} catch (e) {
this.logService.error(e);
}
} else {
const taxInfo = await this.apiService.getTaxInfo();
if (taxInfo) {

View File

@ -8,6 +8,7 @@ import { ToasterService } from 'angular2-toaster';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { UserService } from 'jslib-common/abstractions/user.service';
@ -32,8 +33,8 @@ export class TwoFactorAuthenticatorComponent extends TwoFactorBaseComponent impl
constructor(apiService: ApiService, i18nService: I18nService,
toasterService: ToasterService, private userService: UserService,
platformUtilsService: PlatformUtilsService) {
super(apiService, i18nService, toasterService, platformUtilsService);
platformUtilsService: PlatformUtilsService, logService: LogService) {
super(apiService, i18nService, toasterService, platformUtilsService, logService);
this.qrScript = window.document.createElement('script');
this.qrScript.src = 'scripts/qrious.min.js';
this.qrScript.async = true;

View File

@ -8,6 +8,7 @@ import { ToasterService } from 'angular2-toaster';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { TwoFactorProviderType } from 'jslib-common/enums/twoFactorProviderType';
@ -26,7 +27,8 @@ export abstract class TwoFactorBaseComponent {
protected masterPasswordHash: string;
constructor(protected apiService: ApiService, protected i18nService: I18nService,
protected toasterService: ToasterService, protected platformUtilsService: PlatformUtilsService) { }
protected toasterService: ToasterService, protected platformUtilsService: PlatformUtilsService,
protected logService: LogService) { }
protected auth(authResponse: any) {
this.masterPasswordHash = authResponse.masterPasswordHash;
@ -37,7 +39,9 @@ export abstract class TwoFactorBaseComponent {
try {
await enableFunction();
this.onUpdated.emit(true);
} catch { }
} catch (e) {
this.logService.error(e);
}
}
protected async disable(promise: Promise<any>) {
@ -60,6 +64,8 @@ export abstract class TwoFactorBaseComponent {
this.enabled = false;
this.toasterService.popAsync('success', null, this.i18nService.t('twoStepDisabled'));
this.onUpdated.emit(false);
} catch { }
} catch (e) {
this.logService.error(e);
}
}
}

View File

@ -4,6 +4,7 @@ import { ToasterService } from 'angular2-toaster';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { TwoFactorProviderType } from 'jslib-common/enums/twoFactorProviderType';
@ -24,8 +25,9 @@ export class TwoFactorDuoComponent extends TwoFactorBaseComponent {
formPromise: Promise<any>;
constructor(apiService: ApiService, i18nService: I18nService,
toasterService: ToasterService, platformUtilsService: PlatformUtilsService) {
super(apiService, i18nService, toasterService, platformUtilsService);
toasterService: ToasterService, platformUtilsService: PlatformUtilsService,
logService: LogService) {
super(apiService, i18nService, toasterService, platformUtilsService, logService);
}
auth(authResponse: any) {

View File

@ -4,6 +4,7 @@ import { ToasterService } from 'angular2-toaster';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { UserService } from 'jslib-common/abstractions/user.service';
@ -29,8 +30,8 @@ export class TwoFactorEmailComponent extends TwoFactorBaseComponent {
constructor(apiService: ApiService, i18nService: I18nService,
toasterService: ToasterService, platformUtilsService: PlatformUtilsService,
private userService: UserService) {
super(apiService, i18nService, toasterService, platformUtilsService);
private userService: UserService, logService: LogService) {
super(apiService, i18nService, toasterService, platformUtilsService, logService);
}
auth(authResponse: any) {
@ -52,7 +53,9 @@ export class TwoFactorEmailComponent extends TwoFactorBaseComponent {
this.emailPromise = this.apiService.postTwoFactorEmailSetup(request);
await this.emailPromise;
this.sentEmail = this.email;
} catch { }
} catch (e) {
this.logService.error(e);
}
}
protected enable() {

View File

@ -12,6 +12,7 @@ import { TwoFactorProviderType } from 'jslib-common/enums/twoFactorProviderType'
import { ApiService } from 'jslib-common/abstractions/api.service';
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PasswordVerificationRequest } from 'jslib-common/models/request/passwordVerificationRequest';
@ -30,7 +31,8 @@ export class TwoFactorVerifyComponent {
private masterPasswordHash: string;
constructor(private apiService: ApiService, private i18nService: I18nService,
private toasterService: ToasterService, private cryptoService: CryptoService) { }
private toasterService: ToasterService, private cryptoService: CryptoService,
private logService: LogService) { }
async submit() {
if (this.masterPassword == null || this.masterPassword === '') {
@ -75,6 +77,8 @@ export class TwoFactorVerifyComponent {
response: response,
masterPasswordHash: this.masterPasswordHash,
});
} catch { }
} catch (e) {
this.logService.error(e);
}
}
}

View File

@ -7,6 +7,7 @@ import { ToasterService } from 'angular2-toaster';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { TwoFactorProviderType } from 'jslib-common/enums/twoFactorProviderType';
@ -39,8 +40,8 @@ export class TwoFactorWebAuthnComponent extends TwoFactorBaseComponent {
constructor(apiService: ApiService, i18nService: I18nService,
toasterService: ToasterService, platformUtilsService: PlatformUtilsService,
private ngZone: NgZone) {
super(apiService, i18nService, toasterService, platformUtilsService);
private ngZone: NgZone, logService: LogService) {
super(apiService, i18nService, toasterService, platformUtilsService, logService);
}
auth(authResponse: any) {
@ -89,7 +90,9 @@ export class TwoFactorWebAuthnComponent extends TwoFactorBaseComponent {
const response = await key.removePromise;
key.removePromise = null;
await this.processResponse(response);
} catch { }
} catch (e) {
this.logService.error(e);
}
}
async readKey() {
@ -102,7 +105,9 @@ export class TwoFactorWebAuthnComponent extends TwoFactorBaseComponent {
this.challengePromise = this.apiService.getTwoFactorWebAuthnChallenge(request);
const challenge = await this.challengePromise;
this.readDevice(challenge);
} catch { }
} catch (e) {
this.logService.error(e);
}
}
private readDevice(webAuthnChallenge: ChallengeResponse) {

View File

@ -4,6 +4,7 @@ import { ToasterService } from 'angular2-toaster';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { UpdateTwoFactorYubioOtpRequest } from 'jslib-common/models/request/updateTwoFactorYubioOtpRequest';
@ -26,8 +27,9 @@ export class TwoFactorYubiKeyComponent extends TwoFactorBaseComponent {
disablePromise: Promise<any>;
constructor(apiService: ApiService, i18nService: I18nService,
toasterService: ToasterService, platformUtilsService: PlatformUtilsService) {
super(apiService, i18nService, toasterService, platformUtilsService);
toasterService: ToasterService, platformUtilsService: PlatformUtilsService,
logService: LogService) {
super(apiService, i18nService, toasterService, platformUtilsService, logService);
}
auth(authResponse: any) {

View File

@ -10,6 +10,7 @@ import { CipherService } from 'jslib-common/abstractions/cipher.service';
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
import { FolderService } from 'jslib-common/abstractions/folder.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { MessagingService } from 'jslib-common/abstractions/messaging.service';
import { SyncService } from 'jslib-common/abstractions/sync.service';
@ -30,7 +31,8 @@ export class UpdateKeyComponent {
constructor(private apiService: ApiService, private i18nService: I18nService,
private toasterService: ToasterService, private cryptoService: CryptoService,
private messagingService: MessagingService, private syncService: SyncService,
private folderService: FolderService, private cipherService: CipherService) { }
private folderService: FolderService, private cipherService: CipherService,
private logService: LogService) { }
async submit() {
const hasEncKey = await this.cryptoService.hasEncKey();
@ -57,7 +59,9 @@ export class UpdateKeyComponent {
};
this.toasterService.popAsync(toast);
this.messagingService.send('logout');
} catch { }
} catch (e) {
this.logService.error(e);
}
}
private async makeRequest(): Promise<UpdateKeyRequest> {

View File

@ -9,6 +9,7 @@ import { ToasterService } from 'angular2-toaster';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
@Component({
selector: 'app-update-license',
@ -22,7 +23,7 @@ export class UpdateLicenseComponent {
formPromise: Promise<any>;
constructor(private apiService: ApiService, private i18nService: I18nService,
private toasterService: ToasterService) { }
private toasterService: ToasterService, private logService: LogService) { }
async submit() {
const fileEl = document.getElementById('file') as HTMLInputElement;
@ -51,7 +52,9 @@ export class UpdateLicenseComponent {
await this.formPromise;
this.toasterService.popAsync('success', null, this.i18nService.t('updatedLicense'));
this.onUpdated.emit();
} catch { }
} catch (e) {
this.logService.error(e);
}
}
cancel() {

View File

@ -9,6 +9,7 @@ import { BillingResponse } from 'jslib-common/models/response/billingResponse';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { PaymentMethodType } from 'jslib-common/enums/paymentMethodType';
@ -34,7 +35,8 @@ export class UserBillingComponent implements OnInit {
verifyBankPromise: Promise<any>;
constructor(protected apiService: ApiService, protected i18nService: I18nService,
protected toasterService: ToasterService, protected platformUtilsService: PlatformUtilsService) { }
protected toasterService: ToasterService, protected platformUtilsService: PlatformUtilsService,
private logService: LogService) { }
async ngOnInit() {
await this.load();
@ -67,7 +69,9 @@ export class UserBillingComponent implements OnInit {
await this.verifyBankPromise;
this.toasterService.popAsync('success', null, this.i18nService.t('verifiedBankAccount'));
this.load();
} catch { }
} catch (e) {
this.logService.error(e);
}
}
addCredit() {

View File

@ -10,6 +10,7 @@ import { SubscriptionResponse } from 'jslib-common/models/response/subscriptionR
import { ApiService } from 'jslib-common/abstractions/api.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { TokenService } from 'jslib-common/abstractions/token.service';
@ -31,7 +32,7 @@ export class UserSubscriptionComponent implements OnInit {
constructor(private tokenService: TokenService, private apiService: ApiService,
private platformUtilsService: PlatformUtilsService, private i18nService: I18nService,
private toasterService: ToasterService, private router: Router) {
private toasterService: ToasterService, private router: Router, private logService: LogService) {
this.selfHosted = platformUtilsService.isSelfHost();
}
@ -78,7 +79,9 @@ export class UserSubscriptionComponent implements OnInit {
await this.reinstatePromise;
this.toasterService.popAsync('success', null, this.i18nService.t('reinstated'));
this.load();
} catch { }
} catch (e) {
this.logService.error(e);
}
}
async cancel() {
@ -103,7 +106,9 @@ export class UserSubscriptionComponent implements OnInit {
await this.cancelPromise;
this.toasterService.popAsync('success', null, this.i18nService.t('canceledSubscription'));
this.load();
} catch { }
} catch (e) {
this.logService.error(e);
}
}
downloadLicense() {

View File

@ -4,6 +4,7 @@ import { ToasterService } from 'angular2-toaster';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
@Component({
selector: 'app-verify-email',
@ -13,7 +14,7 @@ export class VerifyEmailComponent {
actionPromise: Promise<any>;
constructor(private apiService: ApiService, private i18nService: I18nService,
private toasterService: ToasterService) { }
private toasterService: ToasterService, private logService: LogService) { }
async send() {
if (this.actionPromise != null) {
@ -23,7 +24,9 @@ export class VerifyEmailComponent {
this.actionPromise = this.apiService.postAccountVerifyEmail();
await this.actionPromise;
this.toasterService.popAsync('success', null, this.i18nService.t('checkInboxForVerification'));
} catch { }
} catch (e) {
this.logService.error(e);
}
this.actionPromise = null;
}
}

View File

@ -4,10 +4,11 @@ import { CryptoService } from 'jslib-common/abstractions/crypto.service';
import { EventService } from 'jslib-common/abstractions/event.service';
import { ExportService } from 'jslib-common/abstractions/export.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { PolicyService } from 'jslib-common/abstractions/policy.service';
import { ExportComponent as BaseExportComponent } from 'jslib-angular/components/export.component';
import { PolicyService } from 'jslib-common/abstractions/policy.service';
@Component({
selector: 'app-export',
@ -18,8 +19,9 @@ export class ExportComponent extends BaseExportComponent {
constructor(cryptoService: CryptoService, i18nService: I18nService,
platformUtilsService: PlatformUtilsService, exportService: ExportService,
eventService: EventService, policyService: PolicyService) {
super(cryptoService, i18nService, platformUtilsService, exportService, eventService, policyService, window);
eventService: EventService, policyService: PolicyService, logService: LogService) {
super(cryptoService, i18nService, platformUtilsService, exportService, eventService,
policyService, window, logService);
}
protected saved() {

View File

@ -8,6 +8,7 @@ import { ToasterService } from 'angular2-toaster';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { ImportOption, ImportService } from 'jslib-common/abstractions/import.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { PolicyService } from 'jslib-common/abstractions/policy.service';
@ -33,7 +34,8 @@ export class ImportComponent implements OnInit {
constructor(protected i18nService: I18nService, protected toasterService: ToasterService,
protected importService: ImportService, protected router: Router,
protected platformUtilsService: PlatformUtilsService, protected policyService: PolicyService) { }
protected platformUtilsService: PlatformUtilsService, protected policyService: PolicyService,
private logService: LogService) { }
async ngOnInit() {
this.setImportOptions();
@ -88,7 +90,9 @@ export class ImportComponent implements OnInit {
if (content != null) {
fileContents = content;
}
} catch { }
} catch (e) {
this.logService.error(e);
}
}
if (fileContents == null || fileContents === '') {
@ -108,7 +112,9 @@ export class ImportComponent implements OnInit {
}
this.toasterService.popAsync('success', null, this.i18nService.t('importSuccess'));
this.router.navigate(this.successNavigate);
} catch { }
} catch (e) {
this.logService.error(e);
}
this.loading = false;
}

View File

@ -4,6 +4,7 @@ import {
} from '@angular/core';
import { CipherService } from 'jslib-common/abstractions/cipher.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { MessagingService } from 'jslib-common/abstractions/messaging.service';
import { PasswordRepromptService } from 'jslib-common/abstractions/passwordReprompt.service';
import { UserService } from 'jslib-common/abstractions/user.service';
@ -27,7 +28,8 @@ export class InactiveTwoFactorReportComponent extends CipherReportComponent impl
cipherDocs = new Map<string, string>();
constructor(protected cipherService: CipherService, modalService: ModalService,
messagingService: MessagingService, userService: UserService, passwordRepromptService: PasswordRepromptService) {
messagingService: MessagingService, userService: UserService, private logService: LogService,
passwordRepromptService: PasswordRepromptService) {
super(modalService, userService, messagingService, passwordRepromptService, true);
}
@ -40,7 +42,10 @@ export class InactiveTwoFactorReportComponent extends CipherReportComponent impl
async setCiphers() {
try {
await this.load2fa();
} catch { }
} catch (e) {
this.logService.error(e);
}
if (this.services.size > 0) {
const allCiphers = await this.getAllCiphers();
const inactive2faCiphers: CipherView[] = [];

View File

@ -9,6 +9,7 @@ import { CollectionService } from 'jslib-common/abstractions/collection.service'
import { EventService } from 'jslib-common/abstractions/event.service';
import { FolderService } from 'jslib-common/abstractions/folder.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { MessagingService } from 'jslib-common/abstractions/messaging.service';
import { PasswordGenerationService } from 'jslib-common/abstractions/passwordGeneration.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
@ -44,9 +45,9 @@ export class AddEditComponent extends BaseAddEditComponent {
userService: UserService, collectionService: CollectionService,
protected totpService: TotpService, protected passwordGenerationService: PasswordGenerationService,
protected messagingService: MessagingService, eventService: EventService,
protected policyService: PolicyService) {
protected policyService: PolicyService, logService: LogService) {
super(cipherService, folderService, i18nService, platformUtilsService, auditService, stateService,
userService, collectionService, messagingService, eventService, policyService);
userService, collectionService, messagingService, eventService, policyService, logService);
}
async ngOnInit() {

View File

@ -4,6 +4,7 @@ import { ApiService } from 'jslib-common/abstractions/api.service';
import { CipherService } from 'jslib-common/abstractions/cipher.service';
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { UserService } from 'jslib-common/abstractions/user.service';
@ -20,8 +21,10 @@ export class AttachmentsComponent extends BaseAttachmentsComponent {
constructor(cipherService: CipherService, i18nService: I18nService,
cryptoService: CryptoService, userService: UserService,
platformUtilsService: PlatformUtilsService, apiService: ApiService) {
super(cipherService, i18nService, cryptoService, userService, platformUtilsService, apiService, window);
platformUtilsService: PlatformUtilsService, apiService: ApiService,
logService: LogService) {
super(cipherService, i18nService, cryptoService, userService, platformUtilsService, apiService, window,
logService);
}
protected async reupload(attachment: AttachmentView) {

View File

@ -11,6 +11,7 @@ import { ToasterService } from 'angular2-toaster';
import { CipherService } from 'jslib-common/abstractions/cipher.service';
import { CollectionService } from 'jslib-common/abstractions/collection.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { UserService } from 'jslib-common/abstractions/user.service';
import { CipherView } from 'jslib-common/models/view/cipherView';
@ -37,7 +38,7 @@ export class BulkShareComponent implements OnInit {
constructor(private cipherService: CipherService, private toasterService: ToasterService,
private i18nService: I18nService, private collectionService: CollectionService,
private userService: UserService) { }
private userService: UserService, private logService: LogService) { }
async ngOnInit() {
this.shareableCiphers = this.ciphers.filter(c => !c.hasOldAttachments && c.organizationId == null);
@ -73,7 +74,9 @@ export class BulkShareComponent implements OnInit {
this.onShared.emit();
const orgName = this.organizations.find(o => o.id === this.organizationId)?.name ?? this.i18nService.t('organization');
this.toasterService.popAsync('success', null, this.i18nService.t('movedItemsToOrg', orgName));
} catch { }
} catch (e) {
this.logService.error(e);
}
}
check(c: CollectionView, select?: boolean) {

View File

@ -11,6 +11,7 @@ import { ToasterService } from 'angular2-toaster';
import { CipherService } from 'jslib-common/abstractions/cipher.service';
import { EventService } from 'jslib-common/abstractions/event.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PasswordRepromptService } from 'jslib-common/abstractions/passwordReprompt.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { SearchService } from 'jslib-common/abstractions/search.service';
@ -52,7 +53,7 @@ export class CiphersComponent extends BaseCiphersComponent implements OnDestroy
protected i18nService: I18nService, protected platformUtilsService: PlatformUtilsService,
protected cipherService: CipherService, protected eventService: EventService,
protected totpService: TotpService, protected userService: UserService,
protected passwordRepromptService: PasswordRepromptService) {
protected passwordRepromptService: PasswordRepromptService, private logService: LogService) {
super(searchService);
}
@ -158,7 +159,9 @@ export class CiphersComponent extends BaseCiphersComponent implements OnDestroy
this.toasterService.popAsync('success', null, this.i18nService.t(permanent ? 'permanentlyDeletedItem'
: 'deletedItem'));
this.refresh();
} catch { }
} catch (e) {
this.logService.error(e);
}
this.actionPromise = null;
}
@ -179,7 +182,9 @@ export class CiphersComponent extends BaseCiphersComponent implements OnDestroy
await this.actionPromise;
this.toasterService.popAsync('success', null, this.i18nService.t('restoredItem'));
this.refresh();
} catch { }
} catch (e) {
this.logService.error(e);
}
this.actionPromise = null;
}

View File

@ -6,6 +6,7 @@ import {
import { CipherService } from 'jslib-common/abstractions/cipher.service';
import { CollectionService } from 'jslib-common/abstractions/collection.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { CollectionView } from 'jslib-common/models/view/collectionView';
@ -18,8 +19,8 @@ import { CollectionsComponent as BaseCollectionsComponent } from 'jslib-angular/
})
export class CollectionsComponent extends BaseCollectionsComponent implements OnDestroy {
constructor(collectionService: CollectionService, platformUtilsService: PlatformUtilsService,
i18nService: I18nService, cipherService: CipherService) {
super(collectionService, platformUtilsService, i18nService, cipherService);
i18nService: I18nService, cipherService: CipherService, logService: LogService) {
super(collectionService, platformUtilsService, i18nService, cipherService, logService);
}
ngOnDestroy() {

View File

@ -2,6 +2,7 @@ import { Component } from '@angular/core';
import { FolderService } from 'jslib-common/abstractions/folder.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import {
@ -14,7 +15,7 @@ import {
})
export class FolderAddEditComponent extends BaseFolderAddEditComponent {
constructor(folderService: FolderService, i18nService: I18nService,
platformUtilsService: PlatformUtilsService) {
super(folderService, i18nService, platformUtilsService);
platformUtilsService: PlatformUtilsService, logService: LogService) {
super(folderService, i18nService, platformUtilsService, logService);
}
}

View File

@ -12,6 +12,7 @@ import { UserService } from 'jslib-common/abstractions/user.service';
import { CollectionView } from 'jslib-common/models/view/collectionView';
import { ShareComponent as BaseShareComponent } from 'jslib-angular/components/share.component';
import { LogService } from 'jslib-common/abstractions/log.service';
@Component({
selector: 'app-vault-share',
@ -20,8 +21,9 @@ import { ShareComponent as BaseShareComponent } from 'jslib-angular/components/s
export class ShareComponent extends BaseShareComponent implements OnDestroy {
constructor(collectionService: CollectionService, platformUtilsService: PlatformUtilsService,
i18nService: I18nService, userService: UserService,
cipherService: CipherService) {
super(collectionService, platformUtilsService, i18nService, userService, cipherService);
cipherService: CipherService, logService: LogService) {
super(collectionService, platformUtilsService, i18nService, userService, cipherService,
logService);
}
ngOnDestroy() {

View File

@ -31,5 +31,8 @@ document.addEventListener('DOMContentLoaded', event => {
function invokeCSCode(data: string) {
try {
(window as any).invokeCSharpAction(data);
} catch (err) { }
} catch (err) {
// tslint:disable-next-line
console.log(err);
}
}

View File

@ -34,7 +34,7 @@
]
}
],
"no-empty": [ true, "allow-empty-catch" ],
"no-empty": [ true ],
"object-literal-sort-keys": false,
"object-literal-shorthand": [ true, "never" ],
"prefer-for-of": false,