feat(notifications): add channel routing matrix, daily summary, and task watch button

This commit is contained in:
sandrodach committed 2026-10-30 09:32:52 +01:00
1 parent 6795edbf4b
commit d2afcf49df
7 files changed
+461 -32

No files matched your search

+14
View File
@@ -35,6 +35,7 @@ import {
TagSummary,
User,
UserInvite,
NotificationSettings,
VoiceAdminStatus,
MergeResult,
WSMessage,
@@ -292,6 +293,7 @@ export const api = {
discordWebhookUrl?: string;
customWebhookUrl?: string;
notifyBeforeMinutes?: number;
notificationSettings?: NotificationSettings;
}): Promise<User> {
return request<User>('/api/v1/auth/settings', {
method: 'PATCH',
@@ -410,6 +412,18 @@ export const api = {
return ensureArray(res);
},
async watchTask(taskId: string): Promise<{ watching: boolean }> {
return request<{ watching: boolean }>(`/api/v1/tasks/${encodeURIComponent(taskId)}/watch`, {
method: 'POST',
});
},
async unwatchTask(taskId: string): Promise<{ watching: boolean }> {
return request<{ watching: boolean }>(`/api/v1/tasks/${encodeURIComponent(taskId)}/watch`, {
method: 'DELETE',
});
},
async reorderTasks(items: { id: string; sortOrder: number; kanbanStatus?: string }[], taskListId?: string): Promise<{ success: boolean }> {
const url = taskListId ? `/api/v1/task-lists/${taskListId}/tasks/reorder` : '/api/v1/tasks/reorder';
return request<{ success: boolean }>(url, {
+28
View File
@@ -46,6 +46,32 @@ export interface VoiceAdminStatus {
// Who can see whom: nobody, members of the same organization, or everybody (Doku/sharing-and-permissions.md)
export type SharingMode = 'private' | 'organizations' | 'open';
export interface NotificationChannelRouting {
email: boolean;
discord: boolean;
}
export interface NotificationEvents {
due: NotificationChannelRouting;
shared: NotificationChannelRouting;
taskDone: NotificationChannelRouting;
watched: NotificationChannelRouting;
}
export interface DailySummarySettings {
enabled: boolean;
time: string;
email: boolean;
discord: boolean;
}
export interface NotificationSettings {
paused: boolean;
includeOwnWatched: boolean;
events: NotificationEvents;
dailySummary: DailySummarySettings;
}
export interface User {
id: string;
email: string;
@@ -59,6 +85,7 @@ export interface User {
discordWebhookUrl?: string;
customWebhookUrl?: string;
notifyBeforeMinutes?: number;
notificationSettings?: NotificationSettings;
organizationId?: string;
createdAt: string;
}
@@ -113,6 +140,7 @@ export interface Thought {
subtasks?: SubTask[];
assignees?: string[]; // user IDs, only people with access to the task list
recurrence?: Recurrence;
isWatching?: boolean;
alarmSent?: boolean;
sortOrder?: number;
createdAt: string;