@burdenoff/microfe-support 2026.830.2 → 2026.902.2
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 +85 -0
- package/dist/generated/global-operations.js +154 -127
- package/dist/generated/global-operations.js.map +1 -1
- package/dist/generated/global-types.d.ts +51 -0
- package/dist/generated/global-types.js +1 -1
- package/dist/generated/global-types.js.map +1 -1
- package/dist/support/components/careers/BulkCandidateDialogs.d.ts +2 -0
- package/dist/support/components/careers/BulkCandidateDialogs.js +486 -222
- package/dist/support/components/careers/BulkCandidateDialogs.js.map +1 -1
- package/dist/support/components/careers/BulkOperationFeedback.d.ts +7 -1
- package/dist/support/components/careers/BulkOperationFeedback.js +80 -1
- package/dist/support/components/careers/BulkOperationFeedback.js.map +1 -1
- package/dist/support/constants/pipeline.js +3 -0
- package/dist/support/constants/pipeline.js.map +1 -1
- package/dist/support/pages/JobApplicationsPage.js +543 -509
- package/dist/support/pages/JobApplicationsPage.js.map +1 -1
- package/dist/support/utils/bulkCandidateOperations.d.ts +30 -0
- package/dist/support/utils/bulkCandidateOperations.js +34 -4
- package/dist/support/utils/bulkCandidateOperations.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,31 +1,33 @@
|
|
|
1
|
-
import { Button as e, Checkbox as t, Dialog as n, DialogContent as r, DialogDescription as ee, DialogFooter as i, DialogHeader as te, DialogTitle as
|
|
2
|
-
import { BulkEnsureInterviewRoundsDocument as
|
|
3
|
-
import { InterviewRoundType as
|
|
4
|
-
import { nativeNotify as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
1
|
+
import { Button as e, Checkbox as t, Dialog as n, DialogContent as r, DialogDescription as ee, DialogFooter as i, DialogHeader as te, DialogTitle as a, Label as o, Select as s, SelectContent as c, SelectItem as l, SelectTrigger as u, SelectValue as ne, Textarea as d } from "../ui.js";
|
|
2
|
+
import { BulkEnsureInterviewRoundsDocument as f, BulkRandomizeAndSendAssignmentDocument as p, BulkSendCustomEmailDocument as m, BulkSendRoundMessageDocument as h, BulkUpdateApplicationStatusDocument as g, NotifyDuplicateApplicantsDocument as _, useGetJobPostingQuery as v } from "../../../generated/global-operations.js";
|
|
3
|
+
import { InterviewRoundType as y } from "../../../generated/global-types.js";
|
|
4
|
+
import { nativeNotify as re } from "../../../utils/nativeBridge.js";
|
|
5
|
+
import { statusLabels as b, statusOrder as x } from "../../constants/pipeline.js";
|
|
6
|
+
import { RichTextEditor as S } from "./RichTextEditor.js";
|
|
7
|
+
import { aggregateBulkCustomEmailResult as C, aggregateBulkStatusUpdateResult as w, aggregateCandidateEmailResult as T, aggregateDuplicateNoticeResult as E, aggregateEnsureRoundResult as D, assertCompleteBulkCustomEmailChunkResult as O, assertCompleteBulkStatusUpdateChunkResult as k, assertCompleteCandidateEmailChunkResult as A, assertCompleteEnsureRoundChunkResult as j, createEmptyBulkCustomEmailAggregate as M, createEmptyBulkStatusUpdateAggregate as N, createEmptyCandidateEmailAggregate as P, createEmptyDuplicateNoticeAggregate as F, createEmptyEnsureRoundAggregate as I, executeSequentialCandidateChunks as ie, getBulkOperationNotificationSeverity as ae, getCandidateSelectionCount as oe, getSelectedCandidateIds as L, hasCandidateEmailType as R, resolveExactCandidateRounds as z } from "../../utils/bulkCandidateOperations.js";
|
|
8
|
+
import { BulkCandidateActionGuidance as B } from "./BulkCandidateActionGuidance.js";
|
|
9
|
+
import { BulkCustomEmailResultDetails as V, BulkOperationProgress as se, BulkStatusUpdateResultDetails as ce, CandidateEmailResultDetails as le, DuplicateNoticeResultDetails as H, EnsureRoundResultDetails as ue, StoppedBulkOperationNotice as U } from "./BulkOperationFeedback.js";
|
|
10
|
+
import { useEffect as de, useMemo as fe, useState as W } from "react";
|
|
11
|
+
import { AlertCircle as pe, Loader2 as G, Mail as K, Send as me, Tag as q, UserPlus as he } from "lucide-react";
|
|
12
|
+
import { graphqlFetch as ge } from "@burdenoff/fe-libs/shared/graphql/fetch";
|
|
13
|
+
import { jsx as J, jsxs as Y } from "react/jsx-runtime";
|
|
14
|
+
import { useApolloClient as _e } from "@apollo/client/react";
|
|
15
|
+
import { print as ve } from "graphql";
|
|
14
16
|
//#region src/support/components/careers/BulkCandidateDialogs.tsx
|
|
15
|
-
function
|
|
16
|
-
return e.isAssignmentRound || e.roundType ===
|
|
17
|
+
function ye(e) {
|
|
18
|
+
return e.isAssignmentRound || e.roundType === y.TakeHome;
|
|
17
19
|
}
|
|
18
|
-
var
|
|
20
|
+
var be = {
|
|
19
21
|
message: "ROUND_MESSAGE",
|
|
20
22
|
assignment: "ASSIGNMENT"
|
|
21
23
|
};
|
|
22
|
-
function
|
|
24
|
+
function xe(e) {
|
|
23
25
|
return e instanceof Error ? e.message : "The request failed without an error message.";
|
|
24
26
|
}
|
|
25
|
-
async function
|
|
26
|
-
let r = await
|
|
27
|
+
async function X(e, t, n) {
|
|
28
|
+
let r = await ge({
|
|
27
29
|
gateway: "global",
|
|
28
|
-
query:
|
|
30
|
+
query: ve(e),
|
|
29
31
|
variables: t,
|
|
30
32
|
operationName: n,
|
|
31
33
|
skipAuthRetry: !0
|
|
@@ -34,39 +36,39 @@ async function z(e, t, n) {
|
|
|
34
36
|
if (!r.data) throw Error(`${n} returned no data.`);
|
|
35
37
|
return r.data;
|
|
36
38
|
}
|
|
37
|
-
function
|
|
38
|
-
let n =
|
|
39
|
+
function Se(e, t) {
|
|
40
|
+
let n = L(t);
|
|
39
41
|
return e.filter((e) => n.has(e.id));
|
|
40
42
|
}
|
|
41
|
-
function
|
|
42
|
-
let
|
|
43
|
+
function Ce({ mode: f, open: m, onClose: g, onOpenAddRound: _, targets: y, selection: b, jobPostingId: x, previewLoading: S, previewError: C }) {
|
|
44
|
+
let w = _e(), [E, D] = W(""), [O, k] = W(""), [j, M] = W(!1), [N, F] = W(null), [I, L] = W(P), [V, ce] = W(null), [H, ue] = W(!1), [K, q] = W(!1), { data: ge, loading: ve, error: Ce } = v({
|
|
43
45
|
variables: { id: x },
|
|
44
|
-
skip: !
|
|
46
|
+
skip: !m || !x,
|
|
45
47
|
fetchPolicy: "network-only"
|
|
46
48
|
});
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}, [
|
|
50
|
-
let
|
|
49
|
+
de(() => {
|
|
50
|
+
m && (D(""), k(""), M(!1), F(null), L(P()), ce(null), ue(!1), q(!1));
|
|
51
|
+
}, [m, f]);
|
|
52
|
+
let we = fe(() => Se(y, b), [b, y]), Te = oe(b), Ee = we.length === Te, De = ge?.jobPosting?.rounds ?? [], Oe = De.filter((e) => f !== "assignment" || ye(e)), ke = De.find((e) => e.id === E), Z = ke ? z(we, ke.id) : {
|
|
51
53
|
pairs: [],
|
|
52
54
|
unresolved: []
|
|
53
|
-
},
|
|
54
|
-
!Q &&
|
|
55
|
+
}, Ae = Z.unresolved.filter((e) => e.reason === "MISSING").length, je = Z.unresolved.filter((e) => e.reason === "AMBIGUOUS").length, Me = be[f], Ne = Z.pairs.filter(({ round: e }) => R(e, Me)).length, Pe = Z.pairs.filter(({ round: e }) => j || !R(e, Me)).length, Fe = we.some((e) => e.jobPostingId !== x), Q = C;
|
|
56
|
+
!Q && Ce ? Q = "Could not load the posting rounds. Nothing will be sent." : !Q && !S && !Ee ? Q = "Some selected candidate details are unavailable. Refresh the selection before sending." : !Q && Fe ? Q = "Some selected candidates do not belong to the filtered posting." : !Q && E && !ve && !ke ? Q = "The selected round is no longer available. Choose another round." : !Q && je > 0 && (Q = `${je} selected candidate${je === 1 ? " has" : "s have"} multiple concrete rounds for this configuration. Nothing will be sent until the data is corrected.`);
|
|
55
57
|
let Ie = async () => {
|
|
56
|
-
if (
|
|
57
|
-
|
|
58
|
-
let e = await
|
|
59
|
-
items:
|
|
58
|
+
if (K || H || S || ve || Q || !Ee || !ke || Z.pairs.length === 0 || Pe === 0 || f === "message" && !O.trim()) return;
|
|
59
|
+
q(!0), ue(!0), ce(null), L(P());
|
|
60
|
+
let e = await ie({
|
|
61
|
+
items: Z.pairs.map(({ applicationId: e, roundId: t }) => ({
|
|
60
62
|
applicationId: e,
|
|
61
63
|
roundId: t
|
|
62
64
|
})),
|
|
63
|
-
initialAggregate:
|
|
64
|
-
onProgress:
|
|
65
|
+
initialAggregate: P(),
|
|
66
|
+
onProgress: F,
|
|
65
67
|
executeChunk: async (e) => {
|
|
66
|
-
if (
|
|
67
|
-
let t = (await
|
|
68
|
+
if (f === "assignment") {
|
|
69
|
+
let t = (await X(p, { input: {
|
|
68
70
|
items: [...e],
|
|
69
|
-
force:
|
|
71
|
+
force: j
|
|
70
72
|
} }, "BulkRandomizeAndSendAssignment")).bulkRandomizeAndSendAssignment;
|
|
71
73
|
if (!t) throw Error("The assignment request returned no result.");
|
|
72
74
|
let n = {
|
|
@@ -86,12 +88,12 @@ function B({ mode: u, open: p, onClose: h, onOpenAddRound: oe, targets: _, selec
|
|
|
86
88
|
message: e.message
|
|
87
89
|
}))
|
|
88
90
|
};
|
|
89
|
-
return
|
|
91
|
+
return A(e, n), n;
|
|
90
92
|
}
|
|
91
|
-
let t = (await
|
|
93
|
+
let t = (await X(h, { input: {
|
|
92
94
|
items: [...e],
|
|
93
|
-
message:
|
|
94
|
-
force:
|
|
95
|
+
message: O.trim(),
|
|
96
|
+
force: j
|
|
95
97
|
} }, "BulkSendRoundMessage")).bulkSendRoundMessage;
|
|
96
98
|
if (!t) throw Error("The message request returned no result.");
|
|
97
99
|
let n = {
|
|
@@ -111,80 +113,80 @@ function B({ mode: u, open: p, onClose: h, onOpenAddRound: oe, targets: _, selec
|
|
|
111
113
|
message: e.message
|
|
112
114
|
}))
|
|
113
115
|
};
|
|
114
|
-
return
|
|
116
|
+
return A(e, n), n;
|
|
115
117
|
},
|
|
116
|
-
mergeResult:
|
|
118
|
+
mergeResult: T
|
|
117
119
|
});
|
|
118
|
-
|
|
120
|
+
L(e.aggregate), e.error && ce({
|
|
119
121
|
knownCompleted: e.processedItems.length,
|
|
120
122
|
ambiguous: e.ambiguousItems.length,
|
|
121
123
|
notStarted: e.notStartedItems.length,
|
|
122
|
-
message:
|
|
123
|
-
}), ae(
|
|
124
|
+
message: xe(e.error)
|
|
125
|
+
}), re(ae({
|
|
124
126
|
succeeded: e.aggregate.succeeded.length,
|
|
125
127
|
skipped: e.aggregate.skipped.length,
|
|
126
128
|
failed: e.aggregate.failed.length,
|
|
127
129
|
ambiguous: !!e.error
|
|
128
|
-
})),
|
|
129
|
-
}, $ = S ||
|
|
130
|
-
return /* @__PURE__ */
|
|
131
|
-
open:
|
|
130
|
+
})), q(!1), w.refetchQueries({ include: ["GetJobApplications", "GetJobApplicationInterviewRounds"] }).catch(() => void 0);
|
|
131
|
+
}, $ = S || ve;
|
|
132
|
+
return /* @__PURE__ */ J(n, {
|
|
133
|
+
open: m,
|
|
132
134
|
onOpenChange: (e) => {
|
|
133
|
-
!e && !
|
|
135
|
+
!e && !K && g();
|
|
134
136
|
},
|
|
135
|
-
children: /* @__PURE__ */
|
|
137
|
+
children: /* @__PURE__ */ Y(r, {
|
|
136
138
|
className: "sm:max-w-xl max-h-[90vh] overflow-y-auto",
|
|
137
139
|
children: [
|
|
138
|
-
/* @__PURE__ */
|
|
139
|
-
/* @__PURE__ */
|
|
140
|
-
action:
|
|
141
|
-
unresolvedCount:
|
|
140
|
+
/* @__PURE__ */ Y(te, { children: [/* @__PURE__ */ J(a, { children: f === "assignment" ? "Assign & Email Random Take-Home" : "Send Message" }), /* @__PURE__ */ J(ee, { children: "Choose one configured round for the candidates in the filtered posting." })] }),
|
|
141
|
+
/* @__PURE__ */ J(B, {
|
|
142
|
+
action: f,
|
|
143
|
+
unresolvedCount: Ae
|
|
142
144
|
}),
|
|
143
|
-
|
|
145
|
+
H ? /* @__PURE__ */ Y("div", {
|
|
144
146
|
className: "space-y-4",
|
|
145
147
|
children: [
|
|
146
|
-
|
|
147
|
-
/* @__PURE__ */
|
|
148
|
-
|
|
149
|
-
/* @__PURE__ */
|
|
150
|
-
onClick:
|
|
151
|
-
disabled:
|
|
148
|
+
N ? /* @__PURE__ */ J(se, { progress: N }) : null,
|
|
149
|
+
/* @__PURE__ */ J(le, { result: I }),
|
|
150
|
+
V ? /* @__PURE__ */ J(U, { details: V }) : null,
|
|
151
|
+
/* @__PURE__ */ J(i, { children: /* @__PURE__ */ J(e, {
|
|
152
|
+
onClick: g,
|
|
153
|
+
disabled: K,
|
|
152
154
|
children: "Done"
|
|
153
155
|
}) })
|
|
154
156
|
]
|
|
155
|
-
}) : /* @__PURE__ */
|
|
157
|
+
}) : /* @__PURE__ */ Y("div", {
|
|
156
158
|
className: "space-y-4",
|
|
157
159
|
children: [
|
|
158
|
-
$ ? /* @__PURE__ */
|
|
160
|
+
$ ? /* @__PURE__ */ Y("div", {
|
|
159
161
|
className: "flex items-center gap-2 text-sm text-text-secondary",
|
|
160
|
-
children: [/* @__PURE__ */
|
|
162
|
+
children: [/* @__PURE__ */ J(G, {
|
|
161
163
|
size: 14,
|
|
162
164
|
className: "animate-spin"
|
|
163
165
|
}), "Refreshing candidates and configured rounds…"]
|
|
164
166
|
}) : null,
|
|
165
|
-
Q ? /* @__PURE__ */
|
|
167
|
+
Q ? /* @__PURE__ */ Y("div", {
|
|
166
168
|
className: "flex items-start gap-2 text-sm text-status-error-text",
|
|
167
169
|
role: "alert",
|
|
168
|
-
children: [/* @__PURE__ */
|
|
170
|
+
children: [/* @__PURE__ */ J(pe, {
|
|
169
171
|
size: 14,
|
|
170
172
|
className: "mt-0.5 shrink-0"
|
|
171
|
-
}), /* @__PURE__ */
|
|
173
|
+
}), /* @__PURE__ */ J("span", { children: Q })]
|
|
172
174
|
}) : null,
|
|
173
|
-
/* @__PURE__ */
|
|
175
|
+
/* @__PURE__ */ Y("div", {
|
|
174
176
|
className: "space-y-1.5",
|
|
175
177
|
children: [
|
|
176
|
-
/* @__PURE__ */
|
|
178
|
+
/* @__PURE__ */ J(o, {
|
|
177
179
|
htmlFor: "bulk-round-config",
|
|
178
180
|
children: "Target round"
|
|
179
181
|
}),
|
|
180
|
-
/* @__PURE__ */
|
|
181
|
-
value:
|
|
182
|
-
onValueChange:
|
|
182
|
+
/* @__PURE__ */ Y(s, {
|
|
183
|
+
value: E,
|
|
184
|
+
onValueChange: D,
|
|
183
185
|
disabled: $ || !!Q,
|
|
184
|
-
children: [/* @__PURE__ */
|
|
186
|
+
children: [/* @__PURE__ */ J(u, {
|
|
185
187
|
id: "bulk-round-config",
|
|
186
|
-
children: /* @__PURE__ */
|
|
187
|
-
}), /* @__PURE__ */
|
|
188
|
+
children: /* @__PURE__ */ J(ne, { placeholder: "Select a round" })
|
|
189
|
+
}), /* @__PURE__ */ J(c, { children: Oe.map((e) => /* @__PURE__ */ Y(l, {
|
|
188
190
|
value: e.id,
|
|
189
191
|
children: [
|
|
190
192
|
"Round ",
|
|
@@ -194,77 +196,77 @@ function B({ mode: u, open: p, onClose: h, onOpenAddRound: oe, targets: _, selec
|
|
|
194
196
|
]
|
|
195
197
|
}, e.id)) })]
|
|
196
198
|
}),
|
|
197
|
-
|
|
199
|
+
Oe.length === 0 && !$ && !Q ? /* @__PURE__ */ J("p", {
|
|
198
200
|
className: "text-xs text-status-warning-text",
|
|
199
|
-
children:
|
|
201
|
+
children: f === "assignment" ? "This posting has no configured assignment round." : "This posting has no configured interview rounds."
|
|
200
202
|
}) : null
|
|
201
203
|
]
|
|
202
204
|
}),
|
|
203
|
-
|
|
205
|
+
f === "message" ? /* @__PURE__ */ Y("div", {
|
|
204
206
|
className: "space-y-1.5",
|
|
205
|
-
children: [/* @__PURE__ */
|
|
207
|
+
children: [/* @__PURE__ */ J(o, {
|
|
206
208
|
htmlFor: "bulk-message",
|
|
207
209
|
children: "Free-text message"
|
|
208
|
-
}), /* @__PURE__ */
|
|
210
|
+
}), /* @__PURE__ */ J(d, {
|
|
209
211
|
id: "bulk-message",
|
|
210
|
-
value:
|
|
211
|
-
onChange: (e) =>
|
|
212
|
+
value: O,
|
|
213
|
+
onChange: (e) => k(e.target.value),
|
|
212
214
|
placeholder: "Write the message sent to each candidate",
|
|
213
215
|
rows: 5
|
|
214
216
|
})]
|
|
215
217
|
}) : null,
|
|
216
|
-
|
|
218
|
+
E && !$ && !Q ? /* @__PURE__ */ Y("div", {
|
|
217
219
|
className: "space-y-2 rounded-md border border-border-seam bg-bg-sunken/30 p-3 text-xs text-text-secondary",
|
|
218
220
|
children: [
|
|
219
|
-
/* @__PURE__ */
|
|
221
|
+
/* @__PURE__ */ J("p", {
|
|
220
222
|
className: "font-medium text-text-primary",
|
|
221
223
|
children: "Preview"
|
|
222
224
|
}),
|
|
223
|
-
/* @__PURE__ */
|
|
225
|
+
/* @__PURE__ */ Y("p", { children: [
|
|
224
226
|
"Will send to ",
|
|
225
|
-
/* @__PURE__ */
|
|
227
|
+
/* @__PURE__ */ J("span", {
|
|
226
228
|
className: "font-semibold",
|
|
227
|
-
children:
|
|
229
|
+
children: Pe
|
|
228
230
|
}),
|
|
229
231
|
" candidate",
|
|
230
|
-
|
|
232
|
+
Pe === 1 ? "" : "s",
|
|
231
233
|
"."
|
|
232
234
|
] }),
|
|
233
|
-
|
|
234
|
-
|
|
235
|
+
Ne > 0 ? /* @__PURE__ */ Y("p", { children: [
|
|
236
|
+
Ne,
|
|
235
237
|
" already received this email type",
|
|
236
238
|
" ",
|
|
237
|
-
|
|
239
|
+
j ? "(force will send again)" : "(the backend will skip them)",
|
|
238
240
|
"."
|
|
239
241
|
] }) : null,
|
|
240
|
-
|
|
242
|
+
Ae > 0 ? /* @__PURE__ */ Y(e, {
|
|
241
243
|
type: "button",
|
|
242
244
|
size: "sm",
|
|
243
245
|
variant: "outline",
|
|
244
|
-
onClick:
|
|
245
|
-
children: [/* @__PURE__ */
|
|
246
|
+
onClick: _,
|
|
247
|
+
children: [/* @__PURE__ */ J(he, { size: 14 }), "Add Selected to Round"]
|
|
246
248
|
}) : null,
|
|
247
|
-
/* @__PURE__ */
|
|
249
|
+
/* @__PURE__ */ Y("label", {
|
|
248
250
|
className: "flex cursor-pointer items-start gap-2 pt-1",
|
|
249
|
-
children: [/* @__PURE__ */
|
|
250
|
-
checked:
|
|
251
|
-
onCheckedChange: (e) =>
|
|
252
|
-
}), /* @__PURE__ */
|
|
251
|
+
children: [/* @__PURE__ */ J(t, {
|
|
252
|
+
checked: j,
|
|
253
|
+
onCheckedChange: (e) => M(e === !0)
|
|
254
|
+
}), /* @__PURE__ */ J("span", { children: "Force resend to candidates with a prior email. Force sends are non-idempotent and are never retried automatically." })]
|
|
253
255
|
})
|
|
254
256
|
]
|
|
255
257
|
}) : null,
|
|
256
|
-
/* @__PURE__ */
|
|
258
|
+
/* @__PURE__ */ Y(i, { children: [/* @__PURE__ */ J(e, {
|
|
257
259
|
variant: "outline",
|
|
258
|
-
onClick:
|
|
259
|
-
disabled:
|
|
260
|
+
onClick: g,
|
|
261
|
+
disabled: K,
|
|
260
262
|
children: "Cancel"
|
|
261
|
-
}), /* @__PURE__ */
|
|
263
|
+
}), /* @__PURE__ */ Y(e, {
|
|
262
264
|
onClick: () => void Ie(),
|
|
263
|
-
disabled:
|
|
264
|
-
children: [
|
|
265
|
+
disabled: K || $ || !!Q || !Ee || !E || Z.pairs.length === 0 || Pe === 0 || f === "message" && !O.trim(),
|
|
266
|
+
children: [K ? /* @__PURE__ */ J(G, {
|
|
265
267
|
size: 16,
|
|
266
268
|
className: "mr-2 animate-spin"
|
|
267
|
-
}) : /* @__PURE__ */
|
|
269
|
+
}) : /* @__PURE__ */ J(me, { size: 16 }), K ? "Sending…" : "Send"]
|
|
268
270
|
})] })
|
|
269
271
|
]
|
|
270
272
|
})
|
|
@@ -272,28 +274,28 @@ function B({ mode: u, open: p, onClose: h, onOpenAddRound: oe, targets: _, selec
|
|
|
272
274
|
})
|
|
273
275
|
});
|
|
274
276
|
}
|
|
275
|
-
function
|
|
276
|
-
let
|
|
277
|
-
variables: { id:
|
|
278
|
-
skip: !t || !
|
|
277
|
+
function we({ open: t, onClose: d, targets: p, selection: m, jobPostingId: h, previewLoading: g, previewError: _ }) {
|
|
278
|
+
let y = _e(), [b, x] = W(""), [S, C] = W(null), [w, T] = W(I), [E, O] = W(null), [k, A] = W(!1), [M, N] = W(!1), { data: P, loading: F, error: L } = v({
|
|
279
|
+
variables: { id: h },
|
|
280
|
+
skip: !t || !h,
|
|
279
281
|
fetchPolicy: "network-only"
|
|
280
282
|
});
|
|
281
|
-
|
|
282
|
-
t && (
|
|
283
|
+
de(() => {
|
|
284
|
+
t && (x(""), C(null), T(I()), O(null), A(!1), N(!1));
|
|
283
285
|
}, [t]);
|
|
284
|
-
let
|
|
285
|
-
!K &&
|
|
286
|
-
let
|
|
287
|
-
if (
|
|
288
|
-
|
|
289
|
-
let e = await
|
|
290
|
-
items:
|
|
291
|
-
initialAggregate:
|
|
286
|
+
let R = fe(() => Se(p, m), [m, p]), z = oe(m), B = R.length === z, V = R.map((e) => e.id), ce = R.some((e) => e.jobPostingId !== h), le = P?.jobPosting?.rounds ?? [], H = le.find((e) => e.id === b), K = _;
|
|
287
|
+
!K && L ? K = "Could not load the posting rounds. Nothing will be changed." : !K && !g && !B ? K = "Some selected candidate details are unavailable. Refresh the selection before adding rounds." : !K && ce ? K = "Some selected candidates do not belong to the filtered posting." : !K && b && !F && !H && (K = "The selected round is no longer available. Choose another round.");
|
|
288
|
+
let me = async () => {
|
|
289
|
+
if (M || k || g || F || K || !B || !H || V.length === 0) return;
|
|
290
|
+
N(!0), A(!0), O(null), T(I());
|
|
291
|
+
let e = await ie({
|
|
292
|
+
items: V,
|
|
293
|
+
initialAggregate: I(),
|
|
292
294
|
onProgress: C,
|
|
293
295
|
executeChunk: async (e) => {
|
|
294
|
-
let t = (await
|
|
295
|
-
jobPostingId:
|
|
296
|
-
roundConfigId:
|
|
296
|
+
let t = (await X(f, { input: {
|
|
297
|
+
jobPostingId: h,
|
|
298
|
+
roundConfigId: H.id,
|
|
297
299
|
applicationIds: [...e]
|
|
298
300
|
} }, "BulkEnsureInterviewRounds")).bulkEnsureInterviewRounds;
|
|
299
301
|
if (!t) throw Error("The add-to-round request returned no result.");
|
|
@@ -312,80 +314,80 @@ function V({ open: t, onClose: l, targets: d, selection: f, jobPostingId: p, pre
|
|
|
312
314
|
message: e.message
|
|
313
315
|
}))
|
|
314
316
|
};
|
|
315
|
-
return
|
|
317
|
+
return j(e, n), n;
|
|
316
318
|
},
|
|
317
|
-
mergeResult:
|
|
319
|
+
mergeResult: D
|
|
318
320
|
});
|
|
319
|
-
T(e.aggregate), e.error &&
|
|
321
|
+
T(e.aggregate), e.error && O({
|
|
320
322
|
knownCompleted: e.processedItems.length,
|
|
321
323
|
ambiguous: e.ambiguousItems.length,
|
|
322
324
|
notStarted: e.notStartedItems.length,
|
|
323
|
-
message:
|
|
324
|
-
}), ae(
|
|
325
|
+
message: xe(e.error)
|
|
326
|
+
}), re(ae({
|
|
325
327
|
succeeded: e.aggregate.created.length + e.aggregate.alreadyPresent.length,
|
|
326
328
|
skipped: 0,
|
|
327
329
|
failed: e.aggregate.failed.length,
|
|
328
330
|
ambiguous: !!e.error
|
|
329
|
-
})),
|
|
330
|
-
}, q =
|
|
331
|
-
return /* @__PURE__ */
|
|
331
|
+
})), N(!1), y.refetchQueries({ include: ["GetJobApplications", "GetJobApplicationInterviewRounds"] }).catch(() => void 0);
|
|
332
|
+
}, q = g || F;
|
|
333
|
+
return /* @__PURE__ */ J(n, {
|
|
332
334
|
open: t,
|
|
333
335
|
onOpenChange: (e) => {
|
|
334
|
-
!e && !
|
|
336
|
+
!e && !M && d();
|
|
335
337
|
},
|
|
336
|
-
children: /* @__PURE__ */
|
|
338
|
+
children: /* @__PURE__ */ Y(r, {
|
|
337
339
|
className: "sm:max-w-xl max-h-[90vh] overflow-y-auto",
|
|
338
340
|
children: [
|
|
339
|
-
/* @__PURE__ */
|
|
340
|
-
/* @__PURE__ */
|
|
341
|
+
/* @__PURE__ */ Y(te, { children: [/* @__PURE__ */ J(a, { children: "Add Selected to Round" }), /* @__PURE__ */ J(ee, { children: "Add every selected candidate in this posting to one configured interview round." })] }),
|
|
342
|
+
/* @__PURE__ */ J("div", {
|
|
341
343
|
className: "rounded-md border border-border-seam bg-bg-sunken/30 p-3 text-sm text-text-secondary",
|
|
342
344
|
children: "Candidates without this concrete round are added with status Scheduled. Existing target rounds are left unchanged, and all prior round history and application status remain unchanged."
|
|
343
345
|
}),
|
|
344
|
-
|
|
346
|
+
k ? /* @__PURE__ */ Y("div", {
|
|
345
347
|
className: "space-y-4",
|
|
346
348
|
children: [
|
|
347
|
-
|
|
348
|
-
/* @__PURE__ */
|
|
349
|
-
E ? /* @__PURE__ */
|
|
350
|
-
/* @__PURE__ */
|
|
351
|
-
onClick:
|
|
352
|
-
disabled:
|
|
349
|
+
S ? /* @__PURE__ */ J(se, { progress: S }) : null,
|
|
350
|
+
/* @__PURE__ */ J(ue, { result: w }),
|
|
351
|
+
E ? /* @__PURE__ */ J(U, { details: E }) : null,
|
|
352
|
+
/* @__PURE__ */ J(i, { children: /* @__PURE__ */ J(e, {
|
|
353
|
+
onClick: d,
|
|
354
|
+
disabled: M,
|
|
353
355
|
children: "Done"
|
|
354
356
|
}) })
|
|
355
357
|
]
|
|
356
|
-
}) : /* @__PURE__ */
|
|
358
|
+
}) : /* @__PURE__ */ Y("div", {
|
|
357
359
|
className: "space-y-4",
|
|
358
360
|
children: [
|
|
359
|
-
q ? /* @__PURE__ */
|
|
361
|
+
q ? /* @__PURE__ */ Y("div", {
|
|
360
362
|
className: "flex items-center gap-2 text-sm text-text-secondary",
|
|
361
|
-
children: [/* @__PURE__ */
|
|
363
|
+
children: [/* @__PURE__ */ J(G, {
|
|
362
364
|
size: 14,
|
|
363
365
|
className: "animate-spin"
|
|
364
366
|
}), "Refreshing candidates and configured rounds…"]
|
|
365
367
|
}) : null,
|
|
366
|
-
K ? /* @__PURE__ */
|
|
368
|
+
K ? /* @__PURE__ */ Y("div", {
|
|
367
369
|
className: "flex items-start gap-2 text-sm text-status-error-text",
|
|
368
370
|
role: "alert",
|
|
369
|
-
children: [/* @__PURE__ */
|
|
371
|
+
children: [/* @__PURE__ */ J(pe, {
|
|
370
372
|
size: 14,
|
|
371
373
|
className: "mt-0.5 shrink-0"
|
|
372
|
-
}), /* @__PURE__ */
|
|
374
|
+
}), /* @__PURE__ */ J("span", { children: K })]
|
|
373
375
|
}) : null,
|
|
374
|
-
/* @__PURE__ */
|
|
376
|
+
/* @__PURE__ */ Y("div", {
|
|
375
377
|
className: "space-y-1.5",
|
|
376
378
|
children: [
|
|
377
|
-
/* @__PURE__ */
|
|
379
|
+
/* @__PURE__ */ J(o, {
|
|
378
380
|
htmlFor: "ensure-round-config",
|
|
379
381
|
children: "Interview round"
|
|
380
382
|
}),
|
|
381
|
-
/* @__PURE__ */
|
|
382
|
-
value:
|
|
383
|
-
onValueChange:
|
|
383
|
+
/* @__PURE__ */ Y(s, {
|
|
384
|
+
value: b,
|
|
385
|
+
onValueChange: x,
|
|
384
386
|
disabled: q || !!K,
|
|
385
|
-
children: [/* @__PURE__ */
|
|
387
|
+
children: [/* @__PURE__ */ J(u, {
|
|
386
388
|
id: "ensure-round-config",
|
|
387
|
-
children: /* @__PURE__ */
|
|
388
|
-
}), /* @__PURE__ */
|
|
389
|
+
children: /* @__PURE__ */ J(ne, { placeholder: "Select a round" })
|
|
390
|
+
}), /* @__PURE__ */ J(c, { children: le.map((e) => /* @__PURE__ */ Y(l, {
|
|
389
391
|
value: e.id,
|
|
390
392
|
children: [
|
|
391
393
|
"Round ",
|
|
@@ -395,34 +397,34 @@ function V({ open: t, onClose: l, targets: d, selection: f, jobPostingId: p, pre
|
|
|
395
397
|
]
|
|
396
398
|
}, e.id)) })]
|
|
397
399
|
}),
|
|
398
|
-
|
|
400
|
+
le.length === 0 && !q && !K ? /* @__PURE__ */ J("p", {
|
|
399
401
|
className: "text-xs text-status-warning-text",
|
|
400
402
|
children: "This posting has no configured interview rounds."
|
|
401
403
|
}) : null
|
|
402
404
|
]
|
|
403
405
|
}),
|
|
404
|
-
/* @__PURE__ */
|
|
406
|
+
/* @__PURE__ */ Y("p", {
|
|
405
407
|
className: "text-xs text-text-secondary",
|
|
406
408
|
children: [
|
|
407
|
-
|
|
409
|
+
z,
|
|
408
410
|
" selected candidate",
|
|
409
|
-
|
|
411
|
+
z === 1 ? "" : "s",
|
|
410
412
|
" ",
|
|
411
413
|
"will be checked. Existing target rounds are reported as already present."
|
|
412
414
|
]
|
|
413
415
|
}),
|
|
414
|
-
/* @__PURE__ */
|
|
416
|
+
/* @__PURE__ */ Y(i, { children: [/* @__PURE__ */ J(e, {
|
|
415
417
|
variant: "outline",
|
|
416
|
-
onClick:
|
|
417
|
-
disabled:
|
|
418
|
+
onClick: d,
|
|
419
|
+
disabled: M,
|
|
418
420
|
children: "Cancel"
|
|
419
|
-
}), /* @__PURE__ */
|
|
420
|
-
onClick: () => void
|
|
421
|
-
disabled:
|
|
422
|
-
children: [
|
|
421
|
+
}), /* @__PURE__ */ Y(e, {
|
|
422
|
+
onClick: () => void me(),
|
|
423
|
+
disabled: M || q || !!K || !B || !b || V.length === 0,
|
|
424
|
+
children: [M ? /* @__PURE__ */ J(G, {
|
|
423
425
|
size: 16,
|
|
424
426
|
className: "mr-2 animate-spin"
|
|
425
|
-
}) : /* @__PURE__ */
|
|
427
|
+
}) : /* @__PURE__ */ J(he, { size: 16 }), M ? "Adding…" : "Add Selected to Round"]
|
|
426
428
|
})] })
|
|
427
429
|
]
|
|
428
430
|
})
|
|
@@ -430,22 +432,22 @@ function V({ open: t, onClose: l, targets: d, selection: f, jobPostingId: p, pre
|
|
|
430
432
|
})
|
|
431
433
|
});
|
|
432
434
|
}
|
|
433
|
-
function
|
|
434
|
-
let
|
|
435
|
-
|
|
436
|
-
t && (
|
|
435
|
+
function Te({ open: t, onClose: o, targets: s, selection: c, jobPostingId: l, previewLoading: u, previewError: ne }) {
|
|
436
|
+
let d = _e(), [f, p] = W(null), [m, h] = W(F), [g, v] = W(null), [y, b] = W(!1), [x, S] = W(!1);
|
|
437
|
+
de(() => {
|
|
438
|
+
t && (p(null), h(F()), v(null), b(!1), S(!1));
|
|
437
439
|
}, [t]);
|
|
438
|
-
let
|
|
439
|
-
!
|
|
440
|
-
let
|
|
441
|
-
if (
|
|
442
|
-
|
|
443
|
-
let e = await
|
|
444
|
-
items:
|
|
445
|
-
initialAggregate:
|
|
446
|
-
onProgress:
|
|
440
|
+
let C = fe(() => Se(s, c), [c, s]), w = oe(c), T = C.length === w, D = C.map((e) => e.id), O = C.some((e) => e.jobPostingId !== l), k = ne;
|
|
441
|
+
!k && !u && !T ? k = "Some selected candidate details are unavailable. Refresh the selection before notifying." : !k && O && (k = "Some selected candidates do not belong to the filtered posting.");
|
|
442
|
+
let A = async () => {
|
|
443
|
+
if (x || y || u || k || !T || D.length === 0) return;
|
|
444
|
+
S(!0), b(!0), v(null), h(F());
|
|
445
|
+
let e = await ie({
|
|
446
|
+
items: D,
|
|
447
|
+
initialAggregate: F(),
|
|
448
|
+
onProgress: p,
|
|
447
449
|
executeChunk: async (e) => {
|
|
448
|
-
let t = (await
|
|
450
|
+
let t = (await X(_, { input: { applicationIds: [...e] } }, "NotifyDuplicateApplicants")).notifyDuplicateApplicants;
|
|
449
451
|
if (!t) throw Error("The duplicate-notice request returned no result.");
|
|
450
452
|
return {
|
|
451
453
|
succeeded: t.succeeded.map((e) => ({ email: e.email })),
|
|
@@ -460,85 +462,85 @@ function H({ open: t, onClose: a, targets: o, selection: s, jobPostingId: re, pr
|
|
|
460
462
|
}))
|
|
461
463
|
};
|
|
462
464
|
},
|
|
463
|
-
mergeResult:
|
|
465
|
+
mergeResult: E
|
|
464
466
|
});
|
|
465
|
-
|
|
467
|
+
h(e.aggregate), e.error && v({
|
|
466
468
|
knownCompleted: e.processedItems.length,
|
|
467
469
|
ambiguous: e.ambiguousItems.length,
|
|
468
470
|
notStarted: e.notStartedItems.length,
|
|
469
|
-
message:
|
|
470
|
-
}), ae(
|
|
471
|
+
message: xe(e.error)
|
|
472
|
+
}), re(ae({
|
|
471
473
|
succeeded: e.aggregate.succeeded.length,
|
|
472
474
|
skipped: e.aggregate.skipped.length,
|
|
473
475
|
failed: e.aggregate.failed.length,
|
|
474
476
|
ambiguous: !!e.error
|
|
475
|
-
})),
|
|
477
|
+
})), S(!1), d.refetchQueries({ include: ["GetJobApplications"] }).catch(() => void 0);
|
|
476
478
|
};
|
|
477
|
-
return /* @__PURE__ */
|
|
479
|
+
return /* @__PURE__ */ J(n, {
|
|
478
480
|
open: t,
|
|
479
481
|
onOpenChange: (e) => {
|
|
480
|
-
!e && !
|
|
482
|
+
!e && !x && o();
|
|
481
483
|
},
|
|
482
|
-
children: /* @__PURE__ */
|
|
484
|
+
children: /* @__PURE__ */ Y(r, {
|
|
483
485
|
className: "sm:max-w-xl max-h-[90vh] overflow-y-auto",
|
|
484
486
|
children: [
|
|
485
|
-
/* @__PURE__ */
|
|
486
|
-
/* @__PURE__ */
|
|
487
|
+
/* @__PURE__ */ Y(te, { children: [/* @__PURE__ */ J(a, { children: "Notify Duplicate Applicants" }), /* @__PURE__ */ J(ee, { children: "Let candidates with more than one application know they only need to complete one take-home assignment." })] }),
|
|
488
|
+
/* @__PURE__ */ J("div", {
|
|
487
489
|
className: "rounded-md border border-border-seam bg-bg-sunken/30 p-3 text-sm text-text-secondary",
|
|
488
490
|
children: "Selected applications are grouped by email address — exactly one notice goes out per unique candidate, even if you select several of their duplicate applications. An email that only appears once among your selection is skipped (it isn't a duplicate), and an email already notified before is skipped automatically."
|
|
489
491
|
}),
|
|
490
|
-
|
|
492
|
+
y ? /* @__PURE__ */ Y("div", {
|
|
491
493
|
className: "space-y-4",
|
|
492
494
|
children: [
|
|
493
|
-
|
|
494
|
-
/* @__PURE__ */
|
|
495
|
-
|
|
496
|
-
/* @__PURE__ */
|
|
497
|
-
onClick:
|
|
498
|
-
disabled:
|
|
495
|
+
f ? /* @__PURE__ */ J(se, { progress: f }) : null,
|
|
496
|
+
/* @__PURE__ */ J(H, { result: m }),
|
|
497
|
+
g ? /* @__PURE__ */ J(U, { details: g }) : null,
|
|
498
|
+
/* @__PURE__ */ J(i, { children: /* @__PURE__ */ J(e, {
|
|
499
|
+
onClick: o,
|
|
500
|
+
disabled: x,
|
|
499
501
|
children: "Done"
|
|
500
502
|
}) })
|
|
501
503
|
]
|
|
502
|
-
}) : /* @__PURE__ */
|
|
504
|
+
}) : /* @__PURE__ */ Y("div", {
|
|
503
505
|
className: "space-y-4",
|
|
504
506
|
children: [
|
|
505
|
-
|
|
507
|
+
u ? /* @__PURE__ */ Y("div", {
|
|
506
508
|
className: "flex items-center gap-2 text-sm text-text-secondary",
|
|
507
|
-
children: [/* @__PURE__ */
|
|
509
|
+
children: [/* @__PURE__ */ J(G, {
|
|
508
510
|
size: 14,
|
|
509
511
|
className: "animate-spin"
|
|
510
512
|
}), "Refreshing candidates…"]
|
|
511
513
|
}) : null,
|
|
512
|
-
|
|
514
|
+
k ? /* @__PURE__ */ Y("div", {
|
|
513
515
|
className: "flex items-start gap-2 text-sm text-status-error-text",
|
|
514
516
|
role: "alert",
|
|
515
|
-
children: [/* @__PURE__ */
|
|
517
|
+
children: [/* @__PURE__ */ J(pe, {
|
|
516
518
|
size: 14,
|
|
517
519
|
className: "mt-0.5 shrink-0"
|
|
518
|
-
}), /* @__PURE__ */
|
|
520
|
+
}), /* @__PURE__ */ J("span", { children: k })]
|
|
519
521
|
}) : null,
|
|
520
|
-
/* @__PURE__ */
|
|
522
|
+
/* @__PURE__ */ Y("p", {
|
|
521
523
|
className: "text-xs text-text-secondary",
|
|
522
524
|
children: [
|
|
523
|
-
|
|
525
|
+
w,
|
|
524
526
|
" selected application",
|
|
525
|
-
|
|
527
|
+
w === 1 ? "" : "s",
|
|
526
528
|
" ",
|
|
527
529
|
"will be checked and grouped by email."
|
|
528
530
|
]
|
|
529
531
|
}),
|
|
530
|
-
/* @__PURE__ */
|
|
532
|
+
/* @__PURE__ */ Y(i, { children: [/* @__PURE__ */ J(e, {
|
|
531
533
|
variant: "outline",
|
|
532
|
-
onClick:
|
|
533
|
-
disabled:
|
|
534
|
+
onClick: o,
|
|
535
|
+
disabled: x,
|
|
534
536
|
children: "Cancel"
|
|
535
|
-
}), /* @__PURE__ */
|
|
536
|
-
onClick: () => void
|
|
537
|
-
disabled:
|
|
538
|
-
children: [
|
|
537
|
+
}), /* @__PURE__ */ Y(e, {
|
|
538
|
+
onClick: () => void A(),
|
|
539
|
+
disabled: x || u || !!k || !T || D.length === 0,
|
|
540
|
+
children: [x ? /* @__PURE__ */ J(G, {
|
|
539
541
|
size: 16,
|
|
540
542
|
className: "mr-2 animate-spin"
|
|
541
|
-
}) : /* @__PURE__ */
|
|
543
|
+
}) : /* @__PURE__ */ J(K, { size: 16 }), x ? "Notifying…" : "Notify Duplicate Applicants"]
|
|
542
544
|
})] })
|
|
543
545
|
]
|
|
544
546
|
})
|
|
@@ -546,7 +548,269 @@ function H({ open: t, onClose: a, targets: o, selection: s, jobPostingId: re, pr
|
|
|
546
548
|
})
|
|
547
549
|
});
|
|
548
550
|
}
|
|
551
|
+
function Ee({ open: t, onClose: s, targets: c, selection: l, previewLoading: u, previewError: ne }) {
|
|
552
|
+
let d = _e(), [f, p] = W(""), [h, g] = W(""), [_, v] = W(null), [y, b] = W(M), [x, w] = W(null), [T, E] = W(!1), [D, k] = W(!1);
|
|
553
|
+
de(() => {
|
|
554
|
+
t && (p(""), g(""), v(null), b(M()), w(null), E(!1), k(!1));
|
|
555
|
+
}, [t]);
|
|
556
|
+
let A = fe(() => Se(c, l), [l, c]), j = oe(l), N = A.length === j, P = A.map((e) => e.id), F = f.trim().length > 0, I = h.trim().length > 0, L = ne;
|
|
557
|
+
!L && !u && !N && (L = "Some selected candidate details are unavailable. Refresh the selection before sending.");
|
|
558
|
+
let R = !D && !T && !u && !L && N && P.length > 0 && F && I, z = async () => {
|
|
559
|
+
if (!R) return;
|
|
560
|
+
k(!0), E(!0), w(null), b(M());
|
|
561
|
+
let e = await ie({
|
|
562
|
+
items: P,
|
|
563
|
+
initialAggregate: M(),
|
|
564
|
+
onProgress: v,
|
|
565
|
+
executeChunk: async (e) => {
|
|
566
|
+
let t = (await X(m, { input: {
|
|
567
|
+
applicationIds: [...e],
|
|
568
|
+
subject: f.trim(),
|
|
569
|
+
message: h
|
|
570
|
+
} }, "BulkSendCustomEmail")).bulkSendCustomEmail;
|
|
571
|
+
if (!t) throw Error("The bulk email request returned no result.");
|
|
572
|
+
let n = {
|
|
573
|
+
succeeded: t.succeeded.map((e) => ({
|
|
574
|
+
applicationId: e.id,
|
|
575
|
+
email: e.email
|
|
576
|
+
})),
|
|
577
|
+
failed: t.failed.map((e) => ({
|
|
578
|
+
applicationId: e.applicationId,
|
|
579
|
+
message: e.message
|
|
580
|
+
}))
|
|
581
|
+
};
|
|
582
|
+
return O([...e], n), n;
|
|
583
|
+
},
|
|
584
|
+
mergeResult: C
|
|
585
|
+
});
|
|
586
|
+
b(e.aggregate), e.error && w({
|
|
587
|
+
knownCompleted: e.processedItems.length,
|
|
588
|
+
ambiguous: e.ambiguousItems.length,
|
|
589
|
+
notStarted: e.notStartedItems.length,
|
|
590
|
+
message: xe(e.error)
|
|
591
|
+
}), re(ae({
|
|
592
|
+
succeeded: e.aggregate.succeeded.length,
|
|
593
|
+
skipped: 0,
|
|
594
|
+
failed: e.aggregate.failed.length,
|
|
595
|
+
ambiguous: !!e.error
|
|
596
|
+
})), k(!1), d.refetchQueries({ include: ["GetJobApplications"] }).catch(() => void 0);
|
|
597
|
+
};
|
|
598
|
+
return /* @__PURE__ */ J(n, {
|
|
599
|
+
open: t,
|
|
600
|
+
onOpenChange: (e) => {
|
|
601
|
+
!e && !D && s();
|
|
602
|
+
},
|
|
603
|
+
children: /* @__PURE__ */ Y(r, {
|
|
604
|
+
className: "sm:max-w-xl max-h-[90vh] overflow-y-auto",
|
|
605
|
+
children: [/* @__PURE__ */ Y(te, { children: [/* @__PURE__ */ J(a, { children: "Send Custom Email" }), /* @__PURE__ */ J(ee, { children: "Send the same branded email — your own subject and message — to every selected candidate, regardless of their stage or round. Useful for progress updates or a closing note to candidates who won't move forward." })] }), T ? /* @__PURE__ */ Y("div", {
|
|
606
|
+
className: "space-y-4",
|
|
607
|
+
children: [
|
|
608
|
+
_ ? /* @__PURE__ */ J(se, { progress: _ }) : null,
|
|
609
|
+
/* @__PURE__ */ J(V, { result: y }),
|
|
610
|
+
x ? /* @__PURE__ */ J(U, { details: x }) : null,
|
|
611
|
+
/* @__PURE__ */ J(i, { children: /* @__PURE__ */ J(e, {
|
|
612
|
+
onClick: s,
|
|
613
|
+
disabled: D,
|
|
614
|
+
children: "Done"
|
|
615
|
+
}) })
|
|
616
|
+
]
|
|
617
|
+
}) : /* @__PURE__ */ Y("div", {
|
|
618
|
+
className: "space-y-4",
|
|
619
|
+
children: [
|
|
620
|
+
u ? /* @__PURE__ */ Y("div", {
|
|
621
|
+
className: "flex items-center gap-2 text-sm text-text-secondary",
|
|
622
|
+
children: [/* @__PURE__ */ J(G, {
|
|
623
|
+
size: 14,
|
|
624
|
+
className: "animate-spin"
|
|
625
|
+
}), "Refreshing candidates…"]
|
|
626
|
+
}) : null,
|
|
627
|
+
L ? /* @__PURE__ */ Y("div", {
|
|
628
|
+
className: "flex items-start gap-2 text-sm text-status-error-text",
|
|
629
|
+
role: "alert",
|
|
630
|
+
children: [/* @__PURE__ */ J(pe, {
|
|
631
|
+
size: 14,
|
|
632
|
+
className: "mt-0.5 shrink-0"
|
|
633
|
+
}), /* @__PURE__ */ J("span", { children: L })]
|
|
634
|
+
}) : null,
|
|
635
|
+
/* @__PURE__ */ Y("div", { children: [/* @__PURE__ */ J(o, {
|
|
636
|
+
htmlFor: "bulk-custom-email-subject",
|
|
637
|
+
children: "Subject"
|
|
638
|
+
}), /* @__PURE__ */ J("input", {
|
|
639
|
+
id: "bulk-custom-email-subject",
|
|
640
|
+
type: "text",
|
|
641
|
+
value: f,
|
|
642
|
+
onChange: (e) => p(e.target.value),
|
|
643
|
+
placeholder: "e.g. An update on your application",
|
|
644
|
+
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"
|
|
645
|
+
})] }),
|
|
646
|
+
/* @__PURE__ */ Y("div", { children: [/* @__PURE__ */ J(o, {
|
|
647
|
+
htmlFor: "bulk-custom-email-message",
|
|
648
|
+
children: "Message"
|
|
649
|
+
}), /* @__PURE__ */ J("div", {
|
|
650
|
+
className: "mt-1.5",
|
|
651
|
+
children: /* @__PURE__ */ J(S, {
|
|
652
|
+
id: "bulk-custom-email-message",
|
|
653
|
+
value: h,
|
|
654
|
+
onChange: g,
|
|
655
|
+
placeholder: "Type your message… This will be sent as a branded email to every selected candidate.",
|
|
656
|
+
"aria-required": !0
|
|
657
|
+
})
|
|
658
|
+
})] }),
|
|
659
|
+
/* @__PURE__ */ Y("p", {
|
|
660
|
+
className: "text-xs text-text-secondary",
|
|
661
|
+
children: [
|
|
662
|
+
j,
|
|
663
|
+
" selected candidate",
|
|
664
|
+
j === 1 ? "" : "s",
|
|
665
|
+
" ",
|
|
666
|
+
"will each receive their own copy of this email."
|
|
667
|
+
]
|
|
668
|
+
}),
|
|
669
|
+
/* @__PURE__ */ Y(i, { children: [/* @__PURE__ */ J(e, {
|
|
670
|
+
variant: "outline",
|
|
671
|
+
onClick: s,
|
|
672
|
+
disabled: D,
|
|
673
|
+
children: "Cancel"
|
|
674
|
+
}), /* @__PURE__ */ Y(e, {
|
|
675
|
+
onClick: () => void z(),
|
|
676
|
+
disabled: !R,
|
|
677
|
+
children: [D ? /* @__PURE__ */ J(G, {
|
|
678
|
+
size: 16,
|
|
679
|
+
className: "mr-2 animate-spin"
|
|
680
|
+
}) : /* @__PURE__ */ J(K, { size: 16 }), D ? "Sending…" : "Send Email"]
|
|
681
|
+
})] })
|
|
682
|
+
]
|
|
683
|
+
})]
|
|
684
|
+
})
|
|
685
|
+
});
|
|
686
|
+
}
|
|
687
|
+
function De({ open: t, onClose: d, targets: f, selection: p, previewLoading: m, previewError: h }) {
|
|
688
|
+
let _ = _e(), [v, y] = W(null), [S, C] = W(null), [T, E] = W(N), [D, O] = W(null), [A, j] = W(!1), [M, P] = W(!1);
|
|
689
|
+
de(() => {
|
|
690
|
+
t && (y(null), C(null), E(N()), O(null), j(!1), P(!1));
|
|
691
|
+
}, [t]);
|
|
692
|
+
let F = fe(() => Se(f, p), [p, f]), I = oe(p), L = F.length === I, R = F.map((e) => e.id), z = h;
|
|
693
|
+
!z && !m && !L && (z = "Some selected candidate details are unavailable. Refresh the selection before updating.");
|
|
694
|
+
let B = !M && !A && !m && !z && L && R.length > 0 && v !== null, V = async () => {
|
|
695
|
+
if (!B || v === null) return;
|
|
696
|
+
P(!0), j(!0), O(null), E(N());
|
|
697
|
+
let e = await ie({
|
|
698
|
+
items: R,
|
|
699
|
+
initialAggregate: N(),
|
|
700
|
+
onProgress: C,
|
|
701
|
+
executeChunk: async (e) => {
|
|
702
|
+
let t = (await X(g, { input: {
|
|
703
|
+
applicationIds: [...e],
|
|
704
|
+
status: v
|
|
705
|
+
} }, "BulkUpdateApplicationStatus")).bulkUpdateApplicationStatus;
|
|
706
|
+
if (!t) throw Error("The bulk status update request returned no result.");
|
|
707
|
+
let n = {
|
|
708
|
+
succeeded: t.succeeded.map((e) => ({
|
|
709
|
+
applicationId: e.id,
|
|
710
|
+
status: e.status
|
|
711
|
+
})),
|
|
712
|
+
failed: t.failed.map((e) => ({
|
|
713
|
+
applicationId: e.applicationId,
|
|
714
|
+
message: e.message
|
|
715
|
+
}))
|
|
716
|
+
};
|
|
717
|
+
return k([...e], n), n;
|
|
718
|
+
},
|
|
719
|
+
mergeResult: w
|
|
720
|
+
});
|
|
721
|
+
E(e.aggregate), e.error && O({
|
|
722
|
+
knownCompleted: e.processedItems.length,
|
|
723
|
+
ambiguous: e.ambiguousItems.length,
|
|
724
|
+
notStarted: e.notStartedItems.length,
|
|
725
|
+
message: xe(e.error)
|
|
726
|
+
}), re(ae({
|
|
727
|
+
succeeded: e.aggregate.succeeded.length,
|
|
728
|
+
skipped: 0,
|
|
729
|
+
failed: e.aggregate.failed.length,
|
|
730
|
+
ambiguous: !!e.error
|
|
731
|
+
})), P(!1), _.refetchQueries({ include: ["GetJobApplications"] }).catch(() => void 0);
|
|
732
|
+
};
|
|
733
|
+
return /* @__PURE__ */ J(n, {
|
|
734
|
+
open: t,
|
|
735
|
+
onOpenChange: (e) => {
|
|
736
|
+
!e && !M && d();
|
|
737
|
+
},
|
|
738
|
+
children: /* @__PURE__ */ Y(r, {
|
|
739
|
+
className: "sm:max-w-md",
|
|
740
|
+
children: [/* @__PURE__ */ Y(te, { children: [/* @__PURE__ */ J(a, { children: "Update Status" }), /* @__PURE__ */ J(ee, { children: "Set the same status on every selected candidate — e.g. mark everyone you just sent a bulk email as \"Email Sent\" so a later send doesn't reach them twice, then move them back to their real stage once you decide the outcome." })] }), A ? /* @__PURE__ */ Y("div", {
|
|
741
|
+
className: "space-y-4",
|
|
742
|
+
children: [
|
|
743
|
+
S ? /* @__PURE__ */ J(se, { progress: S }) : null,
|
|
744
|
+
/* @__PURE__ */ J(ce, { result: T }),
|
|
745
|
+
D ? /* @__PURE__ */ J(U, { details: D }) : null,
|
|
746
|
+
/* @__PURE__ */ J(i, { children: /* @__PURE__ */ J(e, {
|
|
747
|
+
onClick: d,
|
|
748
|
+
disabled: M,
|
|
749
|
+
children: "Done"
|
|
750
|
+
}) })
|
|
751
|
+
]
|
|
752
|
+
}) : /* @__PURE__ */ Y("div", {
|
|
753
|
+
className: "space-y-4",
|
|
754
|
+
children: [
|
|
755
|
+
m ? /* @__PURE__ */ Y("div", {
|
|
756
|
+
className: "flex items-center gap-2 text-sm text-text-secondary",
|
|
757
|
+
children: [/* @__PURE__ */ J(G, {
|
|
758
|
+
size: 14,
|
|
759
|
+
className: "animate-spin"
|
|
760
|
+
}), "Refreshing candidates…"]
|
|
761
|
+
}) : null,
|
|
762
|
+
z ? /* @__PURE__ */ Y("div", {
|
|
763
|
+
className: "flex items-start gap-2 text-sm text-status-error-text",
|
|
764
|
+
role: "alert",
|
|
765
|
+
children: [/* @__PURE__ */ J(pe, {
|
|
766
|
+
size: 14,
|
|
767
|
+
className: "mt-0.5 shrink-0"
|
|
768
|
+
}), /* @__PURE__ */ J("span", { children: z })]
|
|
769
|
+
}) : null,
|
|
770
|
+
/* @__PURE__ */ Y("div", { children: [/* @__PURE__ */ J(o, {
|
|
771
|
+
htmlFor: "bulk-status-update-status",
|
|
772
|
+
children: "New status"
|
|
773
|
+
}), /* @__PURE__ */ Y(s, {
|
|
774
|
+
value: v ?? "",
|
|
775
|
+
onValueChange: (e) => y(e),
|
|
776
|
+
children: [/* @__PURE__ */ J(u, {
|
|
777
|
+
id: "bulk-status-update-status",
|
|
778
|
+
className: "mt-1.5",
|
|
779
|
+
children: /* @__PURE__ */ J(ne, { placeholder: "Select a status" })
|
|
780
|
+
}), /* @__PURE__ */ J(c, { children: x.map((e) => /* @__PURE__ */ J(l, {
|
|
781
|
+
value: e,
|
|
782
|
+
children: b[e] || e
|
|
783
|
+
}, e)) })]
|
|
784
|
+
})] }),
|
|
785
|
+
/* @__PURE__ */ Y("p", {
|
|
786
|
+
className: "text-xs text-text-secondary",
|
|
787
|
+
children: [
|
|
788
|
+
I,
|
|
789
|
+
" selected candidate",
|
|
790
|
+
I === 1 ? "" : "s",
|
|
791
|
+
" ",
|
|
792
|
+
"will be moved to this status."
|
|
793
|
+
]
|
|
794
|
+
}),
|
|
795
|
+
/* @__PURE__ */ Y(i, { children: [/* @__PURE__ */ J(e, {
|
|
796
|
+
variant: "outline",
|
|
797
|
+
onClick: d,
|
|
798
|
+
disabled: M,
|
|
799
|
+
children: "Cancel"
|
|
800
|
+
}), /* @__PURE__ */ Y(e, {
|
|
801
|
+
onClick: () => void V(),
|
|
802
|
+
disabled: !B,
|
|
803
|
+
children: [M ? /* @__PURE__ */ J(G, {
|
|
804
|
+
size: 16,
|
|
805
|
+
className: "mr-2 animate-spin"
|
|
806
|
+
}) : /* @__PURE__ */ J(q, { size: 16 }), M ? "Updating…" : "Update Status"]
|
|
807
|
+
})] })
|
|
808
|
+
]
|
|
809
|
+
})]
|
|
810
|
+
})
|
|
811
|
+
});
|
|
812
|
+
}
|
|
549
813
|
//#endregion
|
|
550
|
-
export {
|
|
814
|
+
export { we as AddSelectedToRoundDialog, Ce as BulkCandidateSendDialog, Ee as BulkCustomEmailDialog, De as BulkStatusUpdateDialog, Te as NotifyDuplicateApplicantsDialog, ye as isAssignmentRoundConfig };
|
|
551
815
|
|
|
552
816
|
//# sourceMappingURL=BulkCandidateDialogs.js.map
|