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: Add shortcut to direct chats via usernames in conversation detail dialog #10277

Merged

Conversation

asliayk
Copy link
Contributor

@asliayk asliayk commented Feb 6, 2025

Checklist

General

Client

  • I strictly followed the client coding and design guidelines.
  • I added multiple integration tests (Jest) related to the features (with a high test coverage), while following the test guidelines.
  • I added multiple screenshots/screencasts of my UI changes.

Motivation and Context

  • It is currently not possible to navigate to a direct chat by clicking on a username in the members list of the conversation detail dialog.
  • The conversation detail dialog for one-to-one chats also includes a members tab, which feels unnecessary clutter since it only ever contains two participants.

Description

  • Clicking on a username in the members list of the conversation detail dialog now navigates to the corresponding direct chat.
  • The members tab has been removed from the conversation detail dialog for one-to-one chats.
  • Some previously missing test cases have been added for ConversationMemberRowComponent.
  • The conversation detail dialog now displays the profile picture of the relevant user if the conversation is a one-to-one chat (similar to Slack).

Steps for Testing

Prerequisites:

  • 1 User
  • 1 Course with Communication enabled
  1. Log in to Artemis.
  2. Navigate to the Communication section of a course.
  3. Open a direct chat. If one does not exist, create a direct chat with a random user by clicking the + button at the top of the sidebar.
  4. Click the Members button in the top right corner of the conversation header to open the conversation detail dialog.
  5. Verify that only the Info tab is present and that the Members tab no longer exists.
  6. Navigate to a channel that contains at least two members.
  7. Open its conversation detail dialog.
  8. Verify that the usernames are now clickable and that clicking on a username navigates to the corresponding direct chat.

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-detail-dialog.component.ts 97.56% ✅ ❌
conversation-member-row.component.ts 88.81% ✅ ❌
conversation-members.component.ts 94.73% ✅ ❌
conversation-header.component.ts 96.2% ✅ ❌

Screenshots

profile picture on header & no members tab for direct chats in conversation detail dialog
image

clickable user names on dialog
image

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • The conversation detail view now shows the members panel only for group chats, reducing clutter in one-to-one conversations.
    • User names are now interactive—clicking a name initiates a direct chat, streamlining communication from the conversation view.
  • Style

    • Enhanced hover effects and clickable styling improve visual feedback on interactive elements for a clearer and more responsive user experience.
    • New CSS class added for standardizing text color across the conversation member rows.
  • Bug Fixes

    • Improved handling of user interactions to prevent actions on the current user's name, ensuring accurate user experience.

@asliayk asliayk added tests client Pull requests that update TypeScript code. (Added Automatically!) component:Communication labels Feb 6, 2025
@asliayk asliayk self-assigned this Feb 6, 2025
@helios-aet helios-aet bot temporarily deployed to artemis-test2.artemis.cit.tum.de February 6, 2025 15:20 Inactive
@asliayk asliayk marked this pull request as ready for review February 6, 2025 15:58
@asliayk asliayk requested a review from a team as a code owner February 6, 2025 15:58
Copy link

coderabbitai bot commented Feb 6, 2025

Walkthrough

This pull request introduces modifications to the conversation detail dialog and related components. It adds a condition in the dialog’s HTML to only show the members tab for group conversations. New output properties and methods are implemented to emit events when a username is clicked. Corresponding changes in styling and test cases support these functional improvements. Additionally, the conversation header component now subscribes to these events to dismiss the modal and trigger one-to-one chat creation.

Changes

File(s) Change Summary
src/.../conversation-detail-dialog.component.html
src/.../conversation-detail-dialog.component.ts
Conditionally render the members tab and add a new output property and method (userNameClicked/onUserNameClicked) to handle username click events.
src/.../conversation-member-row/*.html
src/.../conversation-member-row.component.scss
src/.../conversation-member-row.component.ts
Wrap the username display in a clickable <a> element, add CSS classes for interactivity, and introduce an output property with a method to emit the user’s ID when clicked.
src/.../conversation-members.component.html
src/.../conversation-members.component.ts
Add an event binding on the list item and a new output property (userNameClicked) to propagate username click events.
src/.../conversation-header.component.ts Update the dialog-opening method to add conditions for one-to-one chats and subscribe to the userNameClicked event in order to dismiss the modal and initiate a new chat.
src/test/... (all test specs) Introduce new test cases to validate the emission and handling of username click events and to verify the updated interaction logic across components.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant MR as MemberRow
    participant MM as MembersComponent
    participant DD as DetailDialog
    participant CH as Header

    U->>MR: Click on username
    MR->>MM: Emit onUserNameClicked(userId)
    MM->>DD: Forward click event
    DD->>CH: Emit userNameClicked(userId)
    CH->>CH: Dismiss modal and initiate one-to-one chat
Loading

Possibly related PRs

Suggested labels

small, bugfix, ready to merge

Suggested reviewers

  • HawKhiem
  • PaRangger
  • sachmii
  • ItsaaaMeMario
  • FelberMartin
  • krusche
  • zagemello
✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

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. (Beta)
  • @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

🧹 Nitpick comments (3)
src/test/javascript/spec/component/overview/course-conversations/layout/conversation-header/conversation-header.component.spec.ts (3)

169-198: Improve test readability and maintainability.

The test case effectively verifies the username click functionality, but could benefit from some improvements:

-        it('should dismiss modal and call createOneToOneChatWithId when userNameClicked is emitted', fakeAsync(() => {
+        it('should create one-to-one chat and dismiss modal when username is clicked', fakeAsync(() => {
             const fakeUserNameClicked$ = new Subject<number>();
             const fakeModalRef: NgbModalRef = {
                 componentInstance: {
-                    course: undefined,
-                    activeConversation: undefined,
-                    selectedTab: undefined,
+                    course,
+                    activeConversation,
+                    selectedTab: ConversationDetailTabs.INFO,
                     initialize: jest.fn(),
                     userNameClicked: fakeUserNameClicked$,
                 },

249-271: Enhance test case with specific expectations.

While the test verifies the emission of onUpdateSidebar, it could be more specific about the expected behavior.

-            expect(onUpdateSidebarSpy).toHaveBeenCalled();
+            expect(onUpdateSidebarSpy).toHaveBeenCalledExactlyOnceWith();

273-278: Enhance test case with specific expectations.

Similar to the previous test, this one could be more specific about the expected behavior.

-            expect(collapseSearchSpy).toHaveBeenCalled();
+            expect(collapseSearchSpy).toHaveBeenCalledExactlyOnceWith();
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between cc1e3cb and 9354603.

📒 Files selected for processing (11)
  • src/main/webapp/app/overview/course-conversations/dialogs/conversation-detail-dialog/conversation-detail-dialog.component.html (2 hunks)
  • src/main/webapp/app/overview/course-conversations/dialogs/conversation-detail-dialog/conversation-detail-dialog.component.ts (3 hunks)
  • src/main/webapp/app/overview/course-conversations/dialogs/conversation-detail-dialog/tabs/conversation-members/conversation-member-row/conversation-member-row.component.html (1 hunks)
  • src/main/webapp/app/overview/course-conversations/dialogs/conversation-detail-dialog/tabs/conversation-members/conversation-member-row/conversation-member-row.component.scss (1 hunks)
  • src/main/webapp/app/overview/course-conversations/dialogs/conversation-detail-dialog/tabs/conversation-members/conversation-member-row/conversation-member-row.component.ts (4 hunks)
  • src/main/webapp/app/overview/course-conversations/dialogs/conversation-detail-dialog/tabs/conversation-members/conversation-members.component.html (1 hunks)
  • src/main/webapp/app/overview/course-conversations/dialogs/conversation-detail-dialog/tabs/conversation-members/conversation-members.component.ts (1 hunks)
  • src/main/webapp/app/overview/course-conversations/layout/conversation-header/conversation-header.component.ts (1 hunks)
  • src/test/javascript/spec/component/overview/course-conversations/dialogs/conversation-detail-dialog/conversation-detail-dialog.component.spec.ts (1 hunks)
  • src/test/javascript/spec/component/overview/course-conversations/dialogs/conversation-detail-dialog/tabs/conversation-members/conversation-member-row/conversation-member-row.component.spec.ts (4 hunks)
  • src/test/javascript/spec/component/overview/course-conversations/layout/conversation-header/conversation-header.component.spec.ts (5 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
`src/main/webapp/**/*.ts`: angular_style:https://angular.io/...

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

  • src/main/webapp/app/overview/course-conversations/dialogs/conversation-detail-dialog/tabs/conversation-members/conversation-members.component.ts
  • src/main/webapp/app/overview/course-conversations/layout/conversation-header/conversation-header.component.ts
  • src/main/webapp/app/overview/course-conversations/dialogs/conversation-detail-dialog/conversation-detail-dialog.component.ts
  • src/main/webapp/app/overview/course-conversations/dialogs/conversation-detail-dialog/tabs/conversation-members/conversation-member-row/conversation-member-row.component.ts
`src/main/webapp/**/*.html`: @if and @for are new and valid ...

src/main/webapp/**/*.html: @if and @for are new and valid Angular syntax replacing *ngIf and *ngFor. They should always be used over the old style.

  • src/main/webapp/app/overview/course-conversations/dialogs/conversation-detail-dialog/tabs/conversation-members/conversation-members.component.html
  • src/main/webapp/app/overview/course-conversations/dialogs/conversation-detail-dialog/tabs/conversation-members/conversation-member-row/conversation-member-row.component.html
  • src/main/webapp/app/overview/course-conversations/dialogs/conversation-detail-dialog/conversation-detail-dialog.component.html
`src/test/javascript/spec/**/*.ts`: jest: true; mock: NgMock...

src/test/javascript/spec/**/*.ts: jest: true; mock: NgMocks; bad_practices: avoid_full_module_import; perf_improvements: mock_irrelevant_deps; service_testing: mock_http_for_logic; no_schema: avoid_NO_ERRORS_SCHEMA; expectation_specificity: true; solutions: {boolean: toBeTrue/False, reference: toBe, existence: toBeNull/NotNull, undefined: toBeUndefined, class_obj: toContainEntries/toEqual, spy_calls: {not_called: not.toHaveBeenCalled, once: toHaveBeenCalledOnce, with_value: toHaveBeenCalledWith|toHaveBeenCalledExactlyOnceWith}}

  • src/test/javascript/spec/component/overview/course-conversations/dialogs/conversation-detail-dialog/conversation-detail-dialog.component.spec.ts
  • src/test/javascript/spec/component/overview/course-conversations/dialogs/conversation-detail-dialog/tabs/conversation-members/conversation-member-row/conversation-member-row.component.spec.ts
  • src/test/javascript/spec/component/overview/course-conversations/layout/conversation-header/conversation-header.component.spec.ts
🪛 GitHub Check: client-style
src/main/webapp/app/overview/course-conversations/dialogs/conversation-detail-dialog/tabs/conversation-members/conversation-member-row/conversation-member-row.component.ts

[warning] 305-305:
Optional chain expressions can return undefined by design - using a non-null assertion is unsafe and wrong


[warning] 306-306:
Optional chain expressions can return undefined by design - using a non-null assertion is unsafe and wrong

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (18)
src/test/javascript/spec/component/overview/course-conversations/layout/conversation-header/conversation-header.component.spec.ts (4)

13-13: LGTM! Clean import organization and mock service setup.

The imports are well-organized, and the mock service is properly configured using dependency injection.

Also applies to: 29-31, 70-70


200-222: LGTM! Robust error handling test.

The test case properly verifies that the component gracefully handles modal instances without the userNameClicked property.


224-247: LGTM! Comprehensive one-to-one chat behavior test.

The test case effectively verifies that the info tab is always selected for one-to-one chats, aligning with the PR objective to streamline the UI for direct messages.


303-304: LGTM! Proper tab selection logic.

The modification to detailDialogTest correctly implements the requirement to always show the info tab for one-to-one chats.

src/main/webapp/app/overview/course-conversations/dialogs/conversation-detail-dialog/conversation-detail-dialog.component.ts (1)

38-38: LGTM! Clean implementation of user click handling.

The implementation follows Angular's style guide and uses the new signal-based output syntax.

Also applies to: 77-79

src/test/javascript/spec/component/overview/course-conversations/dialogs/conversation-detail-dialog/conversation-detail-dialog.component.spec.ts (1)

131-136: LGTM! Well-structured test case.

The test follows Jest guidelines and uses proper matchers to verify event emission.

src/main/webapp/app/overview/course-conversations/dialogs/conversation-detail-dialog/tabs/conversation-members/conversation-members.component.ts (1)

42-42: LGTM! Clean implementation of user click event propagation.

The implementation follows Angular's style guide and uses signal-based outputs.

src/main/webapp/app/overview/course-conversations/dialogs/conversation-detail-dialog/tabs/conversation-members/conversation-member-row/conversation-member-row.component.ts (1)

54-54: LGTM! Clean implementation of user click event emission.

The output property follows Angular's style guide.

src/test/javascript/spec/component/overview/course-conversations/dialogs/conversation-detail-dialog/tabs/conversation-members/conversation-member-row/conversation-member-row.component.spec.ts (3)

284-294: LGTM! Test coverage for self-click prevention.

The test correctly verifies that clicking one's own username doesn't emit an event.


296-306: LGTM! Test coverage for username click event.

The test properly verifies that clicking another user's name emits their ID.


338-358: Well-structured parameterized tests for user roles!

Excellent use of parameterized testing to verify icon and tooltip combinations for different user roles.

src/main/webapp/app/overview/course-conversations/dialogs/conversation-detail-dialog/tabs/conversation-members/conversation-member-row/conversation-member-row.component.scss (1)

19-34: LGTM! Clear visual feedback for interactive elements.

Good use of cursor styles and transitions to indicate clickable elements. The .no-hover class effectively prevents interaction styling for the current user's name.

src/main/webapp/app/overview/course-conversations/dialogs/conversation-detail-dialog/tabs/conversation-members/conversation-member-row/conversation-member-row.component.html (1)

16-24: LGTM! Clean implementation of clickable username.

Good use of ngClass for conditional styling and proper event binding for the click handler.

src/main/webapp/app/overview/course-conversations/dialogs/conversation-detail-dialog/conversation-detail-dialog.component.html (2)

40-50: LGTM! Improved UX by hiding members tab in one-to-one chats.

Good implementation of conditional rendering to reduce UI clutter in direct chats.


67-72: LGTM! Clean event binding for username clicks.

Proper implementation of the userNameClicked event binding in the conversation members component.

src/main/webapp/app/overview/course-conversations/dialogs/conversation-detail-dialog/tabs/conversation-members/conversation-members.component.html (1)

61-61: Ensure Event Binding is Correctly Configured for Username Clicks.

The addition of (onUserNameClicked)="userNameClicked.emit($event)" on the <li> element meets the PR objective by enabling clickable usernames that redirect to the appropriate direct chat. Please verify that the corresponding userNameClicked output property is declared and handled appropriately in the component’s TypeScript file.

src/main/webapp/app/overview/course-conversations/layout/conversation-header/conversation-header.component.ts (2)

125-127: LGTM! Tab selection for one-to-one chats.

The implementation correctly forces the INFO tab for one-to-one chats, aligning with the PR objective to remove the members tab from these conversations.


29-34: LGTM! Code style and structure.

The component follows Angular style guidelines and coding requirements:

  • Proper use of dependency injection with inject()
  • Consistent code style with arrow functions and curly braces
  • Well-organized component structure

Also applies to: 35-153

@helios-aet helios-aet bot temporarily deployed to artemis-test3.artemis.cit.tum.de February 6, 2025 23:49 Inactive
@helios-aet helios-aet bot temporarily deployed to artemis-test6.artemis.cit.tum.de February 6, 2025 23:53 Inactive
sachmii
sachmii previously approved these changes Feb 6, 2025
Copy link

@sachmii sachmii 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 TS6. Works as described.

Only info tab shown in direct chat:
direct chat

Copy link

@HanyangXu0508 HanyangXu0508 left a comment

Choose a reason for hiding this comment

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

  1. The Info tab is present and that the Members tab as well.
  2. usernames are now clickable and that clicking on a username navigates to the corresponding direct chat worked as expected.

@helios-aet helios-aet bot temporarily deployed to artemis-test2.artemis.cit.tum.de February 7, 2025 13:33 Inactive
@helios-aet helios-aet bot temporarily deployed to artemis-test2.artemis.cit.tum.de February 7, 2025 15:22 Inactive
HawKhiem
HawKhiem previously approved these changes Feb 7, 2025
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 TS2. In the direct chat, only the Info tab is shown as described

Screenshot 2025-02-07 163610

In the group chat, users names are now clickable and bring users to the direct chat with the respective person when clicked
Screenshot 2025-02-07 163641

@helios-aet helios-aet bot temporarily deployed to artemis-test3.artemis.cit.tum.de February 7, 2025 19:46 Inactive
sawys777
sawys777 previously approved these changes Feb 7, 2025
Copy link

@sawys777 sawys777 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, everything works as expected

DM:
info

Group chat:
groupinfo

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

🧹 Nitpick comments (3)
src/test/javascript/spec/component/overview/course-conversations/layout/conversation-header/conversation-header.component.spec.ts (3)

169-201: Test case for username click handling looks good, but could be more specific with expectations.

The test case properly verifies the modal dismissal and chat creation, but could be more specific with the expectation for createOneToOneChatWithId.

Update the expectation to be more specific:

-            expect(createChatSpy).toHaveBeenCalledWith(testUserId);
+            expect(createChatSpy).toHaveBeenCalledExactlyOnceWith(testUserId);

203-225: Test case for modal without userNameClicked property looks good, but could be more specific with expectations.

The test case properly verifies that the chat creation is not called when the modal instance lacks the userNameClicked property.

Update the expectation to be more specific:

-            expect(createChatSpy).not.toHaveBeenCalled();
+            expect(createChatSpy).toHaveBeenCalledTimes(0);

252-274: Test case for sidebar update looks good, but could be more specific with expectations.

The test case properly verifies that the sidebar is updated when the conversation detail dialog is closed.

Update the expectation to be more specific:

-            expect(onUpdateSidebarSpy).toHaveBeenCalledOnce();
+            expect(onUpdateSidebarSpy).toHaveBeenCalledExactlyOnceWith();
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between c574f32 and 2d0fcf5.

📒 Files selected for processing (1)
  • src/test/javascript/spec/component/overview/course-conversations/layout/conversation-header/conversation-header.component.spec.ts (5 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`src/test/javascript/spec/**/*.ts`: jest: true; mock: NgMock...

src/test/javascript/spec/**/*.ts: jest: true; mock: NgMocks; bad_practices: avoid_full_module_import; perf_improvements: mock_irrelevant_deps; service_testing: mock_http_for_logic; no_schema: avoid_NO_ERRORS_SCHEMA; expectation_specificity: true; solutions: {boolean: toBeTrue/False, reference: toBe, existence: toBeNull/NotNull, undefined: toBeUndefined, class_obj: toContainEntries/toEqual, spy_calls: {not_called: not.toHaveBeenCalled, once: toHaveBeenCalledOnce, with_value: toHaveBeenCalledWith|toHaveBeenCalledExactlyOnceWith}}

  • src/test/javascript/spec/component/overview/course-conversations/layout/conversation-header/conversation-header.component.spec.ts
⏰ Context from checks skipped due to timeout of 90000ms (9)
  • GitHub Check: Call Build Workflow / Build .war artifact
  • GitHub Check: Call Build Workflow / Build and Push Docker Image
  • GitHub Check: server-tests
  • GitHub Check: server-style
  • GitHub Check: client-tests-selected
  • GitHub Check: client-tests
  • GitHub Check: client-style
  • GitHub Check: Analyse
  • GitHub Check: Mend Security Check
🔇 Additional comments (4)
src/test/javascript/spec/component/overview/course-conversations/layout/conversation-header/conversation-header.component.spec.ts (4)

13-13: LGTM! Import changes and mock provider updates look good.

The changes properly import required dependencies and update the mock provider configuration.

Also applies to: 29-31, 70-70


227-250: LGTM! Test case for one-to-one chat info tab looks good.

The test case properly verifies that the info tab is always opened for one-to-one chats, regardless of the requested tab.


276-281: Test case for search bar toggle looks good, but could be more specific with expectations.

The test case properly verifies that the search bar toggle emits the collapse event.

Update the expectation to be more specific:

-            expect(collapseSearchSpy).toHaveBeenCalledOnce();
+            expect(collapseSearchSpy).toHaveBeenCalledExactlyOnceWith();

305-307: LGTM! Modified detailDialogTest function looks good.

The function now properly handles the tab selection based on the conversation type.

coderabbitai[bot]
coderabbitai bot previously approved these changes Feb 10, 2025
ole-ve
ole-ve previously approved these changes Feb 10, 2025
Copy link
Contributor

@ole-ve ole-ve left a comment

Choose a reason for hiding this comment

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

thanks for integrating my feedback, code looks good to me

@helios-aet helios-aet bot temporarily deployed to artemis-test4.artemis.cit.tum.de February 11, 2025 19:11 Inactive
sachmii
sachmii previously approved these changes Feb 11, 2025
Copy link

@sachmii sachmii left a comment

Choose a reason for hiding this comment

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

reapprove

@helios-aet helios-aet bot temporarily deployed to artemis-test1.artemis.cit.tum.de February 12, 2025 09:48 Inactive
@helios-aet helios-aet bot temporarily deployed to artemis-test6.artemis.cit.tum.de February 12, 2025 10:14 Inactive
flbrgit
flbrgit previously approved these changes Feb 12, 2025
Copy link

@flbrgit flbrgit 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 TS6, everything works as expected and usernames are clickable linking to the corresponding direct chat
image

simonbohnen
simonbohnen previously approved these changes Feb 13, 2025
Copy link

@simonbohnen simonbohnen left a comment

Choose a reason for hiding this comment

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

Reapprove

…-from-overview-dialog

# Conflicts:
#	src/test/javascript/spec/component/overview/course-conversations/dialogs/conversation-detail-dialog/conversation-detail-dialog.component.spec.ts
#	src/test/javascript/spec/component/overview/course-conversations/layout/conversation-header/conversation-header.component.spec.ts
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: 0

🧹 Nitpick comments (1)
src/main/webapp/app/overview/course-conversations/dialogs/conversation-detail-dialog/conversation-detail-dialog.component.ts (1)

55-61: Add null safety checks for conversation members.

While the logic is correct, consider adding null safety checks for the members array:

 if (this.activeConversation) {
     const conversation = getAsOneToOneChatDTO(this.activeConversation);
     if (conversation) {
         this.isOneToOneChat = true;
-        this.otherUser = conversation.members?.find((user) => !user.isRequestingUser);
+        this.otherUser = conversation.members?.[0] 
+            ? conversation.members.find((user) => !user.isRequestingUser) ?? undefined
+            : undefined;
     }
 }
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 2d0fcf5 and 20e77b7.

📒 Files selected for processing (3)
  • src/main/webapp/app/overview/course-conversations/dialogs/conversation-detail-dialog/conversation-detail-dialog.component.html (3 hunks)
  • src/main/webapp/app/overview/course-conversations/dialogs/conversation-detail-dialog/conversation-detail-dialog.component.ts (5 hunks)
  • src/main/webapp/app/overview/course-conversations/layout/conversation-header/conversation-header.component.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/main/webapp/app/overview/course-conversations/dialogs/conversation-detail-dialog/conversation-detail-dialog.component.html
  • src/main/webapp/app/overview/course-conversations/layout/conversation-header/conversation-header.component.ts
🧰 Additional context used
📓 Path-based instructions (1)
`src/main/webapp/**/*.ts`: angular_style:https://angular.io/...

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

  • src/main/webapp/app/overview/course-conversations/dialogs/conversation-detail-dialog/conversation-detail-dialog.component.ts
⏰ Context from checks skipped due to timeout of 90000ms (9)
  • GitHub Check: Call Build Workflow / Build .war artifact
  • GitHub Check: Call Build Workflow / Build and Push Docker Image
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: server-style
  • GitHub Check: client-style
  • GitHub Check: client-tests
  • GitHub Check: server-tests
  • GitHub Check: client-tests-selected
  • GitHub Check: Analyse
🔇 Additional comments (4)
src/main/webapp/app/overview/course-conversations/dialogs/conversation-detail-dialog/conversation-detail-dialog.component.ts (4)

1-1: LGTM! Import changes align with new functionality.

The imports follow the Angular style guide and support the new features for handling one-to-one chats and user profiles.

Also applies to: 6-6, 17-18


29-38: LGTM! Component metadata follows standalone pattern.

The imports array is properly structured and includes all necessary dependencies.


48-51: LGTM! Properties follow Angular conventions.

The new properties are well-typed and follow Angular's naming conventions:

  • isOneToOneChat for state tracking
  • otherUser for storing the conversation partner
  • userNameClicked output for event emission

100-102: LGTM! Event handler follows Angular patterns.

The method correctly emits the userId through the output property.

@helios-aet helios-aet bot temporarily deployed to artemis-test2.artemis.cit.tum.de February 15, 2025 11:09 Inactive
@krusche krusche merged commit 8166c34 into develop Feb 15, 2025
33 of 35 checks passed
@krusche krusche deleted the feature/communication/add-user-navigation-from-overview-dialog branch February 15, 2025 11:17
@krusche krusche added this to the 7.10.1 milestone Feb 15, 2025
@krusche krusche added ready to merge maintainer-approved The feature maintainer has approved the PR labels Feb 15, 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!) component:Communication feature maintainer-approved The feature maintainer has approved the PR ready to merge tests
Projects
Status: Merged
Status: Done
Development

Successfully merging this pull request may close these issues.