From 86af7a026f521494493e5f6f1af2987e3932770c Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sat, 5 Sep 2026 20:45:44 +0200 Subject: [PATCH] Add simplified mode to holdings table component --- .../holdings-table.component.html | 10 +++++++--- .../holdings-table.component.stories.ts | 15 +++++++++++++++ .../holdings-table.component.ts | 19 +++++++++++++++++-- 3 files changed, 39 insertions(+), 5 deletions(-) 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 e66dac725..44a70774f 100644 --- a/libs/ui/src/lib/holdings-table/holdings-table.component.html +++ b/libs/ui/src/lib/holdings-table/holdings-table.component.html @@ -3,9 +3,9 @@ class="gf-table w-100" mat-table matSort - matSortActive="allocationInPercentage" - matSortDirection="desc" [dataSource]="dataSource" + [matSortActive]="sortActive()" + [matSortDirection]="sortDirection()" > @@ -181,7 +181,11 @@ - + (); + public readonly isSimplified = input(false); public readonly locale = input(getLocale()); public readonly pageSize = model(Number.MAX_SAFE_INTEGER); @@ -62,6 +63,10 @@ export class GfHoldingsTableComponent { protected readonly dataSource = new MatTableDataSource([]); protected readonly displayedColumns = computed(() => { + if (this.isSimplified()) { + return ['icon', 'nameWithSymbol', 'performanceInPercentage']; + } + const columns = ['icon', 'nameWithSymbol', 'dateOfFirstActivity']; if (this.hasPermissionToShowQuantities()) { @@ -82,7 +87,17 @@ export class GfHoldingsTableComponent { return columns; }); - protected readonly isLoading = computed(() => !this.holdings()); + protected readonly isLoading = computed(() => { + return !this.holdings(); + }); + + protected readonly sortActive = computed(() => { + return this.isSimplified() ? 'assetProfile.name' : 'allocationInPercentage'; + }); + + protected readonly sortDirection = computed(() => { + return this.isSimplified() ? 'asc' : 'desc'; + }); public constructor() { this.dataSource.sortingDataAccessor = getLowercase;