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

Lectures: Group lectures in sidebar by start and end date #8588

Merged

Conversation

rabeatwork
Copy link
Contributor

@rabeatwork rabeatwork commented May 13, 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.

Motivation and Context

New grouping is easier to understand

Description

Lectures are now grouped by their start and end date.

Past:

  • Without end date: The start date of a Lecture is older than 1 week
  • With end date: the end date is in the past

Current:

  • Without end date: The start state is within the last week
  • With end date: the start state is in the past and the end date is in the future

Future: Everything else (except no date)

Steps for Testing

Prerequisites:

  • 1 Student
  • Some Lectures with different start and end dates
  1. Log in to Artemis
  2. Navigate to lectures
  3. check that the lectures are grouped correctly

Testserver States

Note

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






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

@rabeatwork rabeatwork requested a review from a team as a code owner May 13, 2024 16:08
Copy link

coderabbitai bot commented May 13, 2024

Walkthrough

The updates primarily involve renaming and adding functions in the CourseOverviewService to enhance clarity and functionality for handling dates related to courses. Functions for grouping exercises by due dates were renamed, and a new function was introduced for grouping lectures. Corresponding test adjustments were made to reflect these changes and verify the new and updated functionalities.

Changes

File Path Change Summary
.../app/overview/course-overview.service.ts Renamed functions for clarity in handling date-related groupings, and added a new function for lecture grouping.
.../spec/component/course/course-overview.service.spec.ts Updated tests to align with the service changes, including renaming spies and modifying assertions to reflect the new logic in lecture and exercise grouping.

Recent Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between fd6768b and ebd04b8.
Files selected for processing (2)
  • src/main/webapp/app/overview/course-overview.service.ts (3 hunks)
  • src/test/javascript/spec/component/course/course-overview.service.spec.ts (3 hunks)
Additional Context Used
Path-based Instructions (2)
src/main/webapp/app/overview/course-overview.service.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

src/test/javascript/spec/component/course/course-overview.service.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 not posted (6)
src/main/webapp/app/overview/course-overview.service.ts (3)

44-44: Renaming getCorrespondingGroupByDate to getCorrespondingExerciseGroupByDate clarifies its specific use for exercises.


65-83: Adding getCorrespondingLectureGroupByDate enhances the modularity of the service by handling lecture-specific date grouping.


101-101: Using getCorrespondingLectureGroupByDate in groupLecturesByStartDate correctly implements the new grouping logic.

src/test/javascript/spec/component/course/course-overview.service.spec.ts (3)

114-125: The updated tests for groupLecturesByStartDate correctly reflect the new functionality and ensure the grouping logic is working as expected.


160-160: The updated tests for groupExercisesByDueDate correctly reflect the renamed functionality and ensure the grouping logic is working as expected.


182-182: The test for handling all past exercises correctly verifies that they are grouped as expected when all due dates are in the past.


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.

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 a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

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

CodeRabbit Configration 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.

@github-actions github-actions bot added tests client Pull requests that update TypeScript code. (Added Automatically!) labels May 13, 2024
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.

Looks good to me

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.

code lgtm

Copy link
Contributor

@FelixTJDietrich FelixTJDietrich 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 with a bunch of lectures. Works as expected!

Copy link
Contributor

@egekurt123 egekurt123 left a comment

Choose a reason for hiding this comment

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

Manually tested on ts4, works as expected

@krusche krusche added this to the 7.1.0 milestone May 17, 2024
@krusche krusche merged commit 242ee0b into develop May 17, 2024
46 of 52 checks passed
@krusche krusche deleted the chore/lectures/group-lectures-according-to-start-and-end-date branch May 17, 2024 07:11
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!) small tests
Projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

None yet

6 participants