From 54bd2b573cc09729cebe6f389c1b8ff6d423d2c1 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Mon, 3 Aug 2026 19:20:13 +0200 Subject: [PATCH] Improve usability by eliminating page reloads --- .../admin-market-data.component.ts | 22 ++-- .../admin-overview.component.ts | 6 +- .../admin-overview/admin-overview.html | 116 ++++++++++-------- .../user-account-membership.component.ts | 6 +- 4 files changed, 88 insertions(+), 62 deletions(-) diff --git a/apps/client/src/app/components/admin-market-data/admin-market-data.component.ts b/apps/client/src/app/components/admin-market-data/admin-market-data.component.ts index a42ee933b4..8592070eec 100644 --- a/apps/client/src/app/components/admin-market-data/admin-market-data.component.ts +++ b/apps/client/src/app/components/admin-market-data/admin-market-data.component.ts @@ -243,7 +243,7 @@ export class GfAdminMarketDataComponent implements AfterViewInit, OnInit { .subscribe((filters) => { this.activeFilters = filters; - this.loadData(); + this.reloadData({ pageIndex: 0 }); }); addIcons({ @@ -293,7 +293,7 @@ export class GfAdminMarketDataComponent implements AfterViewInit, OnInit { .deleteAssetProfile({ dataSource, symbol }) .pipe(takeUntilDestroyed(this.destroyRef)) .subscribe(() => { - this.loadData(); + this.reloadData(); }); } @@ -306,7 +306,7 @@ export class GfAdminMarketDataComponent implements AfterViewInit, OnInit { ) .pipe(takeUntilDestroyed(this.destroyRef)) .subscribe(() => { - this.loadData(); + this.reloadData(); }); } @@ -453,11 +453,7 @@ export class GfAdminMarketDataComponent implements AfterViewInit, OnInit { if (newAssetProfileIdentifier) { this.onOpenAssetProfileDialog(newAssetProfileIdentifier); } else { - this.loadData({ - pageIndex: this.paginator().pageIndex, - sortColumn: this.sort().active, - sortDirection: this.sort().direction - }); + this.reloadData(); this.router.navigate(['.'], { relativeTo: this.route }); } @@ -511,4 +507,14 @@ export class GfAdminMarketDataComponent implements AfterViewInit, OnInit { }); }); } + + private reloadData({ + pageIndex = this.paginator().pageIndex + }: { pageIndex?: number } = {}) { + this.loadData({ + pageIndex, + sortColumn: this.sort().active, + sortDirection: this.sort().direction + }); + } } diff --git a/apps/client/src/app/components/admin-overview/admin-overview.component.ts b/apps/client/src/app/components/admin-overview/admin-overview.component.ts index ac4cf05fe7..733200c912 100644 --- a/apps/client/src/app/components/admin-overview/admin-overview.component.ts +++ b/apps/client/src/app/components/admin-overview/admin-overview.component.ts @@ -64,7 +64,7 @@ import { } from 'ionicons/icons'; import ms, { StringValue } from 'ms'; import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; -import { switchMap } from 'rxjs'; +import { catchError, of, switchMap } from 'rxjs'; @Component({ changeDetection: ChangeDetectionStrategy.OnPush, @@ -390,6 +390,10 @@ export class GfAdminOverviewComponent implements OnInit { switchMap(() => { return this.userService.get(true); }), + catchError(() => { + // Refresh anyway to reflect the actual state of the settings + return of(undefined); + }), takeUntilDestroyed(this.destroyRef) ) .subscribe(() => { diff --git a/apps/client/src/app/components/admin-overview/admin-overview.html b/apps/client/src/app/components/admin-overview/admin-overview.html index 75092b943b..0dd55827ca 100644 --- a/apps/client/src/app/components/admin-overview/admin-overview.html +++ b/apps/client/src/app/components/admin-overview/admin-overview.html @@ -46,70 +46,86 @@
-
-
User Signup
-
- -
-
- @if (hasPermissionToToggleReadOnlyMode) { + @if (isLoading) { + + } @else {
-
Read-only Mode
+
User Signup
- } -
-
Data Gathering
-
- -
-
- @if (hasPermissionForSystemMessage) { + @if (hasPermissionToToggleReadOnlyMode) { +
+
Read-only Mode
+
+ +
+
+ }
-
System Message
+
Data Gathering
- @if (systemMessage) { -
-
{{ systemMessage | json }}
+ +
+
+ @if (hasPermissionForSystemMessage) { +
+
System Message
+
+ @if (systemMessage) { +
+
+ {{ systemMessage | json }} +
+ +
+ } + @if (!systemMessage) { -
- } - @if (!systemMessage) { - - } + } +
-
+ } }
Housekeeping
diff --git a/apps/client/src/app/components/user-account-membership/user-account-membership.component.ts b/apps/client/src/app/components/user-account-membership/user-account-membership.component.ts index 35aaa9e8ac..defe751ee8 100644 --- a/apps/client/src/app/components/user-account-membership/user-account-membership.component.ts +++ b/apps/client/src/app/components/user-account-membership/user-account-membership.component.ts @@ -173,6 +173,9 @@ export class GfUserAccountMembershipComponent { this.dataService .redeemCoupon(couponCode) .pipe( + switchMap(() => { + return this.userService.get(true); + }), catchError(() => { this.snackBar.open( '😞 ' + $localize`Could not redeem coupon code`, @@ -184,9 +187,6 @@ export class GfUserAccountMembershipComponent { return EMPTY; }), - switchMap(() => { - return this.userService.get(true); - }), takeUntilDestroyed(this.destroyRef) ) .subscribe(() => {