|
|
|
@ -12,18 +12,17 @@ import { |
|
|
|
ChangeDetectionStrategy, |
|
|
|
ChangeDetectorRef, |
|
|
|
Component, |
|
|
|
DestroyRef, |
|
|
|
Inject, |
|
|
|
OnDestroy, |
|
|
|
OnInit |
|
|
|
} from '@angular/core'; |
|
|
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; |
|
|
|
import { |
|
|
|
MAT_DIALOG_DATA, |
|
|
|
MatDialogModule, |
|
|
|
MatDialogRef |
|
|
|
} from '@angular/material/dialog'; |
|
|
|
import { format } from 'date-fns'; |
|
|
|
import { Subject } from 'rxjs'; |
|
|
|
import { takeUntil } from 'rxjs/operators'; |
|
|
|
|
|
|
|
import { GfLineChartComponent } from '../../line-chart/line-chart.component'; |
|
|
|
import { GfValueComponent } from '../../value/value.component'; |
|
|
|
@ -44,16 +43,15 @@ import { BenchmarkDetailDialogParams } from './interfaces/interfaces'; |
|
|
|
styleUrls: ['./benchmark-detail-dialog.component.scss'], |
|
|
|
templateUrl: 'benchmark-detail-dialog.html' |
|
|
|
}) |
|
|
|
export class GfBenchmarkDetailDialogComponent implements OnDestroy, OnInit { |
|
|
|
export class GfBenchmarkDetailDialogComponent implements OnInit { |
|
|
|
public assetProfile: AdminMarketDataDetails['assetProfile']; |
|
|
|
public historicalDataItems: LineChartItem[]; |
|
|
|
public value: number; |
|
|
|
|
|
|
|
private unsubscribeSubject = new Subject<void>(); |
|
|
|
|
|
|
|
public constructor( |
|
|
|
private changeDetectorRef: ChangeDetectorRef, |
|
|
|
private dataService: DataService, |
|
|
|
private destroyRef: DestroyRef, |
|
|
|
public dialogRef: MatDialogRef<GfBenchmarkDetailDialogComponent>, |
|
|
|
@Inject(MAT_DIALOG_DATA) public data: BenchmarkDetailDialogParams |
|
|
|
) {} |
|
|
|
@ -64,7 +62,7 @@ export class GfBenchmarkDetailDialogComponent implements OnDestroy, OnInit { |
|
|
|
dataSource: this.data.dataSource, |
|
|
|
symbol: this.data.symbol |
|
|
|
}) |
|
|
|
.pipe(takeUntil(this.unsubscribeSubject)) |
|
|
|
.pipe(takeUntilDestroyed(this.destroyRef)) |
|
|
|
.subscribe(({ assetProfile, marketData }) => { |
|
|
|
this.assetProfile = assetProfile; |
|
|
|
|
|
|
|
@ -88,9 +86,4 @@ export class GfBenchmarkDetailDialogComponent implements OnDestroy, OnInit { |
|
|
|
public onClose() { |
|
|
|
this.dialogRef.close(); |
|
|
|
} |
|
|
|
|
|
|
|
public ngOnDestroy() { |
|
|
|
this.unsubscribeSubject.next(); |
|
|
|
this.unsubscribeSubject.complete(); |
|
|
|
} |
|
|
|
} |
|
|
|
|