From e67ccea67364cac343e47f81adfd82912a3ef9cf Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Tue, 22 Apr 2025 19:38:03 +0200 Subject: [PATCH 01/12] Feature/rename User to user in subscription database schema (#4576) * Rename User to user * Update changelog --- CHANGELOG.md | 4 ++++ apps/api/src/app/subscription/subscription.service.ts | 2 +- prisma/schema.prisma | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 221a6881f..cbadcebc1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added the endpoints (`DELETE`, `GET` and `POST`) for the watchlist +### Changed + +- Renamed `User` to `user` in the `Subscription` database schema + ## 2.154.0 - 2025-04-21 ### Added diff --git a/apps/api/src/app/subscription/subscription.service.ts b/apps/api/src/app/subscription/subscription.service.ts index f95334684..063c40608 100644 --- a/apps/api/src/app/subscription/subscription.service.ts +++ b/apps/api/src/app/subscription/subscription.service.ts @@ -122,7 +122,7 @@ export class SubscriptionService { data: { expiresAt, price, - User: { + user: { connect: { id: userId } diff --git a/prisma/schema.prisma b/prisma/schema.prisma index b649b38b6..b88a5f9f8 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -226,8 +226,8 @@ model Subscription { id String @id @default(uuid()) price Float? updatedAt DateTime @updatedAt + user User @relation(fields: [userId], onDelete: Cascade, references: [id]) userId String - User User @relation(fields: [userId], onDelete: Cascade, references: [id]) @@index([userId]) } From dfa940c1b442e23285195a401fc77d541d8b76fd Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Wed, 23 Apr 2025 19:46:21 +0200 Subject: [PATCH 02/12] Bugfix/add missing common module import in rule settings dialog (#4586) * Add missing import * Update changelog --- CHANGELOG.md | 4 ++++ .../rule-settings-dialog.component.ts | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cbadcebc1..0e1c5cb4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Renamed `User` to `user` in the `Subscription` database schema +### Fixed + +- Fixed an issue in the settings dialog to customize the rule thresholds of the _X-ray_ page (experimental) + ## 2.154.0 - 2025-04-21 ### Added diff --git a/apps/client/src/app/components/rule/rule-settings-dialog/rule-settings-dialog.component.ts b/apps/client/src/app/components/rule/rule-settings-dialog/rule-settings-dialog.component.ts index b57bcb0fd..7ee9c66cf 100644 --- a/apps/client/src/app/components/rule/rule-settings-dialog/rule-settings-dialog.component.ts +++ b/apps/client/src/app/components/rule/rule-settings-dialog/rule-settings-dialog.component.ts @@ -1,5 +1,6 @@ import { XRayRulesSettings } from '@ghostfolio/common/interfaces'; +import { CommonModule } from '@angular/common'; import { Component, Inject } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; @@ -13,7 +14,13 @@ import { MatSliderModule } from '@angular/material/slider'; import { IRuleSettingsDialogParams } from './interfaces/interfaces'; @Component({ - imports: [FormsModule, MatButtonModule, MatDialogModule, MatSliderModule], + imports: [ + CommonModule, + FormsModule, + MatButtonModule, + MatDialogModule, + MatSliderModule + ], selector: 'gf-rule-settings-dialog', styleUrls: ['./rule-settings-dialog.scss'], templateUrl: './rule-settings-dialog.html' From 56fcafaa12cb7866986c86a2344db467a71e036a Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Wed, 23 Apr 2025 20:15:11 +0200 Subject: [PATCH 03/12] Feature/improve premium data provider handling in getQuotes() (#4590) * Improve premium data provider handling in getQuotes() --- .../data-provider/data-provider.service.ts | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/apps/api/src/services/data-provider/data-provider.service.ts b/apps/api/src/services/data-provider/data-provider.service.ts index 3f02cf109..a4edd5bfa 100644 --- a/apps/api/src/services/data-provider/data-provider.service.ts +++ b/apps/api/src/services/data-provider/data-provider.service.ts @@ -18,6 +18,7 @@ import { DATE_FORMAT, getCurrencyFromSymbol, getStartOfUtcDate, + isCurrency, isDerivedCurrency } from '@ghostfolio/common/helper'; import { @@ -468,17 +469,21 @@ export class DataProviderService { )) { const dataProvider = this.getDataProvider(DataSource[dataSource]); - if ( - dataProvider.getDataProviderInfo().isPremium && - this.configurationService.get('ENABLE_FEATURE_SUBSCRIPTION') && - user?.subscription.type === 'Basic' - ) { - continue; - } - const symbols = assetProfileIdentifiers .filter(({ symbol }) => { - return !isDerivedCurrency(getCurrencyFromSymbol(symbol)); + if (isCurrency(getCurrencyFromSymbol(symbol))) { + // Keep non-derived currencies + return !isDerivedCurrency(getCurrencyFromSymbol(symbol)); + } else if ( + dataProvider.getDataProviderInfo().isPremium && + this.configurationService.get('ENABLE_FEATURE_SUBSCRIPTION') && + user?.subscription.type === 'Basic' + ) { + // Skip symbols of Premium data providers for users without subscription + return false; + } + + return true; }) .map(({ symbol }) => { return symbol; From 53a81b3c2bc330faae342d8af04050fce72ef06a Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Wed, 23 Apr 2025 20:15:31 +0200 Subject: [PATCH 04/12] Feature/migrate assistant component to control flow (#4591) * Migrate to control flow * Update changelog --- CHANGELOG.md | 1 + libs/ui/src/lib/assistant/assistant.html | 86 ++++++++++++------------ 2 files changed, 45 insertions(+), 42 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e1c5cb4b..f0f000afa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Renamed `User` to `user` in the `Subscription` database schema +- Migrated the `@ghostfolio/ui/assistant` component to control flow ### Fixed diff --git a/libs/ui/src/lib/assistant/assistant.html b/libs/ui/src/lib/assistant/assistant.html index 33b4db3ff..fa6738532 100644 --- a/libs/ui/src/lib/assistant/assistant.html +++ b/libs/ui/src/lib/assistant/assistant.html @@ -15,28 +15,26 @@ [formControl]="searchFormControl" [placeholder]="placeholder" /> -
- / -
- - + @if (deviceType !== 'mobile' && !searchFormControl.value) { +
/
+ } + @if (searchFormControl.value) { + + } @else { + + }
- -
No entries...
+ @if (isLoading) { + + } @else { +
No entries...
+ }
@@ -72,16 +72,18 @@ (clicked)="onCloseAssistant()" /> - -
No entries...
+ @if (isLoading) { + + } @else { +
No entries...
+ }
From 10580e22d1d380343ec98769fd169ff75de5d0ef Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Wed, 23 Apr 2025 20:23:20 +0200 Subject: [PATCH 05/12] Feature/migrate value component to control flow (#4592) * Migrate to control flow * Update changelog --- CHANGELOG.md | 1 + libs/ui/src/lib/value/value.component.html | 94 +++++++++++----------- 2 files changed, 50 insertions(+), 45 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f0f000afa..ac62bb06c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Renamed `User` to `user` in the `Subscription` database schema - Migrated the `@ghostfolio/ui/assistant` component to control flow +- Migrated the `@ghostfolio/ui/value` component to control flow ### Fixed diff --git a/libs/ui/src/lib/value/value.component.html b/libs/ui/src/lib/value/value.component.html index 0ead7497e..e252ef8a2 100644 --- a/libs/ui/src/lib/value/value.component.html +++ b/libs/ui/src/lib/value/value.component.html @@ -13,42 +13,45 @@
+
-
-
- @if (value === null) { - *****% - } @else { - {{ formattedValue }}% - } -
-
- @if (value === null) { - ***** - } @else { - {{ formattedValue }} - } -
- - {{ unit }} - -
- {{ unit }} -
+ @if (isPercent) { +
+ @if (value === null) { + *****% + } @else { + {{ formattedValue }}% + } +
+ } @else { +
+ @if (value === null) { + ***** + } @else { + {{ formattedValue }} + } +
+ } + @if (unit) { + + {{ unit }} + +
+ {{ unit }} +
+ } - + @if (isString) {
+ @if (value === undefined) { + + }
From 50e7e3d3c786e9bcf45490f13664cedd3484a63b Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Wed, 23 Apr 2025 20:24:08 +0200 Subject: [PATCH 06/12] Feature/simplify data source checks in DTOs (#4581) * Simplify DataSource checks in DTOs * Add test case * Update changelog --- CHANGELOG.md | 2 ++ .../src/app/admin/update-asset-profile.dto.ts | 2 +- apps/api/src/app/order/create-order.dto.ts | 2 +- test/import/invalid-data-source.json | 18 ++++++++++++++++++ 4 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 test/import/invalid-data-source.json diff --git a/CHANGELOG.md b/CHANGELOG.md index ac62bb06c..ffa35cf41 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Simplified the data source check in the DTO of the activity creation +- Simplified the data source check in the DTO of the asset profile update - Renamed `User` to `user` in the `Subscription` database schema - Migrated the `@ghostfolio/ui/assistant` component to control flow - Migrated the `@ghostfolio/ui/value` component to control flow diff --git a/apps/api/src/app/admin/update-asset-profile.dto.ts b/apps/api/src/app/admin/update-asset-profile.dto.ts index 45923410a..5056dccdb 100644 --- a/apps/api/src/app/admin/update-asset-profile.dto.ts +++ b/apps/api/src/app/admin/update-asset-profile.dto.ts @@ -32,7 +32,7 @@ export class UpdateAssetProfileDto { @IsOptional() currency?: string; - @IsEnum(DataSource, { each: true }) + @IsEnum(DataSource) @IsOptional() dataSource?: DataSource; diff --git a/apps/api/src/app/order/create-order.dto.ts b/apps/api/src/app/order/create-order.dto.ts index f40e65ba1..c2b10fd81 100644 --- a/apps/api/src/app/order/create-order.dto.ts +++ b/apps/api/src/app/order/create-order.dto.ts @@ -49,7 +49,7 @@ export class CreateOrderDto { @IsOptional() customCurrency?: string; - @IsEnum(DataSource, { each: true }) + @IsEnum(DataSource) @IsOptional() dataSource?: DataSource; diff --git a/test/import/invalid-data-source.json b/test/import/invalid-data-source.json new file mode 100644 index 000000000..472e295ee --- /dev/null +++ b/test/import/invalid-data-source.json @@ -0,0 +1,18 @@ +{ + "meta": { + "date": "2021-01-01T00:00:00.000Z", + "version": "dev" + }, + "activities": [ + { + "currency": "USD", + "dataSource": "", + "date": "2021-01-01T00:00:00.000Z", + "fee": 0, + "quantity": 20, + "symbol": "AAPL", + "type": "BUY", + "unitPrice": 100.0 + } + ] +} From ac37974fd69c37b4954b20cadb63801b9713caf1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 23 Apr 2025 20:26:35 +0200 Subject: [PATCH 07/12] Feature/update locales (#4593) Co-authored-by: github-actions[bot] --- apps/client/src/locales/messages.ca.xlf | 20 ++++++++++---------- apps/client/src/locales/messages.de.xlf | 20 ++++++++++---------- apps/client/src/locales/messages.es.xlf | 20 ++++++++++---------- apps/client/src/locales/messages.fr.xlf | 20 ++++++++++---------- apps/client/src/locales/messages.it.xlf | 20 ++++++++++---------- apps/client/src/locales/messages.nl.xlf | 20 ++++++++++---------- apps/client/src/locales/messages.pl.xlf | 20 ++++++++++---------- apps/client/src/locales/messages.pt.xlf | 20 ++++++++++---------- apps/client/src/locales/messages.tr.xlf | 20 ++++++++++---------- apps/client/src/locales/messages.uk.xlf | 20 ++++++++++---------- apps/client/src/locales/messages.xlf | 20 ++++++++++---------- apps/client/src/locales/messages.zh.xlf | 20 ++++++++++---------- 12 files changed, 120 insertions(+), 120 deletions(-) diff --git a/apps/client/src/locales/messages.ca.xlf b/apps/client/src/locales/messages.ca.xlf index 41a5e9078..456e15790 100644 --- a/apps/client/src/locales/messages.ca.xlf +++ b/apps/client/src/locales/messages.ca.xlf @@ -1003,7 +1003,7 @@ libs/ui/src/lib/assistant/assistant.html - 46 + 44 @@ -1603,7 +1603,7 @@ libs/ui/src/lib/assistant/assistant.html - 166 + 168 @@ -4639,7 +4639,7 @@ libs/ui/src/lib/assistant/assistant.html - 107 + 109 @@ -4739,7 +4739,7 @@ libs/ui/src/lib/assistant/assistant.html - 127 + 129 @@ -6035,11 +6035,11 @@ No entries... libs/ui/src/lib/assistant/assistant.html - 63 + 62 libs/ui/src/lib/assistant/assistant.html - 84 + 85 @@ -6055,7 +6055,7 @@ Date Range libs/ui/src/lib/assistant/assistant.html - 93 + 95 @@ -6063,7 +6063,7 @@ Reset Filters libs/ui/src/lib/assistant/assistant.html - 185 + 187 @@ -6071,7 +6071,7 @@ Apply Filters libs/ui/src/lib/assistant/assistant.html - 195 + 197 @@ -7473,7 +7473,7 @@ Tag libs/ui/src/lib/assistant/assistant.html - 155 + 157 diff --git a/apps/client/src/locales/messages.de.xlf b/apps/client/src/locales/messages.de.xlf index 1cc922c39..10f26cddb 100644 --- a/apps/client/src/locales/messages.de.xlf +++ b/apps/client/src/locales/messages.de.xlf @@ -1666,7 +1666,7 @@ libs/ui/src/lib/assistant/assistant.html - 107 + 109 @@ -2186,7 +2186,7 @@ libs/ui/src/lib/assistant/assistant.html - 46 + 44 @@ -2314,7 +2314,7 @@ libs/ui/src/lib/assistant/assistant.html - 166 + 168 @@ -3358,7 +3358,7 @@ libs/ui/src/lib/assistant/assistant.html - 127 + 129 @@ -5963,11 +5963,11 @@ Keine Einträge vorhanden... libs/ui/src/lib/assistant/assistant.html - 63 + 62 libs/ui/src/lib/assistant/assistant.html - 84 + 85 @@ -6183,7 +6183,7 @@ Zeitraum libs/ui/src/lib/assistant/assistant.html - 93 + 95 @@ -6383,7 +6383,7 @@ Filter zurücksetzen libs/ui/src/lib/assistant/assistant.html - 185 + 187 @@ -6407,7 +6407,7 @@ Filter anwenden libs/ui/src/lib/assistant/assistant.html - 195 + 197 @@ -7497,7 +7497,7 @@ Tag libs/ui/src/lib/assistant/assistant.html - 155 + 157 diff --git a/apps/client/src/locales/messages.es.xlf b/apps/client/src/locales/messages.es.xlf index 555c95ac1..8ba704729 100644 --- a/apps/client/src/locales/messages.es.xlf +++ b/apps/client/src/locales/messages.es.xlf @@ -1651,7 +1651,7 @@ libs/ui/src/lib/assistant/assistant.html - 107 + 109 @@ -2171,7 +2171,7 @@ libs/ui/src/lib/assistant/assistant.html - 46 + 44 @@ -2299,7 +2299,7 @@ libs/ui/src/lib/assistant/assistant.html - 166 + 168 @@ -3343,7 +3343,7 @@ libs/ui/src/lib/assistant/assistant.html - 127 + 129 @@ -5940,11 +5940,11 @@ No entries... libs/ui/src/lib/assistant/assistant.html - 63 + 62 libs/ui/src/lib/assistant/assistant.html - 84 + 85 @@ -6160,7 +6160,7 @@ Date Range libs/ui/src/lib/assistant/assistant.html - 93 + 95 @@ -6360,7 +6360,7 @@ Reiniciar filtros libs/ui/src/lib/assistant/assistant.html - 185 + 187 @@ -6384,7 +6384,7 @@ Aplicar filtros libs/ui/src/lib/assistant/assistant.html - 195 + 197 @@ -7474,7 +7474,7 @@ Tag libs/ui/src/lib/assistant/assistant.html - 155 + 157 diff --git a/apps/client/src/locales/messages.fr.xlf b/apps/client/src/locales/messages.fr.xlf index fa1007391..78893b590 100644 --- a/apps/client/src/locales/messages.fr.xlf +++ b/apps/client/src/locales/messages.fr.xlf @@ -654,7 +654,7 @@ libs/ui/src/lib/assistant/assistant.html - 166 + 168 @@ -1906,7 +1906,7 @@ libs/ui/src/lib/assistant/assistant.html - 107 + 109 @@ -2798,7 +2798,7 @@ libs/ui/src/lib/assistant/assistant.html - 46 + 44 @@ -3342,7 +3342,7 @@ libs/ui/src/lib/assistant/assistant.html - 127 + 129 @@ -5939,11 +5939,11 @@ Pas d’entrées ... libs/ui/src/lib/assistant/assistant.html - 63 + 62 libs/ui/src/lib/assistant/assistant.html - 84 + 85 @@ -6159,7 +6159,7 @@ Intervalle de Date libs/ui/src/lib/assistant/assistant.html - 93 + 95 @@ -6359,7 +6359,7 @@ Réinitialiser les Filtres libs/ui/src/lib/assistant/assistant.html - 185 + 187 @@ -6383,7 +6383,7 @@ Appliquer les Filtres libs/ui/src/lib/assistant/assistant.html - 195 + 197 @@ -7473,7 +7473,7 @@ Étiquette libs/ui/src/lib/assistant/assistant.html - 155 + 157 diff --git a/apps/client/src/locales/messages.it.xlf b/apps/client/src/locales/messages.it.xlf index 081535681..c8c1a086d 100644 --- a/apps/client/src/locales/messages.it.xlf +++ b/apps/client/src/locales/messages.it.xlf @@ -1651,7 +1651,7 @@ libs/ui/src/lib/assistant/assistant.html - 107 + 109 @@ -2171,7 +2171,7 @@ libs/ui/src/lib/assistant/assistant.html - 46 + 44 @@ -2299,7 +2299,7 @@ libs/ui/src/lib/assistant/assistant.html - 166 + 168 @@ -3343,7 +3343,7 @@ libs/ui/src/lib/assistant/assistant.html - 127 + 129 @@ -5940,11 +5940,11 @@ Nessun risultato... libs/ui/src/lib/assistant/assistant.html - 63 + 62 libs/ui/src/lib/assistant/assistant.html - 84 + 85 @@ -6160,7 +6160,7 @@ Intervallo di date libs/ui/src/lib/assistant/assistant.html - 93 + 95 @@ -6360,7 +6360,7 @@ Reset Filtri libs/ui/src/lib/assistant/assistant.html - 185 + 187 @@ -6384,7 +6384,7 @@ Applica i Filtri libs/ui/src/lib/assistant/assistant.html - 195 + 197 @@ -7474,7 +7474,7 @@ Tag libs/ui/src/lib/assistant/assistant.html - 155 + 157 diff --git a/apps/client/src/locales/messages.nl.xlf b/apps/client/src/locales/messages.nl.xlf index 6852f7260..7c5066ad6 100644 --- a/apps/client/src/locales/messages.nl.xlf +++ b/apps/client/src/locales/messages.nl.xlf @@ -1650,7 +1650,7 @@ libs/ui/src/lib/assistant/assistant.html - 107 + 109 @@ -2170,7 +2170,7 @@ libs/ui/src/lib/assistant/assistant.html - 46 + 44 @@ -2298,7 +2298,7 @@ libs/ui/src/lib/assistant/assistant.html - 166 + 168 @@ -3342,7 +3342,7 @@ libs/ui/src/lib/assistant/assistant.html - 127 + 129 @@ -5939,11 +5939,11 @@ No entries... libs/ui/src/lib/assistant/assistant.html - 63 + 62 libs/ui/src/lib/assistant/assistant.html - 84 + 85 @@ -6159,7 +6159,7 @@ Date Range libs/ui/src/lib/assistant/assistant.html - 93 + 95 @@ -6359,7 +6359,7 @@ Reset Filters libs/ui/src/lib/assistant/assistant.html - 185 + 187 @@ -6383,7 +6383,7 @@ Apply Filters libs/ui/src/lib/assistant/assistant.html - 195 + 197 @@ -7473,7 +7473,7 @@ Tag libs/ui/src/lib/assistant/assistant.html - 155 + 157 diff --git a/apps/client/src/locales/messages.pl.xlf b/apps/client/src/locales/messages.pl.xlf index e7c42b11b..4970c3d53 100644 --- a/apps/client/src/locales/messages.pl.xlf +++ b/apps/client/src/locales/messages.pl.xlf @@ -1495,7 +1495,7 @@ libs/ui/src/lib/assistant/assistant.html - 166 + 168 @@ -4251,7 +4251,7 @@ libs/ui/src/lib/assistant/assistant.html - 107 + 109 @@ -4351,7 +4351,7 @@ libs/ui/src/lib/assistant/assistant.html - 127 + 129 @@ -4751,7 +4751,7 @@ libs/ui/src/lib/assistant/assistant.html - 46 + 44 @@ -5499,11 +5499,11 @@ Brak wpisów... libs/ui/src/lib/assistant/assistant.html - 63 + 62 libs/ui/src/lib/assistant/assistant.html - 84 + 85 @@ -6159,7 +6159,7 @@ Zakres Dat libs/ui/src/lib/assistant/assistant.html - 93 + 95 @@ -6359,7 +6359,7 @@ Resetuj Filtry libs/ui/src/lib/assistant/assistant.html - 185 + 187 @@ -6383,7 +6383,7 @@ Zastosuj Filtry libs/ui/src/lib/assistant/assistant.html - 195 + 197 @@ -7473,7 +7473,7 @@ Tag libs/ui/src/lib/assistant/assistant.html - 155 + 157 diff --git a/apps/client/src/locales/messages.pt.xlf b/apps/client/src/locales/messages.pt.xlf index 414bacda8..84a3a0061 100644 --- a/apps/client/src/locales/messages.pt.xlf +++ b/apps/client/src/locales/messages.pt.xlf @@ -654,7 +654,7 @@ libs/ui/src/lib/assistant/assistant.html - 166 + 168 @@ -1890,7 +1890,7 @@ libs/ui/src/lib/assistant/assistant.html - 107 + 109 @@ -2694,7 +2694,7 @@ libs/ui/src/lib/assistant/assistant.html - 46 + 44 @@ -3342,7 +3342,7 @@ libs/ui/src/lib/assistant/assistant.html - 127 + 129 @@ -5939,11 +5939,11 @@ No entries... libs/ui/src/lib/assistant/assistant.html - 63 + 62 libs/ui/src/lib/assistant/assistant.html - 84 + 85 @@ -6159,7 +6159,7 @@ Date Range libs/ui/src/lib/assistant/assistant.html - 93 + 95 @@ -6359,7 +6359,7 @@ Reset Filters libs/ui/src/lib/assistant/assistant.html - 185 + 187 @@ -6383,7 +6383,7 @@ Apply Filters libs/ui/src/lib/assistant/assistant.html - 195 + 197 @@ -7473,7 +7473,7 @@ Tag libs/ui/src/lib/assistant/assistant.html - 155 + 157 diff --git a/apps/client/src/locales/messages.tr.xlf b/apps/client/src/locales/messages.tr.xlf index 78a66fc99..97457c7a0 100644 --- a/apps/client/src/locales/messages.tr.xlf +++ b/apps/client/src/locales/messages.tr.xlf @@ -1447,7 +1447,7 @@ libs/ui/src/lib/assistant/assistant.html - 166 + 168 @@ -3731,7 +3731,7 @@ libs/ui/src/lib/assistant/assistant.html - 107 + 109 @@ -3831,7 +3831,7 @@ libs/ui/src/lib/assistant/assistant.html - 127 + 129 @@ -4223,7 +4223,7 @@ libs/ui/src/lib/assistant/assistant.html - 46 + 44 @@ -5939,11 +5939,11 @@ Girdi yok... libs/ui/src/lib/assistant/assistant.html - 63 + 62 libs/ui/src/lib/assistant/assistant.html - 84 + 85 @@ -6159,7 +6159,7 @@ Date Range libs/ui/src/lib/assistant/assistant.html - 93 + 95 @@ -6359,7 +6359,7 @@ Reset Filters libs/ui/src/lib/assistant/assistant.html - 185 + 187 @@ -6383,7 +6383,7 @@ Apply Filters libs/ui/src/lib/assistant/assistant.html - 195 + 197 @@ -7473,7 +7473,7 @@ Tag libs/ui/src/lib/assistant/assistant.html - 155 + 157 diff --git a/apps/client/src/locales/messages.uk.xlf b/apps/client/src/locales/messages.uk.xlf index 47fb7663a..dae661112 100644 --- a/apps/client/src/locales/messages.uk.xlf +++ b/apps/client/src/locales/messages.uk.xlf @@ -1019,7 +1019,7 @@ libs/ui/src/lib/assistant/assistant.html - 46 + 44 @@ -1495,7 +1495,7 @@ libs/ui/src/lib/assistant/assistant.html - 166 + 168 @@ -4879,7 +4879,7 @@ libs/ui/src/lib/assistant/assistant.html - 107 + 109 @@ -4999,7 +4999,7 @@ libs/ui/src/lib/assistant/assistant.html - 127 + 129 @@ -6681,11 +6681,11 @@ Немає записів... libs/ui/src/lib/assistant/assistant.html - 63 + 62 libs/ui/src/lib/assistant/assistant.html - 84 + 85 @@ -6701,7 +6701,7 @@ Діапазон дат libs/ui/src/lib/assistant/assistant.html - 93 + 95 @@ -6709,7 +6709,7 @@ Тег libs/ui/src/lib/assistant/assistant.html - 155 + 157 @@ -6717,7 +6717,7 @@ Скинути фільтри libs/ui/src/lib/assistant/assistant.html - 185 + 187 @@ -6725,7 +6725,7 @@ Застосувати фільтри libs/ui/src/lib/assistant/assistant.html - 195 + 197 diff --git a/apps/client/src/locales/messages.xlf b/apps/client/src/locales/messages.xlf index ad4e1a3ad..d8a7b552c 100644 --- a/apps/client/src/locales/messages.xlf +++ b/apps/client/src/locales/messages.xlf @@ -1438,7 +1438,7 @@ libs/ui/src/lib/assistant/assistant.html - 166 + 168 @@ -3937,7 +3937,7 @@ libs/ui/src/lib/assistant/assistant.html - 107 + 109 @@ -4026,7 +4026,7 @@ libs/ui/src/lib/assistant/assistant.html - 127 + 129 @@ -4383,7 +4383,7 @@ libs/ui/src/lib/assistant/assistant.html - 46 + 44 @@ -5084,11 +5084,11 @@ No entries... libs/ui/src/lib/assistant/assistant.html - 63 + 62 libs/ui/src/lib/assistant/assistant.html - 84 + 85 @@ -5616,7 +5616,7 @@ Date Range libs/ui/src/lib/assistant/assistant.html - 93 + 95 @@ -5801,7 +5801,7 @@ Reset Filters libs/ui/src/lib/assistant/assistant.html - 185 + 187 @@ -5829,7 +5829,7 @@ Apply Filters libs/ui/src/lib/assistant/assistant.html - 195 + 197 @@ -6766,7 +6766,7 @@ Tag libs/ui/src/lib/assistant/assistant.html - 155 + 157 diff --git a/apps/client/src/locales/messages.zh.xlf b/apps/client/src/locales/messages.zh.xlf index 12ed4498b..6305867a3 100644 --- a/apps/client/src/locales/messages.zh.xlf +++ b/apps/client/src/locales/messages.zh.xlf @@ -1504,7 +1504,7 @@ libs/ui/src/lib/assistant/assistant.html - 166 + 168 @@ -4260,7 +4260,7 @@ libs/ui/src/lib/assistant/assistant.html - 107 + 109 @@ -4360,7 +4360,7 @@ libs/ui/src/lib/assistant/assistant.html - 127 + 129 @@ -4760,7 +4760,7 @@ libs/ui/src/lib/assistant/assistant.html - 46 + 44 @@ -5540,11 +5540,11 @@ 没有条目... libs/ui/src/lib/assistant/assistant.html - 63 + 62 libs/ui/src/lib/assistant/assistant.html - 84 + 85 @@ -6144,7 +6144,7 @@ 日期范围 libs/ui/src/lib/assistant/assistant.html - 93 + 95 @@ -6352,7 +6352,7 @@ 重置过滤器 libs/ui/src/lib/assistant/assistant.html - 185 + 187 @@ -6384,7 +6384,7 @@ 应用过滤器 libs/ui/src/lib/assistant/assistant.html - 195 + 197 @@ -7474,7 +7474,7 @@ Tag libs/ui/src/lib/assistant/assistant.html - 155 + 157 From 8dcf04019d7b87daf4d4d1cbef0289daec96ac16 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 23 Apr 2025 20:27:06 +0200 Subject: [PATCH 08/12] Feature/update locales (#4594) Co-authored-by: github-actions[bot] From 4c63e08e3c84e51876d49ae576bc0773f3618aa1 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Wed, 23 Apr 2025 20:29:27 +0200 Subject: [PATCH 09/12] Release 2.155.0 (#4595) --- CHANGELOG.md | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ffa35cf41..fcc336b31 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## Unreleased +## 2.155.0 - 2025-04-23 ### Added diff --git a/package-lock.json b/package-lock.json index 51ddd7bc2..a45d5d875 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ghostfolio", - "version": "2.154.0", + "version": "2.155.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ghostfolio", - "version": "2.154.0", + "version": "2.155.0", "hasInstallScript": true, "license": "AGPL-3.0", "dependencies": { diff --git a/package.json b/package.json index 4d8616297..64fc87aa0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ghostfolio", - "version": "2.154.0", + "version": "2.155.0", "homepage": "https://ghostfol.io", "license": "AGPL-3.0", "repository": "https://github.com/ghostfolio/ghostfolio", From 447fe1806fa4fb33fb2d97371b43dd6698909f59 Mon Sep 17 00:00:00 2001 From: Vinodh Zamboulingame <48854069+vzamboulingame@users.noreply.github.com> Date: Thu, 24 Apr 2025 20:40:12 +0200 Subject: [PATCH 10/12] Bugfix/fix activities import of files with extension in uppercase (#4596) * Fix activities import of files with extension in uppercase * Update changelog --- CHANGELOG.md | 6 ++++++ .../import-activities-dialog.component.ts | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fcc336b31..db8312af0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +### Fixed + +- Improved the file selector of the activities import functionality to accept case-insensitive file extensions (`.CSV` and `.JSON`) + ## 2.155.0 - 2025-04-23 ### Added diff --git a/apps/client/src/app/pages/portfolio/activities/import-activities-dialog/import-activities-dialog.component.ts b/apps/client/src/app/pages/portfolio/activities/import-activities-dialog/import-activities-dialog.component.ts index 82e78a180..20f135801 100644 --- a/apps/client/src/app/pages/portfolio/activities/import-activities-dialog/import-activities-dialog.component.ts +++ b/apps/client/src/app/pages/portfolio/activities/import-activities-dialog/import-activities-dialog.component.ts @@ -247,9 +247,10 @@ export class ImportActivitiesDialog implements OnDestroy { reader.onload = async (readerEvent) => { const fileContent = readerEvent.target.result as string; + const fileExtension = file.name.split('.').pop()?.toLowerCase(); try { - if (file.name.endsWith('.json')) { + if (fileExtension === 'json') { const content = JSON.parse(fileContent); this.accounts = content.accounts; @@ -294,7 +295,7 @@ export class ImportActivitiesDialog implements OnDestroy { } return; - } else if (file.name.endsWith('.csv')) { + } else if (fileExtension === 'csv') { const content = fileContent.split('\n').slice(1); try { From 3b59d7989a23c9dd6c59c12b604cb8ad0d6c801b Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Fri, 25 Apr 2025 08:24:16 +0200 Subject: [PATCH 11/12] Feature/improve currency code validation (#4598) * Improve currency code validation * Update changelog --- CHANGELOG.md | 5 +++++ apps/api/src/validators/is-currency-code.ts | 21 +++++++++++++-------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index db8312af0..328d7749e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Changed + +- Improved the error message of the currency code validation +- Tightened the currency code validation by requiring uppercase letters + ### Fixed - Improved the file selector of the activities import functionality to accept case-insensitive file extensions (`.CSV` and `.JSON`) diff --git a/apps/api/src/validators/is-currency-code.ts b/apps/api/src/validators/is-currency-code.ts index 34a82c481..d04da7808 100644 --- a/apps/api/src/validators/is-currency-code.ts +++ b/apps/api/src/validators/is-currency-code.ts @@ -25,19 +25,24 @@ export class IsExtendedCurrencyConstraint implements ValidatorConstraintInterface { public defaultMessage() { - return '$value must be a valid ISO4217 currency code'; + return '$property must be a valid ISO4217 currency code'; } public validate(currency: any) { // Return true if currency is a standard ISO 4217 code or a derived currency return ( - isISO4217CurrencyCode(currency) || - [ - ...DERIVED_CURRENCIES.map((derivedCurrency) => { - return derivedCurrency.currency; - }), - 'USX' - ].includes(currency) + this.isUpperCase(currency) && + (isISO4217CurrencyCode(currency) || + [ + ...DERIVED_CURRENCIES.map((derivedCurrency) => { + return derivedCurrency.currency; + }), + 'USX' + ].includes(currency)) ); } + + private isUpperCase(aString: string) { + return aString === aString?.toUpperCase(); + } } From 7fb0f9b6e8da4b8e7362704fa6640d820a5a191b Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sat, 26 Apr 2025 07:02:31 +0200 Subject: [PATCH 12/12] Feature/refactor import service (#4599) * Refactoring --- apps/api/src/app/import/import.service.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/api/src/app/import/import.service.ts b/apps/api/src/app/import/import.service.ts index babe7c3e3..b6fe0d949 100644 --- a/apps/api/src/app/import/import.service.ts +++ b/apps/api/src/app/import/import.service.ts @@ -167,9 +167,9 @@ export class ImportService { for (const account of accountsDto) { // Check if there is any existing account with the same ID - const accountWithSameId = existingAccounts.find( - (existingAccount) => existingAccount.id === account.id - ); + const accountWithSameId = existingAccounts.find((existingAccount) => { + return existingAccount.id === account.id; + }); // If there is no account or if the account belongs to a different user then create a new account if (!accountWithSameId || accountWithSameId.userId !== user.id) {