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: Remove announcements from unresolved filter #9561

Conversation

cremertim
Copy link
Contributor

@cremertim cremertim commented Oct 22, 2024

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 added multiple integration tests (Jest) related to the features (with a high test coverage), while following the test guidelines.

Motivation and Context

Description

I removed the announcement channel from the courseWidesearch, if the user looks for unresolved questions

Steps for Testing

Prerequisites:

  • 1 Instructor
  • 1 Course with Communication enabled
  1. Log in to Artemis
  2. Navigate to Course Management
  3. Create an Announcement
  4. Use the course wide search to search for that announcement
  5. verify the announcement is present
  6. click on the unresolved filter
  7. verify the announcement is not present

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

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Test Coverage

Class/File Line Coverage Confirmation (assert/expect)
course-wide-search.component.ts 97.53%

Screenshots

image
Unticked unresolved --> you can see the announcement

image
Ticked unresolved --> you cannot see the announcement

Summary by CodeRabbit

  • New Features

    • Introduced a new method to identify announcement channels in course conversations.
    • Enhanced filtering logic to exclude announcement channels when viewing unresolved conversations.
  • Bug Fixes

    • Improved accuracy of channel ID filtering in the course-wide search functionality.

@cremertim cremertim requested a review from a team as a code owner October 22, 2024 12:57
@github-actions github-actions bot added the client Pull requests that update TypeScript code. (Added Automatically!) label Oct 22, 2024
Copy link

coderabbitai bot commented Oct 22, 2024

Walkthrough

The changes in this pull request modify the CourseWideSearchComponent to enhance the filtering logic for conversations. A new method, conversationIsAnnouncement, is introduced to identify announcement channels. The component's subscription to conversationsOfUser$ is updated to filter out announcement channels when the filterToUnresolved flag is true. Additionally, the currentPostContextFilter is updated to include a new property, courseWideChannelIds, populated based on the filtered conversations.

Changes

File Path Change Summary
src/main/webapp/app/overview/course-conversations/course-wide-search/course-wide-search.component.ts - Added ChannelDTO import.
- Introduced conversationIsAnnouncement method.
- Updated logic for populating courseWideChannelIds in currentPostContextFilter to filter out announcement channels when filterToUnresolved is true.

Possibly related PRs

Suggested labels

ready for review, small, bugfix, component:Communication

Suggested reviewers

  • krusche
  • PaRangger
  • egekurt123

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 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: 1

🧹 Outside diff range and nitpick comments (1)
src/main/webapp/app/overview/course-conversations/course-wide-search/course-wide-search.component.ts (1)

164-170: Specify the return type for conversationIsAnnouncement method

For better code clarity and type safety, consider adding an explicit return type to the conversationIsAnnouncement method.

Apply this diff to add the return type:

- conversationIsAnnouncement(conversation: ConversationDTO) {
+ conversationIsAnnouncement(conversation: ConversationDTO): boolean {
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between f3eaf6d and 8ad5228.

📒 Files selected for processing (1)
  • src/main/webapp/app/overview/course-conversations/course-wide-search/course-wide-search.component.ts (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
src/main/webapp/app/overview/course-conversations/course-wide-search/course-wide-search.component.ts (1)

Pattern src/main/webapp/**/*.ts: angular_style:https://angular.io/guide/styleguide;methods_in_html:false;lazy_loading:true;code_reuse:true;tests:meaningful;types:PascalCase;enums:PascalCase;funcs:camelCase;props:camelCase;no_priv_prefix:true;strings:single_quotes;localize:true;btns:functionality;links:navigation;icons_text:newline;labels:associate;code_style:arrow_funcs,curly_braces,open_braces_same_line,indent_4;memory_leak_prevention:true;routes:naming_schema;chart_framework:ngx-charts;responsive_layout:true

🔇 Additional comments (1)
src/main/webapp/app/overview/course-conversations/course-wide-search/course-wide-search.component.ts (1)

20-20: Necessary import of ChannelDTO

The addition of ChannelDTO to the import statement is required for type assertions in the conversationIsAnnouncement method.

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.

Code LGTM and works just as described 👍🏼

Copy link
Member

@krusche krusche left a comment

Choose a reason for hiding this comment

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

Code looks good to me 👍

Copy link
Contributor

@florian-glombik florian-glombik left a comment

Choose a reason for hiding this comment

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

I followed the testing steps and it worked as described.

One thing that surprised me, I was first searching for the title of the announcement, but the search does only seem to include the content. Can we extend this in the future?

Copy link

⚠️ Unable to deploy to test servers ⚠️

Testserver "artemis-test4.artemis.cit.tum.de" is already in use by PR #9553.

@github-actions github-actions bot added the deployment-error Added by deployment workflows if an error occured label Oct 23, 2024
@Cathy0123456789 Cathy0123456789 added deploy:artemis-test5 and removed deployment-error Added by deployment workflows if an error occured labels Oct 23, 2024
@Cathy0123456789 Cathy0123456789 temporarily deployed to artemis-test5.artemis.cit.tum.de October 23, 2024 23:39 — with GitHub Actions Inactive
Copy link

@Cathy0123456789 Cathy0123456789 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 described.

@krusche krusche changed the title Communication: Remove Announcements from unresolved filter Communication: Remove announcements from unresolved filter Oct 24, 2024
@krusche krusche merged commit 982060f into develop Oct 24, 2024
76 of 84 checks passed
@krusche krusche deleted the feature/communication/remove-announcements-from-unresolved-filter branch October 24, 2024 06:08
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!) maintainer-approved The feature maintainer has approved the PR ready to merge
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

7 participants