1
0

Pagingation for tasks in kanban buckets (#419)

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/419
Co-authored-by: konrad <konrad@kola-entertainments.de>
Co-committed-by: konrad <konrad@kola-entertainments.de>
This commit is contained in:
konrad
2021-03-10 10:59:29 +00:00
parent 1f33477f57
commit f7d8095b5a
3 changed files with 110 additions and 8 deletions

View File

@ -352,7 +352,26 @@ export default {
console.debug(`Loading buckets, loadedListId = ${this.loadedListId}, $route.params =`, this.$route.params)
this.filtersChanged = false
const minScrollHeightPercent = 0.25
this.$store.dispatch('kanban/loadBucketsForList', {listId: this.$route.params.listId, params: this.params})
.then(bs => {
bs.forEach(b => {
const e = this.$refs[`tasks-container${b.id}`][0]
e.onscroll = () => {
if (e.scrollTopMax <= e.scrollTop + e.scrollTop * minScrollHeightPercent) {
this.$store.dispatch('kanban/loadNextTasksForBucket', {
listId: this.$route.params.listId,
params: this.params,
bucketId: b.id,
})
.catch(e => {
this.error(e, this)
})
}
}
})
})
.catch(e => {
this.error(e, this)
})
@ -423,7 +442,7 @@ export default {
task.done = !task.done
this.$store.dispatch('tasks/update', task)
.then(() => {
if(task.done) {
if (task.done) {
playPop()
}
})
@ -518,7 +537,7 @@ export default {
listId: this.$route.params.listId,
})
this.$store.dispatch('kanban/deleteBucket', bucket)
this.$store.dispatch('kanban/deleteBucket', {bucket: bucket, params: this.params})
.then(() => {
this.success({message: 'The bucket has been deleted successfully.'}, this)
})