diff --git a/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.component.ts b/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.component.ts index 9b7b98ba2..c992a7659 100644 --- a/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.component.ts +++ b/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.component.ts @@ -7,7 +7,6 @@ import { UserService } from '@ghostfolio/client/services/user/user.service'; import { NUMERICAL_PRECISION_THRESHOLD } from '@ghostfolio/common/config'; import { DATE_FORMAT, downloadAsFile } from '@ghostfolio/common/helper'; import { - AdminMarketDataDetails, DataProviderInfo, EnhancedSymbolProfile, Filter, @@ -52,7 +51,6 @@ import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; -import { AssetProfileDialogParams } from '../admin-market-data/asset-profile-dialog/interfaces/interfaces'; import { HoldingDetailDialogParams } from './interfaces/interfaces'; @Component({ @@ -86,7 +84,6 @@ export class GfHoldingDetailDialogComponent implements OnDestroy, OnInit { public activityForm: FormGroup; public accounts: Account[]; public assetClass: string; - public assetProfile: AdminMarketDataDetails['assetProfile']; public assetSubClass: string; public averagePrice: number; public benchmarkDataItems: LineChartItem[]; @@ -132,7 +129,6 @@ export class GfHoldingDetailDialogComponent implements OnDestroy, OnInit { private unsubscribeSubject = new Subject(); public constructor( - @Inject(MAT_DIALOG_DATA) public assetProfileData: AssetProfileDialogParams, private changeDetectorRef: ChangeDetectorRef, private dataService: DataService, public dialogRef: MatDialogRef, @@ -399,7 +395,7 @@ export class GfHoldingDetailDialogComponent implements OnDestroy, OnInit { }; } ); - + this.fetchMarketData(); this.changeDetectorRef.markForCheck(); } ); @@ -421,7 +417,6 @@ export class GfHoldingDetailDialogComponent implements OnDestroy, OnInit { this.changeDetectorRef.markForCheck(); } }); - this.onFetchMarketData(); } public onCloneActivity(aActivity: Activity) { @@ -456,15 +451,14 @@ export class GfHoldingDetailDialogComponent implements OnDestroy, OnInit { }); } - public onFetchMarketData() { + public fetchMarketData() { this.dataService .fetchMarketDataBySymbol({ - dataSource: this.assetProfileData.dataSource, - symbol: this.assetProfileData.symbol + dataSource: this.data.dataSource, + symbol: this.data.symbol }) .pipe(takeUntil(this.unsubscribeSubject)) - .subscribe(({ assetProfile, marketData }) => { - this.assetProfile = assetProfile; + .subscribe(({ marketData }) => { this.marketDataItems = marketData; this.historicalDataItems = marketData.map(({ date, marketPrice }) => { return { @@ -478,7 +472,7 @@ export class GfHoldingDetailDialogComponent implements OnDestroy, OnInit { public onMarketDataChanged(withRefresh: boolean = false) { if (withRefresh) { - this.onFetchMarketData(); + this.fetchMarketData(); } } diff --git a/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html b/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html index fe9ac61a7..10914c4fa 100644 --- a/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html +++ b/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html @@ -370,12 +370,12 @@
Market Data
diff --git a/libs/ui/src/lib/historical-market-data-editor/historical-market-data-editor.component.html b/libs/ui/src/lib/historical-market-data-editor/historical-market-data-editor.component.html index b35e1d812..b72ba15f8 100644 --- a/libs/ui/src/lib/historical-market-data-editor/historical-market-data-editor.component.html +++ b/libs/ui/src/lib/historical-market-data-editor/historical-market-data-editor.component.html @@ -48,6 +48,7 @@ cdkTextareaAutosize formControlName="csvString" matInput + rows="2" type="text" (keyup.enter)="$event.stopPropagation()" >