@nivaro/react 0.3.100 → 0.3.102
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/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +46 -3
- package/dist/index.js +623 -620
- package/dist/shared/components/ActivityEntry.js +5 -5
- package/dist/shared/components/CollectionBrowserView.js +183 -175
- package/dist/shared/components/ItemEditForm.js +2708 -2704
- package/dist/shared/components/JobsTray.js +74 -63
- package/dist/shared/components/NotificationBell.js +80 -73
- package/dist/shared/components/TipLayer.js +56 -41
- package/dist/shared/components/cbv-file-label.js +46 -0
- package/dist/shared/components/integrations/console/SignalCard.js +40 -40
- package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +95 -73
- package/dist/shared/components/integrations/console/drill/status.js +23 -18
- package/dist/shared/components/item-edit/RecordInsights.js +86 -86
- package/dist/shared/components/item-edit/header-path-preview.js +46 -34
- package/dist/shared/components/notifications/DeliveryChips.js +1 -2
- package/dist/shared/components/panels/BackgroundMove.js +152 -85
- package/dist/shared/components/panels/PipelinePanel.js +602 -594
- package/dist/shared/components/profile/ActivityFeedCard.js +322 -0
- package/dist/shared/components/profile/DayTimeline.js +145 -140
- package/dist/shared/components/profile/PersonAccess.js +679 -383
- package/dist/shared/components/profile/PersonActivity.js +404 -427
- package/dist/shared/components/profile/PersonDidPanel.js +248 -134
- package/dist/shared/components/profile/PersonProfile.js +33 -32
- package/dist/shared/components/profile/journey-view.js +166 -0
- package/dist/shared/lib/activity-sentence.js +319 -236
- package/dist/shared/lib/jobs-tray.js +60 -41
- package/dist/shared/lib/move-failure.js +16 -6
- package/dist/shared/lib/obligation-banner.js +16 -16
- package/dist/shared/lib/partner-failure.js +44 -32
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as a, jsx as r, Fragment as A } from "react/jsx-runtime";
|
|
2
|
-
import { AlertOctagon as O, AlertTriangle as W, ChevronRight as
|
|
2
|
+
import { AlertOctagon as O, AlertTriangle as W, ChevronRight as E, Loader2 as M, ChevronDown as G, ExternalLink as V } from "lucide-react";
|
|
3
3
|
import { useState as L, useMemo as X, useId as q, useRef as H } from "react";
|
|
4
4
|
import { useItemEditAuth as J } from "../../../context.js";
|
|
5
|
-
import { userErrorMessage as
|
|
5
|
+
import { userErrorMessage as I } from "../../../lib/safe-error.js";
|
|
6
6
|
import { cn as x, titleCase as Q } from "../../../lib/utils.js";
|
|
7
7
|
import { ExplainButton as Y } from "../../ai/ExplainButton.js";
|
|
8
8
|
import { useDrillWindows as Z, DrillTag as ee } from "../../chaos/DrillTag.js";
|
|
@@ -24,7 +24,7 @@ function De({
|
|
|
24
24
|
onExplain: p,
|
|
25
25
|
canExplain: l
|
|
26
26
|
}) {
|
|
27
|
-
const
|
|
27
|
+
const f = t.severity === "critical", v = f ? "negative" : "warning", S = f ? O : W, y = pe(t), z = Z(), $ = t.rows.reduce(
|
|
28
28
|
(N, D) => !N || D.first_seen > N ? D.first_seen : N,
|
|
29
29
|
null
|
|
30
30
|
), k = t.rows[0], [b, C] = L(!1), _ = `ic-signal-body-${t.id.replace(/[^a-z0-9]/gi, "-")}`;
|
|
@@ -51,7 +51,7 @@ function De({
|
|
|
51
51
|
"mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-md",
|
|
52
52
|
de[v]
|
|
53
53
|
),
|
|
54
|
-
"data-tip":
|
|
54
|
+
"data-tip": f ? "Critical — something is failing now" : "Worth a look",
|
|
55
55
|
children: /* @__PURE__ */ r(S, { className: x("h-3.5 w-3.5", T[v]), "aria-hidden": !0 })
|
|
56
56
|
}
|
|
57
57
|
),
|
|
@@ -77,7 +77,7 @@ function De({
|
|
|
77
77
|
/* @__PURE__ */ r("span", { className: "mt-0.5 block truncate text-[12px] text-muted-foreground", children: t.error ? t.error : k ? `${k.title}${k.detail ? ` — ${K(k.detail)}` : ""}` : t.description })
|
|
78
78
|
] }),
|
|
79
79
|
/* @__PURE__ */ r(
|
|
80
|
-
|
|
80
|
+
E,
|
|
81
81
|
{
|
|
82
82
|
className: x(
|
|
83
83
|
"mt-1 h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200",
|
|
@@ -96,7 +96,7 @@ function De({
|
|
|
96
96
|
] }) : /* @__PURE__ */ a(A, { children: [
|
|
97
97
|
/* @__PURE__ */ r("p", { className: "max-w-[80ch] px-4 pb-1 pt-3 text-[12px] leading-relaxed text-muted-foreground", children: t.description }),
|
|
98
98
|
/* @__PURE__ */ r(
|
|
99
|
-
|
|
99
|
+
he,
|
|
100
100
|
{
|
|
101
101
|
signal: t,
|
|
102
102
|
rows: t.rows,
|
|
@@ -124,7 +124,7 @@ function De({
|
|
|
124
124
|
className: "flex w-full items-center gap-1.5 px-4 py-2 text-left text-[12px] font-medium text-muted-foreground hover:text-foreground",
|
|
125
125
|
children: [
|
|
126
126
|
/* @__PURE__ */ r(
|
|
127
|
-
|
|
127
|
+
E,
|
|
128
128
|
{
|
|
129
129
|
className: x("h-3.5 w-3.5 transition-transform", b && "rotate-90")
|
|
130
130
|
}
|
|
@@ -142,14 +142,14 @@ function De({
|
|
|
142
142
|
}
|
|
143
143
|
);
|
|
144
144
|
}
|
|
145
|
-
function
|
|
145
|
+
function he({
|
|
146
146
|
signal: t,
|
|
147
147
|
rows: e,
|
|
148
148
|
onOpenRecord: m,
|
|
149
149
|
onExplain: g,
|
|
150
150
|
canExplain: p
|
|
151
151
|
}) {
|
|
152
|
-
const l = te(),
|
|
152
|
+
const l = te(), f = ne(), [v, S] = L({}), [y, z] = L(/* @__PURE__ */ new Set()), [$, k] = L(/* @__PURE__ */ new Set()), b = X(() => {
|
|
153
153
|
if (!e.some((s) => s.group)) return null;
|
|
154
154
|
const o = /* @__PURE__ */ new Map();
|
|
155
155
|
for (const s of e) {
|
|
@@ -165,15 +165,15 @@ function fe({
|
|
|
165
165
|
const c = await l.mutateAsync({ signal: t.id, row_keys: i, action: o });
|
|
166
166
|
S((n) => {
|
|
167
167
|
const u = { ...n };
|
|
168
|
-
for (const
|
|
168
|
+
for (const h of c) u[h.key] = h;
|
|
169
169
|
return u;
|
|
170
170
|
}), k((n) => new Set([...n].filter((u) => !i.includes(u))));
|
|
171
171
|
} catch (c) {
|
|
172
|
-
const n = ((d = c == null ? void 0 : c.response) == null ? void 0 : d.error) ??
|
|
172
|
+
const n = ((d = c == null ? void 0 : c.response) == null ? void 0 : d.error) ?? I(c, "The action failed");
|
|
173
173
|
S((u) => {
|
|
174
|
-
const
|
|
175
|
-
for (const w of i)
|
|
176
|
-
return
|
|
174
|
+
const h = { ...u };
|
|
175
|
+
for (const w of i) h[w] = { key: w, ok: !1, message: n };
|
|
176
|
+
return h;
|
|
177
177
|
});
|
|
178
178
|
} finally {
|
|
179
179
|
z((c) => new Set([...c].filter((n) => !i.includes(n))));
|
|
@@ -183,12 +183,12 @@ function fe({
|
|
|
183
183
|
const s = o.map((d) => d.key);
|
|
184
184
|
z((d) => /* @__PURE__ */ new Set([...d, ...s]));
|
|
185
185
|
try {
|
|
186
|
-
await
|
|
186
|
+
await f.mutateAsync({ signal: t.id, row_keys: s }), k((d) => new Set([...d].filter((c) => !s.includes(c))));
|
|
187
187
|
} catch (d) {
|
|
188
|
-
const c = ((i = d == null ? void 0 : d.response) == null ? void 0 : i.error) ??
|
|
188
|
+
const c = ((i = d == null ? void 0 : d.response) == null ? void 0 : i.error) ?? I(d, "Could not dismiss");
|
|
189
189
|
S((n) => {
|
|
190
190
|
const u = { ...n };
|
|
191
|
-
for (const
|
|
191
|
+
for (const h of s) u[h] = { key: h, ok: !1, message: c };
|
|
192
192
|
return u;
|
|
193
193
|
});
|
|
194
194
|
} finally {
|
|
@@ -197,8 +197,8 @@ function fe({
|
|
|
197
197
|
}, N = (o, s) => {
|
|
198
198
|
var i, d, c, n;
|
|
199
199
|
if (o.kind === "open") {
|
|
200
|
-
const u = ((i = o.payload) == null ? void 0 : i.collection) ?? ((d = s.record) == null ? void 0 : d.collection),
|
|
201
|
-
u &&
|
|
200
|
+
const u = ((i = o.payload) == null ? void 0 : i.collection) ?? ((d = s.record) == null ? void 0 : d.collection), h = ((c = o.payload) == null ? void 0 : c.id) ?? ((n = s.record) == null ? void 0 : n.id);
|
|
201
|
+
u && h && (m == null || m(u, String(h)));
|
|
202
202
|
return;
|
|
203
203
|
}
|
|
204
204
|
if (o.kind === "explain") {
|
|
@@ -207,7 +207,7 @@ function fe({
|
|
|
207
207
|
}
|
|
208
208
|
C(o, [s]);
|
|
209
209
|
}, D = (o, s) => /* @__PURE__ */ r(
|
|
210
|
-
|
|
210
|
+
fe,
|
|
211
211
|
{
|
|
212
212
|
signal: t,
|
|
213
213
|
row: o,
|
|
@@ -266,12 +266,12 @@ function fe({
|
|
|
266
266
|
const s = o.rows.filter((n) => $.has(n.key)), i = o.rows.length > 0 && s.length === o.rows.length, d = /* @__PURE__ */ new Map();
|
|
267
267
|
for (const n of s) {
|
|
268
268
|
const u = /* @__PURE__ */ new Set();
|
|
269
|
-
for (const
|
|
270
|
-
if (!ue.includes(
|
|
271
|
-
const w = me(
|
|
269
|
+
for (const h of n.actions) {
|
|
270
|
+
if (!ue.includes(h.kind)) continue;
|
|
271
|
+
const w = me(h);
|
|
272
272
|
if (u.has(w)) continue;
|
|
273
273
|
u.add(w);
|
|
274
|
-
const B = d.get(w) ?? { action:
|
|
274
|
+
const B = d.get(w) ?? { action: h, rows: [] };
|
|
275
275
|
B.rows.push(n), d.set(w, B);
|
|
276
276
|
}
|
|
277
277
|
}
|
|
@@ -287,10 +287,10 @@ function fe({
|
|
|
287
287
|
n && (n.indeterminate = s.length > 0 && !i);
|
|
288
288
|
},
|
|
289
289
|
onChange: (n) => k((u) => {
|
|
290
|
-
const
|
|
290
|
+
const h = new Set(u);
|
|
291
291
|
for (const w of o.rows)
|
|
292
|
-
n.target.checked ?
|
|
293
|
-
return
|
|
292
|
+
n.target.checked ? h.add(w.key) : h.delete(w.key);
|
|
293
|
+
return h;
|
|
294
294
|
}),
|
|
295
295
|
"aria-label": `Select every problem in ${o.label}`,
|
|
296
296
|
"data-ic-group-select": o.key,
|
|
@@ -347,17 +347,17 @@ function fe({
|
|
|
347
347
|
] }, o.key);
|
|
348
348
|
}) });
|
|
349
349
|
}
|
|
350
|
-
function
|
|
350
|
+
function P(t) {
|
|
351
351
|
return t.label ? t.label : `${Q(t.collection).replace(/s$/, "")} ${t.id}`;
|
|
352
352
|
}
|
|
353
|
-
function
|
|
353
|
+
function fe({
|
|
354
354
|
signal: t,
|
|
355
355
|
row: e,
|
|
356
356
|
result: m,
|
|
357
357
|
busy: g,
|
|
358
358
|
selectable: p,
|
|
359
359
|
selected: l,
|
|
360
|
-
onSelect:
|
|
360
|
+
onSelect: f,
|
|
361
361
|
onAction: v,
|
|
362
362
|
onOpenRecord: S,
|
|
363
363
|
canExplain: y
|
|
@@ -385,7 +385,7 @@ function he({
|
|
|
385
385
|
{
|
|
386
386
|
type: "checkbox",
|
|
387
387
|
checked: l,
|
|
388
|
-
onChange: (n) =>
|
|
388
|
+
onChange: (n) => f(n.target.checked),
|
|
389
389
|
"aria-label": `Select ${e.title}`,
|
|
390
390
|
"data-ic-select-row": e.key,
|
|
391
391
|
className: "mt-1 h-3.5 w-3.5 shrink-0 accent-[rgb(var(--nvr-cyan-rgb))]"
|
|
@@ -509,7 +509,7 @@ function he({
|
|
|
509
509
|
{
|
|
510
510
|
kind: "signal-row",
|
|
511
511
|
params: { signal: t.id, row_key: e.key },
|
|
512
|
-
label: "Explain this failure"
|
|
512
|
+
label: t.id.startsWith("core:unanswered-") ? "Explain this" : "Explain this failure"
|
|
513
513
|
}
|
|
514
514
|
) }),
|
|
515
515
|
b && D && e.drill && // Esc anywhere inside the open drill collapses it.
|
|
@@ -559,11 +559,11 @@ function R({
|
|
|
559
559
|
onClick: () => m(e.collection, e.id),
|
|
560
560
|
className: "inline-flex max-w-full items-center gap-1 truncate font-medium text-foreground underline decoration-border underline-offset-2 hover:decoration-foreground",
|
|
561
561
|
children: [
|
|
562
|
-
|
|
562
|
+
P(e),
|
|
563
563
|
/* @__PURE__ */ r(V, { className: "h-3 w-3 shrink-0 opacity-60", "aria-hidden": !0 })
|
|
564
564
|
]
|
|
565
565
|
}
|
|
566
|
-
) : /* @__PURE__ */ r("span", { className: "font-medium text-foreground", children:
|
|
566
|
+
) : /* @__PURE__ */ r("span", { className: "font-medium text-foreground", children: P(e) })
|
|
567
567
|
] })
|
|
568
568
|
] });
|
|
569
569
|
}
|
|
@@ -574,9 +574,9 @@ function be({ signal: t }) {
|
|
|
574
574
|
const l = m.get(p.snooze.id) ?? [];
|
|
575
575
|
l.push(p), m.set(p.snooze.id, l);
|
|
576
576
|
}
|
|
577
|
-
const g = (p) => new Set(p.map((
|
|
577
|
+
const g = (p) => new Set(p.map((f) => f.group ?? "")).size === 1 && p[0].group ? `everything in ${p[0].group_label ?? p[0].group}` : `all of “${t.label}”`;
|
|
578
578
|
return /* @__PURE__ */ r("ul", { className: "divide-y divide-border border-t border-border bg-muted/30", children: t.snoozed.map((p) => {
|
|
579
|
-
const l = p.snooze,
|
|
579
|
+
const l = p.snooze, f = l ? m.get(l.id) ?? [] : [], v = l != null && l.until_occurrence ? "Dismissed — shows again if it happens again" : `Snoozed ${l != null && l.until_change ? "until it changes" : l != null && l.until ? `until ${new Date(l.until).toLocaleString(void 0, {
|
|
580
580
|
month: "short",
|
|
581
581
|
day: "numeric",
|
|
582
582
|
hour: "numeric",
|
|
@@ -587,7 +587,7 @@ function be({ signal: t }) {
|
|
|
587
587
|
/* @__PURE__ */ r("p", { className: "truncate text-[12.5px] text-foreground", children: p.title }),
|
|
588
588
|
/* @__PURE__ */ a("p", { className: "text-[11.5px] text-muted-foreground", children: [
|
|
589
589
|
v,
|
|
590
|
-
|
|
590
|
+
f.length > 1 ? ` with ${g(f)}` : "",
|
|
591
591
|
l != null && l.note ? ` — “${l.note}”` : ""
|
|
592
592
|
] })
|
|
593
593
|
] }),
|
|
@@ -596,12 +596,12 @@ function be({ signal: t }) {
|
|
|
596
596
|
{
|
|
597
597
|
type: "button",
|
|
598
598
|
"data-ic-unsnooze": l.id,
|
|
599
|
-
"data-ic-unsnooze-count":
|
|
600
|
-
"data-tip":
|
|
599
|
+
"data-ic-unsnooze-count": f.length,
|
|
600
|
+
"data-tip": f.length > 1 ? `This snooze covers ${f.length} problems (${g(f)}) — they all come back` : void 0,
|
|
601
601
|
disabled: e.isPending && e.variables === l.id,
|
|
602
602
|
onClick: () => e.mutate(l.id),
|
|
603
603
|
className: "h-7 shrink-0 rounded-md px-2.5 text-[12px] font-medium text-muted-foreground hover:bg-muted hover:text-foreground disabled:opacity-60",
|
|
604
|
-
children:
|
|
604
|
+
children: f.length > 1 ? `Unsnooze all ${f.length}` : l != null && l.until_occurrence ? "Undo" : "Unsnooze"
|
|
605
605
|
}
|
|
606
606
|
)
|
|
607
607
|
] }, p.key);
|
|
@@ -1,31 +1,39 @@
|
|
|
1
|
-
import { jsx as e, jsxs as n, Fragment as
|
|
2
|
-
import { ExternalLink as _, ArrowRight as
|
|
1
|
+
import { jsx as e, jsxs as n, Fragment as U } from "react/jsx-runtime";
|
|
2
|
+
import { ExternalLink as _, ArrowRight as R, Loader2 as $, RefreshCw as A } from "lucide-react";
|
|
3
3
|
import { useMemo as W } from "react";
|
|
4
|
-
import { useNavigation as
|
|
5
|
-
import { plainObligationReason as
|
|
4
|
+
import { useNavigation as D } from "../../../../context.js";
|
|
5
|
+
import { plainObligationReason as M } from "../../../../lib/obligation-reason-text.js";
|
|
6
6
|
import { cn as m, titleCase as F } from "../../../../lib/utils.js";
|
|
7
|
-
import { useSubmissionDetail as
|
|
8
|
-
import { ErrorExplanation as
|
|
9
|
-
import { TONE_TEXT as
|
|
10
|
-
import { AttemptHistory as
|
|
11
|
-
import { CodeBlock as
|
|
12
|
-
import { RequesterChip as
|
|
13
|
-
import { StatusPill as
|
|
14
|
-
function
|
|
15
|
-
const t =
|
|
7
|
+
import { useSubmissionDetail as j, useRetrySubmission as B } from "../api.js";
|
|
8
|
+
import { ErrorExplanation as z } from "../ErrorExplanation.js";
|
|
9
|
+
import { TONE_TEXT as c, TONE_SOFT as y, agoText as q, exactTime as w } from "../tone.js";
|
|
10
|
+
import { AttemptHistory as H } from "./attempts.js";
|
|
11
|
+
import { CodeBlock as S, pretty as T } from "./json.js";
|
|
12
|
+
import { RequesterChip as L } from "./requester.js";
|
|
13
|
+
import { StatusPill as I } from "./status.js";
|
|
14
|
+
function X() {
|
|
15
|
+
const t = D();
|
|
16
16
|
return (i) => i ? t.consoleUrl ? t.consoleUrl(i) : i : null;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function k(t, i) {
|
|
19
19
|
/^https?:/.test(i) ? window.open(i, "_blank", "noopener") : t.navigate(i);
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function G(t, i) {
|
|
22
|
+
try {
|
|
23
|
+
const o = new URL(i, window.location.href);
|
|
24
|
+
if (o.origin === window.location.origin) return t.navigate(`${o.pathname}${o.search}`);
|
|
25
|
+
} catch {
|
|
26
|
+
}
|
|
27
|
+
k(t, i);
|
|
28
|
+
}
|
|
29
|
+
function x({ name: t, title: i, children: o }) {
|
|
22
30
|
return /* @__PURE__ */ n("section", { "data-ic-drill-section": t, className: "min-w-0", children: [
|
|
23
31
|
/* @__PURE__ */ e("h4", { className: "mb-1.5 text-[12px] font-semibold text-foreground", children: i }),
|
|
24
32
|
o
|
|
25
33
|
] });
|
|
26
34
|
}
|
|
27
35
|
function b({ label: t, children: i }) {
|
|
28
|
-
return /* @__PURE__ */ n(
|
|
36
|
+
return /* @__PURE__ */ n(U, { children: [
|
|
29
37
|
/* @__PURE__ */ e("dt", { className: "text-[11.5px] text-muted-foreground", children: t }),
|
|
30
38
|
/* @__PURE__ */ e("dd", { className: "min-w-0 text-[12px] text-foreground", children: i })
|
|
31
39
|
] });
|
|
@@ -33,18 +41,18 @@ function b({ label: t, children: i }) {
|
|
|
33
41
|
function N() {
|
|
34
42
|
return /* @__PURE__ */ e("span", { "aria-hidden": !0, className: "text-muted-foreground", children: "·" });
|
|
35
43
|
}
|
|
36
|
-
function
|
|
37
|
-
var o,
|
|
38
|
-
return (o = t.user) != null && o.id || (
|
|
44
|
+
function J(t, i) {
|
|
45
|
+
var o, u, l, d;
|
|
46
|
+
return (o = t.user) != null && o.id || (u = i.user) != null && u.id ? ((l = t.user) == null ? void 0 : l.id) === ((d = i.user) == null ? void 0 : d.id) : t.kind === i.kind && t.label === i.label;
|
|
39
47
|
}
|
|
40
|
-
const
|
|
48
|
+
const K = {
|
|
41
49
|
transient: "Temporary failure",
|
|
42
50
|
rate_limited: "Rate limited",
|
|
43
51
|
auth: "Credentials refused",
|
|
44
52
|
not_found: "Target not found",
|
|
45
53
|
validation: "Content refused",
|
|
46
54
|
unknown: "Unclassified failure"
|
|
47
|
-
},
|
|
55
|
+
}, O = {
|
|
48
56
|
sent: "positive",
|
|
49
57
|
failed: "negative",
|
|
50
58
|
overdue: "negative",
|
|
@@ -53,7 +61,7 @@ const G = {
|
|
|
53
61
|
skipped: "neutral",
|
|
54
62
|
superseded: "neutral"
|
|
55
63
|
};
|
|
56
|
-
function
|
|
64
|
+
function Q() {
|
|
57
65
|
return /* @__PURE__ */ n("div", { className: "space-y-2.5", "aria-busy": !0, children: [
|
|
58
66
|
[72, 96, 60, 84].map((t) => /* @__PURE__ */ e(
|
|
59
67
|
"div",
|
|
@@ -66,41 +74,42 @@ function J() {
|
|
|
66
74
|
/* @__PURE__ */ e("div", { className: "h-16 animate-pulse rounded-md bg-[hsl(var(--nvr-skeleton))]" })
|
|
67
75
|
] });
|
|
68
76
|
}
|
|
69
|
-
function
|
|
70
|
-
var g, f,
|
|
71
|
-
const { data: l, isLoading:
|
|
72
|
-
if (
|
|
77
|
+
function ue({ id: t, onOpenRecord: i, onRetry: o, retryBusy: u }) {
|
|
78
|
+
var g, f, h;
|
|
79
|
+
const { data: l, isLoading: d, isError: v, error: r } = j(t), p = B();
|
|
80
|
+
if (d) return /* @__PURE__ */ e(Q, {});
|
|
73
81
|
if (v || !l) {
|
|
74
82
|
const s = ((g = r == null ? void 0 : r.response) == null ? void 0 : g.error) ?? (r instanceof Error ? r.message : null);
|
|
75
|
-
return /* @__PURE__ */ n("p", { className: m("rounded-md px-3 py-2 text-[12px]",
|
|
83
|
+
return /* @__PURE__ */ n("p", { className: m("rounded-md px-3 py-2 text-[12px]", y.negative, c.negative), children: [
|
|
76
84
|
"Couldn't load this push",
|
|
77
85
|
s ? ` · ${s}` : "",
|
|
78
86
|
"."
|
|
79
87
|
] });
|
|
80
88
|
}
|
|
81
89
|
return /* @__PURE__ */ e(
|
|
82
|
-
|
|
90
|
+
V,
|
|
83
91
|
{
|
|
84
92
|
d: l,
|
|
85
93
|
onOpenRecord: i,
|
|
86
94
|
onRetry: o ?? (() => p.mutate(t)),
|
|
87
|
-
retryBusy: o ? !!
|
|
88
|
-
retryError: o ? null : p.isError ? ((
|
|
95
|
+
retryBusy: o ? !!u : p.isPending,
|
|
96
|
+
retryError: o ? null : p.isError ? ((h = (f = p.error) == null ? void 0 : f.response) == null ? void 0 : h.error) ?? "The retry failed" : null
|
|
89
97
|
}
|
|
90
98
|
);
|
|
91
99
|
}
|
|
92
|
-
function
|
|
100
|
+
function V({
|
|
93
101
|
d: t,
|
|
94
102
|
onOpenRecord: i,
|
|
95
103
|
onRetry: o,
|
|
96
|
-
retryBusy:
|
|
104
|
+
retryBusy: u,
|
|
97
105
|
retryError: l
|
|
98
106
|
}) {
|
|
99
|
-
|
|
107
|
+
var E;
|
|
108
|
+
const d = D(), v = X(), r = t.submission, p = W(
|
|
100
109
|
() => new Map(t.attempt_requesters.map((a) => [a.attempt, a.requester])),
|
|
101
110
|
[t.attempt_requesters]
|
|
102
|
-
), g = F(r.collection).replace(/s$/, ""), f = v(t.trigger.link),
|
|
103
|
-
(a) => a.attempt > 1 && a.requester.kind !== "unknown" && !
|
|
111
|
+
), g = F(r.collection).replace(/s$/, ""), f = v(t.trigger.link), h = t.partner.id != null ? v(`/external-apis/${t.partner.id}`) : null, s = t.obligation, C = t.attempt_requesters.filter(
|
|
112
|
+
(a) => a.attempt > 1 && a.requester.kind !== "unknown" && !J(a.requester, t.triggered_by)
|
|
104
113
|
);
|
|
105
114
|
return /* @__PURE__ */ n("div", { className: "space-y-4", "data-ic-drill": `submission:${r.id}`, children: [
|
|
106
115
|
/* @__PURE__ */ n(
|
|
@@ -137,17 +146,17 @@ function K({
|
|
|
137
146
|
r.record_label
|
|
138
147
|
] }),
|
|
139
148
|
/* @__PURE__ */ e(N, {}),
|
|
140
|
-
/* @__PURE__ */ e(
|
|
149
|
+
/* @__PURE__ */ e(I, { status: r.status, stale: ((E = r.unanswered) == null ? void 0 : E.stale) === !0 }),
|
|
141
150
|
r.error_class && /* @__PURE__ */ e(
|
|
142
151
|
"span",
|
|
143
152
|
{
|
|
144
153
|
className: m(
|
|
145
154
|
"rounded px-1.5 py-0.5 text-[11px] font-medium",
|
|
146
|
-
|
|
147
|
-
|
|
155
|
+
y.warning,
|
|
156
|
+
c.warning
|
|
148
157
|
),
|
|
149
158
|
"data-tip": `Error class: ${r.error_class}`,
|
|
150
|
-
children:
|
|
159
|
+
children: K[r.error_class] ?? r.error_class
|
|
151
160
|
}
|
|
152
161
|
),
|
|
153
162
|
/* @__PURE__ */ e(N, {}),
|
|
@@ -158,28 +167,28 @@ function K({
|
|
|
158
167
|
] }),
|
|
159
168
|
/* @__PURE__ */ e(N, {}),
|
|
160
169
|
/* @__PURE__ */ n("span", { className: "inline-flex items-center gap-1 tabular-nums", children: [
|
|
161
|
-
/* @__PURE__ */ n("span", { "data-tip":
|
|
170
|
+
/* @__PURE__ */ n("span", { "data-tip": w(r.created_at), children: [
|
|
162
171
|
"first sent ",
|
|
163
|
-
|
|
172
|
+
q(r.created_at)
|
|
164
173
|
] }),
|
|
165
|
-
/* @__PURE__ */ e(
|
|
166
|
-
/* @__PURE__ */ n("span", { "data-tip":
|
|
174
|
+
/* @__PURE__ */ e(R, { className: "h-3 w-3", "aria-hidden": !0 }),
|
|
175
|
+
/* @__PURE__ */ n("span", { "data-tip": w(r.updated_at), children: [
|
|
167
176
|
"last tried ",
|
|
168
|
-
|
|
177
|
+
q(r.updated_at)
|
|
169
178
|
] })
|
|
170
179
|
] })
|
|
171
180
|
]
|
|
172
181
|
}
|
|
173
182
|
),
|
|
174
|
-
(r.last_error || (s == null ? void 0 : s.reason)) && /* @__PURE__ */ n(
|
|
175
|
-
r.last_error && r.explanation && /* @__PURE__ */ e(
|
|
183
|
+
(r.last_error || (s == null ? void 0 : s.reason)) && /* @__PURE__ */ n(x, { name: "error", title: "What went wrong", children: [
|
|
184
|
+
r.last_error && r.explanation && /* @__PURE__ */ e(z, { explanation: r.explanation, raw: r.last_error }),
|
|
176
185
|
r.last_error && !r.explanation && /* @__PURE__ */ e(
|
|
177
186
|
"p",
|
|
178
187
|
{
|
|
179
188
|
className: m(
|
|
180
189
|
"whitespace-pre-wrap break-words rounded-md px-3 py-2 font-mono text-[11.5px] leading-relaxed",
|
|
181
|
-
|
|
182
|
-
|
|
190
|
+
y.negative,
|
|
191
|
+
c.negative
|
|
183
192
|
),
|
|
184
193
|
children: r.last_error
|
|
185
194
|
}
|
|
@@ -187,29 +196,29 @@ function K({
|
|
|
187
196
|
(s == null ? void 0 : s.reason) && s.reason !== r.last_error && /* @__PURE__ */ n("p", { className: "mt-1.5 max-w-[80ch] text-[12px] leading-relaxed text-muted-foreground", children: [
|
|
188
197
|
/* @__PURE__ */ e("span", { className: "font-medium text-foreground", children: "Obligation:" }),
|
|
189
198
|
" ",
|
|
190
|
-
|
|
199
|
+
M(s.reason)
|
|
191
200
|
] })
|
|
192
201
|
] }),
|
|
193
|
-
/* @__PURE__ */ e(
|
|
202
|
+
/* @__PURE__ */ e(x, { name: "attempts", title: "Attempts", children: /* @__PURE__ */ e(H, { submissionId: r.id, requesters: p, title: null }) }),
|
|
194
203
|
/* @__PURE__ */ e(
|
|
195
|
-
|
|
204
|
+
x,
|
|
196
205
|
{
|
|
197
206
|
name: "bodies",
|
|
198
207
|
title: r.attempts > 1 ? "Latest request and response" : "Request and response",
|
|
199
208
|
children: /* @__PURE__ */ n("div", { className: "grid gap-3 lg:grid-cols-2", children: [
|
|
200
|
-
/* @__PURE__ */ e(
|
|
201
|
-
/* @__PURE__ */ e(
|
|
209
|
+
/* @__PURE__ */ e(S, { label: "Request", value: T(r.payload), fold: !0 }),
|
|
210
|
+
/* @__PURE__ */ e(S, { label: "Response", value: T(r.response), fold: !0 })
|
|
202
211
|
] })
|
|
203
212
|
}
|
|
204
213
|
),
|
|
205
214
|
/* @__PURE__ */ n("div", { className: "grid gap-4 xl:grid-cols-2", children: [
|
|
206
|
-
/* @__PURE__ */ e(
|
|
207
|
-
/* @__PURE__ */ e(b, { label: "Triggered by", children: /* @__PURE__ */ e("span", { className: "inline-flex max-w-full", "data-ic-drill-triggered-by": !0, children: /* @__PURE__ */ e(
|
|
215
|
+
/* @__PURE__ */ e(x, { name: "why", title: "Why it was sent — and who", children: /* @__PURE__ */ n("dl", { className: "grid grid-cols-[max-content_minmax(0,1fr)] items-baseline gap-x-4 gap-y-1.5", children: [
|
|
216
|
+
/* @__PURE__ */ e(b, { label: "Triggered by", children: /* @__PURE__ */ e("span", { className: "inline-flex max-w-full", "data-ic-drill-triggered-by": !0, children: /* @__PURE__ */ e(L, { r: t.triggered_by }) }) }),
|
|
208
217
|
/* @__PURE__ */ e(b, { label: "What sent it", children: f ? /* @__PURE__ */ n(
|
|
209
218
|
"button",
|
|
210
219
|
{
|
|
211
220
|
type: "button",
|
|
212
|
-
onClick: () =>
|
|
221
|
+
onClick: () => k(d, f),
|
|
213
222
|
className: "inline-flex items-center gap-1 text-left font-medium underline decoration-border underline-offset-2 hover:decoration-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
214
223
|
children: [
|
|
215
224
|
t.trigger.label,
|
|
@@ -223,12 +232,12 @@ function K({
|
|
|
223
232
|
children: t.trigger.label
|
|
224
233
|
}
|
|
225
234
|
) }),
|
|
226
|
-
|
|
235
|
+
C.length > 0 && /* @__PURE__ */ e(b, { label: "Retried by", children: /* @__PURE__ */ e("span", { className: "flex flex-col gap-1", children: C.map((a) => /* @__PURE__ */ n("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
227
236
|
/* @__PURE__ */ n("span", { className: "text-[11.5px] tabular-nums text-muted-foreground", children: [
|
|
228
237
|
"#",
|
|
229
238
|
a.attempt
|
|
230
239
|
] }),
|
|
231
|
-
/* @__PURE__ */ e(
|
|
240
|
+
/* @__PURE__ */ e(L, { r: a.requester, size: "sm" })
|
|
232
241
|
] }, a.attempt)) }) }),
|
|
233
242
|
/* @__PURE__ */ e(b, { label: "Obligation", children: s ? /* @__PURE__ */ n("span", { className: "inline-flex flex-wrap items-center gap-x-1.5 gap-y-0.5", children: [
|
|
234
243
|
/* @__PURE__ */ e("span", { className: "font-mono text-[11.5px]", children: s.kind }),
|
|
@@ -237,15 +246,15 @@ function K({
|
|
|
237
246
|
{
|
|
238
247
|
className: m(
|
|
239
248
|
"rounded px-1.5 py-px text-[11px] font-medium",
|
|
240
|
-
|
|
241
|
-
|
|
249
|
+
y[O[s.outcome] ?? "neutral"],
|
|
250
|
+
c[O[s.outcome] ?? "neutral"]
|
|
242
251
|
),
|
|
243
252
|
children: s.outcome
|
|
244
253
|
}
|
|
245
254
|
),
|
|
246
255
|
/* @__PURE__ */ n("span", { className: "text-[11.5px] text-muted-foreground", children: [
|
|
247
256
|
s.open ? "still open" : "closed",
|
|
248
|
-
s.due_at && /* @__PURE__ */ n("span", { "data-tip":
|
|
257
|
+
s.due_at && /* @__PURE__ */ n("span", { "data-tip": w(s.due_at), children: [
|
|
249
258
|
" ",
|
|
250
259
|
"· due ",
|
|
251
260
|
new Date(s.due_at).toLocaleString()
|
|
@@ -254,9 +263,9 @@ function K({
|
|
|
254
263
|
] }) : /* @__PURE__ */ e("span", { className: "text-muted-foreground", children: "None recorded for this push" }) }),
|
|
255
264
|
t.partner.owner && /* @__PURE__ */ e(b, { label: "Partner owner", children: t.partner.owner.name })
|
|
256
265
|
] }) }),
|
|
257
|
-
/* @__PURE__ */ n(
|
|
266
|
+
/* @__PURE__ */ n(x, { name: "calls", title: "Call log", children: [
|
|
258
267
|
t.call_logs.length === 0 ? /* @__PURE__ */ e("p", { className: "text-[12px] text-muted-foreground", children: "No partner calls matched this push — the writer that sent it does not log its calls." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-border rounded-md border border-border", children: t.call_logs.map((a) => {
|
|
259
|
-
const
|
|
268
|
+
const P = a.error != null || (a.status ?? 0) >= 400;
|
|
260
269
|
return /* @__PURE__ */ n(
|
|
261
270
|
"li",
|
|
262
271
|
{
|
|
@@ -267,7 +276,7 @@ function K({
|
|
|
267
276
|
"span",
|
|
268
277
|
{
|
|
269
278
|
className: "tabular-nums text-muted-foreground",
|
|
270
|
-
"data-tip":
|
|
279
|
+
"data-tip": w(a.created_at),
|
|
271
280
|
children: new Date(a.created_at).toLocaleString()
|
|
272
281
|
}
|
|
273
282
|
),
|
|
@@ -277,7 +286,7 @@ function K({
|
|
|
277
286
|
{
|
|
278
287
|
className: m(
|
|
279
288
|
"font-mono font-medium",
|
|
280
|
-
|
|
289
|
+
P ? c.negative : c.positive
|
|
281
290
|
),
|
|
282
291
|
children: a.status ?? "no response"
|
|
283
292
|
}
|
|
@@ -296,12 +305,12 @@ function K({
|
|
|
296
305
|
a.id
|
|
297
306
|
);
|
|
298
307
|
}) }),
|
|
299
|
-
|
|
308
|
+
h && /* @__PURE__ */ n(
|
|
300
309
|
"button",
|
|
301
310
|
{
|
|
302
311
|
type: "button",
|
|
303
312
|
"data-ic-drill-call-logs": !0,
|
|
304
|
-
onClick: () =>
|
|
313
|
+
onClick: () => k(d, h),
|
|
305
314
|
className: "mt-1.5 inline-flex items-center gap-1 text-[12px] font-medium text-foreground underline decoration-border underline-offset-2 hover:decoration-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
306
315
|
children: [
|
|
307
316
|
"Open in Call Logs",
|
|
@@ -322,15 +331,28 @@ function K({
|
|
|
322
331
|
{
|
|
323
332
|
type: "button",
|
|
324
333
|
"data-ic-drill-retry": !0,
|
|
325
|
-
disabled: !t.retry.eligible ||
|
|
334
|
+
disabled: !t.retry.eligible || u,
|
|
326
335
|
onClick: o,
|
|
327
336
|
className: "inline-flex h-7 items-center gap-1.5 rounded-md border border-border bg-card px-2.5 text-[12px] font-medium text-foreground transition-colors hover:bg-muted disabled:cursor-not-allowed disabled:opacity-60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
328
337
|
children: [
|
|
329
|
-
|
|
338
|
+
u ? /* @__PURE__ */ e($, { className: "h-3 w-3 animate-spin", "aria-hidden": !0 }) : /* @__PURE__ */ e(A, { className: "h-3 w-3", "aria-hidden": !0 }),
|
|
330
339
|
"Retry"
|
|
331
340
|
]
|
|
332
341
|
}
|
|
333
342
|
),
|
|
343
|
+
t.retry.review_url && /* @__PURE__ */ n(
|
|
344
|
+
"button",
|
|
345
|
+
{
|
|
346
|
+
type: "button",
|
|
347
|
+
"data-ic-drill-review": !0,
|
|
348
|
+
onClick: () => G(d, t.retry.review_url),
|
|
349
|
+
className: "inline-flex h-7 items-center gap-1.5 rounded-md border border-border bg-card px-2.5 text-[12px] font-medium text-foreground transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
350
|
+
children: [
|
|
351
|
+
"Mark it on the ERP tab",
|
|
352
|
+
/* @__PURE__ */ e(R, { className: "h-3 w-3", "aria-hidden": !0 })
|
|
353
|
+
]
|
|
354
|
+
}
|
|
355
|
+
),
|
|
334
356
|
i && /* @__PURE__ */ e(
|
|
335
357
|
"button",
|
|
336
358
|
{
|
|
@@ -341,14 +363,14 @@ function K({
|
|
|
341
363
|
}
|
|
342
364
|
),
|
|
343
365
|
!t.retry.eligible && t.retry.reason && /* @__PURE__ */ e("span", { className: "text-[12px] text-muted-foreground", "data-ic-drill-retry-reason": !0, children: t.retry.reason }),
|
|
344
|
-
t.retry.eligible && t.retry.warning && /* @__PURE__ */ e("span", { className: m("text-[12px]",
|
|
345
|
-
l && /* @__PURE__ */ e("span", { className: m("text-[12px]",
|
|
366
|
+
t.retry.eligible && t.retry.warning && /* @__PURE__ */ e("span", { className: m("text-[12px]", c.warning), children: t.retry.warning }),
|
|
367
|
+
l && /* @__PURE__ */ e("span", { className: m("text-[12px]", c.negative), children: l })
|
|
346
368
|
]
|
|
347
369
|
}
|
|
348
370
|
)
|
|
349
371
|
] });
|
|
350
372
|
}
|
|
351
373
|
export {
|
|
352
|
-
|
|
353
|
-
|
|
374
|
+
ue as SubmissionDrill,
|
|
375
|
+
J as sameRequester
|
|
354
376
|
};
|