|
|
@ -46,8 +46,8 @@ import { DeviceDetectorService } from 'ngx-device-detector'; |
|
|
export class GfHomeOverviewComponent implements OnInit { |
|
|
export class GfHomeOverviewComponent implements OnInit { |
|
|
protected readonly errors = signal<AssetProfileIdentifier[]>([]); |
|
|
protected readonly errors = signal<AssetProfileIdentifier[]>([]); |
|
|
protected readonly hasImpersonationId = signal(false); |
|
|
protected readonly hasImpersonationId = signal(false); |
|
|
protected historicalDataItems: LineChartItem[] | null; |
|
|
protected readonly historicalDataItems = signal<LineChartItem[] | null>(null); |
|
|
protected isLoadingPerformance = true; |
|
|
protected readonly isLoadingPerformance = signal(true); |
|
|
protected performance: PortfolioPerformance; |
|
|
protected performance: PortfolioPerformance; |
|
|
protected readonly performanceLabel = $localize`Performance`; |
|
|
protected readonly performanceLabel = $localize`Performance`; |
|
|
protected precision = 2; |
|
|
protected precision = 2; |
|
|
@ -116,8 +116,8 @@ export class GfHomeOverviewComponent implements OnInit { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private update() { |
|
|
private update() { |
|
|
this.historicalDataItems = null; |
|
|
this.historicalDataItems.set(null); |
|
|
this.isLoadingPerformance = true; |
|
|
this.isLoadingPerformance.set(true); |
|
|
|
|
|
|
|
|
this.dataService |
|
|
this.dataService |
|
|
.fetchPortfolioPerformance({ |
|
|
.fetchPortfolioPerformance({ |
|
|
@ -128,7 +128,7 @@ export class GfHomeOverviewComponent implements OnInit { |
|
|
this.errors.set(errors ?? []); |
|
|
this.errors.set(errors ?? []); |
|
|
this.performance = performance; |
|
|
this.performance = performance; |
|
|
|
|
|
|
|
|
this.historicalDataItems = |
|
|
this.historicalDataItems.set( |
|
|
chart?.map( |
|
|
chart?.map( |
|
|
({ date, netPerformanceInPercentageWithCurrencyEffect }) => { |
|
|
({ date, netPerformanceInPercentageWithCurrencyEffect }) => { |
|
|
return { |
|
|
return { |
|
|
@ -136,7 +136,8 @@ export class GfHomeOverviewComponent implements OnInit { |
|
|
value: (netPerformanceInPercentageWithCurrencyEffect ?? 0) * 100 |
|
|
value: (netPerformanceInPercentageWithCurrencyEffect ?? 0) * 100 |
|
|
}; |
|
|
}; |
|
|
} |
|
|
} |
|
|
) ?? null; |
|
|
) ?? null |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
if ( |
|
|
if ( |
|
|
this.deviceType() === 'mobile' && |
|
|
this.deviceType() === 'mobile' && |
|
|
@ -146,7 +147,7 @@ export class GfHomeOverviewComponent implements OnInit { |
|
|
this.precision = 0; |
|
|
this.precision = 0; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.isLoadingPerformance = false; |
|
|
this.isLoadingPerformance.set(false); |
|
|
|
|
|
|
|
|
this.changeDetectorRef.markForCheck(); |
|
|
this.changeDetectorRef.markForCheck(); |
|
|
}); |
|
|
}); |
|
|
|