Skip to content

Commit 6ccf231

Browse files
committed
Merge branch 'developer' into feature-litter-service-vasile
# Conflicts: # src/main/java/com/csaba79coder/littersnap/view/UserViewController.java
2 parents 8558c0d + 38e7adf commit 6ccf231

File tree

6 files changed

+113
-5
lines changed

6 files changed

+113
-5
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
- Spring Boot Test
3232
- Spring Boot Starter Test
3333
- Spring Boot Test Autoconfigure
34-
- JUnit 5
3534

3635
## Basic setup
3736

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
package com.csaba79coder.littersnap;
22

3+
import org.springframework.boot.ApplicationArguments;
4+
import org.springframework.boot.ApplicationRunner;
35
import org.springframework.boot.SpringApplication;
46
import org.springframework.boot.autoconfigure.SpringBootApplication;
57

68
@SpringBootApplication
7-
public class LitterSnapApplication {
9+
public class LitterSnapApplication implements ApplicationRunner {
810

911
public static void main(String[] args) {
1012
SpringApplication.run(LitterSnapApplication.class, args);
1113
}
1214

15+
@Override
16+
public void run(ApplicationArguments args) throws Exception {
17+
18+
}
1319
}

src/main/java/com/csaba79coder/littersnap/model/user/service/UserService.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import org.springframework.stereotype.Service;
1616

1717
import java.time.LocalDateTime;
18+
import java.util.Comparator;
1819
import java.util.List;
1920
import java.util.Objects;
2021
import java.util.UUID;
@@ -38,6 +39,7 @@ public List<UserModel> findAllUsers() {
3839
return userRepository.findAll()
3940
.stream()
4041
.map(Mapper::mapUserEntityToModel)
42+
.sorted(Comparator.comparing(UserModel::getFirstName))
4143
.collect(Collectors.toList());
4244
}
4345

src/main/java/com/csaba79coder/littersnap/view/UserViewController.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
import com.csaba79coder.littersnap.model.user.service.UserService;
55
import lombok.RequiredArgsConstructor;
66
import org.springframework.stereotype.Controller;
7-
import org.springframework.ui.Model;
8-
import org.springframework.web.bind.annotation.GetMapping;
97
import org.springframework.web.bind.annotation.RequestMapping;
108

119
import java.util.List;

src/main/resources/static/style.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,5 +114,9 @@ body {
114114
/* }*/
115115
/*}*/
116116

117-
117+
caption {
118+
caption-side: top;
119+
text-align: center;
120+
color: green;
121+
}
118122

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
<!DOCTYPE html>
2+
<html lang="en" xmlns:th="http://www.thymeleaf.org">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css" rel="stylesheet"
7+
integrity="sha384-KK94CHFLLe+nY2dmCWGMq91rCGa5gtU4mk92HdvYe+M/SXH301p5ILy+dN9+nJOZ" crossorigin="anonymous">
8+
9+
<!-- Font Awesome CSS -->
10+
<link rel='stylesheet' href='https://use.fontawesome.com/releases/v5.3.1/css/all.css'>
11+
<link rel="preconnect" href="https://fonts.googleapis.com">
12+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
13+
<link href="https://fonts.googleapis.com/css2?family=Roboto&display=swap" rel="stylesheet">
14+
<!-- Include jQuery from Google CDN -->
15+
<link rel="stylesheet" th:href="@{/style.css}">
16+
<link th:src="@{/script.js}">
17+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0/dist/css/bootstrap.min.css">
18+
19+
<title>Litter Snap Users</title>
20+
</head>
21+
22+
<body>
23+
<div class="background-overlay"></div>
24+
<div class="container mt-4 bg-white">
25+
<div class="row">
26+
<div class="col">
27+
<div class="table-responsive"> <!--style="overflow: hidden;"-->
28+
<div class="table table-striped">
29+
<table id="users" class="table">
30+
<caption> Users of LitterSnap </caption>
31+
<!-- Table content -->
32+
<thead>
33+
<tr>
34+
<th> Id </th>
35+
<th> Created At </th>
36+
<th> Created By </th>
37+
<th> Updated At </th>
38+
<th> Updated By </th>
39+
<th> Firstname </th>
40+
<th> Email </th>
41+
<th> Role </th>
42+
</tr>
43+
</thead>
44+
<tbody>
45+
<tr th:if="${users.isEmpty()}">
46+
<td colspan="4"> No Users Available </td>
47+
</tr>
48+
<tr th:each="user : ${users}">
49+
<td><span th:text="${user.getId()}"> Id </span></td>
50+
<td><span th:text="${user.getCreatedAt()}"> Created At </span></td>
51+
<td><span th:text="${user.getCreatedBy()}"> Created By </span></td>
52+
<td><span th:text="${user.getUpdatedAt()}"> Updated At </span></td>
53+
<td><span th:text="${user.getUpdatedBy()}"> Updated By </span></td>
54+
<td><span th:text="${user.getFirstName()}"> Firstname </span></td>
55+
<td><span th:text="${user.getEmail()}"> Email </span></td>
56+
<td><span th:text="${user.getRole()}"> Role </span></td>
57+
</tr>
58+
</tbody>
59+
</table>
60+
</div>
61+
</div>
62+
</div>
63+
</div>
64+
</div>
65+
66+
<div class="row justify-content-center align-items-center min-vh-100">
67+
<div class="col-12 col-md-8 col-lg-6">
68+
69+
<div class="container logo-and-slogan-container">
70+
<div class="row ">
71+
<div class="col-5 col-md-5 col-lg-5">
72+
<img th:src="@{/images/ManAndPhone.png}" alt="Image" class="man-with-the-phone-icon">
73+
</div>
74+
</div>
75+
</div>
76+
77+
<input type="text" class="form-control" id="city" name="city" placeholder="Search ..."
78+
required>
79+
</div>
80+
</div>
81+
82+
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.7/dist/umd/popper.min.js"
83+
integrity="sha384-zYPOMqeu1DAVkHiLqWBUTcbYfZ8osu1Nd6Z89ify25QV9guujx43ITvfi12/QExE"
84+
crossorigin="anonymous"></script>
85+
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.min.js"
86+
integrity="sha384-Y4oOpwW3duJdCWv5ly8SCFYWqFDsfob/3GkgExXKV4idmbt98QcxXYs9UoXAB7BZ"
87+
crossorigin="anonymous"></script>
88+
89+
<div class="footer-overlay">
90+
<footer>
91+
<div class="container-fluid">
92+
<p>&copy; 2023 Vasile, Csaba and Kevin. Wiley Edge. All rights reserved.</p>
93+
</div>
94+
</footer>
95+
</div>
96+
97+
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0/dist/js/bootstrap.bundle.min.js"></script>
98+
</body>
99+
</html>

0 commit comments

Comments
 (0)