Browse Source

Task/exclude cash position in base currency from holdings in overview (#8022)

* Exclude cash position in base currency

* Update changelog
pull/8020/head
Thomas Kaul 5 days ago
committed by GitHub
parent
commit
c0aea2ac4a
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 19
      apps/client/src/app/components/home-overview/home-overview.component.ts

1
CHANGELOG.md

@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Improved the label of the cash positions in the holdings charts and table
- Excluded the cash position in the base currency from the holdings table on the overview tab of the home page (experimental)
- Extended the tools to get the activities, the portfolio and the watchlist in the server of the Model Context Protocol (MCP) to include the data source (experimental)
- Upgraded `@openrouter/ai-sdk-provider` from version `3.0.0` to `3.1.0`
- Upgraded `ai` from version `7.0.37` to `7.0.114`

19
apps/client/src/app/components/home-overview/home-overview.component.ts

@ -8,6 +8,7 @@ import {
DEFAULT_LOCALE,
NUMERICAL_PRECISION_THRESHOLD_6_FIGURES
} from '@ghostfolio/common/config';
import { isCashPosition } from '@ghostfolio/common/helper';
import {
AssetProfileIdentifier,
LineChartItem,
@ -153,6 +154,8 @@ export class GfHomeOverviewComponent implements OnInit {
}
private update() {
const userSettings = this.user()?.settings;
this.historicalDataItems.set(null);
this.isLoadingPerformance.set(true);
@ -162,17 +165,27 @@ export class GfHomeOverviewComponent implements OnInit {
this.dataService
.fetchPortfolioHoldings({
filters: [{ id: 'ACTIVE', type: 'HOLDING_TYPE' }],
range: this.user()?.settings?.dateRange
range: userSettings?.dateRange
})
.pipe(takeUntilDestroyed(this.destroyRef))
.subscribe(({ holdings }) => {
this.holdings.set(holdings);
const baseCurrency = userSettings?.baseCurrency ?? DEFAULT_CURRENCY;
this.holdings.set(
holdings.filter(({ assetProfile }) => {
return !(
isCashPosition(assetProfile) &&
assetProfile.currency === baseCurrency &&
assetProfile.symbol === baseCurrency
);
})
);
});
}
this.dataService
.fetchPortfolioPerformance({
range: this.user()?.settings?.dateRange ?? DEFAULT_DATE_RANGE
range: userSettings?.dateRange ?? DEFAULT_DATE_RANGE
})
.pipe(takeUntilDestroyed(this.destroyRef))
.subscribe(({ chart, errors, performance }) => {

Loading…
Cancel
Save