Skip to content

Communication: Show indication if forwarded post has been deleted #10434

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

Merged
merged 19 commits into from
Apr 30, 2025

Conversation

julian-wls
Copy link
Contributor

@julian-wls julian-wls commented Mar 2, 2025

Checklist

General

Client

  • Important: I implemented the changes with a very good performance, prevented too many (unnecessary) REST calls and made sure the UI is responsive, even with large data (e.g. using paging).
  • I strictly followed the principle of data economy for all client-server REST calls.
  • I strictly followed the client coding and design guidelines.
  • Following the theming guidelines, I specified colors only in the theming variable files and checked that the changes look consistent in both the light and the dark theme.
  • I documented the TypeScript code using JSDoc style.
  • I added multiple screenshots/screencasts of my UI changes.
  • I translated all newly inserted strings into English and German.

Motivation and Context

When a message has been forwarded and is deleted afterwards the forwarded message currently does not reflect this information, instead the forwarded message is not shown at all.

Description

This PR makes it possible for users to see whether the source post has been deleted by showing a short info.
Instead of skipping the forwarded messages for which a post wasn't found in the database, undefined is added to the list of forwarded messages. In forwarded-message.component.ts undefined checks have been added to show an indication for these messages. If an undefined value is found the forwarded message cannot show any post information and falls back to the information state, which shows an information label instead.

Before:
image

After:
image

Steps for Testing

Prerequisites:

  • 1 Student
  • 1 Course with Communication enabled
  1. Log in to Artemis
  2. Navigate to Course Communication
  3. Go to conversation A.
  4. Forward a message to channel B
  5. Delete this source message
  6. Go to channel B and verify that a placeholder is shown indicating that the source message has been deleted.

Testserver States

You can manage test servers using Helios. Check environment statuses in the environment list. To deploy to a test server, go to the CI/CD page, find your PR or branch, and trigger the deployment.

Review Progress

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Test Coverage

Client

Class/File Line Coverage Confirmation (assert/expect)
conversation-messages.component.ts 95.86%
forwarded-message.component.ts 86.95%
post.component.ts 95.91%
posting-reactions-bar.component.ts 83.87%
posting-thread.component.ts 92.3%
answer-post.model.ts 100%
post.model.ts 100%

Summary by CodeRabbit

  • New Features

    • Enhanced handling and display of forwarded messages, including informative messages for deleted posts and clear presentation of author details and posting dates.
    • Added localized notifications to indicate when forwarded content originates from an unknown conversation.
  • Style

    • Updated visual styling for forwarded message components to better differentiate and highlight missing or deleted messages.
  • Bug Fixes

    • Improved robustness in the handling of null values within forwarded posts and answer posts, ensuring graceful management of missing content.

@julian-wls julian-wls self-assigned this Mar 2, 2025
@julian-wls julian-wls requested a review from a team as a code owner March 2, 2025 17:17
@github-project-automation github-project-automation bot moved this to Work In Progress in Artemis Development Mar 2, 2025
@github-actions github-actions bot added the client Pull requests that update TypeScript code. (Added Automatically!) label Mar 2, 2025
@julian-wls julian-wls added the communication Pull requests that affect the corresponding module label Mar 2, 2025
Copy link
Contributor

coderabbitai bot commented Mar 2, 2025

Walkthrough

This pull request updates several model and component files to allow forwarded post properties to include null values by changing their types from strictly non-null arrays to arrays of (Type | null). Additionally, component logic is modified to better handle cases where referenced posts are missing or deleted. The updates include changes to type declarations, navigation checks, conditional UI rendering, styling adjustments, and new translation keys for forwarded message statuses.

Changes

File(s) Change Summary
src/.../metis/answer-post.model.ts, src/.../metis/post.model.ts Updated type declarations for forwardedPosts and forwardedAnswerPosts to allow `(Type
src/.../metis/post.component.ts, src/.../metis/posting-thread/posting-thread.component.ts, src/.../metis/posting-reactions-bar/posting-reactions-bar.component.ts, src/.../course-conversations/layout/conversation-messages/conversation-messages.component.ts Modified component logic and type-checks for handling forwarded posts: simplified navigation, enhanced filtering, and ensured robust processing of missing or deleted posts.
src/.../forwarded-message/forwarded-message.component.ts, src/.../forwarded-message/forwarded-message.component.html, src/.../forwarded-message/forwarded-message.component.scss, src/.../metis/post/post.component.html Updated UI templates and styles to conditionally render forwarded message content and display messages when the original post is deleted.
src/.../i18n/de/metis.json, src/.../i18n/en/metis.json Added new translation keys for forwarded message statuses (“forwarded from unknown” and “message deleted”).

Possibly related PRs

Suggested labels

tests, small, bugfix, component:Communication

Suggested reviewers

  • PaRangger
  • HawKhiem
  • cremertim

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7795ed5 and 586e4e4.

📒 Files selected for processing (1)
  • src/test/javascript/spec/component/overview/course-conversations/layout/conversation-messages/conversation-messages.component.spec.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/test/javascript/spec/component/overview/course-conversations/layout/conversation-messages/conversation-messages.component.spec.ts
⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: Call Build Workflow / Build .war artifact
  • GitHub Check: Call Build Workflow / Build and Push Docker Image
  • GitHub Check: client-tests-selected
  • GitHub Check: client-tests
  • GitHub Check: server-tests
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Analyse

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

coderabbitai[bot]
coderabbitai bot previously approved these changes Mar 2, 2025
@github-actions github-actions bot added tests and removed communication Pull requests that affect the corresponding module labels Mar 2, 2025
@julian-wls julian-wls added communication Pull requests that affect the corresponding module and removed tests labels Mar 2, 2025
coderabbitai[bot]
coderabbitai bot previously approved these changes Mar 2, 2025
@github-actions github-actions bot added tests and removed communication Pull requests that affect the corresponding module labels Mar 2, 2025
@julian-wls julian-wls added communication Pull requests that affect the corresponding module and removed tests labels Mar 2, 2025
coderabbitai[bot]
coderabbitai bot previously approved these changes Mar 2, 2025
@helios-aet helios-aet bot temporarily deployed to artemis-test1.artemis.cit.tum.de March 3, 2025 08:45 Inactive
@helios-aet helios-aet bot temporarily deployed to artemis-test2.artemis.cit.tum.de March 3, 2025 09:40 Inactive
@helios-aet helios-aet bot temporarily deployed to artemis-test1.artemis.cit.tum.de March 4, 2025 12:35 Inactive
Copy link
Contributor

@AjayvirS AjayvirS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on TS1, however the placeholder does not seem to be visible. Let me know if this behavior is intended:

Screen.Recording.2025-03-04.134422.mp4

eylulnc
eylulnc previously approved these changes Apr 19, 2025
Copy link
Contributor

@eylulnc eylulnc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on TS3, works as expected.

asliayk
asliayk previously approved these changes Apr 19, 2025
Copy link
Contributor

@asliayk asliayk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested on ts3, reapprove

@helios-aet helios-aet bot temporarily deployed to artemis-test3.artemis.cit.tum.de April 19, 2025 09:13 Inactive
Copy link
Contributor

@PaRangger PaRangger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on TS3. I forwarded and deleted a post and it worked fine, however when forwarding and deleting an answer post it did not show the indicator.

Bildschirmfoto 2025-04-19 um 11 19 13

@helios-aet helios-aet bot temporarily deployed to artemis-test3.artemis.cit.tum.de April 19, 2025 10:00 Inactive
Copy link
Contributor

@PaRangger PaRangger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on TS3. Works now for answer messages too, thanks!! 🥳

Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
End-to-End (E2E) Test Report201 ran196 passed3 skipped2 failed49m 40s 787ms
TestResultTime ⏱
End-to-End (E2E) Test Report
e2e/course/CourseMessages.spec.ts
ts.Course messages › Channel messages › Write/edit/delete message in channel › Student should be able to edit message in channel❌ failure2m 3s 50ms
e2e/exercise/programming/ProgrammingExerciseStaticCodeAnalysis.spec.ts
ts.Static code analysis tests › Configures SCA grading and makes a successful submission with SCA errors❌ failure1m 46s 892ms

@helios-aet helios-aet bot temporarily deployed to artemis-test6.artemis.cit.tum.de April 22, 2025 18:38 Inactive
Copy link
Contributor

@eylulnc eylulnc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested again on TS6.
The indicator visible for both deleted conversations and answers.

@helios-aet helios-aet bot temporarily deployed to artemis-test3.artemis.cit.tum.de April 23, 2025 13:11 Inactive
Copy link

@HawKhiem HawKhiem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on TS3. Works as expected

image

Copy link
Contributor

@asliayk asliayk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

retested on ts3

Copy link
Contributor

@FelberMartin FelberMartin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-approve

@krusche krusche added this to the 8.0.4 milestone Apr 30, 2025
@krusche krusche merged commit 215cc4a into develop Apr 30, 2025
44 of 45 checks passed
@krusche krusche deleted the feature/communication/see-deleted-forwarded-posts branch April 30, 2025 02:45
@github-project-automation github-project-automation bot moved this from Todo to Done in Communication Webclient Apr 30, 2025
@github-project-automation github-project-automation bot moved this from Ready For Review to Merged in Artemis Development Apr 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client Pull requests that update TypeScript code. (Added Automatically!) communication Pull requests that affect the corresponding module feature ready to merge
Projects
Status: Merged
Status: Done
Development

Successfully merging this pull request may close these issues.

10 participants