Skip to content

Development: Allow disabling lecture module in server and client #10652

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

Closed
wants to merge 40 commits into from

Conversation

ole-ve
Copy link
Contributor

@ole-ve ole-ve commented Apr 7, 2025

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 added authorities to all new routes and checked the course groups for displaying navigation elements (links, buttons).
  • 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

In particular for local development, we want to allow disabling certain modules like the lecture module in this PR.

Description

Make Spring components in the lecture-module be autowired based on the value of a custom property, instead of the generic PROFILE_CORE.
This also includes client changes to reflect this.

Disclaimer: Because this is mainly intended to be used for local development, there might be edge cases that cause issues.

Steps for Testing

Note: Needs local testing.

  1. Set artemis.lecture.enabled=false in your application-local.yml
  2. Open the course management overview. See that the lecture button is disabled (S1)
  3. Go to one course and ensure that the lecture button in the tab bar is disabled (S2)

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

Screenshots

S1: Management Course Card View
Screenshot 2025-04-03 at 15 20 19

S2: Management Tab Card View
Screenshot 2025-04-07 at 16 11 15

Summary by CodeRabbit

  • New Features
    • Added conditional activation for the lecture module, controllable via configuration.
    • Updated the user interface to wrap lecture-related tabs and links in a feature overlay, visible only when the lecture module is enabled.
    • Introduced a feature flag check to conditionally display the lectures sidebar item based on module activation.
  • Bug Fixes
    • Improved handling of slide unhide scheduling to safely handle cases when the lecture module is disabled.
  • Tests
    • Extended test coverage to verify proper activation and handling of the lecture module feature.

@github-project-automation github-project-automation bot moved this to Work In Progress in Artemis Development Apr 7, 2025
@github-actions github-actions bot added tests server Pull requests that update Java code. (Added Automatically!) client Pull requests that update TypeScript code. (Added Automatically!) config-change Pull requests that change the config in a way that they require a deployment via Ansible. atlas Pull requests that affect the corresponding module communication Pull requests that affect the corresponding module core Pull requests that affect the corresponding module exercise Pull requests that affect the corresponding module iris Pull requests that affect the corresponding module lecture Pull requests that affect the corresponding module lti Pull requests that affect the corresponding module plagiarism Pull requests that affect the corresponding module labels Apr 7, 2025
coderabbitai[bot]
coderabbitai bot previously approved these changes Apr 30, 2025
Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
End-to-End (E2E) Test Report201 ran197 passed3 skipped1 failed45m 26s 735ms
TestResultTime ⏱
End-to-End (E2E) Test Report
e2e/course/CourseMessages.spec.ts
ts.Course messages › Channel messages › Write/edit/delete message in channel › Student should be able to edit message in channel❌ failure2m 3s 173ms

Copy link

github-actions bot commented May 1, 2025

End-to-End (E2E) Test Results Summary

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
End-to-End (E2E) Test Report201 ran194 passed3 skipped4 failed50m 45s 797ms
TestResultTime ⏱
End-to-End (E2E) Test Report
e2e/course/CourseMessages.spec.ts
ts.Course messages › Channel messages › Write/edit/delete message in channel › Student should be able to edit message in channel❌ failure2m 3s 724ms
e2e/exercise/quiz-exercise/QuizExerciseManagement.spec.ts
ts.Quiz Exercise Management › Quiz Exercise Creation › Creates a Quiz with Drag and Drop❌ failure2m 2s 122ms
e2e/exercise/quiz-exercise/QuizExerciseParticipation.spec.ts
ts.Quiz Exercise Participation › DnD Quiz participation › Student can participate in DnD Quiz❌ failure2m 3s 118ms
e2e/exercise/programming/ProgrammingExerciseStaticCodeAnalysis.spec.ts
ts.Static code analysis tests › Configures SCA grading and makes a successful submission with SCA errors❌ failure1m 44s 901ms

Copy link

github-actions bot commented May 1, 2025

End-to-End (E2E) Test Results Summary

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
End-to-End (E2E) Test Report201 ran194 passed3 skipped4 failed54m 35s 641ms
TestResultTime ⏱
End-to-End (E2E) Test Report
e2e/course/CourseMessages.spec.ts
ts.Course messages › Channel messages › Write/edit/delete message in channel › Student should be able to edit message in channel❌ failure2m 4s 41ms
e2e/exercise/quiz-exercise/QuizExerciseManagement.spec.ts
ts.Quiz Exercise Management › Quiz Exercise Creation › Creates a Quiz with Drag and Drop❌ failure2m 1s 913ms
e2e/exercise/quiz-exercise/QuizExerciseParticipation.spec.ts
ts.Quiz Exercise Participation › DnD Quiz participation › Student can participate in DnD Quiz❌ failure2m 2s 14ms
e2e/exercise/programming/ProgrammingExerciseStaticCodeAnalysis.spec.ts
ts.Static code analysis tests › Configures SCA grading and makes a successful submission with SCA errors❌ failure1m 45s 994ms

Copy link
Contributor

@tobias-lippert tobias-lippert left a comment

Choose a reason for hiding this comment

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

see my inline comments


/**
* Condition to check if the Lecture module is enabled.
* Based on this condition, Spring components concerning atlas functionality can be enabled or disabled.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* Based on this condition, Spring components concerning atlas functionality can be enabled or disabled.
* Based on this condition, Spring components concerning lecture functionality can be enabled or disabled.

<span class="d-none d-xl-inline" jhiTranslate="entity.action.lecture"></span>
</a>
<jhi-feature-overlay [enabled]="lectureEnabled">
<a
Copy link
Contributor

Choose a reason for hiding this comment

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

i think this is inconsistent now. We hide it in the sidebar, but it's greyed out on the course card.

@@ -13,10 +13,12 @@
<span class="tab-link-text" jhiTranslate="artemisApp.courseOverview.menu.exercises"></span>
</a>
@if (course.isAtLeastEditor) {
<a class="tab-link" [routerLink]="['/course-management', course.id, 'lectures']" id="lectures" routerLinkActive="active">
<fa-icon [icon]="faFilePdf" />
<span class="tab-link-text" jhiTranslate="artemisApp.courseOverview.menu.lectures"></span>
Copy link
Contributor

Choose a reason for hiding this comment

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

this component is unused afaik

Copy link

github-actions bot commented May 6, 2025

End-to-End (E2E) Test Results Summary

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
End-to-End (E2E) Test Report201 ran194 passed3 skipped4 failed54m 27s 255ms
TestResultTime ⏱
End-to-End (E2E) Test Report
e2e/course/CourseMessages.spec.ts
ts.Course messages › Channel messages › Write/edit/delete message in channel › Student should be able to edit message in channel❌ failure2m 2s 850ms
e2e/exercise/quiz-exercise/QuizExerciseManagement.spec.ts
ts.Quiz Exercise Management › Quiz Exercise Creation › Creates a Quiz with Drag and Drop❌ failure2m 2s 58ms
e2e/exercise/quiz-exercise/QuizExerciseParticipation.spec.ts
ts.Quiz Exercise Participation › DnD Quiz participation › Student can participate in DnD Quiz❌ failure2m 3s 420ms
e2e/exercise/programming/ProgrammingExerciseStaticCodeAnalysis.spec.ts
ts.Static code analysis tests › Configures SCA grading and makes a successful submission with SCA errors❌ failure1m 42s 956ms

Copy link
Contributor

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

@florian-glombik florian-glombik left a comment

Choose a reason for hiding this comment

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

The server does now start locally with artemis.lecture.enabled:false

  • Add Lecture should not be displayed (or enabled)
image
Request URL:
http://localhost:9000/api/lecture/courses/21/lectures?withLectureUnits=1
Request Method:
GET
Status Code:
Screen.Recording.2025-05-08.at.12.05.37.mov

Copy link

github-actions bot commented May 8, 2025

End-to-End (E2E) Test Results Summary

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
End-to-End (E2E) Test Report201 ran197 passed3 skipped1 failed55m 28s 81ms
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❌ failure1m 47s 580ms

Copy link

@HawKhiem HawKhiem 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, "Add lecture" button is still visible and enabled. Lectures tab is not visible as expected. After clicking on "Add lecture" it did prompt me to input some information for the lecture

Screenshot 2025-05-09 011206
Screenshot 2025-05-09 011219

Copy link

There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions.

@github-actions github-actions bot closed this May 31, 2025
@krusche krusche reopened this May 31, 2025
@github-project-automation github-project-automation bot moved this from Ready For Review to Work In Progress in Artemis Development May 31, 2025
@krusche
Copy link
Member

krusche commented May 31, 2025

@ole-ve please finish this PR asap

@github-actions github-actions bot removed the stale label Jun 1, 2025
Copy link

github-actions bot commented Jun 8, 2025

There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions.

@github-actions github-actions bot added the stale label Jun 8, 2025
@github-actions github-actions bot closed this Jun 27, 2025
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!) config-change Pull requests that change the config in a way that they require a deployment via Ansible. core Pull requests that affect the corresponding module lecture Pull requests that affect the corresponding module server Pull requests that update Java code. (Added Automatically!) stale tests
Projects
Status: Work In Progress
Development

Successfully merging this pull request may close these issues.

7 participants