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 sidebar refresh issue after channel deletion #9271

Merged

Conversation

asliayk
Copy link
Contributor

@asliayk asliayk commented Sep 2, 2024

Checklist

General

Client

Motivation and Context

When a channel is deleted, it should be immediately removed from the sidebar without requiring the user to refresh the page manually. However, a manual refresh is still required for the sidebar to update.
Closes #9151

Description

The forceRefresh function is now called immediately upon entering the prepareSidebarData function to ensure the data refreshes automatically. Additionally, just like when a channel is deleted from the accordion, the prepareSidebarData function is now also triggered when a channel is deleted from the conversation header, ensuring the sidebar data is always up-to-date.

Steps for Testing

Prerequisites:

  • 1 Instructor
  1. Log in to Artemis
  2. Go to Course Management page
  3. Click on Communications button of a course
  4. On the sidebar accordion, click on the settings of a channel, and click the delete button to delete it.
  5. Notice that the channel is immediately removed from the sidebar.
  6. Click on a channel to view its conversation.
  7. Click on its conversation header, and navigate to settings.
  8. Click on the delete button to delete the channel, and notice that the channel is immediately removed from the sidebar.

Testserver States

Note

These badges show the state of the test servers.
Green = Currently available, Red = Currently locked
Click on the badges to get to the test servers.







Review Progress

Performance Review

  • I (as a reviewer) confirm that the client changes (in particular related to REST calls and UI responsiveness) are implemented with a very good performance even for very large courses with more than 2000 students.
  • I (as a reviewer) confirm that the server changes (in particular related to database calls) are implemented with a very good performance even for very large courses with more than 2000 students.

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Exam Mode Test

  • Test 1
  • Test 2

Performance Tests

  • Test 1
  • Test 2

Test Coverage

Summary by CodeRabbit

  • New Features

    • Added a new output event for sidebar updates in the conversation header, enhancing interactivity.
    • Improved sidebar data preparation to ensure it reflects the most current conversation data after refresh.
  • Bug Fixes

    • Resolved issues related to sidebar data not updating properly after conversation refreshes.

@asliayk asliayk added client Pull requests that update TypeScript code. (Added Automatically!) small bugfix component:Communication labels Sep 2, 2024
@asliayk asliayk self-assigned this Sep 2, 2024
@asliayk asliayk requested a review from a team as a code owner September 2, 2024 11:42
Copy link

coderabbitai bot commented Sep 2, 2024

Walkthrough

The changes enhance the jhi-conversation-header component and the associated CourseConversationsComponent to improve sidebar data management. A new output event, (onUpdateSidebar), is introduced to facilitate updates to the sidebar when conversations are refreshed. The prepareSidebarData method is modified to ensure that sidebar updates occur only after conversation data has been refreshed, addressing issues related to stale data in the sidebar.

Changes

Files Change Summary
src/main/webapp/app/overview/course-conversations/course-conversations.component.html Added (onUpdateSidebar) output event to jhi-conversation-header, enhancing interactivity.
src/main/webapp/app/overview/course-conversations/course-conversations.component.ts Modified prepareSidebarData to ensure sidebar data is updated after conversation refresh.
src/main/webapp/app/overview/course-conversations/layout/conversation-header/conversation-header.component.ts Introduced onUpdateSidebar output event emitter to notify parent component of sidebar updates.

Assessment against linked issues

Objective Addressed Explanation
Sidebar should automatically refresh after channel deletion (#9151)

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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Outside diff range comments (1)
src/main/webapp/app/overview/course-conversations/layout/conversation-header/conversation-header.component.ts (1)

Line range hint 1-120: Summary: Effective implementation of sidebar refresh functionality.

The changes made to ConversationHeaderComponent successfully address the issue of the sidebar not refreshing automatically after channel deletion. The implementation:

  1. Adds a new @Output() for sidebar updates.
  2. Emits the update event after force refreshing the conversation data.

These changes align well with Angular best practices and the project's coding style. They effectively solve the problem described in the PR objectives and linked issue #9151.

To further improve the robustness of this solution:

  1. Consider implementing a debounce mechanism if multiple rapid updates are possible, to prevent excessive sidebar refreshes.
  2. Ensure that parent components using this new output are also updated to handle the sidebar refresh event appropriately.

Great job on improving the user experience by eliminating the need for manual refreshes!

Copy link
Contributor

@edkaya edkaya 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 ts5, works as expected. Sidebar is updated successfully after each deletion action.

Copy link
Contributor

@coolchock coolchock left a comment

Choose a reason for hiding this comment

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

tested in testing session, works as expected

Copy link
Contributor

@undernagruzez undernagruzez 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 ts5, works as expected

Copy link
Contributor

@SimonEntholzer SimonEntholzer 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 Ts5 during testing session 👍 deletion works fine

@krusche krusche added this to the 7.5.2 milestone Sep 6, 2024
@krusche krusche merged commit 7a1c378 into develop Sep 6, 2024
25 of 30 checks passed
@krusche krusche deleted the bugfix/communication/sidebar-refresh-for-channel-deletion branch September 6, 2024 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix client Pull requests that update TypeScript code. (Added Automatically!) component:Communication ready to merge small
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Communication: Sidebar does not automatically refresh after channel deletion
6 participants