Browse Source

Merge remote-tracking branch 'origin/main' into task/migrate-portfolio-performance-component-to-standalone

pull/5363/head
KenTandrian 1 week ago
parent
commit
31cc347fb7
  1. 5
      CHANGELOG.md
  2. 25
      apps/client/src/app/components/account-detail-dialog/account-detail-dialog.component.ts
  3. 26
      apps/client/src/app/components/account-detail-dialog/account-detail-dialog.html

5
CHANGELOG.md

@ -7,8 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased
### Added
- Added the interest and dividend values to the account detail dialog
### Changed
- Moved the chart of the account detail dialog from experimental to general availability
- Improved the dynamic numerical precision for various values in the account detail dialog
- Extended the accounts endpoint by dividend and interest
- Refactored the portfolio performance component to standalone

25
apps/client/src/app/components/account-detail-dialog/account-detail-dialog.component.ts

@ -55,11 +55,15 @@ export class AccountDetailDialog implements OnDestroy, OnInit {
public balancePrecision = 2;
public currency: string;
public dataSource: MatTableDataSource<Activity>;
public dividendInBaseCurrency: number;
public dividendInBaseCurrencyPrecision = 2;
public equity: number;
public equityPrecision = 2;
public hasPermissionToDeleteAccountBalance: boolean;
public historicalDataItems: HistoricalDataItem[];
public holdings: PortfolioPosition[];
public interestInBaseCurrency: number;
public interestInBaseCurrencyPrecision = 2;
public isLoadingActivities: boolean;
public isLoadingChart: boolean;
public name: string;
@ -184,6 +188,8 @@ export class AccountDetailDialog implements OnDestroy, OnInit {
({
balance,
currency,
dividendInBaseCurrency,
interestInBaseCurrency,
name,
platform,
transactionCount,
@ -200,6 +206,15 @@ export class AccountDetailDialog implements OnDestroy, OnInit {
}
this.currency = currency;
this.dividendInBaseCurrency = dividendInBaseCurrency;
if (
this.data.deviceType === 'mobile' &&
this.dividendInBaseCurrency >=
NUMERICAL_PRECISION_THRESHOLD_6_FIGURES
) {
this.dividendInBaseCurrencyPrecision = 0;
}
if (isNumber(balance) && isNumber(value)) {
this.equity = new Big(value).minus(balance).toNumber();
@ -214,6 +229,16 @@ export class AccountDetailDialog implements OnDestroy, OnInit {
this.equity = null;
}
this.interestInBaseCurrency = interestInBaseCurrency;
if (
this.data.deviceType === 'mobile' &&
this.interestInBaseCurrency >=
NUMERICAL_PRECISION_THRESHOLD_6_FIGURES
) {
this.interestInBaseCurrencyPrecision = 0;
}
this.name = name;
this.platformName = platform?.name ?? '-';
this.transactionCount = transactionCount;

26
apps/client/src/app/components/account-detail-dialog/account-detail-dialog.html

@ -20,7 +20,6 @@
</div>
</div>
@if (user?.settings?.isExperimentalFeatures) {
<div class="chart-container mb-3">
<gf-investment-chart
class="h-100"
@ -33,7 +32,6 @@
[locale]="user?.settings?.locale"
/>
</div>
}
<div class="mb-3 row">
<div class="col-6 mb-3">
@ -60,6 +58,30 @@
>Equity</gf-value
>
</div>
<div class="col-6 mb-3">
<gf-value
i18n
size="medium"
[isCurrency]="true"
[locale]="user?.settings?.locale"
[precision]="interestInBaseCurrencyPrecision"
[unit]="user?.settings?.baseCurrency"
[value]="interestInBaseCurrency"
>Interest</gf-value
>
</div>
<div class="col-6 mb-3">
<gf-value
i18n
size="medium"
[isCurrency]="true"
[locale]="user?.settings?.locale"
[precision]="dividendInBaseCurrencyPrecision"
[unit]="user?.settings?.baseCurrency"
[value]="dividendInBaseCurrency"
>Dividend</gf-value
>
</div>
<div class="col-6 mb-3">
<gf-value i18n size="medium" [value]="transactionCount"
>Activities</gf-value

Loading…
Cancel
Save