new filter: unassigned cards

Signed-off-by: Jakob Röhrl <jakob.roehrl@web.de>
This commit is contained in:
Jakob Röhrl
2020-05-19 09:42:17 +02:00
parent 6ef8b126e7
commit de0145c3f5
2 changed files with 27 additions and 2 deletions

View File

@@ -32,9 +32,10 @@ export default {
getters: {
cardsByStack: (state, getters, rootState) => (id) => {
return state.cards.filter((card) => {
const { tags, users, due } = rootState.filter
const { tags, users, due, unassigned } = rootState.filter
let allTagsMatch = true
let allUsersMatch = true
let allUnassigned = true
if (tags.length > 0) {
tags.forEach((tag) => {
@@ -58,6 +59,16 @@ export default {
}
}
if (unassigned) {
if (card.assignedUsers.length > 0) {
allUnassigned = false
}
if (!allUnassigned) {
return false
}
}
if (due !== '') {
const datediffHour = ((new Date(card.duedate) - new Date()) / 3600 / 1000)
switch (due) {