Finished implementation of frontend functionality.

Styling and bugfixing next
This commit is contained in:
grimsi
2022-07-25 21:17:30 +02:00
parent 57377036c4
commit aa72161990
23 changed files with 146 additions and 152 deletions
@@ -5,7 +5,11 @@
<span class="spacer"></span>
<button mat-icon-button (click)="reloadLibrary()">
<button mat-icon-button (click)="reloadLibrary()" *ngIf="onLibraryManagementScreen()">
<mat-icon>youtube_searched_for</mat-icon>
</button>
<button mat-icon-button (click)="goToLibraryManagementScreen()">
<mat-icon>settings</mat-icon>
</button>
</mat-toolbar>
@@ -19,7 +19,7 @@ export class HeaderComponent {
reloadLibrary(): void {
this.libraryService.scanLibrary().pipe(timeInterval()).subscribe({
next: value => this.snackBar.open(`Library scan completed in ${Math.trunc(value.interval / 1000)} seconds.`, undefined, {duration: 2000}),
error: error => this.snackBar.open(`Error while scanning library: ${error}`, undefined, {duration: 5000})
error: error => this.snackBar.open(`Error while scanning library: ${error.error.message}`, undefined, {duration: 5000})
})
}
@@ -27,8 +27,16 @@ export class HeaderComponent {
this.router.navigate(['/']);
}
goToLibraryManagementScreen(): void {
this.router.navigate(['/library-management']);
}
notOnLibraryScreen(): boolean {
return !(this.router.url === "/library");
}
onLibraryManagementScreen(): boolean {
return this.router.url === "/library-management";
}
}
@@ -1 +0,0 @@
<h2 fxLayoutAlign="center center">This component is currently not implemented.</h2>
@@ -1,25 +0,0 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { NotImplementedComponent } from './not-implemented.component';
describe('NotImplementedComponent', () => {
let component: NotImplementedComponent;
let fixture: ComponentFixture<NotImplementedComponent>;
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ NotImplementedComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(NotImplementedComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -1,15 +0,0 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-not-implemented',
templateUrl: './not-implemented.component.html',
styleUrls: ['./not-implemented.component.scss']
})
export class NotImplementedComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}