Browse Source

Feature/remove ghostfolio in numbers section from about page (#2029)

* Remove Ghostfolio in Numbers section

* Update changelog
pull/2030/head
Thomas Kaul 2 years ago
committed by GitHub
parent
commit
bd8bb1a36a
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      CHANGELOG.md
  2. 13
      apps/client/src/app/pages/about/about-page.component.ts
  3. 77
      apps/client/src/app/pages/about/about-page.html
  4. 10
      apps/client/src/app/pages/about/about-page.module.ts

6
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/), 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). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## Unreleased
### Changed
- Removed the _Ghostfolio in Numbers_ section from the about page
## 1.275.0 - 2023-05-30 ## 1.275.0 - 2023-05-30
### Changed ### Changed

13
apps/client/src/app/pages/about/about-page.component.ts

@ -3,7 +3,7 @@ import { environment } from '@ghostfolio/client/../environments/environment';
import { DataService } from '@ghostfolio/client/services/data.service'; import { DataService } from '@ghostfolio/client/services/data.service';
import { UserService } from '@ghostfolio/client/services/user/user.service'; import { UserService } from '@ghostfolio/client/services/user/user.service';
import { DEFAULT_LANGUAGE_CODE } from '@ghostfolio/common/config'; import { DEFAULT_LANGUAGE_CODE } from '@ghostfolio/common/config';
import { Statistics, User } from '@ghostfolio/common/interfaces'; import { User } from '@ghostfolio/common/interfaces';
import { hasPermission, permissions } from '@ghostfolio/common/permissions'; import { hasPermission, permissions } from '@ghostfolio/common/permissions';
import { Subject } from 'rxjs'; import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators'; import { takeUntil } from 'rxjs/operators';
@ -17,10 +17,8 @@ import { takeUntil } from 'rxjs/operators';
export class AboutPageComponent implements OnDestroy, OnInit { export class AboutPageComponent implements OnDestroy, OnInit {
public defaultLanguageCode = DEFAULT_LANGUAGE_CODE; public defaultLanguageCode = DEFAULT_LANGUAGE_CODE;
public hasPermissionForBlog: boolean; public hasPermissionForBlog: boolean;
public hasPermissionForStatistics: boolean;
public hasPermissionForSubscription: boolean; public hasPermissionForSubscription: boolean;
public isLoggedIn: boolean; public isLoggedIn: boolean;
public statistics: Statistics;
public user: User; public user: User;
public version = environment.version; public version = environment.version;
@ -31,24 +29,17 @@ export class AboutPageComponent implements OnDestroy, OnInit {
private dataService: DataService, private dataService: DataService,
private userService: UserService private userService: UserService
) { ) {
const { globalPermissions, statistics } = this.dataService.fetchInfo(); const { globalPermissions } = this.dataService.fetchInfo();
this.hasPermissionForBlog = hasPermission( this.hasPermissionForBlog = hasPermission(
globalPermissions, globalPermissions,
permissions.enableBlog permissions.enableBlog
); );
this.hasPermissionForStatistics = hasPermission(
globalPermissions,
permissions.enableStatistics
);
this.hasPermissionForSubscription = hasPermission( this.hasPermissionForSubscription = hasPermission(
globalPermissions, globalPermissions,
permissions.enableSubscription permissions.enableSubscription
); );
this.statistics = statistics;
} }
public ngOnInit() { public ngOnInit() {

77
apps/client/src/app/pages/about/about-page.html

@ -38,7 +38,7 @@
<ng-container *ngIf="version"> <ng-container *ngIf="version">
This instance is running Ghostfolio {{ version }}. This instance is running Ghostfolio {{ version }}.
</ng-container> </ng-container>
<ng-container *ngIf="hasPermissionForStatistics" <ng-container *ngIf="hasPermissionForSubscription"
>Check the system status at >Check the system status at
<a href="https://status.ghostfol.io" title="Ghostfolio Status" <a href="https://status.ghostfol.io" title="Ghostfolio Status"
>status.ghostfol.io</a >status.ghostfol.io</a
@ -134,81 +134,6 @@
</div> </div>
</div> </div>
<div *ngIf="hasPermissionForStatistics" class="mb-5 row">
<div class="col">
<h3 class="mb-3 text-center">Ghostfolio in Numbers</h3>
<mat-card appearance="outlined">
<mat-card-content>
<div class="row">
<div class="col-xs-12 col-md-4 my-2">
<gf-value
size="large"
subLabel="(Last 24 hours)"
[locale]="user?.settings?.locale"
[value]="statistics?.activeUsers1d ?? '-'"
>Active Users</gf-value
>
</div>
<div class="col-xs-12 col-md-4 my-2">
<gf-value
size="large"
subLabel="(Last 30 days)"
[locale]="user?.settings?.locale"
[value]="statistics?.newUsers30d ?? '-'"
>New Users</gf-value
>
</div>
<div class="col-xs-12 col-md-4 my-2">
<gf-value
size="large"
subLabel="(Last 30 days)"
[locale]="user?.settings?.locale"
[value]="statistics?.activeUsers30d ?? '-'"
>Active Users</gf-value
>
</div>
<div class="col-xs-12 col-md-4 my-2">
<a class="d-block" href="https://ghostfolio.slack.com">
<gf-value
size="large"
[locale]="user?.settings?.locale"
[value]="statistics?.slackCommunityUsers ?? '-'"
>Users in Slack community</gf-value
>
</a>
</div>
<div class="col-xs-12 col-md-4 my-2">
<a
class="d-block"
href="https://github.com/ghostfolio/ghostfolio/graphs/contributors"
>
<gf-value
size="large"
[locale]="user?.settings?.locale"
[value]="statistics?.gitHubContributors ?? '-'"
>Contributors on GitHub</gf-value
>
</a>
</div>
<div class="col-xs-12 col-md-4 my-2">
<a
class="d-block"
href="https://github.com/ghostfolio/ghostfolio/stargazers"
>
<gf-value
size="large"
[locale]="user?.settings?.locale"
[value]="statistics?.gitHubStargazers ?? '-'"
>Stars on GitHub</gf-value
>
</a>
</div>
</div>
</mat-card-content>
</mat-card>
</div>
</div>
<div class="row"> <div class="row">
<div *ngIf="hasPermissionForSubscription" class="col-md-3 col-xs-12 my-2"> <div *ngIf="hasPermissionForSubscription" class="col-md-3 col-xs-12 my-2">
<a <a

10
apps/client/src/app/pages/about/about-page.module.ts

@ -1,21 +1,13 @@
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { MatButtonModule } from '@angular/material/button'; import { MatButtonModule } from '@angular/material/button';
import { MatCardModule } from '@angular/material/card';
import { GfValueModule } from '@ghostfolio/ui/value';
import { AboutPageRoutingModule } from './about-page-routing.module'; import { AboutPageRoutingModule } from './about-page-routing.module';
import { AboutPageComponent } from './about-page.component'; import { AboutPageComponent } from './about-page.component';
@NgModule({ @NgModule({
declarations: [AboutPageComponent], declarations: [AboutPageComponent],
imports: [ imports: [AboutPageRoutingModule, CommonModule, MatButtonModule],
AboutPageRoutingModule,
CommonModule,
GfValueModule,
MatButtonModule,
MatCardModule
],
schemas: [CUSTOM_ELEMENTS_SCHEMA] schemas: [CUSTOM_ELEMENTS_SCHEMA]
}) })
export class AboutPageModule {} export class AboutPageModule {}

Loading…
Cancel
Save