Skip to content

Commit

Permalink
Communication: Fix link in email notification (#9212)
Browse files Browse the repository at this point in the history
  • Loading branch information
Strohgelaender committed Aug 21, 2024
1 parent 0d44cc1 commit 93e5704
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -339,11 +339,11 @@ public static String extractNotificationUrl(Notification notification, String ba
* If the post is not associated with a conversation or messaging is disabled in the course, the URL leads to the communication page.
*
* @param post which information will be needed to create the URL
* @param baseUrl the prefix (depends on current set up (e.g. "http://localhost:9000/courses"))
* @param baseUrl the prefix (depends on current set up (e.g. "http://localhost:9000"))
* @return viable URL to the notification related page
*/
public static String extractNotificationUrl(Post post, String baseUrl) {
// e.g. http://localhost:8080/courses/1/messages?conversationId=123
return baseUrl + "/courses/" + post.getConversation().getCourse().getId() + "/messages?conversationId=" + post.getConversation().getId();
// e.g. http://localhost:8080/courses/1/communication?conversationId=123
return baseUrl + "/courses/" + post.getConversation().getCourse().getId() + "/communication?conversationId=" + post.getConversation().getId();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ class NotificationTargetFactoryTest {

private static final String BASE_URL = "https://artemistest.ase.in.tum.de";

private static final String MESSAGES_CONVERSATION = "messages?conversationId=";

private String resultingURL;

private static final String PROBLEM_STATEMENT = "problem statement";
Expand All @@ -74,8 +72,8 @@ class NotificationTargetFactoryTest {

// expected/correct URLs

// e.g. https://artemistest.ase.in.tum.de/courses/477/discussion?searchText=%232000
private static final String EXPECTED_POST_URL = BASE_URL_COURSES_COURSE_ID + "/" + MESSAGES_CONVERSATION + CHANNEL_ID;
// e.g. https://artemistest.ase.in.tum.de/courses/477/communication?conversationId=2000
private static final String EXPECTED_POST_URL = BASE_URL_COURSES_COURSE_ID + "/" + "communication?conversationId=" + CHANNEL_ID;

// e.g. https://artemistest.ase.in.tum.de/courses/477/lectures/199
private static final String EXPECTED_ATTACHMENT_CHANGED_URL = BASE_URL_COURSES_COURSE_ID + "/" + LECTURES_TEXT + "/" + LECTURE_ID;
Expand Down

0 comments on commit 93e5704

Please sign in to comment.