diff --git a/CHANGELOG.md b/CHANGELOG.md index 177638fa..d51ebd29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,14 +23,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Improved the language localization for Catalan (`ca`) - Improved the language localization for Chinese (`zh`) - Improved the language localization for Dutch (`nl`) +- Improved the language localization for French (`fr`) - Improved the language localization for German (`de`) - Improved the language localization for Italian (`it`) - Upgraded `countup.js` from version `2.8.0` to `2.8.2` - Upgraded `nestjs` from version `10.4.15` to `11.0.12` +- Upgraded `twitter-api-v2` from version `1.14.2` to `1.23.0` - Upgraded `yahoo-finance2` from version `2.11.3` to `3.3.2` ### Fixed +- Displayed the button to fetch the current market price only if the activity is not in a custom currency - Fixed an issue in the watchlist endpoint (`POST`) related to the `HasPermissionGuard` ## 2.161.0 - 2025-05-06 diff --git a/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.component.ts b/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.component.ts index dce045a4..5f651195 100644 --- a/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.component.ts +++ b/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.component.ts @@ -39,6 +39,7 @@ export class CreateOrUpdateActivityDialog implements OnDestroy { return { id: assetSubClass, label: translate(assetSubClass) }; }); public currencies: string[] = []; + public currencyOfAssetProfile: string; public currentMarketPrice = null; public defaultDateFormat: string; public isLoading = false; @@ -63,8 +64,10 @@ export class CreateOrUpdateActivityDialog implements OnDestroy { ) {} public ngOnInit() { - this.mode = this.data.activity.id ? 'update' : 'create'; + this.currencyOfAssetProfile = this.data.activity?.SymbolProfile?.currency; this.locale = this.data.user?.settings?.locale; + this.mode = this.data.activity?.id ? 'update' : 'create'; + this.dateAdapter.setLocale(this.locale); const { currencies, platforms } = this.dataService.fetchInfo(); @@ -210,7 +213,7 @@ export class CreateOrUpdateActivityDialog implements OnDestroy { this.activityForm.get('type').value ) ) { - this.updateSymbol(); + this.updateAssetProfile(); } this.changeDetectorRef.markForCheck(); @@ -397,7 +400,7 @@ export class CreateOrUpdateActivityDialog implements OnDestroy { this.dialogRef.close(activity); } else { - (activity as UpdateOrderDto).id = this.data.activity.id; + (activity as UpdateOrderDto).id = this.data.activity?.id; await validateObjectForForm({ classDto: UpdateOrderDto, @@ -422,7 +425,7 @@ export class CreateOrUpdateActivityDialog implements OnDestroy { this.unsubscribeSubject.complete(); } - private updateSymbol() { + private updateAssetProfile() { this.isLoading = true; this.changeDetectorRef.markForCheck(); @@ -450,6 +453,7 @@ export class CreateOrUpdateActivityDialog implements OnDestroy { this.activityForm.get('dataSource').setValue(dataSource); } + this.currencyOfAssetProfile = currency; this.currentMarketPrice = marketPrice; this.isLoading = false; diff --git a/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.html b/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.html index b0521530..08e1b516 100644 --- a/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.html +++ b/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.html @@ -230,8 +230,10 @@ @if ( + currencyOfAssetProfile === + activityForm.get('currencyOfUnitPrice').value && currentMarketPrice && - (data.activity.type === 'BUY' || data.activity.type === 'SELL') && + ['BUY', 'SELL'].includes(data.activity.type) && isToday(activityForm.get('date')?.value) ) {