diff --git a/CHANGELOG.md b/CHANGELOG.md index 371a8e6f4..e242c5379 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Refactored `showTransactions` in favor of `showActivitiesCount` in the accounts table component +- Refactored `transactionCount` in favor of `activitiesCount` in the accounts table component - Deprecated `transactionCount` in favor of `activitiesCount` in the endpoint `GET api/v1/admin` - Removed the deprecated `firstBuyDate` in the portfolio calculator - Upgraded `yahoo-finance2` from version `3.11.2` to `3.13.0` 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 f9329dbfb..27df91a17 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 @@ -380,10 +380,10 @@ [deviceType]="data.deviceType" [hasPermissionToOpenDetails]="false" [locale]="user?.settings?.locale" + [showActivitiesCount]="false" [showAllocationInPercentage]="user?.settings?.isExperimentalFeatures" [showBalance]="false" [showFooter]="false" - [showTransactions]="false" [showValue]="false" [showValueInBaseCurrency]="false" /> diff --git a/apps/client/src/app/pages/accounts/accounts-page.component.ts b/apps/client/src/app/pages/accounts/accounts-page.component.ts index 6c8146f77..f7e6541b5 100644 --- a/apps/client/src/app/pages/accounts/accounts-page.component.ts +++ b/apps/client/src/app/pages/accounts/accounts-page.component.ts @@ -38,6 +38,7 @@ import { GfTransferBalanceDialogComponent } from './transfer-balance/transfer-ba }) export class GfAccountsPageComponent implements OnDestroy, OnInit { public accounts: AccountModel[]; + public activitiesCount = 0; public deviceType: string; public hasImpersonationId: boolean; public hasPermissionToCreateAccount: boolean; @@ -45,7 +46,6 @@ export class GfAccountsPageComponent implements OnDestroy, OnInit { public routeQueryParams: Subscription; public totalBalanceInBaseCurrency = 0; public totalValueInBaseCurrency = 0; - public transactionCount = 0; public user: User; private unsubscribeSubject = new Subject(); @@ -128,14 +128,14 @@ export class GfAccountsPageComponent implements OnDestroy, OnInit { .subscribe( ({ accounts, + activitiesCount, totalBalanceInBaseCurrency, - totalValueInBaseCurrency, - transactionCount + totalValueInBaseCurrency }) => { this.accounts = accounts; + this.activitiesCount = activitiesCount; this.totalBalanceInBaseCurrency = totalBalanceInBaseCurrency; this.totalValueInBaseCurrency = totalValueInBaseCurrency; - this.transactionCount = transactionCount; if (this.accounts?.length <= 0) { this.router.navigate([], { queryParams: { createDialog: true } }); @@ -358,8 +358,8 @@ export class GfAccountsPageComponent implements OnDestroy, OnInit { private reset() { this.accounts = undefined; + this.activitiesCount = 0; this.totalBalanceInBaseCurrency = 0; this.totalValueInBaseCurrency = 0; - this.transactionCount = 0; } } diff --git a/apps/client/src/app/pages/accounts/accounts-page.html b/apps/client/src/app/pages/accounts/accounts-page.html index 6f29a4f7c..0c6b7b8f3 100644 --- a/apps/client/src/app/pages/accounts/accounts-page.html +++ b/apps/client/src/app/pages/accounts/accounts-page.html @@ -4,6 +4,7 @@

Accounts

- + - {{ transactionCount }} + {{ activitiesCount }} diff --git a/libs/ui/src/lib/accounts-table/accounts-table.component.stories.ts b/libs/ui/src/lib/accounts-table/accounts-table.component.stories.ts index 53c59a95f..96da4419d 100644 --- a/libs/ui/src/lib/accounts-table/accounts-table.component.stories.ts +++ b/libs/ui/src/lib/accounts-table/accounts-table.component.stories.ts @@ -115,10 +115,10 @@ export const Loading: Story = { hasPermissionToOpenDetails: false, locale: 'en-US', showActions: false, + showActivitiesCount: true, showAllocationInPercentage: false, showBalance: true, showFooter: true, - showTransactions: true, showValue: true, showValueInBaseCurrency: true } @@ -127,39 +127,39 @@ export const Loading: Story = { export const Default: Story = { args: { accounts, + activitiesCount: 12, baseCurrency: 'USD', deviceType: 'desktop', hasPermissionToOpenDetails: false, locale: 'en-US', showActions: false, + showActivitiesCount: true, showAllocationInPercentage: false, showBalance: true, showFooter: true, - showTransactions: true, showValue: true, showValueInBaseCurrency: true, totalBalanceInBaseCurrency: 12428.2, - totalValueInBaseCurrency: 107971.70321466809, - transactionCount: 12 + totalValueInBaseCurrency: 107971.70321466809 } }; export const WithoutFooter: Story = { args: { accounts, + activitiesCount: 12, baseCurrency: 'USD', deviceType: 'desktop', hasPermissionToOpenDetails: false, locale: 'en-US', showActions: false, + showActivitiesCount: true, showAllocationInPercentage: false, showBalance: true, showFooter: false, - showTransactions: true, showValue: true, showValueInBaseCurrency: true, totalBalanceInBaseCurrency: 12428.2, - totalValueInBaseCurrency: 107971.70321466809, - transactionCount: 12 + totalValueInBaseCurrency: 107971.70321466809 } }; diff --git a/libs/ui/src/lib/accounts-table/accounts-table.component.ts b/libs/ui/src/lib/accounts-table/accounts-table.component.ts index fe91e1eda..21300fdcc 100644 --- a/libs/ui/src/lib/accounts-table/accounts-table.component.ts +++ b/libs/ui/src/lib/accounts-table/accounts-table.component.ts @@ -55,20 +55,20 @@ import { Subject, Subscription } from 'rxjs'; }) export class GfAccountsTableComponent implements OnChanges, OnDestroy { @Input() accounts: Account[]; + @Input() activitiesCount: number; @Input() baseCurrency: string; @Input() deviceType: string; @Input() hasPermissionToOpenDetails = true; @Input() locale = getLocale(); @Input() showActions: boolean; + @Input() showActivitiesCount = true; @Input() showAllocationInPercentage: boolean; @Input() showBalance = true; @Input() showFooter = true; - @Input() showTransactions = true; @Input() showValue = true; @Input() showValueInBaseCurrency = true; @Input() totalBalanceInBaseCurrency: number; @Input() totalValueInBaseCurrency: number; - @Input() transactionCount: number; @Output() accountDeleted = new EventEmitter(); @Output() accountToUpdate = new EventEmitter(); @@ -101,8 +101,8 @@ export class GfAccountsTableComponent implements OnChanges, OnDestroy { public ngOnChanges() { this.displayedColumns = ['status', 'account', 'platform']; - if (this.showTransactions) { - this.displayedColumns.push('transactions'); + if (this.showActivitiesCount) { + this.displayedColumns.push('activitiesCount'); } if (this.showBalance) {