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

style(apps/frontend-manage): update messages shown on creation editors and mark past courses #4300

Merged
merged 1 commit into from
Oct 8, 2024

Conversation

sjschlapbach
Copy link
Member

@sjschlapbach sjschlapbach commented Oct 8, 2024

Screenshot 2024-10-08 at 21 34 04

Summary by CodeRabbit

Release Notes

  • New Features

    • Added a badge to indicate when a course has ended, enhancing visual clarity.
    • Updated course sorting to prioritize by end date instead of start date.
  • Localization

    • Introduced new localization keys for "Ended" in both German and English.
    • Updated existing localization messages to clarify the requirement for microlearnings and practice quizzes to be associated with active courses.

Copy link

aviator-app bot commented Oct 8, 2024

Current Aviator status

Aviator will automatically update this comment as the status of the PR changes.
Comment /aviator refresh to force Aviator to re-examine your PR (or learn about other /aviator commands).

This PR was merged manually (without Aviator). Merging manually can negatively impact the performance of the queue. Consider using Aviator next time.


See the real-time status of this PR on the Aviator webapp.
Use the Aviator Chrome Extension to see the status of your PR within GitHub.

Copy link

coderabbitai bot commented Oct 8, 2024

📝 Walkthrough

Walkthrough

The pull request introduces updates to the CourseListButton component and modifies the sorting logic of courses in the CourseSelectionPage. It adds a new boolean variable isPast to determine if a course has ended, affecting the rendering of badges. Additionally, it updates localization files for both German and English to include new keys and modify existing ones to clarify course requirements.

Changes

File Change Summary
apps/frontend-manage/src/components/courses/CourseListButton.tsx Added faCheck import, introduced isPast variable for end date logic, modified rendering to include an ended badge alongside archived badge.
apps/frontend-manage/src/pages/courses/index.tsx Changed sorting of courses from startDate to endDate.
packages/i18n/messages/de.ts Added new key ended and updated existing keys in microLearning and practiceQuiz sections for clarity on course associations.
packages/i18n/messages/en.ts Added new key ended for localization support.

Possibly related PRs

Suggested reviewers

  • rschlaefli

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 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 anywhere in the PR title to generate the title automatically.

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

Copy link

sonarqubecloud bot commented Oct 8, 2024

@sjschlapbach sjschlapbach merged commit 9f8be29 into v3 Oct 8, 2024
7 of 10 checks passed
@sjschlapbach sjschlapbach deleted the update-messages-highlight-past-course branch October 8, 2024 19:35
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

🧹 Outside diff range and nitpick comments (3)
apps/frontend-manage/src/components/courses/CourseListButton.tsx (2)

35-35: LGTM: New isPast variable added with correct logic.

The isPast variable correctly determines if a course has ended by comparing the endDate with the current date. The use of optional chaining is appropriate.

Consider memoizing this value if the component re-renders frequently:

const isPast = React.useMemo(() => 
  endDate ? dayjs(endDate).isBefore(dayjs()) : false,
  [endDate]
);

This optimization is optional and depends on the component's re-render frequency and performance needs.


64-72: LGTM: Badge rendering logic updated correctly.

The changes improve the organization of badges and correctly implement the new "ended" badge based on the isPast condition. The use of icons and translations is appropriate.

For consistency, consider applying the same hover effect to the "archived" badge as used in the "ended" badge:

-        {isArchived && <Badge>{t('shared.generic.archived')}</Badge>}
+        {isArchived && (
+          <Badge className="hover:bg-gray-700">
+            {t('shared.generic.archived')}
+          </Badge>
+        )}

This change would provide a consistent user experience across all badges.

packages/i18n/messages/en.ts (1)

214-214: LGTM! Consider adding lowercase variant for flexibility.

The addition of ended: 'Ended' is appropriate and well-placed in the generic section. It provides a clear status indicator for ended activities or events.

For consistency with other status indicators in this file (e.g., running: 'Running'), consider adding a lowercase variant:

 ended: 'Ended',
+endedLowercase: 'ended',

This addition would provide flexibility for different UI contexts where a lowercase version might be preferred.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between e064032 and 3ba19a8.

📒 Files selected for processing (4)
  • apps/frontend-manage/src/components/courses/CourseListButton.tsx (3 hunks)
  • apps/frontend-manage/src/pages/courses/index.tsx (1 hunks)
  • packages/i18n/messages/de.ts (4 hunks)
  • packages/i18n/messages/en.ts (4 hunks)
🧰 Additional context used
🔇 Additional comments (7)
apps/frontend-manage/src/components/courses/CourseListButton.tsx (2)

2-2: LGTM: New icon import added correctly.

The faCheck icon is imported from the appropriate package and is used later in the component for the new "ended" badge.


Line range hint 1-78: Overall, the changes to CourseListButton.tsx are well-implemented.

The modifications enhance the component's functionality by introducing the "ended" course status and improving the organization of badges. The code is clean, and the logic is sound. The minor suggestions provided for optimization and consistency can further refine the implementation, but they are not critical.

apps/frontend-manage/src/pages/courses/index.tsx (1)

66-66: Clarify the reasoning for changing course sorting logic

The sorting logic has been modified to use endDate instead of startDate for ordering courses. While this change is technically correct, it may have implications on user experience and expectations.

  1. Can you provide the rationale behind this change? Understanding the motivation will help ensure it aligns with the overall product goals.
  2. Consider the user experience implications:
    • Will users expect to see courses ending soon at the top of the list?
    • How does this affect the visibility of upcoming courses?
  3. If this change is intentional and approved, please ensure that:
    • Any relevant documentation is updated to reflect this new behavior.
    • The product team is aware of this change for any necessary updates to user guides or FAQs.

To ensure consistency across the application, let's check if this change affects other parts of the codebase:

packages/i18n/messages/de.ts (4)

214-214: LGTM: New translation added correctly.

The addition of ended: 'Beendet' in the generic section is appropriate and consistent with the expected changes. This new translation will be useful for indicating completed states in the German version of the application.


1031-1033: Excellent update to the microlearning guidance.

The revised text for microLearningNoCourse provides clearer instructions to users. It now specifies that microlearnings must be associated with an "ongoing" course and offers the additional option of extending an existing course. This change enhances user understanding and provides more flexibility in course management.


1137-1139: Well-implemented consistency in practice quiz guidance.

The update to practiceQuizNoCourse mirrors the improvements made to the microlearning section. It now clearly states that practice quizzes must be associated with an ongoing course and provides the options of creating a new course or extending an existing one. This change maintains consistency across different activity types and improves user guidance.


1206-1208: Excellent enhancement to group activity requirements.

The update to groupActivityNoCourse significantly improves the guidance for creating group activities. It now clearly specifies the need for an ongoing course with both gamification and group formation enabled. The added instruction to verify the existence of a suitable course before proceeding is particularly helpful. This change provides users with more precise requirements, potentially reducing errors in group activity setup.

Copy link

cypress bot commented Oct 8, 2024

klicker-uzh    Run #3170

Run Properties:  status check failed Failed #3170  •  git commit 8b79c3a3a0 ℹ️: Merge 3ba19a87c3d9e263bf09a3753fe97fe781951c06 into e0640327c03b348a202c228b94ee...
Project klicker-uzh
Run status status check failed Failed #3170
Run duration 10m 59s
Commit git commit 8b79c3a3a0 ℹ️: Merge 3ba19a87c3d9e263bf09a3753fe97fe781951c06 into e0640327c03b348a202c228b94ee...
Committer Julius Schlapbach
View all properties for this run ↗︎

Test results
Tests that failed  Failures 2
Tests that were flaky  Flaky 1
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 45

Tests for review

Failed  E-course-workflow.cy.ts • 1 failed test

View Output

Test Artifacts
Test course creation and editing functionalities > Test the assignment of random groups in the seeded test course Test Replay Screenshots
Failed  F-live-quiz-workflow.cy.ts • 1 failed test

View Output

Test Artifacts
Different live-quiz workflows > creates a live quiz without questions and tests the feedback mechanisms and deletes the completed live session Test Replay Screenshots
Flakiness  cypress/e2e/K-group-activity-workflow.cy.ts • 1 flaky test

View Output

Test Artifacts
Create and solve a group activity > create a group activity and edit it Screenshots

Copy link

cypress bot commented Oct 8, 2024

klicker-uzh    Run #3172

Run Properties:  status check passed Passed #3172  •  git commit 9f8be29c87: style(apps/frontend-manage): update messages shown on creation editors and mark ...
Project klicker-uzh
Run status status check passed Passed #3172
Run duration 09m 56s
Commit git commit 9f8be29c87: style(apps/frontend-manage): update messages shown on creation editors and mark ...
Committer Julius Schlapbach
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 1
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 47

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant