@burdenoff/microfe-support 2026.902.3 → 2026.903.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-types.d.ts +1 -0
- package/dist/generated/global-types.js +1 -1
- package/dist/generated/global-types.js.map +1 -1
- package/dist/support/components/careers/BulkCandidateDialogs.js +1 -1
- package/dist/support/constants/pipeline.js +3 -0
- package/dist/support/constants/pipeline.js.map +1 -1
- package/dist/support/pages/JobApplicationDetailPage.js +327 -353
- package/dist/support/pages/JobApplicationDetailPage.js.map +1 -1
- package/dist/support/pages/JobApplicationsPage.js +29 -29
- package/dist/support/utils/jobApplicationFilterParams.js +3 -11
- package/dist/support/utils/jobApplicationFilterParams.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,9 +2,9 @@ import { useSupport as e } from "../providers/SupportProvider.js";
|
|
|
2
2
|
import { Badge as t, Button as n, Checkbox as r, Dialog as i, DialogContent as ee, DialogDescription as te, DialogFooter as ne, DialogHeader as re, DialogTitle as ie, Input as a, Label as o, Select as ae, SelectContent as oe, SelectItem as se, SelectTrigger as ce, SelectValue as le, Textarea as ue } from "../components/ui.js";
|
|
3
3
|
import { useCreateJobApplicationMutation as de, useGetBulkCandidateTargetsLazyQuery as fe, useGetInterviewersQuery as pe, useGetJobApplicationsQuery as me, useGetJobPostingQuery as he, useGetJobPostingsQuery as ge } from "../../generated/global-operations.js";
|
|
4
4
|
import { ConfiguredRoundState as s, JobPostingStatus as _e } from "../../generated/global-types.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { roundStatusConfig as ve, roundStatusOrder as ye, statusColors as be, statusLabels as xe, statusOrder as Se } from "../constants/pipeline.js";
|
|
6
|
+
import { JOB_APPLICATION_FILTERS_OPEN_PARAM_KEY as Ce, JOB_APPLICATION_VIEW_PARAM_KEY as we, applyJobApplicationFilters as Te, buildSupportContextKey as Ee, clearJobApplicationFilters as De, countActiveJobApplicationFilters as Oe, hasActiveJobApplicationFilters as ke, isSupportContextHydration as Ae, mergeSearchParams as je, normalizeJobApplicationFilterText as Me, parseJobApplicationFilters as Ne, parseJobApplicationViewMode as Pe } from "../utils/jobApplicationFilterParams.js";
|
|
7
|
+
import { nativeNotify as Fe } from "../../utils/nativeBridge.js";
|
|
8
8
|
import { CandidateMaterializationError as Ie, createEmptyCandidateSelection as c, getCandidateSelectionCount as Le, getSelectedCandidateIds as Re, materializeCandidateTargets as ze, selectAllMaterializedCandidates as Be, setVisibleCandidateSelection as Ve, toggleCandidateSelection as He } from "../utils/bulkCandidateOperations.js";
|
|
9
9
|
import { AddSelectedToRoundDialog as Ue, BulkCandidateSendDialog as We, BulkCustomEmailDialog as Ge, BulkStatusUpdateDialog as Ke, NotifyDuplicateApplicantsDialog as qe } from "../components/careers/BulkCandidateDialogs.js";
|
|
10
10
|
import { BulkSelectionSummary as Je } from "../components/careers/BulkSelectionSummary.js";
|
|
@@ -97,11 +97,11 @@ function Mt(e) {
|
|
|
97
97
|
});
|
|
98
98
|
}
|
|
99
99
|
function Nt() {
|
|
100
|
-
let Tt = ht(), Nt = mt(), { organizationId: Pt, workspaceId: Ft, productId: It } = e(), [Lt, Rt] = gt(), zt = Lt.toString(), g = u(() =>
|
|
101
|
-
Rt((t) => e(
|
|
100
|
+
let Tt = ht(), Nt = mt(), { organizationId: Pt, workspaceId: Ft, productId: It } = e(), [Lt, Rt] = gt(), zt = Lt.toString(), g = u(() => Ne(new URLSearchParams(zt)), [zt]), _ = l((e) => {
|
|
101
|
+
Rt((t) => e(je(t, typeof window > "u" ? "" : window.location.search)), { replace: !0 });
|
|
102
102
|
}, [Rt]), v = l((e) => {
|
|
103
|
-
_((t) =>
|
|
104
|
-
...
|
|
103
|
+
_((t) => Te(t, {
|
|
104
|
+
...Ne(t),
|
|
105
105
|
...e
|
|
106
106
|
}));
|
|
107
107
|
}, [_]), Bt = l((e, t) => {
|
|
@@ -109,25 +109,25 @@ function Nt() {
|
|
|
109
109
|
let r = new URLSearchParams(n);
|
|
110
110
|
return t === null ? r.delete(e) : r.set(e, t), r;
|
|
111
111
|
});
|
|
112
|
-
}, [_]), y = g.search, b = u(() => new Set(g.statuses), [g.statuses]), x = u(() => new Set(g.roundStatuses), [g.roundStatuses]), S = g.productId, C = g.jobPostingId, w = g.roundConfigId, T = g.configuredRoundState, Vt = g.duplicateEmail, Ht = g.assignmentOwnerEmail, E = g.interviewerId, Ut = l((e) => (v({ search: e }),
|
|
113
|
-
qt(), Xt(), _(
|
|
112
|
+
}, [_]), y = g.search, b = u(() => new Set(g.statuses), [g.statuses]), x = u(() => new Set(g.roundStatuses), [g.roundStatuses]), S = g.productId, C = g.jobPostingId, w = g.roundConfigId, T = g.configuredRoundState, Vt = g.duplicateEmail, Ht = g.assignmentOwnerEmail, E = g.interviewerId, Ut = l((e) => (v({ search: e }), Me(e)), [v]), Wt = l((e) => (v({ assignmentOwnerEmail: e }), Me(e)), [v]), [Gt, Kt, qt] = Xe(y, Ut), [Jt, Yt, Xt] = Xe(Ht, Wt), Zt = l(() => {
|
|
113
|
+
qt(), Xt(), _(De);
|
|
114
114
|
}, [
|
|
115
115
|
qt,
|
|
116
116
|
Xt,
|
|
117
117
|
_
|
|
118
|
-
]), Qt =
|
|
118
|
+
]), Qt = Te(je(new URLSearchParams(Nt.search), typeof window > "u" ? "" : window.location.search), {
|
|
119
119
|
...g,
|
|
120
120
|
search: Gt,
|
|
121
121
|
assignmentOwnerEmail: Jt
|
|
122
|
-
}).toString(), $t = Qt ? `?${Qt}` : "", D =
|
|
122
|
+
}).toString(), $t = Qt ? `?${Qt}` : "", D = Oe(g), en = ke(g), tn = Pe(Lt.get(we)), nn = (e) => Bt(we, e === "list" ? null : e), rn = Lt.get(Ce), an = D > 0, O = rn === null ? an : rn === "1", on = () => {
|
|
123
123
|
let e = !O;
|
|
124
|
-
Bt(
|
|
124
|
+
Bt(Ce, e === an ? null : e ? "1" : "0");
|
|
125
125
|
}, [k, A] = f(c), [sn, cn] = f([]), [j, ln] = f(!1), [un, M] = f(null), [N, dn] = f(null), [P, fn] = f([]), [F, pn] = f(c), [I, mn] = f(!1), [L, hn] = f(null), [gn, _n] = f(!1), [R, z] = f(jt), [B, vn] = f({}), [V, H] = f(null), [yn, bn] = f(""), [xn, Sn] = f(!1), [Cn, wn] = f(!1), [U, Tn] = f({}), En = d(xt), Dn = d(U);
|
|
126
126
|
Dn.current = U;
|
|
127
|
-
let W =
|
|
127
|
+
let W = Ee(Pt, Ft, It), On = d(W);
|
|
128
128
|
Ze(() => {
|
|
129
129
|
let e = On.current;
|
|
130
|
-
On.current = W, e !== W && (
|
|
130
|
+
On.current = W, e !== W && (Ae(e, W) || Zt());
|
|
131
131
|
}, [W, Zt]);
|
|
132
132
|
let G = Gt !== y, kn = {
|
|
133
133
|
...y ? { search: y } : {},
|
|
@@ -215,7 +215,7 @@ function Nt() {
|
|
|
215
215
|
cn(t), A(Be(t.map((e) => e.id)));
|
|
216
216
|
} catch (t) {
|
|
217
217
|
if (t instanceof Ie && t.code === "STALE_SCOPE" || q.current !== e) return;
|
|
218
|
-
M(t instanceof Error ? t.message : "Could not load all matching applications."),
|
|
218
|
+
M(t instanceof Error ? t.message : "Could not load all matching applications."), Fe("error");
|
|
219
219
|
} finally {
|
|
220
220
|
q.current === e && ln(!1);
|
|
221
221
|
}
|
|
@@ -305,7 +305,7 @@ function Nt() {
|
|
|
305
305
|
});
|
|
306
306
|
q.current === t && (En.current = e + (n.data.jobApplications?.items.length ?? xt));
|
|
307
307
|
} catch (e) {
|
|
308
|
-
console.error("Failed to load more applications:", e),
|
|
308
|
+
console.error("Failed to load more applications:", e), Fe("error");
|
|
309
309
|
} finally {
|
|
310
310
|
q.current === t && wn(!1);
|
|
311
311
|
}
|
|
@@ -357,14 +357,14 @@ function Nt() {
|
|
|
357
357
|
} },
|
|
358
358
|
refetchQueries: ["GetJobApplications"]
|
|
359
359
|
})).data?.createJobApplication?.id;
|
|
360
|
-
|
|
360
|
+
Fe("success"), _n(!1), hr(), i && Tt(`/support/applications/${i}${$t}`);
|
|
361
361
|
} catch (e) {
|
|
362
|
-
console.error("Failed to create candidate:", e),
|
|
362
|
+
console.error("Failed to create candidate:", e), Fe("error");
|
|
363
363
|
} finally {
|
|
364
364
|
Sn(!1);
|
|
365
365
|
}
|
|
366
366
|
}
|
|
367
|
-
}, yr =
|
|
367
|
+
}, yr = Se.reduce((e, t) => (e[t] = J.filter((e) => e.status === t), e), {}), br = (e, n = !1) => {
|
|
368
368
|
let i = e.jobPostingId ? tr[e.jobPostingId]?.title : void 0, ee = Yn.has(e.id);
|
|
369
369
|
return /* @__PURE__ */ m("div", {
|
|
370
370
|
className: `w-full bg-bg-surface border rounded-lg shadow-[var(--shadow-pop)] hover:border-border-strong hover:shadow-[var(--shadow-pop-hover)] transition-[box-shadow,border-color] duration-200 group flex items-start gap-2 ${n ? "p-3" : "p-4"} ${ee ? "border-primary" : "border-border-seam"}`,
|
|
@@ -398,8 +398,8 @@ function Nt() {
|
|
|
398
398
|
}),
|
|
399
399
|
/* @__PURE__ */ p(t, {
|
|
400
400
|
variant: "secondary",
|
|
401
|
-
className: `${
|
|
402
|
-
children:
|
|
401
|
+
className: `${be[e.status] || be.NEW} ${e.status === "NEW" ? "motion-safe:animate-vc-glow-pulse" : ""}`,
|
|
402
|
+
children: xe[e.status] || e.status
|
|
403
403
|
}),
|
|
404
404
|
i && /* @__PURE__ */ p(t, {
|
|
405
405
|
variant: "outline",
|
|
@@ -716,14 +716,14 @@ function Nt() {
|
|
|
716
716
|
})]
|
|
717
717
|
}), /* @__PURE__ */ m("div", {
|
|
718
718
|
className: "flex flex-wrap gap-1.5",
|
|
719
|
-
children: [
|
|
719
|
+
children: [Se.map((e) => {
|
|
720
720
|
let t = b.has(e);
|
|
721
721
|
return /* @__PURE__ */ p("button", {
|
|
722
722
|
type: "button",
|
|
723
723
|
onClick: () => ir(e),
|
|
724
724
|
"aria-pressed": t,
|
|
725
|
-
className: `px-2.5 py-1 rounded-full text-xs font-medium border transition-colors ${t ? `${
|
|
726
|
-
children:
|
|
725
|
+
className: `px-2.5 py-1 rounded-full text-xs font-medium border transition-colors ${t ? `${be[e]} border-transparent` : "bg-bg-surface text-text-secondary border-border-seam hover:border-border-strong"}`,
|
|
726
|
+
children: xe[e]
|
|
727
727
|
}, e);
|
|
728
728
|
}), b.size > 0 && /* @__PURE__ */ p("button", {
|
|
729
729
|
type: "button",
|
|
@@ -744,8 +744,8 @@ function Nt() {
|
|
|
744
744
|
]
|
|
745
745
|
}), /* @__PURE__ */ m("div", {
|
|
746
746
|
className: "flex flex-wrap gap-1.5",
|
|
747
|
-
children: [
|
|
748
|
-
let t = x.has(e), n =
|
|
747
|
+
children: [ye.map((e) => {
|
|
748
|
+
let t = x.has(e), n = ve[e], r = T === s.Missing;
|
|
749
749
|
return /* @__PURE__ */ p("button", {
|
|
750
750
|
type: "button",
|
|
751
751
|
onClick: () => ar(e),
|
|
@@ -921,7 +921,7 @@ function Nt() {
|
|
|
921
921
|
children: J.map((e) => br(e))
|
|
922
922
|
}) : /* @__PURE__ */ p("div", {
|
|
923
923
|
className: "flex gap-4 overflow-x-auto pb-4",
|
|
924
|
-
children:
|
|
924
|
+
children: Se.map((e) => {
|
|
925
925
|
let n = yr[e] ?? [];
|
|
926
926
|
return /* @__PURE__ */ m("div", {
|
|
927
927
|
className: "flex flex-col gap-3 w-[280px] flex-shrink-0 max-h-[calc(100vh-280px)]",
|
|
@@ -929,10 +929,10 @@ function Nt() {
|
|
|
929
929
|
className: "flex items-center justify-between px-1",
|
|
930
930
|
children: [/* @__PURE__ */ p("h3", {
|
|
931
931
|
className: "text-sm font-semibold text-text-primary",
|
|
932
|
-
children:
|
|
932
|
+
children: xe[e]
|
|
933
933
|
}), /* @__PURE__ */ p(t, {
|
|
934
934
|
variant: "secondary",
|
|
935
|
-
className:
|
|
935
|
+
className: be[e],
|
|
936
936
|
children: n.length
|
|
937
937
|
})]
|
|
938
938
|
}), /* @__PURE__ */ m("div", {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ConfiguredRoundState as e, InterviewRoundStatus as t
|
|
1
|
+
import { ConfiguredRoundState as e, InterviewRoundStatus as t } from "../../generated/global-types.js";
|
|
2
|
+
import { statusOrder as n } from "../constants/pipeline.js";
|
|
2
3
|
//#region src/support/utils/jobApplicationFilterParams.ts
|
|
3
4
|
var r = {
|
|
4
5
|
search: "q",
|
|
@@ -11,16 +12,7 @@ var r = {
|
|
|
11
12
|
duplicateEmail: "dupes",
|
|
12
13
|
assignmentOwnerEmail: "owner",
|
|
13
14
|
interviewerId: "interviewer"
|
|
14
|
-
}, i = "view", a = "filters", o = 200, s = 128, c = [
|
|
15
|
-
n.New,
|
|
16
|
-
n.Screening,
|
|
17
|
-
n.Shortlisted,
|
|
18
|
-
n.Interview,
|
|
19
|
-
n.Hired,
|
|
20
|
-
n.Rejected,
|
|
21
|
-
n.EmailSent,
|
|
22
|
-
n.Archived
|
|
23
|
-
], l = [
|
|
15
|
+
}, i = "view", a = "filters", o = 200, s = 128, c = n, l = [
|
|
24
16
|
t.Scheduled,
|
|
25
17
|
t.AwaitingSubmission,
|
|
26
18
|
t.Submitted,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jobApplicationFilterParams.js","names":[],"sources":["../../../src/support/utils/jobApplicationFilterParams.ts"],"sourcesContent":["import {\n ConfiguredRoundState,\n InterviewRoundStatus,\n JobApplicationStatus,\n} from '../../generated/global-types';\n\n/**\n * URL-backed filter state for the Career → Job Applications list (BOFF-7068).\n *\n * The list unmounts whenever a reviewer opens a submission, so component state\n * cannot survive the round trip. The query string can: both the row link and\n * the detail page's \"Back to Applications\" button already forward\n * `location.search` verbatim, so filters parked here come back for free — and\n * they also survive a refresh and can be shared as a link.\n *\n * Everything is parsed defensively. A hand-edited or stale URL must never reach\n * the GraphQL variables with an unknown enum value, and must never produce a\n * combination the UI cannot render.\n */\n\nexport type JobApplicationViewMode = 'list' | 'kanban';\n\nexport interface JobApplicationFilterState {\n search: string;\n statuses: JobApplicationStatus[];\n roundStatuses: InterviewRoundStatus[];\n productId: string;\n jobPostingId: string;\n roundConfigId: string;\n configuredRoundState: ConfiguredRoundState | '';\n duplicateEmail: boolean;\n assignmentOwnerEmail: string;\n interviewerId: string;\n}\n\n/** Query-string key for each filter. Short names keep shared links readable. */\nexport const JOB_APPLICATION_FILTER_PARAM_KEYS = {\n search: 'q',\n statuses: 'status',\n roundStatuses: 'stage',\n productId: 'product',\n jobPostingId: 'posting',\n roundConfigId: 'round',\n configuredRoundState: 'roundState',\n duplicateEmail: 'dupes',\n assignmentOwnerEmail: 'owner',\n interviewerId: 'interviewer',\n} as const satisfies Record<keyof JobApplicationFilterState, string>;\n\n/** View mode and filter-panel disclosure are presentation, not filters. */\nexport const JOB_APPLICATION_VIEW_PARAM_KEY = 'view';\nexport const JOB_APPLICATION_FILTERS_OPEN_PARAM_KEY = 'filters';\n\nexport const EMPTY_JOB_APPLICATION_FILTERS: JobApplicationFilterState = {\n search: '',\n statuses: [],\n roundStatuses: [],\n productId: '',\n jobPostingId: '',\n roundConfigId: '',\n configuredRoundState: '',\n duplicateEmail: false,\n assignmentOwnerEmail: '',\n interviewerId: '',\n};\n\n/**\n * Free text goes straight into GraphQL variables, so cap it. Nobody searches\n * with 4 KB of text; a URL that claims otherwise was not typed by a user.\n */\nconst MAX_TEXT_LENGTH = 200;\n/** Identifiers are UUIDs in practice — this is only an upper sanity bound. */\nconst MAX_ID_LENGTH = 128;\n\nconst STATUS_ORDER = [\n JobApplicationStatus.New,\n JobApplicationStatus.Screening,\n JobApplicationStatus.Shortlisted,\n JobApplicationStatus.Interview,\n JobApplicationStatus.Hired,\n JobApplicationStatus.Rejected,\n JobApplicationStatus.EmailSent,\n JobApplicationStatus.Archived,\n] as const;\n\nconst ROUND_STATUS_ORDER = [\n InterviewRoundStatus.Scheduled,\n InterviewRoundStatus.AwaitingSubmission,\n InterviewRoundStatus.Submitted,\n InterviewRoundStatus.Completed,\n InterviewRoundStatus.Passed,\n InterviewRoundStatus.Failed,\n InterviewRoundStatus.NoShow,\n InterviewRoundStatus.Cancelled,\n] as const;\n\nconst CONFIGURED_ROUND_STATES = Object.values(ConfiguredRoundState);\n\n/**\n * The bound applied to every free-text filter, exported so a caller that has to\n * predict what serialization will write (the debounced inputs) uses this rule\n * rather than a second copy of it.\n */\nexport function normalizeJobApplicationFilterText(value: string): string {\n return value.trim().slice(0, MAX_TEXT_LENGTH);\n}\n\nfunction readText(raw: string | null, maxLength: number): string {\n return (raw ?? '').trim().slice(0, maxLength);\n}\n\n/**\n * Parses a comma-separated enum list, dropping anything unrecognised and\n * de-duplicating. Values come back in `allowed` order rather than URL order so\n * that two URLs selecting the same set serialize identically — which keeps the\n * page's query-scope key (and therefore Apollo's cache key) stable.\n */\nfunction readEnumList<T extends string>(raw: string | null, allowed: readonly T[]): T[] {\n if (!raw) return [];\n const requested = new Set(raw.split(',').map((piece) => piece.trim().toUpperCase()));\n return allowed.filter((value) => requested.has(value));\n}\n\n/**\n * Applies the dependency rules the filter UI enforces through its own controls,\n * so a URL can never describe a state the panel could not have produced:\n * round/duplicate filters need a posting, an assignment state needs a round,\n * and \"missing this round\" is incompatible with round-stage chips.\n */\nfunction normalizeJobApplicationFilters(\n state: JobApplicationFilterState\n): JobApplicationFilterState {\n // Bounds live here rather than only in the parse path: a value committed from\n // a control (a 500-character paste into the search box) is serialized without\n // ever passing through `parseJobApplicationFilters`, and an uncapped value\n // written to the query string rides on into history, detail links and shared\n // URLs even though the parse that follows would clamp it.\n const jobPostingId = state.jobPostingId.trim().slice(0, MAX_ID_LENGTH);\n const roundConfigId = jobPostingId ? state.roundConfigId.trim().slice(0, MAX_ID_LENGTH) : '';\n const configuredRoundState = roundConfigId ? state.configuredRoundState : '';\n const roundStatuses =\n configuredRoundState === ConfiguredRoundState.Missing ? [] : state.roundStatuses;\n\n return {\n ...state,\n search: normalizeJobApplicationFilterText(state.search),\n assignmentOwnerEmail: normalizeJobApplicationFilterText(state.assignmentOwnerEmail),\n productId: state.productId.trim().slice(0, MAX_ID_LENGTH),\n interviewerId: state.interviewerId.trim().slice(0, MAX_ID_LENGTH),\n jobPostingId,\n roundConfigId,\n configuredRoundState,\n roundStatuses,\n duplicateEmail: jobPostingId ? state.duplicateEmail : false,\n };\n}\n\nexport function parseJobApplicationFilters(params: URLSearchParams): JobApplicationFilterState {\n const keys = JOB_APPLICATION_FILTER_PARAM_KEYS;\n\n const configuredRoundStateRaw = readText(params.get(keys.configuredRoundState), MAX_ID_LENGTH);\n const configuredRoundState =\n CONFIGURED_ROUND_STATES.find((state) => state === configuredRoundStateRaw.toUpperCase()) ?? '';\n\n return normalizeJobApplicationFilters({\n search: readText(params.get(keys.search), MAX_TEXT_LENGTH),\n statuses: readEnumList(params.get(keys.statuses), STATUS_ORDER),\n roundStatuses: readEnumList(params.get(keys.roundStatuses), ROUND_STATUS_ORDER),\n productId: readText(params.get(keys.productId), MAX_ID_LENGTH),\n jobPostingId: readText(params.get(keys.jobPostingId), MAX_ID_LENGTH),\n roundConfigId: readText(params.get(keys.roundConfigId), MAX_ID_LENGTH),\n configuredRoundState,\n duplicateEmail: params.get(keys.duplicateEmail) === '1',\n assignmentOwnerEmail: readText(params.get(keys.assignmentOwnerEmail), MAX_TEXT_LENGTH),\n interviewerId: readText(params.get(keys.interviewerId), MAX_ID_LENGTH),\n });\n}\n\n/**\n * Serializes to `{ key: value | null }`, where `null` means \"remove this key\".\n * Inactive filters are removed rather than written as empty values so a list\n * with nothing applied has a clean URL.\n */\nexport function serializeJobApplicationFilters(\n state: JobApplicationFilterState\n): Record<string, string | null> {\n const keys = JOB_APPLICATION_FILTER_PARAM_KEYS;\n const normalized = normalizeJobApplicationFilters(state);\n\n return {\n [keys.search]: normalized.search || null,\n [keys.statuses]: normalized.statuses.length > 0 ? normalized.statuses.join(',') : null,\n [keys.roundStatuses]:\n normalized.roundStatuses.length > 0 ? normalized.roundStatuses.join(',') : null,\n [keys.productId]: normalized.productId || null,\n [keys.jobPostingId]: normalized.jobPostingId || null,\n [keys.roundConfigId]: normalized.roundConfigId || null,\n [keys.configuredRoundState]: normalized.configuredRoundState || null,\n [keys.duplicateEmail]: normalized.duplicateEmail ? '1' : null,\n [keys.assignmentOwnerEmail]: normalized.assignmentOwnerEmail || null,\n [keys.interviewerId]: normalized.interviewerId || null,\n };\n}\n\n/**\n * Writes the filter state onto `current`, leaving every unrelated key\n * (`org`, `workspace`, `project`, `view`, …) exactly as it was.\n */\nexport function applyJobApplicationFilters(\n current: URLSearchParams,\n state: JobApplicationFilterState\n): URLSearchParams {\n const next = new URLSearchParams(current);\n for (const [key, value] of Object.entries(serializeJobApplicationFilters(state))) {\n if (value === null) next.delete(key);\n else next.set(key, value);\n }\n return next;\n}\n\n/** Drops every filter key and nothing else — context params and view survive. */\nexport function clearJobApplicationFilters(current: URLSearchParams): URLSearchParams {\n const next = new URLSearchParams(current);\n for (const key of Object.values(JOB_APPLICATION_FILTER_PARAM_KEYS)) next.delete(key);\n return next;\n}\n\n/**\n * Number of filters shown inside the filter panel that are currently applied —\n * drives the count badge on the Filters button. The search box sits outside the\n * panel and is visible on its own, so it is deliberately not counted here.\n */\nexport function countActiveJobApplicationFilters(state: JobApplicationFilterState): number {\n const normalized = normalizeJobApplicationFilters(state);\n return (\n (normalized.statuses.length > 0 ? 1 : 0) +\n (normalized.roundStatuses.length > 0 ? 1 : 0) +\n (normalized.productId ? 1 : 0) +\n (normalized.jobPostingId ? 1 : 0) +\n (normalized.roundConfigId ? 1 : 0) +\n (normalized.configuredRoundState ? 1 : 0) +\n (normalized.duplicateEmail ? 1 : 0) +\n (normalized.assignmentOwnerEmail ? 1 : 0) +\n (normalized.interviewerId ? 1 : 0)\n );\n}\n\n/** True when anything at all narrows the list, including the search box. */\nexport function hasActiveJobApplicationFilters(state: JobApplicationFilterState): boolean {\n return countActiveJobApplicationFilters(state) > 0 || state.search.length > 0;\n}\n\nexport function parseJobApplicationViewMode(raw: string | null): JobApplicationViewMode {\n return raw === 'kanban' ? 'kanban' : 'list';\n}\n\n/**\n * fe-libs' `ActiveContextProvider` writes `org`/`workspace`/`project` with a raw\n * `history.replaceState`, which `BrowserRouter` never observes — so React\n * Router's snapshot of the query string can be missing params that really are\n * in the address bar. Writing that snapshot back would silently strip the\n * active context from the URL.\n *\n * The address bar is therefore the base, and the router snapshot only\n * contributes keys the address bar lacks (which is how the MemoryRouter used by\n * standalone mode and by tests keeps working, since there `window.location`\n * never moves).\n */\nexport function mergeSearchParams(\n routerParams: URLSearchParams,\n windowSearch: string\n): URLSearchParams {\n const merged = new URLSearchParams(windowSearch);\n for (const [key, value] of routerParams.entries()) {\n if (!merged.has(key)) merged.set(key, value);\n }\n return merged;\n}\n\n/**\n * Identity of the active support context as one comparable string. Filters are\n * only meaningful inside a single org/workspace/product, so this key is what\n * both the list page and `JobApplicationFilterContextGuard` compare to decide\n * whether the URL-persisted filters still belong to the context on screen.\n */\nexport function buildSupportContextKey(\n organizationId: string | undefined,\n workspaceId: string | undefined,\n productId: string | undefined\n): string {\n return `${organizationId ?? ''}|${workspaceId ?? ''}|${productId ?? ''}`;\n}\n\n/**\n * True when every axis that changed went from empty to a value — the shell\n * finishing its context resolution, not the reviewer switching context.\n *\n * The distinction matters because the shell hands the microfrontend\n * `activeContext.workspaceId ?? ''`, and `??` does not catch the empty string,\n * so a microfrontend that mounts before the context settles observes\n * `'' -> id`. Treated as a switch, that would strip the filters off a\n * deep-linked or refreshed URL before the reviewer ever saw them.\n *\n * Only a fill counts: an axis moving between two non-empty values, or being\n * emptied, is a genuine switch and must still clear the filters.\n */\nexport function isSupportContextHydration(previousKey: string, nextKey: string): boolean {\n const previous = previousKey.split('|');\n const next = nextKey.split('|');\n // Differing arity means one side is not a key this module built, so it cannot\n // be read as a fill — fall through to the switch path, which clears.\n if (previous.length !== next.length) return false;\n return previous.every((value, index) => value === next[index] || value === '');\n}\n"],"mappings":";;AAoCA,IAAa,IAAoC;CAC/C,QAAQ;CACR,UA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A0B;CACvF,IAAM,IAAW,EAAY,MAAM,GAAG,GAChC,IAAO,EAAQ,MAAM,GAAG;CAI9B,OADI,EAAS,WAAW,EAAK,UACtB,EAAS,OAAO,GAAO,MAAU,MAAU,EAAK,MAAU,MAAU,EAAE;AAC/E"}
|
|
1
|
+
{"version":3,"file":"jobApplicationFilterParams.js","names":[],"sources":["../../../src/support/utils/jobApplicationFilterParams.ts"],"sourcesContent":["import {\n ConfiguredRoundState,\n InterviewRoundStatus,\n JobApplicationStatus,\n} from '../../generated/global-types';\nimport { statusOrder } from '../constants/pipeline';\n\n/**\n * URL-backed filter state for the Career → Job Applications list (BOFF-7068).\n *\n * The list unmounts whenever a reviewer opens a submission, so component state\n * cannot survive the round trip. The query string can: both the row link and\n * the detail page's \"Back to Applications\" button already forward\n * `location.search` verbatim, so filters parked here come back for free — and\n * they also survive a refresh and can be shared as a link.\n *\n * Everything is parsed defensively. A hand-edited or stale URL must never reach\n * the GraphQL variables with an unknown enum value, and must never produce a\n * combination the UI cannot render.\n */\n\nexport type JobApplicationViewMode = 'list' | 'kanban';\n\nexport interface JobApplicationFilterState {\n search: string;\n statuses: JobApplicationStatus[];\n roundStatuses: InterviewRoundStatus[];\n productId: string;\n jobPostingId: string;\n roundConfigId: string;\n configuredRoundState: ConfiguredRoundState | '';\n duplicateEmail: boolean;\n assignmentOwnerEmail: string;\n interviewerId: string;\n}\n\n/** Query-string key for each filter. Short names keep shared links readable. */\nexport const JOB_APPLICATION_FILTER_PARAM_KEYS = {\n search: 'q',\n statuses: 'status',\n roundStatuses: 'stage',\n productId: 'product',\n jobPostingId: 'posting',\n roundConfigId: 'round',\n configuredRoundState: 'roundState',\n duplicateEmail: 'dupes',\n assignmentOwnerEmail: 'owner',\n interviewerId: 'interviewer',\n} as const satisfies Record<keyof JobApplicationFilterState, string>;\n\n/** View mode and filter-panel disclosure are presentation, not filters. */\nexport const JOB_APPLICATION_VIEW_PARAM_KEY = 'view';\nexport const JOB_APPLICATION_FILTERS_OPEN_PARAM_KEY = 'filters';\n\nexport const EMPTY_JOB_APPLICATION_FILTERS: JobApplicationFilterState = {\n search: '',\n statuses: [],\n roundStatuses: [],\n productId: '',\n jobPostingId: '',\n roundConfigId: '',\n configuredRoundState: '',\n duplicateEmail: false,\n assignmentOwnerEmail: '',\n interviewerId: '',\n};\n\n/**\n * Free text goes straight into GraphQL variables, so cap it. Nobody searches\n * with 4 KB of text; a URL that claims otherwise was not typed by a user.\n */\nconst MAX_TEXT_LENGTH = 200;\n/** Identifiers are UUIDs in practice — this is only an upper sanity bound. */\nconst MAX_ID_LENGTH = 128;\n\n// Sourced from the same list that drives the status filter chips, the bulk\n// status dropdown, and the kanban columns — a status only needs to be added\n// once, here, to appear (and actually work) everywhere else. Previously this\n// was a second, hand-maintained copy that silently fell out of sync with\n// `statusOrder` and made a real status invisible to the URL parser.\nconst STATUS_ORDER = statusOrder;\n\nconst ROUND_STATUS_ORDER = [\n InterviewRoundStatus.Scheduled,\n InterviewRoundStatus.AwaitingSubmission,\n InterviewRoundStatus.Submitted,\n InterviewRoundStatus.Completed,\n InterviewRoundStatus.Passed,\n InterviewRoundStatus.Failed,\n InterviewRoundStatus.NoShow,\n InterviewRoundStatus.Cancelled,\n] as const;\n\nconst CONFIGURED_ROUND_STATES = Object.values(ConfiguredRoundState);\n\n/**\n * The bound applied to every free-text filter, exported so a caller that has to\n * predict what serialization will write (the debounced inputs) uses this rule\n * rather than a second copy of it.\n */\nexport function normalizeJobApplicationFilterText(value: string): string {\n return value.trim().slice(0, MAX_TEXT_LENGTH);\n}\n\nfunction readText(raw: string | null, maxLength: number): string {\n return (raw ?? '').trim().slice(0, maxLength);\n}\n\n/**\n * Parses a comma-separated enum list, dropping anything unrecognised and\n * de-duplicating. Values come back in `allowed` order rather than URL order so\n * that two URLs selecting the same set serialize identically — which keeps the\n * page's query-scope key (and therefore Apollo's cache key) stable.\n */\nfunction readEnumList<T extends string>(raw: string | null, allowed: readonly T[]): T[] {\n if (!raw) return [];\n const requested = new Set(raw.split(',').map((piece) => piece.trim().toUpperCase()));\n return allowed.filter((value) => requested.has(value));\n}\n\n/**\n * Applies the dependency rules the filter UI enforces through its own controls,\n * so a URL can never describe a state the panel could not have produced:\n * round/duplicate filters need a posting, an assignment state needs a round,\n * and \"missing this round\" is incompatible with round-stage chips.\n */\nfunction normalizeJobApplicationFilters(\n state: JobApplicationFilterState\n): JobApplicationFilterState {\n // Bounds live here rather than only in the parse path: a value committed from\n // a control (a 500-character paste into the search box) is serialized without\n // ever passing through `parseJobApplicationFilters`, and an uncapped value\n // written to the query string rides on into history, detail links and shared\n // URLs even though the parse that follows would clamp it.\n const jobPostingId = state.jobPostingId.trim().slice(0, MAX_ID_LENGTH);\n const roundConfigId = jobPostingId ? state.roundConfigId.trim().slice(0, MAX_ID_LENGTH) : '';\n const configuredRoundState = roundConfigId ? state.configuredRoundState : '';\n const roundStatuses =\n configuredRoundState === ConfiguredRoundState.Missing ? [] : state.roundStatuses;\n\n return {\n ...state,\n search: normalizeJobApplicationFilterText(state.search),\n assignmentOwnerEmail: normalizeJobApplicationFilterText(state.assignmentOwnerEmail),\n productId: state.productId.trim().slice(0, MAX_ID_LENGTH),\n interviewerId: state.interviewerId.trim().slice(0, MAX_ID_LENGTH),\n jobPostingId,\n roundConfigId,\n configuredRoundState,\n roundStatuses,\n duplicateEmail: jobPostingId ? state.duplicateEmail : false,\n };\n}\n\nexport function parseJobApplicationFilters(params: URLSearchParams): JobApplicationFilterState {\n const keys = JOB_APPLICATION_FILTER_PARAM_KEYS;\n\n const configuredRoundStateRaw = readText(params.get(keys.configuredRoundState), MAX_ID_LENGTH);\n const configuredRoundState =\n CONFIGURED_ROUND_STATES.find((state) => state === configuredRoundStateRaw.toUpperCase()) ?? '';\n\n return normalizeJobApplicationFilters({\n search: readText(params.get(keys.search), MAX_TEXT_LENGTH),\n statuses: readEnumList(params.get(keys.statuses), STATUS_ORDER),\n roundStatuses: readEnumList(params.get(keys.roundStatuses), ROUND_STATUS_ORDER),\n productId: readText(params.get(keys.productId), MAX_ID_LENGTH),\n jobPostingId: readText(params.get(keys.jobPostingId), MAX_ID_LENGTH),\n roundConfigId: readText(params.get(keys.roundConfigId), MAX_ID_LENGTH),\n configuredRoundState,\n duplicateEmail: params.get(keys.duplicateEmail) === '1',\n assignmentOwnerEmail: readText(params.get(keys.assignmentOwnerEmail), MAX_TEXT_LENGTH),\n interviewerId: readText(params.get(keys.interviewerId), MAX_ID_LENGTH),\n });\n}\n\n/**\n * Serializes to `{ key: value | null }`, where `null` means \"remove this key\".\n * Inactive filters are removed rather than written as empty values so a list\n * with nothing applied has a clean URL.\n */\nexport function serializeJobApplicationFilters(\n state: JobApplicationFilterState\n): Record<string, string | null> {\n const keys = JOB_APPLICATION_FILTER_PARAM_KEYS;\n const normalized = normalizeJobApplicationFilters(state);\n\n return {\n [keys.search]: normalized.search || null,\n [keys.statuses]: normalized.statuses.length > 0 ? normalized.statuses.join(',') : null,\n [keys.roundStatuses]:\n normalized.roundStatuses.length > 0 ? normalized.roundStatuses.join(',') : null,\n [keys.productId]: normalized.productId || null,\n [keys.jobPostingId]: normalized.jobPostingId || null,\n [keys.roundConfigId]: normalized.roundConfigId || null,\n [keys.configuredRoundState]: normalized.configuredRoundState || null,\n [keys.duplicateEmail]: normalized.duplicateEmail ? '1' : null,\n [keys.assignmentOwnerEmail]: normalized.assignmentOwnerEmail || null,\n [keys.interviewerId]: normalized.interviewerId || null,\n };\n}\n\n/**\n * Writes the filter state onto `current`, leaving every unrelated key\n * (`org`, `workspace`, `project`, `view`, …) exactly as it was.\n */\nexport function applyJobApplicationFilters(\n current: URLSearchParams,\n state: JobApplicationFilterState\n): URLSearchParams {\n const next = new URLSearchParams(current);\n for (const [key, value] of Object.entries(serializeJobApplicationFilters(state))) {\n if (value === null) next.delete(key);\n else next.set(key, value);\n }\n return next;\n}\n\n/** Drops every filter key and nothing else — context params and view survive. */\nexport function clearJobApplicationFilters(current: URLSearchParams): URLSearchParams {\n const next = new URLSearchParams(current);\n for (const key of Object.values(JOB_APPLICATION_FILTER_PARAM_KEYS)) next.delete(key);\n return next;\n}\n\n/**\n * Number of filters shown inside the filter panel that are currently applied —\n * drives the count badge on the Filters button. The search box sits outside the\n * panel and is visible on its own, so it is deliberately not counted here.\n */\nexport function countActiveJobApplicationFilters(state: JobApplicationFilterState): number {\n const normalized = normalizeJobApplicationFilters(state);\n return (\n (normalized.statuses.length > 0 ? 1 : 0) +\n (normalized.roundStatuses.length > 0 ? 1 : 0) +\n (normalized.productId ? 1 : 0) +\n (normalized.jobPostingId ? 1 : 0) +\n (normalized.roundConfigId ? 1 : 0) +\n (normalized.configuredRoundState ? 1 : 0) +\n (normalized.duplicateEmail ? 1 : 0) +\n (normalized.assignmentOwnerEmail ? 1 : 0) +\n (normalized.interviewerId ? 1 : 0)\n );\n}\n\n/** True when anything at all narrows the list, including the search box. */\nexport function hasActiveJobApplicationFilters(state: JobApplicationFilterState): boolean {\n return countActiveJobApplicationFilters(state) > 0 || state.search.length > 0;\n}\n\nexport function parseJobApplicationViewMode(raw: string | null): JobApplicationViewMode {\n return raw === 'kanban' ? 'kanban' : 'list';\n}\n\n/**\n * fe-libs' `ActiveContextProvider` writes `org`/`workspace`/`project` with a raw\n * `history.replaceState`, which `BrowserRouter` never observes — so React\n * Router's snapshot of the query string can be missing params that really are\n * in the address bar. Writing that snapshot back would silently strip the\n * active context from the URL.\n *\n * The address bar is therefore the base, and the router snapshot only\n * contributes keys the address bar lacks (which is how the MemoryRouter used by\n * standalone mode and by tests keeps working, since there `window.location`\n * never moves).\n */\nexport function mergeSearchParams(\n routerParams: URLSearchParams,\n windowSearch: string\n): URLSearchParams {\n const merged = new URLSearchParams(windowSearch);\n for (const [key, value] of routerParams.entries()) {\n if (!merged.has(key)) merged.set(key, value);\n }\n return merged;\n}\n\n/**\n * Identity of the active support context as one comparable string. Filters are\n * only meaningful inside a single org/workspace/product, so this key is what\n * both the list page and `JobApplicationFilterContextGuard` compare to decide\n * whether the URL-persisted filters still belong to the context on screen.\n */\nexport function buildSupportContextKey(\n organizationId: string | undefined,\n workspaceId: string | undefined,\n productId: string | undefined\n): string {\n return `${organizationId ?? ''}|${workspaceId ?? ''}|${productId ?? ''}`;\n}\n\n/**\n * True when every axis that changed went from empty to a value — the shell\n * finishing its context resolution, not the reviewer switching context.\n *\n * The distinction matters because the shell hands the microfrontend\n * `activeContext.workspaceId ?? ''`, and `??` does not catch the empty string,\n * so a microfrontend that mounts before the context settles observes\n * `'' -> id`. Treated as a switch, that would strip the filters off a\n * deep-linked or refreshed URL before the reviewer ever saw them.\n *\n * Only a fill counts: an axis moving between two non-empty values, or being\n * emptied, is a genuine switch and must still clear the filters.\n */\nexport function isSupportContextHydration(previousKey: string, nextKey: string): boolean {\n const previous = previousKey.split('|');\n const next = nextKey.split('|');\n // Differing arity means one side is not a key this module built, so it cannot\n // be read as a fill — fall through to the switch path, which clears.\n if (previous.length !== next.length) return false;\n return previous.every((value, index) => value === next[index] || value === '');\n}\n"],"mappings":";;;AAqCA,IAAa,IAAoC;CAC/C,QAAQ;CACR,UAAU;CACV,eAAe;CACf,WAAW;CACX,cAAc;CACd,eAAe;CACf,sBAAsB;CACtB,gBAAgB;CAChB,sBAAsB;CACtB,eAAe;AACjB,GAGa,IAAiC,QACjC,IAAyC,WAmBhD,IAAkB,KAElB,IAAgB,KAOhB,IAAe,GAEf,IAAqB;CACzB,EAAqB;CACrB,EAAqB;CACrB,EAAqB;CACrB,EAAqB;CACrB,EAAqB;CACrB,EAAqB;CACrB,EAAqB;CACrB,EAAqB;AACvB,GAEM,IAA0B,OAAO,OAAO,CAAoB;AAOlE,SAAgB,EAAkC,GAAuB;CACvE,OAAO,EAAM,KAAK,CAAC,CAAC,MAAM,GAAG,CAAe;AAC9C;AAEA,SAAS,EAAS,GAAoB,GAA2B;CAC/D,QAAQ,KAAO,GAAA,CAAI,KAAK,CAAC,CAAC,MAAM,GAAG,CAAS;AAC9C;AAQA,SAAS,EAA+B,GAAoB,GAA4B;CAC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