Merge pull request #1926 from nextcloud/enh/unassignedFilter
This commit is contained in:
@@ -76,6 +76,17 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h3>{{ t('deck', 'Filter by assigned user') }}</h3>
|
<h3>{{ t('deck', 'Filter by assigned user') }}</h3>
|
||||||
|
<div class="filter--item">
|
||||||
|
<input
|
||||||
|
id="unassigned"
|
||||||
|
v-model="filter.unassigned"
|
||||||
|
type="checkbox"
|
||||||
|
class="checkbox"
|
||||||
|
value="unassigned"
|
||||||
|
@change="setFilter"
|
||||||
|
@click="beforeSetFilter">
|
||||||
|
<label for="unassigned">{{ t('deck', 'Unassigned') }}</label>
|
||||||
|
</div>
|
||||||
<div v-for="user in board.users" :key="user.uid" class="filter--item">
|
<div v-for="user in board.users" :key="user.uid" class="filter--item">
|
||||||
<input
|
<input
|
||||||
:id="user.uid"
|
:id="user.uid"
|
||||||
@@ -202,7 +213,7 @@ export default {
|
|||||||
stack: '',
|
stack: '',
|
||||||
showArchived: false,
|
showArchived: false,
|
||||||
isAddStackVisible: false,
|
isAddStackVisible: false,
|
||||||
filter: { tags: [], users: [], due: '' },
|
filter: { tags: [], users: [], due: '', unassigned: false },
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -246,8 +257,14 @@ export default {
|
|||||||
this.filter.due = ''
|
this.filter.due = ''
|
||||||
this.$store.dispatch('setFilter', { ...this.filter })
|
this.$store.dispatch('setFilter', { ...this.filter })
|
||||||
}
|
}
|
||||||
|
if (e.target.value === 'unassigned') {
|
||||||
|
this.filter.users = []
|
||||||
|
}
|
||||||
},
|
},
|
||||||
setFilter() {
|
setFilter() {
|
||||||
|
if (this.filter.users.length > 0) {
|
||||||
|
this.filter.unassigned = false
|
||||||
|
}
|
||||||
this.$nextTick(() => this.$store.dispatch('setFilter', { ...this.filter }))
|
this.$nextTick(() => this.$store.dispatch('setFilter', { ...this.filter }))
|
||||||
},
|
},
|
||||||
toggleNav() {
|
toggleNav() {
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ export default {
|
|||||||
getters: {
|
getters: {
|
||||||
cardsByStack: (state, getters, rootState) => (id) => {
|
cardsByStack: (state, getters, rootState) => (id) => {
|
||||||
return state.cards.filter((card) => {
|
return state.cards.filter((card) => {
|
||||||
const { tags, users, due } = rootState.filter
|
const { tags, users, due, unassigned } = rootState.filter
|
||||||
let allTagsMatch = true
|
let allTagsMatch = true
|
||||||
let allUsersMatch = true
|
let allUsersMatch = true
|
||||||
|
|
||||||
@@ -58,6 +58,10 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (unassigned && card.assignedUsers.length > 0) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
if (due !== '') {
|
if (due !== '') {
|
||||||
const datediffHour = ((new Date(card.duedate) - new Date()) / 3600 / 1000)
|
const datediffHour = ((new Date(card.duedate) - new Date()) / 3600 / 1000)
|
||||||
switch (due) {
|
switch (due) {
|
||||||
|
|||||||
Reference in New Issue
Block a user