@burdenoff/microfe-headshotmarketing 2026.1107.2 → 2026.1107.3
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/wspace-operations.d.ts +360 -0
- package/dist/generated/wspace-operations.d.ts.map +1 -1
- package/dist/generated/wspace-operations.js +492 -380
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +8498 -352
- package/dist/generated/wspace-types.d.ts.map +1 -1
- package/dist/generated/wspace-types.js +11 -7
- package/dist/generated/wspace-types.js.map +1 -1
- package/dist/headshotmarketing/pages/analytics/ReportScheduleDialog.d.ts +26 -0
- package/dist/headshotmarketing/pages/analytics/ReportScheduleDialog.d.ts.map +1 -0
- package/dist/headshotmarketing/pages/analytics/ReportScheduleDialog.js +402 -0
- package/dist/headshotmarketing/pages/analytics/ReportScheduleDialog.js.map +1 -0
- package/dist/headshotmarketing/pages/analytics/ReportsPage.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/analytics/ReportsPage.js +356 -243
- package/dist/headshotmarketing/pages/analytics/ReportsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/analytics/reportSchedule.d.ts +66 -0
- package/dist/headshotmarketing/pages/analytics/reportSchedule.d.ts.map +1 -0
- package/dist/headshotmarketing/pages/analytics/reportSchedule.js +131 -0
- package/dist/headshotmarketing/pages/analytics/reportSchedule.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { HeadshotmarketingSavedReportScheduleFieldsFragment } from '../../../generated/wspace-operations';
|
|
3
|
+
import { ScheduleDraft, ScheduleDraftErrors } from './reportSchedule';
|
|
4
|
+
|
|
5
|
+
export interface RecipientOption {
|
|
6
|
+
userId: string;
|
|
7
|
+
name: string;
|
|
8
|
+
email: string | null;
|
|
9
|
+
}
|
|
10
|
+
export declare const ReportScheduleDialog: FC<{
|
|
11
|
+
open: boolean;
|
|
12
|
+
reportId: string;
|
|
13
|
+
reportName: string;
|
|
14
|
+
workspaceId: string;
|
|
15
|
+
schedule: HeadshotmarketingSavedReportScheduleFieldsFragment | null;
|
|
16
|
+
draft: ScheduleDraft;
|
|
17
|
+
onChange: (draft: ScheduleDraft) => void;
|
|
18
|
+
errors: ScheduleDraftErrors;
|
|
19
|
+
serverError: string | null;
|
|
20
|
+
busy: "save" | "remove" | "send" | null;
|
|
21
|
+
onClose: () => void;
|
|
22
|
+
onSave: () => void;
|
|
23
|
+
onRemove: () => void;
|
|
24
|
+
onSendNow: () => void;
|
|
25
|
+
}>;
|
|
26
|
+
//# sourceMappingURL=ReportScheduleDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReportScheduleDialog.d.ts","sourceRoot":"","sources":["../../../../src/headshotmarketing/pages/analytics/ReportScheduleDialog.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAgC,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAK9D,OAAO,EASL,KAAK,kDAAkD,EACxD,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAWL,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACzB,MAAM,kBAAkB,CAAC;AAc1B,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAyFD,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC;IACpC,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,kDAAkD,GAAG,IAAI,CAAC;IACpE,KAAK,EAAE,aAAa,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IACzC,MAAM,EAAE,mBAAmB,CAAC;IAC5B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,IAAI,CAAC;IACxC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB,CA4cA,CAAC"}
|
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
import { HeadshotmarketingReportRecipientIdentitiesDocument as e, HeadshotmarketingReportRecipientMembersDocument as t, useHeadshotmarketingSavedReportDeliveryRunsQuery as n } from "../../../generated/wspace-operations.js";
|
|
2
|
+
import { cn as r } from "../../utils/helpers.js";
|
|
3
|
+
import { HeadshotmarketingReportScheduleCadence as i } from "../../../generated/wspace-types.js";
|
|
4
|
+
import { Modal as a } from "../../components/Modal.js";
|
|
5
|
+
import "../../components/index.js";
|
|
6
|
+
import { WEEKDAYS as o, deliveryStatusLabel as s, deliveryStatusTone as c, describeSchedule as l, formatHour as u, formatInstant as d, ordinal as f, timezoneOptions as p, toggleRecipient as m } from "./reportSchedule.js";
|
|
7
|
+
import { useEffect as h, useMemo as g, useState as _ } from "react";
|
|
8
|
+
import { Send as v, Trash2 as y } from "lucide-react";
|
|
9
|
+
import { useApolloClient as b } from "@apollo/client/react";
|
|
10
|
+
import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
11
|
+
//#region src/headshotmarketing/pages/analytics/ReportScheduleDialog.tsx
|
|
12
|
+
var w = "inline-flex min-h-[40px] items-center gap-2 rounded-md border border-border-seam bg-bg-surface px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken disabled:cursor-not-allowed disabled:opacity-60", T = "min-h-[44px] w-full rounded-md border bg-bg-surface px-3 py-2 text-sm text-text-primary", E = 100, D = 10;
|
|
13
|
+
function O(n, r) {
|
|
14
|
+
let i = b(), [a, o] = _([]), [s, c] = _(!1), [l, u] = _(null);
|
|
15
|
+
return h(() => {
|
|
16
|
+
if (!r || !n) return;
|
|
17
|
+
let a = !1;
|
|
18
|
+
return (async () => {
|
|
19
|
+
c(!0), u(null);
|
|
20
|
+
try {
|
|
21
|
+
let r = [];
|
|
22
|
+
for (let e = 0; e < D; e += 1) {
|
|
23
|
+
let a = (await i.query({
|
|
24
|
+
query: t,
|
|
25
|
+
variables: {
|
|
26
|
+
workspaceId: n,
|
|
27
|
+
offset: e * E
|
|
28
|
+
},
|
|
29
|
+
fetchPolicy: "network-only"
|
|
30
|
+
})).data?.workspaceMembers;
|
|
31
|
+
if (!a) break;
|
|
32
|
+
for (let e of a.items) e.status.toLowerCase() === "active" && r.push(e.userId);
|
|
33
|
+
if (!a.hasMore) break;
|
|
34
|
+
}
|
|
35
|
+
let s = [...new Set(r)], c = [];
|
|
36
|
+
for (let t = 0; t < s.length; t += E) {
|
|
37
|
+
let r = s.slice(t, t + E), a = await i.query({
|
|
38
|
+
query: e,
|
|
39
|
+
variables: {
|
|
40
|
+
workspaceId: n,
|
|
41
|
+
userIds: r
|
|
42
|
+
},
|
|
43
|
+
fetchPolicy: "network-only"
|
|
44
|
+
});
|
|
45
|
+
for (let e of a.data?.workspaceMemberIdentities ?? []) c.push({
|
|
46
|
+
userId: e.userId,
|
|
47
|
+
name: e.displayName || e.email || e.userId,
|
|
48
|
+
email: e.email ?? null
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
c.sort((e, t) => e.name.localeCompare(t.name)), a || o(c);
|
|
52
|
+
} catch (e) {
|
|
53
|
+
a || u(e instanceof Error ? e.message : "Members could not be loaded.");
|
|
54
|
+
} finally {
|
|
55
|
+
a || c(!1);
|
|
56
|
+
}
|
|
57
|
+
})(), () => {
|
|
58
|
+
a = !0;
|
|
59
|
+
};
|
|
60
|
+
}, [
|
|
61
|
+
i,
|
|
62
|
+
n,
|
|
63
|
+
r
|
|
64
|
+
]), {
|
|
65
|
+
members: a,
|
|
66
|
+
loading: s,
|
|
67
|
+
error: l
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
var k = {
|
|
71
|
+
success: "text-status-success-text",
|
|
72
|
+
warning: "text-status-warning-text",
|
|
73
|
+
error: "text-status-error-text",
|
|
74
|
+
neutral: "text-text-secondary"
|
|
75
|
+
}, A = ({ open: e, reportId: t, reportName: h, workspaceId: _, schedule: b, draft: E, onChange: D, errors: A, serverError: j, busy: M, onClose: N, onSave: P, onRemove: F, onSendNow: I }) => {
|
|
76
|
+
let L = O(_, e), R = g(() => p(E.timezone), [E.timezone]), z = n({
|
|
77
|
+
variables: { reportId: t },
|
|
78
|
+
skip: !e || !b,
|
|
79
|
+
fetchPolicy: "cache-and-network"
|
|
80
|
+
}), B = z.data?.headshotmarketingSavedReportDeliveryRuns.items ?? [], V = new Set(L.members.map((e) => e.userId)), H = E.recipientUserIds.filter((e) => !V.has(e)), U = E.cadence === i.Weekly, W = M !== null;
|
|
81
|
+
return /* @__PURE__ */ S(a, {
|
|
82
|
+
open: e,
|
|
83
|
+
onClose: N,
|
|
84
|
+
title: b ? "Delivery schedule" : "Schedule report",
|
|
85
|
+
description: `Email "${h}" to workspace members on a regular schedule. Each email covers the report's period at the time it is sent.`,
|
|
86
|
+
size: "lg",
|
|
87
|
+
footer: /* @__PURE__ */ C(x, { children: [
|
|
88
|
+
b && /* @__PURE__ */ C("button", {
|
|
89
|
+
type: "button",
|
|
90
|
+
onClick: F,
|
|
91
|
+
disabled: W,
|
|
92
|
+
className: r(w, "mr-auto text-status-error-text"),
|
|
93
|
+
children: [/* @__PURE__ */ S(y, { className: "h-4 w-4" }), M === "remove" ? "Removing…" : "Remove schedule"]
|
|
94
|
+
}),
|
|
95
|
+
/* @__PURE__ */ S("button", {
|
|
96
|
+
type: "button",
|
|
97
|
+
onClick: N,
|
|
98
|
+
disabled: W,
|
|
99
|
+
className: w,
|
|
100
|
+
children: "Cancel"
|
|
101
|
+
}),
|
|
102
|
+
/* @__PURE__ */ S("button", {
|
|
103
|
+
type: "button",
|
|
104
|
+
onClick: P,
|
|
105
|
+
disabled: W,
|
|
106
|
+
className: "inline-flex min-h-[40px] items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90 disabled:cursor-not-allowed disabled:opacity-60",
|
|
107
|
+
children: M === "save" ? "Saving…" : b ? "Save schedule" : "Create schedule"
|
|
108
|
+
})
|
|
109
|
+
] }),
|
|
110
|
+
children: /* @__PURE__ */ C("div", {
|
|
111
|
+
className: "space-y-5",
|
|
112
|
+
children: [
|
|
113
|
+
b && /* @__PURE__ */ C("div", {
|
|
114
|
+
className: "flex flex-col gap-3 rounded-lg border border-border-seam bg-bg-sunken/30 px-4 py-3 text-sm sm:flex-row sm:items-center sm:justify-between",
|
|
115
|
+
children: [/* @__PURE__ */ C("div", {
|
|
116
|
+
className: "min-w-0",
|
|
117
|
+
children: [/* @__PURE__ */ S("p", {
|
|
118
|
+
className: "font-medium text-text-primary",
|
|
119
|
+
children: l(b)
|
|
120
|
+
}), /* @__PURE__ */ C("p", {
|
|
121
|
+
className: "mt-0.5 text-xs text-text-secondary",
|
|
122
|
+
children: [b.enabled ? `Next delivery ${d(b.nextRunAt)}` : "Paused", b.lastRunStatus && /* @__PURE__ */ C(x, { children: [
|
|
123
|
+
" · Last: ",
|
|
124
|
+
/* @__PURE__ */ S("span", {
|
|
125
|
+
className: k[c(b.lastRunStatus)],
|
|
126
|
+
children: s(b.lastRunStatus)
|
|
127
|
+
}),
|
|
128
|
+
" ",
|
|
129
|
+
d(b.lastRunAt)
|
|
130
|
+
] })]
|
|
131
|
+
})]
|
|
132
|
+
}), /* @__PURE__ */ C("button", {
|
|
133
|
+
type: "button",
|
|
134
|
+
onClick: I,
|
|
135
|
+
disabled: W,
|
|
136
|
+
className: r(w, "shrink-0"),
|
|
137
|
+
title: "Email the report to the saved recipients now. The next scheduled delivery does not move.",
|
|
138
|
+
children: [/* @__PURE__ */ S(v, { className: "h-4 w-4" }), M === "send" ? "Sending…" : "Send now"]
|
|
139
|
+
})]
|
|
140
|
+
}),
|
|
141
|
+
/* @__PURE__ */ C("fieldset", { children: [/* @__PURE__ */ S("legend", {
|
|
142
|
+
className: "mb-2 text-sm font-medium text-text-primary",
|
|
143
|
+
children: "Frequency"
|
|
144
|
+
}), /* @__PURE__ */ S("div", {
|
|
145
|
+
role: "radiogroup",
|
|
146
|
+
"aria-label": "Frequency",
|
|
147
|
+
className: "inline-flex rounded-md border border-border-seam p-0.5",
|
|
148
|
+
children: [i.Weekly, i.Monthly].map((e) => /* @__PURE__ */ S("button", {
|
|
149
|
+
type: "button",
|
|
150
|
+
role: "radio",
|
|
151
|
+
"aria-checked": E.cadence === e,
|
|
152
|
+
onClick: () => D({
|
|
153
|
+
...E,
|
|
154
|
+
cadence: e
|
|
155
|
+
}),
|
|
156
|
+
className: r("min-h-[36px] rounded px-4 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]", E.cadence === e ? "bg-action-primary-bg text-action-primary-text" : "text-text-secondary hover:bg-bg-sunken"),
|
|
157
|
+
children: e === i.Weekly ? "Weekly" : "Monthly"
|
|
158
|
+
}, e))
|
|
159
|
+
})] }),
|
|
160
|
+
/* @__PURE__ */ C("div", {
|
|
161
|
+
className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
|
|
162
|
+
children: [
|
|
163
|
+
U ? /* @__PURE__ */ C("div", { children: [
|
|
164
|
+
/* @__PURE__ */ S("label", {
|
|
165
|
+
htmlFor: "hm-schedule-weekday",
|
|
166
|
+
className: "mb-1 block text-sm font-medium text-text-primary",
|
|
167
|
+
children: "Day"
|
|
168
|
+
}),
|
|
169
|
+
/* @__PURE__ */ S("select", {
|
|
170
|
+
id: "hm-schedule-weekday",
|
|
171
|
+
value: E.dayOfWeek,
|
|
172
|
+
onChange: (e) => D({
|
|
173
|
+
...E,
|
|
174
|
+
dayOfWeek: Number(e.target.value)
|
|
175
|
+
}),
|
|
176
|
+
"aria-invalid": !!A.dayOfWeek,
|
|
177
|
+
className: r(T, A.dayOfWeek ? "border-status-error-border" : "border-border-seam"),
|
|
178
|
+
children: o.map((e, t) => /* @__PURE__ */ S("option", {
|
|
179
|
+
value: t,
|
|
180
|
+
children: e
|
|
181
|
+
}, e))
|
|
182
|
+
}),
|
|
183
|
+
A.dayOfWeek && /* @__PURE__ */ S("p", {
|
|
184
|
+
className: "mt-1 text-xs text-status-error-text",
|
|
185
|
+
children: A.dayOfWeek
|
|
186
|
+
})
|
|
187
|
+
] }) : /* @__PURE__ */ C("div", { children: [
|
|
188
|
+
/* @__PURE__ */ S("label", {
|
|
189
|
+
htmlFor: "hm-schedule-monthday",
|
|
190
|
+
className: "mb-1 block text-sm font-medium text-text-primary",
|
|
191
|
+
children: "Day of month"
|
|
192
|
+
}),
|
|
193
|
+
/* @__PURE__ */ S("select", {
|
|
194
|
+
id: "hm-schedule-monthday",
|
|
195
|
+
value: E.dayOfMonth,
|
|
196
|
+
onChange: (e) => D({
|
|
197
|
+
...E,
|
|
198
|
+
dayOfMonth: Number(e.target.value)
|
|
199
|
+
}),
|
|
200
|
+
"aria-invalid": !!A.dayOfMonth,
|
|
201
|
+
className: r(T, A.dayOfMonth ? "border-status-error-border" : "border-border-seam"),
|
|
202
|
+
children: Array.from({ length: 28 }, (e, t) => t + 1).map((e) => /* @__PURE__ */ S("option", {
|
|
203
|
+
value: e,
|
|
204
|
+
children: f(e)
|
|
205
|
+
}, e))
|
|
206
|
+
}),
|
|
207
|
+
A.dayOfMonth && /* @__PURE__ */ S("p", {
|
|
208
|
+
className: "mt-1 text-xs text-status-error-text",
|
|
209
|
+
children: A.dayOfMonth
|
|
210
|
+
})
|
|
211
|
+
] }),
|
|
212
|
+
/* @__PURE__ */ C("div", { children: [
|
|
213
|
+
/* @__PURE__ */ S("label", {
|
|
214
|
+
htmlFor: "hm-schedule-hour",
|
|
215
|
+
className: "mb-1 block text-sm font-medium text-text-primary",
|
|
216
|
+
children: "Time"
|
|
217
|
+
}),
|
|
218
|
+
/* @__PURE__ */ S("select", {
|
|
219
|
+
id: "hm-schedule-hour",
|
|
220
|
+
value: E.hour,
|
|
221
|
+
onChange: (e) => D({
|
|
222
|
+
...E,
|
|
223
|
+
hour: Number(e.target.value)
|
|
224
|
+
}),
|
|
225
|
+
"aria-invalid": !!A.hour,
|
|
226
|
+
className: r(T, A.hour ? "border-status-error-border" : "border-border-seam"),
|
|
227
|
+
children: Array.from({ length: 24 }, (e, t) => /* @__PURE__ */ S("option", {
|
|
228
|
+
value: t,
|
|
229
|
+
children: u(t)
|
|
230
|
+
}, t))
|
|
231
|
+
}),
|
|
232
|
+
A.hour && /* @__PURE__ */ S("p", {
|
|
233
|
+
className: "mt-1 text-xs text-status-error-text",
|
|
234
|
+
children: A.hour
|
|
235
|
+
})
|
|
236
|
+
] }),
|
|
237
|
+
/* @__PURE__ */ C("div", { children: [
|
|
238
|
+
/* @__PURE__ */ S("label", {
|
|
239
|
+
htmlFor: "hm-schedule-timezone",
|
|
240
|
+
className: "mb-1 block text-sm font-medium text-text-primary",
|
|
241
|
+
children: "Timezone"
|
|
242
|
+
}),
|
|
243
|
+
/* @__PURE__ */ S("select", {
|
|
244
|
+
id: "hm-schedule-timezone",
|
|
245
|
+
value: E.timezone,
|
|
246
|
+
onChange: (e) => D({
|
|
247
|
+
...E,
|
|
248
|
+
timezone: e.target.value
|
|
249
|
+
}),
|
|
250
|
+
"aria-invalid": !!A.timezone,
|
|
251
|
+
className: r(T, A.timezone ? "border-status-error-border" : "border-border-seam"),
|
|
252
|
+
children: R.map((e) => /* @__PURE__ */ S("option", {
|
|
253
|
+
value: e,
|
|
254
|
+
children: e
|
|
255
|
+
}, e))
|
|
256
|
+
}),
|
|
257
|
+
A.timezone && /* @__PURE__ */ S("p", {
|
|
258
|
+
className: "mt-1 text-xs text-status-error-text",
|
|
259
|
+
children: A.timezone
|
|
260
|
+
})
|
|
261
|
+
] })
|
|
262
|
+
]
|
|
263
|
+
}),
|
|
264
|
+
/* @__PURE__ */ C("fieldset", { children: [
|
|
265
|
+
/* @__PURE__ */ S("legend", {
|
|
266
|
+
className: "mb-1 text-sm font-medium text-text-primary",
|
|
267
|
+
children: "Recipients"
|
|
268
|
+
}),
|
|
269
|
+
/* @__PURE__ */ S("p", {
|
|
270
|
+
className: "mb-2 text-xs text-text-secondary",
|
|
271
|
+
children: "Workspace members only. Each recipient gets the email at the address on their account."
|
|
272
|
+
}),
|
|
273
|
+
/* @__PURE__ */ C("div", {
|
|
274
|
+
className: r("max-h-56 space-y-1 overflow-y-auto rounded-lg border p-2", A.recipients ? "border-status-error-border" : "border-border-seam"),
|
|
275
|
+
children: [
|
|
276
|
+
L.loading && /* @__PURE__ */ S("p", {
|
|
277
|
+
className: "px-2 py-1.5 text-sm text-text-secondary",
|
|
278
|
+
children: "Loading members…"
|
|
279
|
+
}),
|
|
280
|
+
L.error && /* @__PURE__ */ C("p", {
|
|
281
|
+
className: "px-2 py-1.5 text-sm text-status-error-text",
|
|
282
|
+
children: ["Members could not be loaded: ", L.error]
|
|
283
|
+
}),
|
|
284
|
+
L.members.map((e) => {
|
|
285
|
+
let t = E.recipientUserIds.includes(e.userId), n = !e.email;
|
|
286
|
+
return /* @__PURE__ */ C("label", {
|
|
287
|
+
className: r("flex items-center gap-3 rounded-md px-2 py-1.5", n ? "cursor-not-allowed opacity-60" : "cursor-pointer hover:bg-bg-sunken/40"),
|
|
288
|
+
children: [/* @__PURE__ */ S("input", {
|
|
289
|
+
type: "checkbox",
|
|
290
|
+
checked: t,
|
|
291
|
+
disabled: n && !t,
|
|
292
|
+
onChange: () => D({
|
|
293
|
+
...E,
|
|
294
|
+
recipientUserIds: m(E.recipientUserIds, e.userId)
|
|
295
|
+
}),
|
|
296
|
+
className: "h-4 w-4"
|
|
297
|
+
}), /* @__PURE__ */ C("span", {
|
|
298
|
+
className: "min-w-0",
|
|
299
|
+
children: [/* @__PURE__ */ S("span", {
|
|
300
|
+
className: "block truncate text-sm text-text-primary",
|
|
301
|
+
children: e.name
|
|
302
|
+
}), /* @__PURE__ */ S("span", {
|
|
303
|
+
className: "block truncate text-xs text-text-secondary",
|
|
304
|
+
children: e.email ?? "No email address"
|
|
305
|
+
})]
|
|
306
|
+
})]
|
|
307
|
+
}, e.userId);
|
|
308
|
+
}),
|
|
309
|
+
H.map((e) => /* @__PURE__ */ C("label", {
|
|
310
|
+
className: "flex cursor-pointer items-center gap-3 rounded-md px-2 py-1.5 hover:bg-bg-sunken/40",
|
|
311
|
+
children: [/* @__PURE__ */ S("input", {
|
|
312
|
+
type: "checkbox",
|
|
313
|
+
checked: !0,
|
|
314
|
+
onChange: () => D({
|
|
315
|
+
...E,
|
|
316
|
+
recipientUserIds: m(E.recipientUserIds, e)
|
|
317
|
+
}),
|
|
318
|
+
className: "h-4 w-4"
|
|
319
|
+
}), /* @__PURE__ */ C("span", {
|
|
320
|
+
className: "text-sm text-text-secondary",
|
|
321
|
+
children: [
|
|
322
|
+
"Former or unknown member (",
|
|
323
|
+
e.slice(0, 8),
|
|
324
|
+
")"
|
|
325
|
+
]
|
|
326
|
+
})]
|
|
327
|
+
}, e)),
|
|
328
|
+
!L.loading && !L.error && L.members.length === 0 && H.length === 0 && /* @__PURE__ */ S("p", {
|
|
329
|
+
className: "px-2 py-1.5 text-sm text-text-secondary",
|
|
330
|
+
children: "No workspace members found."
|
|
331
|
+
})
|
|
332
|
+
]
|
|
333
|
+
}),
|
|
334
|
+
A.recipients && /* @__PURE__ */ S("p", {
|
|
335
|
+
className: "mt-1 text-xs text-status-error-text",
|
|
336
|
+
children: A.recipients
|
|
337
|
+
})
|
|
338
|
+
] }),
|
|
339
|
+
/* @__PURE__ */ C("label", {
|
|
340
|
+
className: "flex cursor-pointer items-center gap-3 text-sm text-text-primary",
|
|
341
|
+
children: [/* @__PURE__ */ S("input", {
|
|
342
|
+
type: "checkbox",
|
|
343
|
+
checked: !E.enabled,
|
|
344
|
+
onChange: () => D({
|
|
345
|
+
...E,
|
|
346
|
+
enabled: !E.enabled
|
|
347
|
+
}),
|
|
348
|
+
className: "h-4 w-4"
|
|
349
|
+
}), "Pause deliveries (keep the schedule but send nothing)"]
|
|
350
|
+
}),
|
|
351
|
+
b && /* @__PURE__ */ C("div", { children: [
|
|
352
|
+
/* @__PURE__ */ S("h3", {
|
|
353
|
+
className: "mb-2 text-sm font-medium text-text-primary",
|
|
354
|
+
children: "Recent deliveries"
|
|
355
|
+
}),
|
|
356
|
+
z.error && /* @__PURE__ */ C("p", {
|
|
357
|
+
className: "text-xs text-status-error-text",
|
|
358
|
+
children: ["Deliveries could not be loaded: ", z.error.message]
|
|
359
|
+
}),
|
|
360
|
+
!z.error && B.length === 0 && /* @__PURE__ */ S("p", {
|
|
361
|
+
className: "text-xs text-text-secondary",
|
|
362
|
+
children: z.loading ? "Loading…" : "Nothing has been sent yet."
|
|
363
|
+
}),
|
|
364
|
+
B.length > 0 && /* @__PURE__ */ S("ul", {
|
|
365
|
+
className: "divide-y divide-border-seam rounded-lg border border-border-seam text-sm",
|
|
366
|
+
children: B.map((e) => /* @__PURE__ */ C("li", {
|
|
367
|
+
className: "flex flex-wrap items-center justify-between gap-2 px-3 py-2",
|
|
368
|
+
children: [/* @__PURE__ */ C("span", {
|
|
369
|
+
className: "text-text-secondary",
|
|
370
|
+
children: [
|
|
371
|
+
d(e.startedAt),
|
|
372
|
+
" ·",
|
|
373
|
+
" ",
|
|
374
|
+
e.trigger === "MANUAL" ? "Send now" : "Scheduled"
|
|
375
|
+
]
|
|
376
|
+
}), /* @__PURE__ */ C("span", {
|
|
377
|
+
className: k[c(e.status)],
|
|
378
|
+
title: e.error ?? void 0,
|
|
379
|
+
children: [
|
|
380
|
+
s(e.status),
|
|
381
|
+
" · ",
|
|
382
|
+
e.deliveredCount,
|
|
383
|
+
"/",
|
|
384
|
+
e.recipientCount
|
|
385
|
+
]
|
|
386
|
+
})]
|
|
387
|
+
}, e.id))
|
|
388
|
+
})
|
|
389
|
+
] }),
|
|
390
|
+
j && /* @__PURE__ */ S("p", {
|
|
391
|
+
role: "alert",
|
|
392
|
+
className: "rounded-lg border border-status-error-border px-4 py-3 text-sm text-status-error-text",
|
|
393
|
+
children: j
|
|
394
|
+
})
|
|
395
|
+
]
|
|
396
|
+
})
|
|
397
|
+
});
|
|
398
|
+
};
|
|
399
|
+
//#endregion
|
|
400
|
+
export { A as ReportScheduleDialog };
|
|
401
|
+
|
|
402
|
+
//# sourceMappingURL=ReportScheduleDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReportScheduleDialog.js","names":[],"sources":["../../../../src/headshotmarketing/pages/analytics/ReportScheduleDialog.tsx"],"sourcesContent":["/**\n * Schedule dialog for a saved report (mock 15 \"Schedule\", BOFF-10585)\n *\n * Sets a report's delivery schedule — weekly on a weekday or monthly on a\n * day of the month, at a local hour in a timezone — and the workspace\n * members it is emailed to. The service renders the report for its period\n * when a delivery is due and emails it through the notifications platform;\n * recipients are stored as member ids and their addresses are looked up at\n * send time, so someone who leaves the workspace stops receiving it.\n *\n * The dialog also offers Send now (one email to the current recipients,\n * without moving the next scheduled delivery), pausing, removing the\n * schedule, and the last few delivery attempts.\n *\n * @module headshotmarketing/pages/analytics\n */\n\nimport { useEffect, useMemo, useState, type FC } from \"react\";\nimport { useApolloClient } from \"@apollo/client/react\";\nimport { Send, Trash2 } from \"lucide-react\";\nimport { Modal } from \"../../components\";\nimport { cn } from \"../../utils/helpers\";\nimport {\n HeadshotmarketingReportRecipientIdentitiesDocument,\n HeadshotmarketingReportRecipientMembersDocument,\n useHeadshotmarketingSavedReportDeliveryRunsQuery,\n type HeadshotmarketingReportRecipientIdentitiesQuery,\n type HeadshotmarketingReportRecipientIdentitiesQueryVariables,\n type HeadshotmarketingReportRecipientMembersQuery,\n type HeadshotmarketingReportRecipientMembersQueryVariables,\n type HeadshotmarketingSavedReportDeliveryRunsQuery,\n type HeadshotmarketingSavedReportScheduleFieldsFragment,\n} from \"../../../generated/wspace-operations\";\nimport { HeadshotmarketingReportScheduleCadence } from \"../../../generated/wspace-types\";\nimport {\n MAX_DAY_OF_MONTH,\n WEEKDAYS,\n deliveryStatusLabel,\n deliveryStatusTone,\n describeSchedule,\n formatHour,\n formatInstant,\n ordinal,\n timezoneOptions,\n toggleRecipient,\n type ScheduleDraft,\n type ScheduleDraftErrors,\n} from \"./reportSchedule\";\n\nconst BUTTON_SECONDARY =\n \"inline-flex min-h-[40px] items-center gap-2 rounded-md border border-border-seam bg-bg-surface px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken disabled:cursor-not-allowed disabled:opacity-60\";\nconst FIELD =\n \"min-h-[44px] w-full rounded-md border bg-bg-surface px-3 py-2 text-sm text-text-primary\";\n\n/** Members are listed 100 at a time; this caps the directory at 1,000. */\nconst MEMBER_PAGE_SIZE = 100;\nconst MEMBER_PAGE_CAP = 10;\n\ntype DeliveryRun =\n HeadshotmarketingSavedReportDeliveryRunsQuery[\"headshotmarketingSavedReportDeliveryRuns\"][\"items\"][number];\n\nexport interface RecipientOption {\n userId: string;\n name: string;\n email: string | null;\n}\n\n/**\n * Active workspace members with their display names and emails, loaded\n * when the dialog opens.\n */\nfunction useRecipientDirectory(\n workspaceId: string,\n open: boolean,\n): { members: RecipientOption[]; loading: boolean; error: string | null } {\n const client = useApolloClient();\n const [members, setMembers] = useState<RecipientOption[]>([]);\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n useEffect(() => {\n if (!open || !workspaceId) return;\n let cancelled = false;\n const load = async (): Promise<void> => {\n setLoading(true);\n setError(null);\n try {\n const userIds: string[] = [];\n for (let page = 0; page < MEMBER_PAGE_CAP; page += 1) {\n const res = await client.query<\n HeadshotmarketingReportRecipientMembersQuery,\n HeadshotmarketingReportRecipientMembersQueryVariables\n >({\n query: HeadshotmarketingReportRecipientMembersDocument,\n variables: { workspaceId, offset: page * MEMBER_PAGE_SIZE },\n fetchPolicy: \"network-only\",\n });\n const list = res.data?.workspaceMembers;\n if (!list) break;\n for (const item of list.items) {\n if (item.status.toLowerCase() === \"active\") {\n userIds.push(item.userId);\n }\n }\n if (!list.hasMore) break;\n }\n const unique = [...new Set(userIds)];\n const options: RecipientOption[] = [];\n for (let i = 0; i < unique.length; i += MEMBER_PAGE_SIZE) {\n const chunk = unique.slice(i, i + MEMBER_PAGE_SIZE);\n const res = await client.query<\n HeadshotmarketingReportRecipientIdentitiesQuery,\n HeadshotmarketingReportRecipientIdentitiesQueryVariables\n >({\n query: HeadshotmarketingReportRecipientIdentitiesDocument,\n variables: { workspaceId, userIds: chunk },\n fetchPolicy: \"network-only\",\n });\n for (const identity of res.data?.workspaceMemberIdentities ?? []) {\n options.push({\n userId: identity.userId,\n name: identity.displayName || identity.email || identity.userId,\n email: identity.email ?? null,\n });\n }\n }\n options.sort((a, b) => a.name.localeCompare(b.name));\n if (!cancelled) setMembers(options);\n } catch (err) {\n if (!cancelled) {\n setError(\n err instanceof Error ? err.message : \"Members could not be loaded.\",\n );\n }\n } finally {\n if (!cancelled) setLoading(false);\n }\n };\n void load();\n return () => {\n cancelled = true;\n };\n }, [client, workspaceId, open]);\n\n return { members, loading, error };\n}\n\nconst TONE_CLASSES: Record<ReturnType<typeof deliveryStatusTone>, string> = {\n success: \"text-status-success-text\",\n warning: \"text-status-warning-text\",\n error: \"text-status-error-text\",\n neutral: \"text-text-secondary\",\n};\n\nexport const ReportScheduleDialog: FC<{\n open: boolean;\n reportId: string;\n reportName: string;\n workspaceId: string;\n schedule: HeadshotmarketingSavedReportScheduleFieldsFragment | null;\n draft: ScheduleDraft;\n onChange: (draft: ScheduleDraft) => void;\n errors: ScheduleDraftErrors;\n serverError: string | null;\n busy: \"save\" | \"remove\" | \"send\" | null;\n onClose: () => void;\n onSave: () => void;\n onRemove: () => void;\n onSendNow: () => void;\n}> = ({\n open,\n reportId,\n reportName,\n workspaceId,\n schedule,\n draft,\n onChange,\n errors,\n serverError,\n busy,\n onClose,\n onSave,\n onRemove,\n onSendNow,\n}) => {\n const directory = useRecipientDirectory(workspaceId, open);\n const timezones = useMemo(\n () => timezoneOptions(draft.timezone),\n [draft.timezone],\n );\n const runsQuery = useHeadshotmarketingSavedReportDeliveryRunsQuery({\n variables: { reportId },\n skip: !open || !schedule,\n fetchPolicy: \"cache-and-network\",\n });\n const runs: DeliveryRun[] =\n runsQuery.data?.headshotmarketingSavedReportDeliveryRuns.items ?? [];\n\n // Recipients already on the schedule who are no longer listed (left the\n // workspace, or the directory failed to load) stay visible so they can be\n // removed deliberately.\n const listedIds = new Set(directory.members.map((m) => m.userId));\n const unlisted = draft.recipientUserIds.filter((id) => !listedIds.has(id));\n const weekly =\n draft.cadence === HeadshotmarketingReportScheduleCadence.Weekly;\n const disabled = busy !== null;\n\n return (\n <Modal\n open={open}\n onClose={onClose}\n title={schedule ? \"Delivery schedule\" : \"Schedule report\"}\n description={`Email \"${reportName}\" to workspace members on a regular schedule. Each email covers the report's period at the time it is sent.`}\n size=\"lg\"\n footer={\n <>\n {schedule && (\n <button\n type=\"button\"\n onClick={onRemove}\n disabled={disabled}\n className={cn(BUTTON_SECONDARY, \"mr-auto text-status-error-text\")}\n >\n <Trash2 className=\"h-4 w-4\" />\n {busy === \"remove\" ? \"Removing…\" : \"Remove schedule\"}\n </button>\n )}\n <button\n type=\"button\"\n onClick={onClose}\n disabled={disabled}\n className={BUTTON_SECONDARY}\n >\n Cancel\n </button>\n <button\n type=\"button\"\n onClick={onSave}\n disabled={disabled}\n className=\"inline-flex min-h-[40px] items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90 disabled:cursor-not-allowed disabled:opacity-60\"\n >\n {busy === \"save\"\n ? \"Saving…\"\n : schedule\n ? \"Save schedule\"\n : \"Create schedule\"}\n </button>\n </>\n }\n >\n <div className=\"space-y-5\">\n {schedule && (\n <div className=\"flex flex-col gap-3 rounded-lg border border-border-seam bg-bg-sunken/30 px-4 py-3 text-sm sm:flex-row sm:items-center sm:justify-between\">\n <div className=\"min-w-0\">\n <p className=\"font-medium text-text-primary\">\n {describeSchedule(schedule)}\n </p>\n <p className=\"mt-0.5 text-xs text-text-secondary\">\n {schedule.enabled\n ? `Next delivery ${formatInstant(schedule.nextRunAt)}`\n : \"Paused\"}\n {schedule.lastRunStatus && (\n <>\n {\" · Last: \"}\n <span\n className={\n TONE_CLASSES[deliveryStatusTone(schedule.lastRunStatus)]\n }\n >\n {deliveryStatusLabel(schedule.lastRunStatus)}\n </span>{\" \"}\n {formatInstant(schedule.lastRunAt)}\n </>\n )}\n </p>\n </div>\n <button\n type=\"button\"\n onClick={onSendNow}\n disabled={disabled}\n className={cn(BUTTON_SECONDARY, \"shrink-0\")}\n title=\"Email the report to the saved recipients now. The next scheduled delivery does not move.\"\n >\n <Send className=\"h-4 w-4\" />\n {busy === \"send\" ? \"Sending…\" : \"Send now\"}\n </button>\n </div>\n )}\n\n <fieldset>\n <legend className=\"mb-2 text-sm font-medium text-text-primary\">\n Frequency\n </legend>\n <div\n role=\"radiogroup\"\n aria-label=\"Frequency\"\n className=\"inline-flex rounded-md border border-border-seam p-0.5\"\n >\n {[\n HeadshotmarketingReportScheduleCadence.Weekly,\n HeadshotmarketingReportScheduleCadence.Monthly,\n ].map((cadence) => (\n <button\n key={cadence}\n type=\"button\"\n role=\"radio\"\n aria-checked={draft.cadence === cadence}\n onClick={() => onChange({ ...draft, cadence })}\n className={cn(\n \"min-h-[36px] rounded px-4 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]\",\n draft.cadence === cadence\n ? \"bg-action-primary-bg text-action-primary-text\"\n : \"text-text-secondary hover:bg-bg-sunken\",\n )}\n >\n {cadence === HeadshotmarketingReportScheduleCadence.Weekly\n ? \"Weekly\"\n : \"Monthly\"}\n </button>\n ))}\n </div>\n </fieldset>\n\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-3\">\n {weekly ? (\n <div>\n <label\n htmlFor=\"hm-schedule-weekday\"\n className=\"mb-1 block text-sm font-medium text-text-primary\"\n >\n Day\n </label>\n <select\n id=\"hm-schedule-weekday\"\n value={draft.dayOfWeek}\n onChange={(e) =>\n onChange({ ...draft, dayOfWeek: Number(e.target.value) })\n }\n aria-invalid={Boolean(errors.dayOfWeek)}\n className={cn(\n FIELD,\n errors.dayOfWeek\n ? \"border-status-error-border\"\n : \"border-border-seam\",\n )}\n >\n {WEEKDAYS.map((day, index) => (\n <option key={day} value={index}>\n {day}\n </option>\n ))}\n </select>\n {errors.dayOfWeek && (\n <p className=\"mt-1 text-xs text-status-error-text\">\n {errors.dayOfWeek}\n </p>\n )}\n </div>\n ) : (\n <div>\n <label\n htmlFor=\"hm-schedule-monthday\"\n className=\"mb-1 block text-sm font-medium text-text-primary\"\n >\n Day of month\n </label>\n <select\n id=\"hm-schedule-monthday\"\n value={draft.dayOfMonth}\n onChange={(e) =>\n onChange({ ...draft, dayOfMonth: Number(e.target.value) })\n }\n aria-invalid={Boolean(errors.dayOfMonth)}\n className={cn(\n FIELD,\n errors.dayOfMonth\n ? \"border-status-error-border\"\n : \"border-border-seam\",\n )}\n >\n {Array.from({ length: MAX_DAY_OF_MONTH }, (_, i) => i + 1).map(\n (day) => (\n <option key={day} value={day}>\n {ordinal(day)}\n </option>\n ),\n )}\n </select>\n {errors.dayOfMonth && (\n <p className=\"mt-1 text-xs text-status-error-text\">\n {errors.dayOfMonth}\n </p>\n )}\n </div>\n )}\n\n <div>\n <label\n htmlFor=\"hm-schedule-hour\"\n className=\"mb-1 block text-sm font-medium text-text-primary\"\n >\n Time\n </label>\n <select\n id=\"hm-schedule-hour\"\n value={draft.hour}\n onChange={(e) =>\n onChange({ ...draft, hour: Number(e.target.value) })\n }\n aria-invalid={Boolean(errors.hour)}\n className={cn(\n FIELD,\n errors.hour\n ? \"border-status-error-border\"\n : \"border-border-seam\",\n )}\n >\n {Array.from({ length: 24 }, (_, hour) => (\n <option key={hour} value={hour}>\n {formatHour(hour)}\n </option>\n ))}\n </select>\n {errors.hour && (\n <p className=\"mt-1 text-xs text-status-error-text\">\n {errors.hour}\n </p>\n )}\n </div>\n\n <div>\n <label\n htmlFor=\"hm-schedule-timezone\"\n className=\"mb-1 block text-sm font-medium text-text-primary\"\n >\n Timezone\n </label>\n <select\n id=\"hm-schedule-timezone\"\n value={draft.timezone}\n onChange={(e) => onChange({ ...draft, timezone: e.target.value })}\n aria-invalid={Boolean(errors.timezone)}\n className={cn(\n FIELD,\n errors.timezone\n ? \"border-status-error-border\"\n : \"border-border-seam\",\n )}\n >\n {timezones.map((zone) => (\n <option key={zone} value={zone}>\n {zone}\n </option>\n ))}\n </select>\n {errors.timezone && (\n <p className=\"mt-1 text-xs text-status-error-text\">\n {errors.timezone}\n </p>\n )}\n </div>\n </div>\n\n <fieldset>\n <legend className=\"mb-1 text-sm font-medium text-text-primary\">\n Recipients\n </legend>\n <p className=\"mb-2 text-xs text-text-secondary\">\n Workspace members only. Each recipient gets the email at the address\n on their account.\n </p>\n <div\n className={cn(\n \"max-h-56 space-y-1 overflow-y-auto rounded-lg border p-2\",\n errors.recipients\n ? \"border-status-error-border\"\n : \"border-border-seam\",\n )}\n >\n {directory.loading && (\n <p className=\"px-2 py-1.5 text-sm text-text-secondary\">\n Loading members…\n </p>\n )}\n {directory.error && (\n <p className=\"px-2 py-1.5 text-sm text-status-error-text\">\n Members could not be loaded: {directory.error}\n </p>\n )}\n {directory.members.map((member) => {\n const checked = draft.recipientUserIds.includes(member.userId);\n const noEmail = !member.email;\n return (\n <label\n key={member.userId}\n className={cn(\n \"flex items-center gap-3 rounded-md px-2 py-1.5\",\n noEmail\n ? \"cursor-not-allowed opacity-60\"\n : \"cursor-pointer hover:bg-bg-sunken/40\",\n )}\n >\n <input\n type=\"checkbox\"\n checked={checked}\n disabled={noEmail && !checked}\n onChange={() =>\n onChange({\n ...draft,\n recipientUserIds: toggleRecipient(\n draft.recipientUserIds,\n member.userId,\n ),\n })\n }\n className=\"h-4 w-4\"\n />\n <span className=\"min-w-0\">\n <span className=\"block truncate text-sm text-text-primary\">\n {member.name}\n </span>\n <span className=\"block truncate text-xs text-text-secondary\">\n {member.email ?? \"No email address\"}\n </span>\n </span>\n </label>\n );\n })}\n {unlisted.map((userId) => (\n <label\n key={userId}\n className=\"flex cursor-pointer items-center gap-3 rounded-md px-2 py-1.5 hover:bg-bg-sunken/40\"\n >\n <input\n type=\"checkbox\"\n checked\n onChange={() =>\n onChange({\n ...draft,\n recipientUserIds: toggleRecipient(\n draft.recipientUserIds,\n userId,\n ),\n })\n }\n className=\"h-4 w-4\"\n />\n <span className=\"text-sm text-text-secondary\">\n Former or unknown member ({userId.slice(0, 8)})\n </span>\n </label>\n ))}\n {!directory.loading &&\n !directory.error &&\n directory.members.length === 0 &&\n unlisted.length === 0 && (\n <p className=\"px-2 py-1.5 text-sm text-text-secondary\">\n No workspace members found.\n </p>\n )}\n </div>\n {errors.recipients && (\n <p className=\"mt-1 text-xs text-status-error-text\">\n {errors.recipients}\n </p>\n )}\n </fieldset>\n\n <label className=\"flex cursor-pointer items-center gap-3 text-sm text-text-primary\">\n <input\n type=\"checkbox\"\n checked={!draft.enabled}\n onChange={() => onChange({ ...draft, enabled: !draft.enabled })}\n className=\"h-4 w-4\"\n />\n Pause deliveries (keep the schedule but send nothing)\n </label>\n\n {schedule && (\n <div>\n <h3 className=\"mb-2 text-sm font-medium text-text-primary\">\n Recent deliveries\n </h3>\n {runsQuery.error && (\n <p className=\"text-xs text-status-error-text\">\n Deliveries could not be loaded: {runsQuery.error.message}\n </p>\n )}\n {!runsQuery.error && runs.length === 0 && (\n <p className=\"text-xs text-text-secondary\">\n {runsQuery.loading ? \"Loading…\" : \"Nothing has been sent yet.\"}\n </p>\n )}\n {runs.length > 0 && (\n <ul className=\"divide-y divide-border-seam rounded-lg border border-border-seam text-sm\">\n {runs.map((run) => (\n <li\n key={run.id}\n className=\"flex flex-wrap items-center justify-between gap-2 px-3 py-2\"\n >\n <span className=\"text-text-secondary\">\n {formatInstant(run.startedAt)} ·{\" \"}\n {run.trigger === \"MANUAL\" ? \"Send now\" : \"Scheduled\"}\n </span>\n <span\n className={TONE_CLASSES[deliveryStatusTone(run.status)]}\n title={run.error ?? undefined}\n >\n {deliveryStatusLabel(run.status)} · {run.deliveredCount}/\n {run.recipientCount}\n </span>\n </li>\n ))}\n </ul>\n )}\n </div>\n )}\n\n {serverError && (\n <p\n role=\"alert\"\n className=\"rounded-lg border border-status-error-border px-4 py-3 text-sm text-status-error-text\"\n >\n {serverError}\n </p>\n )}\n </div>\n </Modal>\n );\n};\n"],"mappings":";;;;;;;;;;;AAiDA,IAAM,IACJ,uOACI,IACJ,2FAGI,IAAmB,KACnB,IAAkB;AAexB,SAAS,EACP,GACA,GACwE;CACxE,IAAM,IAAS,GAAiB,EAC1B,CAAC,GAAS,KAAc,EAA4B,EAAE,CAAC,EACvD,CAAC,GAAS,KAAc,EAAS,GAAM,EACvC,CAAC,GAAO,KAAY,EAAwB,KAAK;AAkEvD,QAhEA,QAAgB;AACd,MAAI,CAAC,KAAQ,CAAC,EAAa;EAC3B,IAAI,IAAY;AAyDhB,UAxDa,YAA2B;AAEtC,GADA,EAAW,GAAK,EAChB,EAAS,KAAK;AACd,OAAI;IACF,IAAM,IAAoB,EAAE;AAC5B,SAAK,IAAI,IAAO,GAAG,IAAO,GAAiB,KAAQ,GAAG;KASpD,IAAM,KARM,MAAM,EAAO,MAGvB;MACA,OAAO;MACP,WAAW;OAAE;OAAa,QAAQ,IAAO;OAAkB;MAC3D,aAAa;MACd,CAAC,EACe,MAAM;AACvB,SAAI,CAAC,EAAM;AACX,UAAK,IAAM,KAAQ,EAAK,MACtB,CAAI,EAAK,OAAO,aAAa,KAAK,YAChC,EAAQ,KAAK,EAAK,OAAO;AAG7B,SAAI,CAAC,EAAK,QAAS;;IAErB,IAAM,IAAS,CAAC,GAAG,IAAI,IAAI,EAAQ,CAAC,EAC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QAEnD,CAAA;OAEJ;;KACL,EAAO,cACN,kBAAC,KAAD;MAAG,WAAU;gBACV,EAAO;MACN,CAAA;KAEG,EAAA,CAAA;IAEX,kBAAC,SAAD;KAAO,WAAU;eAAjB,CACE,kBAAC,SAAD;MACE,MAAK;MACL,SAAS,CAAC,EAAM;MAChB,gBAAgB,EAAS;OAAE,GAAG;OAAO,SAAS,CAAC,EAAM;OAAS,CAAC;MAC/D,WAAU;MACV,CAAA,EAAA,wDAEI;;IAEP,KACC,kBAAC,OAAD,EAAA,UAAA;KACE,kBAAC,MAAD;MAAI,WAAU;gBAA6C;MAEtD,CAAA;KACJ,EAAU,SACT,kBAAC,KAAD;MAAG,WAAU;gBAAb,CAA8C,oCACX,EAAU,MAAM,QAC/C;;KAEL,CAAC,EAAU,SAAS,EAAK,WAAW,KACnC,kBAAC,KAAD;MAAG,WAAU;gBACV,EAAU,UAAU,aAAa;MAChC,CAAA;KAEL,EAAK,SAAS,KACb,kBAAC,MAAD;MAAI,WAAU;gBACX,EAAK,KAAK,MACT,kBAAC,MAAD;OAEE,WAAU;iBAFZ,CAIE,kBAAC,QAAD;QAAM,WAAU;kBAAhB;SACG,EAAc,EAAI,UAAU;SAAC;SAAG;SAChC,EAAI,YAAY,WAAW,aAAa;SACpC;WACP,kBAAC,QAAD;QACE,WAAW,EAAa,EAAmB,EAAI,OAAO;QACtD,OAAO,EAAI,SAAS,KAAA;kBAFtB;SAIG,EAAoB,EAAI,OAAO;SAAC;SAAI,EAAI;SAAe;SACvD,EAAI;SACA;UACJ;SAdE,EAAI,GAcN,CACL;MACC,CAAA;KAEH,EAAA,CAAA;IAGP,KACC,kBAAC,KAAD;KACE,MAAK;KACL,WAAU;eAET;KACC,CAAA;IAEF;;EACA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReportsPage.d.ts","sourceRoot":"","sources":["../../../../src/headshotmarketing/pages/analytics/ReportsPage.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ReportsPage.d.ts","sourceRoot":"","sources":["../../../../src/headshotmarketing/pages/analytics/ReportsPage.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAqB,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAmWnD,eAAO,MAAM,WAAW,EAAE,EAwsBzB,CAAC"}
|