@nivaro/react 0.3.66 → 0.3.67
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 +8 -1
- package/dist/shared/components/ActivityEntry.js +28 -28
- package/dist/shared/components/CollectionBrowserView.js +584 -585
- package/dist/shared/components/ItemEditForm.js +1758 -1758
- package/dist/shared/components/RecordCompare.js +149 -129
- package/dist/shared/components/bulk/BulkCompareButton.js +16 -16
- package/dist/shared/components/integrations/IntegrationObligationsView.js +199 -187
- package/dist/shared/components/integrations/console/EventsView.js +22 -24
- package/dist/shared/components/integrations/console/SubmissionRow.js +6 -13
- package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +29 -28
- package/dist/shared/components/integrations/console/tone.js +22 -21
- package/dist/shared/components/item-edit/FieldRow.js +193 -193
- package/dist/shared/components/item-edit/GroupSection.js +209 -209
- package/dist/shared/components/item-edit/RecordInsights.js +46 -45
- package/dist/shared/components/panels/BranchLanes.js +7 -7
- package/dist/shared/components/panels/CommentPanel.js +72 -72
- package/dist/shared/components/panels/PipelinePanel.js +261 -261
- package/dist/shared/components/panels/RecordIntegrityBanner.js +78 -78
- package/dist/shared/components/panels/RevisionsPanel.js +220 -220
- package/dist/shared/components/panels/TaskPanel.js +75 -75
- package/dist/shared/components/queue/QueueWorklist.js +499 -498
- package/dist/shared/lib/compare-value.js +73 -0
- package/dist/shared/lib/format-value.js +19 -18
- package/dist/shared/lib/utils.js +59 -57
- package/package.json +1 -1
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { jsxs as r, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { Code2 as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { toast as
|
|
6
|
-
import { useNivaroClient as
|
|
7
|
-
import { get as
|
|
8
|
-
import { obligationQueryParams as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
2
|
+
import { useQueryClient as le, useQuery as V, useQueries as Ce, useMutation as qe } from "@tanstack/react-query";
|
|
3
|
+
import { Code2 as _e, ChevronDown as Oe, Loader2 as Ee, Send as Le } from "lucide-react";
|
|
4
|
+
import { useState as E, useRef as Fe, useEffect as X, useMemo as y, Fragment as Te } from "react";
|
|
5
|
+
import { toast as Z } from "sonner";
|
|
6
|
+
import { useNivaroClient as se, useItemNavigation as Ke, useNavigation as Ie } from "../../context.js";
|
|
7
|
+
import { get as Y, post as de } from "../../lib/commands.js";
|
|
8
|
+
import { obligationQueryParams as je, obligationTabsFor as Pe, toneForOutcome as ee, isRoutableRecord as De, attemptsLabel as Re, lastResponseLabel as Ae, lastResponseFull as He } from "../../lib/obligation-filters.js";
|
|
9
|
+
import { plainObligationReason as te } from "../../lib/obligation-reason-text.js";
|
|
10
|
+
import { serverNow as Me } from "../../lib/server-clock.js";
|
|
11
|
+
import { titleCase as ce, cn as d, formatRelative as ue, humanHours as Qe } from "../../lib/utils.js";
|
|
12
|
+
import { EmptyState as oe } from "../EmptyState.js";
|
|
13
|
+
import { ErrorSurface as ne } from "../ErrorSurface.js";
|
|
13
14
|
import { colorPair as ae } from "../QueryTable.js";
|
|
14
|
-
import { TipLayer as
|
|
15
|
-
import { SimpleSelectXs as
|
|
16
|
-
import { SendCurrentDataButton as
|
|
15
|
+
import { TipLayer as $e } from "../TipLayer.js";
|
|
16
|
+
import { SimpleSelectXs as P } from "../ui/SimpleSelect.js";
|
|
17
|
+
import { SendCurrentDataButton as Be } from "./SendCurrentData.js";
|
|
17
18
|
const D = {
|
|
18
19
|
overdue: "Overdue",
|
|
19
20
|
failed: "Failed",
|
|
@@ -22,7 +23,7 @@ const D = {
|
|
|
22
23
|
sent: "Sent",
|
|
23
24
|
missing: "Missing",
|
|
24
25
|
superseded: "Superseded"
|
|
25
|
-
},
|
|
26
|
+
}, Ue = [
|
|
26
27
|
"overdue",
|
|
27
28
|
"failed",
|
|
28
29
|
"pending",
|
|
@@ -31,53 +32,53 @@ const D = {
|
|
|
31
32
|
"missing",
|
|
32
33
|
"superseded"
|
|
33
34
|
];
|
|
34
|
-
function
|
|
35
|
-
return
|
|
35
|
+
function re(n) {
|
|
36
|
+
return n === "danger" ? "negative" : n === "warning" ? "warning" : n === "positive" ? "positive" : null;
|
|
36
37
|
}
|
|
37
|
-
function
|
|
38
|
-
const b = new Date(
|
|
39
|
-
return b > 0 ? `due in ${
|
|
38
|
+
function Je(n) {
|
|
39
|
+
const b = new Date(n).getTime() - Me();
|
|
40
|
+
return b > 0 ? `due in ${Qe(b / 36e5)}` : ue(n);
|
|
40
41
|
}
|
|
41
|
-
function
|
|
42
|
-
const b =
|
|
42
|
+
function We({ obligationId: n }) {
|
|
43
|
+
const b = se(), c = le(), [p, g] = E(!1), a = qe({
|
|
43
44
|
mutationFn: () => b.request(
|
|
44
|
-
|
|
45
|
+
de(`/integration-obligations/${n}/send`)
|
|
45
46
|
),
|
|
46
47
|
onSuccess: (l) => {
|
|
47
48
|
var u;
|
|
48
|
-
|
|
49
|
+
Z.message(((u = l == null ? void 0 : l.data) == null ? void 0 : u.detail) ?? "Sent"), c.invalidateQueries({ queryKey: ["integration-obligations", "summary"] }), c.invalidateQueries({ queryKey: ["integration-obligations", "list"] });
|
|
49
50
|
},
|
|
50
51
|
onError: (l) => {
|
|
51
52
|
const u = l == null ? void 0 : l.response;
|
|
52
|
-
|
|
53
|
+
Z.error((u == null ? void 0 : u.error) ?? "Send now failed", { duration: 8e3 });
|
|
53
54
|
},
|
|
54
|
-
onSettled: () =>
|
|
55
|
+
onSettled: () => g(!1)
|
|
55
56
|
});
|
|
56
57
|
return /* @__PURE__ */ r(
|
|
57
58
|
"button",
|
|
58
59
|
{
|
|
59
60
|
type: "button",
|
|
60
61
|
"data-obligation-send-now": !0,
|
|
61
|
-
disabled:
|
|
62
|
+
disabled: a.isPending,
|
|
62
63
|
onClick: (l) => {
|
|
63
64
|
if (l.stopPropagation(), !p) {
|
|
64
|
-
|
|
65
|
+
g(!0);
|
|
65
66
|
return;
|
|
66
67
|
}
|
|
67
|
-
|
|
68
|
+
a.mutate();
|
|
68
69
|
},
|
|
69
70
|
className: d(
|
|
70
71
|
"ml-2 inline-flex shrink-0 items-center gap-1 rounded-full border px-2 py-0.5 text-[10.5px] font-medium transition-colors disabled:opacity-60",
|
|
71
72
|
p ? "border-nvr-cyan bg-nvr-cyan/10 text-nvr-cyan dark:border-nvr-cyan dark:bg-nvr-cyan/15" : "border-slate-200 text-slate-500 hover:border-slate-300 hover:bg-slate-50 dark:border-border dark:text-muted-foreground dark:hover:bg-muted"
|
|
72
73
|
),
|
|
73
74
|
children: [
|
|
74
|
-
|
|
75
|
+
a.isPending ? /* @__PURE__ */ t(Ee, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ t(Le, { className: "h-3 w-3" }),
|
|
75
76
|
p ? "Confirm?" : "Send now"
|
|
76
77
|
]
|
|
77
78
|
}
|
|
78
79
|
);
|
|
79
80
|
}
|
|
80
|
-
function
|
|
81
|
+
function ze({ open: n, onToggle: b }) {
|
|
81
82
|
return /* @__PURE__ */ r(
|
|
82
83
|
"button",
|
|
83
84
|
{
|
|
@@ -88,15 +89,15 @@ function Je({ open: o, onToggle: b }) {
|
|
|
88
89
|
},
|
|
89
90
|
className: "inline-flex shrink-0 items-center gap-1 rounded-full border border-slate-200 px-2 py-0.5 text-[10.5px] font-medium text-slate-500 transition-colors hover:border-slate-300 hover:bg-slate-50 dark:border-border dark:text-muted-foreground dark:hover:bg-muted",
|
|
90
91
|
children: [
|
|
91
|
-
/* @__PURE__ */ t(
|
|
92
|
-
|
|
93
|
-
/* @__PURE__ */ t(
|
|
92
|
+
/* @__PURE__ */ t(_e, { className: "h-3 w-3" }),
|
|
93
|
+
n ? "Hide request" : "Show request",
|
|
94
|
+
/* @__PURE__ */ t(Oe, { className: d("h-3 w-3 transition-transform", n && "rotate-180") })
|
|
94
95
|
]
|
|
95
96
|
}
|
|
96
97
|
);
|
|
97
98
|
}
|
|
98
|
-
function
|
|
99
|
-
const
|
|
99
|
+
function Ge() {
|
|
100
|
+
const n = Ie(), b = "/settings?section=integrations", c = n.consoleUrl ? n.consoleUrl(b) : b;
|
|
100
101
|
if (!c) return null;
|
|
101
102
|
const p = /^https?:\/\//.test(c);
|
|
102
103
|
return /* @__PURE__ */ t(
|
|
@@ -105,123 +106,126 @@ function We() {
|
|
|
105
106
|
href: c,
|
|
106
107
|
"data-obligations-settings-link": !0,
|
|
107
108
|
...p ? { target: "_blank", rel: "noreferrer" } : {},
|
|
108
|
-
onClick: (
|
|
109
|
-
p ||
|
|
109
|
+
onClick: (g) => {
|
|
110
|
+
p || g.metaKey || g.ctrlKey || (g.preventDefault(), n.navigate(c));
|
|
110
111
|
},
|
|
111
112
|
className: "underline decoration-dotted hover:text-slate-600 dark:hover:text-slate-200",
|
|
112
113
|
children: "Settings → Integrations"
|
|
113
114
|
}
|
|
114
115
|
);
|
|
115
116
|
}
|
|
116
|
-
function
|
|
117
|
-
return
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
117
|
+
function ie(n) {
|
|
118
|
+
return n.record_label ? n.record_label : /^(nivaro|directus)_/i.test(n.collection) ? n.item : ce(n.collection).replace(/s$/, "");
|
|
119
|
+
}
|
|
120
|
+
function Ve(n) {
|
|
121
|
+
return n.submission_attempts == null ? null : {
|
|
122
|
+
attempts: n.submission_attempts,
|
|
123
|
+
status: n.submission_status,
|
|
124
|
+
last_error: n.submission_last_error,
|
|
125
|
+
response: n.submission_response
|
|
122
126
|
};
|
|
123
127
|
}
|
|
124
|
-
function
|
|
125
|
-
if (!
|
|
128
|
+
function Xe(n) {
|
|
129
|
+
if (!n) return null;
|
|
126
130
|
try {
|
|
127
|
-
return JSON.stringify(JSON.parse(
|
|
131
|
+
return JSON.stringify(JSON.parse(n), null, 2);
|
|
128
132
|
} catch {
|
|
129
|
-
return
|
|
133
|
+
return n;
|
|
130
134
|
}
|
|
131
135
|
}
|
|
132
136
|
const q = 50;
|
|
133
|
-
function
|
|
134
|
-
const c =
|
|
135
|
-
api:
|
|
137
|
+
function gt({ api: n, className: b }) {
|
|
138
|
+
const c = se(), p = le(), g = Ke(), [a, l] = E({
|
|
139
|
+
api: n ?? null,
|
|
136
140
|
kind: null,
|
|
137
141
|
collection: null,
|
|
138
142
|
outcome: ["overdue", "failed", "missing"],
|
|
139
143
|
ageHours: null
|
|
140
|
-
}), [u,
|
|
141
|
-
|
|
142
|
-
const e =
|
|
143
|
-
e !== A.current && (A.current = e, l((
|
|
144
|
-
}, [
|
|
144
|
+
}), [u, L] = E(1), [me, R] = E(null), A = Fe(n ?? null);
|
|
145
|
+
X(() => {
|
|
146
|
+
const e = n ?? null;
|
|
147
|
+
e !== A.current && (A.current = e, l((o) => ({ ...o, api: e })));
|
|
148
|
+
}, [n]);
|
|
145
149
|
const {
|
|
146
150
|
data: m,
|
|
147
151
|
isLoading: H,
|
|
148
|
-
isError:
|
|
149
|
-
} =
|
|
152
|
+
isError: be
|
|
153
|
+
} = V({
|
|
150
154
|
queryKey: ["integration-obligations", "summary"],
|
|
151
|
-
queryFn: () => c.request(
|
|
155
|
+
queryFn: () => c.request(Y("/integration-obligations/summary")),
|
|
152
156
|
staleTime: 3e4
|
|
153
|
-
}), S = (m == null ? void 0 : m.remediation_enabled) === !0,
|
|
154
|
-
!
|
|
157
|
+
}), S = (m == null ? void 0 : m.remediation_enabled) === !0, pe = (m == null ? void 0 : m.notifications_enabled) === !0, M = H ? [] : [
|
|
158
|
+
!pe && "notifications off",
|
|
155
159
|
!S && "remediation off"
|
|
156
|
-
].filter((e) => !!e),
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
}, [
|
|
160
|
+
].filter((e) => !!e), ge = a.outcome.join(",");
|
|
161
|
+
X(() => {
|
|
162
|
+
L(1), R(null);
|
|
163
|
+
}, [a.api, a.kind, a.collection, ge, a.ageHours]);
|
|
160
164
|
const Q = y(
|
|
161
165
|
() => ({
|
|
162
|
-
...
|
|
166
|
+
...je(a),
|
|
163
167
|
page: String(u),
|
|
164
168
|
limit: String(q)
|
|
165
169
|
}),
|
|
166
|
-
[
|
|
170
|
+
[a, u]
|
|
167
171
|
), {
|
|
168
172
|
data: N,
|
|
169
|
-
isLoading:
|
|
170
|
-
isFetching:
|
|
171
|
-
isError:
|
|
172
|
-
} =
|
|
173
|
+
isLoading: he,
|
|
174
|
+
isFetching: xe,
|
|
175
|
+
isError: fe
|
|
176
|
+
} = V({
|
|
173
177
|
queryKey: ["integration-obligations", "list", Q],
|
|
174
|
-
queryFn: () => c.request(
|
|
178
|
+
queryFn: () => c.request(Y("/integration-obligations", Q)),
|
|
175
179
|
staleTime: 15e3,
|
|
176
180
|
placeholderData: (e) => e
|
|
177
|
-
}),
|
|
181
|
+
}), $ = (m == null ? void 0 : m.data.apis) ?? [], B = n ? $.filter((e) => e.api === n) : $, w = (m == null ? void 0 : m.data.kinds) ?? [], F = a.api ? w.filter((e) => e.api === a.api) : w, ve = y(() => {
|
|
178
182
|
const e = /* @__PURE__ */ new Map();
|
|
179
|
-
for (const
|
|
183
|
+
for (const o of w) e.has(o.kind) || e.set(o.kind, o.label);
|
|
180
184
|
return e;
|
|
181
|
-
}, [w]),
|
|
185
|
+
}, [w]), ke = y(() => {
|
|
182
186
|
const e = /* @__PURE__ */ new Map();
|
|
183
|
-
for (const
|
|
184
|
-
e.has(
|
|
185
|
-
return [...e.entries()].map(([
|
|
186
|
-
}, [F]),
|
|
187
|
+
for (const o of F)
|
|
188
|
+
e.has(o.collection) || e.set(o.collection, ce(o.collection));
|
|
189
|
+
return [...e.entries()].map(([o, i]) => ({ value: o, label: i })).sort((o, i) => o.label.localeCompare(i.label));
|
|
190
|
+
}, [F]), f = y(() => Pe(w, a.api), [w, a.api]), U = y(
|
|
187
191
|
() => new Set(
|
|
188
|
-
(
|
|
192
|
+
(a.kind ?? "").split(",").map((e) => e.trim()).filter(Boolean)
|
|
189
193
|
),
|
|
190
|
-
[
|
|
191
|
-
),
|
|
192
|
-
const
|
|
193
|
-
l((i) => ({ ...i, kind:
|
|
194
|
+
[a.kind]
|
|
195
|
+
), J = (e) => e.length > 0 && e.length === U.size && e.every((o) => U.has(o)), s = J(f.waiting) ? "waiting" : J(f.inbound) ? "inbound" : "all", T = (e) => {
|
|
196
|
+
const o = e === "waiting" ? f.waiting : e === "inbound" ? f.inbound : [];
|
|
197
|
+
l((i) => ({ ...i, kind: o.length > 0 ? o.join(",") : null }));
|
|
194
198
|
}, C = (N == null ? void 0 : N.data) ?? [], _ = (N == null ? void 0 : N.total) ?? 0, K = y(
|
|
195
199
|
() => s === "waiting" ? [...new Set(C.map((e) => e.collection))] : [],
|
|
196
200
|
[s, C]
|
|
197
|
-
),
|
|
201
|
+
), I = Ce({
|
|
198
202
|
queries: K.map((e) => {
|
|
199
|
-
const
|
|
203
|
+
const o = C.filter((i) => i.collection === e).map((i) => i.item);
|
|
200
204
|
return {
|
|
201
|
-
queryKey: ["integration-obligations", "owners", e,
|
|
205
|
+
queryKey: ["integration-obligations", "owners", e, o.slice().sort().join(",")],
|
|
202
206
|
queryFn: () => c.request(
|
|
203
|
-
|
|
207
|
+
de(`/pipelines/instance/${e}/owners/batch`, { ids: o })
|
|
204
208
|
).then((i) => i.data ?? {}),
|
|
205
|
-
enabled:
|
|
209
|
+
enabled: o.length > 0,
|
|
206
210
|
staleTime: 6e4
|
|
207
211
|
};
|
|
208
212
|
})
|
|
209
|
-
}),
|
|
213
|
+
}), W = y(() => {
|
|
210
214
|
const e = {};
|
|
211
|
-
return K.forEach((
|
|
212
|
-
var
|
|
213
|
-
const
|
|
214
|
-
if (
|
|
215
|
-
for (const [
|
|
216
|
-
e[`${
|
|
215
|
+
return K.forEach((o, i) => {
|
|
216
|
+
var v;
|
|
217
|
+
const h = (v = I[i]) == null ? void 0 : v.data;
|
|
218
|
+
if (h)
|
|
219
|
+
for (const [x, k] of Object.entries(h))
|
|
220
|
+
e[`${o}:${x}`] = k.map((O) => O.name).join(", ");
|
|
217
221
|
}), e;
|
|
218
|
-
}, [K,
|
|
219
|
-
const
|
|
220
|
-
return
|
|
221
|
-
},
|
|
222
|
-
...
|
|
223
|
-
outcome:
|
|
224
|
-
})),
|
|
222
|
+
}, [K, I]), ye = I.some((e) => e.isLoading), Ne = (e) => {
|
|
223
|
+
const o = `${e.collection}:${e.item}`;
|
|
224
|
+
return o in W ? W[o] || "—" : ye ? "…" : "—";
|
|
225
|
+
}, we = 7 + (s === "waiting" ? 1 : 0) + (s === "inbound" ? 1 : 0) + (S ? 1 : 0), z = (e) => l((o) => ({
|
|
226
|
+
...o,
|
|
227
|
+
outcome: o.outcome.includes(e) ? o.outcome.filter((i) => i !== e) : [...o.outcome, e]
|
|
228
|
+
})), Se = (e) => l((o) => ({ ...o, api: o.api === e ? null : e }));
|
|
225
229
|
return /* @__PURE__ */ r("div", { className: d("space-y-4", b), "data-obligations-board": !0, children: [
|
|
226
230
|
M.length > 0 && /* @__PURE__ */ r(
|
|
227
231
|
"p",
|
|
@@ -231,12 +235,12 @@ function mt({ api: o, className: b }) {
|
|
|
231
235
|
children: [
|
|
232
236
|
M.join(" · "),
|
|
233
237
|
" — ",
|
|
234
|
-
/* @__PURE__ */ t(
|
|
238
|
+
/* @__PURE__ */ t(Ge, {})
|
|
235
239
|
]
|
|
236
240
|
}
|
|
237
241
|
),
|
|
238
|
-
|
|
239
|
-
|
|
242
|
+
be ? /* @__PURE__ */ t(ne, { variant: "500", detail: "Could not load the obligations summary." }) : H ? /* @__PURE__ */ t("div", { className: "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3", children: [1, 2, 3].map((e) => /* @__PURE__ */ t("div", { className: "h-24 animate-pulse rounded-xl bg-[hsl(var(--nvr-skeleton))]" }, e)) }) : B.length === 0 ? /* @__PURE__ */ t(
|
|
243
|
+
oe,
|
|
240
244
|
{
|
|
241
245
|
title: "No obligations recorded yet",
|
|
242
246
|
detail: "The reconcile sweep runs every 15 minutes — once an integration has a registered obligation kind and a message comes due, it shows up here."
|
|
@@ -252,40 +256,40 @@ function mt({ api: o, className: b }) {
|
|
|
252
256
|
"button",
|
|
253
257
|
{
|
|
254
258
|
type: "button",
|
|
255
|
-
"aria-pressed":
|
|
256
|
-
onClick: () =>
|
|
257
|
-
"data-tip":
|
|
259
|
+
"aria-pressed": a.api === e.api,
|
|
260
|
+
onClick: () => Se(e.api),
|
|
261
|
+
"data-tip": a.api === e.api ? "Showing only this partner — click to show all" : void 0,
|
|
258
262
|
className: d(
|
|
259
263
|
"text-[13px] font-semibold hover:underline",
|
|
260
|
-
|
|
264
|
+
a.api === e.api ? "text-nvr-cyan" : "text-slate-800 dark:text-foreground"
|
|
261
265
|
),
|
|
262
266
|
children: e.api
|
|
263
267
|
}
|
|
264
268
|
),
|
|
265
269
|
e.oldest_unmet && /* @__PURE__ */ r("span", { className: "text-[11px] text-slate-400 dark:text-muted-foreground", children: [
|
|
266
270
|
"oldest unmet ",
|
|
267
|
-
|
|
271
|
+
ue(e.oldest_unmet)
|
|
268
272
|
] })
|
|
269
273
|
] }),
|
|
270
|
-
/* @__PURE__ */ t("div", { className: "flex flex-wrap gap-2", children: e.tiles.map((
|
|
271
|
-
const i =
|
|
274
|
+
/* @__PURE__ */ t("div", { className: "flex flex-wrap gap-2", children: e.tiles.map((o) => {
|
|
275
|
+
const i = re(ee(o.outcome)), [h, v] = i ? ae(i) : [null, null], x = a.api === e.api && a.outcome.includes(o.outcome);
|
|
272
276
|
return /* @__PURE__ */ r(
|
|
273
277
|
"button",
|
|
274
278
|
{
|
|
275
279
|
type: "button",
|
|
276
|
-
"data-obligation-tile":
|
|
277
|
-
"aria-pressed":
|
|
280
|
+
"data-obligation-tile": o.outcome,
|
|
281
|
+
"aria-pressed": x,
|
|
278
282
|
onClick: () => {
|
|
279
|
-
l((
|
|
283
|
+
l((k) => ({ ...k, api: e.api })), z(o.outcome);
|
|
280
284
|
},
|
|
281
|
-
style:
|
|
282
|
-
"--obt":
|
|
283
|
-
"--obtd":
|
|
285
|
+
style: h ? {
|
|
286
|
+
"--obt": h,
|
|
287
|
+
"--obtd": v
|
|
284
288
|
} : void 0,
|
|
285
289
|
className: d(
|
|
286
290
|
"min-w-[68px] flex-1 rounded-lg border border-slate-200 bg-white px-2.5 py-1.5 text-left transition dark:border-border dark:bg-card",
|
|
287
|
-
|
|
288
|
-
|
|
291
|
+
h && "border-t-2 border-t-[color:var(--obt)] dark:border-t-[color:var(--obtd)]",
|
|
292
|
+
x && "ring-2 ring-nvr-cyan/50"
|
|
289
293
|
),
|
|
290
294
|
children: [
|
|
291
295
|
/* @__PURE__ */ t(
|
|
@@ -294,15 +298,15 @@ function mt({ api: o, className: b }) {
|
|
|
294
298
|
"data-obligation-tile-count": !0,
|
|
295
299
|
className: d(
|
|
296
300
|
"block text-[15px] font-semibold tabular-nums",
|
|
297
|
-
|
|
301
|
+
h ? "text-[color:var(--obt)] dark:text-[color:var(--obtd)]" : "text-slate-700 dark:text-foreground"
|
|
298
302
|
),
|
|
299
|
-
children:
|
|
303
|
+
children: o.count
|
|
300
304
|
}
|
|
301
305
|
),
|
|
302
|
-
/* @__PURE__ */ t("span", { className: "block text-[10px] uppercase tracking-wide text-slate-400 dark:text-muted-foreground", children: D[
|
|
306
|
+
/* @__PURE__ */ t("span", { className: "block text-[10px] uppercase tracking-wide text-slate-400 dark:text-muted-foreground", children: D[o.outcome] ?? o.outcome })
|
|
303
307
|
]
|
|
304
308
|
},
|
|
305
|
-
|
|
309
|
+
o.outcome
|
|
306
310
|
);
|
|
307
311
|
}) })
|
|
308
312
|
]
|
|
@@ -313,11 +317,11 @@ function mt({ api: o, className: b }) {
|
|
|
313
317
|
/* @__PURE__ */ r("div", { "data-obligation-filter": "kind", className: "flex items-center gap-1.5", children: [
|
|
314
318
|
/* @__PURE__ */ t("span", { className: "text-[11px] text-slate-400 dark:text-muted-foreground", children: "Kind" }),
|
|
315
319
|
/* @__PURE__ */ t(
|
|
316
|
-
|
|
320
|
+
P,
|
|
317
321
|
{
|
|
318
322
|
ariaLabel: "Filter by obligation kind",
|
|
319
|
-
value:
|
|
320
|
-
onChange: (e) => l((
|
|
323
|
+
value: a.kind ?? "",
|
|
324
|
+
onChange: (e) => l((o) => ({ ...o, kind: e || null })),
|
|
321
325
|
options: [
|
|
322
326
|
{ value: "", label: "Every kind" },
|
|
323
327
|
...F.map((e) => ({ value: e.kind, label: e.label }))
|
|
@@ -328,23 +332,23 @@ function mt({ api: o, className: b }) {
|
|
|
328
332
|
/* @__PURE__ */ r("div", { "data-obligations-collection-filter": !0, className: "flex items-center gap-1.5", children: [
|
|
329
333
|
/* @__PURE__ */ t("span", { className: "text-[11px] text-slate-400 dark:text-muted-foreground", children: "Collection" }),
|
|
330
334
|
/* @__PURE__ */ t(
|
|
331
|
-
|
|
335
|
+
P,
|
|
332
336
|
{
|
|
333
337
|
ariaLabel: "Filter by collection",
|
|
334
|
-
value:
|
|
335
|
-
onChange: (e) => l((
|
|
336
|
-
options: [{ value: "", label: "Every collection" }, ...
|
|
338
|
+
value: a.collection ?? "",
|
|
339
|
+
onChange: (e) => l((o) => ({ ...o, collection: e || null })),
|
|
340
|
+
options: [{ value: "", label: "Every collection" }, ...ke]
|
|
337
341
|
}
|
|
338
342
|
)
|
|
339
343
|
] }),
|
|
340
344
|
/* @__PURE__ */ r("div", { "data-obligation-filter": "age", className: "flex items-center gap-1.5", children: [
|
|
341
345
|
/* @__PURE__ */ t("span", { className: "text-[11px] text-slate-400 dark:text-muted-foreground", children: "Age" }),
|
|
342
346
|
/* @__PURE__ */ t(
|
|
343
|
-
|
|
347
|
+
P,
|
|
344
348
|
{
|
|
345
349
|
ariaLabel: "Filter by obligation age",
|
|
346
|
-
value:
|
|
347
|
-
onChange: (e) => l((
|
|
350
|
+
value: a.ageHours != null ? String(a.ageHours) : "",
|
|
351
|
+
onChange: (e) => l((o) => ({ ...o, ageHours: e ? Number(e) : null })),
|
|
348
352
|
options: [
|
|
349
353
|
{ value: "", label: "Any age" },
|
|
350
354
|
{ value: "1", label: "Older than 1 hour" },
|
|
@@ -356,17 +360,17 @@ function mt({ api: o, className: b }) {
|
|
|
356
360
|
] }),
|
|
357
361
|
/* @__PURE__ */ r("div", { "data-obligation-filter": "outcome", className: "flex flex-wrap items-center gap-1", children: [
|
|
358
362
|
/* @__PURE__ */ t("span", { className: "mr-0.5 text-[11px] text-slate-400 dark:text-muted-foreground", children: "Outcome" }),
|
|
359
|
-
|
|
360
|
-
const
|
|
363
|
+
Ue.map((e) => {
|
|
364
|
+
const o = a.outcome.includes(e);
|
|
361
365
|
return /* @__PURE__ */ t(
|
|
362
366
|
"button",
|
|
363
367
|
{
|
|
364
368
|
type: "button",
|
|
365
|
-
"aria-pressed":
|
|
366
|
-
onClick: () =>
|
|
369
|
+
"aria-pressed": o,
|
|
370
|
+
onClick: () => z(e),
|
|
367
371
|
className: d(
|
|
368
372
|
"inline-flex h-6 items-center rounded-full border px-2 text-[10.5px] font-medium transition-colors",
|
|
369
|
-
|
|
373
|
+
o ? "border-slate-400 bg-slate-100 text-slate-900 dark:border-slate-500 dark:bg-slate-700 dark:text-slate-100" : "border-transparent text-slate-500 hover:border-slate-300 hover:bg-slate-50 dark:text-muted-foreground dark:hover:border-slate-600 dark:hover:bg-slate-800"
|
|
370
374
|
),
|
|
371
375
|
children: D[e] ?? e
|
|
372
376
|
},
|
|
@@ -374,7 +378,7 @@ function mt({ api: o, className: b }) {
|
|
|
374
378
|
);
|
|
375
379
|
})
|
|
376
380
|
] }),
|
|
377
|
-
(
|
|
381
|
+
(a.api || a.kind || a.collection || a.ageHours != null) && /* @__PURE__ */ t(
|
|
378
382
|
"button",
|
|
379
383
|
{
|
|
380
384
|
type: "button",
|
|
@@ -390,7 +394,7 @@ function mt({ api: o, className: b }) {
|
|
|
390
394
|
}
|
|
391
395
|
)
|
|
392
396
|
] }),
|
|
393
|
-
|
|
397
|
+
a.api && (f.waiting.length > 0 || f.inbound.length > 0) && /* @__PURE__ */ r("div", { className: "flex flex-wrap items-center gap-1", "data-obligation-filter": "tab", children: [
|
|
394
398
|
/* @__PURE__ */ t(
|
|
395
399
|
"button",
|
|
396
400
|
{
|
|
@@ -405,7 +409,7 @@ function mt({ api: o, className: b }) {
|
|
|
405
409
|
children: "All"
|
|
406
410
|
}
|
|
407
411
|
),
|
|
408
|
-
|
|
412
|
+
f.waiting.length > 0 && /* @__PURE__ */ t(
|
|
409
413
|
"button",
|
|
410
414
|
{
|
|
411
415
|
type: "button",
|
|
@@ -419,7 +423,7 @@ function mt({ api: o, className: b }) {
|
|
|
419
423
|
children: "Waiting on a person"
|
|
420
424
|
}
|
|
421
425
|
),
|
|
422
|
-
|
|
426
|
+
f.inbound.length > 0 && /* @__PURE__ */ t(
|
|
423
427
|
"button",
|
|
424
428
|
{
|
|
425
429
|
type: "button",
|
|
@@ -434,13 +438,13 @@ function mt({ api: o, className: b }) {
|
|
|
434
438
|
}
|
|
435
439
|
)
|
|
436
440
|
] }),
|
|
437
|
-
|
|
441
|
+
fe ? /* @__PURE__ */ t(ne, { variant: "500", detail: "Could not load obligations for this filter." }) : he ? /* @__PURE__ */ t("div", { className: "h-24 animate-pulse rounded-xl bg-[hsl(var(--nvr-skeleton))]" }) : C.length === 0 ? /* @__PURE__ */ t(
|
|
438
442
|
"div",
|
|
439
443
|
{
|
|
440
444
|
className: "rounded-xl border border-slate-200 bg-white dark:border-border dark:bg-card",
|
|
441
445
|
"data-obligations-empty": !0,
|
|
442
446
|
children: /* @__PURE__ */ t(
|
|
443
|
-
|
|
447
|
+
oe,
|
|
444
448
|
{
|
|
445
449
|
title: "Nothing outstanding for this filter",
|
|
446
450
|
detail: "Every message the partner expects, for this outcome, has landed."
|
|
@@ -452,7 +456,7 @@ function mt({ api: o, className: b }) {
|
|
|
452
456
|
{
|
|
453
457
|
className: d(
|
|
454
458
|
"overflow-x-auto rounded-xl border border-slate-200 dark:border-border",
|
|
455
|
-
|
|
459
|
+
xe && "opacity-60 transition-opacity"
|
|
456
460
|
),
|
|
457
461
|
children: [
|
|
458
462
|
/* @__PURE__ */ r("table", { className: "w-full text-[12px] tabular-nums", children: [
|
|
@@ -469,32 +473,45 @@ function mt({ api: o, className: b }) {
|
|
|
469
473
|
S && /* @__PURE__ */ t("th", { className: "px-3 py-1.5 font-medium" })
|
|
470
474
|
] }) }),
|
|
471
475
|
/* @__PURE__ */ t("tbody", { children: C.map((e) => {
|
|
472
|
-
const
|
|
473
|
-
return /* @__PURE__ */ r(
|
|
476
|
+
const o = re(ee(e.outcome)), [i, h] = o ? ae(o) : [null, null], v = S && (e.outcome === "failed" || e.outcome === "missing" || e.outcome === "overdue"), x = De(e.collection), k = Ve(e), O = s === "inbound" && me === e.id, G = Xe(e.detail);
|
|
477
|
+
return /* @__PURE__ */ r(Te, { children: [
|
|
474
478
|
/* @__PURE__ */ r(
|
|
475
479
|
"tr",
|
|
476
480
|
{
|
|
477
481
|
"data-obligation-row": e.id,
|
|
478
|
-
"data-obligation-routable":
|
|
482
|
+
"data-obligation-routable": x ? "1" : "0",
|
|
479
483
|
className: d(
|
|
480
484
|
"border-b border-slate-100 last:border-0 dark:border-border/60",
|
|
481
|
-
|
|
485
|
+
x && "cursor-pointer hover:bg-slate-50 dark:hover:bg-muted"
|
|
482
486
|
),
|
|
483
|
-
onClick:
|
|
487
|
+
onClick: x ? () => g.open({ collection: e.collection, itemId: e.item }) : void 0,
|
|
484
488
|
children: [
|
|
485
|
-
/* @__PURE__ */
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
489
|
+
/* @__PURE__ */ t(
|
|
490
|
+
"td",
|
|
491
|
+
{
|
|
492
|
+
className: "px-3 py-1.5 font-medium text-slate-700 dark:text-slate-200",
|
|
493
|
+
"data-obligation-record": !0,
|
|
494
|
+
children: x ? /* @__PURE__ */ t(
|
|
495
|
+
"button",
|
|
496
|
+
{
|
|
497
|
+
type: "button",
|
|
498
|
+
onClick: (j) => {
|
|
499
|
+
j.stopPropagation(), g.open({ collection: e.collection, itemId: e.item });
|
|
500
|
+
},
|
|
501
|
+
className: "rounded text-left underline decoration-slate-300 underline-offset-2 hover:decoration-slate-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/50 dark:decoration-slate-600 dark:hover:decoration-slate-400",
|
|
502
|
+
children: ie(e)
|
|
503
|
+
}
|
|
504
|
+
) : ie(e)
|
|
505
|
+
}
|
|
506
|
+
),
|
|
507
|
+
/* @__PURE__ */ t("td", { className: "px-3 py-1.5 text-slate-600 dark:text-slate-300", children: ve.get(e.kind) ?? e.kind }),
|
|
508
|
+
/* @__PURE__ */ t("td", { className: "px-3 py-1.5 text-slate-500 dark:text-muted-foreground", children: Je(e.due_at) }),
|
|
492
509
|
/* @__PURE__ */ t("td", { className: "px-3 py-1.5", "data-obligation-outcome": e.outcome, children: /* @__PURE__ */ r(
|
|
493
510
|
"span",
|
|
494
511
|
{
|
|
495
512
|
style: i ? {
|
|
496
513
|
"--obt": i,
|
|
497
|
-
"--obtd":
|
|
514
|
+
"--obtd": h
|
|
498
515
|
} : void 0,
|
|
499
516
|
className: d(
|
|
500
517
|
"inline-flex items-center gap-1 font-medium",
|
|
@@ -515,19 +532,13 @@ function mt({ api: o, className: b }) {
|
|
|
515
532
|
]
|
|
516
533
|
}
|
|
517
534
|
) }),
|
|
518
|
-
/* @__PURE__ */
|
|
535
|
+
/* @__PURE__ */ t(
|
|
519
536
|
"td",
|
|
520
537
|
{
|
|
521
538
|
className: "max-w-[38ch] truncate px-3 py-1.5 text-slate-500 dark:text-muted-foreground",
|
|
522
539
|
"data-obligation-reason": !0,
|
|
523
|
-
"data-tip": e.reason
|
|
524
|
-
children:
|
|
525
|
-
e.reason ?? "—",
|
|
526
|
-
e.submission_id != null && /* @__PURE__ */ r("span", { className: "ml-1 text-slate-300 dark:text-slate-600", children: [
|
|
527
|
-
"· submission #",
|
|
528
|
-
e.submission_id
|
|
529
|
-
] })
|
|
530
|
-
]
|
|
540
|
+
"data-tip": e.reason ? te(e.reason) : void 0,
|
|
541
|
+
children: e.reason ? te(e.reason) : "—"
|
|
531
542
|
}
|
|
532
543
|
),
|
|
533
544
|
/* @__PURE__ */ t(
|
|
@@ -535,7 +546,7 @@ function mt({ api: o, className: b }) {
|
|
|
535
546
|
{
|
|
536
547
|
className: "hidden px-3 py-1.5 text-slate-500 dark:text-muted-foreground lg:table-cell",
|
|
537
548
|
"data-obligations-col-attempts": !0,
|
|
538
|
-
children:
|
|
549
|
+
children: Re(k, e.reason)
|
|
539
550
|
}
|
|
540
551
|
),
|
|
541
552
|
/* @__PURE__ */ t(
|
|
@@ -543,8 +554,8 @@ function mt({ api: o, className: b }) {
|
|
|
543
554
|
{
|
|
544
555
|
className: "hidden max-w-[28ch] truncate px-3 py-1.5 text-slate-500 dark:text-muted-foreground lg:table-cell",
|
|
545
556
|
"data-obligations-last-response": !0,
|
|
546
|
-
"data-tip":
|
|
547
|
-
children:
|
|
557
|
+
"data-tip": He(k) ?? void 0,
|
|
558
|
+
children: Ae(e.outcome, k)
|
|
548
559
|
}
|
|
549
560
|
),
|
|
550
561
|
s === "waiting" && /* @__PURE__ */ t(
|
|
@@ -552,20 +563,20 @@ function mt({ api: o, className: b }) {
|
|
|
552
563
|
{
|
|
553
564
|
className: "px-3 py-1.5 text-slate-600 dark:text-slate-300",
|
|
554
565
|
"data-obligations-owner": !0,
|
|
555
|
-
children:
|
|
566
|
+
children: Ne(e)
|
|
556
567
|
}
|
|
557
568
|
),
|
|
558
569
|
s === "inbound" && /* @__PURE__ */ t("td", { className: "px-3 py-1.5 text-right", children: /* @__PURE__ */ t(
|
|
559
|
-
|
|
570
|
+
ze,
|
|
560
571
|
{
|
|
561
|
-
open:
|
|
562
|
-
onToggle: () =>
|
|
572
|
+
open: O,
|
|
573
|
+
onToggle: () => R((j) => j === e.id ? null : e.id)
|
|
563
574
|
}
|
|
564
575
|
) }),
|
|
565
576
|
S && /* @__PURE__ */ r("td", { className: "px-3 py-1.5 text-right", children: [
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
577
|
+
v && e.can_resend !== !1 && /* @__PURE__ */ t(We, { obligationId: e.id }),
|
|
578
|
+
v && e.can_send_current === !0 && /* @__PURE__ */ t(
|
|
579
|
+
Be,
|
|
569
580
|
{
|
|
570
581
|
obligationId: e.id,
|
|
571
582
|
api: e.api,
|
|
@@ -583,17 +594,17 @@ function mt({ api: o, className: b }) {
|
|
|
583
594
|
]
|
|
584
595
|
}
|
|
585
596
|
),
|
|
586
|
-
|
|
597
|
+
O && /* @__PURE__ */ t(
|
|
587
598
|
"tr",
|
|
588
599
|
{
|
|
589
600
|
className: "border-b border-slate-100 dark:border-border/60",
|
|
590
601
|
children: /* @__PURE__ */ t(
|
|
591
602
|
"td",
|
|
592
603
|
{
|
|
593
|
-
colSpan:
|
|
604
|
+
colSpan: we,
|
|
594
605
|
className: "bg-slate-50 px-3 py-2 dark:bg-muted",
|
|
595
606
|
"data-obligations-detail": !0,
|
|
596
|
-
children:
|
|
607
|
+
children: G ? /* @__PURE__ */ t("pre", { className: "max-h-56 overflow-auto whitespace-pre-wrap break-words rounded-md border border-slate-200 bg-white p-2 font-mono text-[10.5px] leading-4 text-slate-700 dark:border-slate-700 dark:bg-slate-900/40 dark:text-slate-300", children: G }) : /* @__PURE__ */ t("p", { className: "text-[11px] italic text-slate-400 dark:text-muted-foreground", children: "No request detail was stored for this rejection — the reason column above is everything the ledger recorded." })
|
|
597
608
|
}
|
|
598
609
|
)
|
|
599
610
|
},
|
|
@@ -616,7 +627,7 @@ function mt({ api: o, className: b }) {
|
|
|
616
627
|
{
|
|
617
628
|
type: "button",
|
|
618
629
|
disabled: u <= 1,
|
|
619
|
-
onClick: () =>
|
|
630
|
+
onClick: () => L((e) => Math.max(1, e - 1)),
|
|
620
631
|
className: "rounded border border-slate-200 px-2 py-0.5 disabled:opacity-40 dark:border-border",
|
|
621
632
|
children: "Prev"
|
|
622
633
|
}
|
|
@@ -626,7 +637,7 @@ function mt({ api: o, className: b }) {
|
|
|
626
637
|
{
|
|
627
638
|
type: "button",
|
|
628
639
|
disabled: u * q >= _,
|
|
629
|
-
onClick: () =>
|
|
640
|
+
onClick: () => L((e) => e + 1),
|
|
630
641
|
className: "rounded border border-slate-200 px-2 py-0.5 disabled:opacity-40 dark:border-border",
|
|
631
642
|
children: "Next"
|
|
632
643
|
}
|
|
@@ -636,10 +647,11 @@ function mt({ api: o, className: b }) {
|
|
|
636
647
|
]
|
|
637
648
|
}
|
|
638
649
|
),
|
|
639
|
-
/* @__PURE__ */ t(
|
|
650
|
+
/* @__PURE__ */ t($e, {})
|
|
640
651
|
] });
|
|
641
652
|
}
|
|
642
653
|
export {
|
|
643
|
-
|
|
644
|
-
|
|
654
|
+
gt as IntegrationObligationsView,
|
|
655
|
+
ie as obligationRecordText,
|
|
656
|
+
re as roleForTone
|
|
645
657
|
};
|