feat: notifications in the app and, optionally, by e-mail
Derived from events and kept per person: whoever a ticket is assigned to, whoever reports or works on it when it moves, fails QA or gets a comment, and whoever joins a project. Never about what you did yourself, once per event. They arrive live through a subscription to a bell in the header, and are copied by e-mail to whoever turns it on when SMTP_URL is set. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -38,3 +38,15 @@ export enum ReleaseStatus {
|
||||
RELEASED = 'RELEASED',
|
||||
ARCHIVED = 'ARCHIVED',
|
||||
}
|
||||
|
||||
/** Why someone is told. */
|
||||
export enum NotificationKind {
|
||||
ASSIGNED = 'ASSIGNED',
|
||||
STATUS_CHANGED = 'STATUS_CHANGED',
|
||||
QA_FAILED = 'QA_FAILED',
|
||||
COMMENTED = 'COMMENTED',
|
||||
MENTIONED = 'MENTIONED',
|
||||
WATCHED = 'WATCHED',
|
||||
ADDED_TO_PROJECT = 'ADDED_TO_PROJECT',
|
||||
REMINDER = 'REMINDER',
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import {
|
||||
NotificationKind,
|
||||
IssueLinkType,
|
||||
IssuePriority,
|
||||
ProjectRole,
|
||||
@@ -187,3 +188,25 @@ export interface CommandResult {
|
||||
key?: string | null;
|
||||
version: number;
|
||||
}
|
||||
|
||||
/** Something the signed-in person should know. */
|
||||
export interface Notification {
|
||||
id: string;
|
||||
kind: NotificationKind;
|
||||
projectId: string;
|
||||
projectKey: string;
|
||||
issueId: string | null;
|
||||
issueKey: string | null;
|
||||
actor: UserRef;
|
||||
summary: string;
|
||||
/** Null: unread. */
|
||||
readAt: string | null;
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
export interface NotificationSettings {
|
||||
/** Copies by e-mail. */
|
||||
email: boolean;
|
||||
/** Whether this installation can send e-mail at all. */
|
||||
emailAvailable: boolean;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,8 @@ import {
|
||||
Issue,
|
||||
IssuePage,
|
||||
IssueSummary,
|
||||
Notification,
|
||||
NotificationSettings,
|
||||
Project,
|
||||
ProjectAnalytics,
|
||||
ProjectStats,
|
||||
@@ -130,6 +132,18 @@ export abstract class UsersGateway {
|
||||
abstract search(term: string): Observable<UserDirectoryEntry[]>;
|
||||
}
|
||||
|
||||
/** The signed-in person's notifications. */
|
||||
export abstract class NotificationsGateway {
|
||||
abstract mine(
|
||||
unreadOnly: boolean,
|
||||
limit: number,
|
||||
): Observable<{ items: Notification[]; unread: number }>;
|
||||
/** Without ids: all of them. */
|
||||
abstract markRead(ids?: string[]): Observable<void>;
|
||||
abstract settings(): Observable<NotificationSettings>;
|
||||
abstract updateSettings(email: boolean): Observable<NotificationSettings>;
|
||||
}
|
||||
|
||||
/** Realtime (GraphQL subscriptions over WebSocket). */
|
||||
export interface IssueChanged {
|
||||
action: string;
|
||||
@@ -158,4 +172,5 @@ export abstract class TrackerRealtimeGateway {
|
||||
abstract releaseChanges(projectId: string): Observable<Release>;
|
||||
abstract projectChanges(projectId: string): Observable<ProjectChanged>;
|
||||
abstract myProjectsChanges(): Observable<ProjectChanged>;
|
||||
abstract notifications(): Observable<Notification>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user