@burdenoff/microfe-support 2026.819.1 → 2026.819.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/support/components/careers/BulkCandidateDialogs.d.ts +4 -0
- package/dist/support/components/careers/BulkCandidateDialogs.js +179 -174
- package/dist/support/components/careers/BulkCandidateDialogs.js.map +1 -1
- package/dist/support/pages/JobApplicationsPage.js +251 -249
- package/dist/support/pages/JobApplicationsPage.js.map +1 -1
- package/dist/support/utils/bulkCandidateTargetQuery.d.ts +10 -0
- package/dist/support/utils/bulkCandidateTargetQuery.js +14 -0
- package/dist/support/utils/bulkCandidateTargetQuery.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import { type GetJobPostingQuery } from '../../../generated/global-operations';
|
|
1
2
|
import { type BulkCandidateTarget, type CandidateSelectionState } from '../../utils/bulkCandidateOperations';
|
|
3
|
+
type JobPostingRoundConfig = NonNullable<GetJobPostingQuery['jobPosting']>['rounds'][number];
|
|
2
4
|
export type BulkCandidateDialogMode = 'message' | 'assignment';
|
|
5
|
+
type AssignmentRoundConfig = Pick<JobPostingRoundConfig, 'isAssignmentRound' | 'roundType'>;
|
|
6
|
+
export declare function isAssignmentRoundConfig(round: AssignmentRoundConfig): boolean;
|
|
3
7
|
interface SharedDialogProps {
|
|
4
8
|
open: boolean;
|
|
5
9
|
onClose: () => void;
|
|
@@ -1,27 +1,31 @@
|
|
|
1
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 ne, Label as a, Select as re, SelectContent as ie, SelectItem as ae, SelectTrigger as oe, SelectValue as se, Textarea as o } from "../ui.js";
|
|
2
|
-
import { BulkEnsureInterviewRoundsDocument as s, BulkRandomizeAndSendAssignmentDocument as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
2
|
+
import { BulkEnsureInterviewRoundsDocument as s, BulkRandomizeAndSendAssignmentDocument as ce, BulkSendRoundMessageDocument as c, useGetJobPostingQuery as le } from "../../../generated/global-operations.js";
|
|
3
|
+
import { InterviewRoundType as l } from "../../../generated/global-types.js";
|
|
4
|
+
import { nativeNotify as ue } from "../../../utils/nativeBridge.js";
|
|
5
|
+
import { CandidateChunkPreconditionError as u, aggregateCandidateEmailResult as de, aggregateEnsureRoundResult as fe, assertCandidateChunkMatchesCurrentScope as d, assertCandidateEmailChunkMatchesCurrentScope as pe, assertCompleteCandidateEmailChunkResult as f, assertCompleteEnsureRoundChunkResult as p, createEmptyCandidateEmailAggregate as m, createEmptyEnsureRoundAggregate as h, executeSequentialCandidateChunks as me, getBulkOperationNotificationSeverity as he, getCandidateSelectionCount as ge, getSelectedCandidateIds as g, hasCandidateEmailType as _, resolveExactCandidateRounds as v } from "../../utils/bulkCandidateOperations.js";
|
|
6
|
+
import { BulkCandidateActionGuidance as _e } from "./BulkCandidateActionGuidance.js";
|
|
7
|
+
import { BulkOperationProgress as ve, CandidateEmailResultDetails as y, EnsureRoundResultDetails as ye, StoppedBulkOperationNotice as be } from "./BulkOperationFeedback.js";
|
|
8
|
+
import { useEffect as xe, useMemo as Se, useState as b } from "react";
|
|
9
|
+
import { AlertCircle as Ce, Loader2 as x, Send as S, UserPlus as we } from "lucide-react";
|
|
10
|
+
import { graphqlFetch as C } from "@burdenoff/fe-libs/shared/graphql/fetch";
|
|
11
|
+
import { jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
12
|
+
import { useApolloClient as Te } from "@apollo/client/react";
|
|
13
|
+
import { print as E } from "graphql";
|
|
13
14
|
//#region src/support/components/careers/BulkCandidateDialogs.tsx
|
|
14
|
-
|
|
15
|
+
function D(e) {
|
|
16
|
+
return e.isAssignmentRound || e.roundType === l.TakeHome;
|
|
17
|
+
}
|
|
18
|
+
var O = {
|
|
15
19
|
message: "ROUND_MESSAGE",
|
|
16
20
|
assignment: "ASSIGNMENT"
|
|
17
21
|
};
|
|
18
|
-
function
|
|
22
|
+
function Ee(e) {
|
|
19
23
|
return e instanceof Error ? e.message : "The request failed without an error message.";
|
|
20
24
|
}
|
|
21
|
-
async function
|
|
22
|
-
let r = await
|
|
25
|
+
async function k(e, t, n) {
|
|
26
|
+
let r = await C({
|
|
23
27
|
gateway: "global",
|
|
24
|
-
query:
|
|
28
|
+
query: E(e),
|
|
25
29
|
variables: t,
|
|
26
30
|
operationName: n,
|
|
27
31
|
skipAuthRetry: !0
|
|
@@ -30,47 +34,47 @@ async function A(e, t, n) {
|
|
|
30
34
|
if (!r.data) throw Error(`${n} returned no data.`);
|
|
31
35
|
return r.data;
|
|
32
36
|
}
|
|
33
|
-
function
|
|
34
|
-
let n =
|
|
37
|
+
function De(e, t) {
|
|
38
|
+
let n = g(t);
|
|
35
39
|
return e.filter((e) => n.has(e.id));
|
|
36
40
|
}
|
|
37
|
-
async function
|
|
41
|
+
async function Oe(e, t) {
|
|
38
42
|
try {
|
|
39
43
|
return await e(t);
|
|
40
44
|
} catch (e) {
|
|
41
|
-
throw new u(`Candidate scope revalidation failed before this chunk: ${
|
|
45
|
+
throw new u(`Candidate scope revalidation failed before this chunk: ${Ee(e)}`);
|
|
42
46
|
}
|
|
43
47
|
}
|
|
44
|
-
function
|
|
45
|
-
let
|
|
46
|
-
variables: { id:
|
|
47
|
-
skip: !
|
|
48
|
+
function A({ mode: s, open: l, onClose: u, onOpenAddRound: fe, targets: d, selection: p, jobPostingId: h, previewLoading: g, previewError: ye, refreshTargets: C }) {
|
|
49
|
+
let E = Te(), [A, j] = b(""), [M, N] = b(""), [P, F] = b(!1), [I, L] = b(null), [ke, R] = b(m), [z, B] = b(null), [V, H] = b(!1), [U, W] = b(!1), { data: Ae, loading: G, error: je } = le({
|
|
50
|
+
variables: { id: h },
|
|
51
|
+
skip: !l || !h,
|
|
48
52
|
fetchPolicy: "network-only"
|
|
49
53
|
});
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}, [
|
|
53
|
-
let
|
|
54
|
+
xe(() => {
|
|
55
|
+
l && (j(""), N(""), F(!1), L(null), R(m()), B(null), H(!1), W(!1));
|
|
56
|
+
}, [l, s]);
|
|
57
|
+
let K = Se(() => De(d, p), [p, d]), Me = ge(p), q = K.length === Me, Ne = Ae?.jobPosting?.rounds ?? [], Pe = Ne.filter((e) => s !== "assignment" || D(e)), J = Ne.find((e) => e.id === A), Y = J ? v(K, J.id) : {
|
|
54
58
|
pairs: [],
|
|
55
59
|
unresolved: []
|
|
56
|
-
},
|
|
57
|
-
!Q &&
|
|
58
|
-
let
|
|
59
|
-
if (
|
|
60
|
-
|
|
61
|
-
let e = await
|
|
60
|
+
}, Fe = Y.unresolved.filter((e) => e.reason === "MISSING").length, X = Y.unresolved.filter((e) => e.reason === "AMBIGUOUS").length, Ie = O[s], Le = Y.pairs.filter(({ round: e }) => _(e, Ie)).length, Z = Y.pairs.filter(({ round: e }) => P || !_(e, Ie)).length, Re = K.some((e) => e.jobPostingId !== h), Q = ye;
|
|
61
|
+
!Q && je ? Q = "Could not load the posting rounds. Nothing will be sent." : !Q && !g && !q ? Q = "Some selected candidate details are unavailable. Refresh the selection before sending." : !Q && Re ? Q = "Some selected candidates do not belong to the filtered posting." : !Q && A && !G && !J ? Q = "The selected round is no longer available. Choose another round." : !Q && X > 0 && (Q = `${X} selected candidate${X === 1 ? " has" : "s have"} multiple concrete rounds for this configuration. Nothing will be sent until the data is corrected.`);
|
|
62
|
+
let ze = async () => {
|
|
63
|
+
if (U || V || g || G || Q || !q || !J || Y.pairs.length === 0 || Z === 0 || s === "message" && !M.trim()) return;
|
|
64
|
+
W(!0), H(!0), B(null), R(m());
|
|
65
|
+
let e = await me({
|
|
62
66
|
items: Y.pairs.map(({ applicationId: e, roundId: t }) => ({
|
|
63
67
|
applicationId: e,
|
|
64
68
|
roundId: t
|
|
65
69
|
})),
|
|
66
|
-
initialAggregate:
|
|
67
|
-
onProgress:
|
|
70
|
+
initialAggregate: m(),
|
|
71
|
+
onProgress: L,
|
|
68
72
|
executeChunk: async (e) => {
|
|
69
|
-
let t = await
|
|
70
|
-
if (
|
|
71
|
-
let t = (await
|
|
73
|
+
let t = await Oe(C, e.map((e) => e.applicationId));
|
|
74
|
+
if (pe(e, t, h, J.id), s === "assignment") {
|
|
75
|
+
let t = (await k(ce, { input: {
|
|
72
76
|
items: [...e],
|
|
73
|
-
force:
|
|
77
|
+
force: P
|
|
74
78
|
} }, "BulkRandomizeAndSendAssignment")).bulkRandomizeAndSendAssignment;
|
|
75
79
|
if (!t) throw Error("The assignment request returned no result.");
|
|
76
80
|
let n = {
|
|
@@ -90,12 +94,12 @@ function j({ mode: s, open: u, onClose: f, onOpenAddRound: ue, targets: m, selec
|
|
|
90
94
|
message: e.message
|
|
91
95
|
}))
|
|
92
96
|
};
|
|
93
|
-
return
|
|
97
|
+
return f(e, n), n;
|
|
94
98
|
}
|
|
95
|
-
let n = (await
|
|
99
|
+
let n = (await k(c, { input: {
|
|
96
100
|
items: [...e],
|
|
97
|
-
message:
|
|
98
|
-
force:
|
|
101
|
+
message: M.trim(),
|
|
102
|
+
force: P
|
|
99
103
|
} }, "BulkSendRoundMessage")).bulkSendRoundMessage;
|
|
100
104
|
if (!n) throw Error("The message request returned no result.");
|
|
101
105
|
let r = {
|
|
@@ -115,80 +119,80 @@ function j({ mode: s, open: u, onClose: f, onOpenAddRound: ue, targets: m, selec
|
|
|
115
119
|
message: e.message
|
|
116
120
|
}))
|
|
117
121
|
};
|
|
118
|
-
return
|
|
122
|
+
return f(e, r), r;
|
|
119
123
|
},
|
|
120
|
-
mergeResult:
|
|
124
|
+
mergeResult: de
|
|
121
125
|
});
|
|
122
|
-
|
|
126
|
+
R(e.aggregate), e.error && B({
|
|
123
127
|
knownCompleted: e.processedItems.length,
|
|
124
128
|
ambiguous: e.ambiguousItems.length,
|
|
125
129
|
notStarted: e.notStartedItems.length,
|
|
126
|
-
message:
|
|
127
|
-
}),
|
|
130
|
+
message: Ee(e.error)
|
|
131
|
+
}), ue(he({
|
|
128
132
|
succeeded: e.aggregate.succeeded.length,
|
|
129
133
|
skipped: e.aggregate.skipped.length,
|
|
130
134
|
failed: e.aggregate.failed.length,
|
|
131
135
|
ambiguous: !!e.error
|
|
132
|
-
})),
|
|
133
|
-
}, $ =
|
|
134
|
-
return /* @__PURE__ */
|
|
135
|
-
open:
|
|
136
|
+
})), W(!1), E.refetchQueries({ include: ["GetJobApplications", "GetJobApplicationInterviewRounds"] }).catch(() => void 0);
|
|
137
|
+
}, $ = g || G;
|
|
138
|
+
return /* @__PURE__ */ w(n, {
|
|
139
|
+
open: l,
|
|
136
140
|
onOpenChange: (e) => {
|
|
137
|
-
!e && !
|
|
141
|
+
!e && !U && u();
|
|
138
142
|
},
|
|
139
|
-
children: /* @__PURE__ */
|
|
143
|
+
children: /* @__PURE__ */ T(r, {
|
|
140
144
|
className: "sm:max-w-xl max-h-[90vh] overflow-y-auto",
|
|
141
145
|
children: [
|
|
142
|
-
/* @__PURE__ */
|
|
143
|
-
/* @__PURE__ */
|
|
146
|
+
/* @__PURE__ */ T(te, { children: [/* @__PURE__ */ w(ne, { children: s === "assignment" ? "Assign & Email Random Take-Home" : "Send Message" }), /* @__PURE__ */ w(ee, { children: "Choose one configured round for the candidates in the filtered posting." })] }),
|
|
147
|
+
/* @__PURE__ */ w(_e, {
|
|
144
148
|
action: s,
|
|
145
|
-
unresolvedCount:
|
|
149
|
+
unresolvedCount: Fe
|
|
146
150
|
}),
|
|
147
|
-
|
|
151
|
+
V ? /* @__PURE__ */ T("div", {
|
|
148
152
|
className: "space-y-4",
|
|
149
153
|
children: [
|
|
150
|
-
|
|
151
|
-
/* @__PURE__ */
|
|
152
|
-
|
|
153
|
-
/* @__PURE__ */
|
|
154
|
-
onClick:
|
|
155
|
-
disabled:
|
|
154
|
+
I ? /* @__PURE__ */ w(ve, { progress: I }) : null,
|
|
155
|
+
/* @__PURE__ */ w(y, { result: ke }),
|
|
156
|
+
z ? /* @__PURE__ */ w(be, { details: z }) : null,
|
|
157
|
+
/* @__PURE__ */ w(i, { children: /* @__PURE__ */ w(e, {
|
|
158
|
+
onClick: u,
|
|
159
|
+
disabled: U,
|
|
156
160
|
children: "Done"
|
|
157
161
|
}) })
|
|
158
162
|
]
|
|
159
|
-
}) : /* @__PURE__ */
|
|
163
|
+
}) : /* @__PURE__ */ T("div", {
|
|
160
164
|
className: "space-y-4",
|
|
161
165
|
children: [
|
|
162
|
-
$ ? /* @__PURE__ */
|
|
166
|
+
$ ? /* @__PURE__ */ T("div", {
|
|
163
167
|
className: "flex items-center gap-2 text-sm text-text-secondary",
|
|
164
|
-
children: [/* @__PURE__ */
|
|
168
|
+
children: [/* @__PURE__ */ w(x, {
|
|
165
169
|
size: 14,
|
|
166
170
|
className: "animate-spin"
|
|
167
171
|
}), "Refreshing candidates and configured rounds…"]
|
|
168
172
|
}) : null,
|
|
169
|
-
Q ? /* @__PURE__ */
|
|
173
|
+
Q ? /* @__PURE__ */ T("div", {
|
|
170
174
|
className: "flex items-start gap-2 text-sm text-status-error-text",
|
|
171
175
|
role: "alert",
|
|
172
|
-
children: [/* @__PURE__ */
|
|
176
|
+
children: [/* @__PURE__ */ w(Ce, {
|
|
173
177
|
size: 14,
|
|
174
178
|
className: "mt-0.5 shrink-0"
|
|
175
|
-
}), /* @__PURE__ */
|
|
179
|
+
}), /* @__PURE__ */ w("span", { children: Q })]
|
|
176
180
|
}) : null,
|
|
177
|
-
/* @__PURE__ */
|
|
181
|
+
/* @__PURE__ */ T("div", {
|
|
178
182
|
className: "space-y-1.5",
|
|
179
183
|
children: [
|
|
180
|
-
/* @__PURE__ */
|
|
184
|
+
/* @__PURE__ */ w(a, {
|
|
181
185
|
htmlFor: "bulk-round-config",
|
|
182
186
|
children: "Target round"
|
|
183
187
|
}),
|
|
184
|
-
/* @__PURE__ */
|
|
185
|
-
value:
|
|
186
|
-
onValueChange:
|
|
188
|
+
/* @__PURE__ */ T(re, {
|
|
189
|
+
value: A,
|
|
190
|
+
onValueChange: j,
|
|
187
191
|
disabled: $ || !!Q,
|
|
188
|
-
children: [/* @__PURE__ */
|
|
192
|
+
children: [/* @__PURE__ */ w(oe, {
|
|
189
193
|
id: "bulk-round-config",
|
|
190
|
-
children: /* @__PURE__ */
|
|
191
|
-
}), /* @__PURE__ */
|
|
194
|
+
children: /* @__PURE__ */ w(se, { placeholder: "Select a round" })
|
|
195
|
+
}), /* @__PURE__ */ w(ie, { children: Pe.map((e) => /* @__PURE__ */ T(ae, {
|
|
192
196
|
value: e.id,
|
|
193
197
|
children: [
|
|
194
198
|
"Round ",
|
|
@@ -198,35 +202,35 @@ function j({ mode: s, open: u, onClose: f, onOpenAddRound: ue, targets: m, selec
|
|
|
198
202
|
]
|
|
199
203
|
}, e.id)) })]
|
|
200
204
|
}),
|
|
201
|
-
|
|
205
|
+
Pe.length === 0 && !$ && !Q ? /* @__PURE__ */ w("p", {
|
|
202
206
|
className: "text-xs text-status-warning-text",
|
|
203
207
|
children: s === "assignment" ? "This posting has no configured assignment round." : "This posting has no configured interview rounds."
|
|
204
208
|
}) : null
|
|
205
209
|
]
|
|
206
210
|
}),
|
|
207
|
-
s === "message" ? /* @__PURE__ */
|
|
211
|
+
s === "message" ? /* @__PURE__ */ T("div", {
|
|
208
212
|
className: "space-y-1.5",
|
|
209
|
-
children: [/* @__PURE__ */
|
|
213
|
+
children: [/* @__PURE__ */ w(a, {
|
|
210
214
|
htmlFor: "bulk-message",
|
|
211
215
|
children: "Free-text message"
|
|
212
|
-
}), /* @__PURE__ */
|
|
216
|
+
}), /* @__PURE__ */ w(o, {
|
|
213
217
|
id: "bulk-message",
|
|
214
|
-
value:
|
|
215
|
-
onChange: (e) =>
|
|
218
|
+
value: M,
|
|
219
|
+
onChange: (e) => N(e.target.value),
|
|
216
220
|
placeholder: "Write the message sent to each candidate",
|
|
217
221
|
rows: 5
|
|
218
222
|
})]
|
|
219
223
|
}) : null,
|
|
220
|
-
|
|
224
|
+
A && !$ && !Q ? /* @__PURE__ */ T("div", {
|
|
221
225
|
className: "space-y-2 rounded-md border border-border-seam bg-bg-sunken/30 p-3 text-xs text-text-secondary",
|
|
222
226
|
children: [
|
|
223
|
-
/* @__PURE__ */
|
|
227
|
+
/* @__PURE__ */ w("p", {
|
|
224
228
|
className: "font-medium text-text-primary",
|
|
225
229
|
children: "Preview"
|
|
226
230
|
}),
|
|
227
|
-
/* @__PURE__ */
|
|
231
|
+
/* @__PURE__ */ T("p", { children: [
|
|
228
232
|
"Will send to ",
|
|
229
|
-
/* @__PURE__ */
|
|
233
|
+
/* @__PURE__ */ w("span", {
|
|
230
234
|
className: "font-semibold",
|
|
231
235
|
children: Z
|
|
232
236
|
}),
|
|
@@ -234,41 +238,41 @@ function j({ mode: s, open: u, onClose: f, onOpenAddRound: ue, targets: m, selec
|
|
|
234
238
|
Z === 1 ? "" : "s",
|
|
235
239
|
"."
|
|
236
240
|
] }),
|
|
237
|
-
|
|
238
|
-
|
|
241
|
+
Le > 0 ? /* @__PURE__ */ T("p", { children: [
|
|
242
|
+
Le,
|
|
239
243
|
" already received this email type",
|
|
240
244
|
" ",
|
|
241
|
-
|
|
245
|
+
P ? "(force will send again)" : "(the backend will skip them)",
|
|
242
246
|
"."
|
|
243
247
|
] }) : null,
|
|
244
|
-
|
|
248
|
+
Fe > 0 ? /* @__PURE__ */ T(e, {
|
|
245
249
|
type: "button",
|
|
246
250
|
size: "sm",
|
|
247
251
|
variant: "outline",
|
|
248
|
-
onClick:
|
|
249
|
-
children: [/* @__PURE__ */
|
|
252
|
+
onClick: fe,
|
|
253
|
+
children: [/* @__PURE__ */ w(we, { size: 14 }), "Add Selected to Round"]
|
|
250
254
|
}) : null,
|
|
251
|
-
/* @__PURE__ */
|
|
255
|
+
/* @__PURE__ */ T("label", {
|
|
252
256
|
className: "flex cursor-pointer items-start gap-2 pt-1",
|
|
253
|
-
children: [/* @__PURE__ */
|
|
254
|
-
checked:
|
|
255
|
-
onCheckedChange: (e) =>
|
|
256
|
-
}), /* @__PURE__ */
|
|
257
|
+
children: [/* @__PURE__ */ w(t, {
|
|
258
|
+
checked: P,
|
|
259
|
+
onCheckedChange: (e) => F(e === !0)
|
|
260
|
+
}), /* @__PURE__ */ w("span", { children: "Force resend to candidates with a prior email. Force sends are non-idempotent and are never retried automatically." })]
|
|
257
261
|
})
|
|
258
262
|
]
|
|
259
263
|
}) : null,
|
|
260
|
-
/* @__PURE__ */
|
|
264
|
+
/* @__PURE__ */ T(i, { children: [/* @__PURE__ */ w(e, {
|
|
261
265
|
variant: "outline",
|
|
262
|
-
onClick:
|
|
263
|
-
disabled:
|
|
266
|
+
onClick: u,
|
|
267
|
+
disabled: U,
|
|
264
268
|
children: "Cancel"
|
|
265
|
-
}), /* @__PURE__ */
|
|
266
|
-
onClick: () => void
|
|
267
|
-
disabled:
|
|
268
|
-
children: [
|
|
269
|
+
}), /* @__PURE__ */ T(e, {
|
|
270
|
+
onClick: () => void ze(),
|
|
271
|
+
disabled: U || $ || !!Q || !q || !A || Y.pairs.length === 0 || Z === 0 || s === "message" && !M.trim(),
|
|
272
|
+
children: [U ? /* @__PURE__ */ w(x, {
|
|
269
273
|
size: 16,
|
|
270
274
|
className: "mr-2 animate-spin"
|
|
271
|
-
}) : /* @__PURE__ */
|
|
275
|
+
}) : /* @__PURE__ */ w(S, { size: 16 }), U ? "Sending…" : "Send"]
|
|
272
276
|
})] })
|
|
273
277
|
]
|
|
274
278
|
})
|
|
@@ -276,30 +280,30 @@ function j({ mode: s, open: u, onClose: f, onOpenAddRound: ue, targets: m, selec
|
|
|
276
280
|
})
|
|
277
281
|
});
|
|
278
282
|
}
|
|
279
|
-
function
|
|
280
|
-
let
|
|
281
|
-
variables: { id:
|
|
282
|
-
skip: !t || !
|
|
283
|
+
function j({ open: t, onClose: o, targets: ce, selection: c, jobPostingId: l, previewLoading: u, previewError: de, refreshTargets: pe }) {
|
|
284
|
+
let f = Te(), [m, g] = b(""), [_, v] = b(null), [_e, y] = b(h), [S, C] = b(null), [E, D] = b(!1), [O, A] = b(!1), { data: j, loading: M, error: N } = le({
|
|
285
|
+
variables: { id: l },
|
|
286
|
+
skip: !t || !l,
|
|
283
287
|
fetchPolicy: "network-only"
|
|
284
288
|
});
|
|
285
|
-
|
|
286
|
-
t && (
|
|
289
|
+
xe(() => {
|
|
290
|
+
t && (g(""), v(null), y(h()), C(null), D(!1), A(!1));
|
|
287
291
|
}, [t]);
|
|
288
|
-
let
|
|
289
|
-
!
|
|
290
|
-
let
|
|
291
|
-
if (
|
|
292
|
-
|
|
293
|
-
let e = await
|
|
294
|
-
items:
|
|
295
|
-
initialAggregate:
|
|
296
|
-
onProgress:
|
|
292
|
+
let P = Se(() => De(ce, c), [c, ce]), F = ge(c), I = P.length === F, L = P.map((e) => e.id), ke = P.some((e) => e.jobPostingId !== l), R = j?.jobPosting?.rounds ?? [], z = R.find((e) => e.id === m), B = de;
|
|
293
|
+
!B && N ? B = "Could not load the posting rounds. Nothing will be changed." : !B && !u && !I ? B = "Some selected candidate details are unavailable. Refresh the selection before adding rounds." : !B && ke ? B = "Some selected candidates do not belong to the filtered posting." : !B && m && !M && !z && (B = "The selected round is no longer available. Choose another round.");
|
|
294
|
+
let V = async () => {
|
|
295
|
+
if (O || E || u || M || B || !I || !z || L.length === 0) return;
|
|
296
|
+
A(!0), D(!0), C(null), y(h());
|
|
297
|
+
let e = await me({
|
|
298
|
+
items: L,
|
|
299
|
+
initialAggregate: h(),
|
|
300
|
+
onProgress: v,
|
|
297
301
|
executeChunk: async (e) => {
|
|
298
|
-
let t = await
|
|
299
|
-
|
|
300
|
-
let n = (await
|
|
301
|
-
jobPostingId:
|
|
302
|
-
roundConfigId:
|
|
302
|
+
let t = await Oe(pe, e);
|
|
303
|
+
d(e, t, l);
|
|
304
|
+
let n = (await k(s, { input: {
|
|
305
|
+
jobPostingId: l,
|
|
306
|
+
roundConfigId: z.id,
|
|
303
307
|
applicationIds: [...e]
|
|
304
308
|
} }, "BulkEnsureInterviewRounds")).bulkEnsureInterviewRounds;
|
|
305
309
|
if (!n) throw Error("The add-to-round request returned no result.");
|
|
@@ -318,80 +322,80 @@ function M({ open: t, onClose: o, targets: c, selection: l, jobPostingId: u, pre
|
|
|
318
322
|
message: e.message
|
|
319
323
|
}))
|
|
320
324
|
};
|
|
321
|
-
return
|
|
325
|
+
return p(e, r), r;
|
|
322
326
|
},
|
|
323
|
-
mergeResult:
|
|
327
|
+
mergeResult: fe
|
|
324
328
|
});
|
|
325
|
-
|
|
329
|
+
y(e.aggregate), e.error && C({
|
|
326
330
|
knownCompleted: e.processedItems.length,
|
|
327
331
|
ambiguous: e.ambiguousItems.length,
|
|
328
332
|
notStarted: e.notStartedItems.length,
|
|
329
|
-
message:
|
|
330
|
-
}),
|
|
333
|
+
message: Ee(e.error)
|
|
334
|
+
}), ue(he({
|
|
331
335
|
succeeded: e.aggregate.created.length + e.aggregate.alreadyPresent.length,
|
|
332
336
|
skipped: 0,
|
|
333
337
|
failed: e.aggregate.failed.length,
|
|
334
338
|
ambiguous: !!e.error
|
|
335
|
-
})),
|
|
336
|
-
},
|
|
337
|
-
return /* @__PURE__ */
|
|
339
|
+
})), A(!1), f.refetchQueries({ include: ["GetJobApplications", "GetJobApplicationInterviewRounds"] }).catch(() => void 0);
|
|
340
|
+
}, H = u || M;
|
|
341
|
+
return /* @__PURE__ */ w(n, {
|
|
338
342
|
open: t,
|
|
339
343
|
onOpenChange: (e) => {
|
|
340
|
-
!e && !
|
|
344
|
+
!e && !O && o();
|
|
341
345
|
},
|
|
342
|
-
children: /* @__PURE__ */
|
|
346
|
+
children: /* @__PURE__ */ T(r, {
|
|
343
347
|
className: "sm:max-w-xl max-h-[90vh] overflow-y-auto",
|
|
344
348
|
children: [
|
|
345
|
-
/* @__PURE__ */
|
|
346
|
-
/* @__PURE__ */
|
|
349
|
+
/* @__PURE__ */ T(te, { children: [/* @__PURE__ */ w(ne, { children: "Add Selected to Round" }), /* @__PURE__ */ w(ee, { children: "Add every selected candidate in this posting to one configured interview round." })] }),
|
|
350
|
+
/* @__PURE__ */ w("div", {
|
|
347
351
|
className: "rounded-md border border-border-seam bg-bg-sunken/30 p-3 text-sm text-text-secondary",
|
|
348
352
|
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."
|
|
349
353
|
}),
|
|
350
|
-
|
|
354
|
+
E ? /* @__PURE__ */ T("div", {
|
|
351
355
|
className: "space-y-4",
|
|
352
356
|
children: [
|
|
353
|
-
|
|
354
|
-
/* @__PURE__ */
|
|
355
|
-
|
|
356
|
-
/* @__PURE__ */
|
|
357
|
+
_ ? /* @__PURE__ */ w(ve, { progress: _ }) : null,
|
|
358
|
+
/* @__PURE__ */ w(ye, { result: _e }),
|
|
359
|
+
S ? /* @__PURE__ */ w(be, { details: S }) : null,
|
|
360
|
+
/* @__PURE__ */ w(i, { children: /* @__PURE__ */ w(e, {
|
|
357
361
|
onClick: o,
|
|
358
|
-
disabled:
|
|
362
|
+
disabled: O,
|
|
359
363
|
children: "Done"
|
|
360
364
|
}) })
|
|
361
365
|
]
|
|
362
|
-
}) : /* @__PURE__ */
|
|
366
|
+
}) : /* @__PURE__ */ T("div", {
|
|
363
367
|
className: "space-y-4",
|
|
364
368
|
children: [
|
|
365
|
-
|
|
369
|
+
H ? /* @__PURE__ */ T("div", {
|
|
366
370
|
className: "flex items-center gap-2 text-sm text-text-secondary",
|
|
367
|
-
children: [/* @__PURE__ */
|
|
371
|
+
children: [/* @__PURE__ */ w(x, {
|
|
368
372
|
size: 14,
|
|
369
373
|
className: "animate-spin"
|
|
370
374
|
}), "Refreshing candidates and configured rounds…"]
|
|
371
375
|
}) : null,
|
|
372
|
-
|
|
376
|
+
B ? /* @__PURE__ */ T("div", {
|
|
373
377
|
className: "flex items-start gap-2 text-sm text-status-error-text",
|
|
374
378
|
role: "alert",
|
|
375
|
-
children: [/* @__PURE__ */
|
|
379
|
+
children: [/* @__PURE__ */ w(Ce, {
|
|
376
380
|
size: 14,
|
|
377
381
|
className: "mt-0.5 shrink-0"
|
|
378
|
-
}), /* @__PURE__ */
|
|
382
|
+
}), /* @__PURE__ */ w("span", { children: B })]
|
|
379
383
|
}) : null,
|
|
380
|
-
/* @__PURE__ */
|
|
384
|
+
/* @__PURE__ */ T("div", {
|
|
381
385
|
className: "space-y-1.5",
|
|
382
386
|
children: [
|
|
383
|
-
/* @__PURE__ */
|
|
387
|
+
/* @__PURE__ */ w(a, {
|
|
384
388
|
htmlFor: "ensure-round-config",
|
|
385
389
|
children: "Interview round"
|
|
386
390
|
}),
|
|
387
|
-
/* @__PURE__ */
|
|
388
|
-
value:
|
|
389
|
-
onValueChange:
|
|
390
|
-
disabled:
|
|
391
|
-
children: [/* @__PURE__ */
|
|
391
|
+
/* @__PURE__ */ T(re, {
|
|
392
|
+
value: m,
|
|
393
|
+
onValueChange: g,
|
|
394
|
+
disabled: H || !!B,
|
|
395
|
+
children: [/* @__PURE__ */ w(oe, {
|
|
392
396
|
id: "ensure-round-config",
|
|
393
|
-
children: /* @__PURE__ */
|
|
394
|
-
}), /* @__PURE__ */
|
|
397
|
+
children: /* @__PURE__ */ w(se, { placeholder: "Select a round" })
|
|
398
|
+
}), /* @__PURE__ */ w(ie, { children: R.map((e) => /* @__PURE__ */ T(ae, {
|
|
395
399
|
value: e.id,
|
|
396
400
|
children: [
|
|
397
401
|
"Round ",
|
|
@@ -401,33 +405,34 @@ function M({ open: t, onClose: o, targets: c, selection: l, jobPostingId: u, pre
|
|
|
401
405
|
]
|
|
402
406
|
}, e.id)) })]
|
|
403
407
|
}),
|
|
404
|
-
|
|
408
|
+
R.length === 0 && !H && !B ? /* @__PURE__ */ w("p", {
|
|
405
409
|
className: "text-xs text-status-warning-text",
|
|
406
410
|
children: "This posting has no configured interview rounds."
|
|
407
411
|
}) : null
|
|
408
412
|
]
|
|
409
413
|
}),
|
|
410
|
-
/* @__PURE__ */
|
|
414
|
+
/* @__PURE__ */ T("p", {
|
|
411
415
|
className: "text-xs text-text-secondary",
|
|
412
416
|
children: [
|
|
413
|
-
|
|
417
|
+
F,
|
|
414
418
|
" selected candidate",
|
|
415
|
-
|
|
416
|
-
"
|
|
419
|
+
F === 1 ? "" : "s",
|
|
420
|
+
" ",
|
|
421
|
+
"will be checked. Existing target rounds are reported as already present."
|
|
417
422
|
]
|
|
418
423
|
}),
|
|
419
|
-
/* @__PURE__ */
|
|
424
|
+
/* @__PURE__ */ T(i, { children: [/* @__PURE__ */ w(e, {
|
|
420
425
|
variant: "outline",
|
|
421
426
|
onClick: o,
|
|
422
|
-
disabled:
|
|
427
|
+
disabled: O,
|
|
423
428
|
children: "Cancel"
|
|
424
|
-
}), /* @__PURE__ */
|
|
425
|
-
onClick: () => void
|
|
426
|
-
disabled:
|
|
427
|
-
children: [
|
|
429
|
+
}), /* @__PURE__ */ T(e, {
|
|
430
|
+
onClick: () => void V(),
|
|
431
|
+
disabled: O || H || !!B || !I || !m || L.length === 0,
|
|
432
|
+
children: [O ? /* @__PURE__ */ w(x, {
|
|
428
433
|
size: 16,
|
|
429
434
|
className: "mr-2 animate-spin"
|
|
430
|
-
}) : /* @__PURE__ */
|
|
435
|
+
}) : /* @__PURE__ */ w(we, { size: 16 }), O ? "Adding…" : "Add Selected to Round"]
|
|
431
436
|
})] })
|
|
432
437
|
]
|
|
433
438
|
})
|
|
@@ -436,6 +441,6 @@ function M({ open: t, onClose: o, targets: c, selection: l, jobPostingId: u, pre
|
|
|
436
441
|
});
|
|
437
442
|
}
|
|
438
443
|
//#endregion
|
|
439
|
-
export {
|
|
444
|
+
export { j as AddSelectedToRoundDialog, A as BulkCandidateSendDialog, D as isAssignmentRoundConfig };
|
|
440
445
|
|
|
441
446
|
//# sourceMappingURL=BulkCandidateDialogs.js.map
|