@nivaro/react 0.3.64 → 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 +49 -4
- 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 +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 +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,22 +1,23 @@
|
|
|
1
1
|
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { useState as f, useRef as
|
|
4
|
-
import { useNivaroClient as B, useItemNavigation as
|
|
5
|
-
import { get as M, post as A, put as
|
|
6
|
-
import { useLiveWatchRoom as
|
|
7
|
-
import { userErrorMessage as
|
|
8
|
-
import { cn as N } from "../lib/utils.js";
|
|
9
|
-
import { PickList as
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
import { useQueryClient as I, useQuery as T } from "@tanstack/react-query";
|
|
3
|
+
import { useState as f, useRef as V, useEffect as G, useMemo as j } from "react";
|
|
4
|
+
import { useNivaroClient as B, useItemNavigation as H, useNavigation as O } from "../context.js";
|
|
5
|
+
import { get as M, post as A, put as J } from "../lib/commands.js";
|
|
6
|
+
import { useLiveWatchRoom as X, useLiveEvent as Z } from "../lib/live.js";
|
|
7
|
+
import { userErrorMessage as P } from "../lib/safe-error.js";
|
|
8
|
+
import { cn as N, titleCase as ee } from "../lib/utils.js";
|
|
9
|
+
import { PickList as U } from "./imports/ServiceConfigBuilder.js";
|
|
10
|
+
import { useOverviewFields as te } from "./layout-editor/overview/overview-api.js";
|
|
11
|
+
import { TipLayer as re } from "./TipLayer.js";
|
|
12
|
+
function ae({ p: r }) {
|
|
13
|
+
const a = r.total ? Math.min(100, Math.round(r.checked / r.total * 100)) : null;
|
|
14
|
+
return /* @__PURE__ */ n("div", { className: "flex items-center gap-3 text-[11.5px]", "data-conformance-sweep": r.run, children: [
|
|
15
|
+
/* @__PURE__ */ e("span", { className: "w-[180px] shrink-0 truncate font-medium text-slate-700 dark:text-foreground", children: r.collection }),
|
|
15
16
|
/* @__PURE__ */ e(
|
|
16
17
|
"span",
|
|
17
18
|
{
|
|
18
19
|
role: "progressbar",
|
|
19
|
-
"aria-label": `${
|
|
20
|
+
"aria-label": `${r.collection} sweep`,
|
|
20
21
|
"aria-valuemin": 0,
|
|
21
22
|
"aria-valuemax": 100,
|
|
22
23
|
"aria-valuenow": a ?? void 0,
|
|
@@ -34,33 +35,33 @@ function P({ p: t }) {
|
|
|
34
35
|
}
|
|
35
36
|
),
|
|
36
37
|
/* @__PURE__ */ n("span", { className: "tabular-nums text-slate-500 dark:text-muted-foreground", children: [
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
r.checked.toLocaleString(),
|
|
39
|
+
r.total ? ` of ${r.total.toLocaleString()}` : "",
|
|
39
40
|
" checked · ",
|
|
40
|
-
|
|
41
|
+
r.violations.toLocaleString(),
|
|
41
42
|
" ",
|
|
42
43
|
"issue",
|
|
43
|
-
|
|
44
|
+
r.violations === 1 ? "" : "s",
|
|
44
45
|
" so far"
|
|
45
46
|
] })
|
|
46
47
|
] });
|
|
47
48
|
}
|
|
48
|
-
function
|
|
49
|
-
if (!
|
|
50
|
-
const a = Date.now() - new Date(
|
|
49
|
+
function ne(r) {
|
|
50
|
+
if (!r) return "";
|
|
51
|
+
const a = Date.now() - new Date(r).getTime(), s = Math.round(a / 6e4);
|
|
51
52
|
if (s < 1) return "just now";
|
|
52
53
|
if (s < 60) return `${s}m ago`;
|
|
53
54
|
const p = Math.round(s / 60);
|
|
54
|
-
return p < 24 ? `${p}h ago` : new Date(
|
|
55
|
+
return p < 24 ? `${p}h ago` : new Date(r).toLocaleDateString();
|
|
55
56
|
}
|
|
56
|
-
function
|
|
57
|
-
if (!
|
|
57
|
+
function le(r) {
|
|
58
|
+
if (!r.started_at || !r.finished_at) return "";
|
|
58
59
|
const a = Math.round(
|
|
59
|
-
(new Date(
|
|
60
|
+
(new Date(r.finished_at).getTime() - new Date(r.started_at).getTime()) / 1e3
|
|
60
61
|
);
|
|
61
62
|
return a < 60 ? `${a}s` : `${Math.floor(a / 60)}m ${a % 60}s`;
|
|
62
63
|
}
|
|
63
|
-
const
|
|
64
|
+
const F = {
|
|
64
65
|
required: {
|
|
65
66
|
label: "Required empty",
|
|
66
67
|
cls: "bg-red-500/10 text-red-700 dark:text-red-400"
|
|
@@ -97,33 +98,40 @@ const T = {
|
|
|
97
98
|
label: "Not an option the picker offers",
|
|
98
99
|
cls: "bg-purple-500/10 text-purple-700 dark:text-purple-400"
|
|
99
100
|
}
|
|
100
|
-
}
|
|
101
|
-
function
|
|
102
|
-
|
|
101
|
+
};
|
|
102
|
+
function z(r) {
|
|
103
|
+
return String(r ?? "").trim() || "Record with no number";
|
|
104
|
+
}
|
|
105
|
+
function K(r, a) {
|
|
106
|
+
return r[a] || ee(a);
|
|
107
|
+
}
|
|
108
|
+
const E = (r) => r.replace(/[-_]+/g, " ").replace(/^\w/, (a) => a.toUpperCase());
|
|
109
|
+
function oe({ findingId: r }) {
|
|
110
|
+
const a = B(), [s, p] = f(!1), [x, d] = f(""), [o, i] = f(!1), [g, v] = f(null), w = T({
|
|
103
111
|
queryKey: ["conformance-assign-users", x],
|
|
104
112
|
queryFn: () => a.request(M(`/users?search=${encodeURIComponent(x)}&limit=8`)).then((u) => u.data),
|
|
105
113
|
enabled: s && x.trim().length >= 2,
|
|
106
114
|
staleTime: 3e4
|
|
107
|
-
}),
|
|
108
|
-
|
|
115
|
+
}), y = async (u) => {
|
|
116
|
+
i(!0);
|
|
109
117
|
try {
|
|
110
118
|
await a.request(
|
|
111
|
-
A(`/config-conformance/findings/${
|
|
112
|
-
),
|
|
119
|
+
A(`/config-conformance/findings/${r}/assign`, { user_id: u.id })
|
|
120
|
+
), v([u.first_name, u.last_name].filter(Boolean).join(" ") || u.email), p(!1);
|
|
113
121
|
} finally {
|
|
114
|
-
|
|
122
|
+
i(!1);
|
|
115
123
|
}
|
|
116
124
|
};
|
|
117
|
-
return
|
|
125
|
+
return g ? /* @__PURE__ */ n("span", { className: "text-[11px] text-emerald-700 dark:text-emerald-400", "data-finding-assigned": !0, children: [
|
|
118
126
|
"→ ",
|
|
119
|
-
|
|
127
|
+
g
|
|
120
128
|
] }) : /* @__PURE__ */ n("span", { className: "relative inline-block", children: [
|
|
121
129
|
/* @__PURE__ */ e(
|
|
122
130
|
"button",
|
|
123
131
|
{
|
|
124
132
|
type: "button",
|
|
125
133
|
onClick: () => p((u) => !u),
|
|
126
|
-
"data-finding-assign":
|
|
134
|
+
"data-finding-assign": r,
|
|
127
135
|
className: "rounded-md border border-slate-200 px-2 py-0.5 text-[11px] text-slate-600 hover:border-slate-300 hover:text-slate-800 dark:border-border dark:text-muted-foreground",
|
|
128
136
|
title: "Assign this finding to someone as a task on the record",
|
|
129
137
|
children: "Assign…"
|
|
@@ -140,7 +148,7 @@ function re({ findingId: t }) {
|
|
|
140
148
|
{
|
|
141
149
|
autoFocus: !0,
|
|
142
150
|
value: x,
|
|
143
|
-
onChange: (u) =>
|
|
151
|
+
onChange: (u) => d(u.target.value),
|
|
144
152
|
placeholder: "Type a name…",
|
|
145
153
|
className: "h-7 w-full rounded-md border border-slate-200 bg-white px-2 text-[12px] dark:border-border dark:bg-background"
|
|
146
154
|
}
|
|
@@ -151,7 +159,7 @@ function re({ findingId: t }) {
|
|
|
151
159
|
{
|
|
152
160
|
type: "button",
|
|
153
161
|
disabled: o,
|
|
154
|
-
onClick: () => void
|
|
162
|
+
onClick: () => void y(u),
|
|
155
163
|
className: "w-full rounded px-2 py-1 text-left text-[12px] hover:bg-muted disabled:opacity-50",
|
|
156
164
|
children: [
|
|
157
165
|
[u.first_name, u.last_name].filter(Boolean).join(" ") || u.email,
|
|
@@ -166,104 +174,104 @@ function re({ findingId: t }) {
|
|
|
166
174
|
)
|
|
167
175
|
] });
|
|
168
176
|
}
|
|
169
|
-
function
|
|
170
|
-
const a = B(), s =
|
|
171
|
-
|
|
177
|
+
function we({ className: r }) {
|
|
178
|
+
const a = B(), s = I(), p = H(), x = O(), [d, o] = f(""), [i, g] = f(null), [v, w] = f(!1), [y, u] = f(null), [C, q] = f("5000"), c = X("conformance"), [$, R] = f({}), t = V(null);
|
|
179
|
+
G(
|
|
172
180
|
() => () => {
|
|
173
|
-
|
|
181
|
+
t.current && clearTimeout(t.current);
|
|
174
182
|
},
|
|
175
183
|
[]
|
|
176
|
-
),
|
|
184
|
+
), Z(
|
|
177
185
|
"conformance:progress",
|
|
178
186
|
(l) => {
|
|
179
|
-
|
|
180
|
-
const D = { ...
|
|
187
|
+
R((L) => {
|
|
188
|
+
const D = { ...L };
|
|
181
189
|
return l.status === "running" ? D[l.run] = l : delete D[l.run], D;
|
|
182
190
|
});
|
|
183
191
|
const _ = () => {
|
|
184
192
|
s.invalidateQueries({ queryKey: ["conformance-runs"] }), s.invalidateQueries({ queryKey: ["conformance-run", l.run] }), l.status !== "running" && s.invalidateQueries({ queryKey: ["conformance-collections"] });
|
|
185
193
|
};
|
|
186
|
-
l.status !== "running" ? (
|
|
187
|
-
|
|
194
|
+
l.status !== "running" ? (t.current && clearTimeout(t.current), t.current = null, _()) : t.current || (t.current = setTimeout(() => {
|
|
195
|
+
t.current = null, _();
|
|
188
196
|
}, 1500));
|
|
189
197
|
},
|
|
190
198
|
{ includeOwn: !0 }
|
|
191
199
|
);
|
|
192
|
-
const { data:
|
|
200
|
+
const { data: m = [], isLoading: h } = T(
|
|
193
201
|
{
|
|
194
202
|
queryKey: ["conformance-collections"],
|
|
195
203
|
queryFn: () => a.request(M("/config-conformance/collections")).then((l) => l.data ?? []),
|
|
196
204
|
staleTime: 5 * 6e4
|
|
197
205
|
}
|
|
198
|
-
), { data:
|
|
199
|
-
queryKey: ["conformance-runs",
|
|
206
|
+
), { data: b = [], isFetched: W } = T({
|
|
207
|
+
queryKey: ["conformance-runs", d],
|
|
200
208
|
queryFn: () => a.request(
|
|
201
|
-
M(`/config-conformance/runs${
|
|
209
|
+
M(`/config-conformance/runs${d ? `?collection=${d}` : ""}`)
|
|
202
210
|
).then((l) => l.data ?? []),
|
|
203
211
|
refetchInterval: (l) => {
|
|
204
212
|
var _;
|
|
205
|
-
return (_ = l.state.data) != null && _.some((
|
|
213
|
+
return (_ = l.state.data) != null && _.some((L) => L.status === "running") ? c ? 2e4 : 3e3 : !1;
|
|
206
214
|
}
|
|
207
|
-
}),
|
|
208
|
-
const _ =
|
|
215
|
+
}), Q = Object.values($).filter((l) => {
|
|
216
|
+
const _ = b.find((L) => L.id === l.run);
|
|
209
217
|
return !_ || _.status === "running";
|
|
210
|
-
}), S = (
|
|
211
|
-
if (
|
|
218
|
+
}), S = (i != null ? b.find((l) => l.id === i) : void 0) ?? b[0], k = m.find((l) => l.collection === d), Y = async () => {
|
|
219
|
+
if (d) {
|
|
212
220
|
w(!0), u(null);
|
|
213
221
|
try {
|
|
214
222
|
const l = await a.request(
|
|
215
|
-
A(`/config-conformance/${
|
|
216
|
-
limit:
|
|
223
|
+
A(`/config-conformance/${d}/run`, {
|
|
224
|
+
limit: C === "0" ? 0 : Number(C) || 5e3
|
|
217
225
|
})
|
|
218
226
|
);
|
|
219
|
-
|
|
227
|
+
g(l.data.id), s.invalidateQueries({ queryKey: ["conformance-runs"] });
|
|
220
228
|
} catch (l) {
|
|
221
|
-
u(
|
|
229
|
+
u(P(l, "Could not start the run"));
|
|
222
230
|
} finally {
|
|
223
231
|
w(!1);
|
|
224
232
|
}
|
|
225
233
|
}
|
|
226
234
|
};
|
|
227
|
-
return /* @__PURE__ */ n("div", { className: N("flex min-h-0 flex-1 flex-col gap-4 p-6",
|
|
228
|
-
/* @__PURE__ */ e(
|
|
235
|
+
return /* @__PURE__ */ n("div", { className: N("flex min-h-0 flex-1 flex-col gap-4 p-6", r), "data-conformance": !0, children: [
|
|
236
|
+
/* @__PURE__ */ e(re, {}),
|
|
229
237
|
/* @__PURE__ */ n("div", { className: "flex flex-wrap items-end gap-3", children: [
|
|
230
238
|
/* @__PURE__ */ n("div", { className: "w-[300px]", children: [
|
|
231
239
|
/* @__PURE__ */ e("p", { className: "mb-1 text-[11.5px] font-medium text-slate-700 dark:text-foreground", children: "Collection" }),
|
|
232
240
|
/* @__PURE__ */ e(
|
|
233
|
-
|
|
241
|
+
U,
|
|
234
242
|
{
|
|
235
|
-
value:
|
|
243
|
+
value: d,
|
|
236
244
|
onChange: (l) => {
|
|
237
|
-
o(l),
|
|
245
|
+
o(l), g(null);
|
|
238
246
|
},
|
|
239
|
-
options:
|
|
247
|
+
options: m.map((l) => ({
|
|
240
248
|
value: l.collection,
|
|
241
249
|
label: l.display_name || l.collection
|
|
242
250
|
})),
|
|
243
|
-
placeholder:
|
|
251
|
+
placeholder: h ? "Loading…" : "Choose a collection…",
|
|
244
252
|
className: "h-8"
|
|
245
253
|
}
|
|
246
254
|
)
|
|
247
255
|
] }),
|
|
248
|
-
|
|
249
|
-
|
|
256
|
+
k && /* @__PURE__ */ n("p", { className: "pb-1.5 text-[11.5px] text-slate-400", children: [
|
|
257
|
+
k.required,
|
|
250
258
|
" required · ",
|
|
251
|
-
|
|
259
|
+
k.validation,
|
|
252
260
|
" validation · ",
|
|
253
|
-
|
|
261
|
+
k.cascade,
|
|
254
262
|
" ",
|
|
255
263
|
"cascade check",
|
|
256
|
-
|
|
257
|
-
(
|
|
258
|
-
(
|
|
259
|
-
|
|
264
|
+
k.cascade === 1 ? "" : "s",
|
|
265
|
+
(k.row_rules ?? 0) > 0 && ` · ${k.row_rules} grid${k.row_rules === 1 ? "" : "s"} with row rules`,
|
|
266
|
+
(k.row_lints ?? 0) > 0 && ` · ${k.row_lints} grid${k.row_lints === 1 ? "" : "s"} with row lints`,
|
|
267
|
+
k.skipped > 0 && ` · ${k.skipped} not evaluable`
|
|
260
268
|
] }),
|
|
261
269
|
/* @__PURE__ */ n("div", { className: "w-[170px]", children: [
|
|
262
270
|
/* @__PURE__ */ e("p", { className: "mb-1 text-[11.5px] font-medium text-slate-700 dark:text-foreground", children: "Sample size" }),
|
|
263
271
|
/* @__PURE__ */ e(
|
|
264
|
-
|
|
272
|
+
U,
|
|
265
273
|
{
|
|
266
|
-
value:
|
|
274
|
+
value: C,
|
|
267
275
|
onChange: q,
|
|
268
276
|
options: [
|
|
269
277
|
{ value: "1000", label: "1,000 newest" },
|
|
@@ -282,53 +290,53 @@ function ge({ className: t }) {
|
|
|
282
290
|
"button",
|
|
283
291
|
{
|
|
284
292
|
type: "button",
|
|
285
|
-
disabled: !
|
|
286
|
-
onClick: () => void
|
|
293
|
+
disabled: !d || v || b.some((l) => l.status === "running"),
|
|
294
|
+
onClick: () => void Y(),
|
|
287
295
|
className: "h-8 rounded-md bg-nvr-cyan px-3 text-[12.5px] font-medium text-white disabled:opacity-50",
|
|
288
|
-
children:
|
|
296
|
+
children: v ? "Starting…" : "Run checks"
|
|
289
297
|
}
|
|
290
298
|
),
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
299
|
+
d && /* @__PURE__ */ e(se, { collection: d }),
|
|
300
|
+
b.filter((l) => l.status === "completed").length >= 2 && /* @__PURE__ */ e(de, { runs: b }),
|
|
301
|
+
y && /* @__PURE__ */ e("p", { className: "pb-1.5 text-[12px] text-red-600 dark:text-red-400", children: y })
|
|
294
302
|
] }),
|
|
295
|
-
|
|
303
|
+
Q.length > 0 && /* @__PURE__ */ n(
|
|
296
304
|
"div",
|
|
297
305
|
{
|
|
298
306
|
className: "flex flex-col gap-2 rounded-lg border border-slate-200 bg-white px-4 py-3 dark:border-border dark:bg-card",
|
|
299
307
|
"data-conformance-sweeps": !0,
|
|
300
308
|
children: [
|
|
301
309
|
/* @__PURE__ */ e("p", { className: "text-[10.5px] font-semibold uppercase tracking-wide text-slate-400", children: "Sweeps in progress" }),
|
|
302
|
-
|
|
310
|
+
Q.map((l) => /* @__PURE__ */ e(ae, { p: l }, l.run))
|
|
303
311
|
]
|
|
304
312
|
}
|
|
305
313
|
),
|
|
306
|
-
|
|
314
|
+
b.length > 0 && /* @__PURE__ */ e(ie, { runs: b, activeId: (S == null ? void 0 : S.id) ?? null, onSelect: g }),
|
|
307
315
|
S && /* @__PURE__ */ e(
|
|
308
|
-
|
|
316
|
+
ce,
|
|
309
317
|
{
|
|
310
318
|
run: S,
|
|
311
|
-
liveProgress:
|
|
312
|
-
live:
|
|
319
|
+
liveProgress: $[S.id] ?? null,
|
|
320
|
+
live: c,
|
|
313
321
|
onOpenItem: (l, _) => {
|
|
314
322
|
if (_) {
|
|
315
|
-
const
|
|
323
|
+
const L = p.urlFor({ collection: S.collection, itemId: l });
|
|
316
324
|
x.navigate(
|
|
317
|
-
`${
|
|
325
|
+
`${L}${L.includes("?") ? "&" : "?"}focus=${encodeURIComponent(_)}`
|
|
318
326
|
);
|
|
319
327
|
} else
|
|
320
328
|
p.open({ collection: S.collection, itemId: l });
|
|
321
329
|
}
|
|
322
330
|
}
|
|
323
331
|
),
|
|
324
|
-
!S && !
|
|
332
|
+
!S && !h && W && /* @__PURE__ */ n("div", { className: "max-w-[560px] rounded-lg border border-slate-200 bg-white p-5 dark:border-border dark:bg-card", children: [
|
|
325
333
|
/* @__PURE__ */ e("p", { className: "text-[13px] font-medium text-slate-800 dark:text-foreground", children: "Which records would fail their own form?" }),
|
|
326
334
|
/* @__PURE__ */ e("p", { className: "mt-1.5 text-[12.5px] leading-relaxed text-slate-500 dark:text-muted-foreground", children: "Field rules accumulate while data drifts underneath them — imports, integrations, and parent-link changes leave records whose values a person could never save today (“this value is not an available option”). Pick a collection and run its checks: required fields, validation rules, cascade availability, and inline-grid row rules (a labor line still priced at $40, a line whose task no longer matches its category), evaluated against the newest records." })
|
|
327
335
|
] })
|
|
328
336
|
] });
|
|
329
337
|
}
|
|
330
|
-
function
|
|
331
|
-
const a = B(), s =
|
|
338
|
+
function se({ collection: r }) {
|
|
339
|
+
const a = B(), s = I(), { data: p, isError: x } = T({
|
|
332
340
|
queryKey: ["conformance-schedules"],
|
|
333
341
|
queryFn: () => a.request(
|
|
334
342
|
M("/config-conformance/schedules")
|
|
@@ -337,25 +345,25 @@ function ae({ collection: t }) {
|
|
|
337
345
|
staleTime: 6e4
|
|
338
346
|
});
|
|
339
347
|
if (x || !p) return null;
|
|
340
|
-
const
|
|
348
|
+
const d = p.some((o) => o.collection === r && o.is_active);
|
|
341
349
|
return /* @__PURE__ */ n("label", { className: "flex shrink-0 cursor-pointer items-center gap-1.5 whitespace-nowrap pb-1.5 text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
|
|
342
350
|
/* @__PURE__ */ e(
|
|
343
351
|
"button",
|
|
344
352
|
{
|
|
345
353
|
type: "button",
|
|
346
354
|
role: "switch",
|
|
347
|
-
"aria-checked":
|
|
348
|
-
onClick: () => void a.request(
|
|
355
|
+
"aria-checked": d,
|
|
356
|
+
onClick: () => void a.request(J(`/config-conformance/schedules/${r}`, { is_active: !d })).then(() => s.invalidateQueries({ queryKey: ["conformance-schedules"] })),
|
|
349
357
|
className: N(
|
|
350
358
|
"relative h-4 w-7 shrink-0 rounded-full transition-colors",
|
|
351
|
-
|
|
359
|
+
d ? "bg-nvr-cyan" : "bg-slate-300 dark:bg-border"
|
|
352
360
|
),
|
|
353
361
|
children: /* @__PURE__ */ e(
|
|
354
362
|
"span",
|
|
355
363
|
{
|
|
356
364
|
className: N(
|
|
357
365
|
"absolute left-0 top-0.5 h-3 w-3 rounded-full bg-white transition-transform",
|
|
358
|
-
|
|
366
|
+
d ? "translate-x-3.5" : "translate-x-0.5"
|
|
359
367
|
)
|
|
360
368
|
}
|
|
361
369
|
)
|
|
@@ -364,11 +372,11 @@ function ae({ collection: t }) {
|
|
|
364
372
|
"Nightly sweep"
|
|
365
373
|
] });
|
|
366
374
|
}
|
|
367
|
-
function
|
|
368
|
-
const a =
|
|
375
|
+
function de({ runs: r }) {
|
|
376
|
+
const a = r.filter((i) => i.status === "completed").slice(0, 12).reverse();
|
|
369
377
|
if (a.length < 2) return null;
|
|
370
|
-
const s = Math.max(...a.map((
|
|
371
|
-
(
|
|
378
|
+
const s = Math.max(...a.map((i) => i.violation_count), 1), p = 90, x = 22, d = a.map(
|
|
379
|
+
(i, g) => `${g / (a.length - 1) * (p - 4) + 2},${x - 3 - i.violation_count / s * (x - 6)}`
|
|
372
380
|
).join(" "), o = a[a.length - 1].violation_count <= a[0].violation_count;
|
|
373
381
|
return /* @__PURE__ */ e(
|
|
374
382
|
"span",
|
|
@@ -378,7 +386,7 @@ function ne({ runs: t }) {
|
|
|
378
386
|
children: /* @__PURE__ */ e("svg", { width: p, height: x, className: "overflow-visible", children: /* @__PURE__ */ e(
|
|
379
387
|
"polyline",
|
|
380
388
|
{
|
|
381
|
-
points:
|
|
389
|
+
points: d,
|
|
382
390
|
fill: "none",
|
|
383
391
|
strokeWidth: "1.5",
|
|
384
392
|
className: o ? "stroke-emerald-500" : "stroke-amber-500"
|
|
@@ -387,12 +395,12 @@ function ne({ runs: t }) {
|
|
|
387
395
|
}
|
|
388
396
|
);
|
|
389
397
|
}
|
|
390
|
-
function
|
|
391
|
-
runs:
|
|
398
|
+
function ie({
|
|
399
|
+
runs: r,
|
|
392
400
|
activeId: a,
|
|
393
401
|
onSelect: s
|
|
394
402
|
}) {
|
|
395
|
-
const [p, x] = f(!1),
|
|
403
|
+
const [p, x] = f(!1), d = p ? r : r.slice(0, 5);
|
|
396
404
|
return /* @__PURE__ */ n("div", { className: "overflow-hidden rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
|
|
397
405
|
/* @__PURE__ */ n("table", { className: "w-full border-collapse text-[12px] tabular-nums", children: [
|
|
398
406
|
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ n("tr", { className: "border-b border-slate-100 text-left text-[10.5px] uppercase tracking-wide text-slate-400 dark:border-border", children: [
|
|
@@ -404,7 +412,7 @@ function le({
|
|
|
404
412
|
/* @__PURE__ */ e("th", { className: "px-2 py-1.5 font-medium", children: "Started" }),
|
|
405
413
|
/* @__PURE__ */ e("th", { className: "px-3 py-1.5 font-medium", children: "By" })
|
|
406
414
|
] }) }),
|
|
407
|
-
/* @__PURE__ */ e("tbody", { children:
|
|
415
|
+
/* @__PURE__ */ e("tbody", { children: d.map((o) => /* @__PURE__ */ n(
|
|
408
416
|
"tr",
|
|
409
417
|
{
|
|
410
418
|
onClick: () => s(o.id),
|
|
@@ -427,141 +435,145 @@ function le({
|
|
|
427
435
|
o.violation_count === 1 ? "" : "s"
|
|
428
436
|
] }) }),
|
|
429
437
|
/* @__PURE__ */ e("td", { className: "px-2 py-1.5 text-right text-slate-500 dark:text-muted-foreground", children: o.checked_records.toLocaleString() }),
|
|
430
|
-
/* @__PURE__ */ e("td", { className: "px-2 py-1.5 text-right text-slate-500 dark:text-muted-foreground", children:
|
|
438
|
+
/* @__PURE__ */ e("td", { className: "px-2 py-1.5 text-right text-slate-500 dark:text-muted-foreground", children: le(o) }),
|
|
431
439
|
/* @__PURE__ */ e(
|
|
432
440
|
"td",
|
|
433
441
|
{
|
|
434
442
|
className: "px-2 py-1.5 text-slate-500 dark:text-muted-foreground",
|
|
435
443
|
"data-tip": o.started_at ? new Date(o.started_at).toLocaleString() : void 0,
|
|
436
|
-
children:
|
|
444
|
+
children: ne(o.started_at)
|
|
437
445
|
}
|
|
438
446
|
),
|
|
439
|
-
/* @__PURE__ */ e("td", { className: "px-3 py-1.5 text-slate-500 dark:text-muted-foreground", children: o.triggered_by_name ?? "
|
|
447
|
+
/* @__PURE__ */ e("td", { className: "px-3 py-1.5 text-slate-500 dark:text-muted-foreground", children: o.triggered_by_name ?? "Scheduled" })
|
|
440
448
|
]
|
|
441
449
|
},
|
|
442
450
|
o.id
|
|
443
451
|
)) })
|
|
444
452
|
] }),
|
|
445
|
-
|
|
453
|
+
r.length > 5 && /* @__PURE__ */ e(
|
|
446
454
|
"button",
|
|
447
455
|
{
|
|
448
456
|
type: "button",
|
|
449
457
|
onClick: () => x((o) => !o),
|
|
450
458
|
className: "w-full border-t border-slate-100 py-1.5 text-[11px] text-slate-400 transition-colors hover:text-slate-600 dark:border-border dark:hover:text-muted-foreground",
|
|
451
|
-
children: p ? "Show fewer" : `Show all ${
|
|
459
|
+
children: p ? "Show fewer" : `Show all ${r.length} runs`
|
|
452
460
|
}
|
|
453
461
|
)
|
|
454
462
|
] });
|
|
455
463
|
}
|
|
456
|
-
function
|
|
457
|
-
run:
|
|
464
|
+
function ce({
|
|
465
|
+
run: r,
|
|
458
466
|
onOpenItem: a,
|
|
459
467
|
liveProgress: s,
|
|
460
468
|
live: p
|
|
461
469
|
}) {
|
|
462
|
-
const x = B(), [
|
|
463
|
-
|
|
470
|
+
const x = B(), [d, o] = f(1), [i, g] = f(""), [v, w] = f(""), [y, u] = f(!1), { data: C } = te(r.collection), q = j(() => {
|
|
471
|
+
const t = {};
|
|
472
|
+
for (const m of C ?? []) m.label && (t[m.field] = m.label);
|
|
473
|
+
return t;
|
|
474
|
+
}, [C]), { data: c } = T({
|
|
475
|
+
queryKey: ["conformance-run", r.id, d, i, v, y],
|
|
464
476
|
queryFn: () => x.request(
|
|
465
477
|
M(
|
|
466
|
-
`/config-conformance/runs/${
|
|
478
|
+
`/config-conformance/runs/${r.id}?page=${d}&limit=50${i ? `&rule=${i}` : ""}${v ? `&field=${v}` : ""}${y ? "&group=record" : ""}`
|
|
467
479
|
)
|
|
468
|
-
).then((
|
|
469
|
-
refetchInterval:
|
|
470
|
-
}),
|
|
480
|
+
).then((t) => t.data),
|
|
481
|
+
refetchInterval: r.status === "running" ? p ? 2e4 : 3e3 : !1
|
|
482
|
+
}), $ = Math.max(1, Math.ceil(((c == null ? void 0 : c.total) ?? 0) / 50)), R = j(
|
|
471
483
|
() => ({
|
|
472
|
-
rules: (
|
|
473
|
-
fields: ((
|
|
484
|
+
rules: (c == null ? void 0 : c.by_rule) ?? [],
|
|
485
|
+
fields: ((c == null ? void 0 : c.by_field) ?? []).slice(0, 12)
|
|
474
486
|
}),
|
|
475
|
-
[
|
|
487
|
+
[c]
|
|
476
488
|
);
|
|
477
489
|
return /* @__PURE__ */ n("div", { className: "flex min-h-0 flex-1 flex-col rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
|
|
478
490
|
/* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-3 border-b border-slate-100 px-4 py-2.5 dark:border-border", children: [
|
|
479
491
|
/* @__PURE__ */ n("span", { className: "text-[13px] font-semibold text-slate-800 dark:text-foreground", children: [
|
|
480
492
|
"Run #",
|
|
481
|
-
|
|
493
|
+
r.id
|
|
482
494
|
] }),
|
|
483
|
-
|
|
495
|
+
r.status === "running" && /* @__PURE__ */ n("span", { className: "flex items-center gap-1.5 text-[11.5px] text-nvr-cyan-dark dark:text-nvr-cyan", children: [
|
|
484
496
|
/* @__PURE__ */ e("span", { className: "h-1.5 w-1.5 animate-pulse rounded-full bg-nvr-cyan" }),
|
|
485
497
|
"running — ",
|
|
486
|
-
Math.max(
|
|
498
|
+
Math.max(r.checked_records, (s == null ? void 0 : s.checked) ?? 0).toLocaleString(),
|
|
487
499
|
s != null && s.total ? ` of ${s.total.toLocaleString()}` : "",
|
|
488
500
|
" checked so far"
|
|
489
501
|
] }),
|
|
490
|
-
|
|
491
|
-
|
|
502
|
+
r.status === "completed" && /* @__PURE__ */ n("span", { className: "text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
|
|
503
|
+
r.checked_records.toLocaleString(),
|
|
492
504
|
" record",
|
|
493
|
-
|
|
505
|
+
r.checked_records === 1 ? "" : "s",
|
|
494
506
|
" ",
|
|
495
507
|
"checked · ",
|
|
496
|
-
|
|
508
|
+
r.violation_count.toLocaleString(),
|
|
497
509
|
" issue",
|
|
498
|
-
|
|
499
|
-
|
|
510
|
+
r.violation_count === 1 ? "" : "s",
|
|
511
|
+
r.truncated && " · sample truncated — newest records first"
|
|
500
512
|
] }),
|
|
501
|
-
|
|
513
|
+
r.status === "error" && /* @__PURE__ */ e("span", { className: "text-[11.5px] text-red-600 dark:text-red-400", children: r.error }),
|
|
502
514
|
/* @__PURE__ */ e("span", { className: "flex-1" }),
|
|
503
515
|
/* @__PURE__ */ e("span", { className: "flex rounded-md border border-slate-200 p-0.5 dark:border-border", children: [
|
|
504
516
|
{ value: !1, label: "All issues" },
|
|
505
517
|
{ value: !0, label: "By record" }
|
|
506
|
-
].map((
|
|
518
|
+
].map((t) => /* @__PURE__ */ e(
|
|
507
519
|
"button",
|
|
508
520
|
{
|
|
509
521
|
type: "button",
|
|
510
522
|
onClick: () => {
|
|
511
|
-
u(
|
|
523
|
+
u(t.value), o(1);
|
|
512
524
|
},
|
|
513
525
|
className: N(
|
|
514
526
|
"rounded px-2 py-0.5 text-[11px] font-medium transition-colors",
|
|
515
|
-
|
|
527
|
+
y === t.value ? "bg-nvr-cyan/10 text-slate-800 dark:text-foreground" : "text-slate-400 hover:text-slate-600 dark:hover:text-muted-foreground"
|
|
516
528
|
),
|
|
517
|
-
children:
|
|
529
|
+
children: t.label
|
|
518
530
|
},
|
|
519
|
-
|
|
531
|
+
t.label
|
|
520
532
|
)) }),
|
|
521
|
-
|
|
522
|
-
var
|
|
533
|
+
R.rules.map((t) => {
|
|
534
|
+
var m, h;
|
|
523
535
|
return /* @__PURE__ */ n(
|
|
524
536
|
"button",
|
|
525
537
|
{
|
|
526
538
|
type: "button",
|
|
527
539
|
onClick: () => {
|
|
528
|
-
|
|
540
|
+
g((b) => b === t.rule ? "" : t.rule), o(1);
|
|
529
541
|
},
|
|
530
542
|
className: N(
|
|
531
543
|
"rounded-full px-2 py-0.5 text-[11px] font-medium transition-opacity",
|
|
532
|
-
((
|
|
533
|
-
|
|
544
|
+
((m = F[t.rule]) == null ? void 0 : m.cls) ?? "bg-slate-500/10 text-slate-600",
|
|
545
|
+
i && i !== t.rule && "opacity-40"
|
|
534
546
|
),
|
|
535
547
|
children: [
|
|
536
|
-
((
|
|
548
|
+
((h = F[t.rule]) == null ? void 0 : h.label) ?? E(t.rule),
|
|
537
549
|
" ",
|
|
538
|
-
Number(
|
|
550
|
+
Number(t.c).toLocaleString()
|
|
539
551
|
]
|
|
540
552
|
},
|
|
541
|
-
|
|
553
|
+
t.rule
|
|
542
554
|
);
|
|
543
555
|
})
|
|
544
556
|
] }),
|
|
545
|
-
|
|
557
|
+
R.fields.length > 1 && /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1.5 border-b border-slate-100 px-4 py-2 dark:border-border", children: R.fields.map((t) => /* @__PURE__ */ n(
|
|
546
558
|
"button",
|
|
547
559
|
{
|
|
548
560
|
type: "button",
|
|
549
561
|
onClick: () => {
|
|
550
|
-
w((
|
|
562
|
+
w((m) => m === t.field ? "" : t.field), o(1);
|
|
551
563
|
},
|
|
552
564
|
className: N(
|
|
553
|
-
"rounded border px-1.5 py-0.5
|
|
554
|
-
|
|
565
|
+
"rounded border px-1.5 py-0.5 text-[11px] transition-colors",
|
|
566
|
+
v === 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"
|
|
555
567
|
),
|
|
556
568
|
children: [
|
|
557
|
-
|
|
569
|
+
K(q, t.field),
|
|
558
570
|
" · ",
|
|
559
|
-
Number(
|
|
571
|
+
Number(t.c).toLocaleString()
|
|
560
572
|
]
|
|
561
573
|
},
|
|
562
|
-
|
|
574
|
+
t.field
|
|
563
575
|
)) }),
|
|
564
|
-
|
|
576
|
+
i && v && [
|
|
565
577
|
"cascade",
|
|
566
578
|
"option-filter",
|
|
567
579
|
"validation",
|
|
@@ -569,10 +581,10 @@ function oe({
|
|
|
569
581
|
"row-rule",
|
|
570
582
|
"required",
|
|
571
583
|
"row-input"
|
|
572
|
-
].includes(
|
|
584
|
+
].includes(i) && /* @__PURE__ */ e(ue, { run: r, rule: i, field: v, total: (c == null ? void 0 : c.total) ?? 0 }),
|
|
573
585
|
/* @__PURE__ */ n("div", { className: "min-h-0 flex-1 overflow-y-auto", children: [
|
|
574
|
-
|
|
575
|
-
|
|
586
|
+
c !== void 0 && ((c == null ? void 0 : c.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: i || v ? "No findings match the filters." : "Every checked record satisfies its field configuration." }),
|
|
587
|
+
y ? /* @__PURE__ */ e("div", { children: ((c == null ? void 0 : c.findings) ?? []).map((t) => /* @__PURE__ */ n(
|
|
576
588
|
"div",
|
|
577
589
|
{
|
|
578
590
|
className: "border-b border-slate-100 px-4 py-2 dark:border-border/60",
|
|
@@ -582,28 +594,28 @@ function oe({
|
|
|
582
594
|
"button",
|
|
583
595
|
{
|
|
584
596
|
type: "button",
|
|
585
|
-
onClick: () => a(
|
|
597
|
+
onClick: () => a(t.item_id),
|
|
586
598
|
className: "text-[12.5px] font-medium text-nvr-cyan underline decoration-dotted underline-offset-2",
|
|
587
|
-
children:
|
|
599
|
+
children: z(t.item_label)
|
|
588
600
|
}
|
|
589
601
|
),
|
|
590
602
|
/* @__PURE__ */ n("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: [
|
|
591
|
-
|
|
603
|
+
t.count,
|
|
592
604
|
" issue",
|
|
593
|
-
|
|
605
|
+
t.count === 1 ? "" : "s"
|
|
594
606
|
] })
|
|
595
607
|
] }),
|
|
596
|
-
/* @__PURE__ */ e("div", { className: "mt-1 space-y-0.5", children:
|
|
597
|
-
var
|
|
608
|
+
/* @__PURE__ */ e("div", { className: "mt-1 space-y-0.5", children: t.findings.map((m) => {
|
|
609
|
+
var h, b;
|
|
598
610
|
return /* @__PURE__ */ n("div", { className: "flex items-baseline gap-2 text-[12px]", children: [
|
|
599
611
|
/* @__PURE__ */ e(
|
|
600
612
|
"button",
|
|
601
613
|
{
|
|
602
614
|
type: "button",
|
|
603
|
-
onClick: () => a(
|
|
615
|
+
onClick: () => a(t.item_id, m.field),
|
|
604
616
|
"data-tip": "Open the record at this field",
|
|
605
|
-
className: "w-[150px] shrink-0 text-left
|
|
606
|
-
children:
|
|
617
|
+
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",
|
|
618
|
+
children: K(q, m.field)
|
|
607
619
|
}
|
|
608
620
|
),
|
|
609
621
|
/* @__PURE__ */ e(
|
|
@@ -611,19 +623,19 @@ function oe({
|
|
|
611
623
|
{
|
|
612
624
|
className: N(
|
|
613
625
|
"shrink-0 rounded-full px-2 py-0.5 text-[10.5px] font-medium",
|
|
614
|
-
((
|
|
626
|
+
((h = F[m.rule]) == null ? void 0 : h.cls) ?? "bg-slate-500/10 text-slate-600"
|
|
615
627
|
),
|
|
616
|
-
children: ((
|
|
628
|
+
children: ((b = F[m.rule]) == null ? void 0 : b.label) ?? E(m.rule)
|
|
617
629
|
}
|
|
618
630
|
),
|
|
619
|
-
/* @__PURE__ */ e("span", { className: "min-w-0 text-slate-600 dark:text-muted-foreground", children:
|
|
620
|
-
] },
|
|
631
|
+
/* @__PURE__ */ e("span", { className: "min-w-0 text-slate-600 dark:text-muted-foreground", children: m.message })
|
|
632
|
+
] }, m.id);
|
|
621
633
|
}) })
|
|
622
634
|
]
|
|
623
635
|
},
|
|
624
|
-
|
|
625
|
-
)) }) : /* @__PURE__ */ e("table", { className: "w-full border-collapse text-[12px] tabular-nums", children: /* @__PURE__ */ e("tbody", { children: ((
|
|
626
|
-
var
|
|
636
|
+
t.item_id
|
|
637
|
+
)) }) : /* @__PURE__ */ e("table", { className: "w-full border-collapse text-[12px] tabular-nums", children: /* @__PURE__ */ e("tbody", { children: ((c == null ? void 0 : c.findings) ?? []).map((t) => {
|
|
638
|
+
var m, h;
|
|
627
639
|
return /* @__PURE__ */ n(
|
|
628
640
|
"tr",
|
|
629
641
|
{
|
|
@@ -633,19 +645,19 @@ function oe({
|
|
|
633
645
|
"button",
|
|
634
646
|
{
|
|
635
647
|
type: "button",
|
|
636
|
-
onClick: () => a(
|
|
648
|
+
onClick: () => a(t.item_id),
|
|
637
649
|
className: "text-left text-nvr-cyan underline decoration-dotted underline-offset-2",
|
|
638
|
-
children:
|
|
650
|
+
children: z(t.item_label)
|
|
639
651
|
}
|
|
640
652
|
) }),
|
|
641
653
|
/* @__PURE__ */ e("td", { className: "w-[160px] px-2 py-1.5", children: /* @__PURE__ */ e(
|
|
642
654
|
"button",
|
|
643
655
|
{
|
|
644
656
|
type: "button",
|
|
645
|
-
onClick: () => a(
|
|
657
|
+
onClick: () => a(t.item_id, t.field),
|
|
646
658
|
"data-tip": "Open the record at this field",
|
|
647
|
-
className: "
|
|
648
|
-
children:
|
|
659
|
+
className: "text-[11.5px] text-slate-500 underline decoration-dotted underline-offset-2 hover:text-nvr-cyan dark:text-muted-foreground",
|
|
660
|
+
children: K(q, t.field)
|
|
649
661
|
}
|
|
650
662
|
) }),
|
|
651
663
|
/* @__PURE__ */ e("td", { className: "w-[150px] px-2 py-1.5", children: /* @__PURE__ */ e(
|
|
@@ -653,42 +665,42 @@ function oe({
|
|
|
653
665
|
{
|
|
654
666
|
className: N(
|
|
655
667
|
"rounded-full px-2 py-0.5 text-[10.5px] font-medium",
|
|
656
|
-
((
|
|
668
|
+
((m = F[t.rule]) == null ? void 0 : m.cls) ?? "bg-slate-500/10 text-slate-600"
|
|
657
669
|
),
|
|
658
|
-
children: ((
|
|
670
|
+
children: ((h = F[t.rule]) == null ? void 0 : h.label) ?? E(t.rule)
|
|
659
671
|
}
|
|
660
672
|
) }),
|
|
661
|
-
/* @__PURE__ */ e("td", { className: "px-2 py-1.5 text-slate-600 dark:text-muted-foreground", children:
|
|
662
|
-
/* @__PURE__ */ e("td", { className: "w-[120px] px-2 py-1.5 text-right", children: /* @__PURE__ */ e(
|
|
673
|
+
/* @__PURE__ */ e("td", { className: "px-2 py-1.5 text-slate-600 dark:text-muted-foreground", children: t.message }),
|
|
674
|
+
/* @__PURE__ */ e("td", { className: "w-[120px] px-2 py-1.5 text-right", children: /* @__PURE__ */ e(oe, { findingId: t.id }) })
|
|
663
675
|
]
|
|
664
676
|
},
|
|
665
|
-
|
|
677
|
+
t.id
|
|
666
678
|
);
|
|
667
679
|
}) }) })
|
|
668
680
|
] }),
|
|
669
|
-
|
|
681
|
+
$ > 1 && /* @__PURE__ */ n("div", { className: "flex items-center justify-between border-t border-slate-100 px-4 py-2 text-[11.5px] text-slate-500 dark:border-border dark:text-muted-foreground", children: [
|
|
670
682
|
/* @__PURE__ */ e(
|
|
671
683
|
"button",
|
|
672
684
|
{
|
|
673
685
|
type: "button",
|
|
674
|
-
disabled:
|
|
675
|
-
onClick: () => o((
|
|
686
|
+
disabled: d <= 1,
|
|
687
|
+
onClick: () => o((t) => t - 1),
|
|
676
688
|
className: "disabled:opacity-40",
|
|
677
689
|
children: "← Previous"
|
|
678
690
|
}
|
|
679
691
|
),
|
|
680
692
|
/* @__PURE__ */ n("span", { children: [
|
|
681
693
|
"Page ",
|
|
682
|
-
|
|
694
|
+
d,
|
|
683
695
|
" of ",
|
|
684
|
-
|
|
696
|
+
$
|
|
685
697
|
] }),
|
|
686
698
|
/* @__PURE__ */ e(
|
|
687
699
|
"button",
|
|
688
700
|
{
|
|
689
701
|
type: "button",
|
|
690
|
-
disabled:
|
|
691
|
-
onClick: () => o((
|
|
702
|
+
disabled: d >= $,
|
|
703
|
+
onClick: () => o((t) => t + 1),
|
|
692
704
|
className: "disabled:opacity-40",
|
|
693
705
|
children: "Next →"
|
|
694
706
|
}
|
|
@@ -696,26 +708,26 @@ function oe({
|
|
|
696
708
|
] })
|
|
697
709
|
] });
|
|
698
710
|
}
|
|
699
|
-
function
|
|
700
|
-
run:
|
|
711
|
+
function ue({
|
|
712
|
+
run: r,
|
|
701
713
|
rule: a,
|
|
702
714
|
field: s,
|
|
703
715
|
total: p
|
|
704
716
|
}) {
|
|
705
|
-
const x = B(),
|
|
706
|
-
if (p === 0 && !
|
|
707
|
-
const
|
|
717
|
+
const x = B(), d = I(), o = O(), [i, g] = f(null), [v, w] = f(!1), [y, u] = f(null), [C, q] = f(!1);
|
|
718
|
+
if (p === 0 && !y) return null;
|
|
719
|
+
const c = () => {
|
|
708
720
|
q(!0), x.request(
|
|
709
|
-
A(`/config-conformance/runs/${
|
|
710
|
-
).then((
|
|
711
|
-
},
|
|
712
|
-
w(!0), x.request(A(`/config-conformance/runs/${
|
|
713
|
-
const
|
|
721
|
+
A(`/config-conformance/runs/${r.id}/plan`, { field: s, rule: a })
|
|
722
|
+
).then((t) => o.navigate(`/ai-plans?plan=${encodeURIComponent(t.data.plan_id)}`)).catch((t) => u(t.message)).finally(() => q(!1));
|
|
723
|
+
}, $ = a === "row-rule" ? "rederive" : ["cascade", "option-filter", "validation", "display"].includes(a) ? "clear" : null, R = (t) => {
|
|
724
|
+
w(!0), x.request(A(`/config-conformance/runs/${r.id}/remediate`, { action: t, field: s, rule: a })).then((m) => {
|
|
725
|
+
const h = m.data, b = h.failed ? ` — ${h.failed} failed` : "";
|
|
714
726
|
u(
|
|
715
|
-
|
|
716
|
-
),
|
|
717
|
-
}).catch((
|
|
718
|
-
w(!1),
|
|
727
|
+
t === "apply-high" ? `Applied confident fixes on ${h.applied ?? 0} record(s); ${h.skipped ?? 0} need a person${b}. Re-run the checks to confirm.` : t === "rederive" ? `Re-derived ${h.lines ?? 0} line(s) across ${h.records ?? 0} record(s)${b}. Re-run the checks to confirm.` : `Cleared on ${h.cleared ?? 0} record(s)${b}. Re-run the checks to confirm.`
|
|
728
|
+
), d.invalidateQueries({ queryKey: ["conformance-run", r.id] });
|
|
729
|
+
}).catch((m) => u(m.message)).finally(() => {
|
|
730
|
+
w(!1), g(null);
|
|
719
731
|
});
|
|
720
732
|
};
|
|
721
733
|
return /* @__PURE__ */ n("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: [
|
|
@@ -724,25 +736,25 @@ function se({
|
|
|
724
736
|
/* @__PURE__ */ e("span", { className: "font-mono", children: s }),
|
|
725
737
|
" across the affected records — each write is revisioned and attributed to you."
|
|
726
738
|
] }),
|
|
727
|
-
|
|
739
|
+
y ? /* @__PURE__ */ e("span", { className: "text-[11.5px] font-medium text-emerald-600 dark:text-emerald-400", children: y }) : i ? /* @__PURE__ */ n("span", { className: "flex items-center gap-2", children: [
|
|
728
740
|
/* @__PURE__ */ e(
|
|
729
741
|
"button",
|
|
730
742
|
{
|
|
731
743
|
type: "button",
|
|
732
|
-
disabled:
|
|
733
|
-
onClick: () =>
|
|
744
|
+
disabled: v,
|
|
745
|
+
onClick: () => R(i),
|
|
734
746
|
className: N(
|
|
735
747
|
"h-6 rounded-md px-2.5 text-[11.5px] font-medium text-white disabled:opacity-50",
|
|
736
|
-
|
|
748
|
+
i === "clear" ? "bg-red-600" : i === "rederive" ? "bg-orange-600" : "bg-emerald-600"
|
|
737
749
|
),
|
|
738
|
-
children:
|
|
750
|
+
children: v ? "Working…" : i === "apply-high" ? `Yes, apply confident fixes on ${p.toLocaleString()} record(s)` : i === "rederive" ? `Yes, re-run rules on ${p.toLocaleString()} record(s)` : `Yes, clear ${p.toLocaleString()} value(s)`
|
|
739
751
|
}
|
|
740
752
|
),
|
|
741
753
|
/* @__PURE__ */ e(
|
|
742
754
|
"button",
|
|
743
755
|
{
|
|
744
756
|
type: "button",
|
|
745
|
-
onClick: () =>
|
|
757
|
+
onClick: () => g(null),
|
|
746
758
|
className: "text-[11.5px] text-slate-400 hover:text-slate-600",
|
|
747
759
|
children: "Cancel"
|
|
748
760
|
}
|
|
@@ -752,7 +764,7 @@ function se({
|
|
|
752
764
|
"button",
|
|
753
765
|
{
|
|
754
766
|
type: "button",
|
|
755
|
-
onClick: () =>
|
|
767
|
+
onClick: () => g("apply-high"),
|
|
756
768
|
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.",
|
|
757
769
|
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",
|
|
758
770
|
children: "Apply confident fixes…"
|
|
@@ -762,28 +774,30 @@ function se({
|
|
|
762
774
|
"button",
|
|
763
775
|
{
|
|
764
776
|
type: "button",
|
|
765
|
-
disabled:
|
|
766
|
-
onClick:
|
|
777
|
+
disabled: C,
|
|
778
|
+
onClick: c,
|
|
767
779
|
"data-tip": "Build the same confident fixes as a plan: review every record’s old → new value, then approve, schedule or discard it.",
|
|
768
780
|
className: "h-6 rounded-md border border-slate-200 px-2.5 text-[11.5px] font-medium text-slate-600 hover:border-nvr-cyan hover:text-nvr-cyan disabled:opacity-50 dark:border-border dark:text-muted-foreground",
|
|
769
|
-
children:
|
|
781
|
+
children: C ? "Building plan…" : "Fix as a plan…"
|
|
770
782
|
}
|
|
771
783
|
),
|
|
772
|
-
|
|
784
|
+
$ && /* @__PURE__ */ e(
|
|
773
785
|
"button",
|
|
774
786
|
{
|
|
775
787
|
type: "button",
|
|
776
|
-
onClick: () =>
|
|
788
|
+
onClick: () => g($),
|
|
777
789
|
className: N(
|
|
778
790
|
"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",
|
|
779
|
-
|
|
791
|
+
$ === "rederive" ? "hover:border-orange-300 hover:text-orange-600" : "hover:border-red-300 hover:text-red-600"
|
|
780
792
|
),
|
|
781
|
-
children:
|
|
793
|
+
children: $ === "rederive" ? "Re-run rules…" : "Clear values…"
|
|
782
794
|
}
|
|
783
795
|
)
|
|
784
796
|
] })
|
|
785
797
|
] });
|
|
786
798
|
}
|
|
787
799
|
export {
|
|
788
|
-
|
|
800
|
+
we as ConformanceView,
|
|
801
|
+
K as findingFieldLabel,
|
|
802
|
+
z as findingRecordName
|
|
789
803
|
};
|