@nivaro/react 0.3.63 → 0.3.65
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 +54 -5
- package/dist/shared/components/CollectionBrowserView.js +3029 -2947
- package/dist/shared/components/ConformanceView.js +235 -221
- package/dist/shared/components/DataTable.js +478 -459
- package/dist/shared/components/ItemEditForm.js +4469 -4266
- package/dist/shared/components/PageRenderer.js +146 -138
- package/dist/shared/components/RecordDrilldownSheet.js +73 -65
- package/dist/shared/components/bulk/BulkActionButtons.js +72 -72
- package/dist/shared/components/bulk/BulkFieldUpdate.js +114 -103
- package/dist/shared/components/bulk/BulkFieldUpdateButton.js +73 -0
- package/dist/shared/components/bulk/bulk-field-options.js +29 -23
- package/dist/shared/components/integrations/IntegrationObligationsView.js +191 -173
- package/dist/shared/components/integrations/IntegrationStatusLines.js +101 -85
- package/dist/shared/components/integrations/RecordIntegrationPreview.js +11 -9
- package/dist/shared/components/integrations/SendCurrentData.js +126 -0
- package/dist/shared/components/item-edit/CatalogPickerField.js +1530 -1437
- package/dist/shared/components/item-edit/FieldRenderer.js +49 -45
- package/dist/shared/components/item-edit/FieldRow.js +413 -403
- package/dist/shared/components/item-edit/InlineTableField.js +2903 -2816
- package/dist/shared/components/item-edit/M2MCombobox.js +172 -168
- package/dist/shared/components/item-edit/MidairCollisionDialog.js +341 -114
- package/dist/shared/components/item-edit/NestedRelationEditor.js +171 -163
- package/dist/shared/components/item-edit/PlanGrid.js +783 -724
- package/dist/shared/components/item-edit/QuickCreateButton.js +291 -224
- package/dist/shared/components/item-edit/RecordInsights.js +113 -111
- package/dist/shared/components/item-edit/RecordLiveSync.js +4 -1
- package/dist/shared/components/item-edit/RelationCombobox.js +332 -314
- package/dist/shared/components/item-edit/cascade-clear-notice.js +52 -0
- package/dist/shared/components/item-edit/collision-format.js +37 -0
- package/dist/shared/components/item-edit/field-a11y.js +25 -0
- package/dist/shared/components/item-edit/line-merge.js +58 -0
- package/dist/shared/components/item-edit/line-midair.js +94 -87
- package/dist/shared/components/item-edit/move-guard.js +17 -0
- package/dist/shared/components/item-edit/picker-search.js +22 -15
- package/dist/shared/components/item-edit/rail-width.js +8 -0
- package/dist/shared/components/monitoring/InactiveUserLinksView.js +322 -291
- package/dist/shared/components/panels/AccessDeniedPanel.js +96 -55
- package/dist/shared/components/panels/CommentPanel.js +142 -136
- package/dist/shared/components/panels/ItemLockBanner.js +246 -240
- package/dist/shared/components/panels/PipelinePanel.js +1366 -1194
- package/dist/shared/components/panels/RevisionsPanel.js +106 -102
- package/dist/shared/components/panels/SlaBreachBanner.js +16 -20
- package/dist/shared/components/panels/SlaClock.js +90 -68
- package/dist/shared/components/queue/QueueItemSheet.js +94 -87
- package/dist/shared/components/queue/QueueWorklist.js +1502 -1354
- package/dist/shared/components/queue/worklist-csv.js +75 -0
- package/dist/shared/components/queue/worklist-helpers.js +20 -0
- package/dist/shared/components/widgets/ReviewListWidget.js +226 -207
- package/dist/shared/lib/bulk-copy.js +17 -0
- package/dist/shared/lib/cbv-export.js +122 -0
- package/dist/shared/lib/delete-offer.js +13 -0
- package/dist/shared/lib/error-hints.js +1 -0
- package/dist/shared/lib/leave-guard.js +41 -26
- package/dist/shared/lib/list-link.js +72 -56
- package/dist/shared/lib/live-queries.js +32 -30
- package/dist/shared/lib/moved-notice.js +25 -0
- package/dist/shared/lib/notification-target.js +56 -54
- package/dist/shared/lib/obligation-banner.js +11 -8
- package/dist/shared/lib/obligation-reason-text.js +6 -6
- package/dist/shared/lib/sort-cycle.js +6 -0
- package/dist/shared/lib/summary-mode.js +59 -41
- package/package.json +1 -1
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { jsxs as r, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { Code2 as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { toast as
|
|
6
|
-
import { useNivaroClient as
|
|
7
|
-
import { get as
|
|
8
|
-
import { obligationQueryParams as
|
|
2
|
+
import { useQueryClient as ne, useQuery as G, useQueries as Ne, useMutation as we } from "@tanstack/react-query";
|
|
3
|
+
import { Code2 as Se, ChevronDown as Ce, Loader2 as qe, Send as _e } from "lucide-react";
|
|
4
|
+
import { useState as L, useRef as Ee, useEffect as V, useMemo as y, Fragment as Le } from "react";
|
|
5
|
+
import { toast as X } from "sonner";
|
|
6
|
+
import { useNivaroClient as re, useItemNavigation as Oe, useNavigation as Fe } from "../../context.js";
|
|
7
|
+
import { get as Z, post as ie } from "../../lib/commands.js";
|
|
8
|
+
import { obligationQueryParams as Te, obligationTabsFor as Ke, toneForOutcome as Y, isRoutableRecord as je, attemptsLabel as Ie, lastResponseLabel as De, lastResponseFull as Pe } from "../../lib/obligation-filters.js";
|
|
9
9
|
import { serverNow as Ae } from "../../lib/server-clock.js";
|
|
10
|
-
import { titleCase as
|
|
11
|
-
import { EmptyState as
|
|
12
|
-
import { ErrorSurface as
|
|
13
|
-
import { colorPair as
|
|
14
|
-
import { TipLayer as
|
|
15
|
-
import { SimpleSelectXs as
|
|
16
|
-
|
|
10
|
+
import { titleCase as He, cn as d, formatRelative as le, humanHours as Me } from "../../lib/utils.js";
|
|
11
|
+
import { EmptyState as ee } from "../EmptyState.js";
|
|
12
|
+
import { ErrorSurface as te } from "../ErrorSurface.js";
|
|
13
|
+
import { colorPair as ae } from "../QueryTable.js";
|
|
14
|
+
import { TipLayer as Qe } from "../TipLayer.js";
|
|
15
|
+
import { SimpleSelectXs as I } from "../ui/SimpleSelect.js";
|
|
16
|
+
import { SendCurrentDataButton as Re } from "./SendCurrentData.js";
|
|
17
|
+
const D = {
|
|
17
18
|
overdue: "Overdue",
|
|
18
19
|
failed: "Failed",
|
|
19
20
|
pending: "Pending",
|
|
@@ -21,7 +22,7 @@ const I = {
|
|
|
21
22
|
sent: "Sent",
|
|
22
23
|
missing: "Missing",
|
|
23
24
|
superseded: "Superseded"
|
|
24
|
-
},
|
|
25
|
+
}, Be = [
|
|
25
26
|
"overdue",
|
|
26
27
|
"failed",
|
|
27
28
|
"pending",
|
|
@@ -30,53 +31,53 @@ const I = {
|
|
|
30
31
|
"missing",
|
|
31
32
|
"superseded"
|
|
32
33
|
];
|
|
33
|
-
function
|
|
34
|
-
return
|
|
34
|
+
function oe(o) {
|
|
35
|
+
return o === "danger" ? "negative" : o === "warning" ? "warning" : o === "positive" ? "positive" : null;
|
|
35
36
|
}
|
|
36
|
-
function $e(
|
|
37
|
-
const b = new Date(
|
|
38
|
-
return b > 0 ? `due in ${
|
|
37
|
+
function $e(o) {
|
|
38
|
+
const b = new Date(o).getTime() - Ae();
|
|
39
|
+
return b > 0 ? `due in ${Me(b / 36e5)}` : le(o);
|
|
39
40
|
}
|
|
40
|
-
function
|
|
41
|
-
const b =
|
|
41
|
+
function Ue({ obligationId: o }) {
|
|
42
|
+
const b = re(), c = ne(), [p, x] = L(!1), n = we({
|
|
42
43
|
mutationFn: () => b.request(
|
|
43
|
-
|
|
44
|
+
ie(`/integration-obligations/${o}/send`)
|
|
44
45
|
),
|
|
45
46
|
onSuccess: (l) => {
|
|
46
|
-
var
|
|
47
|
-
|
|
47
|
+
var u;
|
|
48
|
+
X.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"] });
|
|
48
49
|
},
|
|
49
50
|
onError: (l) => {
|
|
50
|
-
const
|
|
51
|
-
|
|
51
|
+
const u = l == null ? void 0 : l.response;
|
|
52
|
+
X.error((u == null ? void 0 : u.error) ?? "Send now failed", { duration: 8e3 });
|
|
52
53
|
},
|
|
53
|
-
onSettled: () =>
|
|
54
|
+
onSettled: () => x(!1)
|
|
54
55
|
});
|
|
55
56
|
return /* @__PURE__ */ r(
|
|
56
57
|
"button",
|
|
57
58
|
{
|
|
58
59
|
type: "button",
|
|
59
60
|
"data-obligation-send-now": !0,
|
|
60
|
-
disabled:
|
|
61
|
+
disabled: n.isPending,
|
|
61
62
|
onClick: (l) => {
|
|
62
|
-
if (l.stopPropagation(), !
|
|
63
|
-
|
|
63
|
+
if (l.stopPropagation(), !p) {
|
|
64
|
+
x(!0);
|
|
64
65
|
return;
|
|
65
66
|
}
|
|
66
|
-
|
|
67
|
+
n.mutate();
|
|
67
68
|
},
|
|
68
69
|
className: d(
|
|
69
70
|
"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",
|
|
70
|
-
|
|
71
|
+
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"
|
|
71
72
|
),
|
|
72
73
|
children: [
|
|
73
|
-
|
|
74
|
-
|
|
74
|
+
n.isPending ? /* @__PURE__ */ t(qe, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ t(_e, { className: "h-3 w-3" }),
|
|
75
|
+
p ? "Confirm?" : "Send now"
|
|
75
76
|
]
|
|
76
77
|
}
|
|
77
78
|
);
|
|
78
79
|
}
|
|
79
|
-
function
|
|
80
|
+
function Je({ open: o, onToggle: b }) {
|
|
80
81
|
return /* @__PURE__ */ r(
|
|
81
82
|
"button",
|
|
82
83
|
{
|
|
@@ -87,160 +88,160 @@ function Qe({ open: n, onToggle: b }) {
|
|
|
87
88
|
},
|
|
88
89
|
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",
|
|
89
90
|
children: [
|
|
90
|
-
/* @__PURE__ */ t(
|
|
91
|
-
|
|
92
|
-
/* @__PURE__ */ t(
|
|
91
|
+
/* @__PURE__ */ t(Se, { className: "h-3 w-3" }),
|
|
92
|
+
o ? "Hide request" : "Show request",
|
|
93
|
+
/* @__PURE__ */ t(Ce, { className: d("h-3 w-3 transition-transform", o && "rotate-180") })
|
|
93
94
|
]
|
|
94
95
|
}
|
|
95
96
|
);
|
|
96
97
|
}
|
|
97
|
-
function
|
|
98
|
-
const
|
|
98
|
+
function We() {
|
|
99
|
+
const o = Fe(), b = "/settings?section=integrations", c = o.consoleUrl ? o.consoleUrl(b) : b;
|
|
99
100
|
if (!c) return null;
|
|
100
|
-
const
|
|
101
|
+
const p = /^https?:\/\//.test(c);
|
|
101
102
|
return /* @__PURE__ */ t(
|
|
102
103
|
"a",
|
|
103
104
|
{
|
|
104
105
|
href: c,
|
|
105
106
|
"data-obligations-settings-link": !0,
|
|
106
|
-
...
|
|
107
|
-
onClick: (
|
|
108
|
-
|
|
107
|
+
...p ? { target: "_blank", rel: "noreferrer" } : {},
|
|
108
|
+
onClick: (x) => {
|
|
109
|
+
p || x.metaKey || x.ctrlKey || (x.preventDefault(), o.navigate(c));
|
|
109
110
|
},
|
|
110
111
|
className: "underline decoration-dotted hover:text-slate-600 dark:hover:text-slate-200",
|
|
111
112
|
children: "Settings → Integrations"
|
|
112
113
|
}
|
|
113
114
|
);
|
|
114
115
|
}
|
|
115
|
-
function
|
|
116
|
-
return
|
|
117
|
-
attempts:
|
|
118
|
-
status:
|
|
119
|
-
last_error:
|
|
120
|
-
response:
|
|
116
|
+
function ze(o) {
|
|
117
|
+
return o.submission_attempts == null ? null : {
|
|
118
|
+
attempts: o.submission_attempts,
|
|
119
|
+
status: o.submission_status,
|
|
120
|
+
last_error: o.submission_last_error,
|
|
121
|
+
response: o.submission_response
|
|
121
122
|
};
|
|
122
123
|
}
|
|
123
|
-
function
|
|
124
|
-
if (!
|
|
124
|
+
function Ge(o) {
|
|
125
|
+
if (!o) return null;
|
|
125
126
|
try {
|
|
126
|
-
return JSON.stringify(JSON.parse(
|
|
127
|
+
return JSON.stringify(JSON.parse(o), null, 2);
|
|
127
128
|
} catch {
|
|
128
|
-
return
|
|
129
|
+
return o;
|
|
129
130
|
}
|
|
130
131
|
}
|
|
131
|
-
const
|
|
132
|
-
function
|
|
133
|
-
const c =
|
|
134
|
-
api:
|
|
132
|
+
const q = 50;
|
|
133
|
+
function mt({ api: o, className: b }) {
|
|
134
|
+
const c = re(), p = ne(), x = Oe(), [n, l] = L({
|
|
135
|
+
api: o ?? null,
|
|
135
136
|
kind: null,
|
|
136
137
|
collection: null,
|
|
137
138
|
outcome: ["overdue", "failed", "missing"],
|
|
138
139
|
ageHours: null
|
|
139
|
-
}), [
|
|
140
|
-
|
|
141
|
-
const e =
|
|
142
|
-
e !== A.current && (A.current = e,
|
|
143
|
-
}, [
|
|
140
|
+
}), [u, O] = L(1), [se, P] = L(null), A = Ee(o ?? null);
|
|
141
|
+
V(() => {
|
|
142
|
+
const e = o ?? null;
|
|
143
|
+
e !== A.current && (A.current = e, l((a) => ({ ...a, api: e })));
|
|
144
|
+
}, [o]);
|
|
144
145
|
const {
|
|
145
146
|
data: m,
|
|
146
|
-
isLoading:
|
|
147
|
-
isError:
|
|
148
|
-
} =
|
|
147
|
+
isLoading: H,
|
|
148
|
+
isError: de
|
|
149
|
+
} = G({
|
|
149
150
|
queryKey: ["integration-obligations", "summary"],
|
|
150
|
-
queryFn: () => c.request(
|
|
151
|
+
queryFn: () => c.request(Z("/integration-obligations/summary")),
|
|
151
152
|
staleTime: 3e4
|
|
152
|
-
}), S = (m == null ? void 0 : m.remediation_enabled) === !0,
|
|
153
|
-
!
|
|
153
|
+
}), S = (m == null ? void 0 : m.remediation_enabled) === !0, ce = (m == null ? void 0 : m.notifications_enabled) === !0, M = H ? [] : [
|
|
154
|
+
!ce && "notifications off",
|
|
154
155
|
!S && "remediation off"
|
|
155
|
-
].filter((e) => !!e),
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
}, [
|
|
159
|
-
const
|
|
156
|
+
].filter((e) => !!e), ue = n.outcome.join(",");
|
|
157
|
+
V(() => {
|
|
158
|
+
O(1), P(null);
|
|
159
|
+
}, [n.api, n.kind, n.collection, ue, n.ageHours]);
|
|
160
|
+
const Q = y(
|
|
160
161
|
() => ({
|
|
161
|
-
...
|
|
162
|
-
page: String(
|
|
163
|
-
limit: String(
|
|
162
|
+
...Te(n),
|
|
163
|
+
page: String(u),
|
|
164
|
+
limit: String(q)
|
|
164
165
|
}),
|
|
165
|
-
[
|
|
166
|
+
[n, u]
|
|
166
167
|
), {
|
|
167
|
-
data:
|
|
168
|
-
isLoading:
|
|
169
|
-
isFetching:
|
|
170
|
-
isError:
|
|
171
|
-
} =
|
|
172
|
-
queryKey: ["integration-obligations", "list",
|
|
173
|
-
queryFn: () => c.request(
|
|
168
|
+
data: N,
|
|
169
|
+
isLoading: me,
|
|
170
|
+
isFetching: be,
|
|
171
|
+
isError: pe
|
|
172
|
+
} = G({
|
|
173
|
+
queryKey: ["integration-obligations", "list", Q],
|
|
174
|
+
queryFn: () => c.request(Z("/integration-obligations", Q)),
|
|
174
175
|
staleTime: 15e3,
|
|
175
176
|
placeholderData: (e) => e
|
|
176
|
-
}), R = (m == null ? void 0 : m.data.apis) ?? [],
|
|
177
|
+
}), R = (m == null ? void 0 : m.data.apis) ?? [], B = o ? R.filter((e) => e.api === o) : R, w = (m == null ? void 0 : m.data.kinds) ?? [], F = n.api ? w.filter((e) => e.api === n.api) : w, ge = y(() => {
|
|
177
178
|
const e = /* @__PURE__ */ new Map();
|
|
178
|
-
for (const a of
|
|
179
|
+
for (const a of w) e.has(a.kind) || e.set(a.kind, a.label);
|
|
179
180
|
return e;
|
|
180
|
-
}, [
|
|
181
|
+
}, [w]), xe = y(() => {
|
|
181
182
|
const e = /* @__PURE__ */ new Map();
|
|
182
183
|
for (const a of F)
|
|
183
|
-
e.has(a.collection) || e.set(a.collection,
|
|
184
|
+
e.has(a.collection) || e.set(a.collection, He(a.collection));
|
|
184
185
|
return [...e.entries()].map(([a, i]) => ({ value: a, label: i })).sort((a, i) => a.label.localeCompare(i.label));
|
|
185
|
-
}, [F]), h =
|
|
186
|
+
}, [F]), h = y(() => Ke(w, n.api), [w, n.api]), $ = y(
|
|
186
187
|
() => new Set(
|
|
187
|
-
(
|
|
188
|
+
(n.kind ?? "").split(",").map((e) => e.trim()).filter(Boolean)
|
|
188
189
|
),
|
|
189
|
-
[
|
|
190
|
-
),
|
|
190
|
+
[n.kind]
|
|
191
|
+
), U = (e) => e.length > 0 && e.length === $.size && e.every((a) => $.has(a)), s = U(h.waiting) ? "waiting" : U(h.inbound) ? "inbound" : "all", T = (e) => {
|
|
191
192
|
const a = e === "waiting" ? h.waiting : e === "inbound" ? h.inbound : [];
|
|
192
|
-
|
|
193
|
-
}, C = (
|
|
193
|
+
l((i) => ({ ...i, kind: a.length > 0 ? a.join(",") : null }));
|
|
194
|
+
}, C = (N == null ? void 0 : N.data) ?? [], _ = (N == null ? void 0 : N.total) ?? 0, K = y(
|
|
194
195
|
() => s === "waiting" ? [...new Set(C.map((e) => e.collection))] : [],
|
|
195
196
|
[s, C]
|
|
196
|
-
), j =
|
|
197
|
-
queries:
|
|
197
|
+
), j = Ne({
|
|
198
|
+
queries: K.map((e) => {
|
|
198
199
|
const a = C.filter((i) => i.collection === e).map((i) => i.item);
|
|
199
200
|
return {
|
|
200
201
|
queryKey: ["integration-obligations", "owners", e, a.slice().sort().join(",")],
|
|
201
202
|
queryFn: () => c.request(
|
|
202
|
-
|
|
203
|
+
ie(`/pipelines/instance/${e}/owners/batch`, { ids: a })
|
|
203
204
|
).then((i) => i.data ?? {}),
|
|
204
205
|
enabled: a.length > 0,
|
|
205
206
|
staleTime: 6e4
|
|
206
207
|
};
|
|
207
208
|
})
|
|
208
|
-
}),
|
|
209
|
+
}), J = y(() => {
|
|
209
210
|
const e = {};
|
|
210
|
-
return
|
|
211
|
-
var
|
|
212
|
-
const g = (
|
|
211
|
+
return K.forEach((a, i) => {
|
|
212
|
+
var k;
|
|
213
|
+
const g = (k = j[i]) == null ? void 0 : k.data;
|
|
213
214
|
if (g)
|
|
214
|
-
for (const [f,
|
|
215
|
-
e[`${a}:${f}`] =
|
|
215
|
+
for (const [f, v] of Object.entries(g))
|
|
216
|
+
e[`${a}:${f}`] = v.map((E) => E.name).join(", ");
|
|
216
217
|
}), e;
|
|
217
|
-
}, [
|
|
218
|
+
}, [K, j]), he = j.some((e) => e.isLoading), fe = (e) => {
|
|
218
219
|
const a = `${e.collection}:${e.item}`;
|
|
219
|
-
return a in
|
|
220
|
-
},
|
|
220
|
+
return a in J ? J[a] || "—" : he ? "…" : "—";
|
|
221
|
+
}, ke = 7 + (s === "waiting" ? 1 : 0) + (s === "inbound" ? 1 : 0) + (S ? 1 : 0), W = (e) => l((a) => ({
|
|
221
222
|
...a,
|
|
222
223
|
outcome: a.outcome.includes(e) ? a.outcome.filter((i) => i !== e) : [...a.outcome, e]
|
|
223
|
-
})),
|
|
224
|
+
})), ve = (e) => l((a) => ({ ...a, api: a.api === e ? null : e }));
|
|
224
225
|
return /* @__PURE__ */ r("div", { className: d("space-y-4", b), "data-obligations-board": !0, children: [
|
|
225
|
-
|
|
226
|
+
M.length > 0 && /* @__PURE__ */ r(
|
|
226
227
|
"p",
|
|
227
228
|
{
|
|
228
229
|
"data-obligations-switch-status": !0,
|
|
229
230
|
className: "text-[11px] text-slate-400 dark:text-muted-foreground",
|
|
230
231
|
children: [
|
|
231
|
-
|
|
232
|
+
M.join(" · "),
|
|
232
233
|
" — ",
|
|
233
|
-
/* @__PURE__ */ t(
|
|
234
|
+
/* @__PURE__ */ t(We, {})
|
|
234
235
|
]
|
|
235
236
|
}
|
|
236
237
|
),
|
|
237
|
-
|
|
238
|
-
|
|
238
|
+
de ? /* @__PURE__ */ t(te, { 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(
|
|
239
|
+
ee,
|
|
239
240
|
{
|
|
240
241
|
title: "No obligations recorded yet",
|
|
241
242
|
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."
|
|
242
243
|
}
|
|
243
|
-
) : /* @__PURE__ */ t("div", { className: "space-y-3", children:
|
|
244
|
+
) : /* @__PURE__ */ t("div", { className: "space-y-3", children: B.map((e) => /* @__PURE__ */ r(
|
|
244
245
|
"div",
|
|
245
246
|
{
|
|
246
247
|
"data-obligation-api": e.api,
|
|
@@ -251,23 +252,23 @@ function dt({ api: n, className: b }) {
|
|
|
251
252
|
"button",
|
|
252
253
|
{
|
|
253
254
|
type: "button",
|
|
254
|
-
"aria-pressed":
|
|
255
|
-
onClick: () =>
|
|
256
|
-
"data-tip":
|
|
255
|
+
"aria-pressed": n.api === e.api,
|
|
256
|
+
onClick: () => ve(e.api),
|
|
257
|
+
"data-tip": n.api === e.api ? "Showing only this partner — click to show all" : void 0,
|
|
257
258
|
className: d(
|
|
258
259
|
"text-[13px] font-semibold hover:underline",
|
|
259
|
-
|
|
260
|
+
n.api === e.api ? "text-nvr-cyan" : "text-slate-800 dark:text-foreground"
|
|
260
261
|
),
|
|
261
262
|
children: e.api
|
|
262
263
|
}
|
|
263
264
|
),
|
|
264
265
|
e.oldest_unmet && /* @__PURE__ */ r("span", { className: "text-[11px] text-slate-400 dark:text-muted-foreground", children: [
|
|
265
266
|
"oldest unmet ",
|
|
266
|
-
|
|
267
|
+
le(e.oldest_unmet)
|
|
267
268
|
] })
|
|
268
269
|
] }),
|
|
269
270
|
/* @__PURE__ */ t("div", { className: "flex flex-wrap gap-2", children: e.tiles.map((a) => {
|
|
270
|
-
const i =
|
|
271
|
+
const i = oe(Y(a.outcome)), [g, k] = i ? ae(i) : [null, null], f = n.api === e.api && n.outcome.includes(a.outcome);
|
|
271
272
|
return /* @__PURE__ */ r(
|
|
272
273
|
"button",
|
|
273
274
|
{
|
|
@@ -275,11 +276,11 @@ function dt({ api: n, className: b }) {
|
|
|
275
276
|
"data-obligation-tile": a.outcome,
|
|
276
277
|
"aria-pressed": f,
|
|
277
278
|
onClick: () => {
|
|
278
|
-
|
|
279
|
+
l((v) => ({ ...v, api: e.api })), W(a.outcome);
|
|
279
280
|
},
|
|
280
281
|
style: g ? {
|
|
281
282
|
"--obt": g,
|
|
282
|
-
"--obtd":
|
|
283
|
+
"--obtd": k
|
|
283
284
|
} : void 0,
|
|
284
285
|
className: d(
|
|
285
286
|
"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",
|
|
@@ -298,7 +299,7 @@ function dt({ api: n, className: b }) {
|
|
|
298
299
|
children: a.count
|
|
299
300
|
}
|
|
300
301
|
),
|
|
301
|
-
/* @__PURE__ */ t("span", { className: "block text-[10px] uppercase tracking-wide text-slate-400 dark:text-muted-foreground", children:
|
|
302
|
+
/* @__PURE__ */ t("span", { className: "block text-[10px] uppercase tracking-wide text-slate-400 dark:text-muted-foreground", children: D[a.outcome] ?? a.outcome })
|
|
302
303
|
]
|
|
303
304
|
},
|
|
304
305
|
a.outcome
|
|
@@ -312,11 +313,11 @@ function dt({ api: n, className: b }) {
|
|
|
312
313
|
/* @__PURE__ */ r("div", { "data-obligation-filter": "kind", className: "flex items-center gap-1.5", children: [
|
|
313
314
|
/* @__PURE__ */ t("span", { className: "text-[11px] text-slate-400 dark:text-muted-foreground", children: "Kind" }),
|
|
314
315
|
/* @__PURE__ */ t(
|
|
315
|
-
|
|
316
|
+
I,
|
|
316
317
|
{
|
|
317
318
|
ariaLabel: "Filter by obligation kind",
|
|
318
|
-
value:
|
|
319
|
-
onChange: (e) =>
|
|
319
|
+
value: n.kind ?? "",
|
|
320
|
+
onChange: (e) => l((a) => ({ ...a, kind: e || null })),
|
|
320
321
|
options: [
|
|
321
322
|
{ value: "", label: "Every kind" },
|
|
322
323
|
...F.map((e) => ({ value: e.kind, label: e.label }))
|
|
@@ -327,23 +328,23 @@ function dt({ api: n, className: b }) {
|
|
|
327
328
|
/* @__PURE__ */ r("div", { "data-obligations-collection-filter": !0, className: "flex items-center gap-1.5", children: [
|
|
328
329
|
/* @__PURE__ */ t("span", { className: "text-[11px] text-slate-400 dark:text-muted-foreground", children: "Collection" }),
|
|
329
330
|
/* @__PURE__ */ t(
|
|
330
|
-
|
|
331
|
+
I,
|
|
331
332
|
{
|
|
332
333
|
ariaLabel: "Filter by collection",
|
|
333
|
-
value:
|
|
334
|
-
onChange: (e) =>
|
|
335
|
-
options: [{ value: "", label: "Every collection" }, ...
|
|
334
|
+
value: n.collection ?? "",
|
|
335
|
+
onChange: (e) => l((a) => ({ ...a, collection: e || null })),
|
|
336
|
+
options: [{ value: "", label: "Every collection" }, ...xe]
|
|
336
337
|
}
|
|
337
338
|
)
|
|
338
339
|
] }),
|
|
339
340
|
/* @__PURE__ */ r("div", { "data-obligation-filter": "age", className: "flex items-center gap-1.5", children: [
|
|
340
341
|
/* @__PURE__ */ t("span", { className: "text-[11px] text-slate-400 dark:text-muted-foreground", children: "Age" }),
|
|
341
342
|
/* @__PURE__ */ t(
|
|
342
|
-
|
|
343
|
+
I,
|
|
343
344
|
{
|
|
344
345
|
ariaLabel: "Filter by obligation age",
|
|
345
|
-
value:
|
|
346
|
-
onChange: (e) =>
|
|
346
|
+
value: n.ageHours != null ? String(n.ageHours) : "",
|
|
347
|
+
onChange: (e) => l((a) => ({ ...a, ageHours: e ? Number(e) : null })),
|
|
347
348
|
options: [
|
|
348
349
|
{ value: "", label: "Any age" },
|
|
349
350
|
{ value: "1", label: "Older than 1 hour" },
|
|
@@ -355,29 +356,29 @@ function dt({ api: n, className: b }) {
|
|
|
355
356
|
] }),
|
|
356
357
|
/* @__PURE__ */ r("div", { "data-obligation-filter": "outcome", className: "flex flex-wrap items-center gap-1", children: [
|
|
357
358
|
/* @__PURE__ */ t("span", { className: "mr-0.5 text-[11px] text-slate-400 dark:text-muted-foreground", children: "Outcome" }),
|
|
358
|
-
|
|
359
|
-
const a =
|
|
359
|
+
Be.map((e) => {
|
|
360
|
+
const a = n.outcome.includes(e);
|
|
360
361
|
return /* @__PURE__ */ t(
|
|
361
362
|
"button",
|
|
362
363
|
{
|
|
363
364
|
type: "button",
|
|
364
365
|
"aria-pressed": a,
|
|
365
|
-
onClick: () =>
|
|
366
|
+
onClick: () => W(e),
|
|
366
367
|
className: d(
|
|
367
368
|
"inline-flex h-6 items-center rounded-full border px-2 text-[10.5px] font-medium transition-colors",
|
|
368
369
|
a ? "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"
|
|
369
370
|
),
|
|
370
|
-
children:
|
|
371
|
+
children: D[e] ?? e
|
|
371
372
|
},
|
|
372
373
|
e
|
|
373
374
|
);
|
|
374
375
|
})
|
|
375
376
|
] }),
|
|
376
|
-
(
|
|
377
|
+
(n.api || n.kind || n.collection || n.ageHours != null) && /* @__PURE__ */ t(
|
|
377
378
|
"button",
|
|
378
379
|
{
|
|
379
380
|
type: "button",
|
|
380
|
-
onClick: () =>
|
|
381
|
+
onClick: () => l((e) => ({
|
|
381
382
|
api: null,
|
|
382
383
|
kind: null,
|
|
383
384
|
collection: null,
|
|
@@ -389,14 +390,14 @@ function dt({ api: n, className: b }) {
|
|
|
389
390
|
}
|
|
390
391
|
)
|
|
391
392
|
] }),
|
|
392
|
-
|
|
393
|
+
n.api && (h.waiting.length > 0 || h.inbound.length > 0) && /* @__PURE__ */ r("div", { className: "flex flex-wrap items-center gap-1", "data-obligation-filter": "tab", children: [
|
|
393
394
|
/* @__PURE__ */ t(
|
|
394
395
|
"button",
|
|
395
396
|
{
|
|
396
397
|
type: "button",
|
|
397
398
|
"data-obligations-tab": "all",
|
|
398
399
|
"aria-pressed": s === "all",
|
|
399
|
-
onClick: () =>
|
|
400
|
+
onClick: () => T("all"),
|
|
400
401
|
className: d(
|
|
401
402
|
"inline-flex h-6 items-center rounded-full border px-2.5 text-[10.5px] font-medium transition-colors",
|
|
402
403
|
s === "all" ? "border-nvr-cyan bg-nvr-cyan/10 text-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"
|
|
@@ -410,7 +411,7 @@ function dt({ api: n, className: b }) {
|
|
|
410
411
|
type: "button",
|
|
411
412
|
"data-obligations-tab": "waiting",
|
|
412
413
|
"aria-pressed": s === "waiting",
|
|
413
|
-
onClick: () =>
|
|
414
|
+
onClick: () => T("waiting"),
|
|
414
415
|
className: d(
|
|
415
416
|
"inline-flex h-6 items-center rounded-full border px-2.5 text-[10.5px] font-medium transition-colors",
|
|
416
417
|
s === "waiting" ? "border-nvr-cyan bg-nvr-cyan/10 text-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"
|
|
@@ -424,7 +425,7 @@ function dt({ api: n, className: b }) {
|
|
|
424
425
|
type: "button",
|
|
425
426
|
"data-obligations-tab": "inbound",
|
|
426
427
|
"aria-pressed": s === "inbound",
|
|
427
|
-
onClick: () =>
|
|
428
|
+
onClick: () => T("inbound"),
|
|
428
429
|
className: d(
|
|
429
430
|
"inline-flex h-6 items-center rounded-full border px-2.5 text-[10.5px] font-medium transition-colors",
|
|
430
431
|
s === "inbound" ? "border-nvr-cyan bg-nvr-cyan/10 text-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"
|
|
@@ -433,13 +434,13 @@ function dt({ api: n, className: b }) {
|
|
|
433
434
|
}
|
|
434
435
|
)
|
|
435
436
|
] }),
|
|
436
|
-
|
|
437
|
+
pe ? /* @__PURE__ */ t(te, { variant: "500", detail: "Could not load obligations for this filter." }) : me ? /* @__PURE__ */ t("div", { className: "h-24 animate-pulse rounded-xl bg-[hsl(var(--nvr-skeleton))]" }) : C.length === 0 ? /* @__PURE__ */ t(
|
|
437
438
|
"div",
|
|
438
439
|
{
|
|
439
440
|
className: "rounded-xl border border-slate-200 bg-white dark:border-border dark:bg-card",
|
|
440
441
|
"data-obligations-empty": !0,
|
|
441
442
|
children: /* @__PURE__ */ t(
|
|
442
|
-
|
|
443
|
+
ee,
|
|
443
444
|
{
|
|
444
445
|
title: "Nothing outstanding for this filter",
|
|
445
446
|
detail: "Every message the partner expects, for this outcome, has landed."
|
|
@@ -451,7 +452,7 @@ function dt({ api: n, className: b }) {
|
|
|
451
452
|
{
|
|
452
453
|
className: d(
|
|
453
454
|
"overflow-x-auto rounded-xl border border-slate-200 dark:border-border",
|
|
454
|
-
|
|
455
|
+
be && "opacity-60 transition-opacity"
|
|
455
456
|
),
|
|
456
457
|
children: [
|
|
457
458
|
/* @__PURE__ */ r("table", { className: "w-full text-[12px] tabular-nums", children: [
|
|
@@ -468,8 +469,8 @@ function dt({ api: n, className: b }) {
|
|
|
468
469
|
S && /* @__PURE__ */ t("th", { className: "px-3 py-1.5 font-medium" })
|
|
469
470
|
] }) }),
|
|
470
471
|
/* @__PURE__ */ t("tbody", { children: C.map((e) => {
|
|
471
|
-
const a =
|
|
472
|
-
return /* @__PURE__ */ r(
|
|
472
|
+
const a = oe(Y(e.outcome)), [i, g] = a ? ae(a) : [null, null], k = S && (e.outcome === "failed" || e.outcome === "missing" || e.outcome === "overdue"), f = je(e.collection), v = ze(e), E = s === "inbound" && se === e.id, z = Ge(e.detail);
|
|
473
|
+
return /* @__PURE__ */ r(Le, { children: [
|
|
473
474
|
/* @__PURE__ */ r(
|
|
474
475
|
"tr",
|
|
475
476
|
{
|
|
@@ -486,7 +487,7 @@ function dt({ api: n, className: b }) {
|
|
|
486
487
|
" · ",
|
|
487
488
|
e.item
|
|
488
489
|
] }),
|
|
489
|
-
/* @__PURE__ */ t("td", { className: "px-3 py-1.5 text-slate-600 dark:text-slate-300", children:
|
|
490
|
+
/* @__PURE__ */ t("td", { className: "px-3 py-1.5 text-slate-600 dark:text-slate-300", children: ge.get(e.kind) ?? e.kind }),
|
|
490
491
|
/* @__PURE__ */ t("td", { className: "px-3 py-1.5 text-slate-500 dark:text-muted-foreground", children: $e(e.due_at) }),
|
|
491
492
|
/* @__PURE__ */ t("td", { className: "px-3 py-1.5", "data-obligation-outcome": e.outcome, children: /* @__PURE__ */ r(
|
|
492
493
|
"span",
|
|
@@ -510,7 +511,7 @@ function dt({ api: n, className: b }) {
|
|
|
510
511
|
)
|
|
511
512
|
}
|
|
512
513
|
),
|
|
513
|
-
|
|
514
|
+
D[e.outcome] ?? e.outcome
|
|
514
515
|
]
|
|
515
516
|
}
|
|
516
517
|
) }),
|
|
@@ -534,7 +535,7 @@ function dt({ api: n, className: b }) {
|
|
|
534
535
|
{
|
|
535
536
|
className: "hidden px-3 py-1.5 text-slate-500 dark:text-muted-foreground lg:table-cell",
|
|
536
537
|
"data-obligations-col-attempts": !0,
|
|
537
|
-
children:
|
|
538
|
+
children: Ie(v, e.reason)
|
|
538
539
|
}
|
|
539
540
|
),
|
|
540
541
|
/* @__PURE__ */ t(
|
|
@@ -542,8 +543,8 @@ function dt({ api: n, className: b }) {
|
|
|
542
543
|
{
|
|
543
544
|
className: "hidden max-w-[28ch] truncate px-3 py-1.5 text-slate-500 dark:text-muted-foreground lg:table-cell",
|
|
544
545
|
"data-obligations-last-response": !0,
|
|
545
|
-
"data-tip": Pe(
|
|
546
|
-
children:
|
|
546
|
+
"data-tip": Pe(v) ?? void 0,
|
|
547
|
+
children: De(e.outcome, v)
|
|
547
548
|
}
|
|
548
549
|
),
|
|
549
550
|
s === "waiting" && /* @__PURE__ */ t(
|
|
@@ -551,31 +552,48 @@ function dt({ api: n, className: b }) {
|
|
|
551
552
|
{
|
|
552
553
|
className: "px-3 py-1.5 text-slate-600 dark:text-slate-300",
|
|
553
554
|
"data-obligations-owner": !0,
|
|
554
|
-
children:
|
|
555
|
+
children: fe(e)
|
|
555
556
|
}
|
|
556
557
|
),
|
|
557
558
|
s === "inbound" && /* @__PURE__ */ t("td", { className: "px-3 py-1.5 text-right", children: /* @__PURE__ */ t(
|
|
558
|
-
|
|
559
|
+
Je,
|
|
559
560
|
{
|
|
560
|
-
open:
|
|
561
|
-
onToggle: () => P((
|
|
561
|
+
open: E,
|
|
562
|
+
onToggle: () => P((ye) => ye === e.id ? null : e.id)
|
|
562
563
|
}
|
|
563
564
|
) }),
|
|
564
|
-
S && /* @__PURE__ */
|
|
565
|
+
S && /* @__PURE__ */ r("td", { className: "px-3 py-1.5 text-right", children: [
|
|
566
|
+
k && e.can_resend !== !1 && /* @__PURE__ */ t(Ue, { obligationId: e.id }),
|
|
567
|
+
k && e.can_send_current === !0 && /* @__PURE__ */ t(
|
|
568
|
+
Re,
|
|
569
|
+
{
|
|
570
|
+
obligationId: e.id,
|
|
571
|
+
api: e.api,
|
|
572
|
+
className: "ml-2",
|
|
573
|
+
onSent: () => {
|
|
574
|
+
p.invalidateQueries({
|
|
575
|
+
queryKey: ["integration-obligations", "summary"]
|
|
576
|
+
}), p.invalidateQueries({
|
|
577
|
+
queryKey: ["integration-obligations", "list"]
|
|
578
|
+
});
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
)
|
|
582
|
+
] })
|
|
565
583
|
]
|
|
566
584
|
}
|
|
567
585
|
),
|
|
568
|
-
|
|
586
|
+
E && /* @__PURE__ */ t(
|
|
569
587
|
"tr",
|
|
570
588
|
{
|
|
571
589
|
className: "border-b border-slate-100 dark:border-border/60",
|
|
572
590
|
children: /* @__PURE__ */ t(
|
|
573
591
|
"td",
|
|
574
592
|
{
|
|
575
|
-
colSpan:
|
|
593
|
+
colSpan: ke,
|
|
576
594
|
className: "bg-slate-50 px-3 py-2 dark:bg-muted",
|
|
577
595
|
"data-obligations-detail": !0,
|
|
578
|
-
children:
|
|
596
|
+
children: z ? /* @__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: z }) : /* @__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." })
|
|
579
597
|
}
|
|
580
598
|
)
|
|
581
599
|
},
|
|
@@ -584,21 +602,21 @@ function dt({ api: n, className: b }) {
|
|
|
584
602
|
] }, e.id);
|
|
585
603
|
}) })
|
|
586
604
|
] }),
|
|
587
|
-
|
|
605
|
+
_ > q && /* @__PURE__ */ r("div", { className: "flex items-center justify-between border-t border-slate-200 px-3 py-1.5 text-[11px] text-slate-400 dark:border-border dark:text-muted-foreground", children: [
|
|
588
606
|
/* @__PURE__ */ r("span", { children: [
|
|
589
|
-
(
|
|
607
|
+
(u - 1) * q + 1,
|
|
590
608
|
"–",
|
|
591
|
-
Math.min(
|
|
609
|
+
Math.min(u * q, _),
|
|
592
610
|
" of ",
|
|
593
|
-
|
|
611
|
+
_
|
|
594
612
|
] }),
|
|
595
613
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
596
614
|
/* @__PURE__ */ t(
|
|
597
615
|
"button",
|
|
598
616
|
{
|
|
599
617
|
type: "button",
|
|
600
|
-
disabled:
|
|
601
|
-
onClick: () =>
|
|
618
|
+
disabled: u <= 1,
|
|
619
|
+
onClick: () => O((e) => Math.max(1, e - 1)),
|
|
602
620
|
className: "rounded border border-slate-200 px-2 py-0.5 disabled:opacity-40 dark:border-border",
|
|
603
621
|
children: "Prev"
|
|
604
622
|
}
|
|
@@ -607,8 +625,8 @@ function dt({ api: n, className: b }) {
|
|
|
607
625
|
"button",
|
|
608
626
|
{
|
|
609
627
|
type: "button",
|
|
610
|
-
disabled:
|
|
611
|
-
onClick: () =>
|
|
628
|
+
disabled: u * q >= _,
|
|
629
|
+
onClick: () => O((e) => e + 1),
|
|
612
630
|
className: "rounded border border-slate-200 px-2 py-0.5 disabled:opacity-40 dark:border-border",
|
|
613
631
|
children: "Next"
|
|
614
632
|
}
|
|
@@ -618,10 +636,10 @@ function dt({ api: n, className: b }) {
|
|
|
618
636
|
]
|
|
619
637
|
}
|
|
620
638
|
),
|
|
621
|
-
/* @__PURE__ */ t(
|
|
639
|
+
/* @__PURE__ */ t(Qe, {})
|
|
622
640
|
] });
|
|
623
641
|
}
|
|
624
642
|
export {
|
|
625
|
-
|
|
626
|
-
|
|
643
|
+
mt as IntegrationObligationsView,
|
|
644
|
+
oe as roleForTone
|
|
627
645
|
};
|