Skip to content

Commit da4c45f

Browse files
committed
## 2.3.31
* fixed #311 User Selfservice is broken * Issue #312 User2UserMessage Chat is broken * fixed #313 Change Password - update HTML Layout to current Bootstrap Version * fixed #314 Set Default Language - update HTML Layout to current Bootstrap Version * fixed #315 Add Context - update HTML Layout to current Bootstrap Version * fixed #316 Add Context - add Back Button * Issue #317 switch Context is broken * Issue #318 Broken: http://localhost:8080/taskstate/task/1153/changeorderto/1051
1 parent 58b694e commit da4c45f

File tree

4 files changed

+21
-10
lines changed

4 files changed

+21
-10
lines changed

.idea/compiler.xml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/java/org/woehlke/simpleworklist/user/chat/User2UserMessageController.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
@RequestMapping(path = "/user2user")
3232
public class User2UserMessageController extends AbstractController {
3333

34-
@RequestMapping(path = "/{userId}/messages", method = RequestMethod.GET)
34+
@RequestMapping(path = "/{userId}/messages/", method = RequestMethod.GET)
3535
public final String getLastMessagesBetweenCurrentAndOtherUser(
3636
@PathVariable("userId") UserAccount otherUser,
3737
@PageableDefault(sort = "rowCreatedAt", direction = Sort.Direction.DESC) Pageable request,
@@ -55,7 +55,7 @@ public final String getLastMessagesBetweenCurrentAndOtherUser(
5555
return "user/messages/all";
5656
}
5757

58-
@RequestMapping(path = "/{userId}/", method = RequestMethod.POST)
58+
@RequestMapping(path = "/{userId}/messages/", method = RequestMethod.POST)
5959
public final String sendNewMessageToOtherUser(
6060
@PathVariable("userId") UserAccount otherUser,
6161
@Valid @ModelAttribute("newUser2UserMessage") User2UserMessageFormBean user2UserMessageFormBean,
@@ -84,7 +84,7 @@ public final String sendNewMessageToOtherUser(
8484
} else {
8585
user2UserMessageService.sendNewUserMessage(thisUser, otherUser, user2UserMessageFormBean);
8686
model.addAttribute("userSession", userSession);
87-
return "redirect:/user/messages/" + otherUser.getId();
87+
return "redirect:/user2user/" + otherUser.getId() + "/messages/";
8888
}
8989
}
9090

src/main/java/org/woehlke/simpleworklist/user/services/User2UserMessageServiceImpl.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import org.woehlke.simpleworklist.user.services.User2UserMessageService;
1616

1717
import java.util.List;
18+
import java.util.UUID;
1819

1920
/**
2021
* Created by tw on 16.02.2016.
@@ -43,6 +44,7 @@ public User2UserMessage sendNewUserMessage(
4344
m.setSender(thisUser);
4445
m.setReceiver(otherUser);
4546
m.setReadByReceiver(false);
47+
m.setUuid(UUID.randomUUID().toString());
4648
m.setMessageText(user2UserMessageFormBean.getMessageText());
4749
return userMessageRepository.saveAndFlush(m);
4850
}

src/main/resources/templates/user/messages/all.html

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ <h1>
2222
<div th:each="m : ${user2UserMessagePage}">
2323
<div class="row">
2424
<div class="col">
25-
<div class="alert alert-info" role="alert" th:style="${m.sender.id == otherUser.id ? 'width: 66%; float:right' : 'width: 66%; float:left'}">
25+
<div class="alert alert-info" role="alert"
26+
th:style="${m.sender.id == otherUser.id ? 'width: 66%; float:right' : 'width: 66%; float:left'}">
2627
<span th:text="${m.messageText}" ></span>
2728
<span style="float:right">
2829
<small>
@@ -37,19 +38,20 @@ <h1>
3738
<div class="row" id="newUser2UserMessageForm">
3839
<div class="col">
3940
<div class="card card-body">
40-
<form id="formId" th:action="@{/user2user/{userId}/messages/(userId=${otherUser.id})}" th:object="${user2UserMessageFormBean}" method="post">
41-
<div class="form-group form-control-lg">
41+
<form id="formId" th:action="@{/user2user/{userId}/messages/(userId=${otherUser.id})}"
42+
th:object="${newUser2UserMessage}" method="post">
43+
<div class="form-group">
4244
<label for="textEditor" class="control-label">
4345
<span th:utext="#{pages.user2UserMessages.newMessage}">New Message:</span>
4446
</label>
4547
<textarea id="textEditor" rows="3" cols="50"
46-
th:field="*{messageText}" class="form-control" />
48+
th:field="*{messageText}" class="form-control form-control-lg" />
4749
<div>
4850
<div th:each="err : ${#fields.errors('messageText')}"
4951
th:text="${err}" class="invalid-feedback" />
5052
</div>
5153
</div>
52-
<div class="form-group form-control-lg">
54+
<div class="form-group">
5355
</div>
5456
<button id="newUserMessageButton" type="submit" class="btn btn-primary">
5557
<i class="fas fa-envelope"></i>
@@ -66,9 +68,13 @@ <h1>
6668
</div>
6769
</div>
6870

69-
<script th:src="@{/webjars/ckeditor/4.11.3/full/ckeditor.js}"></script>
71+
<script th:src="@{/webjars/ckeditor/18.0.0/inline/ckeditor.js}"></script>
7072
<script th:inline="javascript">
71-
CKEDITOR.replace( 'textEditor' );
73+
InlineEditor
74+
.create( document.querySelector( '#textEditor' ) )
75+
.catch( error => {
76+
console.error( error );
77+
} );
7278
</script>
7379
</body>
7480
</html>

0 commit comments

Comments
 (0)