From 87ac23651cae4c9c5a8cf11310033d30bcde00df Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sat, 27 Jun 2026 12:54:13 +0200 Subject: [PATCH] Refactoring --- ...reate-or-update-access-dialog.component.ts | 26 +++++++++---------- .../create-or-update-access-dialog.html | 22 +++++++--------- .../src/lib/assistant/assistant.component.ts | 20 +++++++++++--- 3 files changed, 39 insertions(+), 29 deletions(-) diff --git a/apps/client/src/app/components/user-account-access/create-or-update-access-dialog/create-or-update-access-dialog.component.ts b/apps/client/src/app/components/user-account-access/create-or-update-access-dialog/create-or-update-access-dialog.component.ts index 1b56ae798..ef6d0ab39 100644 --- a/apps/client/src/app/components/user-account-access/create-or-update-access-dialog/create-or-update-access-dialog.component.ts +++ b/apps/client/src/app/components/user-account-access/create-or-update-access-dialog/create-or-update-access-dialog.component.ts @@ -178,19 +178,6 @@ export class GfCreateOrUpdateAccessDialogComponent implements OnInit { ); } - private loadHoldings() { - this.dataService - .fetchPortfolioHoldings() - .pipe(takeUntilDestroyed(this.destroyRef)) - .subscribe(({ holdings }) => { - this.holdings = getHoldingsForFilter(holdings); - - this.updateFiltersFormControl(this.data.access?.settings?.filters); - - this.changeDetectorRef.markForCheck(); - }); - } - private async createAccess() { const filters = this.buildFilters(); @@ -230,6 +217,19 @@ export class GfCreateOrUpdateAccessDialogComponent implements OnInit { } } + private loadHoldings() { + this.dataService + .fetchPortfolioHoldings() + .pipe(takeUntilDestroyed(this.destroyRef)) + .subscribe(({ holdings }) => { + this.holdings = getHoldingsForFilter(holdings); + + this.updateFiltersFormControl(this.data.access?.settings?.filters); + + this.changeDetectorRef.markForCheck(); + }); + } + private async updateAccess() { const accessId = this.data.access?.id; diff --git a/apps/client/src/app/components/user-account-access/create-or-update-access-dialog/create-or-update-access-dialog.html b/apps/client/src/app/components/user-account-access/create-or-update-access-dialog/create-or-update-access-dialog.html index 925f7f855..1736aa9fc 100644 --- a/apps/client/src/app/components/user-account-access/create-or-update-access-dialog/create-or-update-access-dialog.html +++ b/apps/client/src/app/components/user-account-access/create-or-update-access-dialog/create-or-update-access-dialog.html @@ -60,18 +60,16 @@ } @if (canApplyFilters) { -

Filters

-
- -
+

Portfolio Filters

+ }
diff --git a/libs/ui/src/lib/assistant/assistant.component.ts b/libs/ui/src/lib/assistant/assistant.component.ts index 205e65c40..d69e5a13a 100644 --- a/libs/ui/src/lib/assistant/assistant.component.ts +++ b/libs/ui/src/lib/assistant/assistant.component.ts @@ -722,14 +722,26 @@ export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit { const settings = this.user?.settings; const filters = [ - { id: settings?.['filters.accounts']?.[0] ?? '', type: 'ACCOUNT' }, + { + id: settings?.['filters.accounts']?.[0] ?? '', + type: 'ACCOUNT' + }, { id: settings?.['filters.assetClasses']?.[0] ?? '', type: 'ASSET_CLASS' }, - { id: settings?.['filters.dataSource'] ?? '', type: 'DATA_SOURCE' }, - { id: settings?.['filters.symbol'] ?? '', type: 'SYMBOL' }, - { id: settings?.['filters.tags']?.[0] ?? '', type: 'TAG' } + { + id: settings?.['filters.dataSource'] ?? '', + type: 'DATA_SOURCE' + }, + { + id: settings?.['filters.symbol'] ?? '', + type: 'SYMBOL' + }, + { + id: settings?.['filters.tags']?.[0] ?? '', + type: 'TAG' + } ].filter(({ id }) => { return !!id; }) as Filter[];