From 92382e0b4d1768dede8fbbf90a932f6e7c1f8252 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Tue, 11 Jul 2023 21:41:12 +0200 Subject: [PATCH] Feature/improve loading state during filtering on allocations page (#2141) * Improve loading state * Update changelog --- CHANGELOG.md | 1 + .../allocations/allocations-page.component.ts | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 708ef7db0..273fd9c05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Improved the loading state during filtering on the allocations page - Beautified the names with ampersand (`&`) in the asset profile ## 1.287.0 - 2023-07-09 diff --git a/apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts b/apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts index 8d89f41a0..43f33b70e 100644 --- a/apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts +++ b/apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts @@ -139,6 +139,8 @@ export class AllocationsPageComponent implements OnDestroy, OnInit { ? $localize`Filter by account or tag...` : ''; + this.initialize(); + return this.dataService.fetchPortfolioDetails({ filters: this.activeFilters }); @@ -146,6 +148,8 @@ export class AllocationsPageComponent implements OnDestroy, OnInit { takeUntil(this.unsubscribeSubject) ) .subscribe((portfolioDetails) => { + this.initialize(); + this.portfolioDetails = portfolioDetails; this.initializeAnalysisData(); @@ -237,6 +241,13 @@ export class AllocationsPageComponent implements OnDestroy, OnInit { } }; this.platforms = {}; + this.portfolioDetails = { + accounts: {}, + filteredValueInPercentage: 0, + holdings: {}, + platforms: {}, + summary: undefined + }; this.positions = {}; this.sectors = { [UNKNOWN_KEY]: { @@ -254,8 +265,6 @@ export class AllocationsPageComponent implements OnDestroy, OnInit { } public initializeAnalysisData() { - this.initialize(); - for (const [ id, { name, valueInBaseCurrency, valueInPercentage }