diff options
| author | Paul-Christian Volkmer | 2024-05-08 13:08:15 +0200 |
|---|---|---|
| committer | Paul-Christian Volkmer | 2024-05-08 13:08:15 +0200 |
| commit | 86bee9e2cf5c97d1339d2cde59b3361e88973a7d (patch) | |
| tree | 076992bcba2d74347f7020780ec0d53b63b416af | |
| parent | f419acb924b30ff73d672475c6f726c8c6e92c3b (diff) | |
feat: show info if no requests present
| -rw-r--r-- | src/integrationTest/kotlin/dev/dnpm/etl/processor/web/HomeControllerTest.kt | 25 | ||||
| -rw-r--r-- | src/main/resources/static/style.css | 4 | ||||
| -rw-r--r-- | src/main/resources/templates/index.html | 6 |
3 files changed, 19 insertions, 16 deletions
diff --git a/src/integrationTest/kotlin/dev/dnpm/etl/processor/web/HomeControllerTest.kt b/src/integrationTest/kotlin/dev/dnpm/etl/processor/web/HomeControllerTest.kt index c37236a..d227dcd 100644 --- a/src/integrationTest/kotlin/dev/dnpm/etl/processor/web/HomeControllerTest.kt +++ b/src/integrationTest/kotlin/dev/dnpm/etl/processor/web/HomeControllerTest.kt @@ -140,9 +140,8 @@ class HomeControllerTest { ) val page = webClient.getPage<HtmlPage>("http://localhost/") - assertThat( - page.querySelectorAll("tbody tr") - ).hasSize(2) + assertThat(page.querySelectorAll("tbody tr")).hasSize(2) + assertThat(page.querySelectorAll("div.notification.info")).isEmpty() } @Test @@ -167,9 +166,8 @@ class HomeControllerTest { ) val page = webClient.getPage<HtmlPage>("http://localhost/report/${requestId}") - assertThat( - page.querySelectorAll("tbody tr") - ).hasSize(1) + assertThat(page.querySelectorAll("tbody tr")).hasSize(1) + assertThat(page.querySelectorAll("div.notification.info")).isEmpty() } @Test @@ -201,9 +199,8 @@ class HomeControllerTest { ) val page = webClient.getPage<HtmlPage>("http://localhost/patient/PSEUDO1") - assertThat( - page.querySelectorAll("tbody tr") - ).hasSize(2) + assertThat(page.querySelectorAll("tbody tr")).hasSize(2) + assertThat(page.querySelectorAll("div.notification.info")).isEmpty() } } @@ -225,9 +222,8 @@ class HomeControllerTest { @Test fun testShouldShowHomePage() { val page = webClient.getPage<HtmlPage>("http://localhost/") - assertThat( - page.querySelectorAll("tbody tr") - ).isEmpty() + assertThat(page.querySelectorAll("tbody tr")).isEmpty() + assertThat(page.querySelectorAll("div.notification.info")).hasSize(1) } @Test @@ -252,9 +248,8 @@ class HomeControllerTest { whenever(requestService.findRequestByPatientId(anyString(), any<Pageable>())).thenReturn(Page.empty()) val page = webClient.getPage<HtmlPage>("http://localhost/patient/PSEUDO1") - assertThat( - page.querySelectorAll("tbody tr") - ).hasSize(0) + assertThat(page.querySelectorAll("tbody tr")).isEmpty() + assertThat(page.querySelectorAll("div.notification.info")).hasSize(1) } } diff --git a/src/main/resources/static/style.css b/src/main/resources/static/style.css index f6a916e..892b020 100644 --- a/src/main/resources/static/style.css +++ b/src/main/resources/static/style.css @@ -619,6 +619,10 @@ input.inline:focus-visible { text-align: center; } +.notification.info { + color: var(--bg-blue); +} + .notification.success { color: var(--bg-green); } diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html index be3123b..520efb6 100644 --- a/src/main/resources/templates/index.html +++ b/src/main/resources/templates/index.html @@ -18,7 +18,11 @@ </h2> </div> - <div class="border"> + <div class="border" th:if="${requests.totalElements == 0}"> + <div class="notification info">Noch keine Anfragen eingegangen</div> + </div> + + <div class="border" th:if="${requests.totalElements > 0}"> <div th:if="${patientId == null}" class="page-control"> <a id="first-page-link" th:href="@{/(page=${0})}" title="Zum Anfang: Taste W" th:if="${not requests.isFirst()}">⇤</a><a th:if="${requests.isFirst()}">⇤</a> <a id="prev-page-link" th:href="@{/(page=${requests.getNumber() - 1})}" title="Seite zurück: Taste A" th:if="${not requests.isFirst()}">←</a><a th:if="${requests.isFirst()}">←</a> |
