@nivaro/react 0.3.117 → 0.3.119
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 +136 -14
- package/dist/index.js +488 -485
- package/dist/shared/components/ActivityEntry.js +130 -125
- package/dist/shared/components/AgentPresenceChip.js +36 -26
- package/dist/shared/components/CellCopyLayer.js +50 -45
- package/dist/shared/components/CollectionBrowserView.js +3757 -3695
- package/dist/shared/components/FilePreviewLightbox.js +96 -58
- package/dist/shared/components/InStep.js +18 -17
- package/dist/shared/components/ItemEditForm.js +4451 -4385
- package/dist/shared/components/JobsTray.js +8 -8
- package/dist/shared/components/LiveNewMatchesPill.js +21 -14
- package/dist/shared/components/LiveOffNote.js +3 -2
- package/dist/shared/components/LiveRowMark.js +53 -23
- package/dist/shared/components/LiveTraceView.js +162 -123
- package/dist/shared/components/MyWorkView.js +320 -299
- package/dist/shared/components/NotificationBell.js +14 -14
- package/dist/shared/components/OverflowRail.js +1 -1
- package/dist/shared/components/PageRenderer.js +120 -116
- package/dist/shared/components/ProfileView.js +203 -202
- package/dist/shared/components/RealtimeStatusBanner.js +31 -29
- package/dist/shared/components/RecordDrilldownSheet.js +7 -7
- package/dist/shared/components/RecordHoverCard.js +102 -84
- package/dist/shared/components/RecordReadView.js +146 -146
- package/dist/shared/components/ScreenRefreshButton.js +34 -32
- package/dist/shared/components/TipLayer.js +65 -58
- package/dist/shared/components/WidgetImageMenu.js +83 -43
- package/dist/shared/components/activity/RecordActivityStream.js +175 -173
- package/dist/shared/components/bulk/BulkSelectionNotices.js +142 -119
- package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +158 -143
- package/dist/shared/components/change-proposals/ProposeChangeButton.js +17 -11
- package/dist/shared/components/change-proposals/ProposeChangeDialog.js +201 -173
- package/dist/shared/components/chat/ChatAnalyticsView.js +27 -27
- package/dist/shared/components/chat/HuddleAnalyticsTab.js +17 -17
- package/dist/shared/components/collections-directory/CollectionsToolbar.js +39 -41
- package/dist/shared/components/collections-directory/page-model.js +72 -67
- package/dist/shared/components/integrations/RecordIntegrationPreview.js +48 -56
- package/dist/shared/components/integrations/SendStatus.js +65 -59
- package/dist/shared/components/integrations/console/ReadyToSendView.js +275 -209
- package/dist/shared/components/integrations/console/SignalCard.js +237 -230
- package/dist/shared/components/item-edit/CatalogPickerField.js +227 -205
- package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +135 -94
- package/dist/shared/components/item-edit/CloneDialog.js +191 -161
- package/dist/shared/components/item-edit/DerivedCauseNote.js +44 -30
- package/dist/shared/components/item-edit/DraftRecoveryBanner.js +153 -134
- package/dist/shared/components/item-edit/FieldComments.js +88 -85
- package/dist/shared/components/item-edit/FieldPointer.js +82 -67
- package/dist/shared/components/item-edit/FieldRow.js +106 -100
- package/dist/shared/components/item-edit/FieldSourceBadge.js +58 -56
- package/dist/shared/components/item-edit/FilePickerField.js +452 -387
- package/dist/shared/components/item-edit/HeaderSummaryChip.js +78 -56
- package/dist/shared/components/item-edit/HeaderTools.js +245 -141
- package/dist/shared/components/item-edit/InlineTableField.js +1242 -1218
- package/dist/shared/components/item-edit/ListNeighborNav.js +47 -50
- package/dist/shared/components/item-edit/LiveTraceSheet.js +15 -10
- package/dist/shared/components/item-edit/MembershipSetField.js +285 -254
- package/dist/shared/components/item-edit/OutboxReviewTray.js +155 -144
- package/dist/shared/components/item-edit/QueueReturnChip.js +15 -36
- package/dist/shared/components/item-edit/RecalcValue.js +57 -32
- package/dist/shared/components/item-edit/RecordHelpChip.js +15 -16
- package/dist/shared/components/item-edit/RecordLiveSync.js +283 -231
- package/dist/shared/components/item-edit/RelationCombobox.js +439 -393
- package/dist/shared/components/item-edit/RemoteChangeUi.js +292 -224
- package/dist/shared/components/item-edit/RemoteUploads.js +26 -20
- package/dist/shared/components/item-edit/RemovedLineNote.js +77 -67
- package/dist/shared/components/item-edit/RichTextEditorImpl.js +184 -179
- package/dist/shared/components/item-edit/ScheduledChangeChip.js +168 -134
- package/dist/shared/components/item-edit/SectionPresence.js +18 -10
- package/dist/shared/components/item-edit/SplitLinesButton.js +163 -139
- package/dist/shared/components/item-edit/UserChip.js +1 -1
- package/dist/shared/components/item-edit/addendum-view.js +6 -0
- package/dist/shared/components/item-edit/file-live.js +69 -54
- package/dist/shared/components/item-edit/layout-switch.js +98 -89
- package/dist/shared/components/item-edit/partner-needs.js +12 -12
- package/dist/shared/components/item-edit/removed-line.js +31 -25
- package/dist/shared/components/layout-editor/pickers/field-picker.js +151 -130
- package/dist/shared/components/list/ListViewers.js +46 -35
- package/dist/shared/components/notifications/NotificationCenterView.js +479 -437
- package/dist/shared/components/panels/AccessDeniedPanel.js +176 -101
- package/dist/shared/components/panels/AlertBanners.js +82 -72
- package/dist/shared/components/panels/BranchLanes.js +22 -22
- package/dist/shared/components/panels/CommentImages.js +123 -102
- package/dist/shared/components/panels/CommentPanel.js +186 -185
- package/dist/shared/components/panels/ExternalRequestsChip.js +111 -119
- package/dist/shared/components/panels/OwnerOpenedLine.js +31 -24
- package/dist/shared/components/panels/PipelinePanel.js +2037 -1885
- package/dist/shared/components/panels/ResubmissionDiff.js +163 -142
- package/dist/shared/components/pipeline/OwnerMatrixSheet.js +400 -288
- package/dist/shared/components/pipeline/PipelineEditorView.js +7 -2
- package/dist/shared/components/profile/AgentNameField.js +107 -81
- package/dist/shared/components/profile/AgentsPanel.js +184 -184
- package/dist/shared/components/profile/PersonAccess.js +599 -495
- package/dist/shared/components/profile/SignInTroubleshooter.js +160 -127
- package/dist/shared/components/profile/SignedInDevices.js +17 -17
- package/dist/shared/components/profile/primitives.js +1 -1
- package/dist/shared/components/queue/OwnerAvatars.js +91 -54
- package/dist/shared/components/queue/QueueTeamStrip.js +56 -46
- package/dist/shared/components/queue/QueueWorklist.js +1002 -983
- package/dist/shared/components/support/AssignRules.js +1733 -0
- package/dist/shared/components/support/PersonPick.js +88 -0
- package/dist/shared/components/support/RequestList.js +790 -0
- package/dist/shared/components/support/ScreenShare.js +158 -152
- package/dist/shared/components/support/SupportRequestDialog.js +50 -48
- package/dist/shared/components/support/SupportView.js +140 -246
- package/dist/shared/components/support/TicketDetailSheet.js +82 -75
- package/dist/shared/components/support/TicketSlowScreens.js +9 -9
- package/dist/shared/components/support/assign-rules-text.js +171 -0
- package/dist/shared/components/support/support-list.js +125 -0
- package/dist/shared/components/ui/SimpleSelect.js +28 -20
- package/dist/shared/components/ui/checkbox.js +6 -6
- package/dist/shared/components/ui/select.js +43 -39
- package/dist/shared/components/ui/sheet.js +9 -9
- package/dist/shared/components/ui/switch.js +12 -11
- package/dist/shared/components/watch-list/WatchDock.js +532 -459
- package/dist/shared/components/watch-list/WatchExtras.js +332 -286
- package/dist/shared/components/watch-list/WatchRows.js +164 -140
- package/dist/shared/lib/activity-sentence.js +103 -91
- package/dist/shared/lib/agent-presence.js +27 -21
- package/dist/shared/lib/approval-progress.js +2 -2
- package/dist/shared/lib/copy-rules.js +31 -24
- package/dist/shared/lib/derived-causes.js +113 -78
- package/dist/shared/lib/grid-cursors.js +26 -26
- package/dist/shared/lib/label-flash.js +27 -0
- package/dist/shared/lib/list-return.js +137 -125
- package/dist/shared/lib/live-deltas.js +40 -34
- package/dist/shared/lib/live-groups.js +56 -52
- package/dist/shared/lib/live-preference.js +64 -59
- package/dist/shared/lib/live-screen.js +223 -192
- package/dist/shared/lib/partner-failure.js +11 -11
- package/dist/shared/lib/rollup-recalc.js +68 -64
- package/dist/shared/lib/screen-refresh.js +74 -68
- package/dist/shared/lib/screen-share.js +108 -104
- package/dist/shared/lib/send-status.js +77 -61
- package/dist/shared/lib/text-diff-window.js +29 -0
- package/dist/shared/lib/watch-list.js +210 -209
- package/dist/shared/lib/widget-image-render.js +72 -49
- package/package.json +1 -1
|
@@ -1,307 +1,368 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { Loader2 as
|
|
4
|
-
import { useRef as
|
|
5
|
-
import { createPortal as
|
|
6
|
-
import { toast as
|
|
7
|
-
import { useApiFetchConfig as
|
|
8
|
-
import { toastError as
|
|
9
|
-
import { ErrorNotice as
|
|
10
|
-
import { Button as
|
|
11
|
-
import { OwnerRecordTrial as
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import { jsxs as s, Fragment as W, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useQueryClient as K } from "@tanstack/react-query";
|
|
3
|
+
import { Loader2 as D, Download as M, Upload as Q, FileSpreadsheet as I, X as V, CircleAlert as U, ChevronDown as j, AlertTriangle as H, Plus as G, Minus as X } from "lucide-react";
|
|
4
|
+
import { useRef as J, useState as f, useEffect as Y } from "react";
|
|
5
|
+
import { createPortal as Z } from "react-dom";
|
|
6
|
+
import { toast as ee } from "sonner";
|
|
7
|
+
import { useApiFetchConfig as te } from "../../context.js";
|
|
8
|
+
import { toastError as z } from "../../lib/error-toast.js";
|
|
9
|
+
import { ErrorNotice as re } from "../ErrorNotice.js";
|
|
10
|
+
import { Button as T } from "../ui/button.js";
|
|
11
|
+
import { OwnerRecordTrial as ae } from "./OwnerRecordTrial.js";
|
|
12
|
+
function se(t) {
|
|
13
|
+
var a, e;
|
|
14
|
+
const d = (e = (a = /\.([a-z0-9]+)$/i.exec(t)) == null ? void 0 : a[1]) == null ? void 0 : e.toLowerCase();
|
|
15
|
+
return {
|
|
16
|
+
title: d && !["xlsx", "xlsm", "xls"].includes(d) ? `This ${d.toUpperCase()} file is not the owner matrix` : "This file is not the owner matrix",
|
|
17
|
+
hint: "Upload the .xlsx file you got from Download as Excel, after editing it. Its Owners sheet is what is read."
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function de(t, d) {
|
|
21
|
+
var o, i;
|
|
22
|
+
const a = t;
|
|
23
|
+
if (!a || !["UNREADABLE", "NO_FILE", "FILE_TOO_LARGE"].includes(String(a.code))) return;
|
|
24
|
+
const e = (i = (o = /\.([a-z0-9]+)$/i.exec(d ?? "")) == null ? void 0 : o[1]) == null ? void 0 : i.toLowerCase();
|
|
25
|
+
return e && !["xlsx", "xlsm", "xls"].includes(e) ? {
|
|
26
|
+
title: `This ${e.toUpperCase()} file has no owner matrix in it`,
|
|
27
|
+
hint: "Upload the .xlsx file you got from Download as Excel, after editing it.",
|
|
28
|
+
code: a.code,
|
|
29
|
+
status: a.status
|
|
30
|
+
} : {
|
|
31
|
+
title: a.message || "This file could not be read",
|
|
32
|
+
hint: "Upload the file you got from Download as Excel — its Owners sheet is what is read.",
|
|
33
|
+
code: a.code,
|
|
34
|
+
status: a.status
|
|
35
|
+
};
|
|
21
36
|
}
|
|
22
|
-
const
|
|
23
|
-
function
|
|
24
|
-
templateId:
|
|
25
|
-
collections:
|
|
37
|
+
const p = (t, d, a = `${d}s`) => `${t} ${t === 1 ? d : a}`;
|
|
38
|
+
function _e({
|
|
39
|
+
templateId: t,
|
|
40
|
+
collections: d
|
|
26
41
|
}) {
|
|
27
|
-
const a =
|
|
28
|
-
async function
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
const
|
|
42
|
+
const a = te(), e = K(), o = J(null), [i, h] = f(!1), [c, O] = f(null), [y, v] = f(null), [b, _] = f(!1), [A, k] = f(!1), [S, x] = f(null), [E, g] = f(!1), $ = `${a.apiBase}/pipelines/${encodeURIComponent(t)}/owner-matrix/sheet`;
|
|
43
|
+
async function C(n, l) {
|
|
44
|
+
const w = new FormData();
|
|
45
|
+
w.append("file", l, l.name);
|
|
46
|
+
const N = await fetch(`${$}${n}`, {
|
|
32
47
|
method: "POST",
|
|
33
48
|
headers: a.authHeaders,
|
|
34
49
|
credentials: a.credentials,
|
|
35
|
-
body:
|
|
36
|
-
}),
|
|
37
|
-
if (!
|
|
38
|
-
throw Object.assign(new Error((
|
|
39
|
-
status:
|
|
40
|
-
code:
|
|
41
|
-
data:
|
|
50
|
+
body: w
|
|
51
|
+
}), u = await N.json().catch(() => ({}));
|
|
52
|
+
if (!N.ok)
|
|
53
|
+
throw Object.assign(new Error((u == null ? void 0 : u.error) || N.statusText), {
|
|
54
|
+
status: N.status,
|
|
55
|
+
code: u == null ? void 0 : u.code,
|
|
56
|
+
data: u == null ? void 0 : u.data
|
|
42
57
|
});
|
|
43
|
-
return
|
|
58
|
+
return u.data;
|
|
44
59
|
}
|
|
45
|
-
async function
|
|
46
|
-
var
|
|
47
|
-
|
|
60
|
+
async function m() {
|
|
61
|
+
var n;
|
|
62
|
+
h(!0);
|
|
48
63
|
try {
|
|
49
|
-
const
|
|
64
|
+
const l = await fetch($, {
|
|
50
65
|
headers: a.authHeaders,
|
|
51
66
|
credentials: a.credentials
|
|
52
67
|
});
|
|
53
|
-
if (!
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
} catch (
|
|
57
|
-
|
|
68
|
+
if (!l.ok) throw Object.assign(new Error(l.statusText), { status: l.status });
|
|
69
|
+
const w = ((n = /filename="([^"]+)"/.exec(l.headers.get("content-disposition") ?? "")) == null ? void 0 : n[1]) ?? "owner matrix.xlsx", N = URL.createObjectURL(await l.blob()), u = document.createElement("a");
|
|
70
|
+
u.href = N, u.download = w, u.click(), URL.revokeObjectURL(N);
|
|
71
|
+
} catch (l) {
|
|
72
|
+
z(l, "Could not download the owner matrix");
|
|
58
73
|
} finally {
|
|
59
|
-
|
|
74
|
+
h(!1);
|
|
60
75
|
}
|
|
61
76
|
}
|
|
62
|
-
async function
|
|
63
|
-
|
|
77
|
+
async function R(n) {
|
|
78
|
+
O(n), v(null), x(null), g(!1), _(!0);
|
|
64
79
|
try {
|
|
65
|
-
|
|
66
|
-
} catch (
|
|
67
|
-
|
|
80
|
+
v(await C("/preview", n));
|
|
81
|
+
} catch (l) {
|
|
82
|
+
x(l);
|
|
68
83
|
} finally {
|
|
69
|
-
|
|
84
|
+
_(!1);
|
|
70
85
|
}
|
|
71
86
|
}
|
|
72
|
-
function
|
|
73
|
-
|
|
87
|
+
function P() {
|
|
88
|
+
O(null), v(null), x(null), g(!1);
|
|
74
89
|
}
|
|
75
|
-
async function
|
|
76
|
-
if (!(!
|
|
77
|
-
|
|
90
|
+
async function q() {
|
|
91
|
+
if (!(!c || !y)) {
|
|
92
|
+
k(!0);
|
|
78
93
|
try {
|
|
79
|
-
await
|
|
80
|
-
const
|
|
81
|
-
|
|
94
|
+
await C(`/apply?hash=${y.plan_hash}`, c);
|
|
95
|
+
const n = y.counts;
|
|
96
|
+
ee.success("Owner matrix updated", {
|
|
82
97
|
description: [
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
98
|
+
n.groups_added && `${p(n.groups_added, "group")} added`,
|
|
99
|
+
n.groups_removed && `${p(n.groups_removed, "group")} removed`,
|
|
100
|
+
n.groups_changed && `${p(n.groups_changed, "group")} changed`
|
|
86
101
|
].filter(Boolean).join(", ")
|
|
87
|
-
}),
|
|
88
|
-
} catch (
|
|
89
|
-
const
|
|
90
|
-
|
|
102
|
+
}), e.invalidateQueries({ queryKey: ["pipeline-all-owner-groups", t] }), e.invalidateQueries({ queryKey: ["owner-matrix-versions", t] }), e.invalidateQueries({ queryKey: ["owner-preview", t] }), P();
|
|
103
|
+
} catch (n) {
|
|
104
|
+
const l = n;
|
|
105
|
+
l.code === "OWNER_SHEET_STALE" || l.code === "OWNER_SHEET_PROBLEMS" ? (l.data && v(l.data), g(l.code === "OWNER_SHEET_STALE"), l.code === "OWNER_SHEET_STALE" && !l.data && c && R(c)) : z(n, "Could not apply the spreadsheet");
|
|
91
106
|
} finally {
|
|
92
|
-
|
|
107
|
+
k(!1);
|
|
93
108
|
}
|
|
94
109
|
}
|
|
95
110
|
}
|
|
96
|
-
return /* @__PURE__ */
|
|
97
|
-
/* @__PURE__ */
|
|
98
|
-
|
|
111
|
+
return /* @__PURE__ */ s(W, { children: [
|
|
112
|
+
/* @__PURE__ */ s(
|
|
113
|
+
T,
|
|
99
114
|
{
|
|
100
115
|
size: "sm",
|
|
101
116
|
variant: "outline",
|
|
102
117
|
className: "h-7 shrink-0 gap-1.5 text-[12px]",
|
|
103
|
-
onClick:
|
|
104
|
-
disabled:
|
|
118
|
+
onClick: m,
|
|
119
|
+
disabled: i,
|
|
105
120
|
"data-owner-sheet-download": !0,
|
|
106
121
|
children: [
|
|
107
|
-
|
|
122
|
+
i ? /* @__PURE__ */ r(D, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ r(M, { className: "h-3.5 w-3.5" }),
|
|
108
123
|
"Download as Excel"
|
|
109
124
|
]
|
|
110
125
|
}
|
|
111
126
|
),
|
|
112
|
-
/* @__PURE__ */
|
|
113
|
-
|
|
127
|
+
/* @__PURE__ */ s(
|
|
128
|
+
T,
|
|
114
129
|
{
|
|
115
130
|
size: "sm",
|
|
116
131
|
variant: "outline",
|
|
117
132
|
className: "h-7 shrink-0 gap-1.5 text-[12px]",
|
|
118
133
|
onClick: () => {
|
|
119
|
-
var
|
|
120
|
-
return (
|
|
134
|
+
var n;
|
|
135
|
+
return (n = o.current) == null ? void 0 : n.click();
|
|
121
136
|
},
|
|
122
137
|
"data-owner-sheet-upload": !0,
|
|
123
138
|
children: [
|
|
124
|
-
/* @__PURE__ */
|
|
139
|
+
/* @__PURE__ */ r(Q, { className: "h-3.5 w-3.5" }),
|
|
125
140
|
"Upload"
|
|
126
141
|
]
|
|
127
142
|
}
|
|
128
143
|
),
|
|
129
|
-
/* @__PURE__ */
|
|
144
|
+
/* @__PURE__ */ r(
|
|
130
145
|
"input",
|
|
131
146
|
{
|
|
132
|
-
ref:
|
|
147
|
+
ref: o,
|
|
133
148
|
type: "file",
|
|
134
149
|
accept: ".xlsx,.xlsm,.xls,.csv",
|
|
135
150
|
className: "hidden",
|
|
136
|
-
onChange: (
|
|
137
|
-
var
|
|
138
|
-
const
|
|
139
|
-
|
|
151
|
+
onChange: (n) => {
|
|
152
|
+
var w;
|
|
153
|
+
const l = (w = n.target.files) == null ? void 0 : w[0];
|
|
154
|
+
n.target.value = "", l && R(l);
|
|
140
155
|
}
|
|
141
156
|
}
|
|
142
157
|
),
|
|
143
|
-
|
|
144
|
-
|
|
158
|
+
c && /* @__PURE__ */ r(
|
|
159
|
+
oe,
|
|
145
160
|
{
|
|
146
|
-
templateId:
|
|
147
|
-
collections:
|
|
148
|
-
fileName:
|
|
149
|
-
preview:
|
|
150
|
-
loading:
|
|
151
|
-
error:
|
|
152
|
-
stale:
|
|
153
|
-
applying:
|
|
154
|
-
onRetry: () =>
|
|
161
|
+
templateId: t,
|
|
162
|
+
collections: d,
|
|
163
|
+
fileName: c.name,
|
|
164
|
+
preview: y,
|
|
165
|
+
loading: b,
|
|
166
|
+
error: S,
|
|
167
|
+
stale: E,
|
|
168
|
+
applying: A,
|
|
169
|
+
onRetry: () => c && void R(c),
|
|
155
170
|
onPickAnother: () => {
|
|
156
|
-
var
|
|
157
|
-
return (
|
|
171
|
+
var n;
|
|
172
|
+
return (n = o.current) == null ? void 0 : n.click();
|
|
158
173
|
},
|
|
159
|
-
onApply:
|
|
160
|
-
onClose:
|
|
174
|
+
onApply: q,
|
|
175
|
+
onClose: P
|
|
161
176
|
}
|
|
162
177
|
)
|
|
163
178
|
] });
|
|
164
179
|
}
|
|
165
|
-
function
|
|
166
|
-
templateId:
|
|
167
|
-
collections:
|
|
180
|
+
function oe({
|
|
181
|
+
templateId: t,
|
|
182
|
+
collections: d,
|
|
168
183
|
fileName: a,
|
|
169
|
-
preview:
|
|
170
|
-
loading:
|
|
171
|
-
error:
|
|
172
|
-
stale:
|
|
173
|
-
applying:
|
|
174
|
-
onRetry:
|
|
175
|
-
onPickAnother:
|
|
176
|
-
onApply:
|
|
177
|
-
onClose:
|
|
184
|
+
preview: e,
|
|
185
|
+
loading: o,
|
|
186
|
+
error: i,
|
|
187
|
+
stale: h,
|
|
188
|
+
applying: c,
|
|
189
|
+
onRetry: O,
|
|
190
|
+
onPickAnother: y,
|
|
191
|
+
onApply: v,
|
|
192
|
+
onClose: b
|
|
178
193
|
}) {
|
|
179
|
-
const [
|
|
180
|
-
|
|
181
|
-
const m = (
|
|
182
|
-
|
|
194
|
+
const [_, A] = f(!1);
|
|
195
|
+
Y(() => {
|
|
196
|
+
const m = (R) => {
|
|
197
|
+
R.key === "Escape" && !c && b();
|
|
183
198
|
};
|
|
184
199
|
return window.addEventListener("keydown", m), () => window.removeEventListener("keydown", m);
|
|
185
|
-
}, [
|
|
186
|
-
const
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
200
|
+
}, [b, c]);
|
|
201
|
+
const k = !!e && e.errors > 0, S = !!e && !k && !e.nothing_to_do && !o, x = !o && !!e && e.rows === 0 && e.errors > 0 && e.problems.every((m) => m.row == null), E = i != null ? de(i, a) : x ? se(a) : void 0, g = !o && (i != null || x), $ = !o && !g && !!e && e.nothing_to_do && !k, C = new Set(
|
|
202
|
+
((e == null ? void 0 : e.problems) ?? []).filter((m) => m.severity === "error" && m.row != null).map((m) => m.row)
|
|
203
|
+
);
|
|
204
|
+
return Z(
|
|
205
|
+
/* @__PURE__ */ s("div", { className: "fixed inset-0 z-[120]", "data-owner-sheet-drawer": !0, children: [
|
|
206
|
+
/* @__PURE__ */ r(
|
|
190
207
|
"button",
|
|
191
208
|
{
|
|
192
209
|
type: "button",
|
|
193
210
|
"aria-label": "Close",
|
|
194
211
|
className: "absolute inset-0 bg-black/30",
|
|
195
|
-
onClick: () => !
|
|
212
|
+
onClick: () => !c && b()
|
|
196
213
|
}
|
|
197
214
|
),
|
|
198
|
-
/* @__PURE__ */
|
|
215
|
+
/* @__PURE__ */ s(
|
|
199
216
|
"div",
|
|
200
217
|
{
|
|
201
218
|
role: "dialog",
|
|
202
219
|
"aria-label": "Review the uploaded owner matrix",
|
|
203
220
|
className: "absolute inset-y-0 right-0 flex w-full max-w-[760px] flex-col border-l border-slate-200 bg-white shadow-2xl dark:border-border dark:bg-card",
|
|
204
221
|
children: [
|
|
205
|
-
/* @__PURE__ */
|
|
206
|
-
/* @__PURE__ */
|
|
207
|
-
/* @__PURE__ */
|
|
208
|
-
/* @__PURE__ */
|
|
209
|
-
/* @__PURE__ */
|
|
222
|
+
/* @__PURE__ */ s("div", { className: "flex shrink-0 items-center gap-2 border-b border-slate-200 px-4 py-3 dark:border-border", children: [
|
|
223
|
+
/* @__PURE__ */ r(I, { className: "h-4 w-4 shrink-0 text-emerald-600 dark:text-emerald-400" }),
|
|
224
|
+
/* @__PURE__ */ s("div", { className: "min-w-0", children: [
|
|
225
|
+
/* @__PURE__ */ r("h2", { className: "text-[14px] font-semibold text-slate-900 dark:text-foreground", children: "Review the upload" }),
|
|
226
|
+
/* @__PURE__ */ s("p", { className: "truncate text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
|
|
210
227
|
a,
|
|
211
|
-
|
|
228
|
+
e && !x ? ` · ${p(e.rows, "row")}` : ""
|
|
212
229
|
] })
|
|
213
230
|
] }),
|
|
214
|
-
/* @__PURE__ */
|
|
231
|
+
/* @__PURE__ */ r(
|
|
215
232
|
"button",
|
|
216
233
|
{
|
|
217
234
|
type: "button",
|
|
218
235
|
"aria-label": "Close",
|
|
219
|
-
onClick:
|
|
220
|
-
disabled:
|
|
236
|
+
onClick: b,
|
|
237
|
+
disabled: c,
|
|
221
238
|
className: "ml-auto rounded p-1 text-slate-400 hover:bg-muted hover:text-slate-700 dark:hover:text-slate-200",
|
|
222
|
-
children: /* @__PURE__ */
|
|
239
|
+
children: /* @__PURE__ */ r(V, { className: "h-4 w-4" })
|
|
223
240
|
}
|
|
224
241
|
)
|
|
225
242
|
] }),
|
|
226
|
-
/* @__PURE__ */
|
|
227
|
-
|
|
228
|
-
/* @__PURE__ */
|
|
243
|
+
/* @__PURE__ */ s("div", { className: "min-h-0 flex-1 space-y-5 overflow-y-auto overscroll-contain px-4 py-4", children: [
|
|
244
|
+
o && /* @__PURE__ */ s("div", { className: "flex items-center gap-2 py-10 text-[13px] text-slate-500 dark:text-muted-foreground", children: [
|
|
245
|
+
/* @__PURE__ */ r(D, { className: "h-4 w-4 animate-spin" }),
|
|
229
246
|
"Reading ",
|
|
230
247
|
a,
|
|
231
248
|
" and comparing it with the owner matrix…"
|
|
232
249
|
] }),
|
|
233
|
-
!
|
|
234
|
-
|
|
250
|
+
!o && (i != null || x) && (E ? /* @__PURE__ */ s(
|
|
251
|
+
"div",
|
|
235
252
|
{
|
|
236
|
-
|
|
237
|
-
|
|
253
|
+
role: "alert",
|
|
254
|
+
"data-owner-sheet-read-failure": !0,
|
|
255
|
+
className: "flex items-start gap-2.5 rounded-md border border-rose-200 bg-rose-50 px-3 py-2.5 dark:border-rose-900/60 dark:bg-rose-950/30",
|
|
256
|
+
children: [
|
|
257
|
+
/* @__PURE__ */ r(U, { className: "mt-0.5 h-4 w-4 shrink-0 text-rose-600 dark:text-rose-400" }),
|
|
258
|
+
/* @__PURE__ */ s("div", { className: "min-w-0 space-y-0.5", children: [
|
|
259
|
+
/* @__PURE__ */ r("p", { className: "text-[13px] font-semibold text-rose-900 dark:text-rose-100", children: E.title }),
|
|
260
|
+
E.hint && /* @__PURE__ */ r("p", { className: "text-[12.5px] text-rose-800 dark:text-rose-200/90", children: E.hint })
|
|
261
|
+
] })
|
|
262
|
+
]
|
|
263
|
+
}
|
|
264
|
+
) : /* @__PURE__ */ r(
|
|
265
|
+
re,
|
|
266
|
+
{
|
|
267
|
+
error: i,
|
|
238
268
|
fallback: "Could not read the spreadsheet",
|
|
239
|
-
onRetry:
|
|
269
|
+
onRetry: O
|
|
240
270
|
}
|
|
241
|
-
),
|
|
242
|
-
!
|
|
243
|
-
|
|
244
|
-
/* @__PURE__ */
|
|
245
|
-
|
|
271
|
+
)),
|
|
272
|
+
!o && x && e && /* @__PURE__ */ s("details", { className: "group text-[12px]", "data-owner-sheet-wrong-file-details": !0, children: [
|
|
273
|
+
/* @__PURE__ */ s("summary", { className: "inline-flex cursor-pointer list-none items-center gap-1 rounded text-slate-600 hover:text-slate-900 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/60 dark:text-muted-foreground dark:hover:text-foreground [&::-webkit-details-marker]:hidden", children: [
|
|
274
|
+
/* @__PURE__ */ r(j, { className: "h-3.5 w-3.5 -rotate-90 transition-transform group-open:rotate-0" }),
|
|
275
|
+
"What the file is missing"
|
|
276
|
+
] }),
|
|
277
|
+
/* @__PURE__ */ r("div", { className: "mt-2", children: /* @__PURE__ */ r(B, { preview: e }) })
|
|
278
|
+
] }),
|
|
279
|
+
!o && e && !x && /* @__PURE__ */ s(W, { children: [
|
|
280
|
+
h && /* @__PURE__ */ s("div", { className: "flex items-start gap-2 rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-[12.5px] text-amber-900 dark:border-amber-800/70 dark:bg-amber-950/40 dark:text-amber-200", children: [
|
|
281
|
+
/* @__PURE__ */ r(H, { className: "mt-0.5 h-3.5 w-3.5 shrink-0" }),
|
|
282
|
+
/* @__PURE__ */ r("span", { children: "Someone changed the owner matrix after you uploaded. Nothing was applied — these are the changes against the matrix as it is now." })
|
|
246
283
|
] }),
|
|
247
|
-
!
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
/* @__PURE__ */
|
|
284
|
+
!e.nothing_to_do && /* @__PURE__ */ r(ne, { preview: e, blockedRows: C }),
|
|
285
|
+
e.problems.length > 0 && /* @__PURE__ */ r(B, { preview: e }),
|
|
286
|
+
e.nothing_to_do && e.errors === 0 && /* @__PURE__ */ r("p", { className: "rounded-md border border-dashed border-slate-200 px-3 py-6 text-center text-[13px] text-slate-500 dark:border-border dark:text-muted-foreground", children: "This file matches the owner matrix — there is nothing to change." }),
|
|
287
|
+
e.steps.map((m) => /* @__PURE__ */ r(ce, { step: m, blockedRows: C }, m.state_id)),
|
|
288
|
+
S && d.length > 0 && /* @__PURE__ */ s("div", { className: "rounded-md border border-slate-200 dark:border-border", children: [
|
|
289
|
+
/* @__PURE__ */ s(
|
|
253
290
|
"button",
|
|
254
291
|
{
|
|
255
292
|
type: "button",
|
|
256
|
-
onClick: () =>
|
|
257
|
-
"aria-expanded":
|
|
258
|
-
|
|
293
|
+
onClick: () => A((m) => !m),
|
|
294
|
+
"aria-expanded": _,
|
|
295
|
+
"data-owner-sheet-trial": !0,
|
|
296
|
+
className: "flex w-full items-center gap-2 rounded-md px-3 py-2 text-left transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-nvr-cyan",
|
|
259
297
|
children: [
|
|
260
|
-
|
|
261
|
-
|
|
298
|
+
/* @__PURE__ */ r(
|
|
299
|
+
j,
|
|
300
|
+
{
|
|
301
|
+
className: `h-3.5 w-3.5 shrink-0 text-slate-500 transition-transform dark:text-muted-foreground ${_ ? "" : "-rotate-90"}`
|
|
302
|
+
}
|
|
303
|
+
),
|
|
304
|
+
/* @__PURE__ */ r("span", { className: "text-[12.5px] font-medium text-slate-800 dark:text-foreground", children: "Try a record with these changes" }),
|
|
305
|
+
/* @__PURE__ */ r("span", { className: "ml-auto text-[11.5px] text-slate-500 dark:text-muted-foreground", children: "Who would own each step" })
|
|
262
306
|
]
|
|
263
307
|
}
|
|
264
308
|
),
|
|
265
|
-
|
|
266
|
-
|
|
309
|
+
_ && (e.draft_groups.length > 2e3 ? /* @__PURE__ */ r("p", { className: "border-t border-slate-200 px-3 py-2 text-[12px] text-slate-500 dark:border-border dark:text-muted-foreground", children: "Too many groups change at once to try a record here." }) : /* @__PURE__ */ r("div", { className: "border-t border-slate-200 p-3 dark:border-border", children: /* @__PURE__ */ r(
|
|
310
|
+
ae,
|
|
267
311
|
{
|
|
268
|
-
templateId:
|
|
269
|
-
collections:
|
|
270
|
-
draft:
|
|
312
|
+
templateId: t,
|
|
313
|
+
collections: d,
|
|
314
|
+
draft: e.draft_groups
|
|
271
315
|
}
|
|
272
316
|
) }))
|
|
273
317
|
] })
|
|
274
318
|
] })
|
|
275
319
|
] }),
|
|
276
|
-
/* @__PURE__ */
|
|
277
|
-
/* @__PURE__ */
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
" ",
|
|
281
|
-
"
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
320
|
+
/* @__PURE__ */ s("div", { className: "flex shrink-0 flex-wrap items-center gap-2 border-t border-slate-200 bg-slate-50 px-4 py-3 dark:border-border dark:bg-muted/30", children: [
|
|
321
|
+
/* @__PURE__ */ s(
|
|
322
|
+
"p",
|
|
323
|
+
{
|
|
324
|
+
className: "min-w-0 flex-1 text-[12px] text-slate-500 dark:text-muted-foreground",
|
|
325
|
+
"data-owner-sheet-footer": !0,
|
|
326
|
+
children: [
|
|
327
|
+
o ? "Reading the file…" : g ? "Nothing was changed. Upload the workbook from Download as Excel." : $ ? "Nothing to apply — the owner matrix already matches this file." : k ? `Fix ${p((e == null ? void 0 : e.errors) ?? 0, "problem")} in the file, then upload it again.` : "Nothing changes until you press Apply.",
|
|
328
|
+
!o && !g && !$ && !k && /* @__PURE__ */ s("span", { className: "hidden sm:inline", children: [
|
|
329
|
+
" ",
|
|
330
|
+
"The matrix is saved as a version first, so it can be restored."
|
|
331
|
+
] })
|
|
332
|
+
]
|
|
333
|
+
}
|
|
334
|
+
),
|
|
335
|
+
/* @__PURE__ */ r(
|
|
336
|
+
T,
|
|
286
337
|
{
|
|
287
338
|
size: "sm",
|
|
288
339
|
variant: "outline",
|
|
289
340
|
className: "h-8 text-[12.5px]",
|
|
290
|
-
onClick:
|
|
291
|
-
disabled:
|
|
341
|
+
onClick: y,
|
|
342
|
+
disabled: c,
|
|
292
343
|
children: "Upload another file"
|
|
293
344
|
}
|
|
294
345
|
),
|
|
295
|
-
/* @__PURE__ */
|
|
296
|
-
|
|
346
|
+
g || $ ? /* @__PURE__ */ r(
|
|
347
|
+
T,
|
|
297
348
|
{
|
|
298
349
|
size: "sm",
|
|
299
|
-
|
|
350
|
+
variant: "outline",
|
|
351
|
+
className: "h-8 text-[12.5px]",
|
|
300
352
|
onClick: b,
|
|
301
|
-
|
|
353
|
+
"data-owner-sheet-close": !0,
|
|
354
|
+
children: "Close"
|
|
355
|
+
}
|
|
356
|
+
) : /* @__PURE__ */ s(
|
|
357
|
+
T,
|
|
358
|
+
{
|
|
359
|
+
size: "sm",
|
|
360
|
+
className: "h-8 gap-1.5 bg-nvr-cyan text-[12.5px] text-white hover:bg-nvr-cyan/90 disabled:bg-slate-200 disabled:text-slate-500 disabled:opacity-100 dark:disabled:border dark:disabled:border-border dark:disabled:!bg-transparent dark:disabled:!text-slate-500",
|
|
361
|
+
onClick: v,
|
|
362
|
+
disabled: !S || c,
|
|
302
363
|
"data-owner-sheet-apply": !0,
|
|
303
364
|
children: [
|
|
304
|
-
|
|
365
|
+
c && /* @__PURE__ */ r(D, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
305
366
|
"Apply changes"
|
|
306
367
|
]
|
|
307
368
|
}
|
|
@@ -314,86 +375,110 @@ function re({
|
|
|
314
375
|
document.body
|
|
315
376
|
);
|
|
316
377
|
}
|
|
317
|
-
|
|
318
|
-
|
|
378
|
+
const F = (t, d) => t.row != null && d.has(t.row);
|
|
379
|
+
function ne({
|
|
380
|
+
preview: t,
|
|
381
|
+
blockedRows: d
|
|
382
|
+
}) {
|
|
383
|
+
const a = { ...t.counts };
|
|
384
|
+
let e = 0;
|
|
385
|
+
for (const h of t.steps)
|
|
386
|
+
for (const c of h.changes)
|
|
387
|
+
F(c, d) && (e++, c.kind === "added" ? a.groups_added-- : c.kind === "removed" ? a.groups_removed-- : a.groups_changed--, a.people_added -= c.people_added.length, a.people_removed -= c.people_removed.length);
|
|
388
|
+
for (const h of Object.keys(a)) a[h] = Math.max(0, a[h]);
|
|
389
|
+
const o = [
|
|
319
390
|
{
|
|
320
|
-
n:
|
|
321
|
-
label:
|
|
391
|
+
n: a.groups_added,
|
|
392
|
+
label: a.groups_added === 1 ? "group added" : "groups added",
|
|
322
393
|
tone: "add"
|
|
323
394
|
},
|
|
324
395
|
{
|
|
325
|
-
n:
|
|
326
|
-
label:
|
|
396
|
+
n: a.groups_removed,
|
|
397
|
+
label: a.groups_removed === 1 ? "group removed" : "groups removed",
|
|
327
398
|
tone: "remove"
|
|
328
399
|
},
|
|
329
400
|
{
|
|
330
|
-
n:
|
|
331
|
-
label:
|
|
401
|
+
n: a.groups_changed,
|
|
402
|
+
label: a.groups_changed === 1 ? "group changed" : "groups changed",
|
|
332
403
|
tone: "change"
|
|
333
404
|
},
|
|
334
405
|
{
|
|
335
|
-
n:
|
|
336
|
-
label:
|
|
406
|
+
n: a.people_added,
|
|
407
|
+
label: a.people_added === 1 ? "person added" : "people added",
|
|
337
408
|
tone: "add"
|
|
338
409
|
},
|
|
339
410
|
{
|
|
340
|
-
n:
|
|
341
|
-
label:
|
|
411
|
+
n: a.people_removed,
|
|
412
|
+
label: a.people_removed === 1 ? "person removed" : "people removed",
|
|
342
413
|
tone: "remove"
|
|
343
414
|
}
|
|
344
|
-
],
|
|
415
|
+
], i = {
|
|
345
416
|
add: "text-emerald-700 dark:text-emerald-400",
|
|
346
417
|
remove: "text-rose-700 dark:text-rose-400",
|
|
347
418
|
change: "text-amber-700 dark:text-amber-400",
|
|
348
419
|
plain: "text-slate-700 dark:text-foreground"
|
|
349
420
|
};
|
|
350
|
-
return /* @__PURE__ */
|
|
351
|
-
/* @__PURE__ */
|
|
352
|
-
|
|
421
|
+
return /* @__PURE__ */ s("div", { className: "space-y-1", children: [
|
|
422
|
+
/* @__PURE__ */ r("div", { className: "flex flex-wrap gap-px overflow-hidden rounded-lg border border-slate-200 bg-slate-200 dark:border-border dark:bg-border", children: o.map((h) => /* @__PURE__ */ s("div", { className: "min-w-[104px] flex-1 bg-white px-3 py-2 dark:bg-card", children: [
|
|
423
|
+
/* @__PURE__ */ r(
|
|
424
|
+
"div",
|
|
425
|
+
{
|
|
426
|
+
className: `text-[17px] font-semibold tabular-nums ${h.n ? i[h.tone] : "text-slate-300 dark:text-slate-600"}`,
|
|
427
|
+
children: h.n
|
|
428
|
+
}
|
|
429
|
+
),
|
|
430
|
+
/* @__PURE__ */ r("div", { className: "text-[11.5px] text-slate-500 dark:text-muted-foreground", children: h.label })
|
|
431
|
+
] }, h.label)) }),
|
|
432
|
+
e > 0 && /* @__PURE__ */ s(
|
|
433
|
+
"p",
|
|
353
434
|
{
|
|
354
|
-
className:
|
|
355
|
-
|
|
435
|
+
className: "text-[11.5px] text-slate-500 dark:text-muted-foreground",
|
|
436
|
+
"data-owner-sheet-waiting": !0,
|
|
437
|
+
children: [
|
|
438
|
+
"Not counted: ",
|
|
439
|
+
p(e, "group change"),
|
|
440
|
+
" waiting on a fix in the file."
|
|
441
|
+
]
|
|
356
442
|
}
|
|
357
|
-
)
|
|
358
|
-
|
|
359
|
-
] }, l.label)) });
|
|
443
|
+
)
|
|
444
|
+
] });
|
|
360
445
|
}
|
|
361
|
-
function
|
|
362
|
-
return /* @__PURE__ */
|
|
363
|
-
/* @__PURE__ */
|
|
364
|
-
|
|
365
|
-
|
|
446
|
+
function B({ preview: t }) {
|
|
447
|
+
return /* @__PURE__ */ s("section", { "aria-label": "Problems", children: [
|
|
448
|
+
/* @__PURE__ */ s("h3", { className: "mb-1.5 text-[12.5px] font-semibold text-slate-800 dark:text-foreground", children: [
|
|
449
|
+
t.errors > 0 ? `${p(t.errors, "problem")} to fix` : `${p(t.warnings, "thing")} to check`,
|
|
450
|
+
t.errors > 0 && t.warnings > 0 && /* @__PURE__ */ s("span", { className: "font-normal text-slate-500 dark:text-muted-foreground", children: [
|
|
366
451
|
" ",
|
|
367
452
|
"· ",
|
|
368
|
-
|
|
453
|
+
p(t.warnings, "warning")
|
|
369
454
|
] })
|
|
370
455
|
] }),
|
|
371
|
-
/* @__PURE__ */
|
|
372
|
-
|
|
456
|
+
/* @__PURE__ */ s("ul", { className: "divide-y divide-slate-100 overflow-hidden rounded-md border border-slate-200 dark:divide-border dark:border-border", children: [
|
|
457
|
+
t.problems.map((d, a) => /* @__PURE__ */ s(
|
|
373
458
|
"li",
|
|
374
459
|
{
|
|
375
460
|
className: "flex items-start gap-2 px-3 py-1.5 text-[12.5px]",
|
|
376
|
-
"data-severity":
|
|
461
|
+
"data-severity": d.severity,
|
|
377
462
|
children: [
|
|
378
|
-
|
|
379
|
-
/* @__PURE__ */
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
463
|
+
d.severity === "error" ? /* @__PURE__ */ r(U, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-rose-600 dark:text-rose-400" }) : /* @__PURE__ */ r(H, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-amber-600 dark:text-amber-400" }),
|
|
464
|
+
/* @__PURE__ */ s("span", { className: "w-[96px] shrink-0 leading-snug text-slate-500 tabular-nums dark:text-muted-foreground", children: [
|
|
465
|
+
/* @__PURE__ */ r("span", { className: "block whitespace-nowrap", children: d.row != null ? `Row ${d.row}` : "File" }),
|
|
466
|
+
d.column && /* @__PURE__ */ r("span", { className: "block truncate text-[11px]", "data-tip": d.column, children: d.column })
|
|
467
|
+
] }),
|
|
468
|
+
/* @__PURE__ */ r("span", { className: "min-w-0 leading-snug text-slate-700 dark:text-foreground", children: d.message })
|
|
384
469
|
]
|
|
385
470
|
},
|
|
386
471
|
a
|
|
387
472
|
)),
|
|
388
|
-
|
|
473
|
+
t.problems_hidden > 0 && /* @__PURE__ */ s("li", { className: "px-3 py-1.5 text-[12px] text-slate-500 dark:text-muted-foreground", children: [
|
|
389
474
|
"…and ",
|
|
390
|
-
|
|
475
|
+
t.problems_hidden,
|
|
391
476
|
" more"
|
|
392
477
|
] })
|
|
393
478
|
] })
|
|
394
479
|
] });
|
|
395
480
|
}
|
|
396
|
-
const
|
|
481
|
+
const le = {
|
|
397
482
|
added: {
|
|
398
483
|
label: "Added",
|
|
399
484
|
cls: "bg-emerald-50 text-emerald-700 ring-emerald-200 dark:bg-emerald-950/40 dark:text-emerald-300 dark:ring-emerald-800/60"
|
|
@@ -406,90 +491,117 @@ const ne = {
|
|
|
406
491
|
label: "Changed",
|
|
407
492
|
cls: "bg-amber-50 text-amber-800 ring-amber-200 dark:bg-amber-950/40 dark:text-amber-300 dark:ring-amber-800/60"
|
|
408
493
|
}
|
|
409
|
-
},
|
|
410
|
-
function
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
494
|
+
}, ie = { step: "Step", name: "Name", default: "Default", priority: "Priority" };
|
|
495
|
+
function ce({
|
|
496
|
+
step: t,
|
|
497
|
+
blockedRows: d
|
|
498
|
+
}) {
|
|
499
|
+
let a = t.people_added, e = t.people_removed, o = 0;
|
|
500
|
+
for (const i of t.changes)
|
|
501
|
+
F(i, d) && (o++, a -= i.people_added.length, e -= i.people_removed.length);
|
|
502
|
+
return /* @__PURE__ */ s("section", { "aria-label": t.state_label, children: [
|
|
503
|
+
/* @__PURE__ */ s("div", { className: "mb-1.5 flex items-baseline gap-2", children: [
|
|
504
|
+
/* @__PURE__ */ r("h3", { className: "text-[13px] font-semibold text-slate-800 dark:text-foreground", children: t.state_label }),
|
|
505
|
+
/* @__PURE__ */ r("span", { className: "text-[11.5px] text-slate-500 tabular-nums dark:text-muted-foreground", children: [
|
|
506
|
+
t.changes.length > o ? p(t.changes.length - o, "group") : "",
|
|
507
|
+
a > 0 ? `+${a}` : "",
|
|
508
|
+
e > 0 ? `−${e}` : "",
|
|
509
|
+
o > 0 ? `${o} waiting on a fix` : ""
|
|
510
|
+
].filter(Boolean).join(" · ") })
|
|
419
511
|
] }),
|
|
420
|
-
/* @__PURE__ */
|
|
512
|
+
/* @__PURE__ */ r("ul", { className: "divide-y divide-slate-100 overflow-hidden rounded-md border border-slate-200 dark:divide-border dark:border-border", children: t.changes.map((i) => /* @__PURE__ */ r(
|
|
513
|
+
me,
|
|
514
|
+
{
|
|
515
|
+
change: i,
|
|
516
|
+
blocked: F(i, d)
|
|
517
|
+
},
|
|
518
|
+
`${i.group_id ?? ""}:${i.row ?? ""}`
|
|
519
|
+
)) })
|
|
421
520
|
] });
|
|
422
521
|
}
|
|
423
|
-
function
|
|
424
|
-
const
|
|
425
|
-
return /* @__PURE__ */
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
522
|
+
function me({ change: t, blocked: d = !1 }) {
|
|
523
|
+
const a = le[t.kind];
|
|
524
|
+
return /* @__PURE__ */ s(
|
|
525
|
+
"li",
|
|
526
|
+
{
|
|
527
|
+
className: `space-y-1.5 px-3 py-2 ${d ? "bg-slate-50 opacity-70 dark:bg-muted/30" : ""}`,
|
|
528
|
+
"data-change-kind": t.kind,
|
|
529
|
+
"data-change-blocked": d || void 0,
|
|
530
|
+
children: [
|
|
531
|
+
/* @__PURE__ */ s("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
532
|
+
d ? /* @__PURE__ */ s("span", { className: "inline-flex items-center gap-1 rounded px-1.5 py-px text-[10.5px] font-semibold uppercase tracking-wide text-rose-700 ring-1 ring-inset ring-rose-200 dark:text-rose-300 dark:ring-rose-800/60", children: [
|
|
533
|
+
/* @__PURE__ */ r(U, { className: "h-3 w-3" }),
|
|
534
|
+
"Fix row ",
|
|
535
|
+
t.row,
|
|
536
|
+
" first"
|
|
537
|
+
] }) : /* @__PURE__ */ r(
|
|
538
|
+
"span",
|
|
539
|
+
{
|
|
540
|
+
className: `rounded px-1.5 py-px text-[10.5px] font-semibold uppercase tracking-wide ring-1 ring-inset ${a.cls}`,
|
|
541
|
+
children: a.label
|
|
542
|
+
}
|
|
543
|
+
),
|
|
544
|
+
/* @__PURE__ */ r("span", { className: "min-w-0 text-[12.5px] font-medium text-slate-800 dark:text-foreground", children: t.label }),
|
|
545
|
+
t.row != null && /* @__PURE__ */ s("span", { className: "ml-auto text-[11px] text-slate-400 tabular-nums", children: [
|
|
546
|
+
"row ",
|
|
547
|
+
t.row
|
|
548
|
+
] })
|
|
549
|
+
] }),
|
|
550
|
+
t.fields.length > 0 && /* @__PURE__ */ r("div", { className: "flex flex-wrap gap-x-4 gap-y-0.5 text-[12px] text-slate-600 dark:text-muted-foreground", children: t.fields.map((e) => /* @__PURE__ */ s("span", { children: [
|
|
551
|
+
ie[e.field],
|
|
552
|
+
":",
|
|
553
|
+
" ",
|
|
554
|
+
/* @__PURE__ */ r("span", { className: "line-through decoration-slate-400", children: e.before || "—" }),
|
|
555
|
+
" →",
|
|
556
|
+
" ",
|
|
557
|
+
/* @__PURE__ */ r("span", { className: "text-slate-800 dark:text-foreground", children: e.after || "—" })
|
|
558
|
+
] }, e.field)) }),
|
|
559
|
+
t.kind === "changed" && t.filters_after.length + t.filters_before.length > 0 && /* @__PURE__ */ r(he, { before: t.filters_before, after: t.filters_after }),
|
|
560
|
+
t.kind === "added" && t.filters_after.length > t.label.split(" · ").length && /* @__PURE__ */ r("div", { className: "text-[12px] text-slate-600 dark:text-muted-foreground", children: t.filters_after.join(" · ") }),
|
|
561
|
+
(t.people_added.length > 0 || t.people_removed.length > 0 || t.teams_added.length > 0 || t.teams_removed.length > 0) && /* @__PURE__ */ s("div", { className: "flex flex-wrap gap-1", children: [
|
|
562
|
+
t.people_added.map((e) => /* @__PURE__ */ r(L, { add: !0, title: e.email ?? void 0, children: e.name }, `+${e.id}`)),
|
|
563
|
+
t.teams_added.map((e) => /* @__PURE__ */ s(L, { add: !0, children: [
|
|
564
|
+
"Team ",
|
|
565
|
+
e.name
|
|
566
|
+
] }, `+t${e.id}`)),
|
|
567
|
+
t.people_removed.map((e) => /* @__PURE__ */ r(L, { title: e.email ?? void 0, children: e.name }, `-${e.id}`)),
|
|
568
|
+
t.teams_removed.map((e) => /* @__PURE__ */ s(L, { children: [
|
|
569
|
+
"Team ",
|
|
570
|
+
e.name
|
|
571
|
+
] }, `-t${e.id}`))
|
|
572
|
+
] })
|
|
573
|
+
]
|
|
574
|
+
}
|
|
575
|
+
);
|
|
464
576
|
}
|
|
465
|
-
function
|
|
466
|
-
const a =
|
|
467
|
-
return /* @__PURE__ */
|
|
468
|
-
/* @__PURE__ */
|
|
469
|
-
a.length > 0 && /* @__PURE__ */
|
|
470
|
-
a.length > 0 &&
|
|
471
|
-
|
|
472
|
-
|
|
577
|
+
function he({ before: t, after: d }) {
|
|
578
|
+
const a = t.filter((o) => !d.includes(o)), e = d.filter((o) => !t.includes(o));
|
|
579
|
+
return /* @__PURE__ */ s("div", { className: "flex flex-wrap items-baseline gap-x-1.5 text-[12px] text-slate-600 dark:text-muted-foreground", children: [
|
|
580
|
+
/* @__PURE__ */ r("span", { children: "Values:" }),
|
|
581
|
+
a.length > 0 && /* @__PURE__ */ r("span", { className: "line-through decoration-slate-400", children: a.join(" · ") }),
|
|
582
|
+
a.length > 0 && e.length > 0 && /* @__PURE__ */ r("span", { "aria-hidden": !0, children: "→" }),
|
|
583
|
+
e.length > 0 && /* @__PURE__ */ r("span", { className: "text-slate-800 dark:text-foreground", children: e.join(" · ") }),
|
|
584
|
+
d.length === 0 && /* @__PURE__ */ r("span", { className: "text-slate-800 dark:text-foreground", children: "any record" })
|
|
473
585
|
] });
|
|
474
586
|
}
|
|
475
|
-
function
|
|
476
|
-
add:
|
|
477
|
-
title:
|
|
587
|
+
function L({
|
|
588
|
+
add: t = !1,
|
|
589
|
+
title: d,
|
|
478
590
|
children: a
|
|
479
591
|
}) {
|
|
480
|
-
return /* @__PURE__ */
|
|
592
|
+
return /* @__PURE__ */ s(
|
|
481
593
|
"span",
|
|
482
594
|
{
|
|
483
|
-
"data-tip":
|
|
484
|
-
className: `inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11.5px] ring-1 ring-inset ${
|
|
595
|
+
"data-tip": d,
|
|
596
|
+
className: `inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11.5px] ring-1 ring-inset ${t ? "bg-emerald-50 text-emerald-800 ring-emerald-200 dark:bg-emerald-950/40 dark:text-emerald-300 dark:ring-emerald-800/60" : "bg-rose-50 text-rose-800 ring-rose-200 dark:bg-rose-950/40 dark:text-rose-300 dark:ring-rose-800/60"}`,
|
|
485
597
|
children: [
|
|
486
|
-
|
|
598
|
+
t ? /* @__PURE__ */ r(G, { className: "h-3 w-3" }) : /* @__PURE__ */ r(X, { className: "h-3 w-3" }),
|
|
487
599
|
a
|
|
488
600
|
]
|
|
489
601
|
}
|
|
490
602
|
);
|
|
491
603
|
}
|
|
492
604
|
export {
|
|
493
|
-
|
|
494
|
-
|
|
605
|
+
_e as OwnerMatrixSheetActions,
|
|
606
|
+
oe as OwnerSheetDrawer
|
|
495
607
|
};
|