feat(reminders): show reminders in notifications bar
This commit is contained in:
parent
e98e5a0d2f
commit
7f70471894
@ -124,6 +124,7 @@ function to(n, index) {
|
||||
switch (n.name) {
|
||||
case names.TASK_COMMENT:
|
||||
case names.TASK_ASSIGNED:
|
||||
case names.TASK_REMINDER:
|
||||
to.name = 'task.detail'
|
||||
to.params.id = n.notification.task.id
|
||||
break
|
||||
|
@ -9,6 +9,7 @@ export const NOTIFICATION_NAMES = {
|
||||
'TASK_COMMENT': 'task.comment',
|
||||
'TASK_ASSIGNED': 'task.assigned',
|
||||
'TASK_DELETED': 'task.deleted',
|
||||
'TASK_REMINDER': 'task.reminder',
|
||||
'PROJECT_CREATED': 'project.created',
|
||||
'TEAM_MEMBER_ADDED': 'team.member.added',
|
||||
} as const
|
||||
@ -35,6 +36,11 @@ interface NotificationCreated extends Notification {
|
||||
project: IProject
|
||||
}
|
||||
|
||||
interface NotificationTaskReminder extends Notification {
|
||||
task: ITask
|
||||
project: IProject
|
||||
}
|
||||
|
||||
interface NotificationMemberAdded extends Notification {
|
||||
member: IUser
|
||||
team: ITeam
|
||||
@ -43,7 +49,7 @@ interface NotificationMemberAdded extends Notification {
|
||||
export interface INotification extends IAbstract {
|
||||
id: number
|
||||
name: string
|
||||
notification: NotificationTask | NotificationAssigned | NotificationDeleted | NotificationCreated | NotificationMemberAdded
|
||||
notification: NotificationTask | NotificationAssigned | NotificationDeleted | NotificationCreated | NotificationMemberAdded | NotificationTaskReminder
|
||||
read: boolean
|
||||
readAt: Date | null
|
||||
|
||||
|
@ -56,6 +56,12 @@ export default class NotificationModel extends AbstractModel<INotification> impl
|
||||
team: new TeamModel(this.notification.team),
|
||||
}
|
||||
break
|
||||
case NOTIFICATION_NAMES.TASK_REMINDER:
|
||||
this.notification = {
|
||||
task: new TaskModel(this.notification.task),
|
||||
project: new ProjectModel(this.notification.project),
|
||||
}
|
||||
break
|
||||
}
|
||||
|
||||
this.created = new Date(this.created)
|
||||
@ -88,6 +94,8 @@ export default class NotificationModel extends AbstractModel<INotification> impl
|
||||
}
|
||||
|
||||
return `added ${who} to the ${this.notification.team.name} team`
|
||||
case NOTIFICATION_NAMES.TASK_REMINDER:
|
||||
return `Reminder for ${this.notification.task.getTextIdentifier()} ${this.notification.task.title} (${this.notification.project.title})`
|
||||
}
|
||||
|
||||
return ''
|
||||
|
Loading…
x
Reference in New Issue
Block a user