diff --git a/src/components/notifications/notifications.vue b/src/components/notifications/notifications.vue index c200711a7..57a1991c7 100644 --- a/src/components/notifications/notifications.vue +++ b/src/components/notifications/notifications.vue @@ -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 diff --git a/src/modelTypes/INotification.ts b/src/modelTypes/INotification.ts index 39a35389b..1a97968d3 100644 --- a/src/modelTypes/INotification.ts +++ b/src/modelTypes/INotification.ts @@ -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 diff --git a/src/models/notification.ts b/src/models/notification.ts index e5843b787..e8a1960b3 100644 --- a/src/models/notification.ts +++ b/src/models/notification.ts @@ -56,6 +56,12 @@ export default class NotificationModel extends AbstractModel 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 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 ''