From 77255df4be2ee2f39ab40c4071dece6d22bc489d Mon Sep 17 00:00:00 2001 From: Thomas <4159106+dtslvr@users.noreply.github.com> Date: Tue, 18 May 2021 19:36:24 +0200 Subject: [PATCH] Feature/disable base currency selector for demo user (#104) * Disable base currency selector based on permission * Update changelog --- CHANGELOG.md | 1 + apps/client/src/app/pages/account/account-page.component.ts | 6 ++++++ apps/client/src/app/pages/account/account-page.html | 1 + 3 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6bbb662a4..a59223393 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 _Ghostfolio Account_ to _My Ghostfolio_ - Hid unknown exchange in the position overview +- Disable the base currency selector for the demo user - Refactored the portfolio unit tests to work without database - Renamed shared helper to `@ghostfolio/common/helper` - Moved shared interfaces to `@ghostfolio/common/interfaces` diff --git a/apps/client/src/app/pages/account/account-page.component.ts b/apps/client/src/app/pages/account/account-page.component.ts index d933691b1..957b4007c 100644 --- a/apps/client/src/app/pages/account/account-page.component.ts +++ b/apps/client/src/app/pages/account/account-page.component.ts @@ -19,6 +19,7 @@ export class AccountPageComponent implements OnDestroy, OnInit { public currencies: Currency[] = []; public defaultDateFormat = DEFAULT_DATE_FORMAT; public hasPermissionForSubscription: boolean; + public hasPermissionToUpdateUserSettings: boolean; public user: User; private unsubscribeSubject = new Subject(); @@ -50,6 +51,11 @@ export class AccountPageComponent implements OnDestroy, OnInit { this.dataService.fetchUser().subscribe((user) => { this.user = user; + this.hasPermissionToUpdateUserSettings = hasPermission( + this.user.permissions, + permissions.updateUserSettings + ); + this.cd.markForCheck(); }); }); diff --git a/apps/client/src/app/pages/account/account-page.html b/apps/client/src/app/pages/account/account-page.html index 1c31fa48d..e5bad92db 100644 --- a/apps/client/src/app/pages/account/account-page.html +++ b/apps/client/src/app/pages/account/account-page.html @@ -35,6 +35,7 @@ Base Currency