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: Add information box to exercise details page #9089

Closed
wants to merge 18 commits into from

Conversation

rabeatwork
Copy link
Contributor

@rabeatwork rabeatwork commented Jul 19, 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

This PR is part of the new design; it enhances usability and aligns with the updated layout.

Description

All important information for an exercise is now displayed in the information boxes at the top. Additionally, the Instructor Actions are consolidated into a dropdown button.

Steps for Testing

Prerequisites:

  • 1 Instructor
  • 1 Students
  • 1 Programming Exercise
  1. Log in to Artemis
  2. Navigate to Exercises
  3. Check differently configured exercises and verify that the information are displayed correctly

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

Test Coverage

Screenshots

Text Future und Kategorie ModelingCurrent Programming + Result Optional Text QuizBewertet

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Introduced a new ExerciseHeadersInformationComponent for displaying exercise-related information.
    • Added dynamic rendering for difficulty levels and submission statuses within the exercise headers.
    • Enhanced the clarity and maintainability of information box content processing in the exam start information component.
    • Implemented a skill bar in the DifficultyLevelComponent to visually represent difficulty levels with color coding.
    • Enhanced ResultComponent and SubmissionResultStatusComponent to conditionally display completion information.
    • Updated CodeButtonComponent and OpenCodeEditorButtonComponent to include a dynamic hideLabelMobile feature for better mobile responsiveness.
    • Added an isDateLessThanAWeekInTheFuture utility function for easier date management.
  • Bug Fixes

    • Improved conditional rendering logic for displaying completion dates and submission result statuses.
  • Style Updates

    • Updated button styles throughout the application for a more modern look.
    • Adjusted the layout and styling of exercise details for better presentation.
    • Enhanced the visual representation of "not released" tags by changing the background color class.
  • Documentation

    • Revised localization strings for clarity and consistency across user interfaces.
  • Tests

    • Introduced unit tests for ExerciseHeadersInformationComponent and DifficultyLevelComponent to ensure expected functionality.
    • Updated tests for CourseExerciseDetailsComponent to include interactions with the new ExerciseHeadersInformationComponent.

@github-actions github-actions bot added tests client Pull requests that update TypeScript code. (Added Automatically!) cypress Pull requests that update cypress tests. (Added Automatically!) labels Jul 19, 2024
@rabeatwork rabeatwork force-pushed the chore/improve-exercise-details-page branch from 23025a3 to dc599f6 Compare July 22, 2024 09:36
@rabeatwork rabeatwork changed the title Chore/improve exercise details page Programming exercises: Add information box to exercise details page Jul 22, 2024
@rabeatwork rabeatwork marked this pull request as ready for review July 22, 2024 10:11
@rabeatwork rabeatwork requested a review from a team as a code owner July 22, 2024 10:11
Copy link

coderabbitai bot commented Jul 22, 2024

Walkthrough

The recent updates significantly enhance the Angular application by refining content display logic, introducing new components, and improving user interface elements. Key changes include a more structured approach to rendering information, better configurability of components, and streamlined data handling through a new type encapsulation. These enhancements aim to improve responsiveness, maintainability, and overall user experience, making interactions more intuitive and efficient.

Changes

Files Change Summary
src/main/webapp/app/exam/.../exam-start-information.component.html
src/main/webapp/app/exam/.../exam-start-information.component.ts
Simplified content processing by switching to a type property, improving structure and clarity of information boxes while enhancing type safety with a new InformationBoxContent.
src/main/webapp/app/exercises/shared/exercise-headers/...
src/main/webapp/app/exercises/shared/exercise-headers/...
Introduced ExerciseHeadersInformationComponent for organized display of exercise details, enhancing modularity and user interaction through dynamic rendering of associated information.
src/main/webapp/app/shared/exercise-categories/exercise-categories.component.html Replaced <h4> tags with <span> elements for flexible styling based on conditions, improving responsive design and semantic structure.
src/test/... Added unit tests for new components to ensure functionality and reliability, particularly for the ExerciseHeadersInformationComponent.
src/main/webapp/app/utils/date.utils.ts Introduced isDateLessThanAWeekInTheFuture function for date validation, enhancing utility for date-related features.
src/main/webapp/app/shared/components/not-released-tag.component.ts Updated noMargin input property to default to true, simplifying component usage by ensuring consistent behavior.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant UI
    participant Service
    participant Component

    User->>UI: Interacts with exercise components
    UI->>Component: Triggers data fetch/update
    Component->>Service: Requests necessary information
    Service-->>Component: Provides updated data
    Component-->>UI: Renders new information in UI
    UI-->>User: Displays updated content
Loading

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

Copy link
Contributor

@sarpsahinalp sarpsahinalp left a comment

Choose a reason for hiding this comment

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

The status and points seems a little small in respect to rest of the elements in the page:
image

Copy link
Contributor

@az108 az108 left a comment

Choose a reason for hiding this comment

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

Can we consider displaying the boxes boxes from the right side above the communication or is it strictly wanted on the left side? It used to be on the right side and it does make sense to keep it with the code and open code editor button. But I dont have a strong opinion on that.
image

Copy link
Contributor

@MarkusPaulsen MarkusPaulsen left a comment

Choose a reason for hiding this comment

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

Edge-Case: Extreme long categories are not displayed correctly and destroy the layout (the right edge of the picture is actually the right edge of the page):
Bildschirmfoto 2024-07-22 um 16 46 35

@rabeatwork
Copy link
Contributor Author

Edge-Case: Extreme long categories are not displayed correctly and destroy the layout (the right edge of the picture is actually the right edge of the page): Bildschirmfoto 2024-07-22 um 16 46 35

I guess this might not be the intended use of our categories, but for now, I've added an ellipsis to only show a maximal number of characters. In a future PR, we could consider restricting the category names to a certain number of characters during creation.

Screenshot 2024-07-26 at 16 03 13

@rabeatwork
Copy link
Contributor Author

Can we consider displaying the boxes boxes from the right side above the communication or is it strictly wanted on the left side? It used to be on the right side and it does make sense to keep it with the code and open code editor button. But I dont have a strong opinion on that. image

Previously, some information was on the right and some on the left. Due to the more common left-to-right reading direction, I will now align the elements to the left.

coderabbitai[bot]
coderabbitai bot previously approved these changes Jul 30, 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.

Code

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

@dmytropolityka dmytropolityka left a comment

Choose a reason for hiding this comment

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

Re-approved

Copy link
Contributor

@az108 az108 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

@sarpsahinalp sarpsahinalp 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

There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions.

Copy link

There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions.

Copy link

github-actions bot commented Sep 7, 2024

There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions.

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!) stale tests
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

7 participants