Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍
TypeScript angularetffinancefintechghostfoliohacktoberfestinvestingnestjsosspersonal-financeportfolioprismasoftwarestocktrackertradingtypescriptwealth-managementweb
Bugfix/handling of Exclude from Analysis tag in activities table (#7511)
Thomas Kaulfa309b57435d
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 054a24bdf3..1118f2a692 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0### Fixed+- Fixed the handling of the _Exclude from Analysis_ tag in the activities table- Resolved a validation error caused by empty strings in the asset profile details dialog of the admin control panel## 3.39.0 - 2026-08-01diff --git a/libs/common/src/lib/helper.spec.ts b/libs/common/src/lib/helper.spec.tsindex 7589347240..c4947394f6 100644--- a/libs/common/src/lib/helper.spec.ts+++ b/libs/common/src/lib/helper.spec.ts@@ -1,8 +1,13 @@+import {+ TAG_ID_EMERGENCY_FUND,+ TAG_ID_EXCLUDE_FROM_ANALYSIS+} from '@ghostfolio/common/config';import {extractNumberFromString,getNumberFormatGroup,getStringOrNull,getStringOrUndefined,+ isAccountExcluded,isCurrency,isCurrencySymbol} from '@ghostfolio/common/helper';@@ -197,6 +202,28 @@ describe('Helper', () => {});});+ describe('Is account excluded', () => {+ it('Account with Exclude from Analysis tag', () => {+ expect(+ isAccountExcluded({ tags: [{ id: TAG_ID_EXCLUDE_FROM_ANALYSIS }] })+ ).toEqual(true);+ });++ it('Account with another tag', () => {+ expect(+ isAccountExcluded({ tags: [{ id: TAG_ID_EMERGENCY_FUND }] })+ ).toEqual(false);+ });++ it('Account without tags', () => {+ expect(isAccountExcluded({ tags: [] })).toEqual(false);+ });++ it('Undefined account', () => {+ expect(isAccountExcluded(undefined)).toEqual(false);+ });+ });+describe('Is currency', () => {it('ISO 4217 currency code', () => {expect(isCurrency('USD')).toEqual(true);diff --git a/libs/common/src/lib/helper.ts b/libs/common/src/lib/helper.tsindex 7e482838c0..58927337ee 100644--- a/libs/common/src/lib/helper.ts+++ b/libs/common/src/lib/helper.ts@@ -476,9 +476,9 @@ export function interpolate(template: string, context: any) {});}-export function isAccountExcluded(account: { tags?: { id: string }[] }) {+export function isAccountExcluded(account?: { tags?: { id: string }[] }) {return (- account.tags?.some(({ id }) => {+ account?.tags?.some(({ id }) => {return id === TAG_ID_EXCLUDE_FROM_ANALYSIS;}) === true);diff --git a/libs/ui/src/lib/activities-table/activities-table.component.ts b/libs/ui/src/lib/activities-table/activities-table.component.tsindex 6fac6d1625..7252b00740 100644--- a/libs/ui/src/lib/activities-table/activities-table.component.ts+++ b/libs/ui/src/lib/activities-table/activities-table.component.ts@@ -298,7 +298,7 @@ export class GfActivitiesTableComponent implements AfterViewInit, OnInit {public isExcludedFromAnalysis(activity: Activity) {return (- (activity.account && isAccountExcluded(activity.account)) ??+ isAccountExcluded(activity.account) ||activity.tags?.some(({ id }) => {return id === TAG_ID_EXCLUDE_FROM_ANALYSIS;}) === true