Filter dailies by due/not due in group plan and challenge page (#10582)

* sort by isDue works but only on refresh

* update isDue for new tasks

* apply correct filter to challenge page
This commit is contained in:
Isabelle Lavandero
2018-08-17 05:58:43 -04:00
committed by Matteo Pagliazzi
parent b977d42402
commit cce9b33844
2 changed files with 8 additions and 5 deletions

View File

@@ -362,7 +362,7 @@ export default {
type: this.type,
filterType: this.activeFilter.label,
}) :
this.filterByCompleted(this.taskListOverride, this.activeFilter.label);
this.filterByLabel(this.taskListOverride, this.activeFilter.label);
let taggedList = this.filterByTagList(filteredTaskList, this.selectedTags);
let searchedList = this.filterBySearchText(taggedList, this.searchText);
@@ -598,10 +598,12 @@ export default {
}
});
},
filterByCompleted (taskList, filter) {
filterByLabel (taskList, filter) {
if (!taskList) return [];
return taskList.filter(task => {
if (filter === 'complete2') return task.completed;
if (filter === 'due') return task.isDue;
if (filter === 'notDue') return !task.isDue;
return !task.completed;
});
},