Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

Feature/add quantity to holdings table of account detail dialog (#5379)

Thomas Kaul614dd0783654
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6d7d54ed95..2fc198aaa9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Included accounts in the search results of the assistant
- Included the data source in the asset profile search results of the assistant
+- Added the quantity column to the holdings table of the account detail dialog
### Changed
diff --git a/apps/client/src/app/components/home-holdings/home-holdings.html b/apps/client/src/app/components/home-holdings/home-holdings.html
index 87d0a514d9..8b4e4c5d34 100644
--- a/apps/client/src/app/components/home-holdings/home-holdings.html
+++ b/apps/client/src/app/components/home-holdings/home-holdings.html
@@ -48,6 +48,7 @@
<gf-holdings-table
[baseCurrency]="user?.settings?.baseCurrency"
[deviceType]="deviceType"
+ [hasPermissionToShowQuantities]="false"
[holdings]="holdings"
[locale]="user?.settings?.locale"
(holdingClicked)="onHoldingClicked($event)"
diff --git a/apps/client/src/app/pages/public/public-page.html b/apps/client/src/app/pages/public/public-page.html
index b5a225c73a..a82c9d0798 100644
--- a/apps/client/src/app/pages/public/public-page.html
+++ b/apps/client/src/app/pages/public/public-page.html
@@ -201,6 +201,7 @@
[data]="holdings"
[deviceType]="deviceType"
[hasPermissionToOpenDetails]="false"
+ [hasPermissionToShowQuantities]="false"
[hasPermissionToShowValues]="false"
[pageSize]="7"
/>
diff --git a/libs/ui/src/lib/holdings-table/holdings-table.component.html b/libs/ui/src/lib/holdings-table/holdings-table.component.html
index 2c238b1372..d3afe9de9e 100644
--- a/libs/ui/src/lib/holdings-table/holdings-table.component.html
+++ b/libs/ui/src/lib/holdings-table/holdings-table.component.html
@@ -64,6 +64,30 @@
</td>
</ng-container>
+ <ng-container matColumnDef="quantity">
+ <th
+ *matHeaderCellDef
+ class="d-none d-lg-table-cell justify-content-end px-1"
+ mat-header-cell
+ mat-sort-header
+ >
+ <ng-container i18n>Quantity</ng-container>
+ </th>
+ <td
+ *matCellDef="let element"
+ class="d-none d-lg-table-cell px-1"
+ mat-cell
+ >
+ <div class="d-flex justify-content-end">
+ <gf-value
+ [isCurrency]="true"
+ [locale]="locale"
+ [value]="isLoading ? undefined : element.quantity"
+ />
+ </div>
+ </td>
+ </ng-container>
+
<ng-container matColumnDef="valueInBaseCurrency">
<th
*matHeaderCellDef
diff --git a/libs/ui/src/lib/holdings-table/holdings-table.component.ts b/libs/ui/src/lib/holdings-table/holdings-table.component.ts
index a4b86e2d7c..89bb4a5413 100644
--- a/libs/ui/src/lib/holdings-table/holdings-table.component.ts
+++ b/libs/ui/src/lib/holdings-table/holdings-table.component.ts
@@ -52,6 +52,7 @@ export class GfHoldingsTableComponent implements OnChanges, OnDestroy {
@Input() baseCurrency: string;
@Input() deviceType: string;
@Input() hasPermissionToOpenDetails = true;
+ @Input() hasPermissionToShowQuantities = true;
@Input() hasPermissionToShowValues = true;
@Input() holdings: PortfolioPosition[];
@Input() locale = getLocale();
@@ -73,6 +74,10 @@ export class GfHoldingsTableComponent implements OnChanges, OnDestroy {
public ngOnChanges() {
this.displayedColumns = ['icon', 'nameWithSymbol', 'dateOfFirstActivity'];
+ if (this.hasPermissionToShowQuantities) {
+ this.displayedColumns.push('quantity');
+ }
+
if (this.hasPermissionToShowValues) {
this.displayedColumns.push('valueInBaseCurrency');
}