2023-11-29
Goal
To save the notes the user takes after completion in the Taskmaster App, then to implement a Celery cron job to schedule task resets.
Notes
Saving Notes in the Task App
First thing I did was correct the AJAX command to save notes in my task app. I noticed in pgadmin that my notes weren't actually saving after they were entered so I had to make some adjustments to my taskmaster.html
template and add an identifier for a task to get its notes. These notes are then received from the POST request and update the state of the Task
model to include the notes information. At first when I pushed these changes to Heroku I received a 500 Response Error, but this was corrected by manually applying the Database Migration via the following command:
heroku run python manage.py migrate
The reason that the database needed to be migrated was because we added timezone
information to each user in the Accounts App. Without that info, the database just doesn't work.
Either way I made a Test task and was able to pull the data with pgadmin to see that it actually saved the notes this time. Yay!
Resetting a task card
Before I added the automated scheduling job, I wanted to add a way for the user to easily reset tasks on their own. Maybe they want to do the task twice in one day or un-check in a task for whatever reason. I want to add a small icon at the top right of a reverse arrow that can be used to reset the task back to its starting state.
I created one SVG in code for the top left to be used as a selector for other features later down the line. I'm using Inkscape to generate other icons now, hopefully this process will be much faster later on down the line but for now it took me 15 minutes to learn how to draw a proper circle.
Results
- Fixed the notes section of the Taskmaster App
- Started working on UI / UX for resetting the state of a card manually
- Added a filed above the task title where the user can adjust their interactions with the task.
Next Time
- Complete Task card UI
- Implement the manual task card reset feature