Browse Source

Bugfix/fix missing header of public pages (#121)

* Fix missing header of public pages

* Update changelog
pull/122/head
Thomas 4 years ago
committed by GitHub
parent
commit
ad961f3039
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 9
      apps/client/src/app/core/auth.guard.ts
  3. 5
      apps/client/src/app/pages/about/about-page-routing.module.ts
  4. 5
      apps/client/src/app/pages/pricing/pricing-page-routing.module.ts
  5. 5
      apps/client/src/app/pages/resources/resources-page-routing.module.ts

1
CHANGELOG.md

@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Fixed the performance chart by considering the investment
- Fixed missing header of public pages (_About_, _Pricing_, _Resources_)
## 1.7.0 - 22.05.2021

9
apps/client/src/app/core/auth.guard.ts

@ -9,14 +9,14 @@ import { ViewMode } from '@prisma/client';
import { EMPTY } from 'rxjs';
import { catchError } from 'rxjs/operators';
import { DataService } from '../services/data.service';
import { SettingsStorageService } from '../services/settings-storage.service';
import { UserService } from '../services/user/user.service';
@Injectable({ providedIn: 'root' })
export class AuthGuard implements CanActivate {
private static PUBLIC_PAGE_ROUTES = ['/about', '/pricing', '/resources'];
constructor(
private dataService: DataService,
private router: Router,
private settingsStorageService: SettingsStorageService,
private userService: UserService
@ -35,7 +35,10 @@ export class AuthGuard implements CanActivate {
.get()
.pipe(
catchError(() => {
if (state.url !== '/start') {
if (AuthGuard.PUBLIC_PAGE_ROUTES.includes(state.url)) {
resolve(true);
return EMPTY;
} else if (state.url !== '/start') {
this.router.navigate(['/start']);
resolve(false);
return EMPTY;

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

@ -1,9 +1,12 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { AuthGuard } from '@ghostfolio/client/core/auth.guard';
import { AboutPageComponent } from './about-page.component';
const routes: Routes = [{ path: '', component: AboutPageComponent }];
const routes: Routes = [
{ path: '', component: AboutPageComponent, canActivate: [AuthGuard] }
];
@NgModule({
imports: [RouterModule.forChild(routes)],

5
apps/client/src/app/pages/pricing/pricing-page-routing.module.ts

@ -1,9 +1,12 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { AuthGuard } from '@ghostfolio/client/core/auth.guard';
import { PricingPageComponent } from './pricing-page.component';
const routes: Routes = [{ path: '', component: PricingPageComponent }];
const routes: Routes = [
{ path: '', component: PricingPageComponent, canActivate: [AuthGuard] }
];
@NgModule({
imports: [RouterModule.forChild(routes)],

5
apps/client/src/app/pages/resources/resources-page-routing.module.ts

@ -1,9 +1,12 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { AuthGuard } from '@ghostfolio/client/core/auth.guard';
import { ResourcesPageComponent } from './resources-page.component';
const routes: Routes = [{ path: '', component: ResourcesPageComponent }];
const routes: Routes = [
{ path: '', component: ResourcesPageComponent, canActivate: [AuthGuard] }
];
@NgModule({
imports: [RouterModule.forChild(routes)],

Loading…
Cancel
Save