Skip to content

Commit ee1e427

Browse files
committed
FIXED: UI .env file issues
1 parent 98856ec commit ee1e427

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

src/main/java/io/github/anantharajuc/sbat/web/controllers/SpringBootApplicationTemplateController.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import org.springframework.core.env.Environment;
1111
import org.springframework.data.domain.Page;
1212
import org.springframework.data.domain.PageRequest;
13+
import org.springframework.security.access.prepost.PreAuthorize;
1314
import org.springframework.stereotype.Controller;
1415
import org.springframework.ui.Model;
1516
import org.springframework.web.bind.annotation.GetMapping;
@@ -156,10 +157,11 @@ public String close()
156157
}
157158

158159
@GetMapping("/listPersons")
160+
//@PreAuthorize("#username == authentication.principal.username")
159161
public String listPersons(Model model, @RequestParam("page") Optional<Integer> page, @RequestParam("size") Optional<Integer> size)
160162
{
161163
final int currentPage = page.orElse(1);
162-
final int pageSize = size.orElse(1000);
164+
final int pageSize = size.orElse(10);
163165

164166
Page<Person> personPage = personQueryServiceImpl.findPaginated(PageRequest.of(currentPage - 1, pageSize));
165167

src/main/resources/application-dev.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ spring.flyway.locations=classpath:/data/mysql/migrations
5757
# Configuring API pagination
5858

5959
# Default page size.
60-
spring.data.web.pageable.default-page-size=100
60+
spring.data.web.pageable.default-page-size=10
6161
# Maximum page size to be accepted
6262
spring.data.web.pageable.max-page-size=500
6363
# Page index parameter name

src/main/resources/templates/fragments/navigation.html

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<nav class="navbar navbar-expand-lg navbar-light bg-light fixed-top">
22
<a class="navbar-brand" href="https://github.com/Spring-Boot-Framework/Spring-Boot-Application-Template" target="_blank" rel="noopener noreferrer">
3-
<img th:src="@{${site_settings.SiteLogo}}" width="30" height="30" alt="" loading="lazy" th:text="${site_settings.SiteInitials}">
3+
<!--<img th:src="@{${site_settings.SiteLogo}}" width="30" height="30" alt="" loading="lazy" th:text="${site_settings.SiteInitials}">-->
4+
<img src="/images/map.svg" width="30" height="30" alt="" loading="lazy" text="SBAT">
45
</a>
56
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
67
<span class="navbar-toggler-icon"></span>
@@ -24,9 +25,8 @@
2425
<a class="nav-link" href="/sbat/form" th:text="#{navbar.form.text}"></span></a>
2526
</li>
2627
<li class="nav-item" sec:authorize="isAuthenticated()">
27-
<a sec:authorize="hasRole('ROLE_PERSON')" class="nav-link" href="/sbat/listPersons" th:text="#{navbar.persons.text}"></span></a>
28+
<a sec:authorize="hasRole('ROLE_ADMIN')" class="nav-link" href="/sbat/listPersons" th:text="#{navbar.persons.text}"></span></a>
2829
</li>
29-
3030

3131
<li class="nav-item dropdown">
3232
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" th:text="Help"></a>
@@ -38,8 +38,7 @@
3838
<a class="dropdown-item notify-item" href="/sbat/security"><img src="/images/security.PNG" alt="user-image" class="mr-1" height="12" th:text="#{navbar.security.text}"></a>
3939
</div>
4040
</li>
41-
42-
41+
4342
</ul>
4443
</br>
4544
<ul class="navbar-nav flex-row ml-md-auto d-none d-md-flex">

src/main/resources/templates/pages/login.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ <h1 th:text="#{login.h1.text}" />
6161
<form id="loginForm" th:action="@{/sbat/login}" method="post">
6262
<div class="form-group">
6363
<label for="username" th:text="#{login.username.text}" />
64-
<input type="text" id="username" name="sbat-username" class="form-control" value="AdminUser" required="" autofocus="" />
64+
<input type="text" id="username" name="sbat-username" class="form-control" value="Admin1" required="" autofocus="" />
6565
</div>
6666
<div class="form-group">
6767
<label for="password" th:text="#{login.password.text}" />

0 commit comments

Comments
 (0)