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 @@

- +
diff --git a/src/app/analytics/members.component.ts b/src/app/analytics/members.component.ts index c7daf47d6..13b63248d 100644 --- a/src/app/analytics/members.component.ts +++ b/src/app/analytics/members.component.ts @@ -18,7 +18,6 @@ import { CallStatus } from '../common/call-status'; import * as myGlobals from '../globals'; import { sanitizeLink, copy } from '../common/utils'; import { AppComponent } from "../app.component"; -import { TranslateService } from '@ngx-translate/core'; import { SimpleSearchService } from "../simple-search/simple-search.service"; import { Search } from "./model/search"; import { debounceTime, distinctUntilChanged, switchMap } from "rxjs/operators"; @@ -61,8 +60,7 @@ export class MembersComponent implements OnInit { constructor( private analyticsService: AnalyticsService, public appComponent: AppComponent, - private simpleSearchService: SimpleSearchService, - private translate: TranslateService + private simpleSearchService: SimpleSearchService ) { } @@ -76,6 +74,9 @@ export class MembersComponent implements OnInit { this.getCompanies(); } + onImageError(event){ + event.target.src = this.config.emptyImage; + } getCompanies() { let rows = this.rows; if (this.view == "List") { diff --git a/src/app/analytics/performance/performance-analytics.component.html b/src/app/analytics/performance/performance-analytics.component.html index e69c9fcd7..374429c9f 100644 --- a/src/app/analytics/performance/performance-analytics.component.html +++ b/src/app/analytics/performance/performance-analytics.component.html @@ -249,12 +249,12 @@
+
- @@ -277,12 +277,12 @@
+
- @@ -305,12 +305,12 @@
+
- @@ -335,12 +335,12 @@
+
- diff --git a/src/app/analytics/performance/performance-analytics.component.ts b/src/app/analytics/performance/performance-analytics.component.ts index f7459e60c..af0841d0f 100644 --- a/src/app/analytics/performance/performance-analytics.component.ts +++ b/src/app/analytics/performance/performance-analytics.component.ts @@ -332,7 +332,6 @@ export class PerformanceAnalyticsComponent implements OnInit { this.analyticsService .getCollabAnalytics(this.comp_id) .then(res => { - this.callStatusCollab.callback("Successfully loaded collab analytics", true); // average trade seller this.trade_green_sell = Math.round(res.tradingVolumesales.approved); this.trade_yellow_sell = Math.round(res.tradingVolumesales.waiting); @@ -435,7 +434,7 @@ export class PerformanceAnalyticsComponent implements OnInit { } - + this.callStatusCollab.callback("Successfully loaded collab analytics", true); }) .catch(error => { this.callStatusCollab.error("Error while loading platform analytics", error); diff --git a/src/app/analytics/platform-analytics.component.html b/src/app/analytics/platform-analytics.component.html index b521ec29d..d472f8b6e 100644 --- a/src/app/analytics/platform-analytics.component.html +++ b/src/app/analytics/platform-analytics.component.html @@ -170,12 +170,12 @@
+
- @@ -198,12 +198,12 @@
+
- @@ -226,12 +226,12 @@
+
- @@ -256,12 +256,12 @@
+
- +
diff --git a/src/app/analytics/platform-info.component.ts b/src/app/analytics/platform-info.component.ts index 046a6ee72..0bbce8a15 100644 --- a/src/app/analytics/platform-info.component.ts +++ b/src/app/analytics/platform-info.component.ts @@ -16,7 +16,6 @@ import {Component, OnInit} from '@angular/core'; import * as myGlobals from '../globals'; -import { TranslateService } from '@ngx-translate/core'; import {DEFAULT_LANGUAGE} from '../catalogue/model/constants'; @Component({ @@ -31,8 +30,7 @@ export class PlatformInfoComponent implements OnInit{ imprint = null; - constructor(private translate: TranslateService, - ) { + constructor() { } ngOnInit() { diff --git a/src/app/analytics/platform-members.component.ts b/src/app/analytics/platform-members.component.ts index 1381a5c21..1caa130ba 100644 --- a/src/app/analytics/platform-members.component.ts +++ b/src/app/analytics/platform-members.component.ts @@ -13,7 +13,6 @@ */ import { Component, OnInit } from "@angular/core"; -import { TranslateService } from '@ngx-translate/core'; import { ActivatedRoute } from "@angular/router"; @Component({ @@ -26,7 +25,6 @@ export class PlatformMembersComponent implements OnInit { size = 12; constructor( - private translate: TranslateService, private route: ActivatedRoute ) { } diff --git a/src/app/analytics/trust-policy.component.ts b/src/app/analytics/trust-policy.component.ts index 5cacfbe05..0abb5770e 100644 --- a/src/app/analytics/trust-policy.component.ts +++ b/src/app/analytics/trust-policy.component.ts @@ -15,7 +15,6 @@ import { Component, OnInit } from "@angular/core"; import { AnalyticsService } from "./analytics.service"; import { CallStatus } from "../common/call-status"; -import { TranslateService } from '@ngx-translate/core'; @Component({ selector: "trust-policy", @@ -30,8 +29,7 @@ export class TrustPolicyComponent implements OnInit { callStatus: CallStatus = new CallStatus(); saveCallStatus: CallStatus = new CallStatus(); - constructor(private analyticsService: AnalyticsService, - private translate: TranslateService) { + constructor(private analyticsService: AnalyticsService) { } ngOnInit(): void { diff --git a/src/app/app.component.html b/src/app/app.component.html index 4267ec2af..d45e2f115 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -298,7 +298,7 @@