@burdenoff/microfe-support 2026.830.2 → 2026.902.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/generated/global-operations.d.ts +42 -0
- package/dist/generated/global-operations.js +252 -239
- package/dist/generated/global-operations.js.map +1 -1
- package/dist/generated/global-types.d.ts +27 -0
- package/dist/generated/global-types.js.map +1 -1
- package/dist/support/components/careers/BulkCandidateDialogs.d.ts +1 -0
- package/dist/support/components/careers/BulkCandidateDialogs.js +351 -214
- package/dist/support/components/careers/BulkCandidateDialogs.js.map +1 -1
- package/dist/support/components/careers/BulkOperationFeedback.d.ts +4 -1
- package/dist/support/components/careers/BulkOperationFeedback.js +49 -1
- package/dist/support/components/careers/BulkOperationFeedback.js.map +1 -1
- package/dist/support/pages/JobApplicationsPage.js +511 -494
- package/dist/support/pages/JobApplicationsPage.js.map +1 -1
- package/dist/support/utils/bulkCandidateOperations.d.ts +15 -0
- package/dist/support/utils/bulkCandidateOperations.js +19 -4
- package/dist/support/utils/bulkCandidateOperations.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BulkCandidateDialogs.js","names":[],"sources":["../../../../src/support/components/careers/BulkCandidateDialogs.tsx"],"sourcesContent":["import { useEffect, useMemo, useState } from 'react';\nimport { useApolloClient } from '@apollo/client/react';\nimport { graphqlFetch } from '@burdenoff/fe-libs/shared/graphql/fetch';\nimport { print, type DocumentNode } from 'graphql';\nimport { AlertCircle, Loader2, Mail, Send, UserPlus } from 'lucide-react';\nimport {\n BulkEnsureInterviewRoundsDocument,\n BulkRandomizeAndSendAssignmentDocument,\n BulkSendRoundMessageDocument,\n NotifyDuplicateApplicantsDocument,\n useGetJobPostingQuery,\n type BulkEnsureInterviewRoundsMutation,\n type BulkEnsureInterviewRoundsMutationVariables,\n type BulkRandomizeAndSendAssignmentMutation,\n type BulkRandomizeAndSendAssignmentMutationVariables,\n type BulkSendRoundMessageMutation,\n type BulkSendRoundMessageMutationVariables,\n type GetJobPostingQuery,\n type NotifyDuplicateApplicantsMutation,\n type NotifyDuplicateApplicantsMutationVariables,\n} from '../../../generated/global-operations';\nimport { InterviewRoundType } from '../../../generated/global-types';\nimport { nativeNotify } from '../../../utils/nativeBridge';\nimport {\n aggregateCandidateEmailResult,\n aggregateDuplicateNoticeResult,\n aggregateEnsureRoundResult,\n assertCompleteCandidateEmailChunkResult,\n assertCompleteEnsureRoundChunkResult,\n createEmptyCandidateEmailAggregate,\n createEmptyDuplicateNoticeAggregate,\n createEmptyEnsureRoundAggregate,\n executeSequentialCandidateChunks,\n getCandidateSelectionCount,\n getSelectedCandidateIds,\n getBulkOperationNotificationSeverity,\n hasCandidateEmailType,\n resolveExactCandidateRounds,\n type BulkCandidateTarget,\n type CandidateEmailAggregate,\n type CandidateSelectionState,\n type DuplicateNoticeAggregate,\n type EnsureRoundAggregate,\n type EnsureRoundFailure,\n type SequentialExecutionProgress,\n} from '../../utils/bulkCandidateOperations';\nimport { BulkCandidateActionGuidance } from './BulkCandidateActionGuidance';\nimport {\n BulkOperationProgress,\n CandidateEmailResultDetails,\n DuplicateNoticeResultDetails,\n EnsureRoundResultDetails,\n StoppedBulkOperationNotice,\n type StoppedBulkOperationDetails,\n} from './BulkOperationFeedback';\nimport {\n Button,\n Checkbox,\n Dialog,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n Label,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n Textarea,\n} from '../ui';\n\ntype JobPostingRoundConfig = NonNullable<GetJobPostingQuery['jobPosting']>['rounds'][number];\nexport type BulkCandidateDialogMode = 'message' | 'assignment';\n\ntype AssignmentRoundConfig = Pick<JobPostingRoundConfig, 'isAssignmentRound' | 'roundType'>;\n\nexport function isAssignmentRoundConfig(round: AssignmentRoundConfig): boolean {\n return round.isAssignmentRound || round.roundType === InterviewRoundType.TakeHome;\n}\n\nconst ROUND_EMAIL_TYPE: Record<BulkCandidateDialogMode, string> = {\n message: 'ROUND_MESSAGE',\n assignment: 'ASSIGNMENT',\n};\n\ninterface SharedDialogProps {\n open: boolean;\n onClose: () => void;\n targets: ReadonlyArray<BulkCandidateTarget>;\n selection: CandidateSelectionState;\n jobPostingId: string;\n previewLoading: boolean;\n previewError: string | null;\n}\n\nfunction errorMessage(error: unknown): string {\n return error instanceof Error ? error.message : 'The request failed without an error message.';\n}\n\nasync function executeNoRetryMutation<TData, TVariables extends Record<string, unknown>>(\n document: DocumentNode,\n variables: TVariables,\n operationName: string\n): Promise<TData> {\n const response = await graphqlFetch<TData>({\n gateway: 'global',\n query: print(document),\n variables,\n operationName,\n // Candidate email sends can be non-idempotent. A transport or auth failure\n // must remain ambiguous and require a new preview before a manual retry.\n skipAuthRetry: true,\n });\n if (response.errors?.length) {\n throw new Error(response.errors.map((error) => error.message).join('; '));\n }\n if (!response.data) {\n throw new Error(`${operationName} returned no data.`);\n }\n return response.data;\n}\n\nfunction selectedTargets(\n targets: ReadonlyArray<BulkCandidateTarget>,\n selection: CandidateSelectionState\n): BulkCandidateTarget[] {\n const selectedIds = getSelectedCandidateIds(selection);\n return targets.filter((target) => selectedIds.has(target.id));\n}\n\nexport function BulkCandidateSendDialog({\n mode,\n open,\n onClose,\n onOpenAddRound,\n targets,\n selection,\n jobPostingId,\n previewLoading,\n previewError,\n}: SharedDialogProps & {\n mode: BulkCandidateDialogMode;\n onOpenAddRound: () => void;\n}) {\n const client = useApolloClient();\n const [roundConfigId, setRoundConfigId] = useState('');\n const [message, setMessage] = useState('');\n const [force, setForce] = useState(false);\n const [progress, setProgress] = useState<SequentialExecutionProgress | null>(null);\n const [result, setResult] = useState<CandidateEmailAggregate>(createEmptyCandidateEmailAggregate);\n const [stopped, setStopped] = useState<StoppedBulkOperationDetails | null>(null);\n const [attempted, setAttempted] = useState(false);\n const [submitting, setSubmitting] = useState(false);\n\n const {\n data: postingData,\n loading: postingLoading,\n error: postingError,\n } = useGetJobPostingQuery({\n variables: { id: jobPostingId },\n skip: !open || !jobPostingId,\n fetchPolicy: 'network-only',\n });\n\n useEffect(() => {\n if (!open) return;\n setRoundConfigId('');\n setMessage('');\n setForce(false);\n setProgress(null);\n setResult(createEmptyCandidateEmailAggregate());\n setStopped(null);\n setAttempted(false);\n setSubmitting(false);\n }, [open, mode]);\n\n const actionTargets = useMemo(() => selectedTargets(targets, selection), [selection, targets]);\n const intendedSelectionCount = getCandidateSelectionCount(selection);\n const selectionDataComplete = actionTargets.length === intendedSelectionCount;\n const postingRoundConfigs = postingData?.jobPosting?.rounds ?? [];\n const roundConfigs = postingRoundConfigs.filter((round: JobPostingRoundConfig) =>\n mode === 'assignment' ? isAssignmentRoundConfig(round) : true\n );\n const targetRoundConfig = postingRoundConfigs.find(\n (round: JobPostingRoundConfig) => round.id === roundConfigId\n );\n const resolution = targetRoundConfig\n ? resolveExactCandidateRounds(actionTargets, targetRoundConfig.id)\n : { pairs: [], unresolved: [] };\n const missingCount = resolution.unresolved.filter((item) => item.reason === 'MISSING').length;\n const ambiguousCount = resolution.unresolved.filter((item) => item.reason === 'AMBIGUOUS').length;\n const emailType = ROUND_EMAIL_TYPE[mode];\n const alreadySentCount = resolution.pairs.filter(({ round }) =>\n hasCandidateEmailType(round, emailType)\n ).length;\n const willSendCount = resolution.pairs.filter(\n ({ round }) => force || !hasCandidateEmailType(round, emailType)\n ).length;\n const postingMismatch = actionTargets.some((target) => target.jobPostingId !== jobPostingId);\n\n let effectivePreviewError = previewError;\n if (!effectivePreviewError && postingError) {\n effectivePreviewError = 'Could not load the posting rounds. Nothing will be sent.';\n } else if (!effectivePreviewError && !previewLoading && !selectionDataComplete) {\n effectivePreviewError =\n 'Some selected candidate details are unavailable. Refresh the selection before sending.';\n } else if (!effectivePreviewError && postingMismatch) {\n effectivePreviewError = 'Some selected candidates do not belong to the filtered posting.';\n } else if (!effectivePreviewError && roundConfigId && !postingLoading && !targetRoundConfig) {\n effectivePreviewError = 'The selected round is no longer available. Choose another round.';\n } else if (!effectivePreviewError && ambiguousCount > 0) {\n effectivePreviewError = `${ambiguousCount} selected candidate${ambiguousCount === 1 ? ' has' : 's have'} multiple concrete rounds for this configuration. Nothing will be sent until the data is corrected.`;\n }\n\n const handleSubmit = async () => {\n if (\n submitting ||\n attempted ||\n previewLoading ||\n postingLoading ||\n effectivePreviewError ||\n !selectionDataComplete ||\n !targetRoundConfig ||\n resolution.pairs.length === 0 ||\n willSendCount === 0 ||\n (mode === 'message' && !message.trim())\n ) {\n return;\n }\n\n setSubmitting(true);\n setAttempted(true);\n setStopped(null);\n setResult(createEmptyCandidateEmailAggregate());\n\n const execution = await executeSequentialCandidateChunks({\n items: resolution.pairs.map(({ applicationId, roundId }) => ({\n applicationId,\n roundId,\n })),\n initialAggregate: createEmptyCandidateEmailAggregate(),\n onProgress: setProgress,\n executeChunk: async (chunk) => {\n if (mode === 'assignment') {\n const response = await executeNoRetryMutation<\n BulkRandomizeAndSendAssignmentMutation,\n BulkRandomizeAndSendAssignmentMutationVariables\n >(\n BulkRandomizeAndSendAssignmentDocument,\n { input: { items: [...chunk], force } },\n 'BulkRandomizeAndSendAssignment'\n );\n const bulkResult = response.bulkRandomizeAndSendAssignment;\n if (!bulkResult) {\n throw new Error('The assignment request returned no result.');\n }\n const chunkResult: CandidateEmailAggregate = {\n succeeded: bulkResult.succeeded.map((item) => ({\n applicationId: item.applicationId,\n roundId: item.id,\n })),\n skipped: bulkResult.skipped.map((item) => ({\n applicationId: item.applicationId,\n roundId: item.roundId,\n reason: item.reason,\n message: item.message,\n })),\n failed: bulkResult.failed.map((item) => ({\n applicationId: item.applicationId,\n roundId: item.roundId,\n message: item.message,\n })),\n };\n assertCompleteCandidateEmailChunkResult(chunk, chunkResult);\n return chunkResult;\n }\n\n const response = await executeNoRetryMutation<\n BulkSendRoundMessageMutation,\n BulkSendRoundMessageMutationVariables\n >(\n BulkSendRoundMessageDocument,\n { input: { items: [...chunk], message: message.trim(), force } },\n 'BulkSendRoundMessage'\n );\n const bulkResult = response.bulkSendRoundMessage;\n if (!bulkResult) {\n throw new Error('The message request returned no result.');\n }\n const chunkResult: CandidateEmailAggregate = {\n succeeded: bulkResult.succeeded.map((item) => ({\n applicationId: item.applicationId,\n roundId: item.id,\n })),\n skipped: bulkResult.skipped.map((item) => ({\n applicationId: item.applicationId,\n roundId: item.roundId,\n reason: item.reason,\n message: item.message,\n })),\n failed: bulkResult.failed.map((item) => ({\n applicationId: item.applicationId,\n roundId: item.roundId,\n message: item.message,\n })),\n };\n assertCompleteCandidateEmailChunkResult(chunk, chunkResult);\n return chunkResult;\n },\n mergeResult: aggregateCandidateEmailResult,\n });\n\n setResult(execution.aggregate);\n if (execution.error) {\n setStopped({\n knownCompleted: execution.processedItems.length,\n ambiguous: execution.ambiguousItems.length,\n notStarted: execution.notStartedItems.length,\n message: errorMessage(execution.error),\n });\n }\n nativeNotify(\n getBulkOperationNotificationSeverity({\n succeeded: execution.aggregate.succeeded.length,\n skipped: execution.aggregate.skipped.length,\n failed: execution.aggregate.failed.length,\n ambiguous: !!execution.error,\n })\n );\n setSubmitting(false);\n\n void client\n .refetchQueries({\n include: ['GetJobApplications', 'GetJobApplicationInterviewRounds'],\n })\n .catch(() => undefined);\n };\n\n const previewBusy = previewLoading || postingLoading;\n const title = mode === 'assignment' ? 'Assign & Email Random Take-Home' : 'Send Message';\n\n return (\n <Dialog\n open={open}\n onOpenChange={(next) => {\n if (!next && !submitting) onClose();\n }}\n >\n <DialogContent className=\"sm:max-w-xl max-h-[90vh] overflow-y-auto\">\n <DialogHeader>\n <DialogTitle>{title}</DialogTitle>\n <DialogDescription>\n Choose one configured round for the candidates in the filtered posting.\n </DialogDescription>\n </DialogHeader>\n\n <BulkCandidateActionGuidance action={mode} unresolvedCount={missingCount} />\n\n {attempted ? (\n <div className=\"space-y-4\">\n {progress ? <BulkOperationProgress progress={progress} /> : null}\n <CandidateEmailResultDetails result={result} />\n {stopped ? <StoppedBulkOperationNotice details={stopped} /> : null}\n <DialogFooter>\n <Button onClick={onClose} disabled={submitting}>\n Done\n </Button>\n </DialogFooter>\n </div>\n ) : (\n <div className=\"space-y-4\">\n {previewBusy ? (\n <div className=\"flex items-center gap-2 text-sm text-text-secondary\">\n <Loader2 size={14} className=\"animate-spin\" />\n Refreshing candidates and configured rounds…\n </div>\n ) : null}\n\n {effectivePreviewError ? (\n <div className=\"flex items-start gap-2 text-sm text-status-error-text\" role=\"alert\">\n <AlertCircle size={14} className=\"mt-0.5 shrink-0\" />\n <span>{effectivePreviewError}</span>\n </div>\n ) : null}\n\n <div className=\"space-y-1.5\">\n <Label htmlFor=\"bulk-round-config\">Target round</Label>\n <Select\n value={roundConfigId}\n onValueChange={setRoundConfigId}\n disabled={previewBusy || !!effectivePreviewError}\n >\n <SelectTrigger id=\"bulk-round-config\">\n <SelectValue placeholder=\"Select a round\" />\n </SelectTrigger>\n <SelectContent>\n {roundConfigs.map((round: JobPostingRoundConfig) => (\n <SelectItem key={round.id} value={round.id}>\n Round {round.roundNumber} — {round.name}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n {roundConfigs.length === 0 && !previewBusy && !effectivePreviewError ? (\n <p className=\"text-xs text-status-warning-text\">\n {mode === 'assignment'\n ? 'This posting has no configured assignment round.'\n : 'This posting has no configured interview rounds.'}\n </p>\n ) : null}\n </div>\n\n {mode === 'message' ? (\n <div className=\"space-y-1.5\">\n <Label htmlFor=\"bulk-message\">Free-text message</Label>\n <Textarea\n id=\"bulk-message\"\n value={message}\n onChange={(event: React.ChangeEvent<HTMLTextAreaElement>) =>\n setMessage(event.target.value)\n }\n placeholder=\"Write the message sent to each candidate\"\n rows={5}\n />\n </div>\n ) : null}\n\n {roundConfigId && !previewBusy && !effectivePreviewError ? (\n <div className=\"space-y-2 rounded-md border border-border-seam bg-bg-sunken/30 p-3 text-xs text-text-secondary\">\n <p className=\"font-medium text-text-primary\">Preview</p>\n <p>\n Will send to <span className=\"font-semibold\">{willSendCount}</span> candidate\n {willSendCount === 1 ? '' : 's'}.\n </p>\n {alreadySentCount > 0 ? (\n <p>\n {alreadySentCount} already received this email type{' '}\n {force ? '(force will send again)' : '(the backend will skip them)'}.\n </p>\n ) : null}\n {missingCount > 0 ? (\n <Button type=\"button\" size=\"sm\" variant=\"outline\" onClick={onOpenAddRound}>\n <UserPlus size={14} />\n Add Selected to Round\n </Button>\n ) : null}\n <label className=\"flex cursor-pointer items-start gap-2 pt-1\">\n <Checkbox\n checked={force}\n onCheckedChange={(checked) => setForce(checked === true)}\n />\n <span>\n Force resend to candidates with a prior email. Force sends are non-idempotent\n and are never retried automatically.\n </span>\n </label>\n </div>\n ) : null}\n\n <DialogFooter>\n <Button variant=\"outline\" onClick={onClose} disabled={submitting}>\n Cancel\n </Button>\n <Button\n onClick={() => void handleSubmit()}\n disabled={\n submitting ||\n previewBusy ||\n !!effectivePreviewError ||\n !selectionDataComplete ||\n !roundConfigId ||\n resolution.pairs.length === 0 ||\n willSendCount === 0 ||\n (mode === 'message' && !message.trim())\n }\n >\n {submitting ? (\n <Loader2 size={16} className=\"mr-2 animate-spin\" />\n ) : (\n <Send size={16} />\n )}\n {submitting ? 'Sending…' : 'Send'}\n </Button>\n </DialogFooter>\n </div>\n )}\n </DialogContent>\n </Dialog>\n );\n}\n\nexport function AddSelectedToRoundDialog({\n open,\n onClose,\n targets,\n selection,\n jobPostingId,\n previewLoading,\n previewError,\n}: SharedDialogProps) {\n const client = useApolloClient();\n const [roundConfigId, setRoundConfigId] = useState('');\n const [progress, setProgress] = useState<SequentialExecutionProgress | null>(null);\n const [result, setResult] = useState<EnsureRoundAggregate>(createEmptyEnsureRoundAggregate);\n const [stopped, setStopped] = useState<StoppedBulkOperationDetails | null>(null);\n const [attempted, setAttempted] = useState(false);\n const [submitting, setSubmitting] = useState(false);\n\n const {\n data: postingData,\n loading: postingLoading,\n error: postingError,\n } = useGetJobPostingQuery({\n variables: { id: jobPostingId },\n skip: !open || !jobPostingId,\n fetchPolicy: 'network-only',\n });\n useEffect(() => {\n if (!open) return;\n setRoundConfigId('');\n setProgress(null);\n setResult(createEmptyEnsureRoundAggregate());\n setStopped(null);\n setAttempted(false);\n setSubmitting(false);\n }, [open]);\n\n const actionTargets = useMemo(() => selectedTargets(targets, selection), [selection, targets]);\n const intendedSelectionCount = getCandidateSelectionCount(selection);\n const selectionDataComplete = actionTargets.length === intendedSelectionCount;\n const selectedIds = actionTargets.map((target) => target.id);\n const postingMismatch = actionTargets.some((target) => target.jobPostingId !== jobPostingId);\n const roundConfigs = postingData?.jobPosting?.rounds ?? [];\n const selectedConfig = roundConfigs.find(\n (round: JobPostingRoundConfig) => round.id === roundConfigId\n );\n\n let effectivePreviewError = previewError;\n if (!effectivePreviewError && postingError) {\n effectivePreviewError = 'Could not load the posting rounds. Nothing will be changed.';\n } else if (!effectivePreviewError && !previewLoading && !selectionDataComplete) {\n effectivePreviewError =\n 'Some selected candidate details are unavailable. Refresh the selection before adding rounds.';\n } else if (!effectivePreviewError && postingMismatch) {\n effectivePreviewError = 'Some selected candidates do not belong to the filtered posting.';\n } else if (!effectivePreviewError && roundConfigId && !postingLoading && !selectedConfig) {\n effectivePreviewError = 'The selected round is no longer available. Choose another round.';\n }\n\n const handleSubmit = async () => {\n if (\n submitting ||\n attempted ||\n previewLoading ||\n postingLoading ||\n effectivePreviewError ||\n !selectionDataComplete ||\n !selectedConfig ||\n selectedIds.length === 0\n ) {\n return;\n }\n\n setSubmitting(true);\n setAttempted(true);\n setStopped(null);\n setResult(createEmptyEnsureRoundAggregate());\n\n const execution = await executeSequentialCandidateChunks({\n items: selectedIds,\n initialAggregate: createEmptyEnsureRoundAggregate(),\n onProgress: setProgress,\n executeChunk: async (applicationIds) => {\n const response = await executeNoRetryMutation<\n BulkEnsureInterviewRoundsMutation,\n BulkEnsureInterviewRoundsMutationVariables\n >(\n BulkEnsureInterviewRoundsDocument,\n {\n input: {\n jobPostingId,\n roundConfigId: selectedConfig.id,\n applicationIds: [...applicationIds],\n },\n },\n 'BulkEnsureInterviewRounds'\n );\n const bulkResult = response.bulkEnsureInterviewRounds;\n if (!bulkResult) {\n throw new Error('The add-to-round request returned no result.');\n }\n const chunkResult: EnsureRoundAggregate = {\n created: bulkResult.created.map((item) => ({\n id: item.round.id,\n applicationId: item.applicationId,\n })),\n alreadyPresent: bulkResult.alreadyPresent.map((item) => ({\n id: item.round.id,\n applicationId: item.applicationId,\n })),\n failed: bulkResult.failed.map((item: EnsureRoundFailure) => ({\n applicationId: item.applicationId,\n code: item.code,\n message: item.message,\n })),\n };\n assertCompleteEnsureRoundChunkResult(applicationIds, chunkResult);\n return chunkResult;\n },\n mergeResult: aggregateEnsureRoundResult,\n });\n\n setResult(execution.aggregate);\n if (execution.error) {\n setStopped({\n knownCompleted: execution.processedItems.length,\n ambiguous: execution.ambiguousItems.length,\n notStarted: execution.notStartedItems.length,\n message: errorMessage(execution.error),\n });\n }\n nativeNotify(\n getBulkOperationNotificationSeverity({\n succeeded: execution.aggregate.created.length + execution.aggregate.alreadyPresent.length,\n skipped: 0,\n failed: execution.aggregate.failed.length,\n ambiguous: !!execution.error,\n })\n );\n setSubmitting(false);\n\n void client\n .refetchQueries({\n include: ['GetJobApplications', 'GetJobApplicationInterviewRounds'],\n })\n .catch(() => undefined);\n };\n\n const previewBusy = previewLoading || postingLoading;\n\n return (\n <Dialog\n open={open}\n onOpenChange={(next) => {\n if (!next && !submitting) onClose();\n }}\n >\n <DialogContent className=\"sm:max-w-xl max-h-[90vh] overflow-y-auto\">\n <DialogHeader>\n <DialogTitle>Add Selected to Round</DialogTitle>\n <DialogDescription>\n Add every selected candidate in this posting to one configured interview round.\n </DialogDescription>\n </DialogHeader>\n\n <div className=\"rounded-md border border-border-seam bg-bg-sunken/30 p-3 text-sm text-text-secondary\">\n Candidates without this concrete round are added with status Scheduled. Existing target\n rounds are left unchanged, and all prior round history and application status remain\n unchanged.\n </div>\n\n {attempted ? (\n <div className=\"space-y-4\">\n {progress ? <BulkOperationProgress progress={progress} /> : null}\n <EnsureRoundResultDetails result={result} />\n {stopped ? <StoppedBulkOperationNotice details={stopped} /> : null}\n <DialogFooter>\n <Button onClick={onClose} disabled={submitting}>\n Done\n </Button>\n </DialogFooter>\n </div>\n ) : (\n <div className=\"space-y-4\">\n {previewBusy ? (\n <div className=\"flex items-center gap-2 text-sm text-text-secondary\">\n <Loader2 size={14} className=\"animate-spin\" />\n Refreshing candidates and configured rounds…\n </div>\n ) : null}\n\n {effectivePreviewError ? (\n <div className=\"flex items-start gap-2 text-sm text-status-error-text\" role=\"alert\">\n <AlertCircle size={14} className=\"mt-0.5 shrink-0\" />\n <span>{effectivePreviewError}</span>\n </div>\n ) : null}\n\n <div className=\"space-y-1.5\">\n <Label htmlFor=\"ensure-round-config\">Interview round</Label>\n <Select\n value={roundConfigId}\n onValueChange={setRoundConfigId}\n disabled={previewBusy || !!effectivePreviewError}\n >\n <SelectTrigger id=\"ensure-round-config\">\n <SelectValue placeholder=\"Select a round\" />\n </SelectTrigger>\n <SelectContent>\n {roundConfigs.map((round: JobPostingRoundConfig) => (\n <SelectItem key={round.id} value={round.id}>\n Round {round.roundNumber} — {round.name}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n {roundConfigs.length === 0 && !previewBusy && !effectivePreviewError ? (\n <p className=\"text-xs text-status-warning-text\">\n This posting has no configured interview rounds.\n </p>\n ) : null}\n </div>\n\n <p className=\"text-xs text-text-secondary\">\n {intendedSelectionCount} selected candidate{intendedSelectionCount === 1 ? '' : 's'}{' '}\n will be checked. Existing target rounds are reported as already present.\n </p>\n\n <DialogFooter>\n <Button variant=\"outline\" onClick={onClose} disabled={submitting}>\n Cancel\n </Button>\n <Button\n onClick={() => void handleSubmit()}\n disabled={\n submitting ||\n previewBusy ||\n !!effectivePreviewError ||\n !selectionDataComplete ||\n !roundConfigId ||\n selectedIds.length === 0\n }\n >\n {submitting ? (\n <Loader2 size={16} className=\"mr-2 animate-spin\" />\n ) : (\n <UserPlus size={16} />\n )}\n {submitting ? 'Adding…' : 'Add Selected to Round'}\n </Button>\n </DialogFooter>\n </div>\n )}\n </DialogContent>\n </Dialog>\n );\n}\n\n/**\n * Notifies candidates who have more than one application on file (and so may\n * have received more than one take-home assignment email) that they only need\n * to complete ONE. Unlike the other two dialogs, this is NOT scoped to a\n * round — it operates on applicationIds directly and the backend groups by\n * email address, so selecting several duplicate applications for the same\n * person still sends exactly one notice.\n */\nexport function NotifyDuplicateApplicantsDialog({\n open,\n onClose,\n targets,\n selection,\n jobPostingId,\n previewLoading,\n previewError,\n}: SharedDialogProps) {\n const client = useApolloClient();\n const [progress, setProgress] = useState<SequentialExecutionProgress | null>(null);\n const [result, setResult] = useState<DuplicateNoticeAggregate>(\n createEmptyDuplicateNoticeAggregate\n );\n const [stopped, setStopped] = useState<StoppedBulkOperationDetails | null>(null);\n const [attempted, setAttempted] = useState(false);\n const [submitting, setSubmitting] = useState(false);\n\n useEffect(() => {\n if (!open) return;\n setProgress(null);\n setResult(createEmptyDuplicateNoticeAggregate());\n setStopped(null);\n setAttempted(false);\n setSubmitting(false);\n }, [open]);\n\n const actionTargets = useMemo(() => selectedTargets(targets, selection), [selection, targets]);\n const intendedSelectionCount = getCandidateSelectionCount(selection);\n const selectionDataComplete = actionTargets.length === intendedSelectionCount;\n const selectedIds = actionTargets.map((target) => target.id);\n const postingMismatch = actionTargets.some((target) => target.jobPostingId !== jobPostingId);\n\n let effectivePreviewError = previewError;\n if (!effectivePreviewError && !previewLoading && !selectionDataComplete) {\n effectivePreviewError =\n 'Some selected candidate details are unavailable. Refresh the selection before notifying.';\n } else if (!effectivePreviewError && postingMismatch) {\n effectivePreviewError = 'Some selected candidates do not belong to the filtered posting.';\n }\n\n const handleSubmit = async () => {\n if (\n submitting ||\n attempted ||\n previewLoading ||\n effectivePreviewError ||\n !selectionDataComplete ||\n selectedIds.length === 0\n ) {\n return;\n }\n\n setSubmitting(true);\n setAttempted(true);\n setStopped(null);\n setResult(createEmptyDuplicateNoticeAggregate());\n\n const execution = await executeSequentialCandidateChunks({\n items: selectedIds,\n initialAggregate: createEmptyDuplicateNoticeAggregate(),\n onProgress: setProgress,\n executeChunk: async (applicationIds) => {\n const response = await executeNoRetryMutation<\n NotifyDuplicateApplicantsMutation,\n NotifyDuplicateApplicantsMutationVariables\n >(\n NotifyDuplicateApplicantsDocument,\n { input: { applicationIds: [...applicationIds] } },\n 'NotifyDuplicateApplicants'\n );\n const bulkResult = response.notifyDuplicateApplicants;\n if (!bulkResult) {\n throw new Error('The duplicate-notice request returned no result.');\n }\n const chunkResult: DuplicateNoticeAggregate = {\n succeeded: bulkResult.succeeded.map((item) => ({ email: item.email })),\n skipped: bulkResult.skipped.map((item) => ({\n email: item.email,\n reason: item.reason,\n message: item.message,\n })),\n failed: bulkResult.failed.map((item) => ({ email: item.email, message: item.message })),\n };\n // No completeness assertion here (unlike the other dialogs): the\n // backend groups by email, so N selected applications can legitimately\n // collapse into fewer result rows — that's the whole point.\n return chunkResult;\n },\n mergeResult: aggregateDuplicateNoticeResult,\n });\n\n setResult(execution.aggregate);\n if (execution.error) {\n setStopped({\n knownCompleted: execution.processedItems.length,\n ambiguous: execution.ambiguousItems.length,\n notStarted: execution.notStartedItems.length,\n message: errorMessage(execution.error),\n });\n }\n nativeNotify(\n getBulkOperationNotificationSeverity({\n succeeded: execution.aggregate.succeeded.length,\n skipped: execution.aggregate.skipped.length,\n failed: execution.aggregate.failed.length,\n ambiguous: !!execution.error,\n })\n );\n setSubmitting(false);\n\n void client.refetchQueries({ include: ['GetJobApplications'] }).catch(() => undefined);\n };\n\n return (\n <Dialog\n open={open}\n onOpenChange={(next) => {\n if (!next && !submitting) onClose();\n }}\n >\n <DialogContent className=\"sm:max-w-xl max-h-[90vh] overflow-y-auto\">\n <DialogHeader>\n <DialogTitle>Notify Duplicate Applicants</DialogTitle>\n <DialogDescription>\n Let candidates with more than one application know they only need to complete one\n take-home assignment.\n </DialogDescription>\n </DialogHeader>\n\n <div className=\"rounded-md border border-border-seam bg-bg-sunken/30 p-3 text-sm text-text-secondary\">\n Selected applications are grouped by email address — exactly one notice goes out per\n unique candidate, even if you select several of their duplicate applications. An email\n that only appears once among your selection is skipped (it isn't a duplicate), and an\n email already notified before is skipped automatically.\n </div>\n\n {attempted ? (\n <div className=\"space-y-4\">\n {progress ? <BulkOperationProgress progress={progress} /> : null}\n <DuplicateNoticeResultDetails result={result} />\n {stopped ? <StoppedBulkOperationNotice details={stopped} /> : null}\n <DialogFooter>\n <Button onClick={onClose} disabled={submitting}>\n Done\n </Button>\n </DialogFooter>\n </div>\n ) : (\n <div className=\"space-y-4\">\n {previewLoading ? (\n <div className=\"flex items-center gap-2 text-sm text-text-secondary\">\n <Loader2 size={14} className=\"animate-spin\" />\n Refreshing candidates…\n </div>\n ) : null}\n\n {effectivePreviewError ? (\n <div className=\"flex items-start gap-2 text-sm text-status-error-text\" role=\"alert\">\n <AlertCircle size={14} className=\"mt-0.5 shrink-0\" />\n <span>{effectivePreviewError}</span>\n </div>\n ) : null}\n\n <p className=\"text-xs text-text-secondary\">\n {intendedSelectionCount} selected application{intendedSelectionCount === 1 ? '' : 's'}{' '}\n will be checked and grouped by email.\n </p>\n\n <DialogFooter>\n <Button variant=\"outline\" onClick={onClose} disabled={submitting}>\n Cancel\n </Button>\n <Button\n onClick={() => void handleSubmit()}\n disabled={\n submitting ||\n previewLoading ||\n !!effectivePreviewError ||\n !selectionDataComplete ||\n selectedIds.length === 0\n }\n >\n {submitting ? (\n <Loader2 size={16} className=\"mr-2 animate-spin\" />\n ) : (\n <Mail size={16} />\n )}\n {submitting ? 'Notifying…' : 'Notify Duplicate Applicants'}\n </Button>\n </DialogFooter>\n </div>\n )}\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AA8EA,SAAgB,EAAwB,GAAuC;CAC7E,OAAO,EAAM,qBAAqB,EAAM,cAAc,EAAmB;AAC3E;AAEA,IAAM,KAA4D;CAChE,SAAS;CACT,YAAY;AACd;AAYA,SAAS,GAAa,GAAwB;CAC5C,OAAO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AAK,WAAU;OAAwD,MAAK;OAA5E,UAAA,CACE,kBAAC,IAAD;QAAa,MAAM;QAAI,WAAU;OAAmB,CAAA,GACpD,kBAAC,QAAD,EAAA,UAAO,EAA4B,CAAA,CAChC;MACH,CAAA,IAAA;MAEJ,kBAAC,KAAD;OAAG,WAAU;OAAb,UAAA;QACG;QAAuB;QAAsB,MAA2B,IAAI,KAAK;QAAK;QAAI;OAE1F;;MAEH,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD;OAAQ,SAAQ;OAAU,SAAS;OAAS,UAAU;OAAY,UAAA;MAE1D,CAAA,GACR,kBAAC,GAAD;OACE,eAAe,KAAK,EAAa;OACjC,UACE,KACA,KACA,CAAC,CAAC,KACF,CAAC,KACD,EAAY,WAAW;OAP3B,UAAA,CAUG,IACC,kBAAC,GAAD;QAAS,MAAM;QAAI,WAAU;OAAqB,CAAA,IAElD,kBAAC,GAAD,EAAM,MAAM,GAAK,CAAA,GAElB,IAAa,eAAe,6BACvB;MACI,CAAA,CAAA,EAAA,CAAA;KACX;;GAEM;;CACT,CAAA;AAEZ"}
|
|
1
|
+
{"version":3,"file":"BulkCandidateDialogs.js","names":[],"sources":["../../../../src/support/components/careers/BulkCandidateDialogs.tsx"],"sourcesContent":["import { useEffect, useMemo, useState } from 'react';\nimport { useApolloClient } from '@apollo/client/react';\nimport { graphqlFetch } from '@burdenoff/fe-libs/shared/graphql/fetch';\nimport { print, type DocumentNode } from 'graphql';\nimport { AlertCircle, Loader2, Mail, Send, UserPlus } from 'lucide-react';\nimport {\n BulkEnsureInterviewRoundsDocument,\n BulkRandomizeAndSendAssignmentDocument,\n BulkSendCustomEmailDocument,\n BulkSendRoundMessageDocument,\n NotifyDuplicateApplicantsDocument,\n useGetJobPostingQuery,\n type BulkEnsureInterviewRoundsMutation,\n type BulkEnsureInterviewRoundsMutationVariables,\n type BulkRandomizeAndSendAssignmentMutation,\n type BulkRandomizeAndSendAssignmentMutationVariables,\n type BulkSendCustomEmailMutation,\n type BulkSendCustomEmailMutationVariables,\n type BulkSendRoundMessageMutation,\n type BulkSendRoundMessageMutationVariables,\n type GetJobPostingQuery,\n type NotifyDuplicateApplicantsMutation,\n type NotifyDuplicateApplicantsMutationVariables,\n} from '../../../generated/global-operations';\nimport { InterviewRoundType } from '../../../generated/global-types';\nimport { nativeNotify } from '../../../utils/nativeBridge';\nimport {\n aggregateBulkCustomEmailResult,\n aggregateCandidateEmailResult,\n aggregateDuplicateNoticeResult,\n aggregateEnsureRoundResult,\n assertCompleteBulkCustomEmailChunkResult,\n assertCompleteCandidateEmailChunkResult,\n assertCompleteEnsureRoundChunkResult,\n createEmptyBulkCustomEmailAggregate,\n createEmptyCandidateEmailAggregate,\n createEmptyDuplicateNoticeAggregate,\n createEmptyEnsureRoundAggregate,\n executeSequentialCandidateChunks,\n getCandidateSelectionCount,\n getSelectedCandidateIds,\n getBulkOperationNotificationSeverity,\n hasCandidateEmailType,\n resolveExactCandidateRounds,\n type BulkCandidateTarget,\n type BulkCustomEmailAggregate,\n type CandidateEmailAggregate,\n type CandidateSelectionState,\n type DuplicateNoticeAggregate,\n type EnsureRoundAggregate,\n type EnsureRoundFailure,\n type SequentialExecutionProgress,\n} from '../../utils/bulkCandidateOperations';\nimport { RichTextEditor } from './RichTextEditor';\nimport { BulkCandidateActionGuidance } from './BulkCandidateActionGuidance';\nimport {\n BulkCustomEmailResultDetails,\n BulkOperationProgress,\n CandidateEmailResultDetails,\n DuplicateNoticeResultDetails,\n EnsureRoundResultDetails,\n StoppedBulkOperationNotice,\n type StoppedBulkOperationDetails,\n} from './BulkOperationFeedback';\nimport {\n Button,\n Checkbox,\n Dialog,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n Label,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n Textarea,\n} from '../ui';\n\ntype JobPostingRoundConfig = NonNullable<GetJobPostingQuery['jobPosting']>['rounds'][number];\nexport type BulkCandidateDialogMode = 'message' | 'assignment';\n\ntype AssignmentRoundConfig = Pick<JobPostingRoundConfig, 'isAssignmentRound' | 'roundType'>;\n\nexport function isAssignmentRoundConfig(round: AssignmentRoundConfig): boolean {\n return round.isAssignmentRound || round.roundType === InterviewRoundType.TakeHome;\n}\n\nconst ROUND_EMAIL_TYPE: Record<BulkCandidateDialogMode, string> = {\n message: 'ROUND_MESSAGE',\n assignment: 'ASSIGNMENT',\n};\n\ninterface SharedDialogProps {\n open: boolean;\n onClose: () => void;\n targets: ReadonlyArray<BulkCandidateTarget>;\n selection: CandidateSelectionState;\n jobPostingId: string;\n previewLoading: boolean;\n previewError: string | null;\n}\n\nfunction errorMessage(error: unknown): string {\n return error instanceof Error ? error.message : 'The request failed without an error message.';\n}\n\nasync function executeNoRetryMutation<TData, TVariables extends Record<string, unknown>>(\n document: DocumentNode,\n variables: TVariables,\n operationName: string\n): Promise<TData> {\n const response = await graphqlFetch<TData>({\n gateway: 'global',\n query: print(document),\n variables,\n operationName,\n // Candidate email sends can be non-idempotent. A transport or auth failure\n // must remain ambiguous and require a new preview before a manual retry.\n skipAuthRetry: true,\n });\n if (response.errors?.length) {\n throw new Error(response.errors.map((error) => error.message).join('; '));\n }\n if (!response.data) {\n throw new Error(`${operationName} returned no data.`);\n }\n return response.data;\n}\n\nfunction selectedTargets(\n targets: ReadonlyArray<BulkCandidateTarget>,\n selection: CandidateSelectionState\n): BulkCandidateTarget[] {\n const selectedIds = getSelectedCandidateIds(selection);\n return targets.filter((target) => selectedIds.has(target.id));\n}\n\nexport function BulkCandidateSendDialog({\n mode,\n open,\n onClose,\n onOpenAddRound,\n targets,\n selection,\n jobPostingId,\n previewLoading,\n previewError,\n}: SharedDialogProps & {\n mode: BulkCandidateDialogMode;\n onOpenAddRound: () => void;\n}) {\n const client = useApolloClient();\n const [roundConfigId, setRoundConfigId] = useState('');\n const [message, setMessage] = useState('');\n const [force, setForce] = useState(false);\n const [progress, setProgress] = useState<SequentialExecutionProgress | null>(null);\n const [result, setResult] = useState<CandidateEmailAggregate>(createEmptyCandidateEmailAggregate);\n const [stopped, setStopped] = useState<StoppedBulkOperationDetails | null>(null);\n const [attempted, setAttempted] = useState(false);\n const [submitting, setSubmitting] = useState(false);\n\n const {\n data: postingData,\n loading: postingLoading,\n error: postingError,\n } = useGetJobPostingQuery({\n variables: { id: jobPostingId },\n skip: !open || !jobPostingId,\n fetchPolicy: 'network-only',\n });\n\n useEffect(() => {\n if (!open) return;\n setRoundConfigId('');\n setMessage('');\n setForce(false);\n setProgress(null);\n setResult(createEmptyCandidateEmailAggregate());\n setStopped(null);\n setAttempted(false);\n setSubmitting(false);\n }, [open, mode]);\n\n const actionTargets = useMemo(() => selectedTargets(targets, selection), [selection, targets]);\n const intendedSelectionCount = getCandidateSelectionCount(selection);\n const selectionDataComplete = actionTargets.length === intendedSelectionCount;\n const postingRoundConfigs = postingData?.jobPosting?.rounds ?? [];\n const roundConfigs = postingRoundConfigs.filter((round: JobPostingRoundConfig) =>\n mode === 'assignment' ? isAssignmentRoundConfig(round) : true\n );\n const targetRoundConfig = postingRoundConfigs.find(\n (round: JobPostingRoundConfig) => round.id === roundConfigId\n );\n const resolution = targetRoundConfig\n ? resolveExactCandidateRounds(actionTargets, targetRoundConfig.id)\n : { pairs: [], unresolved: [] };\n const missingCount = resolution.unresolved.filter((item) => item.reason === 'MISSING').length;\n const ambiguousCount = resolution.unresolved.filter((item) => item.reason === 'AMBIGUOUS').length;\n const emailType = ROUND_EMAIL_TYPE[mode];\n const alreadySentCount = resolution.pairs.filter(({ round }) =>\n hasCandidateEmailType(round, emailType)\n ).length;\n const willSendCount = resolution.pairs.filter(\n ({ round }) => force || !hasCandidateEmailType(round, emailType)\n ).length;\n const postingMismatch = actionTargets.some((target) => target.jobPostingId !== jobPostingId);\n\n let effectivePreviewError = previewError;\n if (!effectivePreviewError && postingError) {\n effectivePreviewError = 'Could not load the posting rounds. Nothing will be sent.';\n } else if (!effectivePreviewError && !previewLoading && !selectionDataComplete) {\n effectivePreviewError =\n 'Some selected candidate details are unavailable. Refresh the selection before sending.';\n } else if (!effectivePreviewError && postingMismatch) {\n effectivePreviewError = 'Some selected candidates do not belong to the filtered posting.';\n } else if (!effectivePreviewError && roundConfigId && !postingLoading && !targetRoundConfig) {\n effectivePreviewError = 'The selected round is no longer available. Choose another round.';\n } else if (!effectivePreviewError && ambiguousCount > 0) {\n effectivePreviewError = `${ambiguousCount} selected candidate${ambiguousCount === 1 ? ' has' : 's have'} multiple concrete rounds for this configuration. Nothing will be sent until the data is corrected.`;\n }\n\n const handleSubmit = async () => {\n if (\n submitting ||\n attempted ||\n previewLoading ||\n postingLoading ||\n effectivePreviewError ||\n !selectionDataComplete ||\n !targetRoundConfig ||\n resolution.pairs.length === 0 ||\n willSendCount === 0 ||\n (mode === 'message' && !message.trim())\n ) {\n return;\n }\n\n setSubmitting(true);\n setAttempted(true);\n setStopped(null);\n setResult(createEmptyCandidateEmailAggregate());\n\n const execution = await executeSequentialCandidateChunks({\n items: resolution.pairs.map(({ applicationId, roundId }) => ({\n applicationId,\n roundId,\n })),\n initialAggregate: createEmptyCandidateEmailAggregate(),\n onProgress: setProgress,\n executeChunk: async (chunk) => {\n if (mode === 'assignment') {\n const response = await executeNoRetryMutation<\n BulkRandomizeAndSendAssignmentMutation,\n BulkRandomizeAndSendAssignmentMutationVariables\n >(\n BulkRandomizeAndSendAssignmentDocument,\n { input: { items: [...chunk], force } },\n 'BulkRandomizeAndSendAssignment'\n );\n const bulkResult = response.bulkRandomizeAndSendAssignment;\n if (!bulkResult) {\n throw new Error('The assignment request returned no result.');\n }\n const chunkResult: CandidateEmailAggregate = {\n succeeded: bulkResult.succeeded.map((item) => ({\n applicationId: item.applicationId,\n roundId: item.id,\n })),\n skipped: bulkResult.skipped.map((item) => ({\n applicationId: item.applicationId,\n roundId: item.roundId,\n reason: item.reason,\n message: item.message,\n })),\n failed: bulkResult.failed.map((item) => ({\n applicationId: item.applicationId,\n roundId: item.roundId,\n message: item.message,\n })),\n };\n assertCompleteCandidateEmailChunkResult(chunk, chunkResult);\n return chunkResult;\n }\n\n const response = await executeNoRetryMutation<\n BulkSendRoundMessageMutation,\n BulkSendRoundMessageMutationVariables\n >(\n BulkSendRoundMessageDocument,\n { input: { items: [...chunk], message: message.trim(), force } },\n 'BulkSendRoundMessage'\n );\n const bulkResult = response.bulkSendRoundMessage;\n if (!bulkResult) {\n throw new Error('The message request returned no result.');\n }\n const chunkResult: CandidateEmailAggregate = {\n succeeded: bulkResult.succeeded.map((item) => ({\n applicationId: item.applicationId,\n roundId: item.id,\n })),\n skipped: bulkResult.skipped.map((item) => ({\n applicationId: item.applicationId,\n roundId: item.roundId,\n reason: item.reason,\n message: item.message,\n })),\n failed: bulkResult.failed.map((item) => ({\n applicationId: item.applicationId,\n roundId: item.roundId,\n message: item.message,\n })),\n };\n assertCompleteCandidateEmailChunkResult(chunk, chunkResult);\n return chunkResult;\n },\n mergeResult: aggregateCandidateEmailResult,\n });\n\n setResult(execution.aggregate);\n if (execution.error) {\n setStopped({\n knownCompleted: execution.processedItems.length,\n ambiguous: execution.ambiguousItems.length,\n notStarted: execution.notStartedItems.length,\n message: errorMessage(execution.error),\n });\n }\n nativeNotify(\n getBulkOperationNotificationSeverity({\n succeeded: execution.aggregate.succeeded.length,\n skipped: execution.aggregate.skipped.length,\n failed: execution.aggregate.failed.length,\n ambiguous: !!execution.error,\n })\n );\n setSubmitting(false);\n\n void client\n .refetchQueries({\n include: ['GetJobApplications', 'GetJobApplicationInterviewRounds'],\n })\n .catch(() => undefined);\n };\n\n const previewBusy = previewLoading || postingLoading;\n const title = mode === 'assignment' ? 'Assign & Email Random Take-Home' : 'Send Message';\n\n return (\n <Dialog\n open={open}\n onOpenChange={(next) => {\n if (!next && !submitting) onClose();\n }}\n >\n <DialogContent className=\"sm:max-w-xl max-h-[90vh] overflow-y-auto\">\n <DialogHeader>\n <DialogTitle>{title}</DialogTitle>\n <DialogDescription>\n Choose one configured round for the candidates in the filtered posting.\n </DialogDescription>\n </DialogHeader>\n\n <BulkCandidateActionGuidance action={mode} unresolvedCount={missingCount} />\n\n {attempted ? (\n <div className=\"space-y-4\">\n {progress ? <BulkOperationProgress progress={progress} /> : null}\n <CandidateEmailResultDetails result={result} />\n {stopped ? <StoppedBulkOperationNotice details={stopped} /> : null}\n <DialogFooter>\n <Button onClick={onClose} disabled={submitting}>\n Done\n </Button>\n </DialogFooter>\n </div>\n ) : (\n <div className=\"space-y-4\">\n {previewBusy ? (\n <div className=\"flex items-center gap-2 text-sm text-text-secondary\">\n <Loader2 size={14} className=\"animate-spin\" />\n Refreshing candidates and configured rounds…\n </div>\n ) : null}\n\n {effectivePreviewError ? (\n <div className=\"flex items-start gap-2 text-sm text-status-error-text\" role=\"alert\">\n <AlertCircle size={14} className=\"mt-0.5 shrink-0\" />\n <span>{effectivePreviewError}</span>\n </div>\n ) : null}\n\n <div className=\"space-y-1.5\">\n <Label htmlFor=\"bulk-round-config\">Target round</Label>\n <Select\n value={roundConfigId}\n onValueChange={setRoundConfigId}\n disabled={previewBusy || !!effectivePreviewError}\n >\n <SelectTrigger id=\"bulk-round-config\">\n <SelectValue placeholder=\"Select a round\" />\n </SelectTrigger>\n <SelectContent>\n {roundConfigs.map((round: JobPostingRoundConfig) => (\n <SelectItem key={round.id} value={round.id}>\n Round {round.roundNumber} — {round.name}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n {roundConfigs.length === 0 && !previewBusy && !effectivePreviewError ? (\n <p className=\"text-xs text-status-warning-text\">\n {mode === 'assignment'\n ? 'This posting has no configured assignment round.'\n : 'This posting has no configured interview rounds.'}\n </p>\n ) : null}\n </div>\n\n {mode === 'message' ? (\n <div className=\"space-y-1.5\">\n <Label htmlFor=\"bulk-message\">Free-text message</Label>\n <Textarea\n id=\"bulk-message\"\n value={message}\n onChange={(event: React.ChangeEvent<HTMLTextAreaElement>) =>\n setMessage(event.target.value)\n }\n placeholder=\"Write the message sent to each candidate\"\n rows={5}\n />\n </div>\n ) : null}\n\n {roundConfigId && !previewBusy && !effectivePreviewError ? (\n <div className=\"space-y-2 rounded-md border border-border-seam bg-bg-sunken/30 p-3 text-xs text-text-secondary\">\n <p className=\"font-medium text-text-primary\">Preview</p>\n <p>\n Will send to <span className=\"font-semibold\">{willSendCount}</span> candidate\n {willSendCount === 1 ? '' : 's'}.\n </p>\n {alreadySentCount > 0 ? (\n <p>\n {alreadySentCount} already received this email type{' '}\n {force ? '(force will send again)' : '(the backend will skip them)'}.\n </p>\n ) : null}\n {missingCount > 0 ? (\n <Button type=\"button\" size=\"sm\" variant=\"outline\" onClick={onOpenAddRound}>\n <UserPlus size={14} />\n Add Selected to Round\n </Button>\n ) : null}\n <label className=\"flex cursor-pointer items-start gap-2 pt-1\">\n <Checkbox\n checked={force}\n onCheckedChange={(checked) => setForce(checked === true)}\n />\n <span>\n Force resend to candidates with a prior email. Force sends are non-idempotent\n and are never retried automatically.\n </span>\n </label>\n </div>\n ) : null}\n\n <DialogFooter>\n <Button variant=\"outline\" onClick={onClose} disabled={submitting}>\n Cancel\n </Button>\n <Button\n onClick={() => void handleSubmit()}\n disabled={\n submitting ||\n previewBusy ||\n !!effectivePreviewError ||\n !selectionDataComplete ||\n !roundConfigId ||\n resolution.pairs.length === 0 ||\n willSendCount === 0 ||\n (mode === 'message' && !message.trim())\n }\n >\n {submitting ? (\n <Loader2 size={16} className=\"mr-2 animate-spin\" />\n ) : (\n <Send size={16} />\n )}\n {submitting ? 'Sending…' : 'Send'}\n </Button>\n </DialogFooter>\n </div>\n )}\n </DialogContent>\n </Dialog>\n );\n}\n\nexport function AddSelectedToRoundDialog({\n open,\n onClose,\n targets,\n selection,\n jobPostingId,\n previewLoading,\n previewError,\n}: SharedDialogProps) {\n const client = useApolloClient();\n const [roundConfigId, setRoundConfigId] = useState('');\n const [progress, setProgress] = useState<SequentialExecutionProgress | null>(null);\n const [result, setResult] = useState<EnsureRoundAggregate>(createEmptyEnsureRoundAggregate);\n const [stopped, setStopped] = useState<StoppedBulkOperationDetails | null>(null);\n const [attempted, setAttempted] = useState(false);\n const [submitting, setSubmitting] = useState(false);\n\n const {\n data: postingData,\n loading: postingLoading,\n error: postingError,\n } = useGetJobPostingQuery({\n variables: { id: jobPostingId },\n skip: !open || !jobPostingId,\n fetchPolicy: 'network-only',\n });\n useEffect(() => {\n if (!open) return;\n setRoundConfigId('');\n setProgress(null);\n setResult(createEmptyEnsureRoundAggregate());\n setStopped(null);\n setAttempted(false);\n setSubmitting(false);\n }, [open]);\n\n const actionTargets = useMemo(() => selectedTargets(targets, selection), [selection, targets]);\n const intendedSelectionCount = getCandidateSelectionCount(selection);\n const selectionDataComplete = actionTargets.length === intendedSelectionCount;\n const selectedIds = actionTargets.map((target) => target.id);\n const postingMismatch = actionTargets.some((target) => target.jobPostingId !== jobPostingId);\n const roundConfigs = postingData?.jobPosting?.rounds ?? [];\n const selectedConfig = roundConfigs.find(\n (round: JobPostingRoundConfig) => round.id === roundConfigId\n );\n\n let effectivePreviewError = previewError;\n if (!effectivePreviewError && postingError) {\n effectivePreviewError = 'Could not load the posting rounds. Nothing will be changed.';\n } else if (!effectivePreviewError && !previewLoading && !selectionDataComplete) {\n effectivePreviewError =\n 'Some selected candidate details are unavailable. Refresh the selection before adding rounds.';\n } else if (!effectivePreviewError && postingMismatch) {\n effectivePreviewError = 'Some selected candidates do not belong to the filtered posting.';\n } else if (!effectivePreviewError && roundConfigId && !postingLoading && !selectedConfig) {\n effectivePreviewError = 'The selected round is no longer available. Choose another round.';\n }\n\n const handleSubmit = async () => {\n if (\n submitting ||\n attempted ||\n previewLoading ||\n postingLoading ||\n effectivePreviewError ||\n !selectionDataComplete ||\n !selectedConfig ||\n selectedIds.length === 0\n ) {\n return;\n }\n\n setSubmitting(true);\n setAttempted(true);\n setStopped(null);\n setResult(createEmptyEnsureRoundAggregate());\n\n const execution = await executeSequentialCandidateChunks({\n items: selectedIds,\n initialAggregate: createEmptyEnsureRoundAggregate(),\n onProgress: setProgress,\n executeChunk: async (applicationIds) => {\n const response = await executeNoRetryMutation<\n BulkEnsureInterviewRoundsMutation,\n BulkEnsureInterviewRoundsMutationVariables\n >(\n BulkEnsureInterviewRoundsDocument,\n {\n input: {\n jobPostingId,\n roundConfigId: selectedConfig.id,\n applicationIds: [...applicationIds],\n },\n },\n 'BulkEnsureInterviewRounds'\n );\n const bulkResult = response.bulkEnsureInterviewRounds;\n if (!bulkResult) {\n throw new Error('The add-to-round request returned no result.');\n }\n const chunkResult: EnsureRoundAggregate = {\n created: bulkResult.created.map((item) => ({\n id: item.round.id,\n applicationId: item.applicationId,\n })),\n alreadyPresent: bulkResult.alreadyPresent.map((item) => ({\n id: item.round.id,\n applicationId: item.applicationId,\n })),\n failed: bulkResult.failed.map((item: EnsureRoundFailure) => ({\n applicationId: item.applicationId,\n code: item.code,\n message: item.message,\n })),\n };\n assertCompleteEnsureRoundChunkResult(applicationIds, chunkResult);\n return chunkResult;\n },\n mergeResult: aggregateEnsureRoundResult,\n });\n\n setResult(execution.aggregate);\n if (execution.error) {\n setStopped({\n knownCompleted: execution.processedItems.length,\n ambiguous: execution.ambiguousItems.length,\n notStarted: execution.notStartedItems.length,\n message: errorMessage(execution.error),\n });\n }\n nativeNotify(\n getBulkOperationNotificationSeverity({\n succeeded: execution.aggregate.created.length + execution.aggregate.alreadyPresent.length,\n skipped: 0,\n failed: execution.aggregate.failed.length,\n ambiguous: !!execution.error,\n })\n );\n setSubmitting(false);\n\n void client\n .refetchQueries({\n include: ['GetJobApplications', 'GetJobApplicationInterviewRounds'],\n })\n .catch(() => undefined);\n };\n\n const previewBusy = previewLoading || postingLoading;\n\n return (\n <Dialog\n open={open}\n onOpenChange={(next) => {\n if (!next && !submitting) onClose();\n }}\n >\n <DialogContent className=\"sm:max-w-xl max-h-[90vh] overflow-y-auto\">\n <DialogHeader>\n <DialogTitle>Add Selected to Round</DialogTitle>\n <DialogDescription>\n Add every selected candidate in this posting to one configured interview round.\n </DialogDescription>\n </DialogHeader>\n\n <div className=\"rounded-md border border-border-seam bg-bg-sunken/30 p-3 text-sm text-text-secondary\">\n Candidates without this concrete round are added with status Scheduled. Existing target\n rounds are left unchanged, and all prior round history and application status remain\n unchanged.\n </div>\n\n {attempted ? (\n <div className=\"space-y-4\">\n {progress ? <BulkOperationProgress progress={progress} /> : null}\n <EnsureRoundResultDetails result={result} />\n {stopped ? <StoppedBulkOperationNotice details={stopped} /> : null}\n <DialogFooter>\n <Button onClick={onClose} disabled={submitting}>\n Done\n </Button>\n </DialogFooter>\n </div>\n ) : (\n <div className=\"space-y-4\">\n {previewBusy ? (\n <div className=\"flex items-center gap-2 text-sm text-text-secondary\">\n <Loader2 size={14} className=\"animate-spin\" />\n Refreshing candidates and configured rounds…\n </div>\n ) : null}\n\n {effectivePreviewError ? (\n <div className=\"flex items-start gap-2 text-sm text-status-error-text\" role=\"alert\">\n <AlertCircle size={14} className=\"mt-0.5 shrink-0\" />\n <span>{effectivePreviewError}</span>\n </div>\n ) : null}\n\n <div className=\"space-y-1.5\">\n <Label htmlFor=\"ensure-round-config\">Interview round</Label>\n <Select\n value={roundConfigId}\n onValueChange={setRoundConfigId}\n disabled={previewBusy || !!effectivePreviewError}\n >\n <SelectTrigger id=\"ensure-round-config\">\n <SelectValue placeholder=\"Select a round\" />\n </SelectTrigger>\n <SelectContent>\n {roundConfigs.map((round: JobPostingRoundConfig) => (\n <SelectItem key={round.id} value={round.id}>\n Round {round.roundNumber} — {round.name}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n {roundConfigs.length === 0 && !previewBusy && !effectivePreviewError ? (\n <p className=\"text-xs text-status-warning-text\">\n This posting has no configured interview rounds.\n </p>\n ) : null}\n </div>\n\n <p className=\"text-xs text-text-secondary\">\n {intendedSelectionCount} selected candidate{intendedSelectionCount === 1 ? '' : 's'}{' '}\n will be checked. Existing target rounds are reported as already present.\n </p>\n\n <DialogFooter>\n <Button variant=\"outline\" onClick={onClose} disabled={submitting}>\n Cancel\n </Button>\n <Button\n onClick={() => void handleSubmit()}\n disabled={\n submitting ||\n previewBusy ||\n !!effectivePreviewError ||\n !selectionDataComplete ||\n !roundConfigId ||\n selectedIds.length === 0\n }\n >\n {submitting ? (\n <Loader2 size={16} className=\"mr-2 animate-spin\" />\n ) : (\n <UserPlus size={16} />\n )}\n {submitting ? 'Adding…' : 'Add Selected to Round'}\n </Button>\n </DialogFooter>\n </div>\n )}\n </DialogContent>\n </Dialog>\n );\n}\n\n/**\n * Notifies candidates who have more than one application on file (and so may\n * have received more than one take-home assignment email) that they only need\n * to complete ONE. Unlike the other two dialogs, this is NOT scoped to a\n * round — it operates on applicationIds directly and the backend groups by\n * email address, so selecting several duplicate applications for the same\n * person still sends exactly one notice.\n */\nexport function NotifyDuplicateApplicantsDialog({\n open,\n onClose,\n targets,\n selection,\n jobPostingId,\n previewLoading,\n previewError,\n}: SharedDialogProps) {\n const client = useApolloClient();\n const [progress, setProgress] = useState<SequentialExecutionProgress | null>(null);\n const [result, setResult] = useState<DuplicateNoticeAggregate>(\n createEmptyDuplicateNoticeAggregate\n );\n const [stopped, setStopped] = useState<StoppedBulkOperationDetails | null>(null);\n const [attempted, setAttempted] = useState(false);\n const [submitting, setSubmitting] = useState(false);\n\n useEffect(() => {\n if (!open) return;\n setProgress(null);\n setResult(createEmptyDuplicateNoticeAggregate());\n setStopped(null);\n setAttempted(false);\n setSubmitting(false);\n }, [open]);\n\n const actionTargets = useMemo(() => selectedTargets(targets, selection), [selection, targets]);\n const intendedSelectionCount = getCandidateSelectionCount(selection);\n const selectionDataComplete = actionTargets.length === intendedSelectionCount;\n const selectedIds = actionTargets.map((target) => target.id);\n const postingMismatch = actionTargets.some((target) => target.jobPostingId !== jobPostingId);\n\n let effectivePreviewError = previewError;\n if (!effectivePreviewError && !previewLoading && !selectionDataComplete) {\n effectivePreviewError =\n 'Some selected candidate details are unavailable. Refresh the selection before notifying.';\n } else if (!effectivePreviewError && postingMismatch) {\n effectivePreviewError = 'Some selected candidates do not belong to the filtered posting.';\n }\n\n const handleSubmit = async () => {\n if (\n submitting ||\n attempted ||\n previewLoading ||\n effectivePreviewError ||\n !selectionDataComplete ||\n selectedIds.length === 0\n ) {\n return;\n }\n\n setSubmitting(true);\n setAttempted(true);\n setStopped(null);\n setResult(createEmptyDuplicateNoticeAggregate());\n\n const execution = await executeSequentialCandidateChunks({\n items: selectedIds,\n initialAggregate: createEmptyDuplicateNoticeAggregate(),\n onProgress: setProgress,\n executeChunk: async (applicationIds) => {\n const response = await executeNoRetryMutation<\n NotifyDuplicateApplicantsMutation,\n NotifyDuplicateApplicantsMutationVariables\n >(\n NotifyDuplicateApplicantsDocument,\n { input: { applicationIds: [...applicationIds] } },\n 'NotifyDuplicateApplicants'\n );\n const bulkResult = response.notifyDuplicateApplicants;\n if (!bulkResult) {\n throw new Error('The duplicate-notice request returned no result.');\n }\n const chunkResult: DuplicateNoticeAggregate = {\n succeeded: bulkResult.succeeded.map((item) => ({ email: item.email })),\n skipped: bulkResult.skipped.map((item) => ({\n email: item.email,\n reason: item.reason,\n message: item.message,\n })),\n failed: bulkResult.failed.map((item) => ({ email: item.email, message: item.message })),\n };\n // No completeness assertion here (unlike the other dialogs): the\n // backend groups by email, so N selected applications can legitimately\n // collapse into fewer result rows — that's the whole point.\n return chunkResult;\n },\n mergeResult: aggregateDuplicateNoticeResult,\n });\n\n setResult(execution.aggregate);\n if (execution.error) {\n setStopped({\n knownCompleted: execution.processedItems.length,\n ambiguous: execution.ambiguousItems.length,\n notStarted: execution.notStartedItems.length,\n message: errorMessage(execution.error),\n });\n }\n nativeNotify(\n getBulkOperationNotificationSeverity({\n succeeded: execution.aggregate.succeeded.length,\n skipped: execution.aggregate.skipped.length,\n failed: execution.aggregate.failed.length,\n ambiguous: !!execution.error,\n })\n );\n setSubmitting(false);\n\n void client.refetchQueries({ include: ['GetJobApplications'] }).catch(() => undefined);\n };\n\n return (\n <Dialog\n open={open}\n onOpenChange={(next) => {\n if (!next && !submitting) onClose();\n }}\n >\n <DialogContent className=\"sm:max-w-xl max-h-[90vh] overflow-y-auto\">\n <DialogHeader>\n <DialogTitle>Notify Duplicate Applicants</DialogTitle>\n <DialogDescription>\n Let candidates with more than one application know they only need to complete one\n take-home assignment.\n </DialogDescription>\n </DialogHeader>\n\n <div className=\"rounded-md border border-border-seam bg-bg-sunken/30 p-3 text-sm text-text-secondary\">\n Selected applications are grouped by email address — exactly one notice goes out per\n unique candidate, even if you select several of their duplicate applications. An email\n that only appears once among your selection is skipped (it isn't a duplicate), and an\n email already notified before is skipped automatically.\n </div>\n\n {attempted ? (\n <div className=\"space-y-4\">\n {progress ? <BulkOperationProgress progress={progress} /> : null}\n <DuplicateNoticeResultDetails result={result} />\n {stopped ? <StoppedBulkOperationNotice details={stopped} /> : null}\n <DialogFooter>\n <Button onClick={onClose} disabled={submitting}>\n Done\n </Button>\n </DialogFooter>\n </div>\n ) : (\n <div className=\"space-y-4\">\n {previewLoading ? (\n <div className=\"flex items-center gap-2 text-sm text-text-secondary\">\n <Loader2 size={14} className=\"animate-spin\" />\n Refreshing candidates…\n </div>\n ) : null}\n\n {effectivePreviewError ? (\n <div className=\"flex items-start gap-2 text-sm text-status-error-text\" role=\"alert\">\n <AlertCircle size={14} className=\"mt-0.5 shrink-0\" />\n <span>{effectivePreviewError}</span>\n </div>\n ) : null}\n\n <p className=\"text-xs text-text-secondary\">\n {intendedSelectionCount} selected application{intendedSelectionCount === 1 ? '' : 's'}{' '}\n will be checked and grouped by email.\n </p>\n\n <DialogFooter>\n <Button variant=\"outline\" onClick={onClose} disabled={submitting}>\n Cancel\n </Button>\n <Button\n onClick={() => void handleSubmit()}\n disabled={\n submitting ||\n previewLoading ||\n !!effectivePreviewError ||\n !selectionDataComplete ||\n selectedIds.length === 0\n }\n >\n {submitting ? (\n <Loader2 size={16} className=\"mr-2 animate-spin\" />\n ) : (\n <Mail size={16} />\n )}\n {submitting ? 'Notifying…' : 'Notify Duplicate Applicants'}\n </Button>\n </DialogFooter>\n </div>\n )}\n </DialogContent>\n </Dialog>\n );\n}\n\nexport function BulkCustomEmailDialog({\n open,\n onClose,\n targets,\n selection,\n previewLoading,\n previewError,\n}: SharedDialogProps) {\n const client = useApolloClient();\n const [subject, setSubject] = useState('');\n const [message, setMessage] = useState('');\n const [progress, setProgress] = useState<SequentialExecutionProgress | null>(null);\n const [result, setResult] = useState<BulkCustomEmailAggregate>(\n createEmptyBulkCustomEmailAggregate\n );\n const [stopped, setStopped] = useState<StoppedBulkOperationDetails | null>(null);\n const [attempted, setAttempted] = useState(false);\n const [submitting, setSubmitting] = useState(false);\n\n useEffect(() => {\n if (!open) return;\n setSubject('');\n setMessage('');\n setProgress(null);\n setResult(createEmptyBulkCustomEmailAggregate());\n setStopped(null);\n setAttempted(false);\n setSubmitting(false);\n }, [open]);\n\n const actionTargets = useMemo(() => selectedTargets(targets, selection), [selection, targets]);\n const intendedSelectionCount = getCandidateSelectionCount(selection);\n const selectionDataComplete = actionTargets.length === intendedSelectionCount;\n const selectedIds = actionTargets.map((target) => target.id);\n const hasSubject = subject.trim().length > 0;\n const hasMessage = message.trim().length > 0;\n\n let effectivePreviewError = previewError;\n if (!effectivePreviewError && !previewLoading && !selectionDataComplete) {\n effectivePreviewError =\n 'Some selected candidate details are unavailable. Refresh the selection before sending.';\n }\n\n const canSubmit =\n !submitting &&\n !attempted &&\n !previewLoading &&\n !effectivePreviewError &&\n selectionDataComplete &&\n selectedIds.length > 0 &&\n hasSubject &&\n hasMessage;\n\n const handleSubmit = async () => {\n if (!canSubmit) return;\n\n setSubmitting(true);\n setAttempted(true);\n setStopped(null);\n setResult(createEmptyBulkCustomEmailAggregate());\n\n const execution = await executeSequentialCandidateChunks({\n items: selectedIds,\n initialAggregate: createEmptyBulkCustomEmailAggregate(),\n onProgress: setProgress,\n executeChunk: async (applicationIds) => {\n const response = await executeNoRetryMutation<\n BulkSendCustomEmailMutation,\n BulkSendCustomEmailMutationVariables\n >(\n BulkSendCustomEmailDocument,\n { input: { applicationIds: [...applicationIds], subject: subject.trim(), message } },\n 'BulkSendCustomEmail'\n );\n const bulkResult = response.bulkSendCustomEmail;\n if (!bulkResult) {\n throw new Error('The bulk email request returned no result.');\n }\n const chunkResult: BulkCustomEmailAggregate = {\n succeeded: bulkResult.succeeded.map((item) => ({\n applicationId: item.id,\n email: item.email,\n })),\n failed: bulkResult.failed.map((item) => ({\n applicationId: item.applicationId,\n message: item.message,\n })),\n };\n assertCompleteBulkCustomEmailChunkResult([...applicationIds], chunkResult);\n return chunkResult;\n },\n mergeResult: aggregateBulkCustomEmailResult,\n });\n\n setResult(execution.aggregate);\n if (execution.error) {\n setStopped({\n knownCompleted: execution.processedItems.length,\n ambiguous: execution.ambiguousItems.length,\n notStarted: execution.notStartedItems.length,\n message: errorMessage(execution.error),\n });\n }\n nativeNotify(\n getBulkOperationNotificationSeverity({\n succeeded: execution.aggregate.succeeded.length,\n skipped: 0,\n failed: execution.aggregate.failed.length,\n ambiguous: !!execution.error,\n })\n );\n setSubmitting(false);\n\n void client.refetchQueries({ include: ['GetJobApplications'] }).catch(() => undefined);\n };\n\n return (\n <Dialog\n open={open}\n onOpenChange={(next) => {\n if (!next && !submitting) onClose();\n }}\n >\n <DialogContent className=\"sm:max-w-xl max-h-[90vh] overflow-y-auto\">\n <DialogHeader>\n <DialogTitle>Send Custom Email</DialogTitle>\n <DialogDescription>\n Send the same branded email — your own subject and message — to every selected\n candidate, regardless of their stage or round. Useful for progress updates or a closing\n note to candidates who won't move forward.\n </DialogDescription>\n </DialogHeader>\n\n {attempted ? (\n <div className=\"space-y-4\">\n {progress ? <BulkOperationProgress progress={progress} /> : null}\n <BulkCustomEmailResultDetails result={result} />\n {stopped ? <StoppedBulkOperationNotice details={stopped} /> : null}\n <DialogFooter>\n <Button onClick={onClose} disabled={submitting}>\n Done\n </Button>\n </DialogFooter>\n </div>\n ) : (\n <div className=\"space-y-4\">\n {previewLoading ? (\n <div className=\"flex items-center gap-2 text-sm text-text-secondary\">\n <Loader2 size={14} className=\"animate-spin\" />\n Refreshing candidates…\n </div>\n ) : null}\n\n {effectivePreviewError ? (\n <div className=\"flex items-start gap-2 text-sm text-status-error-text\" role=\"alert\">\n <AlertCircle size={14} className=\"mt-0.5 shrink-0\" />\n <span>{effectivePreviewError}</span>\n </div>\n ) : null}\n\n <div>\n <Label htmlFor=\"bulk-custom-email-subject\">Subject</Label>\n <input\n id=\"bulk-custom-email-subject\"\n type=\"text\"\n value={subject}\n onChange={(e) => setSubject(e.target.value)}\n placeholder=\"e.g. An update on your application\"\n className=\"mt-1.5 w-full rounded-lg border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-primary/30\"\n />\n </div>\n\n <div>\n <Label htmlFor=\"bulk-custom-email-message\">Message</Label>\n <div className=\"mt-1.5\">\n <RichTextEditor\n id=\"bulk-custom-email-message\"\n value={message}\n onChange={setMessage}\n placeholder=\"Type your message… This will be sent as a branded email to every selected candidate.\"\n aria-required\n />\n </div>\n </div>\n\n <p className=\"text-xs text-text-secondary\">\n {intendedSelectionCount} selected candidate{intendedSelectionCount === 1 ? '' : 's'}{' '}\n will each receive their own copy of this email.\n </p>\n\n <DialogFooter>\n <Button variant=\"outline\" onClick={onClose} disabled={submitting}>\n Cancel\n </Button>\n <Button onClick={() => void handleSubmit()} disabled={!canSubmit}>\n {submitting ? (\n <Loader2 size={16} className=\"mr-2 animate-spin\" />\n ) : (\n <Mail size={16} />\n )}\n {submitting ? 'Sending…' : 'Send Email'}\n </Button>\n </DialogFooter>\n </div>\n )}\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAuFA,SAAgB,GAAwB,GAAuC;CAC7E,OAAO,EAAM,qBAAqB,EAAM,cAAc,EAAmB;AAC3E;AAEA,IAAM,KAA4D;CAChE,SAAS;CACT,YAAY;AACd;AAYA,SAAS,GAAa,GAAwB;CAC5C,OAAO,aAAiB,QAAQ,EAAM,UAAU;AAClD;AAEA,eAAe,EACb,GACA,GACA,GACgB;CAChB,IAAM,IAAW,MAAM,EAA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,CAAA,GACzD,kBAAC,SAAD;MACE,IAAG;MACH,MAAK;MACL,OAAO;MACP,WAAW,MAAM,EAAW,EAAE,OAAO,KAAK;MAC1C,aAAY;MACZ,WAAU;KACX,CAAA,CACE,EAAA,CAAA;KAEL,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,GAAD;MAAO,SAAQ;MAA4B,UAAA;KAAc,CAAA,GACzD,kBAAC,OAAD;MAAK,WAAU;MACb,UAAA,kBAAC,GAAD;OACE,IAAG;OACH,OAAO;OACP,UAAU;OACV,aAAY;OACZ,iBAAA;MACD,CAAA;KACE,CAAA,CACF,EAAA,CAAA;KAEL,kBAAC,KAAD;MAAG,WAAU;MAAb,UAAA;OACG;OAAuB;OAAoB,MAA2B,IAAI,KAAK;OAAK;OAAI;MAExF;;KAEH,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD;MAAQ,SAAQ;MAAU,SAAS;MAAS,UAAU;MAAY,UAAA;KAE1D,CAAA,GACR,kBAAC,GAAD;MAAQ,eAAe,KAAK,GAAa;MAAG,UAAU,CAAC;MAAvD,UAAA,CACG,IACC,kBAAC,GAAD;OAAS,MAAM;OAAI,WAAU;MAAqB,CAAA,IAElD,kBAAC,GAAD,EAAM,MAAM,GAAK,CAAA,GAElB,IAAa,aAAa,YACrB;KACI,CAAA,CAAA,EAAA,CAAA;IACX;GAEM,CAAA,CAAA;;CACT,CAAA;AAEZ"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CandidateEmailAggregate, DuplicateNoticeAggregate, EnsureRoundAggregate, SequentialExecutionProgress } from '../../utils/bulkCandidateOperations';
|
|
1
|
+
import type { BulkCustomEmailAggregate, CandidateEmailAggregate, DuplicateNoticeAggregate, EnsureRoundAggregate, SequentialExecutionProgress } from '../../utils/bulkCandidateOperations';
|
|
2
2
|
interface BulkOperationProgressProps {
|
|
3
3
|
progress: SequentialExecutionProgress;
|
|
4
4
|
}
|
|
@@ -18,6 +18,9 @@ export declare function CandidateEmailResultDetails({ result }: {
|
|
|
18
18
|
export declare function EnsureRoundResultDetails({ result }: {
|
|
19
19
|
result: EnsureRoundAggregate;
|
|
20
20
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
21
|
+
export declare function BulkCustomEmailResultDetails({ result }: {
|
|
22
|
+
result: BulkCustomEmailAggregate;
|
|
23
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
21
24
|
export declare function DuplicateNoticeResultDetails({ result }: {
|
|
22
25
|
result: DuplicateNoticeAggregate;
|
|
23
26
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -189,6 +189,54 @@ function a({ result: n }) {
|
|
|
189
189
|
}) : null;
|
|
190
190
|
}
|
|
191
191
|
function o({ result: n }) {
|
|
192
|
+
return n.succeeded.length > 0 || n.failed.length > 0 ? /* @__PURE__ */ t("div", {
|
|
193
|
+
className: "space-y-3 text-sm",
|
|
194
|
+
children: [
|
|
195
|
+
/* @__PURE__ */ t("p", {
|
|
196
|
+
className: "font-medium text-text-primary",
|
|
197
|
+
children: [
|
|
198
|
+
n.succeeded.length,
|
|
199
|
+
" sent, ",
|
|
200
|
+
n.failed.length,
|
|
201
|
+
" failed"
|
|
202
|
+
]
|
|
203
|
+
}),
|
|
204
|
+
n.succeeded.length > 0 ? /* @__PURE__ */ t("details", {
|
|
205
|
+
className: "text-text-secondary",
|
|
206
|
+
children: [/* @__PURE__ */ t("summary", {
|
|
207
|
+
className: "cursor-pointer font-medium text-text-primary",
|
|
208
|
+
children: [
|
|
209
|
+
"Sent (",
|
|
210
|
+
n.succeeded.length,
|
|
211
|
+
")"
|
|
212
|
+
]
|
|
213
|
+
}), /* @__PURE__ */ e("ul", {
|
|
214
|
+
className: "mt-1 list-disc space-y-1 pl-5",
|
|
215
|
+
children: n.succeeded.map((t, n) => /* @__PURE__ */ e("li", { children: t.email }, `${t.applicationId}-${n}`))
|
|
216
|
+
})]
|
|
217
|
+
}) : null,
|
|
218
|
+
n.failed.length > 0 ? /* @__PURE__ */ t("section", {
|
|
219
|
+
"aria-label": "Applications that failed to receive the email",
|
|
220
|
+
className: "space-y-1",
|
|
221
|
+
children: [/* @__PURE__ */ e("h4", {
|
|
222
|
+
className: "font-semibold text-status-error-text",
|
|
223
|
+
children: "Failed"
|
|
224
|
+
}), /* @__PURE__ */ e("ul", {
|
|
225
|
+
className: "list-disc space-y-1 pl-5 text-status-error-text",
|
|
226
|
+
children: n.failed.map((n, r) => /* @__PURE__ */ t("li", { children: [
|
|
227
|
+
/* @__PURE__ */ e("span", {
|
|
228
|
+
className: "font-medium",
|
|
229
|
+
children: n.applicationId
|
|
230
|
+
}),
|
|
231
|
+
": ",
|
|
232
|
+
n.message
|
|
233
|
+
] }, `${n.applicationId}-${r}`))
|
|
234
|
+
})]
|
|
235
|
+
}) : null
|
|
236
|
+
]
|
|
237
|
+
}) : null;
|
|
238
|
+
}
|
|
239
|
+
function s({ result: n }) {
|
|
192
240
|
return n.succeeded.length > 0 || n.skipped.length > 0 || n.failed.length > 0 ? /* @__PURE__ */ t("div", {
|
|
193
241
|
className: "space-y-3 text-sm",
|
|
194
242
|
children: [
|
|
@@ -263,6 +311,6 @@ function o({ result: n }) {
|
|
|
263
311
|
}) : null;
|
|
264
312
|
}
|
|
265
313
|
//#endregion
|
|
266
|
-
export { n as BulkOperationProgress, i as CandidateEmailResultDetails,
|
|
314
|
+
export { o as BulkCustomEmailResultDetails, n as BulkOperationProgress, i as CandidateEmailResultDetails, s as DuplicateNoticeResultDetails, a as EnsureRoundResultDetails, r as StoppedBulkOperationNotice };
|
|
267
315
|
|
|
268
316
|
//# sourceMappingURL=BulkOperationFeedback.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BulkOperationFeedback.js","names":[],"sources":["../../../../src/support/components/careers/BulkOperationFeedback.tsx"],"sourcesContent":["import type {\n CandidateEmailAggregate,\n DuplicateNoticeAggregate,\n EnsureRoundAggregate,\n SequentialExecutionProgress,\n} from '../../utils/bulkCandidateOperations';\n\ninterface BulkOperationProgressProps {\n progress: SequentialExecutionProgress;\n}\n\nexport function BulkOperationProgress({ progress }: BulkOperationProgressProps) {\n return (\n <div aria-live=\"polite\" className=\"space-y-2\">\n <p className=\"text-sm font-medium text-text-primary\">\n Processed {progress.processed} of {progress.total}\n </p>\n <div\n aria-label={`Processed ${progress.processed} of ${progress.total}`}\n aria-valuemax={progress.total}\n aria-valuemin={0}\n aria-valuenow={progress.processed}\n className=\"h-2 overflow-hidden rounded-full bg-bg-sunken\"\n role=\"progressbar\"\n >\n <div\n className=\"h-full bg-accent-primary transition-[width]\"\n style={{\n width:\n progress.total === 0\n ? '0%'\n : `${Math.round((progress.processed / progress.total) * 100)}%`,\n }}\n />\n </div>\n </div>\n );\n}\n\nexport interface StoppedBulkOperationDetails {\n knownCompleted: number;\n ambiguous: number;\n notStarted: number;\n message: string;\n}\n\nexport function StoppedBulkOperationNotice({ details }: { details: StoppedBulkOperationDetails }) {\n return (\n <div\n className=\"space-y-1 rounded-md border border-status-error-border bg-status-error-bg-subtle p-3 text-sm text-status-error-text\"\n role=\"alert\"\n >\n <p className=\"font-semibold\">\n {details.ambiguous > 0\n ? 'The operation stopped after an ambiguous request failure.'\n : 'The operation stopped before the next request because candidate scope validation failed.'}\n </p>\n <p>{details.message}</p>\n <ul className=\"list-disc space-y-1 pl-5\">\n <li>Known completed: {details.knownCompleted}</li>\n {details.ambiguous > 0 ? (\n <li>Current batch with unknown outcome: {details.ambiguous}</li>\n ) : null}\n <li>Not started: {details.notStarted}</li>\n </ul>\n <p>\n No request was retried automatically. Close this dialog and start a new preview before a\n manual retry.\n </p>\n </div>\n );\n}\n\nexport function CandidateEmailResultDetails({ result }: { result: CandidateEmailAggregate }) {\n const hasResult =\n result.succeeded.length > 0 || result.skipped.length > 0 || result.failed.length > 0;\n if (!hasResult) return null;\n\n return (\n <div className=\"space-y-3 text-sm\">\n <p className=\"font-medium text-text-primary\">\n {result.succeeded.length} succeeded, {result.skipped.length} skipped, {result.failed.length}{' '}\n failed\n </p>\n\n {result.succeeded.length > 0 ? (\n <details className=\"text-text-secondary\">\n <summary className=\"cursor-pointer font-medium text-text-primary\">\n Succeeded ({result.succeeded.length})\n </summary>\n <ul className=\"mt-1 list-disc space-y-1 pl-5\">\n {result.succeeded.map((item, index) => (\n <li key={`${item.applicationId}-${index}`}>{item.applicationId}</li>\n ))}\n </ul>\n </details>\n ) : null}\n\n {result.skipped.length > 0 ? (\n <section aria-label=\"Skipped candidates\" className=\"space-y-1\">\n <h4 className=\"font-semibold text-text-primary\">Skipped</h4>\n <ul className=\"list-disc space-y-1 pl-5 text-text-secondary\">\n {result.skipped.map((item, index) => (\n <li key={`${item.applicationId}-${item.roundId}-${index}`}>\n <span className=\"font-medium\">{item.applicationId}</span>: {item.reason} —{' '}\n {item.message}\n </li>\n ))}\n </ul>\n </section>\n ) : null}\n\n {result.failed.length > 0 ? (\n <section aria-label=\"Failed candidates\" className=\"space-y-1\">\n <h4 className=\"font-semibold text-status-error-text\">Failed</h4>\n <ul className=\"list-disc space-y-1 pl-5 text-status-error-text\">\n {result.failed.map((item, index) => (\n <li key={`${item.applicationId}-${item.roundId}-${index}`}>\n <span className=\"font-medium\">{item.applicationId}</span>: {item.message}\n </li>\n ))}\n </ul>\n </section>\n ) : null}\n </div>\n );\n}\n\nexport function EnsureRoundResultDetails({ result }: { result: EnsureRoundAggregate }) {\n const hasResult =\n result.created.length > 0 || result.alreadyPresent.length > 0 || result.failed.length > 0;\n if (!hasResult) return null;\n\n return (\n <div className=\"space-y-3 text-sm\">\n <p className=\"font-medium text-text-primary\">\n {result.created.length} created, {result.alreadyPresent.length} already present,{' '}\n {result.failed.length} failed\n </p>\n\n {result.created.length > 0 ? (\n <details className=\"text-text-secondary\">\n <summary className=\"cursor-pointer font-medium text-text-primary\">\n Created ({result.created.length})\n </summary>\n <ul className=\"mt-1 list-disc space-y-1 pl-5\">\n {result.created.map((item) => (\n <li key={item.id}>{item.applicationId}</li>\n ))}\n </ul>\n </details>\n ) : null}\n\n {result.alreadyPresent.length > 0 ? (\n <details className=\"text-text-secondary\">\n <summary className=\"cursor-pointer font-medium text-text-primary\">\n Already present ({result.alreadyPresent.length})\n </summary>\n <ul className=\"mt-1 list-disc space-y-1 pl-5\">\n {result.alreadyPresent.map((item) => (\n <li key={item.id}>{item.applicationId}</li>\n ))}\n </ul>\n </details>\n ) : null}\n\n {result.failed.length > 0 ? (\n <section aria-label=\"Candidates not added to round\" className=\"space-y-1\">\n <h4 className=\"font-semibold text-status-error-text\">Failed</h4>\n <ul className=\"list-disc space-y-1 pl-5 text-status-error-text\">\n {result.failed.map((item, index) => (\n <li key={`${item.applicationId}-${item.code}-${index}`}>\n <span className=\"font-medium\">{item.applicationId}</span>: {item.code} —{' '}\n {item.message}\n </li>\n ))}\n </ul>\n </section>\n ) : null}\n </div>\n );\n}\n\nexport function DuplicateNoticeResultDetails({ result }: { result: DuplicateNoticeAggregate }) {\n const hasResult =\n result.succeeded.length > 0 || result.skipped.length > 0 || result.failed.length > 0;\n if (!hasResult) return null;\n\n return (\n <div className=\"space-y-3 text-sm\">\n <p className=\"font-medium text-text-primary\">\n {result.succeeded.length} notified, {result.skipped.length} skipped, {result.failed.length}{' '}\n failed\n </p>\n\n {result.succeeded.length > 0 ? (\n <details className=\"text-text-secondary\">\n <summary className=\"cursor-pointer font-medium text-text-primary\">\n Notified ({result.succeeded.length})\n </summary>\n <ul className=\"mt-1 list-disc space-y-1 pl-5\">\n {result.succeeded.map((item, index) => (\n <li key={`${item.email}-${index}`}>{item.email}</li>\n ))}\n </ul>\n </details>\n ) : null}\n\n {result.skipped.length > 0 ? (\n <details className=\"text-text-secondary\">\n <summary className=\"cursor-pointer font-medium text-text-primary\">\n Skipped ({result.skipped.length})\n </summary>\n <ul className=\"mt-1 list-disc space-y-1 pl-5\">\n {result.skipped.map((item, index) => (\n <li key={`${item.email}-${index}`}>\n <span className=\"font-medium\">{item.email}</span>: {item.reason} — {item.message}\n </li>\n ))}\n </ul>\n </details>\n ) : null}\n\n {result.failed.length > 0 ? (\n <section aria-label=\"Candidate emails that failed to notify\" className=\"space-y-1\">\n <h4 className=\"font-semibold text-status-error-text\">Failed</h4>\n <ul className=\"list-disc space-y-1 pl-5 text-status-error-text\">\n {result.failed.map((item, index) => (\n <li key={`${item.email}-${index}`}>\n <span className=\"font-medium\">{item.email}</span>: {item.message}\n </li>\n ))}\n </ul>\n </section>\n ) : null}\n </div>\n );\n}\n"],"mappings":";;AAWA,SAAgB,EAAsB,EAAE,eAAwC;CAC9E,OACE,kBAAC,OAAD;EAAK,aAAU;EAAS,WAAU;EAAlC,UAAA,CACE,kBAAC,KAAD;GAAG,WAAU;GAAb,UAAA;IAAqD;IACxC,EAAS;IAAU;IAAK,EAAS;GAC3C;EACH,CAAA,GAAA,kBAAC,OAAD;GACE,cAAY,aAAa,EAAS,UAAU,MAAM,EAAS;GAC3D,iBAAe,EAAS;GACxB,iBAAe;GACf,iBAAe,EAAS;GACxB,WAAU;GACV,MAAK;GAEL,UAAA,kBAAC,OAAD;IACE,WAAU;IACV,OAAO,EACL,OACE,EAAS,UAAU,IACf,OACA,GAAG,KAAK,MAAO,EAAS,YAAY,EAAS,QAAS,GAAG,EAAE,GACnE;GACD,CAAA;EACE,CAAA,CACF;;AAET;AASA,SAAgB,EAA2B,EAAE,cAAqD;CAChG,OACE,kBAAC,OAAD;EACE,WAAU;EACV,MAAK;EAFP,UAAA;GAIE,kBAAC,KAAD;IAAG,WAAU;IACV,UAAA,EAAQ,YAAY,IACjB,8DACA;GACH,CAAA;GACH,kBAAC,KAAD,EAAA,UAAI,EAAQ,QAAW,CAAA;GACvB,kBAAC,MAAD;IAAI,WAAU;IAAd,UAAA;KACE,kBAAC,MAAD,EAAA,UAAA,CAAI,qBAAkB,EAAQ,cAAmB,EAAA,CAAA;KAChD,EAAQ,YAAY,IACnB,kBAAC,MAAD,EAAA,UAAA,CAAI,wCAAqC,EAAQ,SAAc,EAAA,CAAA,IAC7D;KACJ,kBAAC,MAAD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GAEH,EAAO,QAAQ,SAAS,IACvB,kBAAC,WAAD;IAAS,WAAU;IAAnB,UAAA,CACE,kBAAC,WAAD;KAAS,WAAU;KAAnB,UAAA;MAAkE;MACtD,EAAO,QAAQ;MAAO;KACzB;IACT,CAAA,GAAA,kBAAC,MAAD;KAAI,WAAU;KACX,UAAA,EAAO,QAAQ,KAAK,GAAM,MACzB,kBAAC,MAAD,EAAA,UAAA;MACE,kBAAC,QAAD;OAAM,WAAU;OAAe,UAAA,EAAK;MAAY,CAAA;MAAC;MAAG,EAAK;MAAO;MAAI,EAAK;KACvE,EAAA,GAFK,GAAG,EAAK,MAAM,GAAG,GAEtB,CACL;IACC,CAAA,CACG;GACP,CAAA,IAAA;GAEH,EAAO,OAAO,SAAS,IACtB,kBAAC,WAAD;IAAS,cAAW;IAAyC,WAAU;IAAvE,UAAA,CACE,kBAAC,MAAD;KAAI,WAAU;KAAuC,UAAA;IAAU,CAAA,GAC/D,kBAAC,MAAD;KAAI,WAAU;KACX,UAAA,EAAO,OAAO,KAAK,GAAM,MACxB,kBAAC,MAAD,EAAA,UAAA;MACE,kBAAC,QAAD;OAAM,WAAU;OAAe,UAAA,EAAK;MAAY,CAAA;MAAC;MAAG,EAAK;KACvD,EAAA,GAFK,GAAG,EAAK,MAAM,GAAG,GAEtB,CACL;IACC,CAAA,CACG;GACP,CAAA,IAAA;EACD;MAjDgB;AAmDzB"}
|
|
1
|
+
{"version":3,"file":"BulkOperationFeedback.js","names":[],"sources":["../../../../src/support/components/careers/BulkOperationFeedback.tsx"],"sourcesContent":["import type {\n BulkCustomEmailAggregate,\n CandidateEmailAggregate,\n DuplicateNoticeAggregate,\n EnsureRoundAggregate,\n SequentialExecutionProgress,\n} from '../../utils/bulkCandidateOperations';\n\ninterface BulkOperationProgressProps {\n progress: SequentialExecutionProgress;\n}\n\nexport function BulkOperationProgress({ progress }: BulkOperationProgressProps) {\n return (\n <div aria-live=\"polite\" className=\"space-y-2\">\n <p className=\"text-sm font-medium text-text-primary\">\n Processed {progress.processed} of {progress.total}\n </p>\n <div\n aria-label={`Processed ${progress.processed} of ${progress.total}`}\n aria-valuemax={progress.total}\n aria-valuemin={0}\n aria-valuenow={progress.processed}\n className=\"h-2 overflow-hidden rounded-full bg-bg-sunken\"\n role=\"progressbar\"\n >\n <div\n className=\"h-full bg-accent-primary transition-[width]\"\n style={{\n width:\n progress.total === 0\n ? '0%'\n : `${Math.round((progress.processed / progress.total) * 100)}%`,\n }}\n />\n </div>\n </div>\n );\n}\n\nexport interface StoppedBulkOperationDetails {\n knownCompleted: number;\n ambiguous: number;\n notStarted: number;\n message: string;\n}\n\nexport function StoppedBulkOperationNotice({ details }: { details: StoppedBulkOperationDetails }) {\n return (\n <div\n className=\"space-y-1 rounded-md border border-status-error-border bg-status-error-bg-subtle p-3 text-sm text-status-error-text\"\n role=\"alert\"\n >\n <p className=\"font-semibold\">\n {details.ambiguous > 0\n ? 'The operation stopped after an ambiguous request failure.'\n : 'The operation stopped before the next request because candidate scope validation failed.'}\n </p>\n <p>{details.message}</p>\n <ul className=\"list-disc space-y-1 pl-5\">\n <li>Known completed: {details.knownCompleted}</li>\n {details.ambiguous > 0 ? (\n <li>Current batch with unknown outcome: {details.ambiguous}</li>\n ) : null}\n <li>Not started: {details.notStarted}</li>\n </ul>\n <p>\n No request was retried automatically. Close this dialog and start a new preview before a\n manual retry.\n </p>\n </div>\n );\n}\n\nexport function CandidateEmailResultDetails({ result }: { result: CandidateEmailAggregate }) {\n const hasResult =\n result.succeeded.length > 0 || result.skipped.length > 0 || result.failed.length > 0;\n if (!hasResult) return null;\n\n return (\n <div className=\"space-y-3 text-sm\">\n <p className=\"font-medium text-text-primary\">\n {result.succeeded.length} succeeded, {result.skipped.length} skipped, {result.failed.length}{' '}\n failed\n </p>\n\n {result.succeeded.length > 0 ? (\n <details className=\"text-text-secondary\">\n <summary className=\"cursor-pointer font-medium text-text-primary\">\n Succeeded ({result.succeeded.length})\n </summary>\n <ul className=\"mt-1 list-disc space-y-1 pl-5\">\n {result.succeeded.map((item, index) => (\n <li key={`${item.applicationId}-${index}`}>{item.applicationId}</li>\n ))}\n </ul>\n </details>\n ) : null}\n\n {result.skipped.length > 0 ? (\n <section aria-label=\"Skipped candidates\" className=\"space-y-1\">\n <h4 className=\"font-semibold text-text-primary\">Skipped</h4>\n <ul className=\"list-disc space-y-1 pl-5 text-text-secondary\">\n {result.skipped.map((item, index) => (\n <li key={`${item.applicationId}-${item.roundId}-${index}`}>\n <span className=\"font-medium\">{item.applicationId}</span>: {item.reason} —{' '}\n {item.message}\n </li>\n ))}\n </ul>\n </section>\n ) : null}\n\n {result.failed.length > 0 ? (\n <section aria-label=\"Failed candidates\" className=\"space-y-1\">\n <h4 className=\"font-semibold text-status-error-text\">Failed</h4>\n <ul className=\"list-disc space-y-1 pl-5 text-status-error-text\">\n {result.failed.map((item, index) => (\n <li key={`${item.applicationId}-${item.roundId}-${index}`}>\n <span className=\"font-medium\">{item.applicationId}</span>: {item.message}\n </li>\n ))}\n </ul>\n </section>\n ) : null}\n </div>\n );\n}\n\nexport function EnsureRoundResultDetails({ result }: { result: EnsureRoundAggregate }) {\n const hasResult =\n result.created.length > 0 || result.alreadyPresent.length > 0 || result.failed.length > 0;\n if (!hasResult) return null;\n\n return (\n <div className=\"space-y-3 text-sm\">\n <p className=\"font-medium text-text-primary\">\n {result.created.length} created, {result.alreadyPresent.length} already present,{' '}\n {result.failed.length} failed\n </p>\n\n {result.created.length > 0 ? (\n <details className=\"text-text-secondary\">\n <summary className=\"cursor-pointer font-medium text-text-primary\">\n Created ({result.created.length})\n </summary>\n <ul className=\"mt-1 list-disc space-y-1 pl-5\">\n {result.created.map((item) => (\n <li key={item.id}>{item.applicationId}</li>\n ))}\n </ul>\n </details>\n ) : null}\n\n {result.alreadyPresent.length > 0 ? (\n <details className=\"text-text-secondary\">\n <summary className=\"cursor-pointer font-medium text-text-primary\">\n Already present ({result.alreadyPresent.length})\n </summary>\n <ul className=\"mt-1 list-disc space-y-1 pl-5\">\n {result.alreadyPresent.map((item) => (\n <li key={item.id}>{item.applicationId}</li>\n ))}\n </ul>\n </details>\n ) : null}\n\n {result.failed.length > 0 ? (\n <section aria-label=\"Candidates not added to round\" className=\"space-y-1\">\n <h4 className=\"font-semibold text-status-error-text\">Failed</h4>\n <ul className=\"list-disc space-y-1 pl-5 text-status-error-text\">\n {result.failed.map((item, index) => (\n <li key={`${item.applicationId}-${item.code}-${index}`}>\n <span className=\"font-medium\">{item.applicationId}</span>: {item.code} —{' '}\n {item.message}\n </li>\n ))}\n </ul>\n </section>\n ) : null}\n </div>\n );\n}\n\nexport function BulkCustomEmailResultDetails({ result }: { result: BulkCustomEmailAggregate }) {\n const hasResult = result.succeeded.length > 0 || result.failed.length > 0;\n if (!hasResult) return null;\n\n return (\n <div className=\"space-y-3 text-sm\">\n <p className=\"font-medium text-text-primary\">\n {result.succeeded.length} sent, {result.failed.length} failed\n </p>\n\n {result.succeeded.length > 0 ? (\n <details className=\"text-text-secondary\">\n <summary className=\"cursor-pointer font-medium text-text-primary\">\n Sent ({result.succeeded.length})\n </summary>\n <ul className=\"mt-1 list-disc space-y-1 pl-5\">\n {result.succeeded.map((item, index) => (\n <li key={`${item.applicationId}-${index}`}>{item.email}</li>\n ))}\n </ul>\n </details>\n ) : null}\n\n {result.failed.length > 0 ? (\n <section aria-label=\"Applications that failed to receive the email\" className=\"space-y-1\">\n <h4 className=\"font-semibold text-status-error-text\">Failed</h4>\n <ul className=\"list-disc space-y-1 pl-5 text-status-error-text\">\n {result.failed.map((item, index) => (\n <li key={`${item.applicationId}-${index}`}>\n <span className=\"font-medium\">{item.applicationId}</span>: {item.message}\n </li>\n ))}\n </ul>\n </section>\n ) : null}\n </div>\n );\n}\n\nexport function DuplicateNoticeResultDetails({ result }: { result: DuplicateNoticeAggregate }) {\n const hasResult =\n result.succeeded.length > 0 || result.skipped.length > 0 || result.failed.length > 0;\n if (!hasResult) return null;\n\n return (\n <div className=\"space-y-3 text-sm\">\n <p className=\"font-medium text-text-primary\">\n {result.succeeded.length} notified, {result.skipped.length} skipped, {result.failed.length}{' '}\n failed\n </p>\n\n {result.succeeded.length > 0 ? (\n <details className=\"text-text-secondary\">\n <summary className=\"cursor-pointer font-medium text-text-primary\">\n Notified ({result.succeeded.length})\n </summary>\n <ul className=\"mt-1 list-disc space-y-1 pl-5\">\n {result.succeeded.map((item, index) => (\n <li key={`${item.email}-${index}`}>{item.email}</li>\n ))}\n </ul>\n </details>\n ) : null}\n\n {result.skipped.length > 0 ? (\n <details className=\"text-text-secondary\">\n <summary className=\"cursor-pointer font-medium text-text-primary\">\n Skipped ({result.skipped.length})\n </summary>\n <ul className=\"mt-1 list-disc space-y-1 pl-5\">\n {result.skipped.map((item, index) => (\n <li key={`${item.email}-${index}`}>\n <span className=\"font-medium\">{item.email}</span>: {item.reason} — {item.message}\n </li>\n ))}\n </ul>\n </details>\n ) : null}\n\n {result.failed.length > 0 ? (\n <section aria-label=\"Candidate emails that failed to notify\" className=\"space-y-1\">\n <h4 className=\"font-semibold text-status-error-text\">Failed</h4>\n <ul className=\"list-disc space-y-1 pl-5 text-status-error-text\">\n {result.failed.map((item, index) => (\n <li key={`${item.email}-${index}`}>\n <span className=\"font-medium\">{item.email}</span>: {item.message}\n </li>\n ))}\n </ul>\n </section>\n ) : null}\n </div>\n );\n}\n"],"mappings":";;AAYA,SAAgB,EAAsB,EAAE,eAAwC;CAC9E,OACE,kBAAC,OAAD;EAAK,aAAU;EAAS,WAAU;EAAlC,UAAA,CACE,kBAAC,KAAD;GAAG,WAAU;GAAb,UAAA;IAAqD;IACxC,EAAS;IAAU;IAAK,EAAS;GAC3C;EACH,CAAA,GAAA,kBAAC,OAAD;GACE,cAAY,aAAa,EAAS,UAAU,MAAM,EAAS;GAC3D,iBAAe,EAAS;GACxB,iBAAe;GACf,iBAAe,EAAS;GACxB,WAAU;GACV,MAAK;GAEL,UAAA,kBAAC,OAAD;IACE,WAAU;IACV,OAAO,EACL,OACE,EAAS,UAAU,IAC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