@nivaro/react 0.3.64 → 0.3.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +62 -8
- package/dist/shared/components/CollectionBrowserView.js +3127 -3204
- package/dist/shared/components/ConformanceView.js +235 -221
- package/dist/shared/components/DataTable.js +478 -459
- package/dist/shared/components/ItemEditForm.js +4842 -4500
- package/dist/shared/components/MyWorkView.js +124 -113
- package/dist/shared/components/PageRenderer.js +146 -138
- package/dist/shared/components/ProfileView.js +483 -472
- package/dist/shared/components/RecordDrilldownSheet.js +73 -65
- package/dist/shared/components/ReportView.js +1100 -1094
- package/dist/shared/components/bulk/BulkActionButtons.js +72 -72
- package/dist/shared/components/bulk/BulkCompareButton.js +62 -0
- package/dist/shared/components/bulk/BulkFieldUpdate.js +114 -103
- package/dist/shared/components/bulk/BulkFieldUpdateButton.js +73 -0
- package/dist/shared/components/bulk/MessageStakeholders.js +235 -0
- package/dist/shared/components/bulk/bulk-field-options.js +29 -23
- package/dist/shared/components/integrations/IntegrationObligationsView.js +191 -173
- package/dist/shared/components/integrations/IntegrationStatusLines.js +101 -85
- package/dist/shared/components/integrations/RecordIntegrationPreview.js +11 -9
- package/dist/shared/components/integrations/SendCurrentData.js +126 -0
- package/dist/shared/components/item-edit/CatalogPickerField.js +1535 -1440
- package/dist/shared/components/item-edit/FieldRenderer.js +49 -45
- package/dist/shared/components/item-edit/FieldRow.js +413 -403
- package/dist/shared/components/item-edit/GroupSection.js +555 -538
- package/dist/shared/components/item-edit/InlineTableField.js +2903 -2816
- package/dist/shared/components/item-edit/M2MCombobox.js +407 -338
- package/dist/shared/components/item-edit/MidairCollisionDialog.js +367 -116
- package/dist/shared/components/item-edit/NestedRelationEditor.js +171 -163
- package/dist/shared/components/item-edit/PlanGrid.js +783 -724
- package/dist/shared/components/item-edit/QuickCreateButton.js +291 -224
- package/dist/shared/components/item-edit/RecordInsights.js +113 -111
- package/dist/shared/components/item-edit/RecordLiveSync.js +4 -1
- package/dist/shared/components/item-edit/RelationCombobox.js +398 -364
- package/dist/shared/components/item-edit/SummaryPanel.js +146 -144
- package/dist/shared/components/item-edit/UserChip.js +264 -229
- package/dist/shared/components/item-edit/cascade-clear-notice.js +56 -0
- package/dist/shared/components/item-edit/collision-format.js +37 -0
- package/dist/shared/components/item-edit/field-a11y.js +25 -0
- package/dist/shared/components/item-edit/header-path-preview.js +52 -0
- package/dist/shared/components/item-edit/line-merge.js +84 -0
- package/dist/shared/components/item-edit/line-midair.js +94 -87
- package/dist/shared/components/item-edit/move-guard.js +17 -0
- package/dist/shared/components/item-edit/picker-search.js +27 -16
- package/dist/shared/components/item-edit/rail-width.js +8 -0
- package/dist/shared/components/monitoring/InactiveUserLinksView.js +126 -124
- package/dist/shared/components/panels/AccessDeniedPanel.js +96 -55
- package/dist/shared/components/panels/CommentPanel.js +142 -136
- package/dist/shared/components/panels/ItemLockBanner.js +246 -240
- package/dist/shared/components/panels/PipelinePanel.js +1366 -1194
- package/dist/shared/components/panels/RevisionsPanel.js +106 -102
- package/dist/shared/components/panels/SlaBreachBanner.js +16 -20
- package/dist/shared/components/panels/SlaClock.js +90 -68
- package/dist/shared/components/queue/QueueItemSheet.js +94 -87
- package/dist/shared/components/queue/QueueWorklist.js +1522 -1347
- package/dist/shared/components/queue/worklist-csv.js +75 -0
- package/dist/shared/components/queue/worklist-helpers.js +20 -0
- package/dist/shared/components/widgets/ReviewListWidget.js +226 -207
- package/dist/shared/lib/bulk-copy.js +17 -0
- package/dist/shared/lib/cbv-export.js +122 -0
- package/dist/shared/lib/delete-offer.js +13 -0
- package/dist/shared/lib/error-hints.js +1 -0
- package/dist/shared/lib/leave-guard.js +41 -26
- package/dist/shared/lib/list-link.js +72 -56
- package/dist/shared/lib/live-queries.js +32 -30
- package/dist/shared/lib/moved-notice.js +25 -0
- package/dist/shared/lib/notification-target.js +56 -54
- package/dist/shared/lib/obligation-banner.js +11 -8
- package/dist/shared/lib/obligation-reason-text.js +6 -6
- package/dist/shared/lib/quick-filter-cascade.js +29 -19
- package/dist/shared/lib/sort-cycle.js +6 -0
- package/dist/shared/lib/summary-mode.js +59 -41
- package/package.json +1 -1
|
@@ -1,85 +1,87 @@
|
|
|
1
|
-
import { jsxs as d, jsx as
|
|
1
|
+
import { jsxs as d, jsx as s, Fragment as y } from "react/jsx-runtime";
|
|
2
2
|
import { useQuery as p } from "@tanstack/react-query";
|
|
3
3
|
import { Info as w } from "lucide-react";
|
|
4
4
|
import { useState as f, useRef as v, useEffect as N } from "react";
|
|
5
5
|
import { useNivaroClient as h } from "../../context.js";
|
|
6
6
|
import { get as u } from "../../lib/commands.js";
|
|
7
|
-
function C(a, t,
|
|
8
|
-
for (const
|
|
9
|
-
["record-audience", t,
|
|
10
|
-
["erp-submissions", t, String(
|
|
11
|
-
["integration-obligations", "record", t, String(
|
|
12
|
-
["record-integrations", t,
|
|
13
|
-
["record-external-ids", t,
|
|
14
|
-
["record-owner-history", t,
|
|
15
|
-
["record-mail-log", t,
|
|
16
|
-
["record-chat-mentions", t,
|
|
7
|
+
function C(a, t, n) {
|
|
8
|
+
for (const r of [
|
|
9
|
+
["record-audience", t, n],
|
|
10
|
+
["erp-submissions", t, String(n)],
|
|
11
|
+
["integration-obligations", "record", t, String(n)],
|
|
12
|
+
["record-integrations", t, n],
|
|
13
|
+
["record-external-ids", t, n],
|
|
14
|
+
["record-owner-history", t, n],
|
|
15
|
+
["record-mail-log", t, n],
|
|
16
|
+
["record-chat-mentions", t, n]
|
|
17
17
|
])
|
|
18
|
-
a.invalidateQueries({ queryKey:
|
|
18
|
+
a.invalidateQueries({ queryKey: r });
|
|
19
19
|
}
|
|
20
|
-
function M(a, t,
|
|
21
|
-
a.invalidateQueries({ queryKey: ["item", t,
|
|
22
|
-
predicate: (
|
|
23
|
-
}), a.invalidateQueries({ queryKey: ["child-summary", t,
|
|
20
|
+
function M(a, t, n) {
|
|
21
|
+
a.invalidateQueries({ queryKey: ["item", t, n] }), a.invalidateQueries({
|
|
22
|
+
predicate: (r) => r.queryKey[0] === "o2m-rows" && String(r.queryKey[3]) === n
|
|
23
|
+
}), a.invalidateQueries({ queryKey: ["child-summary", t, n] }), a.invalidateQueries({ queryKey: ["last-touch", t, n] }), a.invalidateQueries({ queryKey: ["sla-breach", t, n] }), a.invalidateQueries({
|
|
24
|
+
predicate: (r) => (r.queryKey[0] === "item-actions" || r.queryKey[0] === "ext-item-actions") && r.queryKey[1] === t && String(r.queryKey[2]) === n
|
|
25
|
+
}), _(a, t, n);
|
|
24
26
|
}
|
|
25
27
|
const k = 4e3;
|
|
26
|
-
function _(a, t,
|
|
28
|
+
function _(a, t, n) {
|
|
27
29
|
var e;
|
|
28
|
-
const
|
|
29
|
-
a.invalidateQueries({ queryKey: ["comments", t,
|
|
30
|
+
const r = () => {
|
|
31
|
+
a.invalidateQueries({ queryKey: ["comments", t, n] }), a.invalidateQueries({ queryKey: ["comments-related", t, n] });
|
|
30
32
|
};
|
|
31
|
-
|
|
32
|
-
const l = setTimeout(
|
|
33
|
+
r();
|
|
34
|
+
const l = setTimeout(r, k);
|
|
33
35
|
(e = l.unref) == null || e.call(l);
|
|
34
36
|
}
|
|
35
37
|
function B({
|
|
36
38
|
collection: a,
|
|
37
39
|
itemId: t,
|
|
38
|
-
compact:
|
|
40
|
+
compact: n
|
|
39
41
|
}) {
|
|
40
|
-
const [
|
|
42
|
+
const [r, l] = f(!1), [e, i] = f("audience"), c = v(null);
|
|
41
43
|
return N(() => {
|
|
42
|
-
if (!
|
|
43
|
-
const
|
|
44
|
+
if (!r) return;
|
|
45
|
+
const o = (x) => {
|
|
44
46
|
var m;
|
|
45
47
|
(m = c.current) != null && m.contains(x.target) || l(!1);
|
|
46
48
|
};
|
|
47
|
-
return document.addEventListener("mousedown",
|
|
48
|
-
}, [
|
|
49
|
-
/* @__PURE__ */
|
|
49
|
+
return document.addEventListener("mousedown", o), () => document.removeEventListener("mousedown", o);
|
|
50
|
+
}, [r]), /* @__PURE__ */ d("div", { ref: c, className: "relative", children: [
|
|
51
|
+
/* @__PURE__ */ s(
|
|
50
52
|
"button",
|
|
51
53
|
{
|
|
52
54
|
type: "button",
|
|
53
|
-
onClick: () => l((
|
|
55
|
+
onClick: () => l((o) => !o),
|
|
54
56
|
"data-tip": "Record insights — audience, integrations, owner history",
|
|
55
57
|
title: "Record insights",
|
|
56
58
|
"aria-label": "Record insights",
|
|
57
|
-
className:
|
|
58
|
-
children: /* @__PURE__ */
|
|
59
|
+
className: n ? "inline-flex h-8 w-8 items-center justify-center transition-colors hover:bg-accent hover:text-accent-foreground" : "inline-flex h-9 items-center gap-1.5 rounded-md border border-input bg-background px-3 text-sm font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground",
|
|
60
|
+
children: /* @__PURE__ */ s(w, { className: n ? "h-4 w-4" : "h-3.5 w-3.5" })
|
|
59
61
|
}
|
|
60
62
|
),
|
|
61
|
-
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
+
r && /* @__PURE__ */ d("div", { className: "absolute right-0 top-full z-[60] mt-1 w-[480px] max-w-[92vw] rounded-lg border border-slate-200 bg-white p-3 shadow-xl dark:border-border dark:bg-card", children: [
|
|
64
|
+
/* @__PURE__ */ s("div", { className: "mb-2 flex gap-1", children: [
|
|
63
65
|
["audience", "Audience"],
|
|
64
66
|
["integrations", "Integrations"],
|
|
65
67
|
["owners", "Owner history"],
|
|
66
68
|
["mail", "Mail"],
|
|
67
69
|
["chat", "Chat"]
|
|
68
|
-
].map(([
|
|
70
|
+
].map(([o, x]) => /* @__PURE__ */ s(
|
|
69
71
|
"button",
|
|
70
72
|
{
|
|
71
73
|
type: "button",
|
|
72
|
-
onClick: () =>
|
|
73
|
-
className: e ===
|
|
74
|
+
onClick: () => i(o),
|
|
75
|
+
className: e === o ? "whitespace-nowrap rounded-md bg-nvr-cyan/10 px-2 py-1 text-[11.5px] font-medium text-nvr-navy dark:text-nvr-cyan" : "whitespace-nowrap rounded-md px-2 py-1 text-[11.5px] text-slate-500 hover:bg-muted",
|
|
74
76
|
children: x
|
|
75
77
|
},
|
|
76
|
-
|
|
78
|
+
o
|
|
77
79
|
)) }),
|
|
78
|
-
e === "audience" && /* @__PURE__ */
|
|
79
|
-
e === "integrations" && /* @__PURE__ */
|
|
80
|
-
e === "owners" && /* @__PURE__ */
|
|
81
|
-
e === "mail" && /* @__PURE__ */
|
|
82
|
-
e === "chat" && /* @__PURE__ */
|
|
80
|
+
e === "audience" && /* @__PURE__ */ s($, { collection: a, itemId: t }),
|
|
81
|
+
e === "integrations" && /* @__PURE__ */ s(q, { collection: a, itemId: t }),
|
|
82
|
+
e === "owners" && /* @__PURE__ */ s(T, { collection: a, itemId: t }),
|
|
83
|
+
e === "mail" && /* @__PURE__ */ s(D, { collection: a, itemId: t }),
|
|
84
|
+
e === "chat" && /* @__PURE__ */ s(R, { collection: a, itemId: t })
|
|
83
85
|
] })
|
|
84
86
|
] });
|
|
85
87
|
}
|
|
@@ -91,42 +93,42 @@ const L = {
|
|
|
91
93
|
workflow_transition: "state changes"
|
|
92
94
|
};
|
|
93
95
|
function $({ collection: a, itemId: t }) {
|
|
94
|
-
const
|
|
96
|
+
const n = h(), { data: r, isLoading: l } = p({
|
|
95
97
|
queryKey: ["record-audience", a, t],
|
|
96
|
-
queryFn: () =>
|
|
98
|
+
queryFn: () => n.request(u(`/audience/${a}/${t}`)).then((i) => i.data),
|
|
97
99
|
staleTime: 3e4
|
|
98
100
|
});
|
|
99
|
-
if (l) return /* @__PURE__ */
|
|
100
|
-
const e = (
|
|
101
|
-
return e.length === 0 ? /* @__PURE__ */
|
|
101
|
+
if (l) return /* @__PURE__ */ s("p", { className: "text-[12px] text-slate-400", children: "Loading…" });
|
|
102
|
+
const e = (r == null ? void 0 : r.people) ?? [];
|
|
103
|
+
return e.length === 0 ? /* @__PURE__ */ s("p", { className: "text-[12px] text-slate-400", children: "Nobody hears about changes here automatically — no owners, watchers, or subscribers." }) : /* @__PURE__ */ d("div", { className: "max-h-72 overflow-y-auto", children: [
|
|
102
104
|
/* @__PURE__ */ d("p", { className: "pb-1.5 text-[10.5px] text-slate-400", children: [
|
|
103
105
|
e.length,
|
|
104
106
|
" ",
|
|
105
107
|
e.length === 1 ? "person hears" : "people hear",
|
|
106
108
|
" about changes to this record"
|
|
107
109
|
] }),
|
|
108
|
-
e.map((
|
|
110
|
+
e.map((i) => /* @__PURE__ */ d(
|
|
109
111
|
"div",
|
|
110
112
|
{
|
|
111
113
|
className: "border-t border-slate-100 py-1.5 first:border-t-0 dark:border-border/50",
|
|
112
114
|
children: [
|
|
113
|
-
/* @__PURE__ */
|
|
115
|
+
/* @__PURE__ */ s("p", { className: "text-[12px] font-medium text-slate-700 dark:text-slate-200", children: i.name }),
|
|
114
116
|
/* @__PURE__ */ d("div", { className: "mt-0.5 flex flex-wrap gap-1", children: [
|
|
115
|
-
|
|
116
|
-
|
|
117
|
+
i.owner && /* @__PURE__ */ s("span", { className: "rounded-full bg-nvr-cyan/10 px-1.5 py-px text-[10.5px] font-medium text-nvr-navy dark:text-nvr-cyan", children: "Owner — notified on transitions" }),
|
|
118
|
+
i.watch_fields.length > 0 && /* @__PURE__ */ d(
|
|
117
119
|
"span",
|
|
118
120
|
{
|
|
119
121
|
className: "rounded-full bg-slate-100 px-1.5 py-px text-[10.5px] text-slate-600 dark:bg-muted dark:text-slate-300",
|
|
120
|
-
"data-tip":
|
|
122
|
+
"data-tip": i.watch_fields.join(", "),
|
|
121
123
|
children: [
|
|
122
124
|
"Chose to watch ",
|
|
123
|
-
|
|
125
|
+
i.watch_fields.length,
|
|
124
126
|
" ",
|
|
125
|
-
|
|
127
|
+
i.watch_fields.length === 1 ? "field" : "fields"
|
|
126
128
|
]
|
|
127
129
|
}
|
|
128
130
|
),
|
|
129
|
-
|
|
131
|
+
i.subscriptions.map((c) => /* @__PURE__ */ d(
|
|
130
132
|
"span",
|
|
131
133
|
{
|
|
132
134
|
className: "rounded-full bg-slate-100 px-1.5 py-px text-[10.5px] text-slate-600 dark:bg-muted dark:text-slate-300",
|
|
@@ -142,85 +144,85 @@ function $({ collection: a, itemId: t }) {
|
|
|
142
144
|
] })
|
|
143
145
|
]
|
|
144
146
|
},
|
|
145
|
-
|
|
147
|
+
i.id
|
|
146
148
|
))
|
|
147
149
|
] });
|
|
148
150
|
}
|
|
149
151
|
function q({ collection: a, itemId: t }) {
|
|
150
|
-
const
|
|
152
|
+
const n = h(), { data: r = [], isLoading: l } = p({
|
|
151
153
|
queryKey: ["erp-submissions", a, String(t)],
|
|
152
|
-
queryFn: () =>
|
|
154
|
+
queryFn: () => n.request(
|
|
153
155
|
u(`/erp-submissions/${a}/${encodeURIComponent(t)}`)
|
|
154
|
-
).then((
|
|
156
|
+
).then((o) => o.data ?? []).catch(() => []),
|
|
155
157
|
staleTime: 3e4
|
|
156
|
-
}), { data: e, isLoading:
|
|
158
|
+
}), { data: e, isLoading: i } = p({
|
|
157
159
|
queryKey: ["record-integrations", a, t],
|
|
158
|
-
queryFn: () =>
|
|
160
|
+
queryFn: () => n.request(u(`/record-integrations/${a}/${t}`)).then((o) => o.data),
|
|
159
161
|
staleTime: 3e4
|
|
160
162
|
}), { data: c = [] } = p({
|
|
161
163
|
queryKey: ["record-external-ids", a, t],
|
|
162
|
-
queryFn: () =>
|
|
163
|
-
const x =
|
|
164
|
+
queryFn: () => n.request(u(`/items/${a}/${t}`)).then((o) => {
|
|
165
|
+
const x = o.data ?? {}, m = /(external|nuvolo|mwf|oracle|sap|erp|legacy|fusion|mdsi).*(id|number|ref)|^(order_number|requisition_id|sales_order_id)$/i;
|
|
164
166
|
return Object.entries(x).filter(([b, g]) => b !== "id" && g != null && g !== "" && m.test(b)).map(([b, g]) => ({ field: b, value: String(g).slice(0, 60) })).slice(0, 12);
|
|
165
167
|
}).catch(() => []),
|
|
166
168
|
staleTime: 6e4
|
|
167
169
|
});
|
|
168
|
-
return
|
|
170
|
+
return i || l ? /* @__PURE__ */ s("p", { className: "text-[12px] text-slate-400", children: "Loading…" }) : r.length + ((e == null ? void 0 : e.webhooks.length) ?? 0) === 0 ? /* @__PURE__ */ s("p", { className: "text-[12px] text-slate-400", children: "No integration activity for this record." }) : /* @__PURE__ */ d(y, { children: [
|
|
169
171
|
c.length > 0 && /* @__PURE__ */ d("div", { className: "border-b border-slate-100 px-3 py-2 dark:border-border/50", children: [
|
|
170
|
-
/* @__PURE__ */
|
|
171
|
-
/* @__PURE__ */
|
|
172
|
+
/* @__PURE__ */ s("p", { className: "text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: "External identifiers" }),
|
|
173
|
+
/* @__PURE__ */ s("div", { className: "mt-1 flex flex-wrap gap-1.5", children: c.map((o) => /* @__PURE__ */ d(
|
|
172
174
|
"span",
|
|
173
175
|
{
|
|
174
176
|
className: "inline-flex items-center gap-1 rounded border border-slate-200 bg-slate-50 px-1.5 py-0.5 text-[11px] dark:border-border dark:bg-muted/40",
|
|
175
177
|
children: [
|
|
176
178
|
/* @__PURE__ */ d("span", { className: "text-slate-400", children: [
|
|
177
|
-
|
|
179
|
+
o.field,
|
|
178
180
|
":"
|
|
179
181
|
] }),
|
|
180
|
-
/* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ s("span", { className: "font-mono text-slate-700 dark:text-slate-200", children: o.value })
|
|
181
183
|
]
|
|
182
184
|
},
|
|
183
|
-
|
|
185
|
+
o.field
|
|
184
186
|
)) })
|
|
185
187
|
] }),
|
|
186
188
|
/* @__PURE__ */ d("div", { className: "max-h-72 space-y-1 overflow-y-auto text-[12px]", children: [
|
|
187
|
-
|
|
188
|
-
/* @__PURE__ */
|
|
189
|
+
r.map((o) => /* @__PURE__ */ d("p", { className: "flex items-baseline justify-between gap-2", children: [
|
|
190
|
+
/* @__PURE__ */ s("span", { className: "min-w-0 truncate text-slate-700 dark:text-slate-200", children: o.external_api_name ?? o.target ?? o.endpoint_path ?? "ERP push" }),
|
|
189
191
|
/* @__PURE__ */ d(
|
|
190
192
|
"span",
|
|
191
193
|
{
|
|
192
|
-
className:
|
|
194
|
+
className: o.status === "failed" ? "shrink-0 text-red-500" : o.status === "accepted" ? "shrink-0 text-emerald-600" : "shrink-0 text-slate-400",
|
|
193
195
|
children: [
|
|
194
|
-
|
|
196
|
+
o.status,
|
|
195
197
|
" · ",
|
|
196
|
-
new Date(
|
|
198
|
+
new Date(o.created_at).toLocaleDateString()
|
|
197
199
|
]
|
|
198
200
|
}
|
|
199
201
|
)
|
|
200
|
-
] }, `e${
|
|
201
|
-
e == null ? void 0 : e.webhooks.map((
|
|
202
|
+
] }, `e${o.id}`)),
|
|
203
|
+
e == null ? void 0 : e.webhooks.map((o) => /* @__PURE__ */ d("p", { className: "flex items-baseline justify-between gap-2", children: [
|
|
202
204
|
/* @__PURE__ */ d("span", { className: "min-w-0 truncate text-slate-700 dark:text-slate-200", children: [
|
|
203
205
|
"webhook: ",
|
|
204
|
-
|
|
206
|
+
o.webhook
|
|
205
207
|
] }),
|
|
206
208
|
/* @__PURE__ */ d("span", { className: "shrink-0 text-slate-400", children: [
|
|
207
|
-
|
|
209
|
+
o.response_status,
|
|
208
210
|
" · ",
|
|
209
|
-
new Date(
|
|
211
|
+
new Date(o.created_at).toLocaleDateString()
|
|
210
212
|
] })
|
|
211
|
-
] }, `w${
|
|
213
|
+
] }, `w${o.id}`))
|
|
212
214
|
] })
|
|
213
215
|
] });
|
|
214
216
|
}
|
|
215
217
|
function T({ collection: a, itemId: t }) {
|
|
216
|
-
const
|
|
218
|
+
const n = h(), { data: r = [], isLoading: l } = p({
|
|
217
219
|
queryKey: ["record-owner-history", a, t],
|
|
218
|
-
queryFn: () =>
|
|
220
|
+
queryFn: () => n.request(u(`/owner-history/${a}/${t}`)).then((e) => e.data),
|
|
219
221
|
staleTime: 3e4
|
|
220
222
|
});
|
|
221
|
-
return l ? /* @__PURE__ */
|
|
222
|
-
/* @__PURE__ */
|
|
223
|
-
|
|
223
|
+
return l ? /* @__PURE__ */ s("p", { className: "text-[12px] text-slate-400", children: "Loading…" }) : r.length === 0 ? /* @__PURE__ */ s("p", { className: "text-[12px] text-slate-400", children: "No workflow history on this record." }) : /* @__PURE__ */ d("div", { className: "max-h-72 space-y-2 overflow-y-auto text-[12px]", children: [
|
|
224
|
+
/* @__PURE__ */ s("p", { className: "text-[10.5px] text-amber-600 dark:text-amber-400", children: "Owners shown are resolved with TODAY's matrix config — membership changes since then aren't snapshotted." }),
|
|
225
|
+
r.map((e, i) => (
|
|
224
226
|
// biome-ignore lint/suspicious/noArrayIndexKey: ordered stays
|
|
225
227
|
/* @__PURE__ */ d("div", { children: [
|
|
226
228
|
/* @__PURE__ */ d("p", { className: "font-medium text-slate-700 dark:text-slate-200", children: [
|
|
@@ -234,8 +236,8 @@ function T({ collection: a, itemId: t }) {
|
|
|
234
236
|
e.moved_by ? ` · moved by ${e.moved_by}` : ""
|
|
235
237
|
] })
|
|
236
238
|
] }),
|
|
237
|
-
/* @__PURE__ */
|
|
238
|
-
] },
|
|
239
|
+
/* @__PURE__ */ s("p", { className: "text-[11.5px] text-slate-500 dark:text-muted-foreground", children: e.owners.length > 0 ? e.owners.map((c) => c.name).join(", ") : "no resolved owners" })
|
|
240
|
+
] }, i)
|
|
239
241
|
))
|
|
240
242
|
] });
|
|
241
243
|
}
|
|
@@ -249,17 +251,17 @@ const S = {
|
|
|
249
251
|
}
|
|
250
252
|
};
|
|
251
253
|
function K(a) {
|
|
252
|
-
const t = a.split(/[,;]/).map((
|
|
253
|
-
return t.slice(0, 2).map((
|
|
254
|
+
const t = a.split(/[,;]/).map((r) => r.trim()).filter(Boolean);
|
|
255
|
+
return t.slice(0, 2).map((r) => r.split("@")[0]).join(", ") + (t.length > 2 ? ` +${t.length - 2}` : "");
|
|
254
256
|
}
|
|
255
257
|
function D({ collection: a, itemId: t }) {
|
|
256
|
-
const
|
|
258
|
+
const n = h(), { data: r = [], isLoading: l } = p({
|
|
257
259
|
queryKey: ["record-mail-log", a, t],
|
|
258
|
-
queryFn: () =>
|
|
260
|
+
queryFn: () => n.request(u(`/mail-log/record/${a}/${t}`)).then((e) => e.data ?? []).catch(() => []),
|
|
259
261
|
staleTime: 3e4
|
|
260
262
|
});
|
|
261
|
-
return l ? /* @__PURE__ */
|
|
262
|
-
const
|
|
263
|
+
return l ? /* @__PURE__ */ s("p", { className: "p-3 text-[12px] text-slate-400", children: "Loading…" }) : r.length === 0 ? /* @__PURE__ */ s("p", { className: "p-3 text-[12px] text-slate-400", children: "No emails have been sent about this record." }) : /* @__PURE__ */ s("div", { className: "max-h-80 overflow-y-auto", children: r.map((e) => {
|
|
264
|
+
const i = S[e.status] ?? {
|
|
263
265
|
label: e.status,
|
|
264
266
|
cls: "bg-slate-500/10 text-slate-500"
|
|
265
267
|
};
|
|
@@ -269,7 +271,7 @@ function D({ collection: a, itemId: t }) {
|
|
|
269
271
|
className: "border-t border-slate-100 py-2 first:border-t-0 dark:border-border/50",
|
|
270
272
|
children: [
|
|
271
273
|
/* @__PURE__ */ d("div", { className: "flex items-start justify-between gap-2", children: [
|
|
272
|
-
/* @__PURE__ */
|
|
274
|
+
/* @__PURE__ */ s(
|
|
273
275
|
"p",
|
|
274
276
|
{
|
|
275
277
|
className: "min-w-0 text-[12px] leading-snug text-slate-700 [display:-webkit-box] [-webkit-box-orient:vertical] [-webkit-line-clamp:2] overflow-hidden dark:text-slate-200",
|
|
@@ -277,11 +279,11 @@ function D({ collection: a, itemId: t }) {
|
|
|
277
279
|
children: e.subject
|
|
278
280
|
}
|
|
279
281
|
),
|
|
280
|
-
/* @__PURE__ */
|
|
282
|
+
/* @__PURE__ */ s(
|
|
281
283
|
"span",
|
|
282
284
|
{
|
|
283
|
-
className: `shrink-0 rounded-full px-1.5 py-px text-[10px] font-medium ${
|
|
284
|
-
children:
|
|
285
|
+
className: `shrink-0 rounded-full px-1.5 py-px text-[10px] font-medium ${i.cls}`,
|
|
286
|
+
children: i.label
|
|
285
287
|
}
|
|
286
288
|
)
|
|
287
289
|
] }),
|
|
@@ -291,12 +293,12 @@ function D({ collection: a, itemId: t }) {
|
|
|
291
293
|
K(e.to)
|
|
292
294
|
] }),
|
|
293
295
|
" · ",
|
|
294
|
-
/* @__PURE__ */
|
|
296
|
+
/* @__PURE__ */ s("span", { "data-tip": new Date(e.created_at).toLocaleString(), children: new Date(e.created_at).toLocaleDateString(void 0, {
|
|
295
297
|
month: "short",
|
|
296
298
|
day: "numeric"
|
|
297
299
|
}) })
|
|
298
300
|
] }),
|
|
299
|
-
e.status === "failed" && e.error && /* @__PURE__ */
|
|
301
|
+
e.status === "failed" && e.error && /* @__PURE__ */ s(
|
|
300
302
|
"p",
|
|
301
303
|
{
|
|
302
304
|
className: "mt-0.5 truncate rounded bg-red-500/5 px-1.5 py-0.5 text-[10.5px] text-red-600 dark:text-red-400",
|
|
@@ -311,33 +313,33 @@ function D({ collection: a, itemId: t }) {
|
|
|
311
313
|
}) });
|
|
312
314
|
}
|
|
313
315
|
function R({ collection: a, itemId: t }) {
|
|
314
|
-
const
|
|
316
|
+
const n = h(), { data: r = [], isLoading: l } = p({
|
|
315
317
|
queryKey: ["record-chat-mentions", a, t],
|
|
316
|
-
queryFn: () =>
|
|
318
|
+
queryFn: () => n.request(u(`/chat/record-mentions/${a}/${t}`)).then((i) => i.data ?? []).catch(() => []),
|
|
317
319
|
staleTime: 6e4
|
|
318
320
|
});
|
|
319
|
-
if (l) return /* @__PURE__ */
|
|
320
|
-
if (
|
|
321
|
-
return /* @__PURE__ */
|
|
322
|
-
const e = (
|
|
323
|
-
return /* @__PURE__ */
|
|
321
|
+
if (l) return /* @__PURE__ */ s("p", { className: "p-3 text-[12px] text-slate-400", children: "Loading…" });
|
|
322
|
+
if (r.length === 0)
|
|
323
|
+
return /* @__PURE__ */ s("p", { className: "p-3 text-[12px] text-slate-400", children: "No chat messages mention this record outside its own room." });
|
|
324
|
+
const e = (i) => i === "global" ? "#global" : i.startsWith("ch:") ? `#${i.slice(3)}` : i.startsWith("dm:") ? "a direct message" : i;
|
|
325
|
+
return /* @__PURE__ */ s("div", { className: "max-h-72 overflow-y-auto", children: r.map((i) => /* @__PURE__ */ d(
|
|
324
326
|
"div",
|
|
325
327
|
{
|
|
326
328
|
className: "border-b border-slate-100 px-3 py-1.5 last:border-b-0 dark:border-border/50",
|
|
327
329
|
children: [
|
|
328
330
|
/* @__PURE__ */ d("p", { className: "text-[12px] text-slate-700 dark:text-slate-200", children: [
|
|
329
|
-
/* @__PURE__ */
|
|
331
|
+
/* @__PURE__ */ s("span", { className: "font-medium", children: i.sender_name ?? "Someone" }),
|
|
330
332
|
" ",
|
|
331
333
|
/* @__PURE__ */ d("span", { className: "text-slate-400", children: [
|
|
332
334
|
"in ",
|
|
333
|
-
e(
|
|
335
|
+
e(i.room)
|
|
334
336
|
] })
|
|
335
337
|
] }),
|
|
336
|
-
/* @__PURE__ */
|
|
337
|
-
/* @__PURE__ */
|
|
338
|
+
/* @__PURE__ */ s("p", { className: "truncate text-[11.5px] text-slate-500", children: i.message.slice(0, 160) }),
|
|
339
|
+
/* @__PURE__ */ s("p", { className: "text-[10px] text-slate-400", children: new Date(i.date_created).toLocaleString() })
|
|
338
340
|
]
|
|
339
341
|
},
|
|
340
|
-
|
|
342
|
+
i.id
|
|
341
343
|
)) });
|
|
342
344
|
}
|
|
343
345
|
export {
|
|
@@ -43,7 +43,10 @@ const Qe = 8e3, te = [
|
|
|
43
43
|
"approval-brief",
|
|
44
44
|
"erp-submissions",
|
|
45
45
|
"record-integrations",
|
|
46
|
-
"record-integrity"
|
|
46
|
+
"record-integrity",
|
|
47
|
+
// Per-state extension actions (Push to Fusion): someone else's move changes them (army 11 F-12).
|
|
48
|
+
"item-actions",
|
|
49
|
+
"ext-item-actions"
|
|
47
50
|
];
|
|
48
51
|
function qe(e, r, u) {
|
|
49
52
|
const p = new Set(te), f = String(u);
|