From 1013d5ea2b2ff7edc17114ea3e67ae0a6f6d6e43 Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Tue, 1 Oct 2019 10:13:08 +0300 Subject: [PATCH] refactor(account): fix lint errors tenant-box --- .../tenant-box/tenant-box.component.ts | 33 +++++++++++++------ 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/npm/ng-packs/packages/account/src/lib/components/tenant-box/tenant-box.component.ts b/npm/ng-packs/packages/account/src/lib/components/tenant-box/tenant-box.component.ts index a1ba6004c5..c114095adc 100644 --- a/npm/ng-packs/packages/account/src/lib/components/tenant-box/tenant-box.component.ts +++ b/npm/ng-packs/packages/account/src/lib/components/tenant-box/tenant-box.component.ts @@ -9,10 +9,14 @@ import { AccountService } from '../../services/account.service'; @Component({ selector: 'abp-tenant-box', - templateUrl: './tenant-box.component.html', + templateUrl: './tenant-box.component.html' }) export class TenantBoxComponent implements OnInit { - constructor(private store: Store, private toasterService: ToasterService, private accountService: AccountService) {} + constructor( + private store: Store, + private toasterService: ToasterService, + private accountService: AccountService + ) {} tenant = {} as ABP.BasicItem; @@ -21,7 +25,9 @@ export class TenantBoxComponent implements OnInit { isModalVisible: boolean; ngOnInit() { - this.tenant = this.store.selectSnapshot(SessionState.getTenant) || ({} as ABP.BasicItem); + this.tenant = + this.store.selectSnapshot(SessionState.getTenant) || + ({} as ABP.BasicItem); this.tenantName = this.tenant.name || ''; } @@ -37,24 +43,31 @@ export class TenantBoxComponent implements OnInit { take(1), catchError(err => { this.toasterService.error( - snq(() => err.error.error_description, 'AbpUi::DefaultErrorMessage'), - 'AbpUi::Error', + snq( + () => err.error.error_description, + 'AbpUi::DefaultErrorMessage' + ), + 'AbpUi::Error' ); return throwError(err); - }), + }) ) .subscribe(({ success, tenantId }) => { if (success) { this.tenant = { id: tenantId, - name: this.tenant.name, + name: this.tenant.name }; this.tenantName = this.tenant.name; this.isModalVisible = false; } else { - this.toasterService.error(`AbpUiMultiTenancy::GivenTenantIsNotAvailable`, 'AbpUi::Error', { - messageLocalizationParams: [this.tenant.name], - }); + this.toasterService.error( + 'AbpUiMultiTenancy::GivenTenantIsNotAvailable', + 'AbpUi::Error', + { + messageLocalizationParams: [this.tenant.name] + } + ); this.tenant = {} as ABP.BasicItem; } this.store.dispatch(new SetTenant(success ? this.tenant : null));