Browse Source

feat(account): add tenant-box component inputs and outputs interfaces

#2404
pull/2522/head
mehmet-erim 7 years ago
parent
commit
2239d010d4
  1. 20
      npm/ng-packs/packages/account/src/lib/components/tenant-box/tenant-box.component.ts
  2. 6
      npm/ng-packs/packages/account/src/lib/models/account.ts

20
npm/ng-packs/packages/account/src/lib/components/tenant-box/tenant-box.component.ts

@ -6,12 +6,14 @@ import { throwError } from 'rxjs';
import { catchError, take, finalize } from 'rxjs/operators';
import snq from 'snq';
import { AccountService } from '../../services/account.service';
import { Account } from '../../models/account';
@Component({
selector: 'abp-tenant-box',
templateUrl: './tenant-box.component.html',
})
export class TenantBoxComponent implements OnInit {
export class TenantBoxComponent
implements OnInit, Account.TenantBoxComponentInputs, Account.TenantBoxComponentOutputs {
tenant = {} as ABP.BasicItem;
tenantName: string;
@ -20,7 +22,11 @@ export class TenantBoxComponent implements OnInit {
inProgress: boolean;
constructor(private store: Store, private toasterService: ToasterService, private accountService: AccountService) {}
constructor(
private store: Store,
private toasterService: ToasterService,
private accountService: AccountService,
) {}
ngOnInit() {
this.tenant = this.store.selectSnapshot(SessionState.getTenant) || ({} as ABP.BasicItem);
@ -56,9 +62,13 @@ export class TenantBoxComponent implements OnInit {
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));

6
npm/ng-packs/packages/account/src/lib/models/account.ts

@ -0,0 +1,6 @@
// tslint:disable-next-line: no-empty-interface
export interface TenantBoxComponentInputs {}
// tslint:disable-next-line: no-empty-interface
export interface TenantBoxComponentOutputs {}
}
Loading…
Cancel
Save