Browse Source

Feature/add isClosedHoldings input to holdings table and update displayed columns logic

pull/5604/head
Germán Martín 1 month ago
parent
commit
2f7dd4e093
  1. 1
      apps/client/src/app/components/home-holdings/home-holdings.html
  2. 9
      libs/ui/src/lib/holdings-table/holdings-table.component.ts

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

@ -50,6 +50,7 @@
[deviceType]="deviceType"
[hasPermissionToShowQuantities]="false"
[holdings]="holdings"
[isClosedHoldings]="holdingType === 'CLOSED'"
[locale]="user?.settings?.locale"
(holdingClicked)="onHoldingClicked($event)"
/>

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

@ -55,6 +55,7 @@ export class GfHoldingsTableComponent implements OnChanges, OnDestroy {
@Input() hasPermissionToShowQuantities = true;
@Input() hasPermissionToShowValues = true;
@Input() holdings: PortfolioPosition[];
@Input() isClosedHoldings = false;
@Input() locale = getLocale();
@Input() pageSize = Number.MAX_SAFE_INTEGER;
@ -74,15 +75,17 @@ export class GfHoldingsTableComponent implements OnChanges, OnDestroy {
public ngOnChanges() {
this.displayedColumns = ['icon', 'nameWithSymbol', 'dateOfFirstActivity'];
if (this.hasPermissionToShowQuantities) {
if (this.hasPermissionToShowQuantities && !this.isClosedHoldings) {
this.displayedColumns.push('quantity');
}
if (this.hasPermissionToShowValues) {
if (this.hasPermissionToShowValues && !this.isClosedHoldings) {
this.displayedColumns.push('valueInBaseCurrency');
}
this.displayedColumns.push('allocationInPercentage');
if (!this.isClosedHoldings) {
this.displayedColumns.push('allocationInPercentage');
}
if (this.hasPermissionToShowValues) {
this.displayedColumns.push('performance');

Loading…
Cancel
Save