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

Lectures: Hide slide pages until a date #9868

Open
wants to merge 28 commits into
base: feature/lectures/hide-pdf-pages
Choose a base branch
from

Conversation

eceeeren
Copy link
Contributor

@eceeeren eceeeren commented Nov 26, 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 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

The feature to hide slide pages (#9667) has been implemented, allowing instructors to hide pages indefinitely. However, a new feature is needed to enable instructors to hide specific pages with more flexibility to enhance functionality. This feature should provide the following options:

1. Hide Indefinitely: Maintain the current functionality to hide pages permanently until manually unhidden.
2. Hide Until a Specific Date: Allow instructors to set a manual date and time for the pages to be automatically unhidden.
3. Hide Until an Exercise's Due Date: Link the hidden pages to an exercise's due date, ensuring they are unhidden when it is due.

Additionally, a scheduled job should be implemented to automatically unhide pages once the specified conditions are met. This enhancement will improve usability and provide greater control for instructors.

Description

To enable the functionality of hiding pages until a specific date, the following changes have been implemented:

1. PDF Preview Date Box Component: A new component named PDF Preview Date Box has been created.
Date Box Accessibility: The Date Box becomes accessible by clicking the "Hide" button when hovering over a page.
2. Hide Options: The Date Box allows instructors to configure hiding options for the selected page. It provides three choices:

  • Hide the page indefinitely.
  • Hide the page until a specific date and time.
  • Hide the page until the selected exercise's due date.

3. Configuration View: Once the hiding configuration is saved, the current settings can be viewed by clicking the "View" button.
4. Show Page Popover: In the "Show Page" popover, the selected hiding date is displayed, along with an option to unhide the page.
5. Database Integration: The selected configurations are stored in the Slide table for persistence.
6. Scheduled Job: A scheduled job runs every minute, checking the Slide repository to automatically unhide slides that have reached their specified date.

Steps for Testing

Prerequisites:

  • 1 Instructor
  • 1 Student
  1. Log in to Artemis
  2. Navigate to Course Administration
  3. Go to 'Lecture Units'
  4. Create one Lecture Unit with a File
  5. Click "View" button
  6. Hover over one of the pages and click "Hide" button
  7. Confirm that you can see a popover with different options
  8. Click "Hide forever" and confirm that other options are disabled
  9. Uncheck "Hide forever", click "Select Date" and confirm that you can choose a date and time in the calendar
  10. Click "Select Exercise" and confirm that you see "No exercises available" text when there are no exercises with due date defined
  11. Click "Cancel" and confirm that popover is closed with no side effect
  12. Select one of the dates and click "Submit"
  13. Confirm that the page is hidden and you can see "Show" button instead
  14. Click "Show" button and confirm you can see "Show Page" popover
  15. Click "Cancel" to test the button and then click "Show" to show the page again
  16. Repeat from steps 5-15 with dark mode enabled, language is German and when some exercises are added to the course
  17. Hide one of the page to a time in the future and one for a short time (e.g. 1 or 2 minutes)
  18. Observe that the page hidden for a short time is visible after the specified time has passed
  19. Test that "Download" button shows the student version and "Original Version" shows the version that pages are not hidden
  20. Log in as a student and go to lecture's Communication part
  21. Verify that you can not reference hidden slides in the forum, only the visible slides

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

Performance Review

  • I (as a reviewer) confirm that the client changes (in particular related to REST calls and UI responsiveness) are implemented with a very good performance even for very large courses with more than 2000 students.
  • I (as a reviewer) confirm that the server changes (in particular related to database calls) are implemented with a very good performance even for very large courses with more than 2000 students.

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Test Coverage

Class/File Line Coverage Confirmation (assert/expect)
pdf-preview.component.ts 94%
pdf-preview-thumbnail-grid.component.ts 92%
pdf-preview-date-box.component.ts 100%

Screenshots

1. Date Box component with different options selected

Screenshot 2025-01-01 at 23 44 05 Screenshot 2025-01-01 at 23 43 51 Screenshot 2025-01-01 at 23 44 16 Screenshot 2025-01-01 at 23 44 32

2. Show Page popover with different options selected

Screenshot 2025-01-01 at 23 44 49 Screenshot 2025-01-01 at 23 45 05

@eceeeren eceeeren self-assigned this Nov 26, 2024
@github-actions github-actions bot added the client Pull requests that update TypeScript code. (Added Automatically!) label Nov 26, 2024
@eceeeren eceeeren force-pushed the feature/lectures/hide-pdf-pages branch from d3b1d1d to 0d228ea Compare November 26, 2024 09:37
Copy link

github-actions bot commented Dec 3, 2024

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 Dec 3, 2024
@eceeeren eceeeren removed the stale label Dec 11, 2024
@eceeeren eceeeren force-pushed the feature/lectures/hide-pdf-pages branch from 039e239 to 71f7466 Compare December 18, 2024 13:22
@github-actions github-actions bot added server Pull requests that update Java code. (Added Automatically!) database Pull requests that update the database. (Added Automatically!). Require a CRITICAL deployment. lecture Pull requests that affect the corresponding module labels Dec 29, 2024
@github-actions github-actions bot removed server Pull requests that update Java code. (Added Automatically!) database Pull requests that update the database. (Added Automatically!). Require a CRITICAL deployment. lecture Pull requests that affect the corresponding module labels Dec 29, 2024
@github-actions github-actions bot added server Pull requests that update Java code. (Added Automatically!) core Pull requests that affect the corresponding module labels Dec 29, 2024
@github-actions github-actions bot added the lecture Pull requests that affect the corresponding module label Jan 1, 2025
@eceeeren eceeeren marked this pull request as ready for review January 1, 2025 21:06
@eceeeren eceeeren requested a review from a team as a code owner January 1, 2025 21:06
@github-actions github-actions bot added the tests label Jan 1, 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!) core Pull requests that affect the corresponding module lecture Pull requests that affect the corresponding module ready for review server Pull requests that update Java code. (Added Automatically!) tests
Projects
Status: Work In Progress
Development

Successfully merging this pull request may close these issues.

1 participant