@nivaro/react 0.3.64 → 0.3.66
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 +62 -8
- package/dist/shared/components/CollectionBrowserView.js +3127 -3204
- package/dist/shared/components/ConformanceView.js +235 -221
- package/dist/shared/components/DataTable.js +478 -459
- package/dist/shared/components/ItemEditForm.js +4842 -4500
- package/dist/shared/components/MyWorkView.js +124 -113
- package/dist/shared/components/PageRenderer.js +146 -138
- package/dist/shared/components/ProfileView.js +483 -472
- package/dist/shared/components/RecordDrilldownSheet.js +73 -65
- package/dist/shared/components/ReportView.js +1100 -1094
- package/dist/shared/components/bulk/BulkActionButtons.js +72 -72
- package/dist/shared/components/bulk/BulkCompareButton.js +62 -0
- package/dist/shared/components/bulk/BulkFieldUpdate.js +114 -103
- package/dist/shared/components/bulk/BulkFieldUpdateButton.js +73 -0
- package/dist/shared/components/bulk/MessageStakeholders.js +235 -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 +1535 -1440
- 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/GroupSection.js +555 -538
- package/dist/shared/components/item-edit/InlineTableField.js +2903 -2816
- package/dist/shared/components/item-edit/M2MCombobox.js +407 -338
- package/dist/shared/components/item-edit/MidairCollisionDialog.js +367 -116
- 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 +398 -364
- package/dist/shared/components/item-edit/SummaryPanel.js +146 -144
- package/dist/shared/components/item-edit/UserChip.js +264 -229
- package/dist/shared/components/item-edit/cascade-clear-notice.js +56 -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/header-path-preview.js +52 -0
- package/dist/shared/components/item-edit/line-merge.js +84 -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 +27 -16
- package/dist/shared/components/item-edit/rail-width.js +8 -0
- package/dist/shared/components/monitoring/InactiveUserLinksView.js +126 -124
- 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 +1522 -1347
- 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/quick-filter-cascade.js +29 -19
- package/dist/shared/lib/sort-cycle.js +6 -0
- package/dist/shared/lib/summary-mode.js +59 -41
- package/package.json +1 -1
|
@@ -1,71 +1,72 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
2
|
-
import { useQuery as
|
|
3
|
-
import { RotateCcw as
|
|
1
|
+
import { jsx as n, jsxs as u } from "react/jsx-runtime";
|
|
2
|
+
import { useQuery as V, useQueryClient as w, useMutation as B } from "@tanstack/react-query";
|
|
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
|
-
import { useNivaroClient as
|
|
7
|
-
import { get as
|
|
8
|
-
import { bannerLines as
|
|
9
|
-
import { requestTransitionRun as
|
|
6
|
+
import { useNivaroClient as S } from "../../context.js";
|
|
7
|
+
import { get as K, post as P } from "../../lib/commands.js";
|
|
8
|
+
import { bannerLines as D } from "../../lib/obligation-banner.js";
|
|
9
|
+
import { requestTransitionRun as E } from "../../lib/run-transition.js";
|
|
10
10
|
import { cn as f } from "../../lib/utils.js";
|
|
11
11
|
import { colorPair as I } from "../QueryTable.js";
|
|
12
|
-
import { roleForTone as
|
|
13
|
-
|
|
12
|
+
import { roleForTone as O } from "./IntegrationObligationsView.js";
|
|
13
|
+
import { SendCurrentDataButton as M } from "./SendCurrentData.js";
|
|
14
|
+
function U({
|
|
14
15
|
obligationId: d,
|
|
15
|
-
collection:
|
|
16
|
+
collection: i,
|
|
16
17
|
itemId: m,
|
|
17
18
|
enabled: o = !0
|
|
18
19
|
}) {
|
|
19
|
-
const e =
|
|
20
|
+
const e = S(), b = w(), [r, c] = A(!1), s = B({
|
|
20
21
|
mutationFn: () => e.request(
|
|
21
|
-
|
|
22
|
+
P(`/integration-obligations/${d}/send`)
|
|
22
23
|
),
|
|
23
|
-
onSuccess: (
|
|
24
|
-
var
|
|
25
|
-
y.message(((
|
|
26
|
-
queryKey: ["integration-obligations", "record",
|
|
24
|
+
onSuccess: (l) => {
|
|
25
|
+
var a;
|
|
26
|
+
y.message(((a = l == null ? void 0 : l.data) == null ? void 0 : a.detail) ?? "Sent"), b.invalidateQueries({
|
|
27
|
+
queryKey: ["integration-obligations", "record", i, String(m)]
|
|
27
28
|
});
|
|
28
29
|
},
|
|
29
|
-
onError: (
|
|
30
|
-
const
|
|
31
|
-
y.error((
|
|
30
|
+
onError: (l) => {
|
|
31
|
+
const a = l == null ? void 0 : l.response;
|
|
32
|
+
y.error((a == null ? void 0 : a.error) ?? "Send now failed", { duration: 8e3 });
|
|
32
33
|
},
|
|
33
|
-
onSettled: () =>
|
|
34
|
+
onSettled: () => c(!1)
|
|
34
35
|
});
|
|
35
|
-
return /* @__PURE__ */
|
|
36
|
+
return /* @__PURE__ */ u(
|
|
36
37
|
"button",
|
|
37
38
|
{
|
|
38
39
|
type: "button",
|
|
39
40
|
"data-obligation-send-now": !0,
|
|
40
41
|
"data-obligation-send-now-enabled": o,
|
|
41
|
-
disabled:
|
|
42
|
-
title: o ? "
|
|
42
|
+
disabled: s.isPending || !o,
|
|
43
|
+
title: o ? "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",
|
|
43
44
|
onClick: () => {
|
|
44
|
-
if (!
|
|
45
|
-
|
|
45
|
+
if (!r) {
|
|
46
|
+
c(!0);
|
|
46
47
|
return;
|
|
47
48
|
}
|
|
48
|
-
|
|
49
|
+
s.mutate();
|
|
49
50
|
},
|
|
50
51
|
className: f(
|
|
51
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",
|
|
52
|
-
|
|
53
|
+
r ? "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"
|
|
53
54
|
),
|
|
54
55
|
children: [
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
s.isPending ? /* @__PURE__ */ n(Q, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ n(T, { className: "h-3 w-3" }),
|
|
57
|
+
r ? "Confirm send?" : "Send now"
|
|
57
58
|
]
|
|
58
59
|
}
|
|
59
60
|
);
|
|
60
61
|
}
|
|
61
|
-
function
|
|
62
|
-
var e,
|
|
63
|
-
const m =
|
|
64
|
-
queryKey: ["integration-obligations", "record", d, String(
|
|
62
|
+
function ae(d, i) {
|
|
63
|
+
var e, b;
|
|
64
|
+
const m = S(), o = V({
|
|
65
|
+
queryKey: ["integration-obligations", "record", d, String(i)],
|
|
65
66
|
queryFn: () => m.request(
|
|
66
|
-
|
|
67
|
+
K(`/integration-obligations/record/${d}/${encodeURIComponent(String(i))}`)
|
|
67
68
|
),
|
|
68
|
-
enabled: !!d && !!
|
|
69
|
+
enabled: !!d && !!i,
|
|
69
70
|
staleTime: 3e4,
|
|
70
71
|
// A 403 means this viewer may not read the record's integrations — that
|
|
71
72
|
// is an answer, not something to retry.
|
|
@@ -73,41 +74,42 @@ function te(d, s) {
|
|
|
73
74
|
});
|
|
74
75
|
return {
|
|
75
76
|
...o,
|
|
76
|
-
lines:
|
|
77
|
-
remediationEnabled: ((
|
|
77
|
+
lines: D(((e = o.data) == null ? void 0 : e.data) ?? []),
|
|
78
|
+
remediationEnabled: ((b = o.data) == null ? void 0 : b.remediation_enabled) === !0
|
|
78
79
|
};
|
|
79
80
|
}
|
|
80
|
-
const
|
|
81
|
-
function
|
|
81
|
+
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";
|
|
82
|
+
function de({
|
|
82
83
|
collection: d,
|
|
83
|
-
itemId:
|
|
84
|
+
itemId: i,
|
|
84
85
|
lines: m,
|
|
85
86
|
remediationEnabled: o,
|
|
86
87
|
actions: e
|
|
87
88
|
}) {
|
|
88
|
-
|
|
89
|
+
const b = w();
|
|
90
|
+
return m.length === 0 ? null : /* @__PURE__ */ n("div", { className: "space-y-1.5", "data-integration-lines": !0, children: m.map((r) => {
|
|
89
91
|
var k;
|
|
90
|
-
const
|
|
92
|
+
const c = O(r.tone), [s, l] = c ? I(c) : [null, null], a = r.outcome === "failed" || r.outcome === "missing" || r.outcome === "overdue", N = a && r.can_resend !== !1, C = a && r.can_send_current === !0, g = (k = e == null ? void 0 : e.newestSubmissionByApi) == null ? void 0 : k.get(r.api.toLowerCase()), p = r.submission_id ?? (g == null ? void 0 : g.id) ?? null, q = !!(e != null && e.onRetry) && p != null && (r.outcome === "failed" || (g == null ? void 0 : g.status) === "failed"), R = !!(e != null && e.onView) && p != null, _ = !!r.transition_id && !!r.transition_label && a, $ = !!(e != null && e.onCheck) && (r.outcome === "pending" || r.outcome === "overdue"), j = () => {
|
|
91
93
|
var x;
|
|
92
|
-
if (!
|
|
94
|
+
if (!E({
|
|
93
95
|
collection: d,
|
|
94
|
-
item: String(
|
|
95
|
-
transition_id:
|
|
96
|
+
item: String(i),
|
|
97
|
+
transition_id: r.transition_id
|
|
96
98
|
})) {
|
|
97
|
-
y.error(`Open the record to run “${
|
|
99
|
+
y.error(`Open the record to run “${r.transition_label}”`);
|
|
98
100
|
return;
|
|
99
101
|
}
|
|
100
102
|
(x = e == null ? void 0 : e.onRanTransition) == null || x.call(e);
|
|
101
103
|
};
|
|
102
|
-
return /* @__PURE__ */
|
|
104
|
+
return /* @__PURE__ */ u(
|
|
103
105
|
"div",
|
|
104
106
|
{
|
|
105
|
-
"data-integration-line":
|
|
106
|
-
"data-integration-outcome":
|
|
107
|
-
style:
|
|
107
|
+
"data-integration-line": r.api,
|
|
108
|
+
"data-integration-outcome": r.outcome,
|
|
109
|
+
style: s ? { "--obt": s, "--obtd": l } : void 0,
|
|
108
110
|
className: f(
|
|
109
111
|
"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",
|
|
110
|
-
|
|
112
|
+
s && "border-t-2 border-t-[color:var(--obt)] dark:border-t-[color:var(--obtd)]"
|
|
111
113
|
),
|
|
112
114
|
children: [
|
|
113
115
|
/* @__PURE__ */ n(
|
|
@@ -116,13 +118,13 @@ function re({
|
|
|
116
118
|
"aria-hidden": !0,
|
|
117
119
|
className: f(
|
|
118
120
|
"mt-1 h-1.5 w-1.5 shrink-0 rounded-full",
|
|
119
|
-
|
|
121
|
+
s ? "bg-[color:var(--obt)] dark:bg-[color:var(--obtd)]" : "bg-slate-400 dark:bg-slate-600"
|
|
120
122
|
)
|
|
121
123
|
}
|
|
122
124
|
),
|
|
123
|
-
/* @__PURE__ */
|
|
124
|
-
/* @__PURE__ */
|
|
125
|
-
|
|
125
|
+
/* @__PURE__ */ u("p", { className: "min-w-0 flex-1 leading-5 text-slate-700 dark:text-slate-200", children: [
|
|
126
|
+
/* @__PURE__ */ u("span", { className: "font-semibold text-slate-800 dark:text-foreground", children: [
|
|
127
|
+
r.api,
|
|
126
128
|
":"
|
|
127
129
|
] }),
|
|
128
130
|
" ",
|
|
@@ -130,95 +132,109 @@ function re({
|
|
|
130
132
|
"span",
|
|
131
133
|
{
|
|
132
134
|
"data-integration-reason": !0,
|
|
133
|
-
className:
|
|
134
|
-
children:
|
|
135
|
+
className: s ? "text-[color:var(--obt)] dark:text-[color:var(--obtd)]" : "text-slate-500 dark:text-muted-foreground",
|
|
136
|
+
children: r.text
|
|
135
137
|
}
|
|
136
138
|
)
|
|
137
139
|
] }),
|
|
138
|
-
/* @__PURE__ */
|
|
139
|
-
|
|
140
|
+
/* @__PURE__ */ u("span", { className: "ml-auto flex shrink-0 flex-wrap items-center justify-end gap-1", children: [
|
|
141
|
+
_ && /* @__PURE__ */ u(
|
|
140
142
|
"button",
|
|
141
143
|
{
|
|
142
144
|
type: "button",
|
|
143
145
|
"data-integration-action": "rerun",
|
|
144
|
-
onClick:
|
|
145
|
-
title: `Fix what ${
|
|
146
|
-
className: f(
|
|
146
|
+
onClick: j,
|
|
147
|
+
title: `Fix what ${r.api} rejected, then run “${r.transition_label}” again — it re-sends from the current values`,
|
|
148
|
+
className: f(h, "border-nvr-cyan/40 text-nvr-cyan hover:bg-nvr-cyan/10"),
|
|
147
149
|
children: [
|
|
148
|
-
/* @__PURE__ */ n(
|
|
150
|
+
/* @__PURE__ */ n(F, { className: "h-3 w-3" }),
|
|
149
151
|
"Re-run ",
|
|
150
|
-
|
|
152
|
+
r.transition_label
|
|
151
153
|
]
|
|
152
154
|
}
|
|
153
155
|
),
|
|
154
|
-
|
|
156
|
+
q && /* @__PURE__ */ u(
|
|
155
157
|
"button",
|
|
156
158
|
{
|
|
157
159
|
type: "button",
|
|
158
160
|
"data-integration-action": "retry",
|
|
159
161
|
onClick: () => {
|
|
160
|
-
var
|
|
161
|
-
return (
|
|
162
|
+
var t;
|
|
163
|
+
return (t = e == null ? void 0 : e.onRetry) == null ? void 0 : t.call(e, p);
|
|
162
164
|
},
|
|
163
165
|
title: "Send the same request again, unchanged — for a partner that was down, not for data it rejected",
|
|
164
|
-
className:
|
|
166
|
+
className: h,
|
|
165
167
|
children: [
|
|
166
168
|
/* @__PURE__ */ n(v, { className: "h-3 w-3" }),
|
|
167
169
|
"Retry"
|
|
168
170
|
]
|
|
169
171
|
}
|
|
170
172
|
),
|
|
171
|
-
|
|
173
|
+
$ && /* @__PURE__ */ u(
|
|
172
174
|
"button",
|
|
173
175
|
{
|
|
174
176
|
type: "button",
|
|
175
177
|
"data-integration-action": "check",
|
|
176
178
|
onClick: () => {
|
|
177
|
-
var
|
|
178
|
-
return (
|
|
179
|
+
var t;
|
|
180
|
+
return (t = e == null ? void 0 : e.onCheck) == null ? void 0 : t.call(e);
|
|
179
181
|
},
|
|
180
182
|
title: "Ask again whether the partner has acknowledged it",
|
|
181
|
-
className:
|
|
183
|
+
className: h,
|
|
182
184
|
children: [
|
|
183
185
|
/* @__PURE__ */ n(v, { className: "h-3 w-3" }),
|
|
184
186
|
"Check now"
|
|
185
187
|
]
|
|
186
188
|
}
|
|
187
189
|
),
|
|
188
|
-
|
|
190
|
+
R && /* @__PURE__ */ u(
|
|
189
191
|
"button",
|
|
190
192
|
{
|
|
191
193
|
type: "button",
|
|
192
194
|
"data-integration-action": "view",
|
|
193
195
|
onClick: () => {
|
|
194
|
-
var
|
|
195
|
-
return (
|
|
196
|
+
var t;
|
|
197
|
+
return (t = e == null ? void 0 : e.onView) == null ? void 0 : t.call(e, p);
|
|
196
198
|
},
|
|
197
199
|
title: "Show the request and the reply",
|
|
198
|
-
className:
|
|
200
|
+
className: h,
|
|
199
201
|
children: [
|
|
200
|
-
/* @__PURE__ */ n(
|
|
201
|
-
|
|
202
|
+
/* @__PURE__ */ n(L, { className: "h-3 w-3" }),
|
|
203
|
+
r.outcome === "failed" ? "View error" : "View request"
|
|
202
204
|
]
|
|
203
205
|
}
|
|
204
206
|
),
|
|
205
|
-
|
|
206
|
-
|
|
207
|
+
N && /* @__PURE__ */ n(
|
|
208
|
+
U,
|
|
207
209
|
{
|
|
208
|
-
obligationId:
|
|
210
|
+
obligationId: r.obligation_id,
|
|
209
211
|
collection: d,
|
|
210
|
-
itemId:
|
|
212
|
+
itemId: i,
|
|
211
213
|
enabled: o
|
|
212
214
|
}
|
|
215
|
+
),
|
|
216
|
+
C && /* @__PURE__ */ n(
|
|
217
|
+
M,
|
|
218
|
+
{
|
|
219
|
+
obligationId: r.obligation_id,
|
|
220
|
+
api: r.api,
|
|
221
|
+
enabled: o,
|
|
222
|
+
onSent: () => {
|
|
223
|
+
var t;
|
|
224
|
+
b.invalidateQueries({
|
|
225
|
+
queryKey: ["integration-obligations", "record", d, String(i)]
|
|
226
|
+
}), (t = e == null ? void 0 : e.onCheck) == null || t.call(e);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
213
229
|
)
|
|
214
230
|
] })
|
|
215
231
|
]
|
|
216
232
|
},
|
|
217
|
-
|
|
233
|
+
r.api
|
|
218
234
|
);
|
|
219
235
|
}) });
|
|
220
236
|
}
|
|
221
237
|
export {
|
|
222
|
-
|
|
223
|
-
|
|
238
|
+
de as IntegrationStatusLines,
|
|
239
|
+
ae as useRecordObligations
|
|
224
240
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsxs as n, jsx as t, Fragment as M } from "react/jsx-runtime";
|
|
2
2
|
import { useQuery as L, useQueryClient as V } from "@tanstack/react-query";
|
|
3
|
-
import { Loader2 as Z,
|
|
3
|
+
import { Loader2 as Z, Send as X, CheckCircle2 as S, AlertTriangle as Q, Zap as Y, ChevronDown as I, ChevronRight as J, PencilLine as ee } from "lucide-react";
|
|
4
4
|
import { useState as W, useEffect as te } from "react";
|
|
5
5
|
import { useNivaroClient as R } from "../../context.js";
|
|
6
6
|
import { get as _ } from "../../lib/commands.js";
|
|
7
7
|
import { cn as y, formatRelative as ae, formatDateTime as re } from "../../lib/utils.js";
|
|
8
8
|
import { Popover as se, PopoverTrigger as ne, PopoverContent as le } from "../ui/popover.js";
|
|
9
|
-
function
|
|
9
|
+
function P(r) {
|
|
10
10
|
typeof window > "u" || window.dispatchEvent(new CustomEvent("nvr:record-focus", { detail: r }));
|
|
11
11
|
}
|
|
12
12
|
function A({
|
|
@@ -41,7 +41,7 @@ function A({
|
|
|
41
41
|
type: "button",
|
|
42
42
|
"data-preflight-jump-row": e.id,
|
|
43
43
|
onClick: () => {
|
|
44
|
-
o == null || o(),
|
|
44
|
+
o == null || o(), P({
|
|
45
45
|
collection: s,
|
|
46
46
|
item: h,
|
|
47
47
|
childCollection: l.collection,
|
|
@@ -66,7 +66,7 @@ function A({
|
|
|
66
66
|
type: "button",
|
|
67
67
|
"data-preflight-jump-field": l.field,
|
|
68
68
|
onClick: () => {
|
|
69
|
-
o == null || o(),
|
|
69
|
+
o == null || o(), P({ collection: s, item: h, field: l.field });
|
|
70
70
|
},
|
|
71
71
|
className: "mt-0.5 text-[11px] text-nvr-navy underline-offset-2 hover:underline dark:text-nvr-cyan",
|
|
72
72
|
children: "Go to the field"
|
|
@@ -171,9 +171,11 @@ function ie({
|
|
|
171
171
|
"after:absolute after:-inset-1.5 after:content-['']",
|
|
172
172
|
"text-white transition-[filter,transform] duration-150 ease-out hover:brightness-110 active:scale-90",
|
|
173
173
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan",
|
|
174
|
-
|
|
174
|
+
// Ready to send = a neutral send disc, never a green ✓ that reads
|
|
175
|
+
// as "approved / recommended" on an order button (army 11 a2 F2).
|
|
176
|
+
p === "ready" ? "h-3.5 w-3.5 bg-[#475569] dark:bg-[#64748b]" : p === "block" ? "h-4 min-w-4 px-1 bg-[#dc2626]" : "h-4 min-w-4 px-1 bg-[#b45309]"
|
|
175
177
|
),
|
|
176
|
-
children: p === "ready" ? /* @__PURE__ */ t(X, { className: "h-2
|
|
178
|
+
children: p === "ready" ? /* @__PURE__ */ t(X, { className: "h-2 w-2", strokeWidth: 3, "aria-hidden": !0 }) : g.length > 0 ? /* @__PURE__ */ t("span", { className: "text-[10px] font-semibold leading-none tabular-nums", children: g.length > 9 ? "9+" : g.length }) : /* @__PURE__ */ t("span", { className: "text-[10px] font-bold leading-none", children: "!" })
|
|
177
179
|
}
|
|
178
180
|
) : /* @__PURE__ */ n(
|
|
179
181
|
"button",
|
|
@@ -187,7 +189,7 @@ function ie({
|
|
|
187
189
|
),
|
|
188
190
|
"data-tip": $,
|
|
189
191
|
children: [
|
|
190
|
-
p === "ready" ? /* @__PURE__ */ t(
|
|
192
|
+
p === "ready" ? /* @__PURE__ */ t(S, { className: "h-3 w-3 shrink-0" }) : /* @__PURE__ */ t(Q, { className: "h-3 w-3 shrink-0" }),
|
|
191
193
|
/* @__PURE__ */ t("span", { className: "truncate", children: j }),
|
|
192
194
|
C && /* @__PURE__ */ t("span", { className: "shrink-0 opacity-70", children: C })
|
|
193
195
|
]
|
|
@@ -203,7 +205,7 @@ function ie({
|
|
|
203
205
|
(c == null ? void 0 : c.error) ?? "The check could not run.",
|
|
204
206
|
" Nothing is assumed ready."
|
|
205
207
|
] }) : g.length === 0 ? /* @__PURE__ */ n("p", { className: "mt-2 flex items-center gap-1.5 text-[12px] text-emerald-800 dark:text-emerald-300", children: [
|
|
206
|
-
/* @__PURE__ */ t(
|
|
208
|
+
/* @__PURE__ */ t(S, { className: "h-3.5 w-3.5" }),
|
|
207
209
|
O ? b.length > 0 ? `Nothing new to send: ${v(b)} already has these values.` : "Nothing goes to a partner from this record." : f.length > 0 ? "Nothing stands in the way." : "Everything it needs is filled in."
|
|
208
210
|
] }) : /* @__PURE__ */ t("div", { className: "mt-2", children: /* @__PURE__ */ t(
|
|
209
211
|
A,
|
|
@@ -432,5 +434,5 @@ function fe({
|
|
|
432
434
|
export {
|
|
433
435
|
fe as OutboundPreviewSection,
|
|
434
436
|
ie as PushReadinessChip,
|
|
435
|
-
|
|
437
|
+
P as focusRecordTarget
|
|
436
438
|
};
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { jsxs as a, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useQuery as x, useMutation as y } from "@tanstack/react-query";
|
|
3
|
+
import { Send as f, Loader2 as h, AlertTriangle as w } from "lucide-react";
|
|
4
|
+
import { useState as k } from "react";
|
|
5
|
+
import { toast as b } from "sonner";
|
|
6
|
+
import { useNivaroClient as N } from "../../context.js";
|
|
7
|
+
import { get as C, post as P } from "../../lib/commands.js";
|
|
8
|
+
import { cn as $ } from "../../lib/utils.js";
|
|
9
|
+
import { Popover as q, PopoverTrigger as T, PopoverContent as S } from "../ui/popover.js";
|
|
10
|
+
function j(o, t) {
|
|
11
|
+
return `This sends the record's current data${t != null && t.trim() ? ` (${t.trim()})` : ""} to ${o} now — not the original request.`;
|
|
12
|
+
}
|
|
13
|
+
function M({
|
|
14
|
+
obligationId: o,
|
|
15
|
+
api: t,
|
|
16
|
+
enabled: d = !0,
|
|
17
|
+
onSent: l,
|
|
18
|
+
className: v
|
|
19
|
+
}) {
|
|
20
|
+
var g;
|
|
21
|
+
const p = N(), [c, u] = k(!1), m = x({
|
|
22
|
+
queryKey: ["integration-obligations", "fresh-preview", o],
|
|
23
|
+
queryFn: () => p.request(
|
|
24
|
+
C(`/integration-obligations/${o}/fresh-preview`)
|
|
25
|
+
),
|
|
26
|
+
enabled: c,
|
|
27
|
+
// Always rebuilt when the confirm opens: the point is the CURRENT data.
|
|
28
|
+
staleTime: 0,
|
|
29
|
+
gcTime: 0,
|
|
30
|
+
retry: !1
|
|
31
|
+
}), r = (g = m.data) == null ? void 0 : g.data, s = y({
|
|
32
|
+
mutationFn: () => p.request(
|
|
33
|
+
P(`/integration-obligations/${o}/send`, { fresh: !0 })
|
|
34
|
+
),
|
|
35
|
+
onSuccess: (e) => {
|
|
36
|
+
var i;
|
|
37
|
+
b.message(((i = e == null ? void 0 : e.data) == null ? void 0 : i.detail) ?? `Sent to ${t}`), u(!1), l == null || l();
|
|
38
|
+
},
|
|
39
|
+
onError: (e) => {
|
|
40
|
+
const i = e == null ? void 0 : e.response;
|
|
41
|
+
b.error((i == null ? void 0 : i.error) ?? `Could not send to ${t}`, { duration: 8e3 });
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
return /* @__PURE__ */ a(q, { open: c, onOpenChange: (e) => !s.isPending && u(e), children: [
|
|
45
|
+
/* @__PURE__ */ n(T, { asChild: !0, children: /* @__PURE__ */ a(
|
|
46
|
+
"button",
|
|
47
|
+
{
|
|
48
|
+
type: "button",
|
|
49
|
+
"data-obligation-send-current": !0,
|
|
50
|
+
disabled: !d,
|
|
51
|
+
"data-tip": d ? `Send ${t} what the record says now` : "Remediation is off for this deployment — an admin turns it on under Integrations › Remediation",
|
|
52
|
+
onClick: (e) => e.stopPropagation(),
|
|
53
|
+
className: $(
|
|
54
|
+
"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 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/50 disabled:opacity-60 dark:border-border dark:text-muted-foreground dark:hover:bg-muted",
|
|
55
|
+
c && "border-nvr-cyan bg-nvr-cyan/10 text-nvr-cyan dark:border-nvr-cyan dark:bg-nvr-cyan/15",
|
|
56
|
+
v
|
|
57
|
+
),
|
|
58
|
+
children: [
|
|
59
|
+
/* @__PURE__ */ n(f, { className: "h-3 w-3" }),
|
|
60
|
+
"Send current data"
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
) }),
|
|
64
|
+
/* @__PURE__ */ n(
|
|
65
|
+
S,
|
|
66
|
+
{
|
|
67
|
+
align: "end",
|
|
68
|
+
className: "w-[320px] max-w-[calc(100vw-32px)] p-3 text-[12px]",
|
|
69
|
+
onClick: (e) => e.stopPropagation(),
|
|
70
|
+
children: m.isLoading ? /* @__PURE__ */ a("p", { className: "flex items-center gap-2 text-slate-500 dark:text-muted-foreground", children: [
|
|
71
|
+
/* @__PURE__ */ n(h, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
72
|
+
"Building the message from the current data…"
|
|
73
|
+
] }) : r != null && r.available ? /* @__PURE__ */ a("div", { className: "space-y-3", children: [
|
|
74
|
+
/* @__PURE__ */ a(
|
|
75
|
+
"p",
|
|
76
|
+
{
|
|
77
|
+
className: "flex gap-2 leading-5 text-slate-700 dark:text-slate-200",
|
|
78
|
+
"data-send-current-warning": !0,
|
|
79
|
+
children: [
|
|
80
|
+
/* @__PURE__ */ n(
|
|
81
|
+
w,
|
|
82
|
+
{
|
|
83
|
+
"aria-hidden": !0,
|
|
84
|
+
className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-amber-600 dark:text-amber-400"
|
|
85
|
+
}
|
|
86
|
+
),
|
|
87
|
+
/* @__PURE__ */ n("span", { children: j(r.api ?? t, r.summary) })
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
),
|
|
91
|
+
/* @__PURE__ */ a("div", { className: "flex justify-end gap-2", children: [
|
|
92
|
+
/* @__PURE__ */ n(
|
|
93
|
+
"button",
|
|
94
|
+
{
|
|
95
|
+
type: "button",
|
|
96
|
+
onClick: () => u(!1),
|
|
97
|
+
disabled: s.isPending,
|
|
98
|
+
className: "rounded-md px-2.5 py-1 text-[12px] font-medium text-slate-600 hover:bg-slate-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/50 dark:text-muted-foreground dark:hover:bg-muted",
|
|
99
|
+
children: "Cancel"
|
|
100
|
+
}
|
|
101
|
+
),
|
|
102
|
+
/* @__PURE__ */ a(
|
|
103
|
+
"button",
|
|
104
|
+
{
|
|
105
|
+
type: "button",
|
|
106
|
+
"data-send-current-confirm": !0,
|
|
107
|
+
onClick: () => s.mutate(),
|
|
108
|
+
disabled: s.isPending,
|
|
109
|
+
className: "inline-flex items-center gap-1.5 rounded-md bg-nvr-cyan px-2.5 py-1 text-[12px] font-medium text-white hover:opacity-90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/50 focus-visible:ring-offset-1 disabled:opacity-60",
|
|
110
|
+
children: [
|
|
111
|
+
s.isPending ? /* @__PURE__ */ n(h, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ n(f, { className: "h-3 w-3" }),
|
|
112
|
+
"Send to ",
|
|
113
|
+
r.api ?? t
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
)
|
|
117
|
+
] })
|
|
118
|
+
] }) : /* @__PURE__ */ n("p", { className: "text-slate-600 dark:text-slate-300", "data-send-current-refused": !0, children: (r == null ? void 0 : r.detail) ?? (m.isError ? "Could not build the message." : "Nothing to send.") })
|
|
119
|
+
}
|
|
120
|
+
)
|
|
121
|
+
] });
|
|
122
|
+
}
|
|
123
|
+
export {
|
|
124
|
+
M as SendCurrentDataButton,
|
|
125
|
+
j as sendCurrentWarning
|
|
126
|
+
};
|