For this task you will be working on an app to track working hours called "Time to Leave". "Time to Leave" is a web-application written in JavaScript running in Electron, and allows to enter working and break times to show a notification, when the daily amount of work hours is reached.
Alexander: Depending on if I use a VM or not, the following steps might be skipped
Open Visual Studio Code and clone the following repository: URL
Install the project's dependencies using the command npm install
Start the app using the command npm run dev
Feature Request
Users have requested to export their monthly overview of logged times and overall overtime as a PDF. The user interface should include a button to trigger the PDF export of the currently shown month, as indicated in red in the picture. Please read the following text carefully to implement this task.
Task Description
To implement this feature, two changes are necessary:
Change 1: Add print button to the UI
ToDo: Define print button insiderenderer/classes/FlexibleMonthCalendar.js similar to theswitch-view button
Note: Please use the image ../assets/print.svg for the print button.
Test: Check if the printer button appears as shown in the above picture
Change 2: Implement PDF export functionality
ToDo: Implement printing the current window to PDF in js/main-window.js using the electron framework printToPDF function.
Note: Please hard-code the location to be used for storing the PDF, e.g. const pdfPath = path.join(os.homedir(), 'Desktop', 'temp.pdf');
Alexander: This printToPDF function and how to use it is the information retrieval part for having a website in the context
Test: Check if the PDF is stored on the defined path when the print button is clicked. The PDF should look similar to this:
While coding
👉 While working, search online for needed information. It is quicker than navigating through the entire codebase.
👉 Save the file to see to see the effects of your changes - no need to restart the app.
Project
For this task you will be working on an app to track working hours called "Time to Leave". "Time to Leave" is a web-application written in JavaScript running in Electron, and allows to enter working and break times to show a notification, when the daily amount of work hours is reached.
Setup
npm install
npm run dev
Feature Request
Users have requested to export their monthly overview of logged times and overall overtime as a PDF. The user interface should include a button to trigger the PDF export of the currently shown month, as indicated in red in the picture. Please read the following text carefully to implement this task.
Task Description
To implement this feature, two changes are necessary:
Change 1: Add print button to the UI
renderer/classes/FlexibleMonthCalendar.js
similar to theswitch-view
button../assets/print.svg
for the print button.Change 2: Implement PDF export functionality
js/main-window.js
using the electron frameworkprintToPDF
function.const pdfPath = path.join(os.homedir(), 'Desktop', 'temp.pdf');
While coding
👉 While working, search online for needed information. It is quicker than navigating through the entire codebase. 👉 Save the file to see to see the effects of your changes - no need to restart the app.