Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Communication: Fix link in email notification #9212

Merged
merged 2 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading