From bdf382ca14353933dbb20a1e2eb22fd34a98a790 Mon Sep 17 00:00:00 2001 From: Joseph Milazzo Date: Sat, 2 Jan 2021 08:07:34 -0600 Subject: [PATCH 1/7] Changed routing for series to use library/:id/series/:id so that we can always validate a user has library access. --- src/app/_guards/library-access.guard.ts | 41 +++++++++++++++++++ src/app/_services/member.service.ts | 6 ++- src/app/app-routing.module.ts | 13 +++++- .../library-detail.component.ts | 2 +- 4 files changed, 58 insertions(+), 4 deletions(-) create mode 100644 src/app/_guards/library-access.guard.ts diff --git a/src/app/_guards/library-access.guard.ts b/src/app/_guards/library-access.guard.ts new file mode 100644 index 000000000..e6a70ea6d --- /dev/null +++ b/src/app/_guards/library-access.guard.ts @@ -0,0 +1,41 @@ +import { Injectable } from '@angular/core'; +import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree } from '@angular/router'; +import { ToastrService } from 'ngx-toastr'; +import { Observable } from 'rxjs'; +import { map } from 'rxjs/operators'; +import { User } from '../_models/user'; +import { AccountService } from '../_services/account.service'; +import { MemberService } from '../_services/member.service'; + +@Injectable({ + providedIn: 'root' +}) +export class LibraryAccessGuard implements CanActivate { + + constructor(private accountService: AccountService, private toastr: ToastrService, private memberService: MemberService) {} + + canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + + + + + + return this.accountService.currentUser$.pipe( + map((user: User) => { + if (user) { + const libraryId = parseInt(state.url.split('library/')[1], 10); + this.memberService.hasLibraryAccess(libraryId).pipe(res => { + console.log('return: ', res); + return res; + }); + console.log('state:', state.url); + console.log('route: ', route); + return true; + } + this.toastr.error('You are not authorized to view this page.'); + return false; + }) + ); + } + +} diff --git a/src/app/_services/member.service.ts b/src/app/_services/member.service.ts index 4f1ca9fd4..0a6c4ba88 100644 --- a/src/app/_services/member.service.ts +++ b/src/app/_services/member.service.ts @@ -19,9 +19,13 @@ export class MemberService { adminExists() { return this.httpClient.get(this.baseUrl + 'admin/exists'); } - + deleteMember(username: string) { return this.httpClient.delete(this.baseUrl + 'users/delete-user?username=' + username); } + hasLibraryAccess(libraryId: number) { + return this.httpClient.get(this.baseUrl + 'users/has-library-access?libraryId=' + libraryId); + } + } diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 9b1705767..30c9eaf89 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -4,6 +4,8 @@ import { HomeComponent } from './home/home.component'; import { LibraryDetailComponent } from './library-detail/library-detail.component'; import { LibraryComponent } from './library/library.component'; import { SeriesDetailComponent } from './series-detail/series-detail.component'; +import { LibraryAccessGuard } from './_guards/library-access.guard'; + const routes: Routes = [ {path: '', component: HomeComponent}, @@ -12,8 +14,15 @@ const routes: Routes = [ loadChildren: () => import('./admin/admin.module').then(m => m.AdminModule) }, {path: 'library', component: LibraryComponent}, - {path: 'library/:id', component: LibraryDetailComponent}, // NOTE: Should I put a guard up to prevent unauthorized access to libraries and series? - {path: 'series/:id', component: SeriesDetailComponent}, + { + path: '', + runGuardsAndResolvers: 'always', + canActivate: [LibraryAccessGuard], + children: [ + {path: 'library/:id', component: LibraryDetailComponent}, + {path: 'library/:id/series/:id', component: SeriesDetailComponent}, + ] + }, {path: '**', component: HomeComponent, pathMatch: 'full'} ]; diff --git a/src/app/library-detail/library-detail.component.ts b/src/app/library-detail/library-detail.component.ts index 686726624..bf0986bdb 100644 --- a/src/app/library-detail/library-detail.component.ts +++ b/src/app/library-detail/library-detail.component.ts @@ -32,7 +32,7 @@ export class LibraryDetailComponent implements OnInit { } seriesClicked(series: Series) { - this.router.navigateByUrl('/series/' + series.id); + this.router.navigate(['library', this.libraryId, 'series', series.id]); } } From cb9e88acdca317b2cfe82f8ea4b2892102d06dfd Mon Sep 17 00:00:00 2001 From: Joseph Milazzo Date: Sat, 2 Jan 2021 08:46:27 -0600 Subject: [PATCH 2/7] Ensure users are logged in before letting them access library route --- src/app/_guards/auth.guard.ts | 2 +- src/app/_guards/library-access.guard.ts | 36 +++++++++++-------------- src/app/app-routing.module.ts | 3 ++- 3 files changed, 18 insertions(+), 23 deletions(-) diff --git a/src/app/_guards/auth.guard.ts b/src/app/_guards/auth.guard.ts index 5c4ea0afb..a41cd7d16 100644 --- a/src/app/_guards/auth.guard.ts +++ b/src/app/_guards/auth.guard.ts @@ -13,7 +13,7 @@ export class AuthGuard implements CanActivate { constructor(private accountService: AccountService, private toastr: ToastrService) {} canActivate(): Observable { - // this automaticallys subs due to being router guard + // TODO: on failure, can we bring them back to home to show login screen return this.accountService.currentUser$.pipe( map((user: User) => { if (user) { diff --git a/src/app/_guards/library-access.guard.ts b/src/app/_guards/library-access.guard.ts index e6a70ea6d..94159045c 100644 --- a/src/app/_guards/library-access.guard.ts +++ b/src/app/_guards/library-access.guard.ts @@ -2,7 +2,7 @@ import { Injectable } from '@angular/core'; import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree } from '@angular/router'; import { ToastrService } from 'ngx-toastr'; import { Observable } from 'rxjs'; -import { map } from 'rxjs/operators'; +import { map, take } from 'rxjs/operators'; import { User } from '../_models/user'; import { AccountService } from '../_services/account.service'; import { MemberService } from '../_services/member.service'; @@ -14,28 +14,22 @@ export class LibraryAccessGuard implements CanActivate { constructor(private accountService: AccountService, private toastr: ToastrService, private memberService: MemberService) {} - canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + canActivate(next: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + const libraryId = parseInt(state.url.split('library/')[1], 10); + return this.memberService.hasLibraryAccess(libraryId); - - - - return this.accountService.currentUser$.pipe( - map((user: User) => { - if (user) { - const libraryId = parseInt(state.url.split('library/')[1], 10); - this.memberService.hasLibraryAccess(libraryId).pipe(res => { - console.log('return: ', res); - return res; - }); - console.log('state:', state.url); - console.log('route: ', route); - return true; - } - this.toastr.error('You are not authorized to view this page.'); - return false; - }) - ); + // return this.accountService.currentUser$.pipe( + // take((user: User) => { + // if (user) { + // const libraryId = parseInt(state.url.split('library/')[1], 10); + // return this.memberService.hasLibraryAccess(libraryId); + // //return true; + // } + // this.toastr.error('You are not authorized to view this page.'); + // return false; + // }) + // ); } } diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 30c9eaf89..30cdcf988 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -4,6 +4,7 @@ import { HomeComponent } from './home/home.component'; import { LibraryDetailComponent } from './library-detail/library-detail.component'; import { LibraryComponent } from './library/library.component'; import { SeriesDetailComponent } from './series-detail/series-detail.component'; +import { AuthGuard } from './_guards/auth.guard'; import { LibraryAccessGuard } from './_guards/library-access.guard'; @@ -17,7 +18,7 @@ const routes: Routes = [ { path: '', runGuardsAndResolvers: 'always', - canActivate: [LibraryAccessGuard], + canActivate: [AuthGuard, LibraryAccessGuard], children: [ {path: 'library/:id', component: LibraryDetailComponent}, {path: 'library/:id/series/:id', component: SeriesDetailComponent}, From 1fe055b27ee5e20cac71cc018130fb571c1d3017 Mon Sep 17 00:00:00 2001 From: Joseph Milazzo Date: Sat, 2 Jan 2021 08:59:28 -0600 Subject: [PATCH 3/7] Cleanup library access guard. --- src/app/_guards/library-access.guard.ts | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/src/app/_guards/library-access.guard.ts b/src/app/_guards/library-access.guard.ts index 94159045c..611eb556d 100644 --- a/src/app/_guards/library-access.guard.ts +++ b/src/app/_guards/library-access.guard.ts @@ -1,10 +1,6 @@ import { Injectable } from '@angular/core'; -import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree } from '@angular/router'; -import { ToastrService } from 'ngx-toastr'; +import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router'; import { Observable } from 'rxjs'; -import { map, take } from 'rxjs/operators'; -import { User } from '../_models/user'; -import { AccountService } from '../_services/account.service'; import { MemberService } from '../_services/member.service'; @Injectable({ @@ -12,24 +8,10 @@ import { MemberService } from '../_services/member.service'; }) export class LibraryAccessGuard implements CanActivate { - constructor(private accountService: AccountService, private toastr: ToastrService, private memberService: MemberService) {} + constructor(private memberService: MemberService) {} canActivate(next: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { - const libraryId = parseInt(state.url.split('library/')[1], 10); return this.memberService.hasLibraryAccess(libraryId); - - // return this.accountService.currentUser$.pipe( - // take((user: User) => { - // if (user) { - // const libraryId = parseInt(state.url.split('library/')[1], 10); - // return this.memberService.hasLibraryAccess(libraryId); - // //return true; - // } - // this.toastr.error('You are not authorized to view this page.'); - // return false; - // }) - // ); } - } From fe5ec2f03256138503afc783c5cb2f02cbbd9c16 Mon Sep 17 00:00:00 2001 From: Joseph Milazzo Date: Sat, 2 Jan 2021 09:26:48 -0600 Subject: [PATCH 4/7] Refactored library to use it's own card type which wraps app-card-item. Implemented ability to kick off a scan of a library from UI (non-admin route) if you are an admin. --- src/app/_services/library.service.ts | 4 +- src/app/library/library.component.html | 3 +- src/app/library/library.component.ts | 13 ---- .../shared/card-item/card-item.component.html | 1 + .../shared/card-item/card-item.component.ts | 1 + .../library-card/library-card.component.html | 3 + .../library-card/library-card.component.scss | 0 .../library-card/library-card.component.ts | 60 +++++++++++++++++++ src/app/shared/shared.module.ts | 6 +- 9 files changed, 74 insertions(+), 17 deletions(-) create mode 100644 src/app/shared/library-card/library-card.component.html create mode 100644 src/app/shared/library-card/library-card.component.scss create mode 100644 src/app/shared/library-card/library-card.component.ts diff --git a/src/app/_services/library.service.ts b/src/app/_services/library.service.ts index 5243bf517..1e801b03e 100644 --- a/src/app/_services/library.service.ts +++ b/src/app/_services/library.service.ts @@ -33,6 +33,8 @@ export class LibraryService { return this.httpClient.post(this.baseUrl + 'library/update-for', {username, selectedLibraries}); } - + scan(libraryId: number) { + return this.httpClient.post(this.baseUrl + 'library/scan?libraryId=' + libraryId, {}); + } } diff --git a/src/app/library/library.component.html b/src/app/library/library.component.html index 666f33e34..cb906425e 100644 --- a/src/app/library/library.component.html +++ b/src/app/library/library.component.html @@ -2,6 +2,7 @@

Libraries

- + +
\ No newline at end of file diff --git a/src/app/library/library.component.ts b/src/app/library/library.component.ts index c4f027c73..cc268287b 100644 --- a/src/app/library/library.component.ts +++ b/src/app/library/library.component.ts @@ -17,29 +17,16 @@ export class LibraryComponent implements OnInit { user: User | undefined; libraries: Library[] = []; - actions: CardItemAction[] = []; constructor(public accountService: AccountService, private libraryService: LibraryService, private router: Router) { } ngOnInit(): void { this.accountService.currentUser$.pipe(take(1)).subscribe(user => { this.user = user; - if (this.accountService.hasAdminRole(user)) { - this.actions = [ - {title: 'Scan Library', callback: (data: Library) => { - console.log('You tried to scan library: ' + data.name); - }} - ]; - } this.libraryService.getLibrariesForMember(this.user.username).subscribe(libraries => { this.libraries = libraries; - console.log('Libraries: ', this.libraries); }); }); } - handleNavigation(event: any, library: Library) { - this.router.navigateByUrl('/library/' + library.id); - } - } diff --git a/src/app/shared/card-item/card-item.component.html b/src/app/shared/card-item/card-item.component.html index 976a075f8..bb102cbd2 100644 --- a/src/app/shared/card-item/card-item.component.html +++ b/src/app/shared/card-item/card-item.component.html @@ -1,4 +1,5 @@
+ {{title}}
diff --git a/src/app/shared/card-item/card-item.component.ts b/src/app/shared/card-item/card-item.component.ts index ff41443ee..e4a8b431e 100644 --- a/src/app/shared/card-item/card-item.component.ts +++ b/src/app/shared/card-item/card-item.component.ts @@ -19,6 +19,7 @@ export class CardItemComponent implements OnInit { @Input() entity: any; // This is the entity we are representing. It will be returned if an action is executed. @Output() clicked = new EventEmitter(); + placeholderImage = 'assets/images/image-placeholder.jpg'; constructor() { } diff --git a/src/app/shared/library-card/library-card.component.html b/src/app/shared/library-card/library-card.component.html new file mode 100644 index 000000000..fb6fa8b97 --- /dev/null +++ b/src/app/shared/library-card/library-card.component.html @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/app/shared/library-card/library-card.component.scss b/src/app/shared/library-card/library-card.component.scss new file mode 100644 index 000000000..e69de29bb diff --git a/src/app/shared/library-card/library-card.component.ts b/src/app/shared/library-card/library-card.component.ts new file mode 100644 index 000000000..773fa3d98 --- /dev/null +++ b/src/app/shared/library-card/library-card.component.ts @@ -0,0 +1,60 @@ +import { Component, EventEmitter, Input, OnChanges, OnInit, Output } from '@angular/core'; +import { Router } from '@angular/router'; +import { ToastrService } from 'ngx-toastr'; +import { take } from 'rxjs/operators'; +import { Library } from 'src/app/_models/library'; +import { User } from 'src/app/_models/user'; +import { AccountService } from 'src/app/_services/account.service'; +import { LibraryService } from 'src/app/_services/library.service'; +import { CardItemAction } from '../card-item/card-item.component'; + +// Represents a library type card. Uses a app-card-item internally +@Component({ + selector: 'app-library-card', + templateUrl: './library-card.component.html', + styleUrls: ['./library-card.component.scss'] +}) +export class LibraryCardComponent implements OnInit, OnChanges { + @Input() data: Library | undefined; + @Output() clicked = new EventEmitter(); + + isAdmin = false; + actions: CardItemAction[] = []; + + constructor(private accountService: AccountService, private router: Router, + private libraryService: LibraryService, private toastr: ToastrService) { + this.accountService.currentUser$.pipe(take(1)).subscribe(user => { + if (user) { + this.isAdmin = this.accountService.hasAdminRole(user); + } + }); + } + + ngOnInit(): void { + } + + ngOnChanges(changes: any) { + if (this.data) { + this.generateActions(); + } + } + + generateActions() { + this.actions = []; + + if (this.isAdmin) { + this.actions.push({title: 'Scan Library', callback: (data: Library) => { + console.log('You tried to scan library: ' + data.name); + this.libraryService.scan(data?.id).subscribe((res: any) => { + this.toastr.success('Scan started for ' + data.name); + }); + }}); + } + } + + handleClick() { + this.clicked.emit(this.data); + this.router.navigate(['library', this.data?.id]); + } + +} diff --git a/src/app/shared/shared.module.ts b/src/app/shared/shared.module.ts index 01a2b702f..adcc30dc2 100644 --- a/src/app/shared/shared.module.ts +++ b/src/app/shared/shared.module.ts @@ -4,11 +4,12 @@ import { RegisterMemberComponent } from './register-member/register-member.compo import { ReactiveFormsModule } from '@angular/forms'; import { CardItemComponent } from './card-item/card-item.component'; import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; +import { LibraryCardComponent } from './library-card/library-card.component'; @NgModule({ - declarations: [RegisterMemberComponent, CardItemComponent], + declarations: [RegisterMemberComponent, CardItemComponent, LibraryCardComponent], imports: [ CommonModule, ReactiveFormsModule, @@ -16,7 +17,8 @@ import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; ], exports: [ RegisterMemberComponent, - CardItemComponent + CardItemComponent, + LibraryCardComponent ] }) export class SharedModule { } From 1816b6c68d7b15c9f26284a2c873aaee2bf57fbd Mon Sep 17 00:00:00 2001 From: Joseph Milazzo Date: Sat, 2 Jan 2021 12:44:11 -0600 Subject: [PATCH 5/7] Added series card implementation. Added a mock cover to help visualize style changes. Implemented ability to create a new library without validation errors. Fixed a bug in directory picker that caused selected folders to not export the full path. --- src/app/_models/volume.ts | 3 +- src/app/_services/library.service.ts | 4 + .../directory-picker.component.ts | 4 +- .../library-editor-modal.component.html | 38 ++++++++- .../library-editor-modal.component.ts | 42 +++++++++- src/app/admin/admin.module.ts | 5 +- .../library-detail.component.html | 6 +- src/app/library/library.component.html | 5 +- src/app/library/library.component.ts | 5 ++ src/app/nav-header/nav-header.component.html | 2 +- .../series-detail.component.html | 6 +- .../shared/card-item/card-item.component.html | 18 +++-- .../shared/card-item/card-item.component.scss | 14 +++- .../shared/card-item/card-item.component.ts | 4 +- .../library-card/library-card.component.ts | 20 ++++- .../series-card/series-card.component.html | 3 + .../series-card/series-card.component.scss | 0 .../series-card/series-card.component.ts | 76 ++++++++++++++++++ src/app/shared/shared.module.ts | 11 ++- src/assets/images/mock-cover.jpg | Bin 0 -> 12482 bytes 20 files changed, 235 insertions(+), 31 deletions(-) create mode 100644 src/app/shared/series-card/series-card.component.html create mode 100644 src/app/shared/series-card/series-card.component.scss create mode 100644 src/app/shared/series-card/series-card.component.ts create mode 100644 src/assets/images/mock-cover.jpg diff --git a/src/app/_models/volume.ts b/src/app/_models/volume.ts index 77a7629fa..830e5082b 100644 --- a/src/app/_models/volume.ts +++ b/src/app/_models/volume.ts @@ -1,6 +1,7 @@ export interface Volume { id: number; - number: string; + number: number; + name: string; files: Array; coverImage: string; } diff --git a/src/app/_services/library.service.ts b/src/app/_services/library.service.ts index 1e801b03e..ab68af45b 100644 --- a/src/app/_services/library.service.ts +++ b/src/app/_services/library.service.ts @@ -37,4 +37,8 @@ export class LibraryService { return this.httpClient.post(this.baseUrl + 'library/scan?libraryId=' + libraryId, {}); } + create(model: {name: string, type: number, folders: string[]}) { + return this.httpClient.post(this.baseUrl + 'library/create', model); + } + } diff --git a/src/app/admin/_modals/directory-picker/directory-picker.component.ts b/src/app/admin/_modals/directory-picker/directory-picker.component.ts index 55b03ddfb..1a78047ee 100644 --- a/src/app/admin/_modals/directory-picker/directory-picker.component.ts +++ b/src/app/admin/_modals/directory-picker/directory-picker.component.ts @@ -84,7 +84,9 @@ export class DirectoryPickerComponent implements OnInit { event.preventDefault(); event.stopPropagation(); - this.modal.close({success: true, folderPath: folderName}); + const fullPath = (this.routeStack.items.join('\\') + '\\' + folderName).replace('\\\\', '\\'); + + this.modal.close({success: true, folderPath: fullPath}); } close() { diff --git a/src/app/admin/_modals/library-editor-modal/library-editor-modal.component.html b/src/app/admin/_modals/library-editor-modal/library-editor-modal.component.html index 70da5d876..3024c7cb5 100644 --- a/src/app/admin/_modals/library-editor-modal/library-editor-modal.component.html +++ b/src/app/admin/_modals/library-editor-modal/library-editor-modal.component.html @@ -1 +1,37 @@ -

library-editor-modal works!

+ +
+ + + +
\ No newline at end of file diff --git a/src/app/admin/_modals/library-editor-modal/library-editor-modal.component.ts b/src/app/admin/_modals/library-editor-modal/library-editor-modal.component.ts index 920cca0a0..2f76b0792 100644 --- a/src/app/admin/_modals/library-editor-modal/library-editor-modal.component.ts +++ b/src/app/admin/_modals/library-editor-modal/library-editor-modal.component.ts @@ -1,4 +1,8 @@ import { Component, OnInit } from '@angular/core'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; +import { NgbActiveModal, NgbModal } from '@ng-bootstrap/ng-bootstrap'; +import { LibraryService } from 'src/app/_services/library.service'; +import { DirectoryPickerComponent, DirectoryPickerResult } from '../directory-picker/directory-picker.component'; @Component({ selector: 'app-library-editor-modal', @@ -7,9 +11,45 @@ import { Component, OnInit } from '@angular/core'; }) export class LibraryEditorModalComponent implements OnInit { - constructor() { } + + libraryForm: FormGroup = new FormGroup({ + name: new FormControl('', [Validators.required]), + type: new FormControl(0, [Validators.required]) + }); + + selectedFolders: string[] = []; + + constructor(private modalService: NgbModal, private libraryService: LibraryService, public modal: NgbActiveModal) { } ngOnInit(): void { } + submitLibrary() { + const model = this.libraryForm.value; + model.folders = this.selectedFolders; + console.log('Creating library with: ', model); + // this.libraryService.create(model).subscribe(() => { + // this.close(true); + // }); + } + + close(returnVal= false) { + this.modal.close(returnVal); + } + + reset() { + + } + + openDirectoryPicker() { + const modalRef = this.modalService.open(DirectoryPickerComponent); + modalRef.closed.subscribe((closeResult: DirectoryPickerResult) => { + if (closeResult.success) { + this.selectedFolders.push(closeResult.folderPath); + } + }); + } + + + } diff --git a/src/app/admin/admin.module.ts b/src/app/admin/admin.module.ts index 64ee124e7..c9608536b 100644 --- a/src/app/admin/admin.module.ts +++ b/src/app/admin/admin.module.ts @@ -9,7 +9,7 @@ import { LibraryEditorModalComponent } from './_modals/library-editor-modal/libr import { SharedModule } from '../shared/shared.module'; import { LibraryAccessModalComponent } from './_modals/library-access-modal/library-access-modal.component'; import { DirectoryPickerComponent } from './_modals/directory-picker/directory-picker.component'; -import { FormsModule } from '@angular/forms'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; @@ -25,9 +25,10 @@ import { FormsModule } from '@angular/forms'; imports: [ CommonModule, AdminRoutingModule, + ReactiveFormsModule, + FormsModule, NgbNavModule, SharedModule, - FormsModule ], providers: [] }) diff --git a/src/app/library-detail/library-detail.component.html b/src/app/library-detail/library-detail.component.html index 15bd6e363..705cc1173 100644 --- a/src/app/library-detail/library-detail.component.html +++ b/src/app/library-detail/library-detail.component.html @@ -1,12 +1,12 @@

Title (Manga/Recently Added)

-
- +
+
- + Nothing here....
\ No newline at end of file diff --git a/src/app/library/library.component.html b/src/app/library/library.component.html index cb906425e..157dd46c0 100644 --- a/src/app/library/library.component.html +++ b/src/app/library/library.component.html @@ -1,8 +1,7 @@

Libraries

-
+
-
-
\ No newline at end of file +
\ No newline at end of file diff --git a/src/app/library/library.component.ts b/src/app/library/library.component.ts index cc268287b..33480833c 100644 --- a/src/app/library/library.component.ts +++ b/src/app/library/library.component.ts @@ -25,6 +25,11 @@ export class LibraryComponent implements OnInit { this.user = user; this.libraryService.getLibrariesForMember(this.user.username).subscribe(libraries => { this.libraries = libraries; + if (this.libraries.length > 0) { + // TODO: Remove this debug code + console.warn('Warning, debug code is being used!'); + this.libraries[0].coverImage = '/assets/images/mock-cover.jpg'; + } }); }); } diff --git a/src/app/nav-header/nav-header.component.html b/src/app/nav-header/nav-header.component.html index 431ce4a94..3223c7ff1 100644 --- a/src/app/nav-header/nav-header.component.html +++ b/src/app/nav-header/nav-header.component.html @@ -11,7 +11,7 @@