diff --git a/src/app/analytics/analytics.service.ts b/src/app/analytics/analytics.service.ts index 8591472d8..53907742b 100644 --- a/src/app/analytics/analytics.service.ts +++ b/src/app/analytics/analytics.service.ts @@ -97,7 +97,10 @@ export class AnalyticsService { return this.http .get(url, { headers: headers, withCredentials: true }) .toPromise() - .then(res => res.json()) + .then(res => { + // the server returns empty text if there is no global trust policy + return res.text() ? res.json(): res + }) .catch(this.handleError); } diff --git a/src/app/analytics/company-analytics.component.ts b/src/app/analytics/company-analytics.component.ts index 8a50a667b..029395c6b 100644 --- a/src/app/analytics/company-analytics.component.ts +++ b/src/app/analytics/company-analytics.component.ts @@ -13,8 +13,6 @@ */ import { Component, OnInit } from '@angular/core'; -import { AnalyticsService } from "./analytics.service"; -import { TranslateService } from '@ngx-translate/core'; @Component({ selector: 'company-analytics', @@ -26,8 +24,6 @@ export class CompanyAnalyticsComponent implements OnInit { constructor( - private analyticsService: AnalyticsService, - private translate: TranslateService, ) { } diff --git a/src/app/analytics/company-management.component.ts b/src/app/analytics/company-management.component.ts index 802e1cd9d..8da09b764 100644 --- a/src/app/analytics/company-management.component.ts +++ b/src/app/analytics/company-management.component.ts @@ -16,7 +16,6 @@ import { Component, OnInit, Input } from "@angular/core"; import { CompanyManagementTab } from "./model/company-management-tab"; -import { TranslateService } from '@ngx-translate/core'; @Component({ selector: "company-management", @@ -29,7 +28,7 @@ export class CompanyManagementComponent implements OnInit { selectedTab: CompanyManagementTab; - constructor(private translate: TranslateService) { + constructor() { } ngOnInit(): void { diff --git a/src/app/analytics/members.component.html b/src/app/analytics/members.component.html index 5b0c0b9b3..3cab534a6 100644 --- a/src/app/analytics/members.component.html +++ b/src/app/analytics/members.component.html @@ -67,7 +67,7 @@