Browse Source

Add quantity column

pull/5379/head
Thomas Kaul 4 days ago
parent
commit
2a898033f1
  1. 1
      apps/client/src/app/components/home-holdings/home-holdings.html
  2. 1
      apps/client/src/app/pages/public/public-page.html
  3. 24
      libs/ui/src/lib/holdings-table/holdings-table.component.html
  4. 5
      libs/ui/src/lib/holdings-table/holdings-table.component.ts

1
apps/client/src/app/components/home-holdings/home-holdings.html

@ -48,6 +48,7 @@
<gf-holdings-table <gf-holdings-table
[baseCurrency]="user?.settings?.baseCurrency" [baseCurrency]="user?.settings?.baseCurrency"
[deviceType]="deviceType" [deviceType]="deviceType"
[hasPermissionToShowQuantities]="false"
[holdings]="holdings" [holdings]="holdings"
[locale]="user?.settings?.locale" [locale]="user?.settings?.locale"
(holdingClicked)="onHoldingClicked($event)" (holdingClicked)="onHoldingClicked($event)"

1
apps/client/src/app/pages/public/public-page.html

@ -201,6 +201,7 @@
[data]="holdings" [data]="holdings"
[deviceType]="deviceType" [deviceType]="deviceType"
[hasPermissionToOpenDetails]="false" [hasPermissionToOpenDetails]="false"
[hasPermissionToShowQuantities]="false"
[hasPermissionToShowValues]="false" [hasPermissionToShowValues]="false"
[pageSize]="7" [pageSize]="7"
/> />

24
libs/ui/src/lib/holdings-table/holdings-table.component.html

@ -64,6 +64,30 @@
</td> </td>
</ng-container> </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"> <ng-container matColumnDef="valueInBaseCurrency">
<th <th
*matHeaderCellDef *matHeaderCellDef

5
libs/ui/src/lib/holdings-table/holdings-table.component.ts

@ -52,6 +52,7 @@ export class GfHoldingsTableComponent implements OnChanges, OnDestroy {
@Input() baseCurrency: string; @Input() baseCurrency: string;
@Input() deviceType: string; @Input() deviceType: string;
@Input() hasPermissionToOpenDetails = true; @Input() hasPermissionToOpenDetails = true;
@Input() hasPermissionToShowQuantities = true;
@Input() hasPermissionToShowValues = true; @Input() hasPermissionToShowValues = true;
@Input() holdings: PortfolioPosition[]; @Input() holdings: PortfolioPosition[];
@Input() locale = getLocale(); @Input() locale = getLocale();
@ -73,6 +74,10 @@ export class GfHoldingsTableComponent implements OnChanges, OnDestroy {
public ngOnChanges() { public ngOnChanges() {
this.displayedColumns = ['icon', 'nameWithSymbol', 'dateOfFirstActivity']; this.displayedColumns = ['icon', 'nameWithSymbol', 'dateOfFirstActivity'];
if (this.hasPermissionToShowQuantities) {
this.displayedColumns.push('quantity');
}
if (this.hasPermissionToShowValues) { if (this.hasPermissionToShowValues) {
this.displayedColumns.push('valueInBaseCurrency'); this.displayedColumns.push('valueInBaseCurrency');
} }

Loading…
Cancel
Save