Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

Task/reuse value component in platform component of Admin Control panel (#6470)

Winn Cook3c886f134d73
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0aa2e94594..0ce9598e39 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
+- Reused the value component in the platform management of the admin control panel
- Reused the value component in the tag management of the admin control panel
- Upgraded `jsonpath` from version `1.1.1` to `1.2.1`
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 3678278786..7370a19ae7 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 @@
<ng-container i18n>Accounts</ng-container>
</th>
<td *matCellDef="let element" class="px-1 text-right" mat-cell>
- {{ element.accountCount }}
+ <gf-value
+ class="d-inline-block justify-content-end"
+ [locale]="locale"
+ [value]="element.accountCount"
+ />
</td>
</ng-container>
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 02a2eed646..2a04f86cc3 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,14 +1,17 @@
import { UserService } from '@ghostfolio/client/services/user/user.service';
import { CreatePlatformDto, UpdatePlatformDto } from '@ghostfolio/common/dtos';
import { ConfirmationDialogType } from '@ghostfolio/common/enums';
+import { getLocale } from '@ghostfolio/common/helper';
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,
ChangeDetectorRef,
Component,
+ Input,
OnDestroy,
OnInit,
ViewChild
@@ -38,6 +41,7 @@ import { CreateOrUpdatePlatformDialogParams } from './create-or-update-platform-
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [
GfEntityLogoComponent,
+ GfValueComponent,
IonIcon,
MatButtonModule,
MatMenuModule,
@@ -50,6 +54,8 @@ import { CreateOrUpdatePlatformDialogParams } from './create-or-update-platform-
templateUrl: './admin-platform.component.html'
})
export class GfAdminPlatformComponent implements OnDestroy, OnInit {
+ @Input() locale = getLocale();
+
@ViewChild(MatSort) sort: MatSort;
public dataSource = new MatTableDataSource<Platform>();
diff --git a/apps/client/src/app/components/admin-settings/admin-settings.component.html b/apps/client/src/app/components/admin-settings/admin-settings.component.html
index 571e45afaa..41a9992c92 100644
--- a/apps/client/src/app/components/admin-settings/admin-settings.component.html
+++ b/apps/client/src/app/components/admin-settings/admin-settings.component.html
@@ -193,7 +193,7 @@
<div class="mb-5 row">
<div class="col">
<h2 class="text-center" i18n>Platforms</h2>
- <gf-admin-platform />
+ <gf-admin-platform [locale]="user?.settings?.locale" />
</div>
</div>
<div class="row">