-
Notifications
You must be signed in to change notification settings - Fork 297
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
: Add PDF preview for instructors
#8987
Conversation
|
f19b1b4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reapprove after merge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reapprove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reapprove
Lectures
: Create Attachment PDF Preview for the Instructor Interface
Lectures
: Create Attachment PDF Preview for the Instructor InterfaceLectures
: Add PDF preview for instructors
More changes will be added in a follow-up |
Checklist
General
Server
Client
authorities
to all new routes and checked the course groups for displaying navigation elements (links, buttons).Motivation and Context
Currently, instructors must download attached PDF files and open them with external applications to view them, leading to a waste of time and resources. This process interrupts the user experience and creates inconsistency in file browsing due to varying external applications. This pull request aims to resolve these issues by introducing a specialized PDF previewer within the Artemis application. This previewer will allow users to view PDFs directly in the browser, enhancing the user experience. Additionally, the PDF previewer will serve as a foundation for future PDF editing capabilities within the browser.
Implements #8768
Description
n this pull request, several enhancements are made to improve PDF file handling within the Artemis application.
Firstly, a new component called PDFPreviewComponent is created. This component features a thumbnail grid, contained within an implemented container. On the server side, two API methods are added to the FileResource class to fetch files for Attachment and AttachmentUnit objects. Correspondingly, two service methods are created in AttachmentService and AttachmentUnitService to handle these file fetching requests.
Upon initialization, the component subscribes to file changes. Depending on the object type (Attachment or AttachmentUnit), it fetches the files and uses the PDF.js library to separate PDF files into individual pages. These pages are then rendered as thumbnails in a grid layout, providing a clear overview of the document.
Each grid item includes an overlay displaying the page number and is made clickable. When a user clicks on a thumbnail, the respective page is rendered on a larger canvas for an improved previewing experience. Users can navigate between pages using arrow buttons on the canvas or keyboard arrows. Additionally, the enlarged canvas displays page numbers and includes an exit button or background click option for users to exit the enlarged view.
Steps for Testing
Prerequisites:
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
Code Review
Manual Tests
Test Coverage
Screenshots
1. View Button on Attachments
2. View Button on Attachment Units
3. Thumbnail Grid
4. Page Numbers on Hover
5. Enlarged Canvas
6. Thumbnail Grid Dark Mode
Summary by CodeRabbit
Summary by CodeRabbit
New Features
Bug Fixes
Chores