From eb687604da387598114ce7830f09c2944ebeabe2 Mon Sep 17 00:00:00 2001 From: tobikugel Date: Tue, 1 Apr 2025 11:09:12 -0300 Subject: [PATCH] refactor: code review --- apps/api/src/app/import/import.service.ts | 3 ++- .../asset-profile-dialog.component.ts | 8 ++++---- .../asset-profile-dialog.html | 19 ++++++++++--------- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/apps/api/src/app/import/import.service.ts b/apps/api/src/app/import/import.service.ts index 2bc24d979..27f513af7 100644 --- a/apps/api/src/app/import/import.service.ts +++ b/apps/api/src/app/import/import.service.ts @@ -510,6 +510,7 @@ export class ImportService { dataSource, date: dateString, fee, + isActive, quantity, symbol, type, @@ -546,7 +547,7 @@ export class ImportService { SymbolProfile: { currency, dataSource, - isActive: false, + isActive, symbol, activitiesCount: undefined, assetClass: undefined, diff --git a/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts b/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts index 4a0248ac5..d9b344699 100644 --- a/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts +++ b/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts @@ -89,7 +89,7 @@ export class AssetProfileDialog implements OnDestroy, OnInit { historicalData: this.formBuilder.group({ csvString: '' }), - isActive: [false], + isActive: [true], name: ['', Validators.required], scraperConfiguration: this.formBuilder.group({ defaultMarketPrice: null, @@ -542,14 +542,14 @@ export class AssetProfileDialog implements OnDestroy, OnInit { }); } - public onToggleIsActive(event: MatCheckboxChange) { - if (event.checked) { + public onToggleIsActive({ checked }: MatCheckboxChange) { + if (checked) { this.assetProfileForm.get('isActive')?.setValue(true); } else { this.assetProfileForm.get('isActive')?.setValue(false); } - if (event.checked === this.assetProfile.isActive) { + if (checked === this.assetProfile.isActive) { this.assetProfileForm.get('isActive')?.markAsPristine(); } else { this.assetProfileForm.get('isActive')?.markAsDirty(); diff --git a/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.html b/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.html index f8597c9c1..00fff7a12 100644 --- a/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.html +++ b/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.html @@ -513,15 +513,16 @@
- - Active - +
+ + Active + +