From 57659d2c04b7f8d9bf529ea2390c0e95a9c42201 Mon Sep 17 00:00:00 2001
From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com>
Date: Fri, 13 Dec 2024 17:13:51 +0100
Subject: [PATCH 1/8] Feature/add missing public keywords (#4102)
* Add public keyword
---
.../create-or-update-access-dialog.component.ts | 2 +-
apps/client/src/app/core/auth.guard.ts | 2 +-
apps/client/src/app/pages/webauthn/webauthn-page.component.ts | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/apps/client/src/app/components/user-account-access/create-or-update-access-dialog/create-or-update-access-dialog.component.ts b/apps/client/src/app/components/user-account-access/create-or-update-access-dialog/create-or-update-access-dialog.component.ts
index 5bb6ca3e5..727263718 100644
--- a/apps/client/src/app/components/user-account-access/create-or-update-access-dialog/create-or-update-access-dialog.component.ts
+++ b/apps/client/src/app/components/user-account-access/create-or-update-access-dialog/create-or-update-access-dialog.component.ts
@@ -38,7 +38,7 @@ export class CreateOrUpdateAccessDialog implements OnDestroy {
private notificationService: NotificationService
) {}
- ngOnInit() {
+ public ngOnInit() {
this.accessForm = this.formBuilder.group({
alias: [this.data.access.alias],
permissions: [this.data.access.permissions[0], Validators.required],
diff --git a/apps/client/src/app/core/auth.guard.ts b/apps/client/src/app/core/auth.guard.ts
index 548d36473..7a75728ca 100644
--- a/apps/client/src/app/core/auth.guard.ts
+++ b/apps/client/src/app/core/auth.guard.ts
@@ -29,7 +29,7 @@ export class AuthGuard {
`/${paths.resources}`
];
- constructor(
+ public constructor(
private dataService: DataService,
private router: Router,
private settingsStorageService: SettingsStorageService,
diff --git a/apps/client/src/app/pages/webauthn/webauthn-page.component.ts b/apps/client/src/app/pages/webauthn/webauthn-page.component.ts
index 41860014a..77a053258 100644
--- a/apps/client/src/app/pages/webauthn/webauthn-page.component.ts
+++ b/apps/client/src/app/pages/webauthn/webauthn-page.component.ts
@@ -22,7 +22,7 @@ export class GfWebauthnPageComponent implements OnDestroy, OnInit {
private unsubscribeSubject = new Subject();
- constructor(
+ public constructor(
private changeDetectorRef: ChangeDetectorRef,
private router: Router,
private tokenStorageService: TokenStorageService,
From de6884184388c352450f102957e3340f679b3f3e Mon Sep 17 00:00:00 2001
From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com>
Date: Sat, 14 Dec 2024 10:43:35 +0100
Subject: [PATCH 2/8] Feature/add user id to symbol profile database schema
(#4122)
* Add userId to SymbolProfile database schema
* Update changelog
---
CHANGELOG.md | 6 ++++++
apps/api/src/app/import/import.service.ts | 10 ++++++----
apps/api/src/app/order/order.service.ts | 3 ++-
.../migration.sql | 15 +++++++++++++++
prisma/schema.prisma | 17 ++++++++++-------
5 files changed, 39 insertions(+), 12 deletions(-)
create mode 100644 prisma/migrations/20241214091912_added_user_to_symbol_profile/migration.sql
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 42f400bcc..9aebc76a4 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
+
+### Added
+
+- Added `userId` to the `SymbolProfile` database schema
+
## 2.128.0 - 2024-12-12
### Changed
diff --git a/apps/api/src/app/import/import.service.ts b/apps/api/src/app/import/import.service.ts
index e51696b56..3b7290b43 100644
--- a/apps/api/src/app/import/import.service.ts
+++ b/apps/api/src/app/import/import.service.ts
@@ -224,7 +224,7 @@ export class ImportService {
for (const activity of activitiesDto) {
if (!activity.dataSource) {
- if (activity.type === 'ITEM' || activity.type === 'LIABILITY') {
+ if (['FEE', 'INTEREST', 'ITEM', 'LIABILITY'].includes(activity.type)) {
activity.dataSource = DataSource.MANUAL;
} else {
activity.dataSource =
@@ -356,6 +356,7 @@ export class ImportService {
quantity,
type,
unitPrice,
+ Account: validatedAccount,
accountId: validatedAccount?.id,
accountUserId: undefined,
createdAt: new Date(),
@@ -380,10 +381,10 @@ export class ImportService {
symbolMapping,
updatedAt,
url,
+ comment: assetProfile.comment,
currency: assetProfile.currency,
- comment: assetProfile.comment
+ userId: dataSource === 'MANUAL' ? user.id : undefined
},
- Account: validatedAccount,
symbolProfileId: undefined,
updatedAt: new Date(),
userId: user.id
@@ -406,7 +407,8 @@ export class ImportService {
create: {
dataSource,
symbol,
- currency: assetProfile.currency
+ currency: assetProfile.currency,
+ userId: dataSource === 'MANUAL' ? user.id : undefined
},
where: {
dataSource_symbol: {
diff --git a/apps/api/src/app/order/order.service.ts b/apps/api/src/app/order/order.service.ts
index 5613adc5c..129f3d8a9 100644
--- a/apps/api/src/app/order/order.service.ts
+++ b/apps/api/src/app/order/order.service.ts
@@ -93,7 +93,7 @@ export class OrderService {
userId: string;
}
): Promise {
- let Account;
+ let Account: Prisma.AccountCreateNestedOneWithoutOrderInput;
if (data.accountId) {
Account = {
@@ -124,6 +124,7 @@ export class OrderService {
data.SymbolProfile.connectOrCreate.create.dataSource = dataSource;
data.SymbolProfile.connectOrCreate.create.name = name;
data.SymbolProfile.connectOrCreate.create.symbol = id;
+ data.SymbolProfile.connectOrCreate.create.userId = userId;
data.SymbolProfile.connectOrCreate.where.dataSource_symbol = {
dataSource,
symbol: id
diff --git a/prisma/migrations/20241214091912_added_user_to_symbol_profile/migration.sql b/prisma/migrations/20241214091912_added_user_to_symbol_profile/migration.sql
new file mode 100644
index 000000000..cbacd405a
--- /dev/null
+++ b/prisma/migrations/20241214091912_added_user_to_symbol_profile/migration.sql
@@ -0,0 +1,15 @@
+-- AlterTable
+ALTER TABLE "SymbolProfile" ADD COLUMN "userId" TEXT;
+
+-- AddForeignKey
+ALTER TABLE "SymbolProfile" ADD CONSTRAINT "SymbolProfile_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
+
+-- Set userIds in SymbolProfile for 'MANUAL' data source
+UPDATE "SymbolProfile"
+SET "userId" = (
+ SELECT "userId"
+ FROM "Order"
+ WHERE "Order"."symbolProfileId" = "SymbolProfile"."id"
+ LIMIT 1
+)
+WHERE "dataSource" = 'MANUAL';
diff --git a/prisma/schema.prisma b/prisma/schema.prisma
index 7df28d694..af9acebaf 100644
--- a/prisma/schema.prisma
+++ b/prisma/schema.prisma
@@ -188,8 +188,10 @@ model SymbolProfile {
symbol String
symbolMapping Json?
url String?
+ userId String?
Order Order[]
SymbolProfileOverrides SymbolProfileOverrides?
+ User User? @relation(fields: [userId], onDelete: Cascade, references: [id])
@@unique([dataSource, symbol])
@@index([assetClass])
@@ -239,14 +241,14 @@ model Tag {
model User {
accessToken String?
authChallenge String?
- createdAt DateTime @default(now())
- id String @id @default(uuid())
- provider Provider @default(ANONYMOUS)
- role Role @default(USER)
+ createdAt DateTime @default(now())
+ id String @id @default(uuid())
+ provider Provider @default(ANONYMOUS)
+ role Role @default(USER)
thirdPartyId String?
- updatedAt DateTime @updatedAt
- Access Access[] @relation("accessGet")
- AccessGive Access[] @relation("accessGive")
+ updatedAt DateTime @updatedAt
+ Access Access[] @relation("accessGet")
+ AccessGive Access[] @relation("accessGive")
Account Account[]
Analytics Analytics?
ApiKey ApiKey[]
@@ -254,6 +256,7 @@ model User {
Order Order[]
Settings Settings?
Subscription Subscription[]
+ SymbolProfile SymbolProfile[]
Tag Tag[]
@@index([accessToken])
From 6ad9661d7faa542bbe6db0ac6cc018a96bf119b8 Mon Sep 17 00:00:00 2001
From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com>
Date: Sat, 14 Dec 2024 11:19:15 +0100
Subject: [PATCH 3/8] Feature/improve language localization for de 20241214
(#4123)
* Update translations
* Update changelog
---
CHANGELOG.md | 4 ++
.../src/app/portfolio/portfolio.controller.ts | 5 ++
apps/client/project.json | 2 +-
.../portfolio/x-ray/x-ray-page.component.html | 4 +-
apps/client/src/locales/messages.ca.xlf | 52 ++++++++++++-------
apps/client/src/locales/messages.de.xlf | 52 ++++++++++++-------
apps/client/src/locales/messages.es.xlf | 52 ++++++++++++-------
apps/client/src/locales/messages.fr.xlf | 52 ++++++++++++-------
apps/client/src/locales/messages.it.xlf | 52 ++++++++++++-------
apps/client/src/locales/messages.nl.xlf | 52 ++++++++++++-------
apps/client/src/locales/messages.pl.xlf | 52 ++++++++++++-------
apps/client/src/locales/messages.pt.xlf | 52 ++++++++++++-------
apps/client/src/locales/messages.tr.xlf | 52 ++++++++++++-------
apps/client/src/locales/messages.xlf | 50 +++++++++++-------
apps/client/src/locales/messages.zh.xlf | 52 ++++++++++++-------
15 files changed, 384 insertions(+), 201 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9aebc76a4..349e62646 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 `userId` to the `SymbolProfile` database schema
+### Changed
+
+- Improved the language localization for German (`de`)
+
## 2.128.0 - 2024-12-12
### Changed
diff --git a/apps/api/src/app/portfolio/portfolio.controller.ts b/apps/api/src/app/portfolio/portfolio.controller.ts
index b15d22268..0e4022969 100644
--- a/apps/api/src/app/portfolio/portfolio.controller.ts
+++ b/apps/api/src/app/portfolio/portfolio.controller.ts
@@ -623,6 +623,11 @@ export class PortfolioController {
report.rules[rule] = [];
}
}
+
+ report.statistics = {
+ rulesActiveCount: 0,
+ rulesFulfilledCount: 0
+ };
}
return report;
diff --git a/apps/client/project.json b/apps/client/project.json
index dd644f8c1..7fd28d5ca 100644
--- a/apps/client/project.json
+++ b/apps/client/project.json
@@ -212,7 +212,7 @@
"extract-i18n": {
"executor": "ng-extract-i18n-merge:ng-extract-i18n-merge",
"options": {
- "browserTarget": "client:build",
+ "buildTarget": "client:build",
"includeContext": true,
"outputPath": "src/locales",
"targetFiles": [
diff --git a/apps/client/src/app/pages/portfolio/x-ray/x-ray-page.component.html b/apps/client/src/app/pages/portfolio/x-ray/x-ray-page.component.html
index 7a0a3512c..37d9c89c4 100644
--- a/apps/client/src/app/pages/portfolio/x-ray/x-ray-page.component.html
+++ b/apps/client/src/app/pages/portfolio/x-ray/x-ray-page.component.html
@@ -19,9 +19,9 @@
/>
} @else {
{{ statistics?.rulesFulfilledCount }}
- of
+ out of
{{ statistics?.rulesActiveCount }}
- rules are currently fulfilled.
+ rules align with your portfolio.
}
diff --git a/apps/client/src/locales/messages.ca.xlf b/apps/client/src/locales/messages.ca.xlf
index d32f8c1ee..6d9fe62e6 100644
--- a/apps/client/src/locales/messages.ca.xlf
+++ b/apps/client/src/locales/messages.ca.xlf
@@ -2619,7 +2619,7 @@
apps/client/src/app/pages/portfolio/x-ray/x-ray-page.component.html
- 88
+ 105
@@ -2991,7 +2991,7 @@
apps/client/src/app/pages/portfolio/x-ray/x-ray-page.component.html
- 12
+ 29
@@ -3207,7 +3207,7 @@
libs/ui/src/lib/assistant/assistant.component.ts
- 223
+ 221
@@ -3219,7 +3219,7 @@
libs/ui/src/lib/assistant/assistant.component.ts
- 233
+ 231
@@ -3231,7 +3231,7 @@
libs/ui/src/lib/assistant/assistant.component.ts
- 237
+ 235
@@ -3243,7 +3243,7 @@
libs/ui/src/lib/assistant/assistant.component.ts
- 259
+ 257
@@ -3255,7 +3255,7 @@
libs/ui/src/lib/assistant/assistant.component.ts
- 262
+ 260
@@ -5255,7 +5255,7 @@
Currency Cluster Risks
apps/client/src/app/pages/portfolio/x-ray/x-ray-page.component.html
- 31
+ 48
@@ -5263,7 +5263,7 @@
Account Cluster Risks
apps/client/src/app/pages/portfolio/x-ray/x-ray-page.component.html
- 50
+ 67
@@ -6059,7 +6059,7 @@
Week to date
libs/ui/src/lib/assistant/assistant.component.ts
- 225
+ 223
@@ -6067,7 +6067,7 @@
WTD
libs/ui/src/lib/assistant/assistant.component.ts
- 225
+ 223
@@ -6075,7 +6075,7 @@
Month to date
libs/ui/src/lib/assistant/assistant.component.ts
- 229
+ 227
@@ -6083,7 +6083,7 @@
MTD
libs/ui/src/lib/assistant/assistant.component.ts
- 229
+ 227
@@ -6091,7 +6091,7 @@
Year to date
libs/ui/src/lib/assistant/assistant.component.ts
- 233
+ 231
@@ -6099,7 +6099,7 @@
year
libs/ui/src/lib/assistant/assistant.component.ts
- 237
+ 235
@@ -6107,7 +6107,7 @@
years
libs/ui/src/lib/assistant/assistant.component.ts
- 259
+ 257
@@ -7047,7 +7047,7 @@
Inactive
apps/client/src/app/pages/portfolio/x-ray/x-ray-page.component.html
- 107
+ 124
@@ -7457,7 +7457,7 @@
Economic Market Cluster Risks
apps/client/src/app/pages/portfolio/x-ray/x-ray-page.component.html
- 69
+ 86
@@ -7584,6 +7584,22 @@
26
+
+ out of
+ out of
+
+ apps/client/src/app/pages/portfolio/x-ray/x-ray-page.component.html
+ 22
+
+
+
+ rules align with your portfolio.
+ rules align with your portfolio.
+
+ apps/client/src/app/pages/portfolio/x-ray/x-ray-page.component.html
+ 24
+
+