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: Improve the user interface #9103

Merged
merged 8 commits into from
Aug 8, 2024

Conversation

rabeatwork
Copy link
Contributor

@rabeatwork rabeatwork commented Jul 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.
  • 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 added multiple integration tests (Jest) related to the features (with a high test coverage), while following the test guidelines.
  • I added authorities to all new routes and checked the course groups for displaying navigation elements (links, buttons).
  • 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

Tiny styling updates to improve the usability

Description

Steps for Testing

Prerequisites:

  • 1 Instructor
  • 1 Students
  1. Log in to Artemis
  2. Navigate to Communication
  3. Verify that the gray backgrounds are removed
  4. Verify that the items in the sidebar are a bit smaller
  5. Verify that messages and threads are working as before

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
  • I (as a reviewer) confirm that the server changes (in particular related to database calls) are implemented with a very good performance

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Screenshots

Screenshot 2024-07-19 at 17 52 36 Screenshot 2024-07-19 at 18 04 11

Summary by CodeRabbit

  • New Features

    • Enhanced user interface for conversation components with improved layout and responsiveness.
    • Updated styling for buttons and headings, increasing readability and visual consistency.
  • Bug Fixes

    • Streamlined logic for displaying answer post interactions, improving clarity and usability.
  • Documentation

    • Improved semantic clarity and maintainability in the HTML structure of components.
  • Tests

    • Adjusted test cases to reflect changes in HTML structure and enhance test accuracy.
    • Integrated mock services for profile support in component tests to improve testing scenarios.

@rabeatwork rabeatwork requested a review from a team as a code owner July 22, 2024 09:50
@github-actions github-actions bot added tests client Pull requests that update TypeScript code. (Added Automatically!) labels Jul 22, 2024
Copy link

coderabbitai bot commented Jul 22, 2024

Walkthrough

The recent updates to the Angular application enhance user interface components, improve accessibility, and optimize responsiveness. Key changes include refining the layouts of the conversation header and posting headers, transitioning to flexbox models, and updating CSS for enhanced readability. Additionally, testing configurations have been improved for more accurate element selection. Collectively, these modifications create a more intuitive and visually appealing user experience while maintaining core functionalities.

Changes

Files Change Summary
src/main/webapp/app/overview/course-conversations/layout/*.html Enhanced UI in the conversation header, changing heading from <h3> to <h4>, improving button sizes, and adjusting spacing for better layout.
src/main/webapp/app/shared/metis/posting-header/*.html Transitioned to flexbox layouts for posting headers, streamlined author/date displays, and refined class names for better readability and maintainability.
src/main/webapp/app/shared/metis/posting-header/posting-header.directive.ts Changed todayFlag property from `string
src/test/javascript/spec/component/shared/sidebar/sidebar-card-small.component.spec.ts Adjusted navigation paths in tests, updating from ../messages to ../communication, reflecting routing logic changes in the application.
src/test/cypress/support/pageobjects/course/CourseMessages.ts, src/test/playwright/support/pageobjects/course/CourseMessagesPage.ts Modified selectors in getName() and getTopic() for improved accuracy; changed from <h3> class to <h4> and from class to ID selector for topics.
src/test/javascript/spec/component/overview/course-conversations/layout/conversation-header/conversation-header.component.spec.ts Enhanced test setup by adding MetisModule and ProfileService, improving internationalization and profile support in tests.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ConversationHeader
    participant Sidebar
    participant CourseMessages

    User->>ConversationHeader: Click on conversation title
    ConversationHeader->>Sidebar: Update navigation path
    Sidebar-->>User: Redirect to communication area
    User->>CourseMessages: View messages in current conversation
Loading

Recent review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE

Commits

Files that changed from the base of the PR and between 0225594 and 095853a.

Files selected for processing (2)
  • src/test/javascript/spec/component/overview/course-conversations/layout/conversation-header/conversation-header.component.spec.ts (2 hunks)
  • src/test/javascript/spec/component/shared/metis/postings-header/answer-post-header/answer-post-header.component.spec.ts (5 hunks)
Additional context used
Path-based instructions (2)
src/test/javascript/spec/component/overview/course-conversations/layout/conversation-header/conversation-header.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}}

src/test/javascript/spec/component/shared/metis/postings-header/answer-post-header/answer-post-header.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}}

Learnings (1)
src/test/javascript/spec/component/shared/metis/postings-header/answer-post-header/answer-post-header.component.spec.ts (1)
Learnt from: rabeatwork
PR: ls1intum/Artemis#9103
File: src/test/javascript/spec/component/shared/metis/postings-header/answer-post-header/answer-post-header.component.spec.ts:94-94
Timestamp: 2024-08-02T14:03:49.485Z
Learning: The `#today-flag` ID is only present in the test files and not in the actual component's HTML or TypeScript files.
Additional comments not posted (6)
src/test/javascript/spec/component/overview/course-conversations/layout/conversation-header/conversation-header.component.spec.ts (3)

28-30: LGTM!

The additions of MetisModule, MockTranslateService, and TranslateService imports are necessary for the functionalities being tested.


63-63: LGTM!

The addition of MetisModule in the beforeEach block ensures that the module's functionalities are available for the tests.


69-69: LGTM!

The addition of MockTranslateService as a provider ensures that translation functionalities can be mocked during the tests.

src/test/javascript/spec/component/shared/metis/postings-header/answer-post-header/answer-post-header.component.spec.ts (3)

3-3: LGTM!

The addition of MetisModule import is necessary for the functionalities being tested.


39-39: LGTM!

The addition of MetisModule in the beforeEach block ensures that the module's functionalities are available for the tests.


74-75: LGTM!

The addition of userRoleBadge and todayFlag properties enhances the component's state management.


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 as 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.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

@rabeatwork rabeatwork changed the title Chore/communication/tiny UI improvements Communication: User interface improvements Jul 22, 2024
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

pzdr7
pzdr7 previously approved these changes Jul 22, 2024
Copy link
Contributor

@pzdr7 pzdr7 left a comment

Choose a reason for hiding this comment

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

The code looks good 👍

asliayk
asliayk previously approved these changes Jul 22, 2024
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 locally and works as expected

Copy link
Contributor

@JohannesStoehr JohannesStoehr 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 in general, but Coday complains about missing empty lines (see inline commments)

Additionally you touched code that uses the translate pipe. Can you update the lines to use jhiTranslate instead?

@rabeatwork rabeatwork dismissed stale reviews from asliayk and pzdr7 via a544647 July 22, 2024 11:04
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

@github-actions github-actions bot added the cypress Pull requests that update cypress tests. (Added Automatically!) label Jul 23, 2024
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

coderabbitai[bot]
coderabbitai bot previously approved these changes Jul 23, 2024
@rabeatwork rabeatwork force-pushed the chore/communication/tiny-ui-improvements branch from 5df38e8 to d81a636 Compare July 23, 2024 11:56
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

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

Copy link
Contributor

@pzdr7 pzdr7 left a comment

Choose a reason for hiding this comment

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

Code 👍

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.

reapprove

Copy link
Contributor

@JohannesStoehr JohannesStoehr left a comment

Choose a reason for hiding this comment

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

Code

Copy link
Contributor

@JohannesWt JohannesWt 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 TS4 - reaaprove

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!) cypress Pull requests that update cypress tests. (Added Automatically!) ready for review ready to merge tests
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

7 participants