improvement: task assignment notif added to notifications feature.
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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':
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -4,7 +4,8 @@ export type LabCaseActivityType =
|
||||
| 'LAB_COMMENT'
|
||||
| 'CASE_IMPORTANT'
|
||||
| 'CASE_AMENDED'
|
||||
| 'TASK_COMPLETED';
|
||||
| 'TASK_COMPLETED'
|
||||
| 'TASK_ASSIGNED';
|
||||
|
||||
export interface LabCaseActivityItem {
|
||||
id: string;
|
||||
|
||||
Reference in New Issue
Block a user