1

fix some warnings

This commit is contained in:
Christoph
2020-04-08 21:08:57 +02:00
parent 70f3ffdc84
commit 4ac3164569
27 changed files with 94 additions and 92 deletions

View File

@ -223,7 +223,7 @@
<property name="braceAdjustment" value="0"/> <property name="braceAdjustment" value="0"/>
<property name="caseIndent" value="4"/> <property name="caseIndent" value="4"/>
<property name="throwsIndent" value="4"/> <property name="throwsIndent" value="4"/>
<property name="lineWrappingIndentation" value="8"/> <!--<property name="lineWrappingIndentation" value="8"/>-->
<property name="arrayInitIndent" value="4"/> <property name="arrayInitIndent" value="4"/>
</module> </module>
<!-- <module name="VariableDeclarationUsageDistance"/>--> <!-- <module name="VariableDeclarationUsageDistance"/>-->

View File

@ -28,6 +28,7 @@ import static mops.gruppen2.service.ControllerService.getParent;
import static mops.gruppen2.service.ControllerService.getUserLimit; import static mops.gruppen2.service.ControllerService.getUserLimit;
import static mops.gruppen2.service.ControllerService.getVisibility; import static mops.gruppen2.service.ControllerService.getVisibility;
@SuppressWarnings("SameReturnValue")
@Controller @Controller
@SessionScope @SessionScope
@RequestMapping("/gruppen2") @RequestMapping("/gruppen2")

View File

@ -28,6 +28,7 @@ import javax.annotation.security.RolesAllowed;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.UUID; import java.util.UUID;
@SuppressWarnings("SameReturnValue")
@Controller @Controller
@SessionScope @SessionScope
@RequestMapping("/gruppen2") @RequestMapping("/gruppen2")

View File

@ -15,6 +15,7 @@ import javax.annotation.security.RolesAllowed;
import javax.servlet.ServletException; import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
@SuppressWarnings("SameReturnValue")
@Controller @Controller
@Log4j2 @Log4j2
public class GruppenfindungController { public class GruppenfindungController {

View File

@ -27,6 +27,7 @@ import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
@SuppressWarnings("SameReturnValue")
@Controller @Controller
@SessionScope @SessionScope
@RequestMapping("/gruppen2") @RequestMapping("/gruppen2")

View File

@ -11,17 +11,9 @@ import java.util.List;
@Log4j2 @Log4j2
public class APIService { public class APIService {
// private APIService() {} private APIService() {}
public static GroupRequestWrapper wrap(long status, List<Group> groupList) { public static GroupRequestWrapper wrap(long status, List<Group> groupList) {
return new GroupRequestWrapper(status, groupList); return new GroupRequestWrapper(status, groupList);
} }
// public static void updateGroups()
// public static void getGroupIdsOfUser()
// public static void getGroupById()
// public static void updateNecessary()
} }

View File

@ -99,13 +99,13 @@ public class EventStoreService {
* *
* @return Liste von Events * @return Liste von Events
*/ */
static List<Event> getEventsFromDTOs(List<EventDTO> eventDTOS) { private static List<Event> getEventsFromDTOs(List<EventDTO> eventDTOS) {
return eventDTOS.stream() return eventDTOS.stream()
.map(EventStoreService::getEventFromDTO) .map(EventStoreService::getEventFromDTO)
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
static Event getEventFromDTO(EventDTO dto) { private static Event getEventFromDTO(EventDTO dto) {
try { try {
return JsonService.deserializeEvent(dto.getEvent_payload()); return JsonService.deserializeEvent(dto.getEvent_payload());
} catch (JsonProcessingException e) { } catch (JsonProcessingException e) {
@ -136,7 +136,7 @@ public class EventStoreService {
} }
/** /**
* Sucht alle Events, welche zu einer der übergebenen Gruppen gehören * Sucht alle Events, welche zu einer der übergebenen Gruppen gehören.
* *
* @param groupIds Liste an IDs * @param groupIds Liste an IDs
* *
@ -241,7 +241,7 @@ public class EventStoreService {
* *
* @return Eine Liste von einem Add- oder DeleteUserEvent pro Gruppe * @return Eine Liste von einem Add- oder DeleteUserEvent pro Gruppe
*/ */
List<Event> findLatestEventsFromGroupsByUser(User user) { private List<Event> findLatestEventsFromGroupsByUser(User user) {
return getEventsFromDTOs(eventStore.findLatestEventDTOsPartitionedByGroupByUser(user.getId())); return getEventsFromDTOs(eventStore.findLatestEventDTOsPartitionedByGroupByUser(user.getId()));
} }
@ -253,7 +253,7 @@ public class EventStoreService {
* *
* @return Eine Liste von einem Event pro Gruppe * @return Eine Liste von einem Event pro Gruppe
*/ */
List<Event> findLatestEventsFromGroupsByType(String... types) { private List<Event> findLatestEventsFromGroupsByType(String... types) {
return getEventsFromDTOs(eventStore.findLatestEventDTOsPartitionedByGroupByType(Arrays.asList(types))); return getEventsFromDTOs(eventStore.findLatestEventDTOsPartitionedByGroupByType(Arrays.asList(types)));
} }
} }

View File

@ -104,7 +104,7 @@ public class GroupService {
* @return Das neue Teilnehmermaximum * @return Das neue Teilnehmermaximum
*/ */
private static long getAdjustedUserLimit(List<User> newUsers, Group group) { private static long getAdjustedUserLimit(List<User> newUsers, Group group) {
return Math.max(group.getMembers().size() + newUsers.size(), group.getUserLimit()); return Math.max((long) group.getMembers().size() + newUsers.size(), group.getUserLimit());
} }
/** /**
@ -210,7 +210,7 @@ public class GroupService {
eventStoreService.saveEvent(event); eventStoreService.saveEvent(event);
} }
public void updateRole(User user, Group group, Role role) { private void updateRole(User user, Group group, Role role) {
ValidationService.throwIfNoMember(group, user); ValidationService.throwIfNoMember(group, user);
Event event = new UpdateRoleEvent(group, user, role); Event event = new UpdateRoleEvent(group, user, role);

View File

@ -42,7 +42,7 @@
<h1>Metadaten ändern</h1> <h1>Metadaten ändern</h1>
<form method="post" th:action="@{/gruppen2/details/changeMetadata}"> <form method="post" th:action="@{/gruppen2/details/changeMetadata}">
<div class="shadow-sm p-2" <div class="shadow-sm p-2"
style=" border: 10px solid aliceblue; background: aliceblue"> style=" border: 10px solid aliceblue; background: aliceblue;">
<div class="form-group"> <div class="form-group">
<label for="title">Titel</label> <label for="title">Titel</label>
<input class="form-control" id="title" required <input class="form-control" id="title" required
@ -56,7 +56,7 @@
</div> </div>
<div class="form-group pt-4"> <div class="form-group pt-4">
<button class="btn btn-primary" <button class="btn btn-primary"
style="background: #52a1eb; border-style: none" style="background: #52a1eb; border-style: none;"
th:if="${roles.get(user.getId()) == admin}" th:if="${roles.get(user.getId()) == admin}"
th:name="groupId" th:name="groupId"
th:value="${groupId}" th:value="${groupId}"

View File

@ -43,7 +43,7 @@
<div class="col-10"> <div class="col-10">
<h1>Gruppenerstellung</h1> <h1>Gruppenerstellung</h1>
<form enctype="multipart/form-data" method="post" th:action="@{/gruppen2/createOrga}"> <form enctype="multipart/form-data" method="post" th:action="@{/gruppen2/createOrga}">
<div class="shadow-sm p-2" style=" border: 10px solid aliceblue; background: aliceblue"> <div class="shadow-sm p-2" style=" border: 10px solid aliceblue; background: aliceblue;">
<div class="form-group"> <div class="form-group">
<label for="titel">Titel</label> <label for="titel">Titel</label>
<input class="form-control" id="titel" required th:name="title" type="text"> <input class="form-control" id="titel" required th:name="title" type="text">
@ -60,7 +60,7 @@
unbegrenzt</label> unbegrenzt</label>
</div> </div>
<div class="form-group mt-3" id="userMaximum"> <div class="form-group mt-3" id="userMaximum">
<label for="userMaximum">Teilnehmeranzahl</label> <label for="userMax">Teilnehmeranzahl</label>
<input class="form-control" id="userMax" th:name="userMaximum" type="number" min="1" max="100000" value="1"> <input class="form-control" id="userMax" th:name="userMaximum" type="number" min="1" max="100000" value="1">
</div> </div>
<div class="custom-control custom-checkbox" id="privateCheckbox"> <div class="custom-control custom-checkbox" id="privateCheckbox">
@ -96,7 +96,7 @@
</div> </div>
<div class="form-group pt-4"> <div class="form-group pt-4">
<button class="btn btn-primary" <button class="btn btn-primary"
style="background: #52a1eb; border-style: none" style="background: #52a1eb; border-style: none;"
type="submit">Erstellen type="submit">Erstellen
</button> </button>
</div> </div>

View File

@ -39,7 +39,7 @@
<h1>Gruppenerstellung</h1> <h1>Gruppenerstellung</h1>
<form method="post" th:action="@{/gruppen2/createStudent}"> <form method="post" th:action="@{/gruppen2/createStudent}">
<div class="shadow-sm p-2" <div class="shadow-sm p-2"
style=" border: 10px solid aliceblue; border-radius: 5px; background: aliceblue"> style=" border: 10px solid aliceblue; border-radius: 5px; background: aliceblue;">
<div class="form-group"> <div class="form-group">
<label for="titel">Titel</label> <label for="titel">Titel</label>
@ -57,9 +57,9 @@
unbegrenzt</label> unbegrenzt</label>
</div> </div>
<div class="form-group mt-3" id="userMaximum"> <div class="form-group mt-3" id="userMaximum">
<label for="userMaximum">Teilnehmeranzahl</label> <label for="userMax">Teilnehmeranzahl</label>
<input class="form-control" th:name="userMaximum" <input class="form-control" th:name="userMaximum"
type="number" min="1" max="10000"> type="number" min="1" max="10000" id="userMax">
</div> </div>
<div class="custom-control custom-checkbox"> <div class="custom-control custom-checkbox">
<!--DUMMY--> <!--DUMMY-->
@ -77,7 +77,7 @@
</div> </div>
<div class="form-group pt-4"> <div class="form-group pt-4">
<button class="btn btn-primary" <button class="btn btn-primary"
style="background: #52a1eb; border-style: none" style="background: #52a1eb; border-style: none;"
type="submit">Erstellen type="submit">Erstellen
</button> </button>
</div> </div>

View File

@ -33,38 +33,38 @@
<div class="container-fluid"> <div class="container-fluid">
<div> <div>
<div class="shadow-sm p-4 col-8" <div class="shadow-sm p-4 col-8"
style="border: 10px solid aliceblue; display: inline-block; border-radius: 5px; background: aliceblue"> style="border: 10px solid aliceblue; display: inline-block; border-radius: 5px; background: aliceblue;">
<div class="row"> <div class="row">
<div class="col-11"> <div class="col-11">
<h1 style="color: black; font-weight: bold; font-optical-sizing: auto; overflow-wrap: break-word; width: 95%" <h1 style="color: black; font-weight: bold; font-optical-sizing: auto; overflow-wrap: break-word; width: 95%;"
th:text="${group.getTitle()}"></h1> th:text="${group.getTitle()}"></h1>
</div> </div>
<div class="col-1"> <div class="col-1">
<a class="fa fa-pencil" <a class="fa fa-pencil"
style="font-size:30px; width: 5%" style="font-size:30px; width: 5%;"
th:href="@{/gruppen2/details/changeMetadata/{id}(id=${group.getId()})}" th:href="@{/gruppen2/details/changeMetadata/{id}(id=${group.getId()})}"
th:if="${roles.get(user.getId()) == admin}"></a> th:if="${roles.get(user.getId()) == admin}"></a>
</div> </div>
</div> </div>
<h3> <h3>
<span class="badge badge-pill badge-dark" style="background: darkslategray" <span class="badge badge-pill badge-dark" style="background: darkslategray;"
th:if='${group.getVisibility() == group.getVisibility().PRIVATE }'>Private Gruppe</span> th:if='${group.getVisibility() == group.getVisibility().PRIVATE }'>Private Gruppe</span>
<span class="badge badge-pill badge-primary" style="background: #52a1eb" <span class="badge badge-pill badge-primary" style="background: #52a1eb;"
th:if="${group.getVisibility() == group.getVisibility().PUBLIC}">Öffentliche Gruppe</span> th:if="${group.getVisibility() == group.getVisibility().PUBLIC}">Öffentliche Gruppe</span>
<span class="badge badge-pill badge-success" style="background: lightseagreen" <span class="badge badge-pill badge-success" style="background: lightseagreen;"
th:if='${group.getType() == group.getType().LECTURE}'>Veranstaltung</span> th:if='${group.getType() == group.getType().LECTURE}'>Veranstaltung</span>
<span class="badge badge-pill badge-info" style="background: mediumorchid" <span class="badge badge-pill badge-info" style="background: mediumorchid;"
th:text="${parent?.getTitle()}">Parent</span> th:text="${parent?.getTitle()}">Parent</span>
<div class="input-group mb-3" style="margin-top: 10px" <div class="input-group mb-3" style="margin-top: 10px;"
th:if="${roles.get(user.getId()) == admin}"> th:if="${roles.get(user.getId()) == admin}">
<div class="input-group-prepend"> <div class="input-group-prepend">
<span class="input-group-text" id="inputGroup-sizing-default" <span class="input-group-text" id="inputGroup-sizing-default"
style="background: #52a1eb">Einladungslink:</span> style="background: #52a1eb;">Einladungslink:</span>
</div> </div>
<input aria-describedby="basic-addon2" aria-label="Recipient's username" <input aria-describedby="basic-addon2" aria-label="Recipient's username"
class="form-control" class="form-control"
id="groupLink" readonly style="background: white" th:value="${link}" id="groupLink" readonly style="background: white;" th:value="${link}"
type="text"> type="text">
<div class="input-group-append"> <div class="input-group-append">
<button class="btn btn-outline-secondary" onclick="copyLink()" <button class="btn btn-outline-secondary" onclick="copyLink()"
@ -74,23 +74,23 @@
</div> </div>
</h3> </h3>
<br> <br>
<div class="shadow-sm p-4" style="background: white"> <div class="shadow-sm p-4" style="background: white;">
<p style="overflow-wrap: break-word; font-optical-sizing: auto" th:text="${group.getDescription()}"></p> <p style="overflow-wrap: break-word; font-optical-sizing: auto;" th:text="${group.getDescription()}"></p>
</div> </div>
<br> <br>
<div class="text-right btn-toolbar" role="toolbar" style="float: right"> <div class="text-right btn-toolbar" role="toolbar" style="float: right;">
<button class="btn btn-primary" <button class="btn btn-primary"
style="background: #52a1eb; border: none; margin: 5px"> style="background: #52a1eb; border: none; margin: 5px;">
<a style="color: white" th:href="@{/gruppen2}">Zurück</a> <a style="color: white;" th:href="@{/gruppen2}">Zurück</a>
</button> </button>
<form method="post" th:action="@{/gruppen2/leaveGroup}"> <form method="post" th:action="@{/gruppen2/leaveGroup}">
<button class="btn btn-danger" style="border-style: none; margin: 5px" <button class="btn btn-danger" style="border-style: none; margin: 5px;"
th:name="group_id" th:value="${group.getId()}" th:name="group_id" th:value="${group.getId()}"
type="submit">Gruppe verlassen type="submit">Gruppe verlassen
</button> </button>
</form> </form>
<form method="post" th:action="@{/gruppen2/deleteGroup}"> <form method="post" th:action="@{/gruppen2/deleteGroup}">
<button class="btn btn-danger" style="border-style: none; margin: 5px" <button class="btn btn-danger" style="border-style: none; margin: 5px;"
th:name="group_id" th:value="${group.getId()}" th:name="group_id" th:value="${group.getId()}"
th:if="${group.getRoles().get(user.getId()) == admin}" th:if="${group.getRoles().get(user.getId()) == admin}"
type="submit">Gruppe löschen type="submit">Gruppe löschen
@ -98,7 +98,7 @@
</form> </form>
</div> </div>
</div> </div>
<div class="col-4" style="white-space: nowrap; float: right; background: white; display: inline-block; margin-bottom: 100px; margin-top: -8px"> <div class="col-4" style="white-space: nowrap; float: right; background: white; display: inline-block; margin-bottom: 100px; margin-top: -8px;">
<h2>Mitglieder</h2> <h2>Mitglieder</h2>
<div th:switch="${group.getUserLimit() != 100000}"> <div th:switch="${group.getUserLimit() != 100000}">
<h4 th:case="${true}"> <h4 th:case="${true}">
@ -112,7 +112,7 @@
<div th:if="${group.getRoles().get(user.getId()) == admin}"> <div th:if="${group.getRoles().get(user.getId()) == admin}">
<form method="get" <form method="get"
th:action="@{/gruppen2/details/members/{id}(id=${group.getId()})}"> th:action="@{/gruppen2/details/members/{id}(id=${group.getId()})}">
<button class="btn btn-secondary" style="background: slategrey; float: left"> <button class="btn btn-secondary" style="background: slategrey; float: left;">
Mitglieder bearbeiten Mitglieder bearbeiten
</button> </button>
</form> </form>
@ -120,10 +120,10 @@
<br> <br>
</div> </div>
<div style="overflow-y: scroll; <div style="overflow-y: scroll;
height:60vh"> height:60vh;">
<ul class="list-group-flush" style="background: slategrey" <ul class="list-group-flush" style="background: slategrey;"
th:each="member : ${group.getMembers()}"> th:each="member : ${group.getMembers()}">
<li class="list-group-item" style="background: aliceblue"> <li class="list-group-item" style="background: aliceblue;">
<span th:if='${group.getVisibility() == public}' th:text="${member.getId()}"></span> <span th:if='${group.getVisibility() == public}' th:text="${member.getId()}"></span>
<span th:if='${group.getVisibility() == private}' th:text="${#strings.abbreviate(member.getGivenname(), 15) + ' ' + member.getFamilyname().substring(0, 1) + '.'}"></span> <span th:if='${group.getVisibility() == private}' th:text="${#strings.abbreviate(member.getGivenname(), 15) + ' ' + member.getFamilyname().substring(0, 1) + '.'}"></span>
<span class="badge badge-success" <span class="badge badge-success"

View File

@ -29,21 +29,21 @@
</header> </header>
<main th:fragment="bodycontent"> <main th:fragment="bodycontent">
<div class="container-fluid"> <div class="container-fluid">
<div class="shadow-sm p-4" style="border: 1px solid aliceblue; border-radius: 5px; background: aliceblue"> <div class="shadow-sm p-4" style="border: 1px solid aliceblue; border-radius: 5px; background: aliceblue;">
<h1 style="color: black; font-weight: bold; font-optical-sizing: auto; overflow-wrap: break-word" th:text="${group.getTitle()}"></h1> <h1 style="color: black; font-weight: bold; font-optical-sizing: auto; overflow-wrap: break-word;" th:text="${group.getTitle()}"></h1>
<h3> <h3>
<span class="badge badge-pill badge-dark" style="background: darkslategray" <span class="badge badge-pill badge-dark" style="background: darkslategray;"
th:if='${group.getVisibility() == group.getVisibility().PRIVATE }'>Private Gruppe</span> th:if='${group.getVisibility() == group.getVisibility().PRIVATE }'>Private Gruppe</span>
<span class="badge badge-pill badge-primary" style="background: #52a1eb" <span class="badge badge-pill badge-primary" style="background: #52a1eb;"
th:if="${group.getVisibility() == group.getVisibility().PUBLIC}">Öffentliche Gruppe</span> th:if="${group.getVisibility() == group.getVisibility().PUBLIC}">Öffentliche Gruppe</span>
<span class="badge badge-pill badge-success" <span class="badge badge-pill badge-success"
style="background: lightseagreen" style="background: lightseagreen;"
th:if='${group.getType() == lecture}'> Veranstaltung</span> th:if='${group.getType() == lecture}'> Veranstaltung</span>
<span class="badge badge-pill badge-info" style="background: mediumorchid" <span class="badge badge-pill badge-info" style="background: mediumorchid;"
th:text="${parent?.getTitle()}">Parent</span> th:text="${parent?.getTitle()}">Parent</span>
</h3> </h3>
<div class="shadow-sm p-4" style="background: white"> <div class="shadow-sm p-4" style="background: white;">
<p style="overflow-wrap: break-word; font-optical-sizing: auto" <p style="overflow-wrap: break-word; font-optical-sizing: auto;"
th:text="${group.getDescription()}"></p> th:text="${group.getDescription()}"></p>
</div> </div>
</div> </div>

View File

@ -47,7 +47,7 @@
</h5> </h5>
<h5 th:case="${false}"> unbegrenzte Teilnehmeranzahl</h5> <h5 th:case="${false}"> unbegrenzte Teilnehmeranzahl</h5>
</div> </div>
<div class="shadow p-2" style="border: 10px solid aliceblue; background: aliceblue"> <div class="shadow p-2" style="border: 10px solid aliceblue; background: aliceblue;">
<div class="form-group pt-4" th:if="${account.getRoles().contains('orga')}"> <div class="form-group pt-4" th:if="${account.getRoles().contains('orga')}">
<form th:action="@{/gruppen2/details/members/addUsersFromCsv}" <form th:action="@{/gruppen2/details/members/addUsersFromCsv}"
enctype="multipart/form-data" enctype="multipart/form-data"
@ -62,10 +62,10 @@
</div> </div>
<div class="input-group-append"> <div class="input-group-append">
<button class="btn btn-outline-secondary" <button class="btn btn-outline-secondary"
style="background: #52a1eb; border-style: none" style="background: #52a1eb; border-style: none;"
th:name="group_id" th:value="${group.getId()}" th:name="group_id" th:value="${group.getId()}"
type="submit"> type="submit">
<a style="color: white">Hinzufügen</a> <a style="color: white;">Hinzufügen</a>
</button> </button>
</div> </div>
</div> </div>
@ -74,29 +74,31 @@
<div class="form-group pt-4"> <div class="form-group pt-4">
<form method="post" th:action="@{/gruppen2/details/members/changeMaximum}"> <form method="post" th:action="@{/gruppen2/details/members/changeMaximum}">
<div class="input-group mb-3" id="userMaximum"> <div class="input-group mb-3" id="userMaximum">
<label for="teilnehmerzahl"></label>
<input class="form-control" <input class="form-control"
id="teilnehmerzahl"
placeholder="Maximale Teilnehmerzahl ändern..." placeholder="Maximale Teilnehmerzahl ändern..."
th:name="maximum" th:name="maximum"
type="number" th:min="${group.getMembers().size()}" type="number" th:min="${group.getMembers().size()}"
max="10000"> max="10000">
<div class="input-group-append"> <div class="input-group-append">
<button class="btn btn-outline-secondary" <button class="btn btn-outline-secondary"
style="background: #52a1eb; border-style: none" style="background: #52a1eb; border-style: none;"
th:name="group_id" th:value="${group.getId()}" th:name="group_id" th:value="${group.getId()}"
type="submit"> type="submit">
<a style="color: white">Speichern</a> <a style="color: white;">Speichern</a>
</button> </button>
</div> </div>
</div> </div>
</form> </form>
</div> </div>
<table class="table" style="table-layout: fixed"> <table class="table" style="table-layout: fixed;">
<thead> <thead>
<tr> <tr>
<th scope="col">Mitglied</th> <th scope="col">Mitglied</th>
<th scope="col" style="width: 180px">Rolle</th> <th scope="col" style="width: 180px;">Rolle</th>
<th scope="col" style="width: 280px">Optionen</th> <th scope="col" style="width: 280px;">Optionen</th>
</tr> </tr>
</thead> </thead>
<tbody class="table-striped"> <tbody class="table-striped">
@ -124,7 +126,7 @@
type="hidden"> type="hidden">
<input th:name="user_id" th:value="${member.getId()}" <input th:name="user_id" th:value="${member.getId()}"
type="hidden"> type="hidden">
<button class="btn btn-danger btn-sm" style="margin: 5px" <button class="btn btn-danger btn-sm" style="margin: 5px;"
th:if='!${account.getName().equals(member.getId())}'> th:if='!${account.getName().equals(member.getId())}'>
Mitglied entfernen Mitglied entfernen
</button> </button>
@ -135,7 +137,7 @@
</tbody> </tbody>
</table> </table>
<form method="get" th:action="@{/gruppen2/details/{id}(id=${group.getId()})}"> <form method="get" th:action="@{/gruppen2/details/{id}(id=${group.getId()})}">
<button class="btn btn-primary" style="background: #52a1eb; border-style: none" type="submit"> <button class="btn btn-primary" style="background: #52a1eb; border-style: none;" type="submit">
Fertig Fertig
</button> </button>
</form> </form>

View File

@ -11,7 +11,7 @@
</head> </head>
<body> <body>
<div class="mx-auto" style="vertical-align: center; border-radius: 5px; horiz-align: center; top: 50%; left: 50%;"> <div class="mx-auto" style="vertical-align: center; border-radius: 5px; horiz-align: center; top: 50%; left: 50%;">
<div class="jumbotron" style="background: aliceblue"> <div class="jumbotron" style="background: aliceblue;">
<div class="container"> <div class="container">
<h1 class="display-3">UPSI</h1> <h1 class="display-3">UPSI</h1>
<p class="lead">Da ist wohl etwas schiefgelaufen :(</p><br> <p class="lead">Da ist wohl etwas schiefgelaufen :(</p><br>
@ -30,7 +30,7 @@
<button class="btn btn-primary" <button class="btn btn-primary"
style="background: #52a1eb; border-style: none;"> style="background: #52a1eb; border-style: none;">
<a href="#" onclick="window.history.back(-1);return false;" role="button" <a href="#" onclick="window.history.back(-1);return false;" role="button"
style="color: white">Zurück</a> style="color: white;">Zurück</a>
</button> </button>
</div> </div>
</div> </div>

View File

@ -34,28 +34,28 @@
<div class="col-10"> <div class="col-10">
<h1>Meine Gruppen</h1> <h1>Meine Gruppen</h1>
<form method="get" th:action="@{/}"> <form method="get" th:action="@{/}">
<h3 style="color: dodgerblue; font-weight: bold; font-optical-sizing: auto"> <h3 style="color: dodgerblue; font-weight: bold; font-optical-sizing: auto;">
<small style="font-weight: normal; color: black">Mitglied in </small> <small style="font-weight: normal; color: black;">Mitglied in </small>
<small style="font-weight: bold; color: black" <small style="font-weight: bold; color: black;"
th:text="${gruppen.size()}"></small> th:text="${gruppen.size()}"></small>
<small style="font-weight: normal; color: black" <small style="font-weight: normal; color: black;"
th:if='${gruppen.size()==1}'> Gruppe.</small> th:if='${gruppen.size()==1}'> Gruppe.</small>
<small style="font-weight: normal; color: black" <small style="font-weight: normal; color: black;"
th:if='${gruppen.size()!=1}'> Gruppen.</small> th:if='${gruppen.size()!=1}'> Gruppen.</small>
</h3> </h3>
<br> <br>
<div th:each="gruppe: ${gruppen}"> <div th:each="gruppe: ${gruppen}">
<div class="shadow-sm p-4" <div class="shadow-sm p-4"
style="border: none; border-radius: 5px; background: aliceblue"> style="border: none; border-radius: 5px; background: aliceblue;">
<h3 style="color: dodgerblue; font-weight: bold; font-optical-sizing: auto; overflow-wrap: break-word"> <h3 style="color: dodgerblue; font-weight: bold; font-optical-sizing: auto; overflow-wrap: break-word;">
<span class="badge badge-pill badge-success" <span class="badge badge-pill badge-success"
style="background: lightseagreen; margin-right: 25px; float: right" style="background: lightseagreen; margin-right: 25px; float: right;"
th:if='${gruppe.getType() == lecture}'>Veranstaltung</span> th:if='${gruppe.getType() == lecture}'>Veranstaltung</span>
<a th:href="@{/gruppen2/details/{id}(id=${gruppe.getId()})}" <a th:href="@{/gruppen2/details/{id}(id=${gruppe.getId()})}"
th:text="${gruppe.getTitle()}"></a> th:text="${gruppe.getTitle()}"></a>
</h3> </h3>
<div class="shadow-sm p-4" style="background: white"> <div class="shadow-sm p-4" style="background: white;">
<p style="overflow-wrap: break-word; font-optical-sizing: auto" <p style="overflow-wrap: break-word; font-optical-sizing: auto;"
th:text="${#strings.abbreviate(gruppe.getDescription(),300)}"></p> th:text="${#strings.abbreviate(gruppe.getDescription(),300)}"></p>
</div> </div>
</div> </div>

View File

@ -34,11 +34,11 @@
<main th:fragment="bodycontent"> <main th:fragment="bodycontent">
<div class="container-fluid"> <div class="container-fluid">
<div class="shadow-sm p-4" <div class="shadow-sm p-4"
style="border: 1px solid aliceblue; border-radius: 5px; background: aliceblue"> style="border: 1px solid aliceblue; border-radius: 5px; background: aliceblue;">
<h1 style="color: black; font-weight: bold; font-optical-sizing: auto; overflow-wrap: break-word" <h1 style="color: black; font-weight: bold; font-optical-sizing: auto; overflow-wrap: break-word;"
th:text="${group.getTitle()}"></h1> th:text="${group.getTitle()}"></h1>
<div class="shadow-sm p-4" style="background: white"> <div class="shadow-sm p-4" style="background: white;">
<p style="overflow-wrap: break-word; font-optical-sizing: auto" <p style="overflow-wrap: break-word; font-optical-sizing: auto;"
th:text="${group.getDescription()}"></p> th:text="${group.getDescription()}"></p>
</div> </div>
<div class="form-group mt-2" th:if="${group.getMembers().size() < group.getUserLimit()}"> <div class="form-group mt-2" th:if="${group.getMembers().size() < group.getUserLimit()}">

View File

@ -34,7 +34,7 @@
<div class="col-10"> <div class="col-10">
<h1>Gruppensuche</h1> <h1>Gruppensuche</h1>
<div class="shadow-sm p-2" <div class="shadow-sm p-2"
style="border: 10px solid aliceblue; border-radius: 5px; background: aliceblue"> style="border: 10px solid aliceblue; border-radius: 5px; background: aliceblue;">
<form method="get" th:action="@{/gruppen2/search}"> <form method="get" th:action="@{/gruppen2/search}">
<div class="form-group"> <div class="form-group">
<label for="suchleiste">Suchbegriff:</label> <label for="suchleiste">Suchbegriff:</label>
@ -43,12 +43,12 @@
th:name="suchbegriff" type="text"> th:name="suchbegriff" type="text">
</div> </div>
<button class="btn btn-primary" <button class="btn btn-primary"
style="background: #52a1eb; border-style: none" style="background: #52a1eb; border-style: none;"
type="submit">Suchen type="submit">Suchen
</button> </button>
<button class="btn btn-primary" style="background: deepskyblue; border-style: none" type="submit"> <button class="btn btn-primary" style="background: deepskyblue; border-style: none;" type="submit">
<a href="/gruppen2/search?suchbegriff=" style="color: white">Alle <a href="/gruppen2/search?suchbegriff=" style="color: white;">Alle
anzeigen</a> anzeigen</a>
</button> </button>
</form> </form>
</div> </div>

View File

@ -6,6 +6,7 @@ import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest @SpringBootTest
class Gruppen2ApplicationTests { class Gruppen2ApplicationTests {
@SuppressWarnings("EmptyMethod")
@Test @Test
void contextLoads() { void contextLoads() {
} }

View File

@ -11,7 +11,7 @@ import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.classes;
import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.noClasses; import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.noClasses;
@AnalyzeClasses(packages = "mops.gruppen2", importOptions = ImportOption.DoNotIncludeTests.class) @AnalyzeClasses(packages = "mops.gruppen2", importOptions = ImportOption.DoNotIncludeTests.class)
public class ControllerTest { class ControllerTest {
@ArchTest @ArchTest
public static final ArchRule controllerClassesShouldBeAnnotatedWithControllerOrRestControllerAnnotation = classes() public static final ArchRule controllerClassesShouldBeAnnotatedWithControllerOrRestControllerAnnotation = classes()

View File

@ -10,7 +10,7 @@ import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.classes;
import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.noClasses; import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.noClasses;
@AnalyzeClasses(packages = "mops.gruppen2", importOptions = ImportOption.DoNotIncludeTests.class) @AnalyzeClasses(packages = "mops.gruppen2", importOptions = ImportOption.DoNotIncludeTests.class)
public class DomainTest { class DomainTest {
@ArchTest @ArchTest
public static final ArchRule domainClassesShouldNotAccessClassesFromOtherPackagesExceptDomainItself = noClasses() public static final ArchRule domainClassesShouldNotAccessClassesFromOtherPackagesExceptDomainItself = noClasses()

View File

@ -7,7 +7,7 @@ import com.tngtech.archunit.lang.ArchRule;
import com.tngtech.archunit.library.Architectures; import com.tngtech.archunit.library.Architectures;
@AnalyzeClasses(packages = "mops.gruppen2", importOptions = ImportOption.DoNotIncludeTests.class) @AnalyzeClasses(packages = "mops.gruppen2", importOptions = ImportOption.DoNotIncludeTests.class)
public class LayeredArchitectureTest { class LayeredArchitectureTest {
private static final Architectures.LayeredArchitecture layeredArchitecture = Architectures private static final Architectures.LayeredArchitecture layeredArchitecture = Architectures
.layeredArchitecture() .layeredArchitecture()

View File

@ -10,7 +10,7 @@ import org.springframework.stereotype.Repository;
import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.classes; import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.classes;
@AnalyzeClasses(packages = "mops.gruppen2", importOptions = ImportOption.DoNotIncludeTests.class) @AnalyzeClasses(packages = "mops.gruppen2", importOptions = ImportOption.DoNotIncludeTests.class)
public class RepositoryTest { class RepositoryTest {
@ArchTest @ArchTest
public static final ArchRule repositoryClassesThatAreAnnotatedWithRepositoryShouldHaveRepositoryInName = classes() public static final ArchRule repositoryClassesThatAreAnnotatedWithRepositoryShouldHaveRepositoryInName = classes()

View File

@ -9,7 +9,7 @@ import org.springframework.stereotype.Service;
import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.classes; import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.classes;
@AnalyzeClasses(packages = "mops.gruppen2", importOptions = ImportOption.DoNotIncludeTests.class) @AnalyzeClasses(packages = "mops.gruppen2", importOptions = ImportOption.DoNotIncludeTests.class)
public class ServiceTest { class ServiceTest {
@ArchTest @ArchTest
public static final ArchRule serviceClassesShouldHaveServiceInName = classes() public static final ArchRule serviceClassesShouldHaveServiceInName = classes()

View File

@ -42,6 +42,7 @@ class APIControllerTest {
@Autowired @Autowired
private JdbcTemplate template; private JdbcTemplate template;
@SuppressWarnings("SyntaxError")
@BeforeEach @BeforeEach
void setUp() { void setUp() {
eventRepository.deleteAll(); eventRepository.deleteAll();

View File

@ -35,6 +35,7 @@ class EventStoreServiceTest {
@Autowired @Autowired
private JdbcTemplate template; private JdbcTemplate template;
@SuppressWarnings("SyntaxError")
@BeforeEach @BeforeEach
void setUp() { void setUp() {
eventStoreService = new EventStoreService(eventRepository); eventStoreService = new EventStoreService(eventRepository);

View File

@ -57,6 +57,7 @@ class GroupServiceTest {
@Autowired @Autowired
private InviteService inviteService; private InviteService inviteService;
@SuppressWarnings("SyntaxError")
@BeforeEach @BeforeEach
void setUp() { void setUp() {
groupService = new GroupService(eventStoreService, inviteService); groupService = new GroupService(eventStoreService, inviteService);