This is an automated email from the ASF dual-hosted git repository. dgnatyshyn pushed a commit to branch DLAB-1609 in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git
commit 1cb6a4685420f86d44aa09c78c2ea289dda3046c Author: Dmytro Gnatyshyn <[email protected]> AuthorDate: Wed Mar 4 15:11:23 2020 +0200 [DLAB-1609]: Conveyed 'Resource Type' value to UI --- .../src/app/administration/project/project-data.service.ts | 9 ++++++--- .../resources/webapp/src/app/reporting/reporting.component.ts | 8 ++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/project/project-data.service.ts b/services/self-service/src/main/resources/webapp/src/app/administration/project/project-data.service.ts index f60fb56..2755f16 100644 --- a/services/self-service/src/main/resources/webapp/src/app/administration/project/project-data.service.ts +++ b/services/self-service/src/main/resources/webapp/src/app/administration/project/project-data.service.ts @@ -26,9 +26,12 @@ import { Project } from './project.component'; @Injectable() export class ProjectDataService { - _projects = new BehaviorSubject<any>(null); - endpointsList: any; - constructor(private projectService: ProjectService, private endpointService: EndpointService) { + private _projects = new BehaviorSubject<any>(null); + private endpointsList: any = []; + constructor( + private projectService: ProjectService, + private endpointService: EndpointService + ) { this.getProjectsList(); } diff --git a/services/self-service/src/main/resources/webapp/src/app/reporting/reporting.component.ts b/services/self-service/src/main/resources/webapp/src/app/reporting/reporting.component.ts index 51cca06..b6fbc26 100644 --- a/services/self-service/src/main/resources/webapp/src/app/reporting/reporting.component.ts +++ b/services/self-service/src/main/resources/webapp/src/app/reporting/reporting.component.ts @@ -79,7 +79,7 @@ export class ReportingComponent implements OnInit, OnDestroy { ) { } ngOnInit() { - this.getBillingProvider(); + this.getEnvironmentHealthStatus(); } ngOnDestroy() { @@ -87,14 +87,13 @@ export class ReportingComponent implements OnInit, OnDestroy { } getBillingProvider() { - this.getEnvironmentHealthStatus(); if (this.admin) { this.endpointService.getEndpointsData().subscribe(list => { - // @ts-ignore - const endpoints = [...list]; + const endpoints = JSON.parse(JSON.stringify(list)); const localEndpoint = endpoints.filter(endpoint => endpoint.name === 'local'); if (localEndpoint.length) { this.PROVIDER = localEndpoint[0].cloudProvider.toLowerCase(); + console.log(this.PROVIDER); if (this.PROVIDER) { this.rebuildBillingReport(); } @@ -227,6 +226,7 @@ export class ReportingComponent implements OnInit, OnDestroy { .subscribe((result: any) => { this.billingEnabled = result.billingEnabled; this.admin = result.admin; + this.getBillingProvider(); }); } } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
