@nivaro/react 0.3.63 → 0.3.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +54 -5
- package/dist/shared/components/CollectionBrowserView.js +3029 -2947
- package/dist/shared/components/ConformanceView.js +235 -221
- package/dist/shared/components/DataTable.js +478 -459
- package/dist/shared/components/ItemEditForm.js +4469 -4266
- package/dist/shared/components/PageRenderer.js +146 -138
- package/dist/shared/components/RecordDrilldownSheet.js +73 -65
- package/dist/shared/components/bulk/BulkActionButtons.js +72 -72
- package/dist/shared/components/bulk/BulkFieldUpdate.js +114 -103
- package/dist/shared/components/bulk/BulkFieldUpdateButton.js +73 -0
- package/dist/shared/components/bulk/bulk-field-options.js +29 -23
- package/dist/shared/components/integrations/IntegrationObligationsView.js +191 -173
- package/dist/shared/components/integrations/IntegrationStatusLines.js +101 -85
- package/dist/shared/components/integrations/RecordIntegrationPreview.js +11 -9
- package/dist/shared/components/integrations/SendCurrentData.js +126 -0
- package/dist/shared/components/item-edit/CatalogPickerField.js +1530 -1437
- package/dist/shared/components/item-edit/FieldRenderer.js +49 -45
- package/dist/shared/components/item-edit/FieldRow.js +413 -403
- package/dist/shared/components/item-edit/InlineTableField.js +2903 -2816
- package/dist/shared/components/item-edit/M2MCombobox.js +172 -168
- package/dist/shared/components/item-edit/MidairCollisionDialog.js +341 -114
- package/dist/shared/components/item-edit/NestedRelationEditor.js +171 -163
- package/dist/shared/components/item-edit/PlanGrid.js +783 -724
- package/dist/shared/components/item-edit/QuickCreateButton.js +291 -224
- package/dist/shared/components/item-edit/RecordInsights.js +113 -111
- package/dist/shared/components/item-edit/RecordLiveSync.js +4 -1
- package/dist/shared/components/item-edit/RelationCombobox.js +332 -314
- package/dist/shared/components/item-edit/cascade-clear-notice.js +52 -0
- package/dist/shared/components/item-edit/collision-format.js +37 -0
- package/dist/shared/components/item-edit/field-a11y.js +25 -0
- package/dist/shared/components/item-edit/line-merge.js +58 -0
- package/dist/shared/components/item-edit/line-midair.js +94 -87
- package/dist/shared/components/item-edit/move-guard.js +17 -0
- package/dist/shared/components/item-edit/picker-search.js +22 -15
- package/dist/shared/components/item-edit/rail-width.js +8 -0
- package/dist/shared/components/monitoring/InactiveUserLinksView.js +322 -291
- package/dist/shared/components/panels/AccessDeniedPanel.js +96 -55
- package/dist/shared/components/panels/CommentPanel.js +142 -136
- package/dist/shared/components/panels/ItemLockBanner.js +246 -240
- package/dist/shared/components/panels/PipelinePanel.js +1366 -1194
- package/dist/shared/components/panels/RevisionsPanel.js +106 -102
- package/dist/shared/components/panels/SlaBreachBanner.js +16 -20
- package/dist/shared/components/panels/SlaClock.js +90 -68
- package/dist/shared/components/queue/QueueItemSheet.js +94 -87
- package/dist/shared/components/queue/QueueWorklist.js +1502 -1354
- package/dist/shared/components/queue/worklist-csv.js +75 -0
- package/dist/shared/components/queue/worklist-helpers.js +20 -0
- package/dist/shared/components/widgets/ReviewListWidget.js +226 -207
- package/dist/shared/lib/bulk-copy.js +17 -0
- package/dist/shared/lib/cbv-export.js +122 -0
- package/dist/shared/lib/delete-offer.js +13 -0
- package/dist/shared/lib/error-hints.js +1 -0
- package/dist/shared/lib/leave-guard.js +41 -26
- package/dist/shared/lib/list-link.js +72 -56
- package/dist/shared/lib/live-queries.js +32 -30
- package/dist/shared/lib/moved-notice.js +25 -0
- package/dist/shared/lib/notification-target.js +56 -54
- package/dist/shared/lib/obligation-banner.js +11 -8
- package/dist/shared/lib/obligation-reason-text.js +6 -6
- package/dist/shared/lib/sort-cycle.js +6 -0
- package/dist/shared/lib/summary-mode.js +59 -41
- package/package.json +1 -1
|
@@ -1,318 +1,348 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { RotateCw as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { useNivaroClient as
|
|
6
|
-
import { get as
|
|
7
|
-
import { userErrorMessage as
|
|
8
|
-
import { cn as
|
|
9
|
-
import { UserAvatar as
|
|
10
|
-
const
|
|
1
|
+
import { jsxs as r, jsx as e, Fragment as J } from "react/jsx-runtime";
|
|
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
|
+
import { cn as A, formatRelative as pe } from "../../lib/utils.js";
|
|
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
|
-
},
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
}, b = (l) => l.toLocaleString(), X = (l) => l === "anonymised" ? "redacted" : l, ge = ["suspended", "redacted", "placeholder"];
|
|
27
|
+
function Ee({
|
|
28
|
+
className: l,
|
|
29
|
+
focusUserId: s,
|
|
30
|
+
onClearFocus: o
|
|
31
|
+
}) {
|
|
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);
|
|
36
|
+
}, [s]);
|
|
37
|
+
const [n, p] = x(0), a = K({
|
|
38
|
+
queryKey: ["inactive-user-links", n],
|
|
39
|
+
queryFn: () => N.request(M(`/inactive-user-links${n ? "?fresh=1" : ""}`)).then((t) => t.data),
|
|
31
40
|
staleTime: 6e4
|
|
32
|
-
}),
|
|
41
|
+
}), f = F(
|
|
33
42
|
() => {
|
|
34
43
|
var t;
|
|
35
|
-
return new Map((((t =
|
|
44
|
+
return new Map((((t = a.data) == null ? void 0 : t.sources) ?? []).map((S) => [S.key, S]));
|
|
36
45
|
},
|
|
37
|
-
[
|
|
38
|
-
),
|
|
39
|
-
(t) => !(!t || t.role === "audit" && !
|
|
40
|
-
[
|
|
41
|
-
),
|
|
42
|
-
var
|
|
43
|
-
const t =
|
|
44
|
-
return (((
|
|
45
|
-
const P =
|
|
46
|
-
(
|
|
47
|
-
var
|
|
48
|
-
return +(((
|
|
46
|
+
[a.data]
|
|
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(() => {
|
|
51
|
+
var S;
|
|
52
|
+
const t = q.trim().toLowerCase();
|
|
53
|
+
return (((S = a.data) == null ? void 0 : S.users) ?? []).map((v) => {
|
|
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;
|
|
49
58
|
}
|
|
50
59
|
);
|
|
51
|
-
return { ...
|
|
52
|
-
}).filter((
|
|
53
|
-
(
|
|
54
|
-
).sort((
|
|
55
|
-
}, [
|
|
60
|
+
return { ...v, links: P, total: P.reduce((R, z) => R + z.count, 0) };
|
|
61
|
+
}).filter((v) => v.total > 0).filter((v) => !$ || v.user.id.toUpperCase() === $.toUpperCase()).filter(
|
|
62
|
+
(v) => !t || `${v.user.name} ${v.user.email ?? ""}`.toLowerCase().includes(t)
|
|
63
|
+
).sort((v, P) => P.total - v.total);
|
|
64
|
+
}, [a.data, f, q, D, $]), W = F(() => {
|
|
56
65
|
const t = { suspended: 0, redacted: 0, anonymised: 0, placeholder: 0 };
|
|
57
|
-
for (const
|
|
66
|
+
for (const S of T) t[X(S.user.reason)]++;
|
|
58
67
|
return t;
|
|
59
|
-
}, [
|
|
60
|
-
var
|
|
61
|
-
let t = 0,
|
|
62
|
-
for (const P of
|
|
63
|
-
for (const
|
|
64
|
-
((
|
|
65
|
-
return { records: t, seats:
|
|
66
|
-
}, [
|
|
67
|
-
|
|
68
|
-
},
|
|
69
|
-
|
|
68
|
+
}, [T]), O = c ? T.filter((t) => X(t.user.reason) === c) : T, H = F(() => {
|
|
69
|
+
var v;
|
|
70
|
+
let t = 0, S = 0;
|
|
71
|
+
for (const P of O)
|
|
72
|
+
for (const R of P.links)
|
|
73
|
+
((v = f.get(R.source)) == null ? void 0 : v.role) === "seat" ? S += R.count : t += R.count;
|
|
74
|
+
return { records: t, seats: S };
|
|
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"] });
|
|
70
79
|
};
|
|
71
|
-
return /* @__PURE__ */
|
|
72
|
-
/* @__PURE__ */
|
|
73
|
-
/* @__PURE__ */
|
|
74
|
-
/* @__PURE__ */
|
|
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: [
|
|
81
|
+
/* @__PURE__ */ r("div", { className: "flex flex-wrap items-center gap-x-5 gap-y-3", children: [
|
|
82
|
+
/* @__PURE__ */ r("dl", { className: "flex items-baseline gap-5 text-[12px] text-slate-500 dark:text-muted-foreground", children: [
|
|
83
|
+
/* @__PURE__ */ r("div", { className: "flex items-baseline gap-1.5", children: [
|
|
75
84
|
/* @__PURE__ */ e(
|
|
76
85
|
"dd",
|
|
77
86
|
{
|
|
78
87
|
className: "text-[20px] font-semibold tabular-nums text-slate-900 dark:text-foreground",
|
|
79
88
|
"data-inactive-people": !0,
|
|
80
|
-
children:
|
|
89
|
+
children: a.isLoading ? "—" : b(O.length)
|
|
81
90
|
}
|
|
82
91
|
),
|
|
83
|
-
/* @__PURE__ */ e("dt", { children:
|
|
92
|
+
/* @__PURE__ */ e("dt", { children: O.length === 1 ? "person" : "people" })
|
|
84
93
|
] }),
|
|
85
|
-
/* @__PURE__ */
|
|
86
|
-
/* @__PURE__ */ e("dd", { className: "text-[20px] font-semibold tabular-nums text-slate-900 dark:text-foreground", children:
|
|
87
|
-
/* @__PURE__ */ e("dt", { children:
|
|
94
|
+
/* @__PURE__ */ r("div", { className: "flex items-baseline gap-1.5", 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" })
|
|
88
97
|
] }),
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
/* @__PURE__ */ e("dd", { className: "text-[20px] font-semibold tabular-nums text-slate-900 dark:text-foreground", children:
|
|
98
|
+
/* @__PURE__ */ r("div", { className: "flex items-baseline gap-1.5", children: [
|
|
99
|
+
/* @__PURE__ */ e("dd", { className: "text-[20px] font-semibold tabular-nums text-slate-900 dark:text-foreground", children: a.isLoading ? "—" : b(H.seats) }),
|
|
91
100
|
/* @__PURE__ */ e("dt", { children: "owner seats and team places" })
|
|
92
101
|
] })
|
|
93
102
|
] }),
|
|
94
|
-
/* @__PURE__ */
|
|
103
|
+
/* @__PURE__ */ r(
|
|
95
104
|
"button",
|
|
96
105
|
{
|
|
97
106
|
type: "button",
|
|
98
|
-
onClick:
|
|
99
|
-
disabled:
|
|
107
|
+
onClick: oe,
|
|
108
|
+
disabled: a.isFetching,
|
|
100
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",
|
|
101
110
|
"data-inactive-rescan": !0,
|
|
102
111
|
children: [
|
|
103
|
-
/* @__PURE__ */ e(
|
|
112
|
+
/* @__PURE__ */ e(ce, { className: A("h-3.5 w-3.5", a.isFetching && "animate-spin") }),
|
|
104
113
|
"Scan again"
|
|
105
114
|
]
|
|
106
115
|
}
|
|
107
116
|
)
|
|
108
117
|
] }),
|
|
109
|
-
/* @__PURE__ */
|
|
110
|
-
|
|
111
|
-
|
|
118
|
+
$ && /* @__PURE__ */ r(
|
|
119
|
+
"p",
|
|
120
|
+
{
|
|
121
|
+
className: "flex flex-wrap items-center gap-2 text-[12px] text-slate-600 dark:text-muted-foreground",
|
|
122
|
+
"data-inactive-focus": !0,
|
|
123
|
+
children: [
|
|
124
|
+
"Showing one person.",
|
|
125
|
+
/* @__PURE__ */ e(
|
|
126
|
+
"button",
|
|
127
|
+
{
|
|
128
|
+
type: "button",
|
|
129
|
+
onClick: () => {
|
|
130
|
+
L(null), o == null || o();
|
|
131
|
+
},
|
|
132
|
+
className: "font-medium text-slate-800 underline underline-offset-2 dark:text-foreground",
|
|
133
|
+
children: "Show everyone"
|
|
134
|
+
}
|
|
135
|
+
)
|
|
136
|
+
]
|
|
137
|
+
}
|
|
138
|
+
),
|
|
139
|
+
/* @__PURE__ */ r("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
140
|
+
/* @__PURE__ */ r("label", { className: "relative", children: [
|
|
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" }),
|
|
112
142
|
/* @__PURE__ */ e(
|
|
113
143
|
"input",
|
|
114
144
|
{
|
|
115
|
-
value:
|
|
116
|
-
onChange: (t) =>
|
|
145
|
+
value: q,
|
|
146
|
+
onChange: (t) => j(t.target.value),
|
|
117
147
|
placeholder: "Find a person",
|
|
118
148
|
className: "h-8 w-56 rounded-md border border-slate-200 bg-background pl-7 pr-2 text-[12.5px] text-slate-800 placeholder:text-slate-500 focus:border-slate-400 focus:outline-none dark:border-border dark:text-foreground dark:placeholder:text-muted-foreground",
|
|
119
149
|
"data-inactive-search": !0
|
|
120
150
|
}
|
|
121
151
|
)
|
|
122
152
|
] }),
|
|
123
|
-
/* @__PURE__ */ e("span", { className: "flex flex-wrap items-center gap-1", children:
|
|
124
|
-
(t) =>
|
|
153
|
+
/* @__PURE__ */ e("span", { className: "flex flex-wrap items-center gap-1", children: ge.map(
|
|
154
|
+
(t) => W[t] || c === t ? /* @__PURE__ */ r(
|
|
125
155
|
"button",
|
|
126
156
|
{
|
|
127
157
|
type: "button",
|
|
128
|
-
"aria-pressed":
|
|
129
|
-
onClick: () =>
|
|
130
|
-
"data-tip":
|
|
158
|
+
"aria-pressed": c === t,
|
|
159
|
+
onClick: () => C(c === t ? null : t),
|
|
160
|
+
"data-tip": ne[t],
|
|
131
161
|
"data-inactive-reason": t,
|
|
132
|
-
className:
|
|
162
|
+
className: A(
|
|
133
163
|
"h-7 rounded-md border px-2 text-[11.5px] font-medium transition-colors",
|
|
134
|
-
|
|
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"
|
|
135
165
|
),
|
|
136
166
|
children: [
|
|
137
|
-
|
|
167
|
+
re[t],
|
|
138
168
|
" ",
|
|
139
|
-
/* @__PURE__ */ e("span", { className: "tabular-nums text-slate-500 dark:text-muted-foreground", children:
|
|
169
|
+
/* @__PURE__ */ e("span", { className: "tabular-nums text-slate-500 dark:text-muted-foreground", children: b(W[t]) })
|
|
140
170
|
]
|
|
141
171
|
},
|
|
142
172
|
t
|
|
143
173
|
) : null
|
|
144
174
|
) }),
|
|
145
|
-
/* @__PURE__ */
|
|
175
|
+
/* @__PURE__ */ r("span", { className: "ml-auto flex flex-wrap items-center gap-x-4 gap-y-1", children: [
|
|
146
176
|
/* @__PURE__ */ e(
|
|
147
|
-
|
|
177
|
+
U,
|
|
148
178
|
{
|
|
149
179
|
label: "Only records in an open workflow",
|
|
150
|
-
checked:
|
|
151
|
-
onChange:
|
|
180
|
+
checked: h,
|
|
181
|
+
onChange: d,
|
|
152
182
|
hook: "open"
|
|
153
183
|
}
|
|
154
184
|
),
|
|
155
185
|
/* @__PURE__ */ e(
|
|
156
|
-
|
|
186
|
+
U,
|
|
157
187
|
{
|
|
158
188
|
label: "Owner seats and team places",
|
|
159
|
-
checked:
|
|
160
|
-
onChange:
|
|
189
|
+
checked: g,
|
|
190
|
+
onChange: w,
|
|
161
191
|
hook: "seats"
|
|
162
192
|
}
|
|
163
193
|
),
|
|
164
194
|
/* @__PURE__ */ e(
|
|
165
|
-
|
|
195
|
+
U,
|
|
166
196
|
{
|
|
167
197
|
label: "Created by / updated by",
|
|
168
|
-
checked:
|
|
169
|
-
onChange:
|
|
198
|
+
checked: u,
|
|
199
|
+
onChange: k,
|
|
170
200
|
hook: "audit"
|
|
171
201
|
}
|
|
172
202
|
),
|
|
173
203
|
/* @__PURE__ */ e(
|
|
174
|
-
|
|
204
|
+
U,
|
|
175
205
|
{
|
|
176
206
|
label: "The person's own saved sets",
|
|
177
|
-
checked:
|
|
178
|
-
onChange:
|
|
207
|
+
checked: i,
|
|
208
|
+
onChange: m,
|
|
179
209
|
hook: "own"
|
|
180
210
|
}
|
|
181
211
|
)
|
|
182
212
|
] })
|
|
183
213
|
] }),
|
|
184
|
-
(
|
|
185
|
-
|
|
214
|
+
(I = a.data) != null && I.failed.length ? /* @__PURE__ */ r("p", { className: "text-[11.5px] text-amber-700 dark:text-amber-300", children: [
|
|
215
|
+
a.data.failed.length,
|
|
186
216
|
" link ",
|
|
187
|
-
|
|
217
|
+
a.data.failed.length === 1 ? "type" : "types",
|
|
188
218
|
" could not be read and are left out: ",
|
|
189
|
-
|
|
219
|
+
a.data.failed.join(", ")
|
|
190
220
|
] }) : null,
|
|
191
|
-
/* @__PURE__ */ e("div", { className: "flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children:
|
|
221
|
+
/* @__PURE__ */ e("div", { className: "flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: a.isLoading ? /* @__PURE__ */ e("div", { className: "space-y-2 p-4", children: [0, 1, 2, 3, 4].map((t) => /* @__PURE__ */ e(
|
|
192
222
|
"div",
|
|
193
223
|
{
|
|
194
224
|
className: "h-9 animate-pulse rounded",
|
|
195
225
|
style: { background: "hsl(var(--nvr-skeleton))" }
|
|
196
226
|
},
|
|
197
227
|
t
|
|
198
|
-
)) }) :
|
|
228
|
+
)) }) : a.isError ? /* @__PURE__ */ r("p", { className: "p-6 text-[12.5px] text-rose-700 dark:text-rose-300", children: [
|
|
199
229
|
"The scan failed. ",
|
|
200
|
-
|
|
201
|
-
] }) :
|
|
202
|
-
/* @__PURE__ */ e(
|
|
203
|
-
/* @__PURE__ */ e("p", { className: "text-[13px] font-medium text-slate-800 dark:text-foreground", children:
|
|
204
|
-
/* @__PURE__ */ e("p", { className: "max-w-[52ch] text-[12px] text-slate-500 dark:text-muted-foreground", children:
|
|
205
|
-
] }) : /* @__PURE__ */ e("ul", { className: "min-h-0 flex-1 divide-y divide-slate-100 overflow-y-auto dark:divide-border", children:
|
|
206
|
-
|
|
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,
|
|
207
237
|
{
|
|
208
238
|
person: t,
|
|
209
|
-
sources:
|
|
239
|
+
sources: f,
|
|
210
240
|
open: _ === t.user.id,
|
|
211
|
-
onToggle: () =>
|
|
212
|
-
onChanged:
|
|
241
|
+
onToggle: () => E(_ === t.user.id ? null : t.user.id),
|
|
242
|
+
onChanged: de
|
|
213
243
|
},
|
|
214
244
|
t.user.id
|
|
215
245
|
)) }) })
|
|
216
246
|
] });
|
|
217
247
|
}
|
|
218
|
-
function
|
|
248
|
+
function U({
|
|
219
249
|
label: l,
|
|
220
|
-
checked:
|
|
250
|
+
checked: s,
|
|
221
251
|
onChange: o,
|
|
222
|
-
hook:
|
|
252
|
+
hook: N
|
|
223
253
|
}) {
|
|
224
|
-
return /* @__PURE__ */
|
|
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: [
|
|
225
255
|
/* @__PURE__ */ e(
|
|
226
256
|
"input",
|
|
227
257
|
{
|
|
228
258
|
type: "checkbox",
|
|
229
|
-
checked:
|
|
230
|
-
onChange: (
|
|
259
|
+
checked: s,
|
|
260
|
+
onChange: (y) => o(y.target.checked),
|
|
231
261
|
className: "h-3.5 w-3.5 accent-slate-700",
|
|
232
|
-
"data-inactive-switch":
|
|
262
|
+
"data-inactive-switch": N
|
|
233
263
|
}
|
|
234
264
|
),
|
|
235
265
|
l
|
|
236
266
|
] });
|
|
237
267
|
}
|
|
238
|
-
function
|
|
268
|
+
function se(l) {
|
|
239
269
|
return l.kind === "builtin" ? l.label : `${l.collection_label} · ${l.label}`;
|
|
240
270
|
}
|
|
241
|
-
function
|
|
271
|
+
function ke({
|
|
242
272
|
person: l,
|
|
243
|
-
sources:
|
|
273
|
+
sources: s,
|
|
244
274
|
open: o,
|
|
245
|
-
onToggle:
|
|
246
|
-
onChanged:
|
|
275
|
+
onToggle: N,
|
|
276
|
+
onChanged: y
|
|
247
277
|
}) {
|
|
248
|
-
const
|
|
249
|
-
return /* @__PURE__ */
|
|
250
|
-
/* @__PURE__ */
|
|
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();
|
|
279
|
+
return /* @__PURE__ */ r("li", { "data-inactive-person": d.id, children: [
|
|
280
|
+
/* @__PURE__ */ r(
|
|
251
281
|
"button",
|
|
252
282
|
{
|
|
253
283
|
type: "button",
|
|
254
|
-
onClick:
|
|
284
|
+
onClick: N,
|
|
255
285
|
"aria-expanded": o,
|
|
256
286
|
className: "flex w-full items-center gap-3 px-4 py-2.5 text-left hover:bg-muted",
|
|
257
287
|
children: [
|
|
258
|
-
o ? /* @__PURE__ */ e(
|
|
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" }),
|
|
259
289
|
/* @__PURE__ */ e(
|
|
260
|
-
|
|
290
|
+
fe,
|
|
261
291
|
{
|
|
262
292
|
userId: d.id,
|
|
263
293
|
className: "h-6 w-6 shrink-0 rounded-full object-cover",
|
|
264
|
-
fallback: /* @__PURE__ */ e("span", { className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-slate-200 text-[9px] font-semibold text-slate-600 dark:bg-muted dark:text-muted-foreground", children:
|
|
294
|
+
fallback: /* @__PURE__ */ e("span", { className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-slate-200 text-[9px] font-semibold text-slate-600 dark:bg-muted dark:text-muted-foreground", children: k })
|
|
265
295
|
}
|
|
266
296
|
),
|
|
267
|
-
/* @__PURE__ */
|
|
297
|
+
/* @__PURE__ */ r("span", { className: "min-w-0 flex-[0_1_260px]", children: [
|
|
268
298
|
/* @__PURE__ */ e("span", { className: "block truncate text-[12.5px] font-medium text-slate-900 dark:text-foreground", children: d.name }),
|
|
269
299
|
/* @__PURE__ */ e("span", { className: "block truncate text-[11px] text-slate-500 dark:text-muted-foreground", children: d.email ?? "—" })
|
|
270
300
|
] }),
|
|
271
301
|
/* @__PURE__ */ e(
|
|
272
302
|
"span",
|
|
273
303
|
{
|
|
274
|
-
className:
|
|
304
|
+
className: A(
|
|
275
305
|
"shrink-0 rounded px-1.5 py-0.5 text-[10.5px] font-medium",
|
|
276
|
-
|
|
306
|
+
be[d.reason]
|
|
277
307
|
),
|
|
278
|
-
"data-tip":
|
|
279
|
-
children:
|
|
308
|
+
"data-tip": ne[d.reason],
|
|
309
|
+
children: re[d.reason]
|
|
280
310
|
}
|
|
281
311
|
),
|
|
282
|
-
/* @__PURE__ */
|
|
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: [
|
|
283
313
|
l.links.slice(0, 3).map((i) => {
|
|
284
|
-
const
|
|
285
|
-
return
|
|
314
|
+
const m = s.get(i.source);
|
|
315
|
+
return m ? `${se(m)} ${b(i.count)}` : "";
|
|
286
316
|
}).filter(Boolean).join(" · "),
|
|
287
317
|
l.links.length > 3 ? ` · +${l.links.length - 3} more` : ""
|
|
288
318
|
] }),
|
|
289
|
-
/* @__PURE__ */ e("span", { className: "ml-auto shrink-0 text-[11px] text-slate-500 dark:text-muted-foreground", children: d.last_access ? `last active ${
|
|
290
|
-
/* @__PURE__ */ e("span", { className: "w-14 shrink-0 text-right text-[12.5px] font-semibold tabular-nums text-slate-900 dark:text-foreground", children:
|
|
319
|
+
/* @__PURE__ */ e("span", { className: "ml-auto shrink-0 text-[11px] text-slate-500 dark:text-muted-foreground", children: d.last_access ? `last active ${pe(d.last_access)}` : "never signed in" }),
|
|
320
|
+
/* @__PURE__ */ e("span", { className: "w-14 shrink-0 text-right text-[12.5px] font-semibold tabular-nums text-slate-900 dark:text-foreground", children: b(l.total) })
|
|
291
321
|
]
|
|
292
322
|
}
|
|
293
323
|
),
|
|
294
|
-
o && /* @__PURE__ */
|
|
324
|
+
o && /* @__PURE__ */ r("div", { className: "border-t border-slate-100 bg-slate-50/60 px-4 py-3 pl-11 dark:border-border dark:bg-white/[0.02]", children: [
|
|
295
325
|
/* @__PURE__ */ e("ul", { className: "space-y-1", children: l.links.map((i) => {
|
|
296
|
-
const
|
|
297
|
-
return
|
|
298
|
-
|
|
326
|
+
const m = s.get(i.source);
|
|
327
|
+
return m ? /* @__PURE__ */ e(
|
|
328
|
+
ve,
|
|
299
329
|
{
|
|
300
330
|
userId: d.id,
|
|
301
|
-
source:
|
|
331
|
+
source: m,
|
|
302
332
|
count: i.count,
|
|
303
|
-
onChanged:
|
|
333
|
+
onChanged: y
|
|
304
334
|
},
|
|
305
335
|
i.source
|
|
306
336
|
) : null;
|
|
307
337
|
}) }),
|
|
308
|
-
u && /* @__PURE__ */
|
|
338
|
+
u && /* @__PURE__ */ r("p", { className: "mt-3 text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
|
|
309
339
|
"Everything this person holds can also move in one pass from",
|
|
310
340
|
" ",
|
|
311
341
|
/* @__PURE__ */ e(
|
|
312
342
|
"button",
|
|
313
343
|
{
|
|
314
344
|
type: "button",
|
|
315
|
-
onClick: () =>
|
|
345
|
+
onClick: () => h.navigate(u),
|
|
316
346
|
className: "font-medium text-slate-700 underline decoration-dotted underline-offset-2 hover:text-slate-900 dark:text-foreground",
|
|
317
347
|
children: "their account page"
|
|
318
348
|
}
|
|
@@ -323,110 +353,110 @@ function me({
|
|
|
323
353
|
] })
|
|
324
354
|
] });
|
|
325
355
|
}
|
|
326
|
-
function
|
|
356
|
+
function ve({
|
|
327
357
|
userId: l,
|
|
328
|
-
source:
|
|
358
|
+
source: s,
|
|
329
359
|
count: o,
|
|
330
|
-
onChanged:
|
|
360
|
+
onChanged: N
|
|
331
361
|
}) {
|
|
332
|
-
var
|
|
333
|
-
const
|
|
334
|
-
queryKey: ["inactive-user-records", l,
|
|
335
|
-
queryFn: () =>
|
|
336
|
-
|
|
337
|
-
`/inactive-user-links/${l}/records?source=${encodeURIComponent(
|
|
362
|
+
var g, w;
|
|
363
|
+
const y = B(), { open: h } = te(), [d, u] = x(!1), k = !0, i = s.kind === "builtin", m = K({
|
|
364
|
+
queryKey: ["inactive-user-records", l, s.key],
|
|
365
|
+
queryFn: () => y.request(
|
|
366
|
+
M(
|
|
367
|
+
`/inactive-user-links/${l}/records?source=${encodeURIComponent(s.key)}&limit=100`
|
|
338
368
|
)
|
|
339
|
-
).then((
|
|
340
|
-
enabled: d &&
|
|
369
|
+
).then((c) => c.data),
|
|
370
|
+
enabled: d && k
|
|
341
371
|
});
|
|
342
|
-
return /* @__PURE__ */
|
|
343
|
-
/* @__PURE__ */
|
|
344
|
-
/* @__PURE__ */
|
|
372
|
+
return /* @__PURE__ */ r("li", { "data-inactive-source": s.key, children: [
|
|
373
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-2 text-[12px]", children: [
|
|
374
|
+
/* @__PURE__ */ r(
|
|
345
375
|
"button",
|
|
346
376
|
{
|
|
347
377
|
type: "button",
|
|
348
|
-
disabled: !
|
|
349
|
-
onClick: () => u((
|
|
378
|
+
disabled: !k,
|
|
379
|
+
onClick: () => u((c) => !c),
|
|
350
380
|
"aria-expanded": d,
|
|
351
381
|
className: "flex min-w-0 items-center gap-1.5 text-left text-slate-700 enabled:hover:text-slate-900 dark:text-foreground",
|
|
352
382
|
children: [
|
|
353
|
-
d ? /* @__PURE__ */ e(
|
|
354
|
-
/* @__PURE__ */ e("span", { className: "truncate", children:
|
|
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" }),
|
|
384
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: se(s) })
|
|
355
385
|
]
|
|
356
386
|
}
|
|
357
387
|
),
|
|
358
|
-
/* @__PURE__ */ e("span", { className: "tabular-nums text-slate-500 dark:text-muted-foreground", children:
|
|
359
|
-
|
|
360
|
-
|
|
388
|
+
/* @__PURE__ */ e("span", { className: "tabular-nums text-slate-500 dark:text-muted-foreground", children: b(o) }),
|
|
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" }),
|
|
390
|
+
s.reassignable && !i && /* @__PURE__ */ e("span", { className: "ml-auto", children: /* @__PURE__ */ e(le, { userId: l, source: s, count: o, onDone: N }) })
|
|
361
391
|
] }),
|
|
362
|
-
d &&
|
|
363
|
-
|
|
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(
|
|
393
|
+
Ne,
|
|
364
394
|
{
|
|
365
395
|
userId: l,
|
|
366
|
-
source:
|
|
367
|
-
entries: ((
|
|
368
|
-
onChanged:
|
|
396
|
+
source: s,
|
|
397
|
+
entries: ((g = m.data) == null ? void 0 : g.entries) ?? [],
|
|
398
|
+
onChanged: N
|
|
369
399
|
}
|
|
370
|
-
) : (
|
|
371
|
-
|
|
372
|
-
var
|
|
400
|
+
) : (w = m.data) != null && w.records.length ? /* @__PURE__ */ r("ul", { className: "flex flex-wrap gap-1", "data-inactive-records": !0, children: [
|
|
401
|
+
m.data.records.map((c) => {
|
|
402
|
+
var C;
|
|
373
403
|
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
374
404
|
"button",
|
|
375
405
|
{
|
|
376
406
|
type: "button",
|
|
377
|
-
onClick: () =>
|
|
407
|
+
onClick: () => h({ collection: c.collection, itemId: c.id }),
|
|
378
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",
|
|
379
|
-
children: ((
|
|
409
|
+
children: ((C = c.label) == null ? void 0 : C.trim()) || `#${c.id}`
|
|
380
410
|
}
|
|
381
|
-
) }, `${
|
|
411
|
+
) }, `${c.collection}:${c.id}`);
|
|
382
412
|
}),
|
|
383
|
-
o >
|
|
413
|
+
o > m.data.records.length && /* @__PURE__ */ r("li", { className: "px-1 py-0.5 text-[11px] text-slate-500 dark:text-muted-foreground", children: [
|
|
384
414
|
"+",
|
|
385
|
-
|
|
415
|
+
b(o - m.data.records.length),
|
|
386
416
|
" more"
|
|
387
417
|
] })
|
|
388
418
|
] }) : /* @__PURE__ */ e("p", { className: "text-[11.5px] text-slate-500 dark:text-muted-foreground", children: "Nothing to list." }) })
|
|
389
419
|
] });
|
|
390
420
|
}
|
|
391
|
-
function
|
|
421
|
+
function le({
|
|
392
422
|
userId: l,
|
|
393
|
-
source:
|
|
423
|
+
source: s,
|
|
394
424
|
count: o,
|
|
395
|
-
ids:
|
|
396
|
-
label:
|
|
397
|
-
onDone:
|
|
425
|
+
ids: N,
|
|
426
|
+
label: y = "Hand to…",
|
|
427
|
+
onDone: h
|
|
398
428
|
}) {
|
|
399
|
-
var
|
|
400
|
-
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({
|
|
401
431
|
queryKey: ["inactive-reassign-users", i],
|
|
402
|
-
queryFn: () => d.request(
|
|
403
|
-
enabled: u && !
|
|
432
|
+
queryFn: () => d.request(M(`/users?search=${encodeURIComponent(i)}&limit=8`)).then((a) => a.data),
|
|
433
|
+
enabled: u && !g && i.trim().length >= 2,
|
|
404
434
|
staleTime: 3e4
|
|
405
|
-
}),
|
|
406
|
-
if (
|
|
407
|
-
|
|
435
|
+
}), L = (a) => [a.first_name, a.last_name].filter(Boolean).join(" ") || a.email, n = async () => {
|
|
436
|
+
if (g) {
|
|
437
|
+
C(!0), E(null);
|
|
408
438
|
try {
|
|
409
|
-
const
|
|
410
|
-
|
|
411
|
-
`${
|
|
412
|
-
),
|
|
413
|
-
} catch (
|
|
414
|
-
const
|
|
415
|
-
|
|
439
|
+
const f = (await d.request(ae(`/inactive-user-links/${l}/reassign`, { source: s.key, to: g.id, ids: N }))).data;
|
|
440
|
+
j(
|
|
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})` : "")
|
|
442
|
+
), k(!1), h();
|
|
443
|
+
} catch (a) {
|
|
444
|
+
const f = a.response;
|
|
445
|
+
E((f == null ? void 0 : f.error) ?? Q(a, ""));
|
|
416
446
|
} finally {
|
|
417
|
-
|
|
447
|
+
C(!1);
|
|
418
448
|
}
|
|
419
449
|
}
|
|
420
450
|
};
|
|
421
|
-
return
|
|
451
|
+
return q ? /* @__PURE__ */ e("span", { className: "text-[11px] text-emerald-700 dark:text-emerald-400", "data-inactive-reassigned": !0, children: q }) : /* @__PURE__ */ r("span", { className: "relative inline-block", children: [
|
|
422
452
|
/* @__PURE__ */ e(
|
|
423
453
|
"button",
|
|
424
454
|
{
|
|
425
455
|
type: "button",
|
|
426
|
-
onClick: () =>
|
|
427
|
-
"data-inactive-reassign":
|
|
456
|
+
onClick: () => k((a) => !a),
|
|
457
|
+
"data-inactive-reassign": s.key,
|
|
428
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",
|
|
429
|
-
children:
|
|
459
|
+
children: y
|
|
430
460
|
}
|
|
431
461
|
),
|
|
432
462
|
u && /* @__PURE__ */ e(
|
|
@@ -434,30 +464,30 @@ function te({
|
|
|
434
464
|
{
|
|
435
465
|
className: "absolute right-0 top-7 z-30 w-72 rounded-md border border-slate-200 bg-white p-2 text-left shadow-md dark:border-border dark:bg-card",
|
|
436
466
|
"data-inactive-reassign-panel": !0,
|
|
437
|
-
children:
|
|
438
|
-
/* @__PURE__ */
|
|
467
|
+
children: g ? /* @__PURE__ */ r("div", { className: "space-y-2", children: [
|
|
468
|
+
/* @__PURE__ */ r("p", { className: "text-[12px] text-slate-700 dark:text-foreground", children: [
|
|
439
469
|
"Put ",
|
|
440
|
-
/* @__PURE__ */ e("strong", { className: "font-semibold", children:
|
|
470
|
+
/* @__PURE__ */ e("strong", { className: "font-semibold", children: L(g) }),
|
|
441
471
|
" on",
|
|
442
472
|
" ",
|
|
443
|
-
|
|
473
|
+
b(Math.min(o, 500)),
|
|
444
474
|
" ",
|
|
445
|
-
|
|
475
|
+
s.kind === "builtin" ? o === 1 ? "place" : "places" : o === 1 ? "record" : "records",
|
|
446
476
|
" ",
|
|
447
477
|
"as ",
|
|
448
|
-
|
|
478
|
+
s.label.toLowerCase(),
|
|
449
479
|
o > 500 ? " (500 at a time)" : "",
|
|
450
480
|
"?",
|
|
451
481
|
" ",
|
|
452
|
-
|
|
482
|
+
s.kind === "builtin" ? "Places they already hold are not doubled." : "Each change is saved to the record's history."
|
|
453
483
|
] }),
|
|
454
|
-
|
|
455
|
-
/* @__PURE__ */
|
|
484
|
+
_ && /* @__PURE__ */ e("p", { className: "text-[11.5px] text-rose-700 dark:text-rose-300", children: _ }),
|
|
485
|
+
/* @__PURE__ */ r("div", { className: "flex justify-end gap-1.5", children: [
|
|
456
486
|
/* @__PURE__ */ e(
|
|
457
487
|
"button",
|
|
458
488
|
{
|
|
459
489
|
type: "button",
|
|
460
|
-
onClick: () =>
|
|
490
|
+
onClick: () => w(null),
|
|
461
491
|
className: "h-7 rounded-md px-2 text-[11.5px] text-slate-600 hover:text-slate-900 dark:text-muted-foreground",
|
|
462
492
|
children: "Back"
|
|
463
493
|
}
|
|
@@ -466,125 +496,125 @@ function te({
|
|
|
466
496
|
"button",
|
|
467
497
|
{
|
|
468
498
|
type: "button",
|
|
469
|
-
onClick:
|
|
470
|
-
disabled:
|
|
499
|
+
onClick: n,
|
|
500
|
+
disabled: c,
|
|
471
501
|
"data-inactive-reassign-confirm": !0,
|
|
472
502
|
className: "h-7 rounded-md bg-nvr-cyan px-2.5 text-[11.5px] font-medium text-white disabled:opacity-60",
|
|
473
|
-
children:
|
|
503
|
+
children: c ? "Moving…" : "Move them"
|
|
474
504
|
}
|
|
475
505
|
)
|
|
476
506
|
] })
|
|
477
|
-
] }) : /* @__PURE__ */
|
|
507
|
+
] }) : /* @__PURE__ */ r(J, { children: [
|
|
478
508
|
/* @__PURE__ */ e(
|
|
479
509
|
"input",
|
|
480
510
|
{
|
|
481
511
|
autoFocus: !0,
|
|
482
512
|
value: i,
|
|
483
|
-
onChange: (
|
|
513
|
+
onChange: (a) => m(a.target.value),
|
|
484
514
|
placeholder: "Search people",
|
|
485
515
|
className: "h-8 w-full rounded-md border border-slate-200 bg-background px-2 text-[12.5px] text-slate-800 placeholder:text-slate-500 focus:border-slate-400 focus:outline-none dark:border-border dark:text-foreground"
|
|
486
516
|
}
|
|
487
517
|
),
|
|
488
|
-
/* @__PURE__ */
|
|
489
|
-
(
|
|
518
|
+
/* @__PURE__ */ r("ul", { className: "mt-1 max-h-56 overflow-y-auto", children: [
|
|
519
|
+
($.data ?? []).filter((a) => a.id.toLowerCase() !== l.toLowerCase()).map((a) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ r(
|
|
490
520
|
"button",
|
|
491
521
|
{
|
|
492
522
|
type: "button",
|
|
493
|
-
onClick: () =>
|
|
494
|
-
"data-inactive-candidate":
|
|
523
|
+
onClick: () => w(a),
|
|
524
|
+
"data-inactive-candidate": a.id,
|
|
495
525
|
className: "flex w-full flex-col rounded px-2 py-1 text-left hover:bg-muted",
|
|
496
526
|
children: [
|
|
497
|
-
/* @__PURE__ */ e("span", { className: "text-[12px] text-slate-800 dark:text-foreground", children:
|
|
498
|
-
/* @__PURE__ */ e("span", { className: "text-[10.5px] text-slate-500 dark:text-muted-foreground", children:
|
|
527
|
+
/* @__PURE__ */ e("span", { className: "text-[12px] text-slate-800 dark:text-foreground", children: L(a) }),
|
|
528
|
+
/* @__PURE__ */ e("span", { className: "text-[10.5px] text-slate-500 dark:text-muted-foreground", children: a.email })
|
|
499
529
|
]
|
|
500
530
|
}
|
|
501
|
-
) },
|
|
502
|
-
i.trim().length >= 2 &&
|
|
531
|
+
) }, a.id)),
|
|
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." })
|
|
503
533
|
] })
|
|
504
534
|
] })
|
|
505
535
|
}
|
|
506
536
|
)
|
|
507
537
|
] });
|
|
508
538
|
}
|
|
509
|
-
function
|
|
539
|
+
function Ne({
|
|
510
540
|
userId: l,
|
|
511
|
-
source:
|
|
541
|
+
source: s,
|
|
512
542
|
entries: o,
|
|
513
|
-
onChanged:
|
|
543
|
+
onChanged: N
|
|
514
544
|
}) {
|
|
515
|
-
const
|
|
516
|
-
const
|
|
517
|
-
return
|
|
518
|
-
}),
|
|
519
|
-
var
|
|
520
|
-
|
|
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);
|
|
547
|
+
return a.has(n) ? a.delete(n) : a.add(n), a;
|
|
548
|
+
}), $ = async () => {
|
|
549
|
+
var n;
|
|
550
|
+
w(!0);
|
|
521
551
|
try {
|
|
522
|
-
const
|
|
523
|
-
|
|
552
|
+
const p = await y.request(
|
|
553
|
+
ae(`/inactive-user-links/${l}/remove`, { source: s.key, ids: j })
|
|
524
554
|
);
|
|
525
|
-
|
|
526
|
-
`${
|
|
527
|
-
),
|
|
528
|
-
} catch (
|
|
529
|
-
|
|
555
|
+
C(
|
|
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, ""));
|
|
530
560
|
} finally {
|
|
531
|
-
|
|
561
|
+
w(!1);
|
|
532
562
|
}
|
|
533
563
|
};
|
|
534
564
|
if (!o.length)
|
|
535
565
|
return /* @__PURE__ */ e("p", { className: "text-[11.5px] text-slate-500 dark:text-muted-foreground", children: "Nothing to list." });
|
|
536
|
-
const
|
|
537
|
-
return /* @__PURE__ */
|
|
538
|
-
/* @__PURE__ */
|
|
539
|
-
/* @__PURE__ */
|
|
566
|
+
const L = o.filter((n) => n.sole).length;
|
|
567
|
+
return /* @__PURE__ */ r("div", { "data-inactive-entries": s.key, children: [
|
|
568
|
+
/* @__PURE__ */ r("div", { className: "mb-1 flex min-h-7 flex-wrap items-center gap-2 text-[11.5px] text-slate-600 dark:text-muted-foreground", children: [
|
|
569
|
+
/* @__PURE__ */ r("label", { className: "flex cursor-pointer items-center gap-1.5", children: [
|
|
540
570
|
/* @__PURE__ */ e(
|
|
541
571
|
"input",
|
|
542
572
|
{
|
|
543
573
|
type: "checkbox",
|
|
544
|
-
checked:
|
|
545
|
-
onChange: () =>
|
|
574
|
+
checked: _,
|
|
575
|
+
onChange: () => k(_ ? /* @__PURE__ */ new Set() : new Set(o.map((n) => n.id))),
|
|
546
576
|
className: "h-3.5 w-3.5 accent-slate-700",
|
|
547
577
|
"data-inactive-entries-all": !0
|
|
548
578
|
}
|
|
549
579
|
),
|
|
550
|
-
u.size ? `${
|
|
580
|
+
u.size ? `${b(u.size)} picked` : "Pick all"
|
|
551
581
|
] }),
|
|
552
|
-
|
|
553
|
-
|
|
582
|
+
L > 0 && /* @__PURE__ */ r("span", { className: "rounded bg-[#ffe4e6] px-1.5 py-0.5 text-[10.5px] font-medium text-[#9f1239] dark:bg-[#3d1a20] dark:text-[#f4a3ad]", children: [
|
|
583
|
+
b(L),
|
|
554
584
|
" with nobody else who can act"
|
|
555
585
|
] }),
|
|
556
|
-
|
|
557
|
-
u.size > 0 && /* @__PURE__ */
|
|
586
|
+
c && /* @__PURE__ */ e("span", { className: "text-emerald-700 dark:text-emerald-400", children: c }),
|
|
587
|
+
u.size > 0 && /* @__PURE__ */ r("span", { className: "ml-auto flex items-center gap-1.5", children: [
|
|
558
588
|
/* @__PURE__ */ e(
|
|
559
|
-
|
|
589
|
+
le,
|
|
560
590
|
{
|
|
561
591
|
userId: l,
|
|
562
|
-
source:
|
|
592
|
+
source: s,
|
|
563
593
|
count: u.size,
|
|
564
|
-
ids:
|
|
565
|
-
label: `Hand ${
|
|
594
|
+
ids: j,
|
|
595
|
+
label: `Hand ${b(u.size)} to…`,
|
|
566
596
|
onDone: () => {
|
|
567
|
-
|
|
597
|
+
k(/* @__PURE__ */ new Set()), N();
|
|
568
598
|
}
|
|
569
599
|
}
|
|
570
600
|
),
|
|
571
|
-
|
|
601
|
+
q && (i ? /* @__PURE__ */ r(J, { children: [
|
|
572
602
|
/* @__PURE__ */ e(
|
|
573
603
|
"button",
|
|
574
604
|
{
|
|
575
605
|
type: "button",
|
|
576
|
-
onClick:
|
|
577
|
-
disabled:
|
|
606
|
+
onClick: $,
|
|
607
|
+
disabled: g,
|
|
578
608
|
"data-inactive-remove-confirm": !0,
|
|
579
609
|
className: "h-[22px] rounded-md bg-[#be123c] px-2 text-[11px] font-medium text-white disabled:opacity-60",
|
|
580
|
-
children:
|
|
610
|
+
children: g ? "Removing…" : `Remove ${b(u.size)}, no successor`
|
|
581
611
|
}
|
|
582
612
|
),
|
|
583
613
|
/* @__PURE__ */ e(
|
|
584
614
|
"button",
|
|
585
615
|
{
|
|
586
616
|
type: "button",
|
|
587
|
-
onClick: () =>
|
|
617
|
+
onClick: () => m(!1),
|
|
588
618
|
className: "text-[11px] text-slate-600 hover:text-slate-900 dark:text-muted-foreground",
|
|
589
619
|
children: "Keep"
|
|
590
620
|
}
|
|
@@ -593,7 +623,7 @@ function he({
|
|
|
593
623
|
"button",
|
|
594
624
|
{
|
|
595
625
|
type: "button",
|
|
596
|
-
onClick: () =>
|
|
626
|
+
onClick: () => m(!0),
|
|
597
627
|
"data-inactive-remove": !0,
|
|
598
628
|
className: "rounded-md border border-slate-200 bg-white px-2 py-0.5 text-[11px] text-slate-600 hover:border-[#be123c] hover:text-[#be123c] dark:border-border dark:bg-card dark:text-muted-foreground",
|
|
599
629
|
children: "Remove…"
|
|
@@ -601,64 +631,65 @@ function he({
|
|
|
601
631
|
))
|
|
602
632
|
] })
|
|
603
633
|
] }),
|
|
604
|
-
/* @__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((
|
|
605
|
-
const
|
|
606
|
-
return /* @__PURE__ */
|
|
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) => {
|
|
635
|
+
const p = n.console_path ? h.consoleUrl ? h.consoleUrl(n.console_path) : n.console_path : null;
|
|
636
|
+
return /* @__PURE__ */ r(
|
|
607
637
|
"li",
|
|
608
638
|
{
|
|
609
639
|
className: "flex items-start gap-2 px-2.5 py-1.5",
|
|
610
|
-
"data-inactive-entry":
|
|
640
|
+
"data-inactive-entry": n.id,
|
|
611
641
|
children: [
|
|
612
642
|
/* @__PURE__ */ e(
|
|
613
643
|
"input",
|
|
614
644
|
{
|
|
615
645
|
type: "checkbox",
|
|
616
|
-
checked: u.has(
|
|
617
|
-
onChange: () =>
|
|
618
|
-
"aria-label": `Pick ${
|
|
646
|
+
checked: u.has(n.id),
|
|
647
|
+
onChange: () => E(n.id),
|
|
648
|
+
"aria-label": `Pick ${n.title}`,
|
|
619
649
|
className: "mt-0.5 h-3.5 w-3.5 shrink-0 accent-slate-700"
|
|
620
650
|
}
|
|
621
651
|
),
|
|
622
|
-
/* @__PURE__ */
|
|
623
|
-
/* @__PURE__ */
|
|
624
|
-
|
|
652
|
+
/* @__PURE__ */ r("div", { className: "min-w-0 flex-1", children: [
|
|
653
|
+
/* @__PURE__ */ r("div", { className: "flex flex-wrap items-baseline gap-x-2", children: [
|
|
654
|
+
n.record ? /* @__PURE__ */ e(
|
|
625
655
|
"button",
|
|
626
656
|
{
|
|
627
657
|
type: "button",
|
|
628
|
-
onClick: () =>
|
|
658
|
+
onClick: () => n.record && d({ collection: n.record.collection, itemId: n.record.id }),
|
|
629
659
|
className: "text-left text-[12px] font-medium text-slate-900 underline decoration-dotted underline-offset-2 dark:text-foreground",
|
|
630
|
-
children:
|
|
660
|
+
children: n.title
|
|
631
661
|
}
|
|
632
|
-
) :
|
|
662
|
+
) : p ? /* @__PURE__ */ e(
|
|
633
663
|
"button",
|
|
634
664
|
{
|
|
635
665
|
type: "button",
|
|
636
|
-
onClick: () => /^https?:/.test(
|
|
666
|
+
onClick: () => /^https?:/.test(p) ? window.open(p, "_blank") : h.navigate(p),
|
|
637
667
|
className: "text-left text-[12px] font-medium text-slate-900 underline decoration-dotted underline-offset-2 dark:text-foreground",
|
|
638
|
-
children:
|
|
668
|
+
children: n.title
|
|
639
669
|
}
|
|
640
|
-
) : /* @__PURE__ */ e("span", { className: "text-[12px] font-medium text-slate-900 dark:text-foreground", children:
|
|
641
|
-
/* @__PURE__ */ e("span", { className: "text-[11px] text-slate-500 dark:text-muted-foreground", children:
|
|
670
|
+
) : /* @__PURE__ */ e("span", { className: "text-[12px] font-medium text-slate-900 dark:text-foreground", children: n.title }),
|
|
671
|
+
/* @__PURE__ */ e("span", { className: "text-[11px] text-slate-500 dark:text-muted-foreground", children: n.facts.join(" · ") })
|
|
642
672
|
] }),
|
|
643
|
-
|
|
644
|
-
(
|
|
673
|
+
n.subtitle && /* @__PURE__ */ e("p", { className: "text-[11.5px] text-slate-600 dark:text-muted-foreground", children: n.subtitle }),
|
|
674
|
+
(s.key === "builtin:owner_seats" || s.key === "builtin:teams") && /* @__PURE__ */ e(
|
|
645
675
|
"p",
|
|
646
676
|
{
|
|
647
|
-
className:
|
|
677
|
+
className: A(
|
|
648
678
|
"text-[11px]",
|
|
649
|
-
|
|
679
|
+
n.sole ? "font-medium text-[#9f1239] dark:text-[#f4a3ad]" : "text-slate-500 dark:text-muted-foreground"
|
|
650
680
|
),
|
|
651
|
-
children:
|
|
681
|
+
children: n.sole ? "Nobody else who can act holds this — records here resolve no owner." : `Also held by ${n.others.slice(0, 4).join(", ")}${n.others.length > 4 ? ` +${n.others.length - 4}` : ""}${n.others.length ? "" : "a linked team"}`
|
|
652
682
|
}
|
|
653
683
|
)
|
|
654
684
|
] })
|
|
655
685
|
]
|
|
656
686
|
},
|
|
657
|
-
|
|
687
|
+
n.id
|
|
658
688
|
);
|
|
659
689
|
}) })
|
|
660
690
|
] });
|
|
661
691
|
}
|
|
662
692
|
export {
|
|
663
|
-
|
|
693
|
+
Ee as InactiveUserLinksView,
|
|
694
|
+
X as reasonGroup
|
|
664
695
|
};
|