261023_02_ENH: 일괄 발송 일부 접수 완료 상태 지원 및 결과 알림·건수 표시 개선

This commit is contained in:
2026-10-23 15:10:46 +09:00
parent 3c27a1fa46
commit 3b552f38cf
5 changed files with 77 additions and 15 deletions

View File

@@ -13,7 +13,8 @@ import { useSelectedProject } from '@/hooks/useSelectedProject'
import { useDialog } from '@/hooks/useDialog'
import type { SelectedProject } from '@/store/jotai/project'
import { markListJobNotified, trackListJob, untrackListJob, useTrackedListJobs } from '@/store/list-job-tracker'
import { LIST_JOB_VIEW, listJobLabel } from '@/const/listJobConst'
import { LIST_JOB_VIEW } from '@/const/listJobConst'
import { getListJobResultNotification } from '@/utils/listJobResult'
import { isActiveListJob, isListJobType, parseListJob, type ListJob } from '@/types/list-job'
function isProjectSelection(value: unknown, projectId: number): value is SelectedProject {
@@ -100,14 +101,12 @@ export function ListJobWatcher({ userId, prjctIdx }: { userId: string; prjctIdx:
void qc.invalidateQueries({ queryKey: key })
}
if (openRequest?.opened && openRequest.jobKey === tracked.jobKey) return
const label = listJobLabel(job.jobType, job.operation)
const open = { label: '보기', onClick: () => {
hideAll()
setOpenRequest({ userId, prjctIdx: tracked.prjctIdx, jobType: tracked.jobType, jobKey: tracked.jobKey, opened: false })
} }
if (job.jobStatus === 'SUCCEEDED') toast.success(`${label} 작업이 완료됐습니다.`, { action: open })
else if (job.jobStatus === 'CANCELLED') toast.info(`${label} 작업이 중단됐습니다.`, { action: open })
else toast.error(`${label} 작업이 실패했습니다.`, { action: open })
const notification = getListJobResultNotification(job)
toast[notification.kind](notification.message, { action: open, description: notification.description })
})
}, [details, trackedJobs, openRequest, setOpenRequest, qc, userId, hideAll])