@nivaro/react 0.3.103 → 0.3.105
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 +15 -3
- package/dist/shared/components/CollectionBrowserView.js +1694 -1639
- package/dist/shared/components/ItemEditForm.js +2867 -2845
- package/dist/shared/components/imports/CollectionImportPanel.js +483 -459
- package/dist/shared/components/integrations/IntegrationStatusLines.js +71 -68
- package/dist/shared/components/item-edit/InlineTableField.js +88 -88
- package/dist/shared/components/item-edit/UserChip.js +38 -38
- package/dist/shared/components/layout-editor/DesignNode.js +16 -14
- package/dist/shared/components/layout-editor/LayoutEditor.js +445 -441
- package/dist/shared/components/layout-editor/inspector/Inspector.js +18 -18
- package/dist/shared/components/layout-editor/inspector/SlotInspector.js +80 -52
- package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
- package/dist/shared/components/layout-editor/settings/ButtonsSection.js +54 -26
- package/dist/shared/components/layout-editor/settings/settings-registry.js +23 -15
- package/dist/shared/components/layout-editor/useLayoutDraft.js +211 -196
- package/dist/shared/components/panels/ExternalRequestsChip.js +141 -122
- package/dist/shared/components/quick-filters/QuickFilterBarEditor.js +334 -0
- package/dist/shared/components/quick-filters/QuickFilterFieldPicker.js +151 -0
- package/dist/shared/components/quick-filters/QuickFilterForm.js +371 -0
- package/dist/shared/components/quick-filters/config.js +63 -0
- package/dist/shared/components/quick-filters/facets.js +55 -0
- package/dist/shared/components/quick-filters/useQuickFilterEditing.js +95 -0
- package/dist/shared/lib/entry-config.js +7 -7
- package/dist/shared/lib/integration-chip.js +10 -6
- package/dist/shared/lib/owners-header-tile.js +63 -0
- package/package.json +1 -1
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as o, jsxs as u } from "react/jsx-runtime";
|
|
2
2
|
import { useQuery as V, useQueryClient as w, useMutation as B } from "@tanstack/react-query";
|
|
3
3
|
import { RotateCcw as F, RefreshCw as v, Eye as L, Loader2 as Q, Send as T } from "lucide-react";
|
|
4
4
|
import { useState as A } from "react";
|
|
5
5
|
import { toast as y } from "sonner";
|
|
6
6
|
import { useNivaroClient as S } from "../../context.js";
|
|
7
|
-
import { get as
|
|
8
|
-
import { bannerLines as
|
|
9
|
-
import { requestTransitionRun as
|
|
7
|
+
import { get as I, post as K } from "../../lib/commands.js";
|
|
8
|
+
import { bannerLines as P } from "../../lib/obligation-banner.js";
|
|
9
|
+
import { requestTransitionRun as D } from "../../lib/run-transition.js";
|
|
10
10
|
import { cn as f } from "../../lib/utils.js";
|
|
11
|
-
import { colorPair as
|
|
11
|
+
import { colorPair as E } from "../QueryTable.js";
|
|
12
12
|
import { roleForTone as O } from "./IntegrationObligationsView.js";
|
|
13
13
|
import { SendCurrentDataButton as M } from "./SendCurrentData.js";
|
|
14
14
|
function U({
|
|
15
15
|
obligationId: d,
|
|
16
16
|
collection: i,
|
|
17
17
|
itemId: m,
|
|
18
|
-
enabled:
|
|
18
|
+
enabled: r = !0
|
|
19
19
|
}) {
|
|
20
|
-
const e = S(), b = w(), [
|
|
20
|
+
const e = S(), b = w(), [t, c] = A(!1), l = B({
|
|
21
21
|
mutationFn: () => e.request(
|
|
22
|
-
|
|
22
|
+
K(`/integration-obligations/${d}/send`)
|
|
23
23
|
),
|
|
24
|
-
onSuccess: (
|
|
24
|
+
onSuccess: (s) => {
|
|
25
25
|
var a;
|
|
26
|
-
y.message(((a =
|
|
26
|
+
y.message(((a = s == null ? void 0 : s.data) == null ? void 0 : a.detail) ?? "Sent"), b.invalidateQueries({
|
|
27
27
|
queryKey: ["integration-obligations", "record", i, String(m)]
|
|
28
28
|
});
|
|
29
29
|
},
|
|
30
|
-
onError: (
|
|
31
|
-
const a =
|
|
30
|
+
onError: (s) => {
|
|
31
|
+
const a = s == null ? void 0 : s.response;
|
|
32
32
|
y.error((a == null ? void 0 : a.error) ?? "Send now failed", { duration: 8e3 });
|
|
33
33
|
},
|
|
34
34
|
onSettled: () => c(!1)
|
|
@@ -38,33 +38,33 @@ function U({
|
|
|
38
38
|
{
|
|
39
39
|
type: "button",
|
|
40
40
|
"data-obligation-send-now": !0,
|
|
41
|
-
"data-obligation-send-now-enabled":
|
|
42
|
-
disabled:
|
|
43
|
-
title:
|
|
41
|
+
"data-obligation-send-now-enabled": r,
|
|
42
|
+
disabled: l.isPending || !r,
|
|
43
|
+
title: r ? "Send the stored request again, unchanged (admins)" : "Remediation is off for this deployment — an admin turns it on under Integrations › Remediation, then this sends from here",
|
|
44
44
|
onClick: () => {
|
|
45
|
-
if (!
|
|
45
|
+
if (!t) {
|
|
46
46
|
c(!0);
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
|
-
|
|
49
|
+
l.mutate();
|
|
50
50
|
},
|
|
51
51
|
className: f(
|
|
52
52
|
"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",
|
|
53
|
-
|
|
53
|
+
t ? "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"
|
|
54
54
|
),
|
|
55
55
|
children: [
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
l.isPending ? /* @__PURE__ */ o(Q, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ o(T, { className: "h-3 w-3" }),
|
|
57
|
+
t ? "Confirm send?" : "Send now"
|
|
58
58
|
]
|
|
59
59
|
}
|
|
60
60
|
);
|
|
61
61
|
}
|
|
62
62
|
function ae(d, i) {
|
|
63
|
-
var e, b;
|
|
64
|
-
const m = S(),
|
|
63
|
+
var e, b, t;
|
|
64
|
+
const m = S(), r = V({
|
|
65
65
|
queryKey: ["integration-obligations", "record", d, String(i)],
|
|
66
66
|
queryFn: () => m.request(
|
|
67
|
-
|
|
67
|
+
I(`/integration-obligations/record/${d}/${encodeURIComponent(String(i))}`)
|
|
68
68
|
),
|
|
69
69
|
enabled: !!d && !!i,
|
|
70
70
|
staleTime: 3e4,
|
|
@@ -73,9 +73,12 @@ function ae(d, i) {
|
|
|
73
73
|
retry: !1
|
|
74
74
|
});
|
|
75
75
|
return {
|
|
76
|
-
...
|
|
77
|
-
lines:
|
|
78
|
-
remediationEnabled: ((b =
|
|
76
|
+
...r,
|
|
77
|
+
lines: P(((e = r.data) == null ? void 0 : e.data) ?? []),
|
|
78
|
+
remediationEnabled: ((b = r.data) == null ? void 0 : b.remediation_enabled) === !0,
|
|
79
|
+
/** Obligation rows on the record (null until answered). */
|
|
80
|
+
obligationCount: r.data ? (r.data.data ?? []).length : null,
|
|
81
|
+
partnerIntegration: (t = r.data) == null ? void 0 : t.partner_integration
|
|
79
82
|
};
|
|
80
83
|
}
|
|
81
84
|
const h = "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-600 transition-colors hover:border-slate-300 hover:bg-slate-50 disabled:opacity-60 dark:border-border dark:text-muted-foreground dark:hover:bg-muted";
|
|
@@ -83,20 +86,20 @@ function de({
|
|
|
83
86
|
collection: d,
|
|
84
87
|
itemId: i,
|
|
85
88
|
lines: m,
|
|
86
|
-
remediationEnabled:
|
|
89
|
+
remediationEnabled: r,
|
|
87
90
|
actions: e
|
|
88
91
|
}) {
|
|
89
92
|
const b = w();
|
|
90
|
-
return m.length === 0 ? null : /* @__PURE__ */
|
|
93
|
+
return m.length === 0 ? null : /* @__PURE__ */ o("div", { className: "space-y-1.5", "data-integration-lines": !0, children: m.map((t) => {
|
|
91
94
|
var k;
|
|
92
|
-
const c = O(
|
|
95
|
+
const c = O(t.tone), [l, s] = c ? E(c) : [null, null], a = t.outcome === "failed" || t.outcome === "missing" || t.outcome === "overdue", C = a && t.can_resend !== !1, N = a && t.can_send_current === !0, g = (k = e == null ? void 0 : e.newestSubmissionByApi) == null ? void 0 : k.get(t.api.toLowerCase()), p = t.submission_id ?? (g == null ? void 0 : g.id) ?? null, _ = !!(e != null && e.onRetry) && p != null && (t.outcome === "failed" || (g == null ? void 0 : g.status) === "failed"), q = !!(e != null && e.onView) && p != null, R = !!t.transition_id && !!t.transition_label && a, $ = !!(e != null && e.onCheck) && (t.outcome === "pending" || t.outcome === "overdue"), j = () => {
|
|
93
96
|
var x;
|
|
94
|
-
if (!
|
|
97
|
+
if (!D({
|
|
95
98
|
collection: d,
|
|
96
99
|
item: String(i),
|
|
97
|
-
transition_id:
|
|
100
|
+
transition_id: t.transition_id
|
|
98
101
|
})) {
|
|
99
|
-
y.error(`Open the record to run “${
|
|
102
|
+
y.error(`Open the record to run “${t.transition_label}”`);
|
|
100
103
|
return;
|
|
101
104
|
}
|
|
102
105
|
(x = e == null ? void 0 : e.onRanTransition) == null || x.call(e);
|
|
@@ -104,68 +107,68 @@ function de({
|
|
|
104
107
|
return /* @__PURE__ */ u(
|
|
105
108
|
"div",
|
|
106
109
|
{
|
|
107
|
-
"data-integration-line":
|
|
108
|
-
"data-integration-outcome":
|
|
109
|
-
style:
|
|
110
|
+
"data-integration-line": t.api,
|
|
111
|
+
"data-integration-outcome": t.outcome,
|
|
112
|
+
style: l ? { "--obt": l, "--obtd": s } : void 0,
|
|
110
113
|
className: f(
|
|
111
114
|
"flex items-start gap-2 rounded-lg border border-slate-200 bg-white px-3 py-1.5 text-[12px] dark:border-border dark:bg-card",
|
|
112
|
-
|
|
115
|
+
l && "border-t-2 border-t-[color:var(--obt)] dark:border-t-[color:var(--obtd)]"
|
|
113
116
|
),
|
|
114
117
|
children: [
|
|
115
|
-
/* @__PURE__ */
|
|
118
|
+
/* @__PURE__ */ o(
|
|
116
119
|
"span",
|
|
117
120
|
{
|
|
118
121
|
"aria-hidden": !0,
|
|
119
122
|
className: f(
|
|
120
123
|
"mt-1 h-1.5 w-1.5 shrink-0 rounded-full",
|
|
121
|
-
|
|
124
|
+
l ? "bg-[color:var(--obt)] dark:bg-[color:var(--obtd)]" : "bg-slate-400 dark:bg-slate-600"
|
|
122
125
|
)
|
|
123
126
|
}
|
|
124
127
|
),
|
|
125
128
|
/* @__PURE__ */ u("p", { className: "min-w-0 flex-1 leading-5 text-slate-700 dark:text-slate-200", children: [
|
|
126
129
|
/* @__PURE__ */ u("span", { className: "font-semibold text-slate-800 dark:text-foreground", children: [
|
|
127
|
-
|
|
130
|
+
t.api,
|
|
128
131
|
":"
|
|
129
132
|
] }),
|
|
130
133
|
" ",
|
|
131
|
-
/* @__PURE__ */
|
|
134
|
+
/* @__PURE__ */ o(
|
|
132
135
|
"span",
|
|
133
136
|
{
|
|
134
137
|
"data-integration-reason": !0,
|
|
135
|
-
className:
|
|
136
|
-
children:
|
|
138
|
+
className: l ? "text-[color:var(--obt)] dark:text-[color:var(--obtd)]" : "text-slate-500 dark:text-muted-foreground",
|
|
139
|
+
children: t.text
|
|
137
140
|
}
|
|
138
141
|
)
|
|
139
142
|
] }),
|
|
140
143
|
/* @__PURE__ */ u("span", { className: "ml-auto flex shrink-0 flex-wrap items-center justify-end gap-1", children: [
|
|
141
|
-
|
|
144
|
+
R && /* @__PURE__ */ u(
|
|
142
145
|
"button",
|
|
143
146
|
{
|
|
144
147
|
type: "button",
|
|
145
148
|
"data-integration-action": "rerun",
|
|
146
149
|
onClick: j,
|
|
147
|
-
title: `Fix what ${
|
|
150
|
+
title: `Fix what ${t.api} rejected, then run “${t.transition_label}” again — it re-sends from the current values`,
|
|
148
151
|
className: f(h, "border-nvr-cyan/40 text-nvr-cyan hover:bg-nvr-cyan/10"),
|
|
149
152
|
children: [
|
|
150
|
-
/* @__PURE__ */
|
|
153
|
+
/* @__PURE__ */ o(F, { className: "h-3 w-3" }),
|
|
151
154
|
"Re-run ",
|
|
152
|
-
|
|
155
|
+
t.transition_label
|
|
153
156
|
]
|
|
154
157
|
}
|
|
155
158
|
),
|
|
156
|
-
|
|
159
|
+
_ && /* @__PURE__ */ u(
|
|
157
160
|
"button",
|
|
158
161
|
{
|
|
159
162
|
type: "button",
|
|
160
163
|
"data-integration-action": "retry",
|
|
161
164
|
onClick: () => {
|
|
162
|
-
var
|
|
163
|
-
return (
|
|
165
|
+
var n;
|
|
166
|
+
return (n = e == null ? void 0 : e.onRetry) == null ? void 0 : n.call(e, p);
|
|
164
167
|
},
|
|
165
168
|
title: "Send the same request again, unchanged — for a partner that was down, not for data it rejected",
|
|
166
169
|
className: h,
|
|
167
170
|
children: [
|
|
168
|
-
/* @__PURE__ */
|
|
171
|
+
/* @__PURE__ */ o(v, { className: "h-3 w-3" }),
|
|
169
172
|
"Retry"
|
|
170
173
|
]
|
|
171
174
|
}
|
|
@@ -176,61 +179,61 @@ function de({
|
|
|
176
179
|
type: "button",
|
|
177
180
|
"data-integration-action": "check",
|
|
178
181
|
onClick: () => {
|
|
179
|
-
var
|
|
180
|
-
return (
|
|
182
|
+
var n;
|
|
183
|
+
return (n = e == null ? void 0 : e.onCheck) == null ? void 0 : n.call(e);
|
|
181
184
|
},
|
|
182
185
|
title: "Ask again whether the partner has acknowledged it",
|
|
183
186
|
className: h,
|
|
184
187
|
children: [
|
|
185
|
-
/* @__PURE__ */
|
|
188
|
+
/* @__PURE__ */ o(v, { className: "h-3 w-3" }),
|
|
186
189
|
"Check now"
|
|
187
190
|
]
|
|
188
191
|
}
|
|
189
192
|
),
|
|
190
|
-
|
|
193
|
+
q && /* @__PURE__ */ u(
|
|
191
194
|
"button",
|
|
192
195
|
{
|
|
193
196
|
type: "button",
|
|
194
197
|
"data-integration-action": "view",
|
|
195
198
|
onClick: () => {
|
|
196
|
-
var
|
|
197
|
-
return (
|
|
199
|
+
var n;
|
|
200
|
+
return (n = e == null ? void 0 : e.onView) == null ? void 0 : n.call(e, p);
|
|
198
201
|
},
|
|
199
202
|
title: "Show the request and the reply",
|
|
200
203
|
className: h,
|
|
201
204
|
children: [
|
|
202
|
-
/* @__PURE__ */
|
|
203
|
-
|
|
205
|
+
/* @__PURE__ */ o(L, { className: "h-3 w-3" }),
|
|
206
|
+
t.outcome === "failed" ? "View error" : "View request"
|
|
204
207
|
]
|
|
205
208
|
}
|
|
206
209
|
),
|
|
207
|
-
|
|
210
|
+
C && /* @__PURE__ */ o(
|
|
208
211
|
U,
|
|
209
212
|
{
|
|
210
|
-
obligationId:
|
|
213
|
+
obligationId: t.obligation_id,
|
|
211
214
|
collection: d,
|
|
212
215
|
itemId: i,
|
|
213
|
-
enabled:
|
|
216
|
+
enabled: r
|
|
214
217
|
}
|
|
215
218
|
),
|
|
216
|
-
|
|
219
|
+
N && /* @__PURE__ */ o(
|
|
217
220
|
M,
|
|
218
221
|
{
|
|
219
|
-
obligationId:
|
|
220
|
-
api:
|
|
221
|
-
enabled:
|
|
222
|
+
obligationId: t.obligation_id,
|
|
223
|
+
api: t.api,
|
|
224
|
+
enabled: r,
|
|
222
225
|
onSent: () => {
|
|
223
|
-
var
|
|
226
|
+
var n;
|
|
224
227
|
b.invalidateQueries({
|
|
225
228
|
queryKey: ["integration-obligations", "record", d, String(i)]
|
|
226
|
-
}), (
|
|
229
|
+
}), (n = e == null ? void 0 : e.onCheck) == null || n.call(e);
|
|
227
230
|
}
|
|
228
231
|
}
|
|
229
232
|
)
|
|
230
233
|
] })
|
|
231
234
|
]
|
|
232
235
|
},
|
|
233
|
-
|
|
236
|
+
t.api
|
|
234
237
|
);
|
|
235
238
|
}) });
|
|
236
239
|
}
|