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: Leave unit form selection available in edit mode #10229

Merged
merged 2 commits into from
Feb 2, 2025

Conversation

laxerhd
Copy link
Contributor

@laxerhd laxerhd commented Jan 28, 2025

Checklist

General

Client

  • 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 screenshots/screencasts of my UI changes.

Motivation and Context

Regarding this PR #10178, there was a suggestion to leave the unit selection open in the form instead of clicking the “Cancel” button.

Description

  • Removed loading screen in create-exercise-unit: I did not see a reason for only this one to have a loading screen and it messed with the layout for the page if clicked for a few moments
  • The form for unit selection always remains open, and each time you click on another form, all others are set to “false” so that multiple forms are not open.

Steps for Testing

Prerequisites:

  • 1 Instructor
  • 1 Course with a lecture
  1. Go to a Course with lectures
  2. Click on Lectures
  3. Click on Manage
  4. Click on Edit
  5. Scroll down till you see Add a new Lecture Unit
  6. Click on one of the unit forms and test it out

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

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Screenshots

Example with expanded Video Form Unit and unit form selection bar stays available
image

Summary by CodeRabbit

  • UI/UX Improvements

    • Simplified lecture unit creation interface
    • Streamlined layout for exercise unit creation
    • Enhanced form management for lecture units
    • Improved form opening and closing logic
  • Bug Fixes

    • Resolved potential issues with multiple open forms during lecture unit creation

The changes focus on improving the user experience when creating and managing lecture units by simplifying the interface and ensuring more consistent form behavior.

@laxerhd laxerhd self-assigned this Jan 28, 2025
@laxerhd laxerhd requested a review from a team as a code owner January 28, 2025 23:35
@github-actions github-actions bot added the client Pull requests that update TypeScript code. (Added Automatically!) label Jan 28, 2025
Copy link

coderabbitai bot commented Jan 28, 2025

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

npm warn config production Use --omit=dev instead.

Walkthrough

The pull request introduces changes to the lecture unit management components, focusing on simplifying the HTML templates and component logic. The modifications primarily affect the create-exercise-unit.component.html and lecture-units.component.html files, streamlining the layout and rendering logic. In the lecture-units.component.ts, a minor change was made to the onCreateLectureUnit method to ensure that lecture unit forms are closed before creating a new unit.

Changes

File Change Summary
src/main/webapp/app/lecture/lecture-unit/lecture-unit-management/create-exercise-unit/create-exercise-unit.component.html Removed loading state, simplified content layout, added descriptive paragraph
src/main/webapp/app/lecture/lecture-units/lecture-units.component.html Simplified conditional rendering logic for unit creation card and forms
src/main/webapp/app/lecture/lecture-units/lecture-units.component.ts Added onCloseLectureUnitForms() call at the start of onCreateLectureUnit method

Possibly related PRs

Suggested Labels

tests, client, small, enhancement, ready to merge, maintainer-approved

Suggested Reviewers

  • JohannesStoehr
  • EneaGore
  • SimonEntholzer
  • BBesrour
  • HawKhiem
✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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: 0

🧹 Nitpick comments (1)
src/main/webapp/app/lecture/lecture-unit/lecture-unit-management/create-exercise-unit/create-exercise-unit.component.html (1)

25-81: Consider accessibility improvements for the exercise selection table.

While the table structure is good, consider adding ARIA labels and role attributes to improve accessibility.

-                <table class="table table-bordered">
+                <table class="table table-bordered" role="grid" aria-label="Exercise selection table">
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c8c93d2 and 5770b64.

📒 Files selected for processing (3)
  • src/main/webapp/app/lecture/lecture-unit/lecture-unit-management/create-exercise-unit/create-exercise-unit.component.html (1 hunks)
  • src/main/webapp/app/lecture/lecture-units/lecture-units.component.html (1 hunks)
  • src/main/webapp/app/lecture/lecture-units/lecture-units.component.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
src/main/webapp/app/lecture/lecture-units/lecture-units.component.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/main/webapp/app/lecture/lecture-unit/lecture-unit-management/create-exercise-unit/create-exercise-unit.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/lecture/lecture-units/lecture-units.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.

⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: client-tests
  • GitHub Check: server-tests
  • GitHub Check: Analyse
🔇 Additional comments (13)
src/main/webapp/app/lecture/lecture-units/lecture-units.component.ts (2)

94-94: LGTM! Good improvement to form state management.

The addition of this.onCloseLectureUnitForms() ensures a clean state by closing all forms before opening a new one, preventing multiple forms from being open simultaneously.


94-94: LGTM! The change aligns with the PR objectives.

The addition of this.onCloseLectureUnitForms() ensures that all forms are closed before opening a new one, preventing multiple forms from being open simultaneously.

src/main/webapp/app/lecture/lecture-units/lecture-units.component.html (6)

11-13: LGTM! Improved visibility of unit creation options.

The unit creation card is now always visible, making it easier for users to access unit creation functionality.


15-19: LGTM! Clear header text based on context.

The header text appropriately changes between "Edit Lecture Unit" and "New Lecture Unit" based on the current operation.


20-65: LGTM! Modern Angular syntax and consistent form handling.

The template uses the new @if syntax instead of *ngIf, following Angular's latest best practices. Each form's visibility is properly controlled, and the cancel functionality is consistently implemented across all form types.


11-13: LGTM! Unit creation card is now always visible.

This change aligns with the PR objective of keeping unit selection available at all times.


15-19: LGTM! Clear header text based on component state.

The conditional header text provides clear feedback about whether the user is editing an existing unit or creating a new one.


20-65: LGTM! Form rendering follows new Angular syntax.

The implementation correctly uses @if instead of *ngIf as per the coding guidelines. Each form has consistent properties:

  • Edit mode flag
  • Cancel button
  • Event handlers
  • Form data binding
src/main/webapp/app/lecture/lecture-unit/lecture-unit-management/create-exercise-unit/create-exercise-unit.component.html (5)

1-6: LGTM! Clean container structure.

The template uses proper Bootstrap container classes and includes a clear heading.


7-24: LGTM! Improved button layout and description.

The layout provides a clear description of the exercise unit creation process and properly aligns the action buttons.


1-6: LGTM! Clean container structure with responsive layout.

The container structure with Bootstrap grid classes ensures proper spacing and responsiveness.


7-24: LGTM! Well-organized description and action buttons.

The layout effectively:

  • Splits description and buttons into separate columns
  • Right-aligns buttons for better UX
  • Properly handles button states and icons

25-81: LGTM! Comprehensive exercise selection table.

The table implementation includes:

  • Responsive wrapper
  • Sortable columns with icons
  • Clear exercise properties
  • Interactive row selection

@laxerhd laxerhd changed the title Lecture: Leave unit form selection available in edit mode Lectures: Leave unit form selection available in edit mode Jan 28, 2025
@github-actions github-actions bot added deployment-error Added by deployment workflows if an error occured and removed deploy:artemis-test3 labels Jan 29, 2025
@vinceclifford vinceclifford added deploy:artemis-test5 and removed deployment-error Added by deployment workflows if an error occured labels Jan 29, 2025
@vinceclifford vinceclifford temporarily deployed to artemis-test5.artemis.cit.tum.de January 29, 2025 12:44 — with GitHub Actions Inactive
Copy link

@vinceclifford vinceclifford 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 TS5, works as expected.

Copy link

@sawys777 sawys777 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, every lecture unit was successfully created and the function works as expected.

Copy link

@zagemello zagemello 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, all works as expected!

@krusche krusche modified the milestones: 7.9.2, 7.9.1 Feb 2, 2025
@krusche krusche changed the title Lectures: Leave unit form selection available in edit mode Lectures: Leave unit form selection available in edit mode Feb 2, 2025
@krusche krusche merged commit 9e33c00 into develop Feb 2, 2025
181 of 188 checks passed
@krusche krusche deleted the bugfix/general/force-lecture-unit-selection-open branch February 2, 2025 21:39
@alekspetrov9e alekspetrov9e temporarily deployed to artemis-test4.artemis.cit.tum.de February 3, 2025 10:15 — with GitHub Actions Inactive
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!) ready for review
Projects
Status: Merged
Development

Successfully merging this pull request may close these issues.