@nivaro/react 0.3.138 → 0.3.140
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/components/InlineGridField.js +95 -92
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +36 -2
- package/dist/shared/components/AudienceConfirmPanel.js +19 -19
- package/dist/shared/components/BroadcastView.js +213 -211
- package/dist/shared/components/CollectionBrowserView.js +2677 -2658
- package/dist/shared/components/ConfigHistory.js +45 -45
- package/dist/shared/components/ConformanceView.js +110 -110
- package/dist/shared/components/DataTable.js +51 -51
- package/dist/shared/components/FilePreviewLightbox.js +26 -25
- package/dist/shared/components/ItemEditForm.js +3038 -3027
- package/dist/shared/components/LiveCount.js +27 -23
- package/dist/shared/components/LiveTraceView.js +62 -61
- package/dist/shared/components/PageRenderer.js +422 -410
- package/dist/shared/components/ProfileView.js +199 -199
- package/dist/shared/components/QualityRulesView.js +70 -70
- package/dist/shared/components/QueryTable.js +131 -130
- package/dist/shared/components/RecordGraph.js +98 -98
- package/dist/shared/components/RecordReadView.js +287 -288
- package/dist/shared/components/ReportView.js +1279 -1259
- package/dist/shared/components/SlaRulesView.js +73 -74
- package/dist/shared/components/WidgetSlot.js +73 -73
- package/dist/shared/components/ai/AiChart.js +36 -32
- package/dist/shared/components/ai/AiMarkdown.js +136 -129
- package/dist/shared/components/ai/TaskDo.js +87 -87
- package/dist/shared/components/ai/answer-formats.js +37 -30
- package/dist/shared/components/ai/call-log/format.js +17 -16
- package/dist/shared/components/bulk/BulkActionButtons.js +66 -66
- package/dist/shared/components/bulk/BulkFieldUpdate.js +59 -59
- package/dist/shared/components/bulk/BulkSelectionNotices.js +34 -34
- package/dist/shared/components/bulk/MessageStakeholders.js +31 -29
- package/dist/shared/components/bulk/PushBulkButtons.js +83 -82
- package/dist/shared/components/bulk/bulk-field-options.js +10 -10
- package/dist/shared/components/cbv/column-totals.js +53 -51
- package/dist/shared/components/chat/ChatAnalyticsView.js +87 -87
- package/dist/shared/components/collections-directory/CollectionsToolbar.js +18 -18
- package/dist/shared/components/command-center/announce.js +7 -6
- package/dist/shared/components/command-center/panels/AttentionPanel.js +32 -31
- package/dist/shared/components/command-center/panels/FlowPanel.js +29 -28
- package/dist/shared/components/command-center/panels/PeoplePanel.js +39 -39
- package/dist/shared/components/delegation/DelegationConsoleView.js +27 -27
- package/dist/shared/components/imports/RunDetailSheet.js +1 -1
- package/dist/shared/components/integrations/IntegrationObligationsView.js +119 -119
- package/dist/shared/components/integrations/console/EventsView.js +35 -35
- package/dist/shared/components/integrations/console/FirefightView.js +15 -14
- package/dist/shared/components/integrations/console/PartnerDetail.js +78 -78
- package/dist/shared/components/integrations/console/ReadyToSendView.js +103 -103
- package/dist/shared/components/integrations/console/SignalCard.js +67 -67
- package/dist/shared/components/item-edit/CatalogPickerField.js +536 -527
- package/dist/shared/components/item-edit/ChangesTray.js +88 -74
- package/dist/shared/components/item-edit/FilePickerField.js +123 -123
- package/dist/shared/components/item-edit/GroupSection.js +301 -292
- package/dist/shared/components/item-edit/HeaderSummaryChip.js +54 -54
- package/dist/shared/components/item-edit/InlineGridField.js +45 -36
- package/dist/shared/components/item-edit/InlineTableField.js +1167 -1153
- package/dist/shared/components/item-edit/NestedRelationEditor.js +106 -99
- package/dist/shared/components/item-edit/RecordChatMentionsChip.js +11 -11
- package/dist/shared/components/layout-editor/ai-forms/SlimPanel.js +43 -44
- package/dist/shared/components/monitoring/ApiRequestLog.js +35 -35
- package/dist/shared/components/notifications/NotificationCenterView.js +268 -268
- package/dist/shared/components/ops-report/format.js +37 -36
- package/dist/shared/components/panels/ReferencedByPanel.js +21 -20
- package/dist/shared/components/panels/RevisionsPanel.js +306 -305
- package/dist/shared/components/pipeline/OwnerMatrixVersionsCard.js +12 -12
- package/dist/shared/components/pipeline/PipelineEditorView.js +483 -482
- package/dist/shared/components/pipeline/PipelineHealthCards.js +33 -32
- package/dist/shared/components/pipeline/TeamsView.js +189 -130
- package/dist/shared/components/profile/AgentsPanel.js +6 -6
- package/dist/shared/components/profile/DelegationCard.js +13 -12
- package/dist/shared/components/profile/PersonActivity.js +48 -48
- package/dist/shared/components/profile/PersonExtras.js +107 -107
- package/dist/shared/components/profile/PersonWeek.js +9 -9
- package/dist/shared/components/queue/QueueBulkBar.js +19 -18
- package/dist/shared/components/queue/QueueBulkMove.js +21 -20
- package/dist/shared/components/queue/QueueItemSheet.js +136 -131
- package/dist/shared/components/queue/QueueWorklist.js +671 -670
- package/dist/shared/components/queue/worklist-helpers.js +36 -21
- package/dist/shared/components/support/RequestList.js +121 -121
- package/dist/shared/components/support/SupportAnalytics.js +29 -29
- package/dist/shared/lib/activity-sentence.js +316 -278
- package/dist/shared/lib/format-value.js +5 -4
- package/dist/shared/lib/number-format.js +87 -0
- package/dist/shared/lib/number-kind.js +133 -0
- package/dist/shared/lib/utils.js +24 -20
- package/dist/shared/lib/watch-list.js +1 -1
- package/dist/shared/lib/widget-value-format.js +26 -12
- package/package.json +1 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { useState as v, useRef as
|
|
4
|
-
import { useNivaroClient as
|
|
5
|
-
import { get as
|
|
6
|
-
import { useLiveWatchRoom as
|
|
7
|
-
import { useResolvedFindings as
|
|
8
|
-
import { userErrorMessage as
|
|
9
|
-
import { cn as _, toLocalDateString as
|
|
10
|
-
import { FindingFixedMark as
|
|
11
|
-
import { PickList as
|
|
12
|
-
import { useOverviewFields as
|
|
13
|
-
import { TipLayer as
|
|
14
|
-
function
|
|
2
|
+
import { useQueryClient as z, useQuery as B } from "@tanstack/react-query";
|
|
3
|
+
import { useState as v, useRef as H, useEffect as J, useMemo as E } from "react";
|
|
4
|
+
import { useNivaroClient as D, useItemNavigation as X, useNavigation as V } from "../context.js";
|
|
5
|
+
import { get as A, post as K, put as Z } from "../lib/commands.js";
|
|
6
|
+
import { useLiveWatchRoom as P, useLiveEvent as ee } from "../lib/live.js";
|
|
7
|
+
import { useResolvedFindings as te } from "../lib/live-findings.js";
|
|
8
|
+
import { userErrorMessage as re } from "../lib/safe-error.js";
|
|
9
|
+
import { cn as _, formatNumber as T, toLocalDateString as ne, titleCase as ae } from "../lib/utils.js";
|
|
10
|
+
import { FindingFixedMark as O } from "./FindingFixedMark.js";
|
|
11
|
+
import { PickList as W } from "./imports/ServiceConfigBuilder.js";
|
|
12
|
+
import { useOverviewFields as le } from "./layout-editor/overview/overview-api.js";
|
|
13
|
+
import { TipLayer as oe } from "./TipLayer.js";
|
|
14
|
+
function se({ p: r }) {
|
|
15
15
|
const n = r.total ? Math.min(100, Math.round(r.checked / r.total * 100)) : null;
|
|
16
16
|
return /* @__PURE__ */ l("div", { className: "flex items-center gap-3 text-[11.5px]", "data-conformance-sweep": r.run, children: [
|
|
17
17
|
/* @__PURE__ */ e("span", { className: "w-[180px] shrink-0 truncate font-medium text-slate-700 dark:text-foreground", children: r.collection }),
|
|
@@ -48,15 +48,15 @@ function oe({ p: r }) {
|
|
|
48
48
|
] })
|
|
49
49
|
] });
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function ie(r) {
|
|
52
52
|
if (!r) return "";
|
|
53
53
|
const n = Date.now() - new Date(r).getTime(), d = Math.round(n / 6e4);
|
|
54
54
|
if (d < 1) return "just now";
|
|
55
55
|
if (d < 60) return `${d}m ago`;
|
|
56
56
|
const p = Math.round(d / 60);
|
|
57
|
-
return p < 24 ? `${p}h ago` :
|
|
57
|
+
return p < 24 ? `${p}h ago` : ne(r);
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function de(r) {
|
|
60
60
|
if (!r.started_at || !r.finished_at) return "";
|
|
61
61
|
const n = Math.round(
|
|
62
62
|
(new Date(r.finished_at).getTime() - new Date(r.started_at).getTime()) / 1e3
|
|
@@ -101,32 +101,32 @@ const M = {
|
|
|
101
101
|
cls: "bg-purple-500/10 text-purple-700 dark:text-purple-400"
|
|
102
102
|
}
|
|
103
103
|
};
|
|
104
|
-
function
|
|
104
|
+
function Y(r) {
|
|
105
105
|
return String(r ?? "").trim() || "Record with no number";
|
|
106
106
|
}
|
|
107
|
-
function
|
|
108
|
-
return r[n] ||
|
|
107
|
+
function j(r, n) {
|
|
108
|
+
return r[n] || ae(n);
|
|
109
109
|
}
|
|
110
|
-
const
|
|
111
|
-
function
|
|
112
|
-
const n =
|
|
110
|
+
const U = (r) => r.replace(/[-_]+/g, " ").replace(/^\w/, (n) => n.toUpperCase());
|
|
111
|
+
function ce({ findingId: r }) {
|
|
112
|
+
const n = D(), [d, p] = v(!1), [h, c] = v(""), [a, u] = v(!1), [x, f] = v(null), N = B({
|
|
113
113
|
queryKey: ["conformance-assign-users", h],
|
|
114
|
-
queryFn: () => n.request(
|
|
114
|
+
queryFn: () => n.request(A(`/users?search=${encodeURIComponent(h)}&limit=8`)).then((m) => m.data),
|
|
115
115
|
enabled: d && h.trim().length >= 2,
|
|
116
116
|
staleTime: 3e4
|
|
117
117
|
}), k = async (m) => {
|
|
118
118
|
u(!0);
|
|
119
119
|
try {
|
|
120
120
|
await n.request(
|
|
121
|
-
|
|
122
|
-
),
|
|
121
|
+
K(`/config-conformance/findings/${r}/assign`, { user_id: m.id })
|
|
122
|
+
), f([m.first_name, m.last_name].filter(Boolean).join(" ") || m.email), p(!1);
|
|
123
123
|
} finally {
|
|
124
124
|
u(!1);
|
|
125
125
|
}
|
|
126
126
|
};
|
|
127
|
-
return
|
|
127
|
+
return x ? /* @__PURE__ */ l("span", { className: "text-[11px] text-emerald-700 dark:text-emerald-400", "data-finding-assigned": !0, children: [
|
|
128
128
|
"→ ",
|
|
129
|
-
|
|
129
|
+
x
|
|
130
130
|
] }) : /* @__PURE__ */ l("span", { className: "relative inline-block", children: [
|
|
131
131
|
/* @__PURE__ */ e(
|
|
132
132
|
"button",
|
|
@@ -176,19 +176,19 @@ function de({ findingId: r }) {
|
|
|
176
176
|
)
|
|
177
177
|
] });
|
|
178
178
|
}
|
|
179
|
-
function
|
|
180
|
-
const n =
|
|
181
|
-
|
|
179
|
+
function Re({ className: r }) {
|
|
180
|
+
const n = D(), d = z(), p = X(), h = V(), [c, a] = v(""), [u, x] = v(null), [f, N] = v(!1), [k, m] = v(null), [y, q] = v("5000"), s = P("conformance"), [w, I] = v({}), b = H(null);
|
|
181
|
+
J(
|
|
182
182
|
() => () => {
|
|
183
183
|
b.current && clearTimeout(b.current);
|
|
184
184
|
},
|
|
185
185
|
[]
|
|
186
|
-
),
|
|
186
|
+
), ee(
|
|
187
187
|
"conformance:progress",
|
|
188
188
|
(o) => {
|
|
189
189
|
I((F) => {
|
|
190
|
-
const
|
|
191
|
-
return o.status === "running" ?
|
|
190
|
+
const Q = { ...F };
|
|
191
|
+
return o.status === "running" ? Q[o.run] = o : delete Q[o.run], Q;
|
|
192
192
|
});
|
|
193
193
|
const L = () => {
|
|
194
194
|
d.invalidateQueries({ queryKey: ["conformance-runs"] }), d.invalidateQueries({ queryKey: ["conformance-run", o.run] }), o.status !== "running" && d.invalidateQueries({ queryKey: ["conformance-collections"] });
|
|
@@ -199,16 +199,16 @@ function Le({ className: r }) {
|
|
|
199
199
|
},
|
|
200
200
|
{ includeOwn: !0 }
|
|
201
201
|
);
|
|
202
|
-
const { data: R = [], isLoading: g } =
|
|
202
|
+
const { data: R = [], isLoading: g } = B(
|
|
203
203
|
{
|
|
204
204
|
queryKey: ["conformance-collections"],
|
|
205
|
-
queryFn: () => n.request(
|
|
205
|
+
queryFn: () => n.request(A("/config-conformance/collections")).then((o) => o.data ?? []),
|
|
206
206
|
staleTime: 5 * 6e4
|
|
207
207
|
}
|
|
208
|
-
), { data: t = [], isFetched: i } =
|
|
208
|
+
), { data: t = [], isFetched: i } = B({
|
|
209
209
|
queryKey: ["conformance-runs", c],
|
|
210
210
|
queryFn: () => n.request(
|
|
211
|
-
|
|
211
|
+
A(`/config-conformance/runs${c ? `?collection=${c}` : ""}`)
|
|
212
212
|
).then((o) => o.data ?? []),
|
|
213
213
|
refetchInterval: (o) => {
|
|
214
214
|
var L;
|
|
@@ -217,34 +217,34 @@ function Le({ className: r }) {
|
|
|
217
217
|
}), S = Object.values(w).filter((o) => {
|
|
218
218
|
const L = t.find((F) => F.id === o.run);
|
|
219
219
|
return !L || L.status === "running";
|
|
220
|
-
}), $ = (u != null ? t.find((o) => o.id === u) : void 0) ?? t[0], C = R.find((o) => o.collection === c),
|
|
220
|
+
}), $ = (u != null ? t.find((o) => o.id === u) : void 0) ?? t[0], C = R.find((o) => o.collection === c), G = async () => {
|
|
221
221
|
if (c) {
|
|
222
222
|
N(!0), m(null);
|
|
223
223
|
try {
|
|
224
224
|
const o = await n.request(
|
|
225
|
-
|
|
225
|
+
K(`/config-conformance/${c}/run`, {
|
|
226
226
|
limit: y === "0" ? 0 : Number(y) || 5e3
|
|
227
227
|
})
|
|
228
228
|
);
|
|
229
|
-
|
|
229
|
+
x(o.data.id), d.invalidateQueries({ queryKey: ["conformance-runs"] });
|
|
230
230
|
} catch (o) {
|
|
231
|
-
m(
|
|
231
|
+
m(re(o, "Could not start the run"));
|
|
232
232
|
} finally {
|
|
233
233
|
N(!1);
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
236
|
};
|
|
237
237
|
return /* @__PURE__ */ l("div", { className: _("flex min-h-0 flex-1 flex-col gap-4 p-6", r), "data-conformance": !0, children: [
|
|
238
|
-
/* @__PURE__ */ e(
|
|
238
|
+
/* @__PURE__ */ e(oe, {}),
|
|
239
239
|
/* @__PURE__ */ l("div", { className: "flex flex-wrap items-end gap-3", children: [
|
|
240
240
|
/* @__PURE__ */ l("div", { className: "w-[300px]", children: [
|
|
241
241
|
/* @__PURE__ */ e("p", { className: "mb-1 text-[11.5px] font-medium text-slate-700 dark:text-foreground", children: "Collection" }),
|
|
242
242
|
/* @__PURE__ */ e(
|
|
243
|
-
|
|
243
|
+
W,
|
|
244
244
|
{
|
|
245
245
|
value: c,
|
|
246
246
|
onChange: (o) => {
|
|
247
|
-
a(o),
|
|
247
|
+
a(o), x(null);
|
|
248
248
|
},
|
|
249
249
|
options: R.map((o) => ({
|
|
250
250
|
value: o.collection,
|
|
@@ -271,7 +271,7 @@ function Le({ className: r }) {
|
|
|
271
271
|
/* @__PURE__ */ l("div", { className: "w-[170px]", children: [
|
|
272
272
|
/* @__PURE__ */ e("p", { className: "mb-1 text-[11.5px] font-medium text-slate-700 dark:text-foreground", children: "Sample size" }),
|
|
273
273
|
/* @__PURE__ */ e(
|
|
274
|
-
|
|
274
|
+
W,
|
|
275
275
|
{
|
|
276
276
|
value: y,
|
|
277
277
|
onChange: q,
|
|
@@ -292,14 +292,14 @@ function Le({ className: r }) {
|
|
|
292
292
|
"button",
|
|
293
293
|
{
|
|
294
294
|
type: "button",
|
|
295
|
-
disabled: !c ||
|
|
296
|
-
onClick: () => void
|
|
295
|
+
disabled: !c || f || t.some((o) => o.status === "running"),
|
|
296
|
+
onClick: () => void G(),
|
|
297
297
|
className: "h-8 rounded-md bg-nvr-cyan px-3 text-[12.5px] font-medium text-white disabled:opacity-50",
|
|
298
|
-
children:
|
|
298
|
+
children: f ? "Starting…" : "Run checks"
|
|
299
299
|
}
|
|
300
300
|
),
|
|
301
|
-
c && /* @__PURE__ */ e(
|
|
302
|
-
t.filter((o) => o.status === "completed").length >= 2 && /* @__PURE__ */ e(
|
|
301
|
+
c && /* @__PURE__ */ e(ue, { collection: c }),
|
|
302
|
+
t.filter((o) => o.status === "completed").length >= 2 && /* @__PURE__ */ e(me, { runs: t }),
|
|
303
303
|
k && /* @__PURE__ */ e("p", { className: "pb-1.5 text-[12px] text-red-600 dark:text-red-400", children: k })
|
|
304
304
|
] }),
|
|
305
305
|
S.length > 0 && /* @__PURE__ */ l(
|
|
@@ -309,13 +309,13 @@ function Le({ className: r }) {
|
|
|
309
309
|
"data-conformance-sweeps": !0,
|
|
310
310
|
children: [
|
|
311
311
|
/* @__PURE__ */ e("p", { className: "text-[10.5px] font-semibold uppercase tracking-wide text-slate-400", children: "Sweeps in progress" }),
|
|
312
|
-
S.map((o) => /* @__PURE__ */ e(
|
|
312
|
+
S.map((o) => /* @__PURE__ */ e(se, { p: o }, o.run))
|
|
313
313
|
]
|
|
314
314
|
}
|
|
315
315
|
),
|
|
316
|
-
t.length > 0 && /* @__PURE__ */ e(
|
|
316
|
+
t.length > 0 && /* @__PURE__ */ e(pe, { runs: t, activeId: ($ == null ? void 0 : $.id) ?? null, onSelect: x }),
|
|
317
317
|
$ && /* @__PURE__ */ e(
|
|
318
|
-
|
|
318
|
+
fe,
|
|
319
319
|
{
|
|
320
320
|
run: $,
|
|
321
321
|
liveProgress: w[$.id] ?? null,
|
|
@@ -337,11 +337,11 @@ function Le({ className: r }) {
|
|
|
337
337
|
] })
|
|
338
338
|
] });
|
|
339
339
|
}
|
|
340
|
-
function
|
|
341
|
-
const n =
|
|
340
|
+
function ue({ collection: r }) {
|
|
341
|
+
const n = D(), d = z(), { data: p, isError: h } = B({
|
|
342
342
|
queryKey: ["conformance-schedules"],
|
|
343
343
|
queryFn: () => n.request(
|
|
344
|
-
|
|
344
|
+
A("/config-conformance/schedules")
|
|
345
345
|
).then((a) => a.data ?? []),
|
|
346
346
|
retry: !1,
|
|
347
347
|
staleTime: 6e4
|
|
@@ -355,7 +355,7 @@ function ce({ collection: r }) {
|
|
|
355
355
|
type: "button",
|
|
356
356
|
role: "switch",
|
|
357
357
|
"aria-checked": c,
|
|
358
|
-
onClick: () => void n.request(
|
|
358
|
+
onClick: () => void n.request(Z(`/config-conformance/schedules/${r}`, { is_active: !c })).then(() => d.invalidateQueries({ queryKey: ["conformance-schedules"] })),
|
|
359
359
|
className: _(
|
|
360
360
|
"relative h-4 w-7 shrink-0 rounded-full transition-colors",
|
|
361
361
|
c ? "bg-nvr-cyan" : "bg-slate-300 dark:bg-border"
|
|
@@ -374,11 +374,11 @@ function ce({ collection: r }) {
|
|
|
374
374
|
"Nightly sweep"
|
|
375
375
|
] });
|
|
376
376
|
}
|
|
377
|
-
function
|
|
377
|
+
function me({ runs: r }) {
|
|
378
378
|
const n = r.filter((u) => u.status === "completed").slice(0, 12).reverse();
|
|
379
379
|
if (n.length < 2) return null;
|
|
380
380
|
const d = Math.max(...n.map((u) => u.violation_count), 1), p = 90, h = 22, c = n.map(
|
|
381
|
-
(u,
|
|
381
|
+
(u, x) => `${x / (n.length - 1) * (p - 4) + 2},${h - 3 - u.violation_count / d * (h - 6)}`
|
|
382
382
|
).join(" "), a = n[n.length - 1].violation_count <= n[0].violation_count;
|
|
383
383
|
return /* @__PURE__ */ e(
|
|
384
384
|
"span",
|
|
@@ -397,7 +397,7 @@ function ue({ runs: r }) {
|
|
|
397
397
|
}
|
|
398
398
|
);
|
|
399
399
|
}
|
|
400
|
-
function
|
|
400
|
+
function pe({
|
|
401
401
|
runs: r,
|
|
402
402
|
activeId: n,
|
|
403
403
|
onSelect: d
|
|
@@ -437,13 +437,13 @@ function me({
|
|
|
437
437
|
a.violation_count === 1 ? "" : "s"
|
|
438
438
|
] }) }),
|
|
439
439
|
/* @__PURE__ */ e("td", { className: "px-2 py-1.5 text-right text-slate-500 dark:text-muted-foreground", children: a.checked_records.toLocaleString() }),
|
|
440
|
-
/* @__PURE__ */ e("td", { className: "px-2 py-1.5 text-right text-slate-500 dark:text-muted-foreground", children:
|
|
440
|
+
/* @__PURE__ */ e("td", { className: "px-2 py-1.5 text-right text-slate-500 dark:text-muted-foreground", children: de(a) }),
|
|
441
441
|
/* @__PURE__ */ e(
|
|
442
442
|
"td",
|
|
443
443
|
{
|
|
444
444
|
className: "px-2 py-1.5 text-slate-500 dark:text-muted-foreground",
|
|
445
445
|
"data-tip": a.started_at ? new Date(a.started_at).toLocaleString() : void 0,
|
|
446
|
-
children:
|
|
446
|
+
children: ie(a.started_at)
|
|
447
447
|
}
|
|
448
448
|
),
|
|
449
449
|
/* @__PURE__ */ e("td", { className: "px-3 py-1.5 text-slate-500 dark:text-muted-foreground", children: a.triggered_by_name ?? "Scheduled" })
|
|
@@ -463,22 +463,22 @@ function me({
|
|
|
463
463
|
)
|
|
464
464
|
] });
|
|
465
465
|
}
|
|
466
|
-
async function
|
|
466
|
+
async function he(r, n, d, p) {
|
|
467
467
|
const h = /* @__PURE__ */ new Map();
|
|
468
|
-
for (const
|
|
468
|
+
for (const f of d) h.set(f.itemId, [...h.get(f.itemId) ?? [], f]);
|
|
469
469
|
const c = [], a = [...h.entries()];
|
|
470
470
|
let u = 0;
|
|
471
|
-
const
|
|
472
|
-
var
|
|
471
|
+
const x = async () => {
|
|
472
|
+
var f, N;
|
|
473
473
|
for (; u < a.length; ) {
|
|
474
474
|
const [k, m] = a[u++];
|
|
475
475
|
try {
|
|
476
476
|
const y = await r.request(
|
|
477
|
-
|
|
477
|
+
K(
|
|
478
478
|
`/config-conformance/record/${encodeURIComponent(n)}/${encodeURIComponent(k)}/check`
|
|
479
479
|
)
|
|
480
480
|
);
|
|
481
|
-
if (((
|
|
481
|
+
if (((f = y.data) == null ? void 0 : f.enabled) === !1) continue;
|
|
482
482
|
const q = new Set(
|
|
483
483
|
(((N = y.data) == null ? void 0 : N.findings) ?? []).map((s) => `${s.field ?? ""}\0${s.rule}`)
|
|
484
484
|
);
|
|
@@ -491,48 +491,48 @@ async function pe(r, n, d, p) {
|
|
|
491
491
|
}
|
|
492
492
|
}
|
|
493
493
|
};
|
|
494
|
-
return await Promise.all([
|
|
494
|
+
return await Promise.all([x(), x(), x(), x()]), c;
|
|
495
495
|
}
|
|
496
|
-
function
|
|
496
|
+
function fe({
|
|
497
497
|
run: r,
|
|
498
498
|
onOpenItem: n,
|
|
499
499
|
liveProgress: d,
|
|
500
500
|
live: p
|
|
501
501
|
}) {
|
|
502
|
-
const h =
|
|
502
|
+
const h = D(), [c, a] = v(1), [u, x] = v(""), [f, N] = v(""), [k, m] = v(!1), { data: y } = le(r.collection), q = E(() => {
|
|
503
503
|
const t = {};
|
|
504
504
|
for (const i of y ?? []) i.label && (t[i.field] = i.label);
|
|
505
505
|
return t;
|
|
506
|
-
}, [y]), { data: s } =
|
|
507
|
-
queryKey: ["conformance-run", r.id, c, u,
|
|
506
|
+
}, [y]), { data: s } = B({
|
|
507
|
+
queryKey: ["conformance-run", r.id, c, u, f, k],
|
|
508
508
|
queryFn: () => h.request(
|
|
509
|
-
|
|
510
|
-
`/config-conformance/runs/${r.id}?page=${c}&limit=50${u ? `&rule=${u}` : ""}${
|
|
509
|
+
A(
|
|
510
|
+
`/config-conformance/runs/${r.id}?page=${c}&limit=50${u ? `&rule=${u}` : ""}${f ? `&field=${f}` : ""}${k ? "&group=record" : ""}`
|
|
511
511
|
)
|
|
512
512
|
).then((t) => t.data),
|
|
513
513
|
refetchInterval: r.status === "running" ? p ? 2e4 : 3e3 : !1
|
|
514
|
-
}), w = Math.max(1, Math.ceil(((s == null ? void 0 : s.total) ?? 0) / 50)), I =
|
|
514
|
+
}), w = Math.max(1, Math.ceil(((s == null ? void 0 : s.total) ?? 0) / 50)), I = E(
|
|
515
515
|
() => ({
|
|
516
516
|
rules: (s == null ? void 0 : s.by_rule) ?? [],
|
|
517
517
|
fields: ((s == null ? void 0 : s.by_field) ?? []).slice(0, 12)
|
|
518
518
|
}),
|
|
519
519
|
[s]
|
|
520
|
-
), b =
|
|
520
|
+
), b = E(() => {
|
|
521
521
|
const t = [];
|
|
522
522
|
for (const i of (s == null ? void 0 : s.findings) ?? [])
|
|
523
523
|
"findings" in i ? t.push(...i.findings.map((S) => ({ ...S, item_id: i.item_id }))) : t.push(i);
|
|
524
524
|
return t;
|
|
525
|
-
}, [s]), R =
|
|
525
|
+
}, [s]), R = E(
|
|
526
526
|
() => b.map((t) => ({
|
|
527
527
|
key: String(t.id),
|
|
528
528
|
collection: r.collection,
|
|
529
529
|
itemId: t.item_id
|
|
530
530
|
})),
|
|
531
531
|
[b, r.collection]
|
|
532
|
-
), { resolved: g } =
|
|
532
|
+
), { resolved: g } = te({
|
|
533
533
|
findings: R,
|
|
534
534
|
enabled: r.status === "completed",
|
|
535
|
-
recheck: (t) =>
|
|
535
|
+
recheck: (t) => he(
|
|
536
536
|
h,
|
|
537
537
|
r.collection,
|
|
538
538
|
t,
|
|
@@ -590,7 +590,7 @@ function he({
|
|
|
590
590
|
{
|
|
591
591
|
type: "button",
|
|
592
592
|
onClick: () => {
|
|
593
|
-
|
|
593
|
+
x(($) => $ === t.rule ? "" : t.rule), a(1);
|
|
594
594
|
},
|
|
595
595
|
className: _(
|
|
596
596
|
"rounded-full px-2 py-0.5 text-[11px] font-medium transition-opacity",
|
|
@@ -598,7 +598,7 @@ function he({
|
|
|
598
598
|
u && u !== t.rule && "opacity-40"
|
|
599
599
|
),
|
|
600
600
|
children: [
|
|
601
|
-
((S = M[t.rule]) == null ? void 0 : S.label) ??
|
|
601
|
+
((S = M[t.rule]) == null ? void 0 : S.label) ?? U(t.rule),
|
|
602
602
|
" ",
|
|
603
603
|
Number(t.c).toLocaleString()
|
|
604
604
|
]
|
|
@@ -616,17 +616,17 @@ function he({
|
|
|
616
616
|
},
|
|
617
617
|
className: _(
|
|
618
618
|
"rounded border px-1.5 py-0.5 text-[11px] transition-colors",
|
|
619
|
-
|
|
619
|
+
f === t.field ? "border-nvr-cyan/50 bg-nvr-cyan/10 text-slate-800 dark:text-foreground" : "border-slate-200 text-slate-500 dark:border-border dark:text-muted-foreground"
|
|
620
620
|
),
|
|
621
621
|
children: [
|
|
622
|
-
|
|
622
|
+
j(q, t.field),
|
|
623
623
|
" · ",
|
|
624
624
|
Number(t.c).toLocaleString()
|
|
625
625
|
]
|
|
626
626
|
},
|
|
627
627
|
t.field
|
|
628
628
|
)) }),
|
|
629
|
-
u &&
|
|
629
|
+
u && f && [
|
|
630
630
|
"cascade",
|
|
631
631
|
"option-filter",
|
|
632
632
|
"validation",
|
|
@@ -634,9 +634,9 @@ function he({
|
|
|
634
634
|
"row-rule",
|
|
635
635
|
"required",
|
|
636
636
|
"row-input"
|
|
637
|
-
].includes(u) && /* @__PURE__ */ e(xe, { run: r, rule: u, field:
|
|
637
|
+
].includes(u) && /* @__PURE__ */ e(xe, { run: r, rule: u, field: f, total: (s == null ? void 0 : s.total) ?? 0 }),
|
|
638
638
|
/* @__PURE__ */ l("div", { className: "min-h-0 flex-1 overflow-y-auto", children: [
|
|
639
|
-
s !== void 0 && ((s == null ? void 0 : s.findings) ?? []).length === 0 && r.status === "completed" && /* @__PURE__ */ e("p", { className: "px-4 py-6 text-[12.5px] text-emerald-600 dark:text-emerald-400", children: u ||
|
|
639
|
+
s !== void 0 && ((s == null ? void 0 : s.findings) ?? []).length === 0 && r.status === "completed" && /* @__PURE__ */ e("p", { className: "px-4 py-6 text-[12.5px] text-emerald-600 dark:text-emerald-400", children: u || f ? "No findings match the filters." : "Every checked record satisfies its field configuration." }),
|
|
640
640
|
k ? /* @__PURE__ */ e("div", { children: ((s == null ? void 0 : s.findings) ?? []).map((t) => /* @__PURE__ */ l(
|
|
641
641
|
"div",
|
|
642
642
|
{
|
|
@@ -649,11 +649,11 @@ function he({
|
|
|
649
649
|
type: "button",
|
|
650
650
|
onClick: () => n(t.item_id),
|
|
651
651
|
className: "text-[12.5px] font-medium text-nvr-cyan underline decoration-dotted underline-offset-2",
|
|
652
|
-
children:
|
|
652
|
+
children: Y(t.item_label)
|
|
653
653
|
}
|
|
654
654
|
),
|
|
655
655
|
/* @__PURE__ */ l("span", { className: "rounded-full bg-slate-100 px-1.5 py-0.5 text-[10.5px] font-medium text-slate-600 dark:bg-background dark:text-muted-foreground", children: [
|
|
656
|
-
t.count,
|
|
656
|
+
T(t.count),
|
|
657
657
|
" issue",
|
|
658
658
|
t.count === 1 ? "" : "s"
|
|
659
659
|
] })
|
|
@@ -676,7 +676,7 @@ function he({
|
|
|
676
676
|
onClick: () => n(t.item_id, i.field),
|
|
677
677
|
"data-tip": "Open the record at this field",
|
|
678
678
|
className: "w-[150px] shrink-0 text-left text-[11.5px] text-slate-500 underline decoration-dotted underline-offset-2 hover:text-nvr-cyan dark:text-muted-foreground",
|
|
679
|
-
children:
|
|
679
|
+
children: j(q, i.field)
|
|
680
680
|
}
|
|
681
681
|
),
|
|
682
682
|
/* @__PURE__ */ e(
|
|
@@ -686,11 +686,11 @@ function he({
|
|
|
686
686
|
"shrink-0 rounded-full px-2 py-0.5 text-[10.5px] font-medium",
|
|
687
687
|
((S = M[i.rule]) == null ? void 0 : S.cls) ?? "bg-slate-500/10 text-slate-600"
|
|
688
688
|
),
|
|
689
|
-
children: (($ = M[i.rule]) == null ? void 0 : $.label) ??
|
|
689
|
+
children: (($ = M[i.rule]) == null ? void 0 : $.label) ?? U(i.rule)
|
|
690
690
|
}
|
|
691
691
|
),
|
|
692
692
|
/* @__PURE__ */ e("span", { className: "min-w-0 text-slate-600 dark:text-muted-foreground", children: i.message }),
|
|
693
|
-
g.get(String(i.id)) && /* @__PURE__ */ e(
|
|
693
|
+
g.get(String(i.id)) && /* @__PURE__ */ e(O, { mark: g.get(String(i.id)) })
|
|
694
694
|
]
|
|
695
695
|
},
|
|
696
696
|
i.id
|
|
@@ -716,7 +716,7 @@ function he({
|
|
|
716
716
|
type: "button",
|
|
717
717
|
onClick: () => n(t.item_id),
|
|
718
718
|
className: "text-left text-nvr-cyan underline decoration-dotted underline-offset-2",
|
|
719
|
-
children:
|
|
719
|
+
children: Y(t.item_label)
|
|
720
720
|
}
|
|
721
721
|
) }),
|
|
722
722
|
/* @__PURE__ */ e("td", { className: "w-[160px] px-2 py-1.5", children: /* @__PURE__ */ e(
|
|
@@ -726,7 +726,7 @@ function he({
|
|
|
726
726
|
onClick: () => n(t.item_id, t.field),
|
|
727
727
|
"data-tip": "Open the record at this field",
|
|
728
728
|
className: "text-[11.5px] text-slate-500 underline decoration-dotted underline-offset-2 hover:text-nvr-cyan dark:text-muted-foreground",
|
|
729
|
-
children:
|
|
729
|
+
children: j(q, t.field)
|
|
730
730
|
}
|
|
731
731
|
) }),
|
|
732
732
|
/* @__PURE__ */ e("td", { className: "w-[150px] px-2 py-1.5", children: /* @__PURE__ */ e(
|
|
@@ -736,11 +736,11 @@ function he({
|
|
|
736
736
|
"rounded-full px-2 py-0.5 text-[10.5px] font-medium",
|
|
737
737
|
((i = M[t.rule]) == null ? void 0 : i.cls) ?? "bg-slate-500/10 text-slate-600"
|
|
738
738
|
),
|
|
739
|
-
children: ((S = M[t.rule]) == null ? void 0 : S.label) ??
|
|
739
|
+
children: ((S = M[t.rule]) == null ? void 0 : S.label) ?? U(t.rule)
|
|
740
740
|
}
|
|
741
741
|
) }),
|
|
742
742
|
/* @__PURE__ */ e("td", { className: "px-2 py-1.5 text-slate-600 dark:text-muted-foreground", children: t.message }),
|
|
743
|
-
/* @__PURE__ */ e("td", { className: "w-[120px] px-2 py-1.5 text-right", children: g.get(String(t.id)) ? /* @__PURE__ */ e(
|
|
743
|
+
/* @__PURE__ */ e("td", { className: "w-[120px] px-2 py-1.5 text-right", children: g.get(String(t.id)) ? /* @__PURE__ */ e(O, { mark: g.get(String(t.id)) }) : /* @__PURE__ */ e(ce, { findingId: t.id }) })
|
|
744
744
|
]
|
|
745
745
|
},
|
|
746
746
|
t.id
|
|
@@ -783,20 +783,20 @@ function xe({
|
|
|
783
783
|
field: d,
|
|
784
784
|
total: p
|
|
785
785
|
}) {
|
|
786
|
-
const h =
|
|
786
|
+
const h = D(), c = z(), a = V(), [u, x] = v(null), [f, N] = v(!1), [k, m] = v(null), [y, q] = v(!1);
|
|
787
787
|
if (p === 0 && !k) return null;
|
|
788
788
|
const s = () => {
|
|
789
789
|
q(!0), h.request(
|
|
790
|
-
|
|
790
|
+
K(`/config-conformance/runs/${r.id}/plan`, { field: d, rule: n })
|
|
791
791
|
).then((b) => a.navigate(`/ai-plans?plan=${encodeURIComponent(b.data.plan_id)}`)).catch((b) => m(b.message)).finally(() => q(!1));
|
|
792
792
|
}, w = n === "row-rule" ? "rederive" : ["cascade", "option-filter", "validation", "display"].includes(n) ? "clear" : null, I = (b) => {
|
|
793
|
-
N(!0), h.request(
|
|
793
|
+
N(!0), h.request(K(`/config-conformance/runs/${r.id}/remediate`, { action: b, field: d, rule: n })).then((R) => {
|
|
794
794
|
const g = R.data, t = g.failed ? ` — ${g.failed} failed` : "";
|
|
795
795
|
m(
|
|
796
|
-
b === "apply-high" ? `Applied confident fixes on ${g.applied ?? 0} record(s); ${g.skipped ?? 0} need a person${t}. Re-run the checks to confirm.` : b === "rederive" ? `Re-derived ${g.lines ?? 0} line(s) across ${g.records ?? 0} record(s)${t}. Re-run the checks to confirm.` : `Cleared on ${g.cleared ?? 0} record(s)${t}. Re-run the checks to confirm.`
|
|
796
|
+
b === "apply-high" ? `Applied confident fixes on ${T(g.applied ?? 0)} record(s); ${T(g.skipped ?? 0)} need a person${t}. Re-run the checks to confirm.` : b === "rederive" ? `Re-derived ${T(g.lines ?? 0)} line(s) across ${T(g.records ?? 0)} record(s)${t}. Re-run the checks to confirm.` : `Cleared on ${T(g.cleared ?? 0)} record(s)${t}. Re-run the checks to confirm.`
|
|
797
797
|
), c.invalidateQueries({ queryKey: ["conformance-run", r.id] });
|
|
798
798
|
}).catch((R) => m(R.message)).finally(() => {
|
|
799
|
-
N(!1),
|
|
799
|
+
N(!1), x(null);
|
|
800
800
|
});
|
|
801
801
|
};
|
|
802
802
|
return /* @__PURE__ */ l("div", { className: "flex flex-wrap items-center gap-2.5 border-b border-slate-100 bg-slate-50/60 px-4 py-2 dark:border-border dark:bg-background/40", children: [
|
|
@@ -810,20 +810,20 @@ function xe({
|
|
|
810
810
|
"button",
|
|
811
811
|
{
|
|
812
812
|
type: "button",
|
|
813
|
-
disabled:
|
|
813
|
+
disabled: f,
|
|
814
814
|
onClick: () => I(u),
|
|
815
815
|
className: _(
|
|
816
816
|
"h-6 rounded-md px-2.5 text-[11.5px] font-medium text-white disabled:opacity-50",
|
|
817
817
|
u === "clear" ? "bg-red-600" : u === "rederive" ? "bg-orange-600" : "bg-emerald-600"
|
|
818
818
|
),
|
|
819
|
-
children:
|
|
819
|
+
children: f ? "Working…" : u === "apply-high" ? `Yes, apply confident fixes on ${p.toLocaleString()} record(s)` : u === "rederive" ? `Yes, re-run rules on ${p.toLocaleString()} record(s)` : `Yes, clear ${p.toLocaleString()} value(s)`
|
|
820
820
|
}
|
|
821
821
|
),
|
|
822
822
|
/* @__PURE__ */ e(
|
|
823
823
|
"button",
|
|
824
824
|
{
|
|
825
825
|
type: "button",
|
|
826
|
-
onClick: () =>
|
|
826
|
+
onClick: () => x(null),
|
|
827
827
|
className: "text-[11.5px] text-slate-400 hover:text-slate-600",
|
|
828
828
|
children: "Cancel"
|
|
829
829
|
}
|
|
@@ -833,7 +833,7 @@ function xe({
|
|
|
833
833
|
"button",
|
|
834
834
|
{
|
|
835
835
|
type: "button",
|
|
836
|
-
onClick: () =>
|
|
836
|
+
onClick: () => x("apply-high"),
|
|
837
837
|
title: "For each record, apply the top proposal only when its confidence is high (an only option, a rule-derived value); everything else is left for a person.",
|
|
838
838
|
className: "h-6 rounded-md border border-emerald-300 px-2.5 text-[11.5px] font-medium text-emerald-700 hover:bg-emerald-50 dark:border-emerald-500/40 dark:text-emerald-400 dark:hover:bg-emerald-500/10",
|
|
839
839
|
children: "Apply confident fixes…"
|
|
@@ -854,7 +854,7 @@ function xe({
|
|
|
854
854
|
"button",
|
|
855
855
|
{
|
|
856
856
|
type: "button",
|
|
857
|
-
onClick: () =>
|
|
857
|
+
onClick: () => x(w),
|
|
858
858
|
className: _(
|
|
859
859
|
"h-6 rounded-md border border-slate-200 px-2.5 text-[11.5px] font-medium text-slate-600 dark:border-border dark:text-muted-foreground",
|
|
860
860
|
w === "rederive" ? "hover:border-orange-300 hover:text-orange-600" : "hover:border-red-300 hover:text-red-600"
|
|
@@ -866,8 +866,8 @@ function xe({
|
|
|
866
866
|
] });
|
|
867
867
|
}
|
|
868
868
|
export {
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
869
|
+
Re as ConformanceView,
|
|
870
|
+
j as findingFieldLabel,
|
|
871
|
+
Y as findingRecordName,
|
|
872
|
+
he as fixedConformanceFindings
|
|
873
873
|
};
|