diff --git a/CHANGELOG.md b/CHANGELOG.md index c3cf5040d..17dbe58cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,8 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Added + +- Added the user interface for received access from others + ### Changed +- Improved the language localization for German (`de`) - Upgraded the _Stripe_ dependencies - Upgraded `angular` from version `18.2.8` to `19.0.5` - Upgraded `husky` from version `9.1.6` to `9.1.7` diff --git a/apps/api/src/app/user/user.service.ts b/apps/api/src/app/user/user.service.ts index bac6ed19b..33e9a67da 100644 --- a/apps/api/src/app/user/user.service.ts +++ b/apps/api/src/app/user/user.service.ts @@ -89,6 +89,7 @@ export class UserService { }), this.tagService.getTagsForUser(id) ]); + const access = userData[0]; const firstActivity = userData[1]; let tags = userData[2]; @@ -119,7 +120,8 @@ export class UserService { access: access.map((accessItem) => { return { alias: accessItem.alias, - id: accessItem.id + id: accessItem.id, + permissions: accessItem.permissions }; }), accounts: Account, diff --git a/apps/client/src/app/components/admin-settings/admin-settings.component.ts b/apps/client/src/app/components/admin-settings/admin-settings.component.ts index 4c6e7662e..be077c0e6 100644 --- a/apps/client/src/app/components/admin-settings/admin-settings.component.ts +++ b/apps/client/src/app/components/admin-settings/admin-settings.component.ts @@ -101,7 +101,8 @@ export class AdminSettingsComponent implements OnDestroy, OnInit { autoFocus: false, data: { deviceType: this.deviceType, - pricingUrl: this.pricingUrl + pricingUrl: this.pricingUrl, + user: this.user }, height: this.deviceType === 'mobile' ? '98vh' : undefined, width: this.deviceType === 'mobile' ? '100vw' : '50rem' diff --git a/apps/client/src/app/components/admin-settings/ghostfolio-premium-api-dialog/ghostfolio-premium-api-dialog.html b/apps/client/src/app/components/admin-settings/ghostfolio-premium-api-dialog/ghostfolio-premium-api-dialog.html index f2f753750..ac777ffda 100644 --- a/apps/client/src/app/components/admin-settings/ghostfolio-premium-api-dialog/ghostfolio-premium-api-dialog.html +++ b/apps/client/src/app/components/admin-settings/ghostfolio-premium-api-dialog/ghostfolio-premium-api-dialog.html @@ -31,17 +31,19 @@ mat-flat-button >Notify me -
- or -
- + @if (data.user?.settings?.isExperimentalFeatures) { +
+ or +
+ + } diff --git a/apps/client/src/app/components/admin-settings/ghostfolio-premium-api-dialog/interfaces/interfaces.ts b/apps/client/src/app/components/admin-settings/ghostfolio-premium-api-dialog/interfaces/interfaces.ts index 0c629599e..157a6f414 100644 --- a/apps/client/src/app/components/admin-settings/ghostfolio-premium-api-dialog/interfaces/interfaces.ts +++ b/apps/client/src/app/components/admin-settings/ghostfolio-premium-api-dialog/interfaces/interfaces.ts @@ -1,4 +1,7 @@ +import { User } from '@ghostfolio/common/interfaces'; + export interface GhostfolioPremiumApiDialogParams { deviceType: string; pricingUrl: string; + user: User; } diff --git a/apps/client/src/app/components/user-account-access/user-account-access.component.ts b/apps/client/src/app/components/user-account-access/user-account-access.component.ts index 7c4033242..6f111f456 100644 --- a/apps/client/src/app/components/user-account-access/user-account-access.component.ts +++ b/apps/client/src/app/components/user-account-access/user-account-access.component.ts @@ -28,7 +28,8 @@ import { CreateOrUpdateAccessDialog } from './create-or-update-access-dialog/cre standalone: false }) export class UserAccountAccessComponent implements OnDestroy, OnInit { - public accesses: Access[]; + public accessesGet: Access[]; + public accessesGive: Access[]; public deviceType: string; public hasPermissionToCreateAccess: boolean; public hasPermissionToDeleteAccess: boolean; @@ -126,11 +127,21 @@ export class UserAccountAccessComponent implements OnDestroy, OnInit { } private update() { + this.accessesGet = this.user.access.map(({ alias, id, permissions }) => { + return { + alias, + id, + permissions, + grantee: $localize`Me`, + type: 'PRIVATE' + }; + }); + this.dataService .fetchAccesses() .pipe(takeUntil(this.unsubscribeSubject)) .subscribe((accesses) => { - this.accesses = accesses; + this.accessesGive = accesses; this.changeDetectorRef.markForCheck(); }); diff --git a/apps/client/src/app/components/user-account-access/user-account-access.html b/apps/client/src/app/components/user-account-access/user-account-access.html index e5d43cadc..efb918984 100644 --- a/apps/client/src/app/components/user-account-access/user-account-access.html +++ b/apps/client/src/app/components/user-account-access/user-account-access.html @@ -1,14 +1,16 @@
-

+ @if (accessesGet.length > 0) { +

Received Access

+ + } +

Granted Access @if (user?.subscription?.type === 'Basic') { }

Granted Access apps/client/src/app/components/user-account-access/user-account-access.html - 5 + 7 @@ -7616,6 +7616,22 @@ 82 + + Me + Me + + apps/client/src/app/components/user-account-access/user-account-access.component.ts + 134 + + + + Received Access + Received Access + + apps/client/src/app/components/user-account-access/user-account-access.html + 3 + + diff --git a/apps/client/src/locales/messages.de.xlf b/apps/client/src/locales/messages.de.xlf index 561bdea3a..2a49abfb3 100644 --- a/apps/client/src/locales/messages.de.xlf +++ b/apps/client/src/locales/messages.de.xlf @@ -1815,10 +1815,10 @@ Granted Access - Zugangsberechtigung + Gewährte Zugangsberechtigung apps/client/src/app/components/user-account-access/user-account-access.html - 5 + 7 @@ -7616,6 +7616,22 @@ 82 + + Me + Ich + + apps/client/src/app/components/user-account-access/user-account-access.component.ts + 134 + + + + Received Access + Erhaltene Zugangsberechtigung + + apps/client/src/app/components/user-account-access/user-account-access.html + 3 + + diff --git a/apps/client/src/locales/messages.es.xlf b/apps/client/src/locales/messages.es.xlf index f4eecb92d..4eb127ccc 100644 --- a/apps/client/src/locales/messages.es.xlf +++ b/apps/client/src/locales/messages.es.xlf @@ -1819,7 +1819,7 @@ Acceso concedido apps/client/src/app/components/user-account-access/user-account-access.html - 5 + 7 @@ -7617,6 +7617,22 @@ 82 + + Me + Me + + apps/client/src/app/components/user-account-access/user-account-access.component.ts + 134 + + + + Received Access + Received Access + + apps/client/src/app/components/user-account-access/user-account-access.html + 3 + + diff --git a/apps/client/src/locales/messages.fr.xlf b/apps/client/src/locales/messages.fr.xlf index ee90ad9aa..a01b96513 100644 --- a/apps/client/src/locales/messages.fr.xlf +++ b/apps/client/src/locales/messages.fr.xlf @@ -2174,7 +2174,7 @@ Accès donné apps/client/src/app/components/user-account-access/user-account-access.html - 5 + 7 @@ -7616,6 +7616,22 @@ 82 + + Me + Me + + apps/client/src/app/components/user-account-access/user-account-access.component.ts + 134 + + + + Received Access + Received Access + + apps/client/src/app/components/user-account-access/user-account-access.html + 3 + + diff --git a/apps/client/src/locales/messages.it.xlf b/apps/client/src/locales/messages.it.xlf index aafcc1b51..172909d0d 100644 --- a/apps/client/src/locales/messages.it.xlf +++ b/apps/client/src/locales/messages.it.xlf @@ -1819,7 +1819,7 @@ Accesso concesso apps/client/src/app/components/user-account-access/user-account-access.html - 5 + 7 @@ -7617,6 +7617,22 @@ 82 + + Me + Me + + apps/client/src/app/components/user-account-access/user-account-access.component.ts + 134 + + + + Received Access + Received Access + + apps/client/src/app/components/user-account-access/user-account-access.html + 3 + + diff --git a/apps/client/src/locales/messages.nl.xlf b/apps/client/src/locales/messages.nl.xlf index 8d91118f0..b13e4d66e 100644 --- a/apps/client/src/locales/messages.nl.xlf +++ b/apps/client/src/locales/messages.nl.xlf @@ -1818,7 +1818,7 @@ Verleende toegang apps/client/src/app/components/user-account-access/user-account-access.html - 5 + 7 @@ -7616,6 +7616,22 @@ 82 + + Me + Me + + apps/client/src/app/components/user-account-access/user-account-access.component.ts + 134 + + + + Received Access + Received Access + + apps/client/src/app/components/user-account-access/user-account-access.html + 3 + + diff --git a/apps/client/src/locales/messages.pl.xlf b/apps/client/src/locales/messages.pl.xlf index 223c8a57f..06b42b64d 100644 --- a/apps/client/src/locales/messages.pl.xlf +++ b/apps/client/src/locales/messages.pl.xlf @@ -3031,7 +3031,7 @@ Przyznano dostęp apps/client/src/app/components/user-account-access/user-account-access.html - 5 + 7 @@ -3812,7 +3812,7 @@ Ghostfolio is a privacy-first, open source dashboard for your personal finances. Break down your asset allocation, know your net worth and make solid, data-driven investment decisions. - Ghostfolio to zapewniający prywatność, open source'owy panel do zarządzania finansami osobistymi. Przeanalizuj szczegółowo swoją alokację aktywów, określ swoją wartość netto i podejmuj przemyślane decyzje inwestycyjne oparte na danych. + Ghostfolio to zapewniający prywatność, open source'owy panel do zarządzania finansami osobistymi. Przeanalizuj szczegółowo swoją alokację aktywów, określ swoją wartość netto i podejmuj przemyślane decyzje inwestycyjne oparte na danych. apps/client/src/app/pages/landing/landing-page.html 9 @@ -7616,6 +7616,22 @@ 82 + + Me + Me + + apps/client/src/app/components/user-account-access/user-account-access.component.ts + 134 + + + + Received Access + Received Access + + apps/client/src/app/components/user-account-access/user-account-access.html + 3 + + diff --git a/apps/client/src/locales/messages.pt.xlf b/apps/client/src/locales/messages.pt.xlf index bfe9c77b0..3ad4c089e 100644 --- a/apps/client/src/locales/messages.pt.xlf +++ b/apps/client/src/locales/messages.pt.xlf @@ -2122,7 +2122,7 @@ Acesso Concedido apps/client/src/app/components/user-account-access/user-account-access.html - 5 + 7 @@ -7616,6 +7616,22 @@ 82 + + Me + Me + + apps/client/src/app/components/user-account-access/user-account-access.component.ts + 134 + + + + Received Access + Received Access + + apps/client/src/app/components/user-account-access/user-account-access.html + 3 + + diff --git a/apps/client/src/locales/messages.tr.xlf b/apps/client/src/locales/messages.tr.xlf index eea97ae16..5e8a124eb 100644 --- a/apps/client/src/locales/messages.tr.xlf +++ b/apps/client/src/locales/messages.tr.xlf @@ -5171,7 +5171,7 @@ xErişim İzni Verildi apps/client/src/app/components/user-account-access/user-account-access.html - 5 + 7 @@ -7616,6 +7616,22 @@ 82 + + Me + Me + + apps/client/src/app/components/user-account-access/user-account-access.component.ts + 134 + + + + Received Access + Received Access + + apps/client/src/app/components/user-account-access/user-account-access.html + 3 + + diff --git a/apps/client/src/locales/messages.xlf b/apps/client/src/locales/messages.xlf index 1e4fa6cdc..d94fa1090 100644 --- a/apps/client/src/locales/messages.xlf +++ b/apps/client/src/locales/messages.xlf @@ -2832,7 +2832,7 @@ Granted Access apps/client/src/app/components/user-account-access/user-account-access.html - 5 + 7 @@ -6891,6 +6891,20 @@ 82 + + Received Access + + apps/client/src/app/components/user-account-access/user-account-access.html + 3 + + + + Me + + apps/client/src/app/components/user-account-access/user-account-access.component.ts + 134 + + diff --git a/apps/client/src/locales/messages.zh.xlf b/apps/client/src/locales/messages.zh.xlf index 0271ddb72..e88e77aec 100644 --- a/apps/client/src/locales/messages.zh.xlf +++ b/apps/client/src/locales/messages.zh.xlf @@ -3048,7 +3048,7 @@ 授予访问权限 apps/client/src/app/components/user-account-access/user-account-access.html - 5 + 7 @@ -7617,6 +7617,22 @@ 82 + + Me + Me + + apps/client/src/app/components/user-account-access/user-account-access.component.ts + 134 + + + + Received Access + Received Access + + apps/client/src/app/components/user-account-access/user-account-access.html + 3 + + diff --git a/libs/common/src/lib/interfaces/user.interface.ts b/libs/common/src/lib/interfaces/user.interface.ts index 647822d34..667e59fd8 100644 --- a/libs/common/src/lib/interfaces/user.interface.ts +++ b/libs/common/src/lib/interfaces/user.interface.ts @@ -1,17 +1,14 @@ import { SubscriptionOfferKey } from '@ghostfolio/common/types'; import { SubscriptionType } from '@ghostfolio/common/types/subscription-type.type'; -import { Account, Tag } from '@prisma/client'; +import { Access, Account, Tag } from '@prisma/client'; import { SystemMessage } from './system-message.interface'; import { UserSettings } from './user-settings.interface'; // TODO: Compare with UserWithSettings export interface User { - access: { - alias?: string; - id: string; - }[]; + access: Pick[]; accounts: Account[]; dateOfFirstActivity: Date; id: string;