1
0
mirror of https://github.com/pcvolkmer/etl-processor.git synced 2025-04-19 17:26:51 +00:00

feat: show info if no requests present

This commit is contained in:
Paul-Christian Volkmer 2024-05-08 13:08:15 +02:00
parent f419acb924
commit 86bee9e2cf
3 changed files with 19 additions and 16 deletions

View File

@ -140,9 +140,8 @@ class HomeControllerTest {
) )
val page = webClient.getPage<HtmlPage>("http://localhost/") val page = webClient.getPage<HtmlPage>("http://localhost/")
assertThat( assertThat(page.querySelectorAll("tbody tr")).hasSize(2)
page.querySelectorAll("tbody tr") assertThat(page.querySelectorAll("div.notification.info")).isEmpty()
).hasSize(2)
} }
@Test @Test
@ -167,9 +166,8 @@ class HomeControllerTest {
) )
val page = webClient.getPage<HtmlPage>("http://localhost/report/${requestId}") val page = webClient.getPage<HtmlPage>("http://localhost/report/${requestId}")
assertThat( assertThat(page.querySelectorAll("tbody tr")).hasSize(1)
page.querySelectorAll("tbody tr") assertThat(page.querySelectorAll("div.notification.info")).isEmpty()
).hasSize(1)
} }
@Test @Test
@ -201,9 +199,8 @@ class HomeControllerTest {
) )
val page = webClient.getPage<HtmlPage>("http://localhost/patient/PSEUDO1") val page = webClient.getPage<HtmlPage>("http://localhost/patient/PSEUDO1")
assertThat( assertThat(page.querySelectorAll("tbody tr")).hasSize(2)
page.querySelectorAll("tbody tr") assertThat(page.querySelectorAll("div.notification.info")).isEmpty()
).hasSize(2)
} }
} }
@ -225,9 +222,8 @@ class HomeControllerTest {
@Test @Test
fun testShouldShowHomePage() { fun testShouldShowHomePage() {
val page = webClient.getPage<HtmlPage>("http://localhost/") val page = webClient.getPage<HtmlPage>("http://localhost/")
assertThat( assertThat(page.querySelectorAll("tbody tr")).isEmpty()
page.querySelectorAll("tbody tr") assertThat(page.querySelectorAll("div.notification.info")).hasSize(1)
).isEmpty()
} }
@Test @Test
@ -252,9 +248,8 @@ class HomeControllerTest {
whenever(requestService.findRequestByPatientId(anyString(), any<Pageable>())).thenReturn(Page.empty()) whenever(requestService.findRequestByPatientId(anyString(), any<Pageable>())).thenReturn(Page.empty())
val page = webClient.getPage<HtmlPage>("http://localhost/patient/PSEUDO1") val page = webClient.getPage<HtmlPage>("http://localhost/patient/PSEUDO1")
assertThat( assertThat(page.querySelectorAll("tbody tr")).isEmpty()
page.querySelectorAll("tbody tr") assertThat(page.querySelectorAll("div.notification.info")).hasSize(1)
).hasSize(0)
} }
} }

View File

@ -619,6 +619,10 @@ input.inline:focus-visible {
text-align: center; text-align: center;
} }
.notification.info {
color: var(--bg-blue);
}
.notification.success { .notification.success {
color: var(--bg-green); color: var(--bg-green);
} }

View File

@ -18,7 +18,11 @@
</h2> </h2>
</div> </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"> <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()}">&larrb;</a><a th:if="${requests.isFirst()}">&larrb;</a> <a id="first-page-link" th:href="@{/(page=${0})}" title="Zum Anfang: Taste W" th:if="${not requests.isFirst()}">&larrb;</a><a th:if="${requests.isFirst()}">&larrb;</a>
<a id="prev-page-link" th:href="@{/(page=${requests.getNumber() - 1})}" title="Seite zurück: Taste A" th:if="${not requests.isFirst()}">&larr;</a><a th:if="${requests.isFirst()}">&larr;</a> <a id="prev-page-link" th:href="@{/(page=${requests.getNumber() - 1})}" title="Seite zurück: Taste A" th:if="${not requests.isFirst()}">&larr;</a><a th:if="${requests.isFirst()}">&larr;</a>