From 0e036e3498bb1c884eacaab1c2142c18834d04a6 Mon Sep 17 00:00:00 2001
From: Winn Cook <111204176+WinnCook@users.noreply.github.com>
Date: Tue, 3 Mar 2026 10:43:57 -0700
Subject: [PATCH] Reuse value component in platform component of Admin Control
panel
---
.../admin-platform/admin-platform.component.html | 6 +++++-
.../admin-platform/admin-platform.component.ts | 14 ++++++++++++++
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/apps/client/src/app/components/admin-platform/admin-platform.component.html b/apps/client/src/app/components/admin-platform/admin-platform.component.html
index 367827878..cb2f8294d 100644
--- a/apps/client/src/app/components/admin-platform/admin-platform.component.html
+++ b/apps/client/src/app/components/admin-platform/admin-platform.component.html
@@ -52,7 +52,11 @@
Accounts
- {{ element.accountCount }}
+
|
diff --git a/apps/client/src/app/components/admin-platform/admin-platform.component.ts b/apps/client/src/app/components/admin-platform/admin-platform.component.ts
index 02a2eed64..e3a09bcb0 100644
--- a/apps/client/src/app/components/admin-platform/admin-platform.component.ts
+++ b/apps/client/src/app/components/admin-platform/admin-platform.component.ts
@@ -1,9 +1,11 @@
import { UserService } from '@ghostfolio/client/services/user/user.service';
import { CreatePlatformDto, UpdatePlatformDto } from '@ghostfolio/common/dtos';
import { ConfirmationDialogType } from '@ghostfolio/common/enums';
+import { User } from '@ghostfolio/common/interfaces';
import { GfEntityLogoComponent } from '@ghostfolio/ui/entity-logo';
import { NotificationService } from '@ghostfolio/ui/notifications';
import { AdminService, DataService } from '@ghostfolio/ui/services';
+import { GfValueComponent } from '@ghostfolio/ui/value';
import {
ChangeDetectionStrategy,
@@ -38,6 +40,7 @@ import { CreateOrUpdatePlatformDialogParams } from './create-or-update-platform-
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [
GfEntityLogoComponent,
+ GfValueComponent,
IonIcon,
MatButtonModule,
MatMenuModule,
@@ -56,6 +59,7 @@ export class GfAdminPlatformComponent implements OnDestroy, OnInit {
public deviceType: string;
public displayedColumns = ['name', 'url', 'accounts', 'actions'];
public platforms: Platform[];
+ public user: User;
private unsubscribeSubject = new Subject();
@@ -94,6 +98,16 @@ export class GfAdminPlatformComponent implements OnDestroy, OnInit {
public ngOnInit() {
this.deviceType = this.deviceService.getDeviceInfo().deviceType;
+ this.userService.stateChanged
+ .pipe(takeUntil(this.unsubscribeSubject))
+ .subscribe((state) => {
+ if (state?.user) {
+ this.user = state.user;
+
+ this.changeDetectorRef.markForCheck();
+ }
+ });
+
this.fetchPlatforms();
}