kolaente
ad27f588a2
All checks were successful
continuous-integration/drone/push Build is passing
This fixes an ux issue where the total count would show a wrong number of total tasks because that was the number of tasks which were loaded at the time. In combination with bucket limits, this caused error messages when the user would attempt to drag tasks into a bucket which appeared not full but was.
33 lines
783 B
TypeScript
33 lines
783 B
TypeScript
import AbstractModel from './abstractModel'
|
|
import UserModel from './user'
|
|
import TaskModel from './task'
|
|
|
|
import type {IBucket} from '@/modelTypes/IBucket'
|
|
import type {ITask} from '@/modelTypes/ITask'
|
|
import type {IUser} from '@/modelTypes/IUser'
|
|
|
|
export default class BucketModel extends AbstractModel<IBucket> implements IBucket {
|
|
id = 0
|
|
title = ''
|
|
projectId = ''
|
|
limit = 0
|
|
tasks: ITask[] = []
|
|
isDoneBucket = false
|
|
position = 0
|
|
count = 0
|
|
|
|
createdBy: IUser = null
|
|
created: Date = null
|
|
updated: Date = null
|
|
|
|
constructor(data: Partial<IBucket>) {
|
|
super()
|
|
this.assignData(data)
|
|
|
|
this.tasks = this.tasks.map(t => new TaskModel(t))
|
|
|
|
this.createdBy = new UserModel(this.createdBy)
|
|
this.created = new Date(this.created)
|
|
this.updated = new Date(this.updated)
|
|
}
|
|
} |