-
Notifications
You must be signed in to change notification settings - Fork 52
Feature/todo list #285
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
Feature/todo list #285
Conversation
… and add some functions
Codecov Report
@@ Coverage Diff @@
## develop #285 +/- ##
===========================================
+ Coverage 94.54% 94.57% +0.03%
===========================================
Files 85 87 +2
Lines 3997 4076 +79
===========================================
+ Hits 3779 3855 +76
- Misses 218 221 +3
Continue to review full report at Codecov.
|
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.
That's a good start! I have added few insights :)
app/internal/todo_list.py
Outdated
return task | ||
|
||
|
||
def sort_by_time(tasks: List[Task]) -> List[Task]: |
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.
Prefer sorting in the database, it's probably faster
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.
But the most logical thing to do is to sort your daily task by the time they happen
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.
You're right - I meant to order them when you querying the database using sort by
… and fixed styles
…ed edit task test and reformatted
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.
Looks great :) Fix the minor issues and we're ready to go
app/routers/dayview.py
Outdated
tasks = (session.query(Task) | ||
.filter(Task.owner_id == user.user_id) | ||
.filter(Task.date == day.date()) | ||
.order_by(Task.time) | ||
) |
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.
Please use precommit hooks to reformat
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.
fixed
app/routers/todo_list.py
Outdated
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, | ||
) | ||
return RedirectResponse( | ||
url=f"/day/{date_str}", |
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.
Use url_for
on all those places
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.
fixed
app/static/js/todo_list_modals.js
Outdated
|
||
function openEditModal(event){ | ||
const modal = document.getElementById('edit-modal'); | ||
console.log(event); |
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.
Remove console.log parts
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.
fixed
data-bs-dismiss="modal" | ||
aria-label="Close"></button> | ||
</div> | ||
<form action="/task/edit" method="post"> |
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.
Use url_for
wherever relevant
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.
fixed
tests/test_todo_list.py
Outdated
|
||
def test_if_task_deleted(home_test_client, task1: Task, session): | ||
response = home_test_client.post( | ||
"/task/delete", |
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.
url_for
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.
fixed
app/static/js/todo_list_modals.js
Outdated
//function openEditModal(taskId, taskTime, taskTitle, taskDescription, taskImportant){ | ||
// $('#list-modal').modal('toggle'); | ||
// $('#edit-task-id').val(taskId); | ||
// $('#customer-time2').val(taskTime); | ||
// $('#customer-title2').val(taskTitle); | ||
// $('#customer-descrip2').val(taskDescription); | ||
// $('#is-important2').prop('checked', taskImportant); | ||
// $('#edit-modal').modal('toggle'); | ||
//} |
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.
Remove commented code
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.
fixed
I created a tasks list for every day in
dayview
by clicking on the buttoncreate task
you can add task to the daily tasks list.by clicking on the button
todo list
you can see all your daily tasks sorted by time and marked by important or not.after you finish a task you can mark the task
Done
.