More css stuffs
This commit is contained in:
+1
-1
@@ -28,7 +28,7 @@ public class BookController {
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
public ResponseEntity<List<BookDTO>> getBooks() throws InterruptedException {
|
||||
public ResponseEntity<List<BookDTO>> getBooks() {
|
||||
return ResponseEntity.ok(booksService.getBooks());
|
||||
}
|
||||
|
||||
|
||||
@@ -27,8 +27,10 @@
|
||||
</div>
|
||||
|
||||
<div class="virtual-scroller-container">
|
||||
<div *ngIf="(bookState$ | async)?.error">
|
||||
<p class="no-books-text">Failed to load library's books!</p>
|
||||
<div class="no-books-container" *ngIf="(bookState$ | async)?.error">
|
||||
<p class="no-books-text">
|
||||
{{ entityType === 'Library' ? "Failed to load library's books!" : "Failed to load shelf's books!" }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="no-books-container" *ngIf="!(bookState$ | async)?.error && (bookState$ | async)?.loaded && (bookState$ | async)?.books?.length === 0">
|
||||
<p class="no-books-text">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {Injectable} from '@angular/core';
|
||||
import {BehaviorSubject, Observable, of} from 'rxjs';
|
||||
import {HttpClient} from '@angular/common/http';
|
||||
import { catchError, map, switchMap } from 'rxjs/operators';
|
||||
import {catchError, map, switchMap, tap} from 'rxjs/operators';
|
||||
import {Book, BookMetadata, BookSetting} from '../model/book.model';
|
||||
import {BookState} from '../model/state/book-state.model';
|
||||
|
||||
@@ -24,6 +24,13 @@ export class BookService {
|
||||
|
||||
private loadBooks(): void {
|
||||
this.http.get<Book[]>(this.url).pipe(
|
||||
tap(books => {
|
||||
this.bookStateSubject.next({
|
||||
books: books || [],
|
||||
loaded: true,
|
||||
error: null,
|
||||
});
|
||||
}),
|
||||
catchError(error => {
|
||||
this.bookStateSubject.next({
|
||||
books: null,
|
||||
@@ -32,13 +39,7 @@ export class BookService {
|
||||
});
|
||||
return of(null);
|
||||
})
|
||||
).subscribe(books => {
|
||||
this.bookStateSubject.next({
|
||||
books: books || [],
|
||||
loaded: true,
|
||||
error: null,
|
||||
});
|
||||
});
|
||||
).subscribe();
|
||||
}
|
||||
|
||||
updateBookShelves(bookIds: Set<number | undefined>, shelvesToAssign: Set<number | undefined>, shelvesToUnassign: Set<number | undefined>): Observable<Book[]> {
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
transition: transform $transitionDuration, left $transitionDuration;
|
||||
background-color: var(--surface-overlay);
|
||||
border-radius: $borderRadius;
|
||||
padding: 0.5rem 1.5rem;
|
||||
padding: 0.5rem 1.35rem;
|
||||
box-shadow: 0px 3px 5px rgba(0, 0, 0, .02), 0px 0px 2px rgba(0, 0, 0, .05), 0px 1px 4px rgba(0, 0, 0, .08);
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
outline: 0 none;
|
||||
color: var(--text-color);
|
||||
cursor: pointer;
|
||||
padding: .75rem 1rem;
|
||||
padding: 0.75rem 0.5rem 0.75rem 1rem;
|
||||
border-radius: $borderRadius;
|
||||
transition: background-color $transitionDuration, box-shadow $transitionDuration;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user