Task Comments (#66)
Better edit/remove buttons Spacing More loading Add loading Better dates formatting Add editing comments Move closing delete modal to finally Add delete comments Add keycode modifier Comment styling Comment form Add basic task comments functionality Co-authored-by: kolaente <k@knt.li> Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/66
This commit is contained in:
parent
683012f468
commit
57f78ee0d4
9 changed files with 261 additions and 1 deletions
22
src/models/taskComment.js
Normal file
22
src/models/taskComment.js
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import AbstractModel from './abstractModel'
|
||||
import UserModel from './user'
|
||||
|
||||
export default class TaskCommentModel extends AbstractModel {
|
||||
constructor(data) {
|
||||
super(data)
|
||||
this.author = new UserModel(this.author)
|
||||
this.created = new Date(this.created)
|
||||
this.updated = new Date(this.updated)
|
||||
}
|
||||
|
||||
defaults() {
|
||||
return {
|
||||
id: 0,
|
||||
task_id: 0,
|
||||
comment: '',
|
||||
author: UserModel,
|
||||
created: null,
|
||||
update: null,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -19,6 +19,7 @@ export default class UserModel extends AbstractModel {
|
|||
}
|
||||
|
||||
getAvatarUrl(size = 50) {
|
||||
return `https://www.gravatar.com/avatar/${this.avatar}?s=${size}&d=mp`
|
||||
const avatarUrl = this.avatar !== '' ? this.avatar : this.avatarUrl
|
||||
return `https://www.gravatar.com/avatar/${avatarUrl}?s=${size}&d=mp`
|
||||
}
|
||||
}
|
||||
Reference in a new issue