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

Programming exercises: Display automatic assessment history correctly #8542

Conversation

rabeatwork
Copy link
Contributor

@rabeatwork rabeatwork commented May 3, 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.
  • I added multiple screenshots/screencasts of my UI changes.

Changes affecting Programming Exercises

  • High priority: I tested all changes and their related features with all corresponding user types on a test server configured with the integrated lifecycle setup (LocalVC and LocalCI).
  • I tested all changes and their related features with all corresponding user types on a test server configured with Gitlab and Jenkins.

Motivation and Context

Fixes this issue: #8529

Steps for Testing

Prerequisites:

  • 1 Student
  1. Log in to Artemis
  2. Navigate to a Course
  3. Go to an exercise with automated assessment history
  4. Click on another exercise which must be unstarted
  5. See that the assessment history of the first exercise is no longer incorrectly displayed on the page for the second exercise

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

Exam Mode Test

  • Test 1
  • Test 2

Screenshots

Exercise with History
image
History is no longer displayed when switching to another exercises
image

@rabeatwork rabeatwork requested a review from a team as a code owner May 3, 2024 15:21
@github-actions github-actions bot added the client Pull requests that update TypeScript code. (Added Automatically!) label May 3, 2024
Copy link

coderabbitai bot commented May 3, 2024

Walkthrough

The update aims to enhance the sidebar card component's functionality by refining the routing behavior and introducing a method to trigger page reloads. These adjustments are designed to offer a more interactive and responsive user experience by enabling dynamic navigation based on selected sidebar items.

Changes

File Path Change Summary
.../sidebar-card.component.html Modified [routerLink] for conditional routing and added (click) event for forceReload().
.../sidebar-card.component.ts Added imports for ActivatedRoute and Router, injected them in the constructor, and included a forceReload method.
.../sidebar-card.component.spec.ts Introduced a spy for forceReload to enhance testing coverage alongside existing spy for emitStoreLastSelectedItem.
.../mock-router.ts Updated the return value of the navigate function from synchronous to promise-based in the MockRouter class.

Possibly related issues


Recent Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between b690841 and f8c4e59.
Files selected for processing (4)
  • src/main/webapp/app/shared/sidebar/sidebar-card/sidebar-card.component.html (1 hunks)
  • src/main/webapp/app/shared/sidebar/sidebar-card/sidebar-card.component.ts (2 hunks)
  • src/test/javascript/spec/component/shared/sidebar/sidebar-card.component.spec.ts (1 hunks)
  • src/test/javascript/spec/helpers/mocks/mock-router.ts (1 hunks)
Files skipped from review as they are similar to previous changes (2)
  • src/main/webapp/app/shared/sidebar/sidebar-card/sidebar-card.component.html
  • src/main/webapp/app/shared/sidebar/sidebar-card/sidebar-card.component.ts
Additional Context Used
Path-based Instructions (2)
src/test/javascript/spec/helpers/mocks/mock-router.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/sidebar/sidebar-card.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 not posted (3)
src/test/javascript/spec/helpers/mocks/mock-router.ts (1)

8-8: The change to the navigate method to return a resolved Promise is appropriate for simulating navigation in tests.

src/test/javascript/spec/component/shared/sidebar/sidebar-card.component.spec.ts (2)

64-64: Setting up a spy on emitStoreLastSelectedItem is correctly implemented to test its invocation on click.


69-69: The spy on forceReload and its subsequent check for invocation are correctly implemented.


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.

@rabeatwork rabeatwork changed the title Programming Exercise: Automatic assessment history is incorrectly displayed Programming Exercise: Display automatic assessment history correctly May 3, 2024
coderabbitai[bot]
coderabbitai bot previously approved these changes May 3, 2024
coderabbitai[bot]
coderabbitai bot previously approved these changes May 3, 2024
@rabeatwork rabeatwork force-pushed the bugfix/programming-exercise/automatic-assessment-history-incorrectly-displayed branch from 6d8b8c1 to f8c4e59 Compare May 3, 2024 17:21
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.

Tested on ts4, works as expected. Code also lgtm

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

@julian-christl
Copy link
Member

I don't think a force reload on every sidebar switch is the way to go here. This seems to be a rather inefficient hotfix to me.

Did you consider preventing the wrongful loading or whatever caused the issue in the first place? If yes, why did you decide against a direct fix of that?

@krusche krusche changed the title Programming Exercise: Display automatic assessment history correctly Programming exercises: Display automatic assessment history correctly May 3, 2024
@krusche krusche added this to the 7.0.3 milestone May 3, 2024
@krusche krusche merged commit 43c7372 into develop May 4, 2024
41 of 43 checks passed
@krusche krusche deleted the bugfix/programming-exercise/automatic-assessment-history-incorrectly-displayed branch May 4, 2024 08:09
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!) tests
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants