|
|
@ -34,6 +34,7 @@ import { GfHistoricalMarketDataEditorComponent } from '@ghostfolio/ui/historical |
|
|
import { translate } from '@ghostfolio/ui/i18n'; |
|
|
import { translate } from '@ghostfolio/ui/i18n'; |
|
|
import { GfLineChartComponent } from '@ghostfolio/ui/line-chart'; |
|
|
import { GfLineChartComponent } from '@ghostfolio/ui/line-chart'; |
|
|
import { GfPortfolioProportionChartComponent } from '@ghostfolio/ui/portfolio-proportion-chart'; |
|
|
import { GfPortfolioProportionChartComponent } from '@ghostfolio/ui/portfolio-proportion-chart'; |
|
|
|
|
|
import { GfPremiumIndicatorComponent } from '@ghostfolio/ui/premium-indicator'; |
|
|
import { DataService } from '@ghostfolio/ui/services'; |
|
|
import { DataService } from '@ghostfolio/ui/services'; |
|
|
import { GfTagsSelectorComponent } from '@ghostfolio/ui/tags-selector'; |
|
|
import { GfTagsSelectorComponent } from '@ghostfolio/ui/tags-selector'; |
|
|
import { GfValueComponent } from '@ghostfolio/ui/value'; |
|
|
import { GfValueComponent } from '@ghostfolio/ui/value'; |
|
|
@ -102,6 +103,7 @@ import { |
|
|
GfHistoricalMarketDataEditorComponent, |
|
|
GfHistoricalMarketDataEditorComponent, |
|
|
GfLineChartComponent, |
|
|
GfLineChartComponent, |
|
|
GfPortfolioProportionChartComponent, |
|
|
GfPortfolioProportionChartComponent, |
|
|
|
|
|
GfPremiumIndicatorComponent, |
|
|
GfTagsSelectorComponent, |
|
|
GfTagsSelectorComponent, |
|
|
GfValueComponent, |
|
|
GfValueComponent, |
|
|
IonIcon, |
|
|
IonIcon, |
|
|
@ -161,6 +163,7 @@ export class GfHoldingDetailDialogComponent implements OnInit { |
|
|
protected investmentInBaseCurrencyWithCurrencyEffect: number; |
|
|
protected investmentInBaseCurrencyWithCurrencyEffect: number; |
|
|
protected investmentInBaseCurrencyWithCurrencyEffectPrecision = 2; |
|
|
protected investmentInBaseCurrencyWithCurrencyEffectPrecision = 2; |
|
|
protected isLoading = true; |
|
|
protected isLoading = true; |
|
|
|
|
|
protected isOwnAssetProfile: boolean; |
|
|
protected readonly isUUID = isUUID; |
|
|
protected readonly isUUID = isUUID; |
|
|
protected marketDataItems: MarketData[] = []; |
|
|
protected marketDataItems: MarketData[] = []; |
|
|
protected marketPrice: number; |
|
|
protected marketPrice: number; |
|
|
@ -367,13 +370,10 @@ export class GfHoldingDetailDialogComponent implements OnInit { |
|
|
|
|
|
|
|
|
this.feeInBaseCurrency = feeInBaseCurrency; |
|
|
this.feeInBaseCurrency = feeInBaseCurrency; |
|
|
|
|
|
|
|
|
this.hasPermissionToReadMarketDataOfOwnAssetProfile = |
|
|
this.hasPermissionToReadMarketDataOfOwnAssetProfile = hasPermission( |
|
|
hasPermission( |
|
|
this.user?.permissions, |
|
|
this.user?.permissions, |
|
|
permissions.readMarketDataOfOwnAssetProfile |
|
|
permissions.readMarketDataOfOwnAssetProfile |
|
|
); |
|
|
) && |
|
|
|
|
|
assetProfile?.dataSource === 'MANUAL' && |
|
|
|
|
|
assetProfile?.userId === this.user?.id; |
|
|
|
|
|
|
|
|
|
|
|
this.historicalDataItems = historicalData.map( |
|
|
this.historicalDataItems = historicalData.map( |
|
|
({ averagePrice, date, marketPrice }) => { |
|
|
({ averagePrice, date, marketPrice }) => { |
|
|
@ -400,6 +400,10 @@ export class GfHoldingDetailDialogComponent implements OnInit { |
|
|
this.investmentInBaseCurrencyWithCurrencyEffectPrecision = 0; |
|
|
this.investmentInBaseCurrencyWithCurrencyEffectPrecision = 0; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.isOwnAssetProfile = |
|
|
|
|
|
assetProfile?.dataSource === 'MANUAL' && |
|
|
|
|
|
assetProfile?.userId === this.user?.id; |
|
|
|
|
|
|
|
|
this.marketPrice = marketPrice; |
|
|
this.marketPrice = marketPrice; |
|
|
this.marketPriceMax = marketPriceMax; |
|
|
this.marketPriceMax = marketPriceMax; |
|
|
|
|
|
|
|
|
@ -574,7 +578,10 @@ export class GfHoldingDetailDialogComponent implements OnInit { |
|
|
} |
|
|
} |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
if (this.hasPermissionToReadMarketDataOfOwnAssetProfile) { |
|
|
if ( |
|
|
|
|
|
this.hasPermissionToReadMarketDataOfOwnAssetProfile && |
|
|
|
|
|
this.isOwnAssetProfile |
|
|
|
|
|
) { |
|
|
this.fetchMarketData(); |
|
|
this.fetchMarketData(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|