|
|
@ -38,6 +38,8 @@ import { MatCardModule } from '@angular/material/card'; |
|
|
import { Router, RouterModule } from '@angular/router'; |
|
|
import { Router, RouterModule } from '@angular/router'; |
|
|
import { DeviceDetectorService } from 'ngx-device-detector'; |
|
|
import { DeviceDetectorService } from 'ngx-device-detector'; |
|
|
|
|
|
|
|
|
|
|
|
const MINIMUM_CHART_ITEMS = 3; |
|
|
|
|
|
|
|
|
@Component({ |
|
|
@Component({ |
|
|
changeDetection: ChangeDetectionStrategy.OnPush, |
|
|
changeDetection: ChangeDetectionStrategy.OnPush, |
|
|
imports: [ |
|
|
imports: [ |
|
|
@ -56,6 +58,12 @@ 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 readonly historicalDataItems = signal<LineChartItem[] | null>(null); |
|
|
protected readonly historicalDataItems = signal<LineChartItem[] | null>(null); |
|
|
|
|
|
|
|
|
|
|
|
// A line through only two points (e.g. the close of the previous day and
|
|
|
|
|
|
// now) is drawn as a misleading slope across the whole width
|
|
|
|
|
|
protected readonly hasEnoughChartData = computed(() => { |
|
|
|
|
|
return (this.historicalDataItems()?.length ?? 0) >= MINIMUM_CHART_ITEMS; |
|
|
|
|
|
}); |
|
|
protected readonly holdings = signal<PortfolioPosition[] | undefined>( |
|
|
protected readonly holdings = signal<PortfolioPosition[] | undefined>( |
|
|
undefined |
|
|
undefined |
|
|
); |
|
|
); |
|
|
|