From 37509bad3b0585d78403f90e132f42754b85e813 Mon Sep 17 00:00:00 2001 From: Attila Cseh Date: Mon, 7 Jul 2025 14:32:21 +0200 Subject: [PATCH] code review changes --- CHANGELOG.md | 2 +- .../app/pages/accounts/accounts-page.component.ts | 12 ++++++------ .../src/app/pages/accounts/accounts-page.routes.ts | 4 ++-- .../create-or-update-account-dialog.component.ts | 6 +++--- .../transfer-balance-dialog.component.ts | 6 +++--- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e181ecba4..23564e289 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,8 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Improved the language localization in the users table of the admin control panel -- Refactored the portfolio pages to standalone - Refactored the accounts pages to standalone +- Refactored the portfolio pages to standalone - Renamed `Settings` to `settings` in the `User` database schema - Improved the language localization for Catalan (`ca`) - Improved the language localization for Dutch (`nl`) diff --git a/apps/client/src/app/pages/accounts/accounts-page.component.ts b/apps/client/src/app/pages/accounts/accounts-page.component.ts index 57ab99154..7d139bd5d 100644 --- a/apps/client/src/app/pages/accounts/accounts-page.component.ts +++ b/apps/client/src/app/pages/accounts/accounts-page.component.ts @@ -23,8 +23,8 @@ import { DeviceDetectorService } from 'ngx-device-detector'; import { EMPTY, Subject, Subscription } from 'rxjs'; import { catchError, takeUntil } from 'rxjs/operators'; -import { CreateOrUpdateAccountDialog } from './create-or-update-account-dialog/create-or-update-account-dialog.component'; -import { TransferBalanceDialog } from './transfer-balance/transfer-balance-dialog.component'; +import { GfCreateOrUpdateAccountDialogComponent } from './create-or-update-account-dialog/create-or-update-account-dialog.component'; +import { GfTransferBalanceDialogComponent } from './transfer-balance/transfer-balance-dialog.component'; @Component({ host: { class: 'has-fab page' }, @@ -38,7 +38,7 @@ import { TransferBalanceDialog } from './transfer-balance/transfer-balance-dialo styleUrls: ['./accounts-page.scss'], templateUrl: './accounts-page.html' }) -export class AccountsPageComponent implements OnDestroy, OnInit { +export class GfAccountsPageComponent implements OnDestroy, OnInit { public accounts: AccountModel[]; public deviceType: string; public hasImpersonationId: boolean; @@ -185,7 +185,7 @@ export class AccountsPageComponent implements OnDestroy, OnInit { name, platformId }: AccountModel) { - const dialogRef = this.dialog.open(CreateOrUpdateAccountDialog, { + const dialogRef = this.dialog.open(GfCreateOrUpdateAccountDialogComponent, { data: { account: { balance, @@ -259,7 +259,7 @@ export class AccountsPageComponent implements OnDestroy, OnInit { } private openCreateAccountDialog() { - const dialogRef = this.dialog.open(CreateOrUpdateAccountDialog, { + const dialogRef = this.dialog.open(GfCreateOrUpdateAccountDialogComponent, { data: { account: { balance: 0, @@ -301,7 +301,7 @@ export class AccountsPageComponent implements OnDestroy, OnInit { } private openTransferBalanceDialog() { - const dialogRef = this.dialog.open(TransferBalanceDialog, { + const dialogRef = this.dialog.open(GfTransferBalanceDialogComponent, { data: { accounts: this.accounts }, diff --git a/apps/client/src/app/pages/accounts/accounts-page.routes.ts b/apps/client/src/app/pages/accounts/accounts-page.routes.ts index ac5dc478f..e4edc39c1 100644 --- a/apps/client/src/app/pages/accounts/accounts-page.routes.ts +++ b/apps/client/src/app/pages/accounts/accounts-page.routes.ts @@ -3,12 +3,12 @@ import { internalRoutes } from '@ghostfolio/common/routes/routes'; import { Routes } from '@angular/router'; -import { AccountsPageComponent } from './accounts-page.component'; +import { GfAccountsPageComponent } from './accounts-page.component'; export const routes: Routes = [ { canActivate: [AuthGuard], - component: AccountsPageComponent, + component: GfAccountsPageComponent, path: '', title: internalRoutes.accounts.title } diff --git a/apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.component.ts b/apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.component.ts index 3bc855763..beb815e0c 100644 --- a/apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.component.ts +++ b/apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.component.ts @@ -37,6 +37,7 @@ import { map, startWith } from 'rxjs/operators'; import { CreateOrUpdateAccountDialogParams } from './interfaces/interfaces'; @Component({ + changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'h-100' }, imports: [ CommonModule, @@ -52,11 +53,10 @@ import { CreateOrUpdateAccountDialogParams } from './interfaces/interfaces'; ReactiveFormsModule ], selector: 'gf-create-or-update-account-dialog', - changeDetection: ChangeDetectionStrategy.OnPush, styleUrls: ['./create-or-update-account-dialog.scss'], templateUrl: 'create-or-update-account-dialog.html' }) -export class CreateOrUpdateAccountDialog implements OnDestroy { +export class GfCreateOrUpdateAccountDialogComponent implements OnDestroy { public accountForm: FormGroup; public currencies: string[] = []; public filteredPlatforms: Observable; @@ -67,7 +67,7 @@ export class CreateOrUpdateAccountDialog implements OnDestroy { public constructor( @Inject(MAT_DIALOG_DATA) public data: CreateOrUpdateAccountDialogParams, private dataService: DataService, - public dialogRef: MatDialogRef, + public dialogRef: MatDialogRef, private formBuilder: FormBuilder ) {} diff --git a/apps/client/src/app/pages/accounts/transfer-balance/transfer-balance-dialog.component.ts b/apps/client/src/app/pages/accounts/transfer-balance/transfer-balance-dialog.component.ts index a562f15ba..368c7f2f0 100644 --- a/apps/client/src/app/pages/accounts/transfer-balance/transfer-balance-dialog.component.ts +++ b/apps/client/src/app/pages/accounts/transfer-balance/transfer-balance-dialog.component.ts @@ -30,6 +30,7 @@ import { Subject } from 'rxjs'; import { TransferBalanceDialogParams } from './interfaces/interfaces'; @Component({ + changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'h-100' }, imports: [ GfEntityLogoComponent, @@ -41,11 +42,10 @@ import { TransferBalanceDialogParams } from './interfaces/interfaces'; ReactiveFormsModule ], selector: 'gf-transfer-balance-dialog', - changeDetection: ChangeDetectionStrategy.OnPush, styleUrls: ['./transfer-balance-dialog.scss'], templateUrl: 'transfer-balance-dialog.html' }) -export class TransferBalanceDialog implements OnDestroy { +export class GfTransferBalanceDialogComponent implements OnDestroy { public accounts: Account[] = []; public currency: string; public transferBalanceForm: FormGroup; @@ -54,7 +54,7 @@ export class TransferBalanceDialog implements OnDestroy { public constructor( @Inject(MAT_DIALOG_DATA) public data: TransferBalanceDialogParams, - public dialogRef: MatDialogRef, + public dialogRef: MatDialogRef, private formBuilder: FormBuilder ) {}