From 8ee217bbe8281f907023b6e139df816501f47112 Mon Sep 17 00:00:00 2001
From: grimsi <9295182+grimsi@users.noreply.github.com>
Date: Fri, 5 Aug 2022 10:26:01 +0200
Subject: [PATCH] Various styling and small QoL improvements
---
frontend/src/app/app.component.ts | 12 ++
frontend/src/app/app.module.ts | 6 +-
.../error-dialog/error-dialog.component.ts | 4 +-
.../game-detail-view.component.html | 1 +
.../components/header/header.component.html | 8 +-
.../app/components/header/header.component.ts | 16 +-
.../library-management.component.html | 140 ++++++++++--------
.../library-management.component.scss | 3 +-
.../library-overview.component.ts | 6 +-
.../src/app/interceptor/error.interceptor.ts | 8 +-
frontend/src/app/services/games.service.ts | 30 +++-
frontend/src/styles.scss | 11 ++
12 files changed, 160 insertions(+), 85 deletions(-)
diff --git a/frontend/src/app/app.component.ts b/frontend/src/app/app.component.ts
index 9d6b2f1..5b8f69f 100644
--- a/frontend/src/app/app.component.ts
+++ b/frontend/src/app/app.component.ts
@@ -1,4 +1,5 @@
import { Component } from '@angular/core';
+import {ActivatedRoute, NavigationEnd, Router} from "@angular/router";
@Component({
selector: 'app-root',
@@ -7,4 +8,15 @@ import { Component } from '@angular/core';
})
export class AppComponent {
title = 'frontend';
+ mySubscription;
+
+ constructor(private router: Router, private activatedRoute: ActivatedRoute){
+ this.router.routeReuseStrategy.shouldReuseRoute = () => false;
+ this.mySubscription = this.router.events.subscribe((event) => {
+ if (event instanceof NavigationEnd) {
+ // Trick the Router into believing it's last link wasn't previously loaded
+ this.router.navigated = false;
+ }
+ });
+ }
}
diff --git a/frontend/src/app/app.module.ts b/frontend/src/app/app.module.ts
index 5e9fac7..3012076 100644
--- a/frontend/src/app/app.module.ts
+++ b/frontend/src/app/app.module.ts
@@ -29,7 +29,7 @@ import {MatPaginatorModule} from "@angular/material/paginator";
import {MatSortModule} from "@angular/material/sort";
import {GameCoverComponent} from './components/game-cover/game-cover.component';
import {GameDetailViewComponent} from './components/game-detail-view/game-detail-view.component';
-import {MatSnackBarModule} from '@angular/material/snack-bar';
+import {MAT_SNACK_BAR_DEFAULT_OPTIONS, MatSnackBarModule} from '@angular/material/snack-bar';
import {MatGridListModule} from "@angular/material/grid-list";
import {GameScreenshotComponent} from './components/game-screenshot/game-screenshot.component';
import {YouTubePlayerModule} from "@angular/youtube-player";
@@ -94,6 +94,10 @@ import {MapGameDialogComponent} from "./components/map-game-dialog/map-game-dial
provide: HTTP_INTERCEPTORS,
useClass: ErrorInterceptor,
multi: true
+ },
+ {
+ provide: MAT_SNACK_BAR_DEFAULT_OPTIONS,
+ useValue: { panelClass: ['snackbar-dark'] },
}
],
bootstrap: [AppComponent]
diff --git a/frontend/src/app/components/error-dialog/error-dialog.component.ts b/frontend/src/app/components/error-dialog/error-dialog.component.ts
index 998d314..b5e0b7a 100644
--- a/frontend/src/app/components/error-dialog/error-dialog.component.ts
+++ b/frontend/src/app/components/error-dialog/error-dialog.component.ts
@@ -5,9 +5,7 @@ import {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';
selector: 'app-error-dialog',
template: `
Error
-
- {{message}}
-
+
diff --git a/frontend/src/app/components/game-detail-view/game-detail-view.component.html b/frontend/src/app/components/game-detail-view/game-detail-view.component.html
index 2eb59d3..5843682 100644
--- a/frontend/src/app/components/game-detail-view/game-detail-view.component.html
+++ b/frontend/src/app/components/game-detail-view/game-detail-view.component.html
@@ -8,6 +8,7 @@
{{game.title}}
+
Release: {{game.releaseDate | date: 'longDate'}}
{{game.summary}}
diff --git a/frontend/src/app/components/header/header.component.html b/frontend/src/app/components/header/header.component.html
index 419a2c1..a8c333f 100644
--- a/frontend/src/app/components/header/header.component.html
+++ b/frontend/src/app/components/header/header.component.html
@@ -1,11 +1,15 @@
-