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

Learning path: Fix translation for introduction screen #9438

Merged

Conversation

JohannesWt
Copy link
Contributor

@JohannesWt JohannesWt commented Oct 7, 2024

Checklist

General

Client

Motivation and Context

There is a translation issue as the Translate Pipe has been accidentally removed from the learning path screen. Therefore the introduction screen did not show any translations or errors

Description

This PR introduces the new standalone Translation Pipe

Steps for Testing

Prerequisites:

  • 1 Instructor
  • 1 Student
  • 1 competency with a unit
  • not started a learning path
  1. Log in to Artemis
  2. Navigate to the learning path student screen
  3. Verify that there is an introduction text and a button which lets you start your learning path

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

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Test Coverage

unchanged

Summary by CodeRabbit

  • New Features
    • Enhanced the Learning Path Student Page with translation capabilities through the addition of the TranslateDirective.

This update improves accessibility for users by allowing content to be displayed in multiple languages.

@JohannesWt JohannesWt self-assigned this Oct 7, 2024
@github-actions github-actions bot added the client Pull requests that update TypeScript code. (Added Automatically!) label Oct 7, 2024
@JohannesWt JohannesWt added bugfix and removed client Pull requests that update TypeScript code. (Added Automatically!) labels Oct 7, 2024
@JohannesWt JohannesWt marked this pull request as ready for review October 7, 2024 18:41
@JohannesWt JohannesWt requested a review from a team as a code owner October 7, 2024 18:41
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.

Code

Copy link

coderabbitai bot commented Oct 7, 2024

Walkthrough

The changes introduce the TranslateDirective into the LearningPathStudentPageComponent by adding it to the component's imports array. This allows the directive to be utilized within the component's template. No other alterations to the component's logic or properties are made.

Changes

File Change Summary
src/main/webapp/app/course/learning-paths/pages/learning-path-student-page/learning-path-student-page.component.ts Added import for TranslateDirective to the component's imports array.

Possibly related PRs

  • Learning path: Fix competency graph overflow and display minimap #8992: The changes in this PR involve modifications to the competency-graph.component.html, which is part of the learning paths feature, similar to the learning-path-student-page.component.ts in the main PR. Both PRs are related to the learning paths functionality within the same application context.

Suggested labels

client, small, ready for review

Suggested reviewers

  • JohannesStoehr
  • SimonEntholzer
  • florian-glombik
  • N0W0RK

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

🧹 Outside diff range comments (1)
src/main/webapp/app/course/learning-paths/pages/learning-path-student-page/learning-path-student-page.component.ts (1)

Line range hint 1-72: Suggestion: Add unit tests for translation functionality

The changes look good and address the translation issue. However, to ensure the new translation functionality works as expected and to prevent future regressions, it would be beneficial to add unit tests for this component.

Consider adding tests that:

  1. Verify the TranslateDirective is properly imported and used.
  2. Check if the introduction text and button are correctly translated.
  3. Ensure the translation works for both English and German, as mentioned in the PR objectives.

This will help maintain the reliability of the translation feature and align with the coding guideline for meaningful tests.

Would you like assistance in generating some example unit tests for this component?

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE

📥 Commits

Files that changed from the base of the PR and between a0f7fd8 and 40fb64b.

📒 Files selected for processing (1)
  • src/main/webapp/app/course/learning-paths/pages/learning-path-student-page/learning-path-student-page.component.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
src/main/webapp/app/course/learning-paths/pages/learning-path-student-page/learning-path-student-page.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

🔇 Additional comments (3)
src/main/webapp/app/course/learning-paths/pages/learning-path-student-page/learning-path-student-page.component.ts (3)

13-13: LGTM: Import of TranslateDirective

The addition of the TranslateDirective import aligns with the PR objective of fixing the translation issue for the introduction screen. This import follows the coding guideline for using camelCase in imports.


20-20: LGTM: Addition of TranslateDirective to imports array

Adding TranslateDirective to the imports array is necessary to use the directive in the component's template. This change is consistent with Angular best practices and addresses the translation issue mentioned in the PR objectives.


Line range hint 1-72: Summary: Translation issue addressed with minimal, focused changes

The changes in this file effectively address the translation issue mentioned in the PR objectives:

  1. The TranslateDirective is imported and added to the component's imports array.
  2. These minimal changes should allow the introduction text and button to be properly translated.

The implementation follows Angular best practices and the provided coding guidelines. The component's overall structure remains solid, with proper error handling and use of modern Angular features like signals and effects.

To further improve the reliability of this feature, consider adding unit tests as suggested in the previous comment.

Overall, these changes appear to be a good solution to the reported translation problem.

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

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

Code lgtm, tested locally!

Copy link
Contributor

@PaRangger PaRangger left a comment

Choose a reason for hiding this comment

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

Code LGTM, tested on TS6. 👍🏼

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 ts6, works as expected

@MaximilianAnzinger MaximilianAnzinger added ready to merge maintainer-approved The feature maintainer has approved the PR and removed ready for review labels Oct 8, 2024
Copy link
Collaborator

@MaximilianAnzinger MaximilianAnzinger left a comment

Choose a reason for hiding this comment

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

Maintainer approved

@krusche krusche added this to the 7.6.0 milestone Oct 11, 2024
@krusche krusche merged commit 93dae1b into develop Oct 11, 2024
65 of 69 checks passed
@krusche krusche deleted the feature/learning-paths/fix-introduction-translation branch October 11, 2024 05:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix maintainer-approved The feature maintainer has approved the PR ready to merge small
Projects
Archived in project
Status: Done
Development

Successfully merging this pull request may close these issues.

8 participants