From 043c6811322a509bf7477be29edd1ee45d9a01fb Mon Sep 17 00:00:00 2001 From: "aditya.chandel" <> Date: Sun, 22 Dec 2024 12:18:33 -0700 Subject: [PATCH] Display message when there's no books --- .../com/adityachandel/booklore/service/BooksService.java | 1 + .../component/books-browser/books-browser.component.html | 5 ++++- .../component/books-browser/books-browser.component.scss | 5 +++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/booklore-api/src/main/java/com/adityachandel/booklore/service/BooksService.java b/booklore-api/src/main/java/com/adityachandel/booklore/service/BooksService.java index 723296103..28490f256 100644 --- a/booklore-api/src/main/java/com/adityachandel/booklore/service/BooksService.java +++ b/booklore-api/src/main/java/com/adityachandel/booklore/service/BooksService.java @@ -70,6 +70,7 @@ public class BooksService { } else { throw new IllegalArgumentException("Invalid sortBy parameter"); } + return bookPage.getContent().stream() .map(BookTransformer::convertToBookDTO) .collect(Collectors.toList()); diff --git a/booklore-ui/src/app/book/component/books-browser/books-browser.component.html b/booklore-ui/src/app/book/component/books-browser/books-browser.component.html index e525adf31..61bb826ac 100644 --- a/booklore-ui/src/app/book/component/books-browser/books-browser.component.html +++ b/booklore-ui/src/app/book/component/books-browser/books-browser.component.html @@ -23,12 +23,15 @@
- +
+
+

No books available to display.

+
diff --git a/booklore-ui/src/app/book/component/books-browser/books-browser.component.scss b/booklore-ui/src/app/book/component/books-browser/books-browser.component.scss index e78aaf08d..f09bcd5f3 100644 --- a/booklore-ui/src/app/book/component/books-browser/books-browser.component.scss +++ b/booklore-ui/src/app/book/component/books-browser/books-browser.component.scss @@ -49,3 +49,8 @@ overflow: hidden; align-items: start; } + +.empty-message { + display: flex; + justify-content: space-around; +}