From 82fe2590bf4118e091b30dfa8ae74fde3529a463 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Wed, 19 Mar 2025 17:26:00 +0100 Subject: [PATCH 1/8] Feature/add Storybook link to development guide (#4448) * Add Storybook --- DEVELOPMENT.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index cea43095d..1c45aeca1 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -60,6 +60,10 @@ Remove permission in `UserService` using `without()` Use `@if (user?.settings?.isExperimentalFeatures) {}` in HTML template +## Component Library (_Storybook_) + +https://ghostfol.io/development/storybook + ## Git ### Rebase From ddc798928097d0df193504133cca210525b68d02 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 19 Mar 2025 20:37:30 +0100 Subject: [PATCH 2/8] Feature/update locales (#4460) Co-authored-by: github-actions[bot] --- apps/client/src/locales/messages.ca.xlf | 4 ++-- apps/client/src/locales/messages.de.xlf | 4 ++-- apps/client/src/locales/messages.es.xlf | 4 ++-- apps/client/src/locales/messages.fr.xlf | 4 ++-- apps/client/src/locales/messages.it.xlf | 4 ++-- apps/client/src/locales/messages.nl.xlf | 4 ++-- apps/client/src/locales/messages.pl.xlf | 4 ++-- apps/client/src/locales/messages.pt.xlf | 4 ++-- apps/client/src/locales/messages.tr.xlf | 4 ++-- apps/client/src/locales/messages.uk.xlf | 4 ++-- apps/client/src/locales/messages.xlf | 4 ++-- apps/client/src/locales/messages.zh.xlf | 4 ++-- 12 files changed, 24 insertions(+), 24 deletions(-) diff --git a/apps/client/src/locales/messages.ca.xlf b/apps/client/src/locales/messages.ca.xlf index 0f9de4906..f83df8770 100644 --- a/apps/client/src/locales/messages.ca.xlf +++ b/apps/client/src/locales/messages.ca.xlf @@ -7589,7 +7589,7 @@ AI prompt has been copied to the clipboard apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts - 170 + 173 @@ -7685,7 +7685,7 @@ Open Duck.ai apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts - 171 + 174 diff --git a/apps/client/src/locales/messages.de.xlf b/apps/client/src/locales/messages.de.xlf index 223253bae..d8ee071f5 100644 --- a/apps/client/src/locales/messages.de.xlf +++ b/apps/client/src/locales/messages.de.xlf @@ -7589,7 +7589,7 @@ KI-Anweisung wurde in die Zwischenablage kopiert apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts - 170 + 173 @@ -7685,7 +7685,7 @@ Öffne Duck.ai apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts - 171 + 174 diff --git a/apps/client/src/locales/messages.es.xlf b/apps/client/src/locales/messages.es.xlf index a763a3902..5b9c5dbef 100644 --- a/apps/client/src/locales/messages.es.xlf +++ b/apps/client/src/locales/messages.es.xlf @@ -7590,7 +7590,7 @@ AI prompt has been copied to the clipboard apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts - 170 + 173 @@ -7686,7 +7686,7 @@ Open Duck.ai apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts - 171 + 174 diff --git a/apps/client/src/locales/messages.fr.xlf b/apps/client/src/locales/messages.fr.xlf index 0e7b6b9aa..2b61e3ed1 100644 --- a/apps/client/src/locales/messages.fr.xlf +++ b/apps/client/src/locales/messages.fr.xlf @@ -7589,7 +7589,7 @@ AI prompt has been copied to the clipboard apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts - 170 + 173 @@ -7685,7 +7685,7 @@ Open Duck.ai apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts - 171 + 174 diff --git a/apps/client/src/locales/messages.it.xlf b/apps/client/src/locales/messages.it.xlf index 4ab6c53a1..3d12719eb 100644 --- a/apps/client/src/locales/messages.it.xlf +++ b/apps/client/src/locales/messages.it.xlf @@ -7590,7 +7590,7 @@ AI prompt has been copied to the clipboard apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts - 170 + 173 @@ -7686,7 +7686,7 @@ Open Duck.ai apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts - 171 + 174 diff --git a/apps/client/src/locales/messages.nl.xlf b/apps/client/src/locales/messages.nl.xlf index 13671956d..fa29621a5 100644 --- a/apps/client/src/locales/messages.nl.xlf +++ b/apps/client/src/locales/messages.nl.xlf @@ -7589,7 +7589,7 @@ AI prompt has been copied to the clipboard apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts - 170 + 173 @@ -7685,7 +7685,7 @@ Open Duck.ai apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts - 171 + 174 diff --git a/apps/client/src/locales/messages.pl.xlf b/apps/client/src/locales/messages.pl.xlf index ac208d13a..e6e89741d 100644 --- a/apps/client/src/locales/messages.pl.xlf +++ b/apps/client/src/locales/messages.pl.xlf @@ -7589,7 +7589,7 @@ AI prompt has been copied to the clipboard apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts - 170 + 173 @@ -7685,7 +7685,7 @@ Open Duck.ai apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts - 171 + 174 diff --git a/apps/client/src/locales/messages.pt.xlf b/apps/client/src/locales/messages.pt.xlf index 789ee6360..5676461ed 100644 --- a/apps/client/src/locales/messages.pt.xlf +++ b/apps/client/src/locales/messages.pt.xlf @@ -7589,7 +7589,7 @@ AI prompt has been copied to the clipboard apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts - 170 + 173 @@ -7685,7 +7685,7 @@ Open Duck.ai apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts - 171 + 174 diff --git a/apps/client/src/locales/messages.tr.xlf b/apps/client/src/locales/messages.tr.xlf index 05e2566f8..f9e2bfd9b 100644 --- a/apps/client/src/locales/messages.tr.xlf +++ b/apps/client/src/locales/messages.tr.xlf @@ -7589,7 +7589,7 @@ AI prompt has been copied to the clipboard apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts - 170 + 173 @@ -7685,7 +7685,7 @@ Open Duck.ai apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts - 171 + 174 diff --git a/apps/client/src/locales/messages.uk.xlf b/apps/client/src/locales/messages.uk.xlf index 94d3893ba..2c13d1ef7 100644 --- a/apps/client/src/locales/messages.uk.xlf +++ b/apps/client/src/locales/messages.uk.xlf @@ -7597,7 +7597,7 @@ Запит AI скопійовано в буфер обміну apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts - 170 + 173 @@ -7685,7 +7685,7 @@ Open Duck.ai apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts - 171 + 174 diff --git a/apps/client/src/locales/messages.xlf b/apps/client/src/locales/messages.xlf index c1ec934be..778195c24 100644 --- a/apps/client/src/locales/messages.xlf +++ b/apps/client/src/locales/messages.xlf @@ -6867,7 +6867,7 @@ AI prompt has been copied to the clipboard apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts - 170 + 173 @@ -6951,7 +6951,7 @@ Open Duck.ai apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts - 171 + 174 diff --git a/apps/client/src/locales/messages.zh.xlf b/apps/client/src/locales/messages.zh.xlf index 6d6054df6..5c1b6bc5b 100644 --- a/apps/client/src/locales/messages.zh.xlf +++ b/apps/client/src/locales/messages.zh.xlf @@ -7590,7 +7590,7 @@ AI prompt has been copied to the clipboard apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts - 170 + 173 @@ -7686,7 +7686,7 @@ Open Duck.ai apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts - 171 + 174 From 795e4582a8005b15ae0d788a45d6032b64ebe917 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szymon=20=C5=81=C4=85giewka?= Date: Wed, 19 Mar 2025 21:10:19 +0100 Subject: [PATCH 3/8] Feature/replace lodash.uniq with Array.from + Set (#4387) * Replace lodash.uniq with Array.from + Set * Update chagnelog --- CHANGELOG.md | 1 + .../calculator/portfolio-calculator.ts | 4 ++-- .../src/app/portfolio/portfolio.service.ts | 20 ++++++++++--------- .../exchange-rate-data.service.ts | 4 ++-- .../create-asset-profile-dialog.component.ts | 5 +++-- .../user-account-settings.component.ts | 3 +-- 6 files changed, 20 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ea12f2ca9..8f58b23f8 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 - Improved the symbol validation in the _Yahoo Finance_ service (get asset profiles) +- Refactored `lodash.uniq` with `Array.from(new Set(...))` - Refreshed the cryptocurrencies list ### Fixed diff --git a/apps/api/src/app/portfolio/calculator/portfolio-calculator.ts b/apps/api/src/app/portfolio/calculator/portfolio-calculator.ts index 54d80a955..52d57230b 100644 --- a/apps/api/src/app/portfolio/calculator/portfolio-calculator.ts +++ b/apps/api/src/app/portfolio/calculator/portfolio-calculator.ts @@ -49,7 +49,7 @@ import { min, subDays } from 'date-fns'; -import { isNumber, sortBy, sum, uniq, uniqBy } from 'lodash'; +import { isNumber, sortBy, sum, uniqBy } from 'lodash'; export abstract class PortfolioCalculator { protected static readonly ENABLE_LOGGING = false; @@ -222,7 +222,7 @@ export abstract class PortfolioCalculator { const exchangeRatesByCurrency = await this.exchangeRateDataService.getExchangeRatesByCurrency({ - currencies: uniq(Object.values(currencies)), + currencies: Array.from(new Set(Object.values(currencies))), endDate: endOfDay(this.endDate), startDate: this.startDate, targetCurrency: this.currency diff --git a/apps/api/src/app/portfolio/portfolio.service.ts b/apps/api/src/app/portfolio/portfolio.service.ts index e90ebd4ae..a3d9e3c4a 100644 --- a/apps/api/src/app/portfolio/portfolio.service.ts +++ b/apps/api/src/app/portfolio/portfolio.service.ts @@ -82,7 +82,7 @@ import { parseISO, set } from 'date-fns'; -import { isEmpty, uniq } from 'lodash'; +import { isEmpty } from 'lodash'; import { PortfolioCalculator } from './calculator/portfolio-calculator'; import { @@ -2032,14 +2032,16 @@ export class PortfolioService { where: { id: filters[0].id } }); } else { - const accountIds = uniq( - activities - .filter(({ accountId }) => { - return accountId; - }) - .map(({ accountId }) => { - return accountId; - }) + const accountIds = Array.from( + new Set( + activities + .filter(({ accountId }) => { + return accountId; + }) + .map(({ accountId }) => { + return accountId; + }) + ) ); currentAccounts = await this.accountService.accounts({ diff --git a/apps/api/src/services/exchange-rate-data/exchange-rate-data.service.ts b/apps/api/src/services/exchange-rate-data/exchange-rate-data.service.ts index db95a3487..0a2d177ce 100644 --- a/apps/api/src/services/exchange-rate-data/exchange-rate-data.service.ts +++ b/apps/api/src/services/exchange-rate-data/exchange-rate-data.service.ts @@ -23,7 +23,7 @@ import { isToday, subDays } from 'date-fns'; -import { isNumber, uniq } from 'lodash'; +import { isNumber } from 'lodash'; import ms from 'ms'; @Injectable() @@ -515,7 +515,7 @@ export class ExchangeRateDataService { } } - return uniq(currencies).filter(Boolean).sort(); + return Array.from(new Set(currencies)).filter(Boolean).sort(); } private prepareCurrencyPairs(aCurrencies: string[]) { diff --git a/apps/client/src/app/components/admin-market-data/create-asset-profile-dialog/create-asset-profile-dialog.component.ts b/apps/client/src/app/components/admin-market-data/create-asset-profile-dialog/create-asset-profile-dialog.component.ts index b0f69fa5c..e84554577 100644 --- a/apps/client/src/app/components/admin-market-data/create-asset-profile-dialog/create-asset-profile-dialog.component.ts +++ b/apps/client/src/app/components/admin-market-data/create-asset-profile-dialog/create-asset-profile-dialog.component.ts @@ -20,7 +20,6 @@ import { } from '@angular/forms'; import { MatDialogRef } from '@angular/material/dialog'; import { isISO4217CurrencyCode } from 'class-validator'; -import { uniq } from 'lodash'; import { Subject, takeUntil } from 'rxjs'; import { CreateAssetProfileDialogMode } from './interfaces/interfaces'; @@ -87,7 +86,9 @@ export class CreateAssetProfileDialog implements OnInit, OnDestroy { this.createAssetProfileForm.get('addCurrency').value as string ).toUpperCase(); - const currencies = uniq([...this.customCurrencies, currency]).sort(); + const currencies = Array.from( + new Set([...this.customCurrencies, currency]) + ).sort(); this.dataService .putAdminSetting(PROPERTY_CURRENCIES, { diff --git a/apps/client/src/app/components/user-account-settings/user-account-settings.component.ts b/apps/client/src/app/components/user-account-settings/user-account-settings.component.ts index ced617117..1ee23ff8a 100644 --- a/apps/client/src/app/components/user-account-settings/user-account-settings.component.ts +++ b/apps/client/src/app/components/user-account-settings/user-account-settings.component.ts @@ -24,7 +24,6 @@ import { FormBuilder, Validators } from '@angular/forms'; import { MatSlideToggleChange } from '@angular/material/slide-toggle'; import { MatSnackBar } from '@angular/material/snack-bar'; import { format, parseISO } from 'date-fns'; -import { uniq } from 'lodash'; import ms from 'ms'; import { EMPTY, Subject, throwError } from 'rxjs'; import { catchError, takeUntil } from 'rxjs/operators'; @@ -108,7 +107,7 @@ export class UserAccountSettingsComponent implements OnDestroy, OnInit { ); this.locales.push(this.user.settings.locale); - this.locales = uniq(this.locales.sort()); + this.locales = Array.from(new Set(this.locales)).sort(); this.changeDetectorRef.markForCheck(); } From 1aa1960d45ec5d731a8351663d70154e6e50c2b7 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Thu, 20 Mar 2025 08:03:32 +0100 Subject: [PATCH 4/8] Feature/rename TWR to ROAI (#4464) * Rename TWR to ROAI --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 14477ea9a..ed82ac723 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ Ghostfolio is for you if you are... - ✅ Create, update and delete transactions - ✅ Multi account management -- ✅ Portfolio performance: Time-weighted rate of return (TWR) for `Today`, `WTD`, `MTD`, `YTD`, `1Y`, `5Y`, `Max` +- ✅ Portfolio performance: Return on Average Investment (ROAI) for `Today`, `WTD`, `MTD`, `YTD`, `1Y`, `5Y`, `Max` - ✅ Various charts - ✅ Static analysis to identify potential risks in your portfolio - ✅ Import and export transactions From d8b305a343720cd07f618e64722ecf1119ea429e Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Thu, 20 Mar 2025 08:04:02 +0100 Subject: [PATCH 5/8] Feature/add Storybook to sitemap.xml (#4452) * Add Storybook * Update changelog --- CHANGELOG.md | 1 + apps/api/src/assets/sitemap.xml | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f58b23f8..4d24ce5d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Added support for filtering in the _Copy AI prompt to clipboard_ actions on the analysis page (experimental) +- Added the _Storybook_ path to the `sitemap.xml` file ### Changed diff --git a/apps/api/src/assets/sitemap.xml b/apps/api/src/assets/sitemap.xml index a422ff31a..fc1e89dba 100644 --- a/apps/api/src/assets/sitemap.xml +++ b/apps/api/src/assets/sitemap.xml @@ -92,6 +92,10 @@ https://ghostfol.io/de/ueber-uns/oss-friends ${currentDate}T00:00:00+00:00 + + https://ghostfol.io/development/storybook + ${currentDate}T00:00:00+00:00 + https://ghostfol.io/en ${currentDate}T00:00:00+00:00 From 150d97bd420c1a480b7658df34eed05be8aaa28c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 21 Mar 2025 20:40:59 +0100 Subject: [PATCH 6/8] Feature/update locales (#4463) Co-authored-by: github-actions[bot] --- apps/client/src/locales/messages.ca.xlf | 10 +++++----- apps/client/src/locales/messages.de.xlf | 10 +++++----- apps/client/src/locales/messages.es.xlf | 10 +++++----- apps/client/src/locales/messages.fr.xlf | 10 +++++----- apps/client/src/locales/messages.it.xlf | 10 +++++----- apps/client/src/locales/messages.nl.xlf | 10 +++++----- apps/client/src/locales/messages.pl.xlf | 10 +++++----- apps/client/src/locales/messages.pt.xlf | 10 +++++----- apps/client/src/locales/messages.tr.xlf | 10 +++++----- apps/client/src/locales/messages.uk.xlf | 10 +++++----- apps/client/src/locales/messages.xlf | 10 +++++----- apps/client/src/locales/messages.zh.xlf | 10 +++++----- 12 files changed, 60 insertions(+), 60 deletions(-) diff --git a/apps/client/src/locales/messages.ca.xlf b/apps/client/src/locales/messages.ca.xlf index f83df8770..52a1a1dac 100644 --- a/apps/client/src/locales/messages.ca.xlf +++ b/apps/client/src/locales/messages.ca.xlf @@ -2475,7 +2475,7 @@ apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 160 + 159 @@ -3343,7 +3343,7 @@ Auto apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 40 + 39 @@ -3351,7 +3351,7 @@ Do you really want to close your Ghostfolio account? apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 175 + 174 @@ -3359,7 +3359,7 @@ Do you really want to remove this sign in method? apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 249 + 248 @@ -3367,7 +3367,7 @@ Oops! There was an error setting up biometric authentication. apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 303 + 302 diff --git a/apps/client/src/locales/messages.de.xlf b/apps/client/src/locales/messages.de.xlf index d8ee071f5..49495d26e 100644 --- a/apps/client/src/locales/messages.de.xlf +++ b/apps/client/src/locales/messages.de.xlf @@ -1022,7 +1022,7 @@ apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 160 + 159 @@ -1662,7 +1662,7 @@ Möchtest du diese Anmeldemethode wirklich löschen? apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 249 + 248 @@ -2906,7 +2906,7 @@ Automatisch apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 40 + 39 @@ -6603,7 +6603,7 @@ Möchtest du dieses Ghostfolio Konto wirklich schliessen? apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 175 + 174 @@ -6651,7 +6651,7 @@ Ups! Beim Einrichten der biometrischen Authentifizierung ist ein Fehler aufgetreten. apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 303 + 302 diff --git a/apps/client/src/locales/messages.es.xlf b/apps/client/src/locales/messages.es.xlf index 5b9c5dbef..2997331e2 100644 --- a/apps/client/src/locales/messages.es.xlf +++ b/apps/client/src/locales/messages.es.xlf @@ -1023,7 +1023,7 @@ apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 160 + 159 @@ -1663,7 +1663,7 @@ ¿Estás seguro de eliminar este método de acceso? apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 249 + 248 @@ -2907,7 +2907,7 @@ Automático apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 40 + 39 @@ -6604,7 +6604,7 @@ ¿Estás seguro de querer borrar tu cuenta de Ghostfolio? apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 175 + 174 @@ -6652,7 +6652,7 @@ Oops! There was an error setting up biometric authentication. apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 303 + 302 diff --git a/apps/client/src/locales/messages.fr.xlf b/apps/client/src/locales/messages.fr.xlf index 2b61e3ed1..3819bc98d 100644 --- a/apps/client/src/locales/messages.fr.xlf +++ b/apps/client/src/locales/messages.fr.xlf @@ -1334,7 +1334,7 @@ apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 160 + 159 @@ -1878,7 +1878,7 @@ Auto apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 40 + 39 @@ -1918,7 +1918,7 @@ Voulez-vous vraiment supprimer cette méthode de connexion ? apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 249 + 248 @@ -6603,7 +6603,7 @@ Confirmer la suppresion de votre compte Ghostfolio ? apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 175 + 174 @@ -6651,7 +6651,7 @@ Oops! Une erreur s'est produite lors de la configuration de l'authentification biométrique. apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 303 + 302 diff --git a/apps/client/src/locales/messages.it.xlf b/apps/client/src/locales/messages.it.xlf index 3d12719eb..257f8f68a 100644 --- a/apps/client/src/locales/messages.it.xlf +++ b/apps/client/src/locales/messages.it.xlf @@ -1023,7 +1023,7 @@ apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 160 + 159 @@ -1663,7 +1663,7 @@ Vuoi davvero rimuovere questo metodo di accesso? apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 249 + 248 @@ -2907,7 +2907,7 @@ Auto apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 40 + 39 @@ -6604,7 +6604,7 @@ Confermi di voler chiudere il tuo account Ghostfolio? apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 175 + 174 @@ -6652,7 +6652,7 @@ Ops! C'è stato un errore impostando l'autenticazione biometrica. apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 303 + 302 diff --git a/apps/client/src/locales/messages.nl.xlf b/apps/client/src/locales/messages.nl.xlf index fa29621a5..00341b16c 100644 --- a/apps/client/src/locales/messages.nl.xlf +++ b/apps/client/src/locales/messages.nl.xlf @@ -1022,7 +1022,7 @@ apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 160 + 159 @@ -1662,7 +1662,7 @@ Wil je deze aanmeldingsmethode echt verwijderen? apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 249 + 248 @@ -2906,7 +2906,7 @@ Automatisch apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 40 + 39 @@ -6603,7 +6603,7 @@ Do you really want to close your Ghostfolio account? apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 175 + 174 @@ -6651,7 +6651,7 @@ Oops! There was an error setting up biometric authentication. apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 303 + 302 diff --git a/apps/client/src/locales/messages.pl.xlf b/apps/client/src/locales/messages.pl.xlf index e6e89741d..aaed78ea7 100644 --- a/apps/client/src/locales/messages.pl.xlf +++ b/apps/client/src/locales/messages.pl.xlf @@ -2287,7 +2287,7 @@ apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 160 + 159 @@ -3075,7 +3075,7 @@ Auto apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 40 + 39 @@ -3083,7 +3083,7 @@ Czy na pewno chcesz usunąć tą metode logowania? apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 249 + 248 @@ -6603,7 +6603,7 @@ Czy na pewno chcesz zamknąć swoje konto Ghostfolio? apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 175 + 174 @@ -6651,7 +6651,7 @@ Ups! Wystąpił błąd podczas konfigurowania uwierzytelniania biometrycznego. apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 303 + 302 diff --git a/apps/client/src/locales/messages.pt.xlf b/apps/client/src/locales/messages.pt.xlf index 5676461ed..5fe949db4 100644 --- a/apps/client/src/locales/messages.pt.xlf +++ b/apps/client/src/locales/messages.pt.xlf @@ -1206,7 +1206,7 @@ apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 160 + 159 @@ -1862,7 +1862,7 @@ Auto apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 40 + 39 @@ -1902,7 +1902,7 @@ Deseja realmente remover este método de início de sessão? apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 249 + 248 @@ -6603,7 +6603,7 @@ Do you really want to close your Ghostfolio account? apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 175 + 174 @@ -6651,7 +6651,7 @@ Oops! There was an error setting up biometric authentication. apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 303 + 302 diff --git a/apps/client/src/locales/messages.tr.xlf b/apps/client/src/locales/messages.tr.xlf index f9e2bfd9b..2e385d887 100644 --- a/apps/client/src/locales/messages.tr.xlf +++ b/apps/client/src/locales/messages.tr.xlf @@ -2135,7 +2135,7 @@ apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 160 + 159 @@ -4895,7 +4895,7 @@ Otomatik apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 40 + 39 @@ -4935,7 +4935,7 @@ Bu giriş yöntemini kaldırmayı gerçekten istiyor musunuz? apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 249 + 248 @@ -6603,7 +6603,7 @@ Do you really want to close your Ghostfolio account? apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 175 + 174 @@ -6651,7 +6651,7 @@ Oops! There was an error setting up biometric authentication. apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 303 + 302 diff --git a/apps/client/src/locales/messages.uk.xlf b/apps/client/src/locales/messages.uk.xlf index 2c13d1ef7..b2dc82d73 100644 --- a/apps/client/src/locales/messages.uk.xlf +++ b/apps/client/src/locales/messages.uk.xlf @@ -2595,7 +2595,7 @@ apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 160 + 159 @@ -3591,7 +3591,7 @@ Автоматичний apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 40 + 39 @@ -3599,7 +3599,7 @@ Ви дійсно хочете закрити ваш обліковий запис Ghostfolio? apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 175 + 174 @@ -3607,7 +3607,7 @@ Ви дійсно хочете вилучити цей спосіб входу? apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 249 + 248 @@ -3615,7 +3615,7 @@ Упс! Виникла помилка під час налаштування біометричної автентифікації. apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 303 + 302 diff --git a/apps/client/src/locales/messages.xlf b/apps/client/src/locales/messages.xlf index 778195c24..417df8c83 100644 --- a/apps/client/src/locales/messages.xlf +++ b/apps/client/src/locales/messages.xlf @@ -2152,7 +2152,7 @@ apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 160 + 159 @@ -2864,14 +2864,14 @@ Auto apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 40 + 39 Do you really want to remove this sign in method? apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 249 + 248 @@ -6009,7 +6009,7 @@ Do you really want to close your Ghostfolio account? apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 175 + 174 @@ -6044,7 +6044,7 @@ Oops! There was an error setting up biometric authentication. apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 303 + 302 diff --git a/apps/client/src/locales/messages.zh.xlf b/apps/client/src/locales/messages.zh.xlf index 5c1b6bc5b..ca4b21fe0 100644 --- a/apps/client/src/locales/messages.zh.xlf +++ b/apps/client/src/locales/messages.zh.xlf @@ -2296,7 +2296,7 @@ apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 160 + 159 @@ -3084,7 +3084,7 @@ 自动 apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 40 + 39 @@ -3092,7 +3092,7 @@ 您确实要删除此登录方法吗? apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 249 + 248 @@ -6604,7 +6604,7 @@ Do you really want to close your Ghostfolio account? apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 175 + 174 @@ -6652,7 +6652,7 @@ Oops! There was an error setting up biometric authentication. apps/client/src/app/components/user-account-settings/user-account-settings.component.ts - 303 + 302 From 536b000ff926f57d36a9d1d7b0f938af7854a060 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Fri, 21 Mar 2025 20:41:37 +0100 Subject: [PATCH 7/8] Feature/improve Storybook story of fire calculator (#4451) * Add default value for fire wealth --- .../lib/fire-calculator/fire-calculator.component.stories.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/ui/src/lib/fire-calculator/fire-calculator.component.stories.ts b/libs/ui/src/lib/fire-calculator/fire-calculator.component.stories.ts index 0ad868ff9..e4cfa18ea 100644 --- a/libs/ui/src/lib/fire-calculator/fire-calculator.component.stories.ts +++ b/libs/ui/src/lib/fire-calculator/fire-calculator.component.stories.ts @@ -45,7 +45,7 @@ type Story = StoryObj; export const Simple: Story = { args: { currency: 'USD', - fireWealth: 0, + fireWealth: 50000, locale: locale } }; From 198f73db004fc45cf1aca77a6d59acb632da0030 Mon Sep 17 00:00:00 2001 From: csehatt741 <77381875+csehatt741@users.noreply.github.com> Date: Fri, 21 Mar 2025 20:58:47 +0100 Subject: [PATCH 8/8] Feature/improve export by applying filters on accounts and tags (#4425) * Improve export by applying filters on accounts and tags * Update changelog --------- Co-authored-by: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> --- CHANGELOG.md | 1 + apps/api/src/app/export/export.controller.ts | 3 +- apps/api/src/app/export/export.service.ts | 96 +++++++++++--------- 3 files changed, 58 insertions(+), 42 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d24ce5d6..80f831119 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 +- Improved the export functionality by applying filters on accounts and tags - Improved the symbol validation in the _Yahoo Finance_ service (get asset profiles) - Refactored `lodash.uniq` with `Array.from(new Set(...))` - Refreshed the cryptocurrencies list diff --git a/apps/api/src/app/export/export.controller.ts b/apps/api/src/app/export/export.controller.ts index 551b3e489..d807132c9 100644 --- a/apps/api/src/app/export/export.controller.ts +++ b/apps/api/src/app/export/export.controller.ts @@ -21,10 +21,11 @@ export class ExportController { @UseGuards(AuthGuard('jwt'), HasPermissionGuard) public async export( @Query('accounts') filterByAccounts?: string, - @Query('activityIds') activityIds?: string[], + @Query('activityIds') filterByActivityIds?: string, @Query('assetClasses') filterByAssetClasses?: string, @Query('tags') filterByTags?: string ): Promise { + const activityIds = filterByActivityIds?.split(',') ?? []; const filters = this.apiService.buildFiltersFromQueryParams({ filterByAccounts, filterByAssetClasses, diff --git a/apps/api/src/app/export/export.service.ts b/apps/api/src/app/export/export.service.ts index 8b9d2c56c..f0449dc14 100644 --- a/apps/api/src/app/export/export.service.ts +++ b/apps/api/src/app/export/export.service.ts @@ -28,6 +28,22 @@ export class ExportService { }): Promise { const platformsMap: { [platformId: string]: Platform } = {}; + let { activities } = await this.orderService.getOrders({ + filters, + userCurrency, + userId, + includeDrafts: true, + sortColumn: 'date', + sortDirection: 'asc', + withExcludedAccounts: true + }); + + if (activityIds?.length > 0) { + activities = activities.filter(({ id }) => { + return activityIds.includes(id); + }); + } + const accounts = ( await this.accountService.accounts({ include: { @@ -39,57 +55,55 @@ export class ExportService { }, where: { userId } }) - ).map( - ({ - balance, - balances, - comment, - currency, - id, - isExcluded, - name, - Platform: platform, - platformId - }) => { - if (platformId) { - platformsMap[platformId] = platform; - } - - return { + ) + .filter(({ id }) => { + return activities.length > 0 + ? activities.some(({ accountId }) => { + return accountId === id; + }) + : true; + }) + .map( + ({ balance, - balances: balances.map(({ date, value }) => { - return { date: date.toISOString(), value }; - }), + balances, comment, currency, id, isExcluded, name, + Platform: platform, platformId - }; - } - ); - - let { activities } = await this.orderService.getOrders({ - filters, - userCurrency, - userId, - includeDrafts: true, - sortColumn: 'date', - sortDirection: 'asc', - withExcludedAccounts: true - }); + }) => { + if (platformId) { + platformsMap[platformId] = platform; + } - if (activityIds) { - activities = activities.filter((activity) => { - return activityIds.includes(activity.id); - }); - } + return { + balance, + balances: balances.map(({ date, value }) => { + return { date: date.toISOString(), value }; + }), + comment, + currency, + id, + isExcluded, + name, + platformId + }; + } + ); const tags = (await this.tagService.getTagsForUser(userId)) - .filter(({ isUsed }) => { - return isUsed; - }) + .filter( + ({ id, isUsed }) => + isUsed && + activities.some((activity) => { + return activity.tags.some(({ id: tagId }) => { + return tagId === id; + }); + }) + ) .map(({ id, name }) => { return { id,