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

Adaptive learning: Redesign edit competency relation section #9447

Merged
merged 23 commits into from
Oct 22, 2024

Conversation

JohannesWt
Copy link
Contributor

@JohannesWt JohannesWt commented Oct 9, 2024

Checklist

General

Server

  • Important: I implemented the changes with a very good performance and prevented too many (unnecessary) and too complex database calls.
  • I strictly followed the principle of data economy for all database calls.
  • I strictly followed the server coding and design guidelines.
  • I added multiple integration tests (Spring) related to the features (with a high test coverage).
  • I added pre-authorization annotations according to the guidelines and checked the course groups for all new REST Calls (security).
  • I documented the Java code using JavaDoc style.

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 (e.g. using paging).
  • I strictly followed the principle of data economy for all client-server REST calls.
  • 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 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

Description

This PR introduces a redesigned section for creating/deleting and updating a relation between course competencies. Therefore a new button has been added to the competency management page which opens an own modal to create relations between competencies. The new graph in the modal distinguishes between Prerequisites and Competencies to make to give the Instructor a hint what to connect.

This PR is the first part of a makeover to convert the competency management page to use signals and make all involved components standalone or replace them completely.

Steps for Testing

Prerequisites:

  • 1 Instructor
  1. Log in to Artemis
  2. Navigate to Competency Management
  3. Click the "Edit Relations"-Button
  4. Create two or more relations
  5. Click on a relation and delete it
  6. Click on a relation and update the relation type

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

Client

Class/File Line Coverage Confirmation (assert/expect)
competency-management.component.ts 88.76% ✅ ❌
competency-relation-graph.component.ts not found (deleted)
course-competencies-relation-graph.component.ts 96.42% ✅ ❌
course-competencies-relation-modal.component.ts 100%
course-competency-relation-form.component.ts 91.54% ✅ ❌
course-competency-relation-node.component.ts 100%
course-competency-api.service.ts 91.66% ✅ ❌
competency.model.ts 88.15% ✅ ❌

Server

Class/File Line Coverage Confirmation (assert/expect)
UpdateCourseCompetencyRelationDTO.java 100%
CompetencyService.java 90% ✅ ❌
CourseCompetencyService.java 90% ✅ ❌
PrerequisiteService.java 90% ✅ ❌
CourseCompetencyResource.java 97% ✅ ❌

Screenshots

image

Summary by CodeRabbit

  • New Features

    • Introduced a modal for managing course competency relations.
    • Added new components for competency relation management, including a relation graph and relation form.
    • New buttons and labels added for editing relations in multiple languages.
    • Enhanced modularity of the Competency Management Component.
  • Bug Fixes

    • Removed outdated methods related to competency relations to streamline functionality.
  • Documentation

    • Updated documentation to reflect changes in competency relation management.
  • Tests

    • Added new test suites for the newly introduced components and functionalities.

@JohannesWt JohannesWt self-assigned this Oct 9, 2024
@github-actions github-actions bot added tests client Pull requests that update TypeScript code. (Added Automatically!) labels Oct 9, 2024
@github-actions github-actions bot added server Pull requests that update Java code. (Added Automatically!) atlas Pull requests that affect the corresponding module labels Oct 9, 2024
@MaximilianAnzinger MaximilianAnzinger changed the title Adaptive Learning: Redesign edit competency relation section Adaptive learning: Redesign edit competency relation section Oct 9, 2024
@JohannesWt JohannesWt marked this pull request as ready for review October 10, 2024 09:18
@JohannesWt JohannesWt requested a review from a team as a code owner October 10, 2024 09:18
Copy link

coderabbitai bot commented Oct 10, 2024

Walkthrough

This pull request introduces significant modifications across several Java and TypeScript files related to competency management. Key changes include updates to service constructors, the addition of new methods for managing course competency relations, and the introduction of new components for handling competency relations in the frontend. The CompetencyManagementComponent has been restructured to remove relation management features, while new modal components and relation graph components have been added. Additionally, several localization files have been updated to reflect these changes.

Changes

File Change Summary
src/main/java/de/tum/cit/aet/artemis/atlas/service/competency/*.java Constructor signatures updated and new methods added for competency services.
src/main/webapp/app/course/competencies/competency-management/*.ts Component restructured to remove relation management; new methods and properties added for modal handling.
src/main/webapp/app/course/competencies/competency-management/*.html Button added for opening competency relations modal; competency relation graph component removed.
src/main/webapp/app/course/competencies/components/*.ts New components added for competency relations and forms, including methods and properties for managing relations.
src/main/webapp/i18n/de/competency.json New keys and objects added for managing competency relations in German localization.
src/main/webapp/i18n/en/competency.json New keys and objects added for managing competency relations in English localization.
src/test/java/de/tum/cit/aet/artemis/atlas/competency/*.java New integration test method added for course competency relation updates.
src/test/javascript/spec/component/competencies/*.spec.ts New test suites added for the newly created components; some imports removed from existing tests.

Possibly related PRs

Suggested labels

enhancement, ready to merge, component:AdaptiveLearning

Suggested reviewers

  • JohannesStoehr
  • MaximilianAnzinger
  • florian-glombik
  • pzdr7
  • Jan-Thurner
  • sarpsahinalp

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

🧹 Outside diff range and nitpick comments (1)
src/main/webapp/i18n/de/competency.json (1)

246-275: New "relations" section added successfully.

The new "relations" section has been added with appropriate translations for managing relationships between course competencies. The translations are consistent and use the informal "du" form as required. However, there's a minor suggestion for improvement:

Consider adding a brief explanation for each relation type in the "relationTypes" object. This could help users understand the differences between "ASSUMES", "EXTENDS", and "MATCHES" more easily. For example:

"relationTypes": {
-    "ASSUMES": "Setzt voraus",
-    "EXTENDS": "Erweitert",
-    "MATCHES": "Stimmt überein mit"
+    "ASSUMES": "Setzt voraus (Eine Kompetenz ist Voraussetzung für eine andere)",
+    "EXTENDS": "Erweitert (Eine Kompetenz baut auf einer anderen auf)",
+    "MATCHES": "Stimmt überein mit (Zwei Kompetenzen sind gleichwertig)"
},
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between f1136c2 and d2d0a0d.

📒 Files selected for processing (4)
  • src/main/webapp/app/course/competencies/competency-management/competency-management.component.html (1 hunks)
  • src/main/webapp/app/course/competencies/competency-management/competency-management.component.ts (6 hunks)
  • src/main/webapp/i18n/de/competency.json (2 hunks)
  • src/main/webapp/i18n/en/competency.json (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/main/webapp/app/course/competencies/competency-management/competency-management.component.html
  • src/main/webapp/i18n/en/competency.json
🧰 Additional context used
📓 Path-based instructions (2)
src/main/webapp/app/course/competencies/competency-management/competency-management.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/i18n/de/competency.json (1)

Pattern src/main/webapp/i18n/de/**/*.json: German language translations should be informal (dutzen) and should never be formal (sietzen). So the user should always be addressed with "du/dein" and never with "sie/ihr".

🪛 GitHub Check: client-tests-selected
src/main/webapp/app/course/competencies/competency-management/competency-management.component.ts

[failure] 47-47:
Cannot find name 'faEdit'. Did you mean the instance member 'this.faEdit'?

🪛 GitHub Check: client-tests
src/main/webapp/app/course/competencies/competency-management/competency-management.component.ts

[failure] 47-47:
Cannot find name 'faEdit'. Did you mean the instance member 'this.faEdit'?

🪛 GitHub Check: client-compilation
src/main/webapp/app/course/competencies/competency-management/competency-management.component.ts

[failure] 47-47:
Cannot find name 'faEdit'. Did you mean the instance member 'this.faEdit'?

🔇 Additional comments (2)
src/main/webapp/i18n/de/competency.json (2)

175-177: LGTM! New buttons added correctly.

The new buttons "Alles eines Kurses importieren", "Beziehungen bearbeiten", and "Hilfe" have been added correctly to the "manage" section. The translations are appropriate and consistent with the existing style.


Line range hint 1-424: Overall assessment: Changes look good!

The new translations added to this file are consistent with the existing style and correctly use the informal "du" form as required by the coding guidelines. The additions provide necessary support for the competency relations feature and are well-integrated into the existing structure. No major issues were found, and only a minor suggestion for improvement was made regarding the explanation of relation types.

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 (1)
src/main/webapp/app/course/competencies/competency-management/competency-management.component.ts (1)

124-132: Consider changing the access modifier to 'private'

The method openCourseCompetenciesRelationModal is declared as protected. Unless this method needs to be accessed by subclasses, consider marking it as private to encapsulate it within the component and maintain consistency in access modifiers.

Apply this diff to adjust the access modifier:

- protected openCourseCompetenciesRelationModal(): void {
+ private openCourseCompetenciesRelationModal(): void {
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between d2d0a0d and d564946.

📒 Files selected for processing (1)
  • src/main/webapp/app/course/competencies/competency-management/competency-management.component.ts (5 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
src/main/webapp/app/course/competencies/competency-management/competency-management.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 (1)
src/main/webapp/app/course/competencies/competency-management/competency-management.component.ts (1)

130-131: Verify the necessity of wrapping data with signal when passing to the modal

In lines 130-131, you are wrapping this.courseId and this.courseCompetencies with Angular signals before assigning them to the modal's component instance. Ensure that the modal component is designed to accept signals and that this approach is intentional. If the modal does not specifically require signals, consider passing the raw data directly to avoid unnecessary complexity.

Copy link
Contributor

@SimonEntholzer SimonEntholzer left a comment

Choose a reason for hiding this comment

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

Works on Testserver 2 after merge conflict

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.

Reapprove after merge

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.

Reapprove after merge conflicts 👍

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.

Tested locally, works after merge conflict

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
atlas Pull requests that affect the corresponding module client Pull requests that update TypeScript code. (Added Automatically!) ready to merge server Pull requests that update Java code. (Added Automatically!) tests
Projects
Archived in project
Status: Done
Development

Successfully merging this pull request may close these issues.

10 participants