Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript đŸ€

Feature/harmonize use of permissions on about and landing page (#2084)

Thomas Kaulb5e2a3aa91f1
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8c7eebdad7..92cd4366b6 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 b054e8d8c7..3eafe89adc 100644
--- a/apps/client/src/app/app.component.html
+++ b/apps/client/src/app/app.component.html
@@ -89,7 +89,7 @@
<li>
<a i18n [routerLink]="['/about', 'license']">License</a>
</li>
- <li *ngIf="hasPermissionForSubscription">
+ <li *ngIf="hasPermissionForStatistics">
<a [routerLink]="['/open']">Open Startup</a>
</li>
<li *ngIf="hasPermissionForSubscription">
diff --git a/apps/client/src/app/app.component.ts b/apps/client/src/app/app.component.ts
index 574cf1f014..6a8a3a64dd 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 460319afe9..9e33985d0c 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 40e0ac036f..870655bccd 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</a
>
- and we share aggregated
- <a title="Open Startup" [routerLink]="['/open']">key metrics</a>
- of the platform’s performance. The project has been initiated by
+ <ng-container *ngIf="hasPermissionForStatistics">
+ and we share aggregated
+ <a title="Open Startup" [routerLink]="['/open']">key metrics</a>
+ of the platform’s performance</ng-container
+ >. The project has been initiated by
<a href="https://dotsilver.ch" title="Website of Thomas Kaul"
>Thomas Kaul</a
>
diff --git a/apps/client/src/app/pages/landing/landing-page.html b/apps/client/src/app/pages/landing/landing-page.html
index 1a463ccb5e..5228c41b26 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 @@
<div *ngIf="hasPermissionForStatistics" class="row mb-5">
<div
- *ngIf="hasPermissionForSubscription"
class="col-md-4 d-flex my-1"
[ngClass]="{ 'justify-content-center': this.deviceType !== 'mobile' }"
>
<a
class="d-block"
title="Ghostfolio in Numbers: Monthly Active Users (MAU)"
- [routerLink]="['/about']"
+ [routerLink]="['/open']"
>
<gf-value
icon="people-outline"
@@ -61,24 +60,6 @@
>
</a>
</div>
- <div
- *ngIf="!hasPermissionForSubscription"
- class="col-md-4 d-flex my-1"
- [ngClass]="{ 'justify-content-center': this.deviceType !== 'mobile' }"
- >
- <a
- class="d-block"
- title="Ghostfolio in Numbers: Contributors on GitHub"
- [routerLink]="['/about']"
- >
- <gf-value
- icon="people-outline"
- size="large"
- [value]="statistics?.gitHubContributors ?? '-'"
- >Contributors on GitHub</gf-value
- >
- </a>
- </div>
<div
class="col-md-4 d-flex my-1"
[ngClass]="{ 'justify-content-center': this.deviceType !== 'mobile' }"
@@ -86,7 +67,7 @@
<a
class="d-block"
title="Ghostfolio in Numbers: Stars on GitHub"
- [routerLink]="['/about']"
+ [routerLink]="['/open']"
>
<gf-value
icon="star-outline"
@@ -103,7 +84,7 @@
<a
class="d-block"
title="Ghostfolio in Numbers: Pulls on Docker Hub"
- [routerLink]="['/about']"
+ [routerLink]="['/open']"
>
<gf-value
icon="cloud-download-outline"