Skip to content

Commit

Permalink
Show comments on approved todos as well (#472)
Browse files Browse the repository at this point in the history
* show positive feedback comments on todolists

* Marked only todos with disapproved comments as red

* Fixed the bug where todos will show in red if todo qa was created with approved as null
  • Loading branch information
adbharadwaj committed Jul 27, 2018
1 parent c779b64 commit 2983fa5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion orchestra/static/dist/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -61812,7 +61812,7 @@ function todoChecklist() {
};

scope.isInDanger = function (todo) {
return !todo.completed && _momentTimezone2.default.isBeforeNowBy(todo.due_datetime, 1, 'days') || scope.todoQas[todo.description];
return !todo.completed && _momentTimezone2.default.isBeforeNowBy(todo.due_datetime, 1, 'days') || scope.todoQas[todo.description] && scope.todoQas[todo.description].approved === false;
};

scope.isSkipped = function (todo) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default function todoChecklist () {
}

scope.isInDanger = (todo) => {
return (!todo.completed && moment.isBeforeNowBy(todo.due_datetime, 1, 'days')) || scope.todoQas[todo.description]
return (!todo.completed && moment.isBeforeNowBy(todo.due_datetime, 1, 'days')) || (scope.todoQas[todo.description] && scope.todoQas[todo.description].approved === false)
}

scope.isSkipped = (todo) => {
Expand Down
2 changes: 1 addition & 1 deletion orchestra/todos/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def worker_task_recent_todo_qas(request):
task_todo_qas = TodoQA.objects.filter(todo__task=task_id)

if task_todo_qas.exists():
todo_qas = task_todo_qas.filter(approved=False)
todo_qas = task_todo_qas
else:
task = Task.objects.get(pk=task_id)
most_recent_worker_task_todo_qa = TodoQA.objects.filter(
Expand Down

0 comments on commit 2983fa5

Please sign in to comment.