improvement: task assignment notif added to notifications feature.

This commit is contained in:
2026-07-18 17:23:47 +03:30
parent 9941dca849
commit 408b2c3329
16 changed files with 76 additions and 18 deletions

View File

@@ -761,6 +761,7 @@
"activityClinicComment": "{actor}: “{preview}” · {date}",
"activityLabComment": "{actor}: “{preview}” · {date}",
"activityTaskCompleted": "{step} completed by {actor} · {date}",
"activityTaskAssigned": "{step} assigned by {actor} · {date}",
"activityCaseImportant": "Marked important by {actor} · {date}",
"activityCaseAmended": "Case updated by {actor} · {date}",
"activityGeneric": "Update · {date}",

View File

@@ -762,6 +762,7 @@
"activityClinicComment": "{actor}: «{preview}» · {date}",
"activityLabComment": "{actor}: «{preview}» · {date}",
"activityTaskCompleted": "{step} توسط {actor} تکمیل شد · {date}",
"activityTaskAssigned": "{step} توسط {actor} اختصاص داده شد · {date}",
"activityCaseImportant": "مهم علامت‌گذاری شد توسط {actor} · {date}",
"activityCaseAmended": "پرونده به‌روزرسانی شد توسط {actor} · {date}",
"activityGeneric": "به‌روزرسانی · {date}",

View File

@@ -761,6 +761,7 @@
"activityClinicComment": "{actor}: “{preview}” · {date}",
"activityLabComment": "{actor}: “{preview}” · {date}",
"activityTaskCompleted": "{step} voltooid door {actor} · {date}",
"activityTaskAssigned": "{step} toegewezen door {actor} · {date}",
"activityCaseImportant": "Als belangrijk gemarkeerd door {actor} · {date}",
"activityCaseAmended": "Case bijgewerkt door {actor} · {date}",
"activityGeneric": "Update · {date}",

View File

@@ -297,6 +297,7 @@ export function CasesPage() {
try {
const response = await casesApi.assignTask(selectedCaseId, taskId, assigneeUserId);
setSelectedCase(response.data);
notifyTabBadgesChanged();
} catch (error: unknown) {
toast.showError(getUserFacingError(error, tErrors, t('errorAssignTask')));
} finally {

View File

@@ -35,6 +35,12 @@ export function formatLabCaseActivityLine(
actor,
date,
});
case 'TASK_ASSIGNED':
return t('activityTaskAssigned', {
step: activity.stepLabel ?? t('activityUnknownStep'),
actor,
date,
});
case 'CASE_IMPORTANT':
return t('activityCaseImportant', { actor, date });
case 'CASE_AMENDED':

View File

@@ -78,11 +78,16 @@ export function RealtimeProvider({ children }: { children: ReactNode }) {
const socket = io(`${apiOrigin()}/realtime`, {
withCredentials: true,
transports: ['websocket', 'polling'],
// Avoid hammering the gateway with an expired cookie; we reconnect after refresh.
reconnection: true,
reconnectionAttempts: 5,
reconnectionDelay: 2000,
});
socketRef.current = socket;
socket.on('connect', () => setConnected(true));
socket.on('disconnect', () => setConnected(false));
socket.on('connect_error', () => setConnected(false));
socket.on('notification.created', (payload: { notification?: UserNotificationItem }) => {
if (payload?.notification) {
setLastNotification(payload.notification);

View File

@@ -4,7 +4,8 @@ export type LabCaseActivityType =
| 'LAB_COMMENT'
| 'CASE_IMPORTANT'
| 'CASE_AMENDED'
| 'TASK_COMPLETED';
| 'TASK_COMPLETED'
| 'TASK_ASSIGNED';
export interface LabCaseActivityItem {
id: string;