Skip to content

Development: Use signals in title channel name component #10979

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

Open
wants to merge 67 commits into
base: develop
Choose a base branch
from

Conversation

florian-glombik
Copy link
Contributor

@florian-glombik florian-glombik commented Jun 4, 2025

Checklist

General

Client

  • Important: I implemented the changes with a very good performance, prevented too many UI re-renderings
  • 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 documented the TypeScript code using JSDoc style.
  • I added multiple screenshots/screencasts of my UI changes.

Motivation and Context

We want to exploit the language features that Angular offers. In most cases, signals offer a more intuitive and more performant solution than raw RxJS subscriptions.

In the long run, we can simplify the status bar updates and rely on computed signals instead of registering effects and defining update methods, which is a much cleaner and easier to maintain approach. Exploiting signals also yields better performance and less UI updates.

This PR is a step in that direction.

Description

  • Removes the deprecated attributes formValid and formValidChanges from title-channel-name.component.ts
  • Use signals in components where title-channel-name.component.ts is used
  • Make injections readonly
  • Reduce code duplication by introducing shared method for removing hypens in title-channel-name.component.ts
  • Made constants protected readonly
  • Adjusted existing tests to work with signals, added some tests for coverage
  • The signal migration lowered the coverage threshold, but as the components are well tested and bumping the coverage up in this PR to the previous state would be a huge effort, I decided to add a dedicated PR to increase the coverage in unrelated components Development: Improve client test coverage #11016

Steps for Testing

Test this as instructor

  1. Verify the status bar updates properly when changing the title when creating/editing TextExercises
  2. Verify the status bar updates properly when changing the title when creating/editing ModelingExercises
  3. Verify the status bar updates properly when changing the title when creating/editing ProgrammingExercises
  4. Verify the status bar updates properly when changing the title when creating/editing FileUploadExercises
  5. Verify the status bar updates properly when changing the title when creating/editing Lectures

The behaviour should not have changed in comparison to develop when editing the title of one of the listed entities.

Testserver States

You can manage test servers using Helios. Check environment statuses in the environment list. To deploy to a test server, go to the CI/CD page, find your PR or branch, and trigger the deployment.

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)
doughnut-chart.component.ts 95.12%
file-upload-exercise-update.component.ts 91.52%
lecture-update.component.ts 91.03%
modeling-exercise-update.component.ts 92.36%
title-channel-name.component.ts 100%
text-exercise-update.component.ts 96.94%

Screenshots

Apperance should not have changed, see this example:

titleChannelNameComponentSignalsMigration

Summary by CodeRabbit

  • New Features

    • Improved form validation experience for exercise and lecture update screens by making validity checks reactive and automatic.
    • Enhanced title and channel name handling with more robust formatting and real-time updates.
  • Refactor

    • Switched to a more reactive approach for child component communication and form validation across multiple exercise and update components.
    • Updated component APIs to use function-based and signal-based access for properties and methods.
    • Improved encapsulation and immutability of icons and injected services.
    • Simplified subscription handling and replaced manual subscriptions with reactive effects.
    • Refined component input handling using reactive models and signals.
  • Bug Fixes

    • Ensured that empty or undefined titles and channel names are handled gracefully, preventing potential issues during updates.
  • Style

    • Updated templates to use function calls for bindings, improving consistency and reliability.
  • Tests

    • Refactored and enhanced test suites to align with new reactive patterns and component APIs.
    • Improved test setup completeness and mocking for dependent services and components.
  • Chores

    • Adjusted code coverage thresholds to reflect recent changes.

@github-project-automation github-project-automation bot moved this to Work In Progress in Artemis Development Jun 4, 2025
@github-actions github-actions bot added client Pull requests that update TypeScript code. (Added Automatically!) exercise Pull requests that affect the corresponding module fileupload Pull requests that affect the corresponding module lecture Pull requests that affect the corresponding module modeling Pull requests that affect the corresponding module programming Pull requests that affect the corresponding module text Pull requests that affect the corresponding module labels Jun 4, 2025
Copy link

github-actions bot commented Jun 4, 2025

End-to-End (E2E) Test Results Summary

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
End-to-End (E2E) Test Report201 ran197 passed3 skipped1 failed59m 22s 829ms
TestResultTime ⏱
End-to-End (E2E) Test Report
e2e/exercise/programming/ProgrammingExerciseStaticCodeAnalysis.spec.ts
ts.Static code analysis tests › Configures SCA grading and makes a successful submission with SCA errors❌ failure2m 16s 288ms

coderabbitai[bot]
coderabbitai bot previously approved these changes Jun 13, 2025
Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ✅Skipped ⚠️FailedTime ⏱
End-to-End (E2E) Test Report201 ran198 passed3 skipped0 failed54m 53s 361ms
TestResultTime ⏱
No test annotations available

Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
End-to-End (E2E) Test Report201 ran197 passed3 skipped1 failed1h 1m 30s 415ms
TestResultTime ⏱
End-to-End (E2E) Test Report
e2e/exercise/programming/ProgrammingExerciseStaticCodeAnalysis.spec.ts
ts.Static code analysis tests › Configures SCA grading and makes a successful submission with SCA errors❌ failure2m 16s 292ms

ahmetsenturk
ahmetsenturk previously approved these changes Jun 13, 2025
Copy link
Contributor

@ahmetsenturk ahmetsenturk 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 👍

…annel-name-component

# Conflicts:
#	jest.config.js
@github-actions github-actions bot added tests server Pull requests that update Java code. (Added Automatically!) core Pull requests that affect the corresponding module labels Jun 14, 2025
coderabbitai[bot]
coderabbitai bot previously approved these changes Jun 14, 2025
Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
End-to-End (E2E) Test Report201 ran197 passed3 skipped1 failed56m 4s 844ms
TestResultTime ⏱
End-to-End (E2E) Test Report
e2e/exercise/programming/ProgrammingExerciseStaticCodeAnalysis.spec.ts
ts.Static code analysis tests › Configures SCA grading and makes a successful submission with SCA errors❌ failure2m 12s 866ms

coderabbitai[bot]
coderabbitai bot previously approved these changes Jun 14, 2025
Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
End-to-End (E2E) Test Report201 ran197 passed3 skipped1 failed59m 16s 291ms
TestResultTime ⏱
End-to-End (E2E) Test Report
e2e/exercise/programming/ProgrammingExerciseStaticCodeAnalysis.spec.ts
ts.Static code analysis tests › Configures SCA grading and makes a successful submission with SCA errors❌ failure2m 16s 721ms

@helios-aet helios-aet bot temporarily deployed to artemis-test4.artemis.cit.tum.de June 14, 2025 19:07 Inactive
chuuuun
chuuuun previously approved these changes Jun 14, 2025
Copy link

@chuuuun chuuuun 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, user 17. status bars updates properly in mentioned domains.

@helios-aet helios-aet bot temporarily deployed to artemis-test5.artemis.cit.tum.de June 14, 2025 19:20 Inactive
Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
End-to-End (E2E) Test Report201 ran197 passed3 skipped1 failed52m 49s 38ms
TestResultTime ⏱
End-to-End (E2E) Test Report
e2e/exercise/quiz-exercise/QuizExerciseParticipation.spec.ts
ts.Quiz Exercise Participation › DnD Quiz participation › Student can participate in DnD Quiz❌ failure2m 3s 472ms

@github-actions github-actions bot removed tests server Pull requests that update Java code. (Added Automatically!) core Pull requests that affect the corresponding module labels Jun 15, 2025
Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ✅SkippedFailedTime ⏱
End-to-End (E2E) Test Report1 ran1 passed0 skipped0 failed1s 834ms
TestResultTime ⏱
No test annotations available

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!) exercise Pull requests that affect the corresponding module fileupload Pull requests that affect the corresponding module iris Pull requests that affect the corresponding module lecture Pull requests that affect the corresponding module modeling Pull requests that affect the corresponding module programming Pull requests that affect the corresponding module ready for review text Pull requests that affect the corresponding module
Projects
Status: Ready For Review
Development

Successfully merging this pull request may close these issues.

4 participants