-
Notifications
You must be signed in to change notification settings - Fork 297
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 profile picture to user selector
#9764
Communication
: Add profile picture to user selector
#9764
Conversation
WalkthroughThe changes in this pull request primarily focus on enhancing the user interface of the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this 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/shared/course-users-selector/course-users-selector.component.html (1)
26-29
: Consider making sizes configurable and updating ID prefixesThe hardcoded values and naming could be improved:
- Consider making image and font sizes configurable via inputs
- The 'sidebar' prefix in IDs (
sidebar-profile-picture
,sidebar-default-profile-picture
) might not be appropriate for this contextExample improvement:
- [imageSizeInRem]="'1.1'" - [fontSizeInRem]="'0.5'" - [imageId]="'sidebar-profile-picture'" - [defaultPictureId]="'sidebar-default-profile-picture'" + [imageSizeInRem]="config.imageSizeInRem" + [fontSizeInRem]="config.fontSizeInRem" + [imageId]="'user-selector-profile-picture'" + [defaultPictureId]="'user-selector-default-profile-picture'"
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (3)
src/main/webapp/app/shared/course-users-selector/course-users-selector.component.html
(1 hunks)src/main/webapp/app/shared/course-users-selector/course-users-selector.module.ts
(1 hunks)src/test/javascript/spec/component/shared/course-users-selector/course-users-selector.component.spec.ts
(2 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
src/main/webapp/app/shared/course-users-selector/course-users-selector.component.html (1)
Pattern 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/shared/course-users-selector/course-users-selector.module.ts (1)
src/test/javascript/spec/component/shared/course-users-selector/course-users-selector.component.spec.ts (1)
Pattern 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}}
🔇 Additional comments (5)
src/main/webapp/app/shared/course-users-selector/course-users-selector.module.ts (2)
7-7
: LGTM!
The import statement follows Angular style guidelines with proper naming and absolute import path.
10-10
:
Critical: Move ProfilePictureComponent to correct array
The ProfilePictureComponent
should not be in the imports
array. Components must be declared in the declarations
array of an NgModule. The imports
array is meant for importing other modules only.
Additionally, since this component is from app/shared/
, it's likely already declared in ArtemisSharedModule
which you're already importing. You shouldn't declare it again to avoid multiple declaration errors.
Apply this fix:
@NgModule({
- imports: [CommonModule, FormsModule, ReactiveFormsModule, ArtemisSharedModule, ArtemisSharedComponentModule, ProfilePictureComponent],
+ imports: [CommonModule, FormsModule, ReactiveFormsModule, ArtemisSharedModule, ArtemisSharedComponentModule],
exports: [CourseUsersSelectorComponent],
declarations: [CourseUsersSelectorComponent],
})
Let's verify if ProfilePictureComponent is already declared in ArtemisSharedModule:
src/main/webapp/app/shared/course-users-selector/course-users-selector.component.html (2)
16-16
: LGTM: Input configuration updated correctly
The change from resultFormatter
to resultTemplate
properly implements the template-based approach needed for the enhanced user display.
23-39
: LGTM: Well-structured template implementation
The template implementation effectively combines profile pictures with user labels using proper flex layout and accessibility considerations.
src/test/javascript/spec/component/shared/course-users-selector/course-users-selector.component.spec.ts (1)
9-9
: LGTM! Correct imports for mocking.
The imports for MockComponent
and ProfilePictureComponent
are correctly added to support the new profile picture feature.
Also applies to: 17-17
...vascript/spec/component/shared/course-users-selector/course-users-selector.component.spec.ts
Show resolved
Hide resolved
src/main/webapp/app/shared/course-users-selector/course-users-selector.component.html
Outdated
Show resolved
Hide resolved
...vascript/spec/component/shared/course-users-selector/course-users-selector.component.spec.ts
Outdated
Show resolved
Hide resolved
Tested on TS3, looks great! I left some small nitpicks for the code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested the student side on TS4. After following the described steps for testing, everything worked as described! Showed multiple pictures and names but also for 1 search result!
Since this works very well and having pictures added makes searching a lot easier. I would love to see this implemented.
36a3c03
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Server tested on: 01
Works as expected. I like it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on TS1, everything worked as expected.
Checklist
General
Client
Motivation and Context
Currently, when users select individuals to create a direct/group chat, only names are displayed, and profile pictures are not visible. This can make it harder to identify the correct person.
Description
Added profile picture component to user selector to get relevant profile pictures.
Steps for Testing
Prerequisites:
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
Manual Tests
Test Coverage
Screenshots
direct chat dialog
group chat dialog
Summary by CodeRabbit
New Features
Bug Fixes
Tests