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

Tutorial groups: Improve tutor usability #8426

Merged
merged 3 commits into from
Apr 21, 2024

Conversation

JohannesStoehr
Copy link
Contributor

@JohannesStoehr JohannesStoehr commented Apr 17, 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 integration tests (Jest) related to the features (with a high test coverage), while following the test guidelines.
  • I added multiple screenshots/screencasts of my UI changes.

Motivation and Context

Tutors also have to navigate to their tutorials to either verify or look up information there or to insert the number of attendees for the latest session. This should be made as easy as possible.
Additionally fixes #8428

Description

  • Now shows the tutorial group of the tutor in the course view instead of You are not registered to any tutorial group in this course.
  • When navigating to the details view of the tutorial group, the tutor can now enter the attending students in the sessions table. This also updates the average attendees and utilization if that is necessary (one of the latest three sessions that are already past were edited)
  • The update is not done when the tutor enters the information via the session detail view, since this was not implemented previously as well
  • The attendance is now displayed before the capacity, see: Unintuitive order in tutorial groups overview #8428

Steps for Testing

Prerequisites:

  • 1 Instructor
  1. Log in to Artemis
  2. Navigate to Course Administration
  3. Create a tutorial group and assign yourself as tutor and create a few sessions in the future and past
  4. Head to the course view and check out the tutorial group view there. Make sure that you see your assigned tutorial group
  5. Click on that tutorial group and input different attendee numbers for different sessions. The average attendees should update when editing any of the latest three past sessions

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

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Test Coverage

Client

Class/File Line Coverage Confirmation (assert/expect)
tutorial-group-session.service.ts 94.87%
tutorial-group-detail.component.ts 90.24%
course-tutorial-groups.component.ts 85.41%

Screenshots

Bildschirmfoto 2024-04-17 um 23 02 47 Bildschirmfoto 2024-04-17 um 23 03 09

Summary by CodeRabbit

  • New Features

    • Added a read-only attribute to the tutorial group sessions table based on user role.
    • Introduced an event to recalculate attendance details upon updates.
    • Enhanced filtering of tutorial groups for users based on their roles.
  • Bug Fixes

    • Adjusted attendance calculation method in TutorialGroupDetailComponent.
  • Tests

    • Updated and added new test cases to reflect changes in user role filtering and attendance calculations in tutorial groups components.

@JohannesStoehr JohannesStoehr added enhancement ready for review client Pull requests that update TypeScript code. (Added Automatically!) small user interface component:TutorialGroups labels Apr 17, 2024
@JohannesStoehr JohannesStoehr added this to the 7.0.1 milestone Apr 17, 2024
@JohannesStoehr JohannesStoehr self-assigned this Apr 17, 2024
@JohannesStoehr JohannesStoehr requested a review from a team as a code owner April 17, 2024 21:06
Copy link

coderabbitai bot commented Apr 17, 2024

Walkthrough

The changes across the Angular application aim to improve the functionality and user experience related to tutorial groups. These enhancements include adding new attributes, methods, and dependencies to better manage tutorial group sessions, attendance, and user roles within the application.

Changes

Files Change Summary
.../tutorial-group-session.service.ts
.../tutorial-group-detail.component.ts
Added constructor parameter in TutorialGroupSessionService and imports in TutorialGroupDetailComponent.
.../tutorial-group-detail.component.html Introduced [isReadOnly] attribute and (attendanceUpdated) event in jhi-tutorial-group-sessions-table.
.../course-tutorial-groups.component.ts
.../course-tutorial-groups.component.spec.ts
Updated registeredTutorialGroups getter and test cases for role-based filtering.
.../tutorial-group-detail.component.spec.ts Added imports and a new test case for attendance calculation.
.../tutorial-groups-table/tutorial-group-row/tutorial-group-row.component.html Reordered display of tutorialGroup.capacity and tutorialGroup.numberOfRegisteredUsers.
.../tutorial-groups-table/tutorial-groups-table.component.html Changed translation key order from "capacityWithRegistrations" to "registrationsWithCapacity."
.../i18n/de/tutorialGroups.json
.../i18n/en/tutorialGroups.json
Swapped display order of "registrations" and "capacity" in UI text.

Possibly related issues


Recent Review Details

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 12131cd and 63c5b13.
Files selected for processing (4)
  • src/main/webapp/app/course/tutorial-groups/shared/tutorial-groups-table/tutorial-group-row/tutorial-group-row.component.html (1 hunks)
  • src/main/webapp/app/course/tutorial-groups/shared/tutorial-groups-table/tutorial-groups-table.component.html (1 hunks)
  • src/main/webapp/i18n/de/tutorialGroups.json (1 hunks)
  • src/main/webapp/i18n/en/tutorialGroups.json (1 hunks)
Additional Context Used
Path-based Instructions (2)
src/main/webapp/app/course/tutorial-groups/shared/tutorial-groups-table/tutorial-group-row/tutorial-group-row.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/course/tutorial-groups/shared/tutorial-groups-table/tutorial-groups-table.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.

Additional comments not posted (4)
src/main/webapp/app/course/tutorial-groups/shared/tutorial-groups-table/tutorial-group-row/tutorial-group-row.component.html (1)

15-15: Change in data display order approved.

This change enhances the clarity of the data presentation by aligning with the intuitive format of showing "Registrations / Capacity". Good use of Angular template syntax and bindings.

src/main/webapp/app/course/tutorial-groups/shared/tutorial-groups-table/tutorial-groups-table.component.html (1)

25-25: Change in translation key approved.

This change updates the translation key to "registrationsWithCapacity", enhancing the consistency and clarity of the table header. Good use of Angular template syntax and bindings.

src/main/webapp/i18n/en/tutorialGroups.json (1)

43-43: Change in translation string approved.

This change updates the translation string to "Registrations / Capacity", enhancing the consistency and clarity of the data presentation. Correct usage of JSON syntax.

src/main/webapp/i18n/de/tutorialGroups.json (1)

43-43: Change in translation string approved.

This change updates the translation string to "Registrierungen / Kapazität", enhancing the consistency and clarity of the data presentation. Correct usage of JSON syntax.


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 the tests label Apr 17, 2024
Copy link
Contributor

@simon-hng simon-hng left a comment

Choose a reason for hiding this comment

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

Code changes LGTM with meaningful tests!

Very nice work!

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

coderabbitai[bot]
coderabbitai bot previously approved these changes Apr 17, 2024
Strohgelaender
Strohgelaender previously approved these changes Apr 18, 2024
Copy link
Contributor

@Strohgelaender Strohgelaender 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
Member

@julian-christl julian-christl 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

julian-christl

This comment was marked as off-topic.

Copy link
Member

@julian-christl julian-christl left a comment

Choose a reason for hiding this comment

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

The order displayed in the details view of a tutorial group is very weird:

The next one is at the top, then the rest of the sessions come in the reversed order and on the bottom the past ones come. So if, as a tutor, I want to insert the attendance of my group I had 10 minutes ago, I always have to scroll down to the bottom.


Edit: Since the old tutorial is kept on top for 30 minutes after the tutorial, that should be enough time.

Copy link
Member

@julian-christl julian-christl 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, tested on ts2

Copy link
Contributor

@coolchock coolchock 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 ts2, works as expected 👍

@krusche krusche merged commit b01f877 into develop Apr 21, 2024
33 of 41 checks passed
@krusche krusche deleted the enhancement/tutorial-groups/improve-tutor-usability branch April 21, 2024 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Unintuitive order in tutorial groups overview
6 participants