feat(FinancialReports): add loading progress bar.

fix(preformance): Optimize preformance of virtualized list.
fix(preformance): Optimize financial reports preformance.
This commit is contained in:
a.bouhuolia
2021-03-16 17:27:27 +02:00
parent f1cf02c9df
commit 42230fe64b
73 changed files with 969 additions and 320 deletions

View File

@@ -19,6 +19,7 @@ const ERRORS = {
TENANT_ALREADY_SEEDED: 'tenant_already_seeded',
TENANT_DB_NOT_BUILT: 'tenant_db_not_built',
};
@Service()
export default class OrganizationService {
@EventDispatcher()
@@ -111,6 +112,20 @@ export default class OrganizationService {
return [tenant];
}
/**
* Retrieve the current organization metadata.
* @param {number} tenantId
* @returns {Promise<ITenant[]>}
*/
public async currentOrganization(tenantId: number): Promise<ITenant[]> {
const { tenantRepository } = this.sysRepositories;
const tenant = await tenantRepository.findOneById(tenantId, ['subscriptions']);
this.throwIfTenantNotExists(tenant);
return tenant;
}
/**
* Throws error in case the given tenant is undefined.
* @param {ITenant} tenant