feat: add bell notification system for task assignment

This commit is contained in:
Jordan Knott
2021-11-02 14:45:05 -05:00
parent 3afd860534
commit 799d7f3ad0
53 changed files with 3306 additions and 163 deletions

View File

@ -4,10 +4,60 @@ extend type Subscription {
extend type Query {
notifications: [Notified!]!
notified(input: NotifiedInput!): NotifiedResult!
hasUnreadNotifications: HasUnreadNotificationsResult!
}
extend type Mutation {
notificationToggleRead(input: NotificationToggleReadInput!): Notified!
}
type HasUnreadNotificationsResult {
unread: Boolean!
}
input NotificationToggleReadInput {
notifiedID: UUID!
}
input NotifiedInput {
limit: Int!
cursor: String
filter: NotificationFilter!
}
type PageInfo {
endCursor: String!
hasNextPage: Boolean!
}
type NotifiedResult {
totalCount: Int!
notified: [Notified!]!
pageInfo: PageInfo!
}
enum ActionType {
TASK_MEMBER_ADDED
TEAM_ADDED
TEAM_REMOVED
PROJECT_ADDED
PROJECT_REMOVED
PROJECT_ARCHIVED
DUE_DATE_ADDED
DUE_DATE_REMOVED
DUE_DATE_CHANGED
TASK_ASSIGNED
TASK_MOVED
TASK_ARCHIVED
TASK_ATTACHMENT_UPLOADED
COMMENT_MENTIONED
COMMENT_OTHER
}
enum NotificationFilter {
ALL
UNREAD
ASSIGNED
MENTIONED
}
type NotificationData {
@ -24,7 +74,7 @@ type NotificationCausedBy {
type Notification {
id: ID!
actionType: ActionType!
causedBy: NotificationCausedBy!
causedBy: NotificationCausedBy
data: [NotificationData!]!
createdAt: Time!
}

View File

@ -4,10 +4,60 @@ extend type Subscription {
extend type Query {
notifications: [Notified!]!
notified(input: NotifiedInput!): NotifiedResult!
hasUnreadNotifications: HasUnreadNotificationsResult!
}
extend type Mutation {
notificationToggleRead(input: NotificationToggleReadInput!): Notified!
}
type HasUnreadNotificationsResult {
unread: Boolean!
}
input NotificationToggleReadInput {
notifiedID: UUID!
}
input NotifiedInput {
limit: Int!
cursor: String
filter: NotificationFilter!
}
type PageInfo {
endCursor: String!
hasNextPage: Boolean!
}
type NotifiedResult {
totalCount: Int!
notified: [Notified!]!
pageInfo: PageInfo!
}
enum ActionType {
TASK_MEMBER_ADDED
TEAM_ADDED
TEAM_REMOVED
PROJECT_ADDED
PROJECT_REMOVED
PROJECT_ARCHIVED
DUE_DATE_ADDED
DUE_DATE_REMOVED
DUE_DATE_CHANGED
TASK_ASSIGNED
TASK_MOVED
TASK_ARCHIVED
TASK_ATTACHMENT_UPLOADED
COMMENT_MENTIONED
COMMENT_OTHER
}
enum NotificationFilter {
ALL
UNREAD
ASSIGNED
MENTIONED
}
type NotificationData {
@ -24,7 +74,7 @@ type NotificationCausedBy {
type Notification {
id: ID!
actionType: ActionType!
causedBy: NotificationCausedBy!
causedBy: NotificationCausedBy
data: [NotificationData!]!
createdAt: Time!
}

View File

@ -27,6 +27,7 @@ type Task {
name: String!
position: Float!
description: String
watched: Boolean!
dueDate: Time
hasTime: Boolean!
complete: Boolean!
@ -352,6 +353,8 @@ extend type Mutation {
Task! @hasRole(roles: [ADMIN, MEMBER], level: PROJECT, type: TASK)
updateTaskDueDate(input: UpdateTaskDueDate!):
Task! @hasRole(roles: [ADMIN, MEMBER], level: PROJECT, type: TASK)
toggleTaskWatch(input: ToggleTaskWatch!):
Task! @hasRole(roles: [ADMIN, MEMBER], level: PROJECT, type: TASK)
assignTask(input: AssignTaskInput):
Task! @hasRole(roles: [ADMIN, MEMBER], level: PROJECT, type: TASK)
@ -359,6 +362,10 @@ extend type Mutation {
Task! @hasRole(roles: [ADMIN, MEMBER], level: PROJECT, type: TASK)
}
input ToggleTaskWatch {
taskID: UUID!
}
input NewTask {
taskGroupID: UUID!
name: String!

View File

@ -27,6 +27,7 @@ type Task {
name: String!
position: Float!
description: String
watched: Boolean!
dueDate: Time
hasTime: Boolean!
complete: Boolean!

View File

@ -14,6 +14,8 @@ extend type Mutation {
Task! @hasRole(roles: [ADMIN, MEMBER], level: PROJECT, type: TASK)
updateTaskDueDate(input: UpdateTaskDueDate!):
Task! @hasRole(roles: [ADMIN, MEMBER], level: PROJECT, type: TASK)
toggleTaskWatch(input: ToggleTaskWatch!):
Task! @hasRole(roles: [ADMIN, MEMBER], level: PROJECT, type: TASK)
assignTask(input: AssignTaskInput):
Task! @hasRole(roles: [ADMIN, MEMBER], level: PROJECT, type: TASK)
@ -21,6 +23,10 @@ extend type Mutation {
Task! @hasRole(roles: [ADMIN, MEMBER], level: PROJECT, type: TASK)
}
input ToggleTaskWatch {
taskID: UUID!
}
input NewTask {
taskGroupID: UUID!
name: String!