From b5e2a3aa91f113878d265cef164307e76e5b6b8b Mon Sep 17 00:00:00 2001
From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com>
Date: Mon, 19 Jun 2023 20:29:36 +0200
Subject: [PATCH] Feature/harmonize use of permissions on about and landing
page (#2084)
* Harmonize use of permissions
* About page
* Landing page
* About changelog
---
CHANGELOG.md | 2 ++
apps/client/src/app/app.component.html | 2 +-
apps/client/src/app/app.component.ts | 6 +++++
.../overview/about-overview-page.component.ts | 6 +++++
.../about/overview/about-overview-page.html | 8 +++---
.../src/app/pages/landing/landing-page.html | 25 +++----------------
6 files changed, 23 insertions(+), 26 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8c7eebdad..92cd4366b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
+- Harmonized the use of permissions on the about page
+- Harmonized the use of permissions on the landing page
- Improved the language localization for German (`de`)
- Improved the language localization for Portuguese (`pt`)
diff --git a/apps/client/src/app/app.component.html b/apps/client/src/app/app.component.html
index b054e8d8c..3eafe89ad 100644
--- a/apps/client/src/app/app.component.html
+++ b/apps/client/src/app/app.component.html
@@ -89,7 +89,7 @@
License
-
+
Open Startup
diff --git a/apps/client/src/app/app.component.ts b/apps/client/src/app/app.component.ts
index 574cf1f01..6a8a3a64d 100644
--- a/apps/client/src/app/app.component.ts
+++ b/apps/client/src/app/app.component.ts
@@ -33,6 +33,7 @@ export class AppComponent implements OnDestroy, OnInit {
public currentYear = new Date().getFullYear();
public deviceType: string;
public hasPermissionForBlog: boolean;
+ public hasPermissionForStatistics: boolean;
public hasPermissionForSubscription: boolean;
public hasPermissionToAccessFearAndGreedIndex: boolean;
public info: InfoItem;
@@ -70,6 +71,11 @@ export class AppComponent implements OnDestroy, OnInit {
permissions.enableSubscription
);
+ this.hasPermissionForStatistics = hasPermission(
+ this.info?.globalPermissions,
+ permissions.enableStatistics
+ );
+
this.hasPermissionToAccessFearAndGreedIndex = hasPermission(
this.info?.globalPermissions,
permissions.enableFearAndGreedIndex
diff --git a/apps/client/src/app/pages/about/overview/about-overview-page.component.ts b/apps/client/src/app/pages/about/overview/about-overview-page.component.ts
index 460319afe..9e33985d0 100644
--- a/apps/client/src/app/pages/about/overview/about-overview-page.component.ts
+++ b/apps/client/src/app/pages/about/overview/about-overview-page.component.ts
@@ -15,6 +15,7 @@ import { takeUntil } from 'rxjs/operators';
})
export class AboutOverviewPageComponent implements OnDestroy, OnInit {
public hasPermissionForBlog: boolean;
+ public hasPermissionForStatistics: boolean;
public hasPermissionForSubscription: boolean;
public isLoggedIn: boolean;
public user: User;
@@ -34,6 +35,11 @@ export class AboutOverviewPageComponent implements OnDestroy, OnInit {
permissions.enableBlog
);
+ this.hasPermissionForStatistics = hasPermission(
+ globalPermissions,
+ permissions.enableStatistics
+ );
+
this.hasPermissionForSubscription = hasPermission(
globalPermissions,
permissions.enableSubscription
diff --git a/apps/client/src/app/pages/about/overview/about-overview-page.html b/apps/client/src/app/pages/about/overview/about-overview-page.html
index 40e0ac036..870655bcc 100644
--- a/apps/client/src/app/pages/about/overview/about-overview-page.html
+++ b/apps/client/src/app/pages/about/overview/about-overview-page.html
@@ -19,9 +19,11 @@
title="GNU Affero General Public License"
>AGPL-3.0 license
- and we share aggregated
- key metrics
- of the platform’s performance. The project has been initiated by
+
+ and we share aggregated
+ key metrics
+ of the platform’s performance. The project has been initiated by
Thomas Kaul
diff --git a/apps/client/src/app/pages/landing/landing-page.html b/apps/client/src/app/pages/landing/landing-page.html
index 1a463ccb5..5228c41b2 100644
--- a/apps/client/src/app/pages/landing/landing-page.html
+++ b/apps/client/src/app/pages/landing/landing-page.html
@@ -44,14 +44,13 @@