Compare commits

..

3 Commits

Author SHA1 Message Date
renovate 333d50c56c chore(deps): update dev-dependencies
continuous-integration/drone/pr Build is failing Details
2023-12-25 10:25:46 +00:00
kolaente fae5b764dd
fix(notifications): unread indicator spacing
continuous-integration/drone/push Build is passing Details
2023-12-23 15:53:17 +01:00
kolaente 7f70471894
feat(reminders): show reminders in notifications bar
continuous-integration/drone/push Build is passing Details
2023-12-23 15:48:29 +01:00
4 changed files with 18 additions and 3 deletions

View File

@ -142,7 +142,7 @@
"@typescript-eslint/eslint-plugin": "6.15.0",
"@typescript-eslint/parser": "6.15.0",
"@vitejs/plugin-legacy": "5.2.0",
"@vitejs/plugin-vue": "4.5.2",
"@vitejs/plugin-vue": "4.6.0",
"@vue/eslint-config-typescript": "12.0.0",
"@vue/test-utils": "2.4.3",
"@vue/tsconfig": "0.5.1",

View File

@ -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
@ -221,7 +222,7 @@ async function markAllRead() {
height: .35rem;
background: var(--primary);
border-radius: 100%;
margin-left: .5rem;
margin: 0 .5rem;
&.read {
background: transparent;

View File

@ -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

View File

@ -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 ''