@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,80 +1,81 @@
|
|
|
1
1
|
import { jsxs as r, jsx as e, Fragment as J } from "react/jsx-runtime";
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { RotateCw as
|
|
4
|
-
import { useState as x, useEffect as
|
|
5
|
-
import { useNivaroClient as
|
|
6
|
-
import { get as
|
|
7
|
-
import { userErrorMessage as
|
|
2
|
+
import { useQueryClient as ie, useQuery as K } from "@tanstack/react-query";
|
|
3
|
+
import { RotateCw as ce, Search as ue, UserX as me, ChevronDown as Y, ChevronRight as Z } from "lucide-react";
|
|
4
|
+
import { useState as x, useEffect as xe, useMemo as F, useCallback as he } from "react";
|
|
5
|
+
import { useNivaroClient as B, useNavigation as ee, useItemNavigation as te } from "../../context.js";
|
|
6
|
+
import { get as M, post as ae } from "../../lib/commands.js";
|
|
7
|
+
import { userErrorMessage as Q } from "../../lib/safe-error.js";
|
|
8
8
|
import { cn as A, formatRelative as pe } from "../../lib/utils.js";
|
|
9
|
-
import { UserAvatar as
|
|
10
|
-
const
|
|
9
|
+
import { UserAvatar as fe } from "../UserAvatar.js";
|
|
10
|
+
const re = {
|
|
11
11
|
suspended: "Suspended",
|
|
12
12
|
redacted: "Redacted",
|
|
13
|
-
|
|
13
|
+
// One word for one state app-wide (army 11): the legacy anonymisation IS a redaction.
|
|
14
|
+
anonymised: "Redacted",
|
|
14
15
|
placeholder: "Placeholder"
|
|
15
|
-
},
|
|
16
|
+
}, ne = {
|
|
16
17
|
suspended: "The account is suspended — the person cannot sign in or act.",
|
|
17
|
-
redacted: "Personal details were removed by a retention policy.",
|
|
18
|
-
anonymised: "
|
|
18
|
+
redacted: "Personal details were removed by a retention policy (or the legacy retention job).",
|
|
19
|
+
anonymised: "Redacted by the legacy retention job — the name and email were replaced.",
|
|
19
20
|
placeholder: "Stands in for a legacy account that no longer exists."
|
|
20
|
-
},
|
|
21
|
+
}, be = {
|
|
21
22
|
suspended: "bg-[#fef3c7] text-[#92400e] dark:bg-[#3a2a12] dark:text-[#f5c97a]",
|
|
22
23
|
redacted: "bg-[#ffe4e6] text-[#9f1239] dark:bg-[#3d1a20] dark:text-[#f4a3ad]",
|
|
23
24
|
anonymised: "bg-[#ffe4e6] text-[#9f1239] dark:bg-[#3d1a20] dark:text-[#f4a3ad]",
|
|
24
25
|
placeholder: "bg-[#e2e8f0] text-[#334155] dark:bg-[#2c3038] dark:text-[#cbd5e1]"
|
|
25
|
-
}, b = (l) => l.toLocaleString();
|
|
26
|
-
function
|
|
26
|
+
}, b = (l) => l.toLocaleString(), X = (l) => l === "anonymised" ? "redacted" : l, ge = ["suspended", "redacted", "placeholder"];
|
|
27
|
+
function Ee({
|
|
27
28
|
className: l,
|
|
28
29
|
focusUserId: s,
|
|
29
30
|
onClearFocus: o
|
|
30
31
|
}) {
|
|
31
|
-
var
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
L(s ?? null), s &&
|
|
32
|
+
var I;
|
|
33
|
+
const N = B(), y = ie(), [h, d] = x(!0), [u, k] = x(!1), [i, m] = x(!1), [g, w] = x(!0), [c, C] = x(null), [q, j] = x(""), [_, E] = x(s ?? null), [$, L] = x(s ?? null);
|
|
34
|
+
xe(() => {
|
|
35
|
+
L(s ?? null), s && E(s);
|
|
35
36
|
}, [s]);
|
|
36
|
-
const [n,
|
|
37
|
+
const [n, p] = x(0), a = K({
|
|
37
38
|
queryKey: ["inactive-user-links", n],
|
|
38
|
-
queryFn: () =>
|
|
39
|
+
queryFn: () => N.request(M(`/inactive-user-links${n ? "?fresh=1" : ""}`)).then((t) => t.data),
|
|
39
40
|
staleTime: 6e4
|
|
40
|
-
}), f =
|
|
41
|
+
}), f = F(
|
|
41
42
|
() => {
|
|
42
43
|
var t;
|
|
43
44
|
return new Map((((t = a.data) == null ? void 0 : t.sources) ?? []).map((S) => [S.key, S]));
|
|
44
45
|
},
|
|
45
46
|
[a.data]
|
|
46
|
-
),
|
|
47
|
-
(t) => !(!t || t.role === "audit" && !u || t.role === "own" && !i || t.role === "seat" && !g ||
|
|
48
|
-
[
|
|
49
|
-
),
|
|
47
|
+
), D = he(
|
|
48
|
+
(t) => !(!t || t.role === "audit" && !u || t.role === "own" && !i || t.role === "seat" && !g || h && t.scope !== "open" && t.role !== "seat"),
|
|
49
|
+
[h, u, i, g]
|
|
50
|
+
), T = F(() => {
|
|
50
51
|
var S;
|
|
51
52
|
const t = q.trim().toLowerCase();
|
|
52
53
|
return (((S = a.data) == null ? void 0 : S.users) ?? []).map((v) => {
|
|
53
|
-
const P = v.links.filter((R) =>
|
|
54
|
-
(R,
|
|
55
|
-
var
|
|
56
|
-
return +(((
|
|
54
|
+
const P = v.links.filter((R) => D(f.get(R.source))).sort(
|
|
55
|
+
(R, z) => {
|
|
56
|
+
var G, V;
|
|
57
|
+
return +(((G = f.get(R.source)) == null ? void 0 : G.role) === "seat") - +(((V = f.get(z.source)) == null ? void 0 : V.role) === "seat") || z.count - R.count;
|
|
57
58
|
}
|
|
58
59
|
);
|
|
59
|
-
return { ...v, links: P, total: P.reduce((R,
|
|
60
|
+
return { ...v, links: P, total: P.reduce((R, z) => R + z.count, 0) };
|
|
60
61
|
}).filter((v) => v.total > 0).filter((v) => !$ || v.user.id.toUpperCase() === $.toUpperCase()).filter(
|
|
61
62
|
(v) => !t || `${v.user.name} ${v.user.email ?? ""}`.toLowerCase().includes(t)
|
|
62
63
|
).sort((v, P) => P.total - v.total);
|
|
63
|
-
}, [a.data, f, q,
|
|
64
|
+
}, [a.data, f, q, D, $]), W = F(() => {
|
|
64
65
|
const t = { suspended: 0, redacted: 0, anonymised: 0, placeholder: 0 };
|
|
65
|
-
for (const S of
|
|
66
|
+
for (const S of T) t[X(S.user.reason)]++;
|
|
66
67
|
return t;
|
|
67
|
-
}, [
|
|
68
|
+
}, [T]), O = c ? T.filter((t) => X(t.user.reason) === c) : T, H = F(() => {
|
|
68
69
|
var v;
|
|
69
70
|
let t = 0, S = 0;
|
|
70
|
-
for (const P of
|
|
71
|
+
for (const P of O)
|
|
71
72
|
for (const R of P.links)
|
|
72
73
|
((v = f.get(R.source)) == null ? void 0 : v.role) === "seat" ? S += R.count : t += R.count;
|
|
73
74
|
return { records: t, seats: S };
|
|
74
|
-
}, [
|
|
75
|
-
|
|
76
|
-
},
|
|
77
|
-
|
|
75
|
+
}, [O, f]), oe = () => {
|
|
76
|
+
p((t) => t + 1), E(null);
|
|
77
|
+
}, de = () => {
|
|
78
|
+
y.invalidateQueries({ queryKey: ["inactive-user-links"] }), y.invalidateQueries({ queryKey: ["inactive-user-records"] });
|
|
78
79
|
};
|
|
79
80
|
return /* @__PURE__ */ r("div", { className: A("flex min-h-0 flex-1 flex-col gap-4 p-6", l), "data-inactive-links": !0, children: [
|
|
80
81
|
/* @__PURE__ */ r("div", { className: "flex flex-wrap items-center gap-x-5 gap-y-3", children: [
|
|
@@ -85,17 +86,17 @@ function qe({
|
|
|
85
86
|
{
|
|
86
87
|
className: "text-[20px] font-semibold tabular-nums text-slate-900 dark:text-foreground",
|
|
87
88
|
"data-inactive-people": !0,
|
|
88
|
-
children: a.isLoading ? "—" : b(
|
|
89
|
+
children: a.isLoading ? "—" : b(O.length)
|
|
89
90
|
}
|
|
90
91
|
),
|
|
91
|
-
/* @__PURE__ */ e("dt", { children:
|
|
92
|
+
/* @__PURE__ */ e("dt", { children: O.length === 1 ? "person" : "people" })
|
|
92
93
|
] }),
|
|
93
94
|
/* @__PURE__ */ r("div", { className: "flex items-baseline gap-1.5", children: [
|
|
94
|
-
/* @__PURE__ */ e("dd", { className: "text-[20px] font-semibold tabular-nums text-slate-900 dark:text-foreground", children: a.isLoading ? "—" : b(
|
|
95
|
-
/* @__PURE__ */ e("dt", { children:
|
|
95
|
+
/* @__PURE__ */ e("dd", { className: "text-[20px] font-semibold tabular-nums text-slate-900 dark:text-foreground", children: a.isLoading ? "—" : b(H.records) }),
|
|
96
|
+
/* @__PURE__ */ e("dt", { children: h ? "links on open records" : "record links" })
|
|
96
97
|
] }),
|
|
97
98
|
/* @__PURE__ */ r("div", { className: "flex items-baseline gap-1.5", children: [
|
|
98
|
-
/* @__PURE__ */ e("dd", { className: "text-[20px] font-semibold tabular-nums text-slate-900 dark:text-foreground", children: a.isLoading ? "—" : b(
|
|
99
|
+
/* @__PURE__ */ e("dd", { className: "text-[20px] font-semibold tabular-nums text-slate-900 dark:text-foreground", children: a.isLoading ? "—" : b(H.seats) }),
|
|
99
100
|
/* @__PURE__ */ e("dt", { children: "owner seats and team places" })
|
|
100
101
|
] })
|
|
101
102
|
] }),
|
|
@@ -103,12 +104,12 @@ function qe({
|
|
|
103
104
|
"button",
|
|
104
105
|
{
|
|
105
106
|
type: "button",
|
|
106
|
-
onClick:
|
|
107
|
+
onClick: oe,
|
|
107
108
|
disabled: a.isFetching,
|
|
108
109
|
className: "ml-auto inline-flex h-8 items-center gap-1.5 rounded-md border border-slate-200 px-2.5 text-[12px] font-medium text-slate-600 hover:border-slate-300 hover:text-slate-900 disabled:opacity-60 dark:border-border dark:text-muted-foreground dark:hover:text-foreground",
|
|
109
110
|
"data-inactive-rescan": !0,
|
|
110
111
|
children: [
|
|
111
|
-
/* @__PURE__ */ e(
|
|
112
|
+
/* @__PURE__ */ e(ce, { className: A("h-3.5 w-3.5", a.isFetching && "animate-spin") }),
|
|
112
113
|
"Scan again"
|
|
113
114
|
]
|
|
114
115
|
}
|
|
@@ -137,7 +138,7 @@ function qe({
|
|
|
137
138
|
),
|
|
138
139
|
/* @__PURE__ */ r("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
139
140
|
/* @__PURE__ */ r("label", { className: "relative", children: [
|
|
140
|
-
/* @__PURE__ */ e(
|
|
141
|
+
/* @__PURE__ */ e(ue, { className: "pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
|
|
141
142
|
/* @__PURE__ */ e(
|
|
142
143
|
"input",
|
|
143
144
|
{
|
|
@@ -149,23 +150,23 @@ function qe({
|
|
|
149
150
|
}
|
|
150
151
|
)
|
|
151
152
|
] }),
|
|
152
|
-
/* @__PURE__ */ e("span", { className: "flex flex-wrap items-center gap-1", children:
|
|
153
|
-
(t) =>
|
|
153
|
+
/* @__PURE__ */ e("span", { className: "flex flex-wrap items-center gap-1", children: ge.map(
|
|
154
|
+
(t) => W[t] || c === t ? /* @__PURE__ */ r(
|
|
154
155
|
"button",
|
|
155
156
|
{
|
|
156
157
|
type: "button",
|
|
157
158
|
"aria-pressed": c === t,
|
|
158
159
|
onClick: () => C(c === t ? null : t),
|
|
159
|
-
"data-tip":
|
|
160
|
+
"data-tip": ne[t],
|
|
160
161
|
"data-inactive-reason": t,
|
|
161
162
|
className: A(
|
|
162
163
|
"h-7 rounded-md border px-2 text-[11.5px] font-medium transition-colors",
|
|
163
164
|
c === t ? "border-slate-400 bg-slate-100 text-slate-900 dark:border-border dark:bg-muted dark:text-foreground" : "border-slate-200 text-slate-600 hover:border-slate-300 dark:border-border dark:text-muted-foreground"
|
|
164
165
|
),
|
|
165
166
|
children: [
|
|
166
|
-
|
|
167
|
+
re[t],
|
|
167
168
|
" ",
|
|
168
|
-
/* @__PURE__ */ e("span", { className: "tabular-nums text-slate-500 dark:text-muted-foreground", children: b(
|
|
169
|
+
/* @__PURE__ */ e("span", { className: "tabular-nums text-slate-500 dark:text-muted-foreground", children: b(W[t]) })
|
|
169
170
|
]
|
|
170
171
|
},
|
|
171
172
|
t
|
|
@@ -173,16 +174,16 @@ function qe({
|
|
|
173
174
|
) }),
|
|
174
175
|
/* @__PURE__ */ r("span", { className: "ml-auto flex flex-wrap items-center gap-x-4 gap-y-1", children: [
|
|
175
176
|
/* @__PURE__ */ e(
|
|
176
|
-
|
|
177
|
+
U,
|
|
177
178
|
{
|
|
178
179
|
label: "Only records in an open workflow",
|
|
179
|
-
checked:
|
|
180
|
+
checked: h,
|
|
180
181
|
onChange: d,
|
|
181
182
|
hook: "open"
|
|
182
183
|
}
|
|
183
184
|
),
|
|
184
185
|
/* @__PURE__ */ e(
|
|
185
|
-
|
|
186
|
+
U,
|
|
186
187
|
{
|
|
187
188
|
label: "Owner seats and team places",
|
|
188
189
|
checked: g,
|
|
@@ -191,7 +192,7 @@ function qe({
|
|
|
191
192
|
}
|
|
192
193
|
),
|
|
193
194
|
/* @__PURE__ */ e(
|
|
194
|
-
|
|
195
|
+
U,
|
|
195
196
|
{
|
|
196
197
|
label: "Created by / updated by",
|
|
197
198
|
checked: u,
|
|
@@ -200,7 +201,7 @@ function qe({
|
|
|
200
201
|
}
|
|
201
202
|
),
|
|
202
203
|
/* @__PURE__ */ e(
|
|
203
|
-
|
|
204
|
+
U,
|
|
204
205
|
{
|
|
205
206
|
label: "The person's own saved sets",
|
|
206
207
|
checked: i,
|
|
@@ -210,7 +211,7 @@ function qe({
|
|
|
210
211
|
)
|
|
211
212
|
] })
|
|
212
213
|
] }),
|
|
213
|
-
(
|
|
214
|
+
(I = a.data) != null && I.failed.length ? /* @__PURE__ */ r("p", { className: "text-[11.5px] text-amber-700 dark:text-amber-300", children: [
|
|
214
215
|
a.data.failed.length,
|
|
215
216
|
" link ",
|
|
216
217
|
a.data.failed.length === 1 ? "type" : "types",
|
|
@@ -226,29 +227,29 @@ function qe({
|
|
|
226
227
|
t
|
|
227
228
|
)) }) : a.isError ? /* @__PURE__ */ r("p", { className: "p-6 text-[12.5px] text-rose-700 dark:text-rose-300", children: [
|
|
228
229
|
"The scan failed. ",
|
|
229
|
-
|
|
230
|
-
] }) :
|
|
231
|
-
/* @__PURE__ */ e(
|
|
232
|
-
/* @__PURE__ */ e("p", { className: "text-[13px] font-medium text-slate-800 dark:text-foreground", children:
|
|
233
|
-
/* @__PURE__ */ e("p", { className: "max-w-[52ch] text-[12px] text-slate-500 dark:text-muted-foreground", children:
|
|
234
|
-
] }) : /* @__PURE__ */ e("ul", { className: "min-h-0 flex-1 divide-y divide-slate-100 overflow-y-auto dark:divide-border", children:
|
|
235
|
-
|
|
230
|
+
Q(a.error, "")
|
|
231
|
+
] }) : O.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-1 flex-col items-center justify-center gap-2 p-10 text-center", children: [
|
|
232
|
+
/* @__PURE__ */ e(me, { className: "h-6 w-6 text-slate-400" }),
|
|
233
|
+
/* @__PURE__ */ e("p", { className: "text-[13px] font-medium text-slate-800 dark:text-foreground", children: h ? "Nobody inactive is named on open work" : "Nothing matches" }),
|
|
234
|
+
/* @__PURE__ */ e("p", { className: "max-w-[52ch] text-[12px] text-slate-500 dark:text-muted-foreground", children: h ? "Every contact, owner and task on a record in an open workflow belongs to someone who can still act. Clear the first switch to look at closed records too." : "Change the switches above to widen what counts as a link." })
|
|
235
|
+
] }) : /* @__PURE__ */ e("ul", { className: "min-h-0 flex-1 divide-y divide-slate-100 overflow-y-auto dark:divide-border", children: O.map((t) => /* @__PURE__ */ e(
|
|
236
|
+
ke,
|
|
236
237
|
{
|
|
237
238
|
person: t,
|
|
238
239
|
sources: f,
|
|
239
240
|
open: _ === t.user.id,
|
|
240
|
-
onToggle: () =>
|
|
241
|
-
onChanged:
|
|
241
|
+
onToggle: () => E(_ === t.user.id ? null : t.user.id),
|
|
242
|
+
onChanged: de
|
|
242
243
|
},
|
|
243
244
|
t.user.id
|
|
244
245
|
)) }) })
|
|
245
246
|
] });
|
|
246
247
|
}
|
|
247
|
-
function
|
|
248
|
+
function U({
|
|
248
249
|
label: l,
|
|
249
250
|
checked: s,
|
|
250
251
|
onChange: o,
|
|
251
|
-
hook:
|
|
252
|
+
hook: N
|
|
252
253
|
}) {
|
|
253
254
|
return /* @__PURE__ */ r("label", { className: "flex cursor-pointer items-center gap-1.5 text-[11.5px] text-slate-600 dark:text-muted-foreground", children: [
|
|
254
255
|
/* @__PURE__ */ e(
|
|
@@ -256,37 +257,37 @@ function B({
|
|
|
256
257
|
{
|
|
257
258
|
type: "checkbox",
|
|
258
259
|
checked: s,
|
|
259
|
-
onChange: (
|
|
260
|
+
onChange: (y) => o(y.target.checked),
|
|
260
261
|
className: "h-3.5 w-3.5 accent-slate-700",
|
|
261
|
-
"data-inactive-switch":
|
|
262
|
+
"data-inactive-switch": N
|
|
262
263
|
}
|
|
263
264
|
),
|
|
264
265
|
l
|
|
265
266
|
] });
|
|
266
267
|
}
|
|
267
|
-
function
|
|
268
|
+
function se(l) {
|
|
268
269
|
return l.kind === "builtin" ? l.label : `${l.collection_label} · ${l.label}`;
|
|
269
270
|
}
|
|
270
|
-
function
|
|
271
|
+
function ke({
|
|
271
272
|
person: l,
|
|
272
273
|
sources: s,
|
|
273
274
|
open: o,
|
|
274
|
-
onToggle:
|
|
275
|
-
onChanged:
|
|
275
|
+
onToggle: N,
|
|
276
|
+
onChanged: y
|
|
276
277
|
}) {
|
|
277
|
-
const
|
|
278
|
+
const h = ee(), d = l.user, u = h.userUrl ? h.userUrl(d.id) : `/users/${d.id}`, k = d.name.split(/\s+/).map((i) => i[0]).join("").slice(0, 2).toUpperCase();
|
|
278
279
|
return /* @__PURE__ */ r("li", { "data-inactive-person": d.id, children: [
|
|
279
280
|
/* @__PURE__ */ r(
|
|
280
281
|
"button",
|
|
281
282
|
{
|
|
282
283
|
type: "button",
|
|
283
|
-
onClick:
|
|
284
|
+
onClick: N,
|
|
284
285
|
"aria-expanded": o,
|
|
285
286
|
className: "flex w-full items-center gap-3 px-4 py-2.5 text-left hover:bg-muted",
|
|
286
287
|
children: [
|
|
287
288
|
o ? /* @__PURE__ */ e(Y, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }) : /* @__PURE__ */ e(Z, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
|
|
288
289
|
/* @__PURE__ */ e(
|
|
289
|
-
|
|
290
|
+
fe,
|
|
290
291
|
{
|
|
291
292
|
userId: d.id,
|
|
292
293
|
className: "h-6 w-6 shrink-0 rounded-full object-cover",
|
|
@@ -302,16 +303,16 @@ function be({
|
|
|
302
303
|
{
|
|
303
304
|
className: A(
|
|
304
305
|
"shrink-0 rounded px-1.5 py-0.5 text-[10.5px] font-medium",
|
|
305
|
-
|
|
306
|
+
be[d.reason]
|
|
306
307
|
),
|
|
307
|
-
"data-tip":
|
|
308
|
-
children:
|
|
308
|
+
"data-tip": ne[d.reason],
|
|
309
|
+
children: re[d.reason]
|
|
309
310
|
}
|
|
310
311
|
),
|
|
311
312
|
/* @__PURE__ */ r("span", { className: "hidden min-w-0 flex-1 truncate text-[11.5px] text-slate-500 md:block dark:text-muted-foreground", children: [
|
|
312
313
|
l.links.slice(0, 3).map((i) => {
|
|
313
314
|
const m = s.get(i.source);
|
|
314
|
-
return m ? `${
|
|
315
|
+
return m ? `${se(m)} ${b(i.count)}` : "";
|
|
315
316
|
}).filter(Boolean).join(" · "),
|
|
316
317
|
l.links.length > 3 ? ` · +${l.links.length - 3} more` : ""
|
|
317
318
|
] }),
|
|
@@ -324,12 +325,12 @@ function be({
|
|
|
324
325
|
/* @__PURE__ */ e("ul", { className: "space-y-1", children: l.links.map((i) => {
|
|
325
326
|
const m = s.get(i.source);
|
|
326
327
|
return m ? /* @__PURE__ */ e(
|
|
327
|
-
|
|
328
|
+
ve,
|
|
328
329
|
{
|
|
329
330
|
userId: d.id,
|
|
330
331
|
source: m,
|
|
331
332
|
count: i.count,
|
|
332
|
-
onChanged:
|
|
333
|
+
onChanged: y
|
|
333
334
|
},
|
|
334
335
|
i.source
|
|
335
336
|
) : null;
|
|
@@ -341,7 +342,7 @@ function be({
|
|
|
341
342
|
"button",
|
|
342
343
|
{
|
|
343
344
|
type: "button",
|
|
344
|
-
onClick: () =>
|
|
345
|
+
onClick: () => h.navigate(u),
|
|
345
346
|
className: "font-medium text-slate-700 underline decoration-dotted underline-offset-2 hover:text-slate-900 dark:text-foreground",
|
|
346
347
|
children: "their account page"
|
|
347
348
|
}
|
|
@@ -352,17 +353,17 @@ function be({
|
|
|
352
353
|
] })
|
|
353
354
|
] });
|
|
354
355
|
}
|
|
355
|
-
function
|
|
356
|
+
function ve({
|
|
356
357
|
userId: l,
|
|
357
358
|
source: s,
|
|
358
359
|
count: o,
|
|
359
|
-
onChanged:
|
|
360
|
+
onChanged: N
|
|
360
361
|
}) {
|
|
361
362
|
var g, w;
|
|
362
|
-
const
|
|
363
|
+
const y = B(), { open: h } = te(), [d, u] = x(!1), k = !0, i = s.kind === "builtin", m = K({
|
|
363
364
|
queryKey: ["inactive-user-records", l, s.key],
|
|
364
|
-
queryFn: () =>
|
|
365
|
-
|
|
365
|
+
queryFn: () => y.request(
|
|
366
|
+
M(
|
|
366
367
|
`/inactive-user-links/${l}/records?source=${encodeURIComponent(s.key)}&limit=100`
|
|
367
368
|
)
|
|
368
369
|
).then((c) => c.data),
|
|
@@ -380,21 +381,21 @@ function ge({
|
|
|
380
381
|
className: "flex min-w-0 items-center gap-1.5 text-left text-slate-700 enabled:hover:text-slate-900 dark:text-foreground",
|
|
381
382
|
children: [
|
|
382
383
|
d ? /* @__PURE__ */ e(Y, { className: "h-3 w-3 shrink-0 text-slate-400" }) : /* @__PURE__ */ e(Z, { className: "h-3 w-3 shrink-0 text-slate-400" }),
|
|
383
|
-
/* @__PURE__ */ e("span", { className: "truncate", children:
|
|
384
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: se(s) })
|
|
384
385
|
]
|
|
385
386
|
}
|
|
386
387
|
),
|
|
387
388
|
/* @__PURE__ */ e("span", { className: "tabular-nums text-slate-500 dark:text-muted-foreground", children: b(o) }),
|
|
388
389
|
s.scope === "open" && /* @__PURE__ */ e("span", { className: "rounded bg-[#e0f2fe] px-1.5 py-0.5 text-[10px] font-medium text-[#075985] dark:bg-[#15303f] dark:text-[#8fcdf0]", children: "open workflow" }),
|
|
389
|
-
s.reassignable && !i && /* @__PURE__ */ e("span", { className: "ml-auto", children: /* @__PURE__ */ e(
|
|
390
|
+
s.reassignable && !i && /* @__PURE__ */ e("span", { className: "ml-auto", children: /* @__PURE__ */ e(le, { userId: l, source: s, count: o, onDone: N }) })
|
|
390
391
|
] }),
|
|
391
392
|
d && k && /* @__PURE__ */ e("div", { className: "ml-[18px] mt-1 mb-2", children: m.isLoading ? /* @__PURE__ */ e("p", { className: "text-[11.5px] text-slate-500 dark:text-muted-foreground", children: "Loading…" }) : i ? /* @__PURE__ */ e(
|
|
392
|
-
|
|
393
|
+
Ne,
|
|
393
394
|
{
|
|
394
395
|
userId: l,
|
|
395
396
|
source: s,
|
|
396
397
|
entries: ((g = m.data) == null ? void 0 : g.entries) ?? [],
|
|
397
|
-
onChanged:
|
|
398
|
+
onChanged: N
|
|
398
399
|
}
|
|
399
400
|
) : (w = m.data) != null && w.records.length ? /* @__PURE__ */ r("ul", { className: "flex flex-wrap gap-1", "data-inactive-records": !0, children: [
|
|
400
401
|
m.data.records.map((c) => {
|
|
@@ -403,7 +404,7 @@ function ge({
|
|
|
403
404
|
"button",
|
|
404
405
|
{
|
|
405
406
|
type: "button",
|
|
406
|
-
onClick: () =>
|
|
407
|
+
onClick: () => h({ collection: c.collection, itemId: c.id }),
|
|
407
408
|
className: "rounded border border-slate-200 bg-white px-1.5 py-0.5 text-[11px] text-slate-700 hover:border-slate-400 dark:border-border dark:bg-card dark:text-foreground",
|
|
408
409
|
children: ((C = c.label) == null ? void 0 : C.trim()) || `#${c.id}`
|
|
409
410
|
}
|
|
@@ -417,31 +418,31 @@ function ge({
|
|
|
417
418
|
] }) : /* @__PURE__ */ e("p", { className: "text-[11.5px] text-slate-500 dark:text-muted-foreground", children: "Nothing to list." }) })
|
|
418
419
|
] });
|
|
419
420
|
}
|
|
420
|
-
function
|
|
421
|
+
function le({
|
|
421
422
|
userId: l,
|
|
422
423
|
source: s,
|
|
423
424
|
count: o,
|
|
424
|
-
ids:
|
|
425
|
-
label:
|
|
426
|
-
onDone:
|
|
425
|
+
ids: N,
|
|
426
|
+
label: y = "Hand to…",
|
|
427
|
+
onDone: h
|
|
427
428
|
}) {
|
|
428
|
-
var
|
|
429
|
-
const d =
|
|
429
|
+
var p;
|
|
430
|
+
const d = B(), [u, k] = x(!1), [i, m] = x(""), [g, w] = x(null), [c, C] = x(!1), [q, j] = x(null), [_, E] = x(null), $ = K({
|
|
430
431
|
queryKey: ["inactive-reassign-users", i],
|
|
431
|
-
queryFn: () => d.request(
|
|
432
|
+
queryFn: () => d.request(M(`/users?search=${encodeURIComponent(i)}&limit=8`)).then((a) => a.data),
|
|
432
433
|
enabled: u && !g && i.trim().length >= 2,
|
|
433
434
|
staleTime: 3e4
|
|
434
435
|
}), L = (a) => [a.first_name, a.last_name].filter(Boolean).join(" ") || a.email, n = async () => {
|
|
435
436
|
if (g) {
|
|
436
|
-
C(!0),
|
|
437
|
+
C(!0), E(null);
|
|
437
438
|
try {
|
|
438
|
-
const f = (await d.request(ae(`/inactive-user-links/${l}/reassign`, { source: s.key, to: g.id, ids:
|
|
439
|
+
const f = (await d.request(ae(`/inactive-user-links/${l}/reassign`, { source: s.key, to: g.id, ids: N }))).data;
|
|
439
440
|
j(
|
|
440
441
|
`${b(f.moved)} moved to ${L(g)}` + (f.removed ? ` · ${b(f.removed)} already theirs` : "") + (f.failed.length ? ` · ${b(f.failed.length)} refused (${f.failed[0].error})` : "")
|
|
441
|
-
), k(!1),
|
|
442
|
+
), k(!1), h();
|
|
442
443
|
} catch (a) {
|
|
443
444
|
const f = a.response;
|
|
444
|
-
|
|
445
|
+
E((f == null ? void 0 : f.error) ?? Q(a, ""));
|
|
445
446
|
} finally {
|
|
446
447
|
C(!1);
|
|
447
448
|
}
|
|
@@ -455,7 +456,7 @@ function se({
|
|
|
455
456
|
onClick: () => k((a) => !a),
|
|
456
457
|
"data-inactive-reassign": s.key,
|
|
457
458
|
className: "rounded-md border border-slate-200 bg-white px-2 py-0.5 text-[11px] text-slate-600 hover:border-slate-300 hover:text-slate-900 dark:border-border dark:bg-card dark:text-muted-foreground dark:hover:text-foreground",
|
|
458
|
-
children:
|
|
459
|
+
children: y
|
|
459
460
|
}
|
|
460
461
|
),
|
|
461
462
|
u && /* @__PURE__ */ e(
|
|
@@ -528,34 +529,34 @@ function se({
|
|
|
528
529
|
]
|
|
529
530
|
}
|
|
530
531
|
) }, a.id)),
|
|
531
|
-
i.trim().length >= 2 && !$.isLoading && !((
|
|
532
|
+
i.trim().length >= 2 && !$.isLoading && !((p = $.data) != null && p.length) && /* @__PURE__ */ e("li", { className: "px-2 py-1 text-[11.5px] text-slate-500 dark:text-muted-foreground", children: "No active person matches." })
|
|
532
533
|
] })
|
|
533
534
|
] })
|
|
534
535
|
}
|
|
535
536
|
)
|
|
536
537
|
] });
|
|
537
538
|
}
|
|
538
|
-
function
|
|
539
|
+
function Ne({
|
|
539
540
|
userId: l,
|
|
540
541
|
source: s,
|
|
541
542
|
entries: o,
|
|
542
|
-
onChanged:
|
|
543
|
+
onChanged: N
|
|
543
544
|
}) {
|
|
544
|
-
const
|
|
545
|
-
const a = new Set(
|
|
545
|
+
const y = B(), h = ee(), { open: d } = te(), [u, k] = x(/* @__PURE__ */ new Set()), [i, m] = x(!1), [g, w] = x(!1), [c, C] = x(null), q = s.key !== "builtin:tasks", j = [...u], _ = o.length > 0 && u.size === o.length, E = (n) => k((p) => {
|
|
546
|
+
const a = new Set(p);
|
|
546
547
|
return a.has(n) ? a.delete(n) : a.add(n), a;
|
|
547
548
|
}), $ = async () => {
|
|
548
549
|
var n;
|
|
549
550
|
w(!0);
|
|
550
551
|
try {
|
|
551
|
-
const
|
|
552
|
+
const p = await y.request(
|
|
552
553
|
ae(`/inactive-user-links/${l}/remove`, { source: s.key, ids: j })
|
|
553
554
|
);
|
|
554
555
|
C(
|
|
555
|
-
`${b(
|
|
556
|
-
), k(/* @__PURE__ */ new Set()), m(!1),
|
|
557
|
-
} catch (
|
|
558
|
-
C(((n =
|
|
556
|
+
`${b(p.data.removed)} removed${p.data.failed.length ? ` · ${b(p.data.failed.length)} refused` : ""}`
|
|
557
|
+
), k(/* @__PURE__ */ new Set()), m(!1), N();
|
|
558
|
+
} catch (p) {
|
|
559
|
+
C(((n = p.response) == null ? void 0 : n.error) ?? Q(p, ""));
|
|
559
560
|
} finally {
|
|
560
561
|
w(!1);
|
|
561
562
|
}
|
|
@@ -585,7 +586,7 @@ function ke({
|
|
|
585
586
|
c && /* @__PURE__ */ e("span", { className: "text-emerald-700 dark:text-emerald-400", children: c }),
|
|
586
587
|
u.size > 0 && /* @__PURE__ */ r("span", { className: "ml-auto flex items-center gap-1.5", children: [
|
|
587
588
|
/* @__PURE__ */ e(
|
|
588
|
-
|
|
589
|
+
le,
|
|
589
590
|
{
|
|
590
591
|
userId: l,
|
|
591
592
|
source: s,
|
|
@@ -593,7 +594,7 @@ function ke({
|
|
|
593
594
|
ids: j,
|
|
594
595
|
label: `Hand ${b(u.size)} to…`,
|
|
595
596
|
onDone: () => {
|
|
596
|
-
k(/* @__PURE__ */ new Set()),
|
|
597
|
+
k(/* @__PURE__ */ new Set()), N();
|
|
597
598
|
}
|
|
598
599
|
}
|
|
599
600
|
),
|
|
@@ -631,7 +632,7 @@ function ke({
|
|
|
631
632
|
] })
|
|
632
633
|
] }),
|
|
633
634
|
/* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 rounded-md border border-slate-200 bg-white dark:divide-border dark:border-border dark:bg-card", children: o.map((n) => {
|
|
634
|
-
const
|
|
635
|
+
const p = n.console_path ? h.consoleUrl ? h.consoleUrl(n.console_path) : n.console_path : null;
|
|
635
636
|
return /* @__PURE__ */ r(
|
|
636
637
|
"li",
|
|
637
638
|
{
|
|
@@ -643,7 +644,7 @@ function ke({
|
|
|
643
644
|
{
|
|
644
645
|
type: "checkbox",
|
|
645
646
|
checked: u.has(n.id),
|
|
646
|
-
onChange: () =>
|
|
647
|
+
onChange: () => E(n.id),
|
|
647
648
|
"aria-label": `Pick ${n.title}`,
|
|
648
649
|
className: "mt-0.5 h-3.5 w-3.5 shrink-0 accent-slate-700"
|
|
649
650
|
}
|
|
@@ -658,11 +659,11 @@ function ke({
|
|
|
658
659
|
className: "text-left text-[12px] font-medium text-slate-900 underline decoration-dotted underline-offset-2 dark:text-foreground",
|
|
659
660
|
children: n.title
|
|
660
661
|
}
|
|
661
|
-
) :
|
|
662
|
+
) : p ? /* @__PURE__ */ e(
|
|
662
663
|
"button",
|
|
663
664
|
{
|
|
664
665
|
type: "button",
|
|
665
|
-
onClick: () => /^https?:/.test(
|
|
666
|
+
onClick: () => /^https?:/.test(p) ? window.open(p, "_blank") : h.navigate(p),
|
|
666
667
|
className: "text-left text-[12px] font-medium text-slate-900 underline decoration-dotted underline-offset-2 dark:text-foreground",
|
|
667
668
|
children: n.title
|
|
668
669
|
}
|
|
@@ -689,5 +690,6 @@ function ke({
|
|
|
689
690
|
] });
|
|
690
691
|
}
|
|
691
692
|
export {
|
|
692
|
-
|
|
693
|
+
Ee as InactiveUserLinksView,
|
|
694
|
+
X as reasonGroup
|
|
693
695
|
};
|