@nivaro/react 0.3.63 → 0.3.64
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.
|
@@ -9,7 +9,7 @@ import { noteReplayEvent as _e, createReplayCheckoutState as De } from "../share
|
|
|
9
9
|
import { emitReplayTap as Te, setReplayRecorderMode as N, registerReplayCapture as qe, clipEndOffset as Le, withClipKind as Pe } from "../shared/lib/replay-capture.js";
|
|
10
10
|
import { instrumentConsole as Ne, instrumentRequests as Fe, redactSecrets as Me } from "../shared/lib/replay-context.js";
|
|
11
11
|
import { instrumentSocket as Oe } from "../shared/lib/replay-socket.js";
|
|
12
|
-
const Ue = "nivaro-react@0.3.
|
|
12
|
+
const Ue = "nivaro-react@0.3.64", j = 1e4, We = 150, He = 3e3, Ke = 600, $e = (n) => `nvr_replay_resume${n ? `:${n}` : ""}`, G = () => typeof navigator > "u" || navigator.onLine !== !1;
|
|
13
13
|
function Be(n) {
|
|
14
14
|
return typeof n.url != "string" || typeof fetch != "function" ? null : (f, a) => {
|
|
15
15
|
const u = typeof n.getToken == "function" ? n.getToken() : void 0, d = { "Content-Type": "application/json" };
|
package/dist/index.d.ts
CHANGED
|
@@ -5119,8 +5119,12 @@ declare interface ImportValidationReport {
|
|
|
5119
5119
|
truncated: boolean;
|
|
5120
5120
|
}
|
|
5121
5121
|
|
|
5122
|
-
export declare function InactiveUserLinksView({ className }: {
|
|
5122
|
+
export declare function InactiveUserLinksView({ className, focusUserId, onClearFocus }: {
|
|
5123
5123
|
className?: string;
|
|
5124
|
+
/** Show only this person, opened (a link from the "People to offload" card). */
|
|
5125
|
+
focusUserId?: string | null;
|
|
5126
|
+
/** "Show everyone" on the focus chip; the host drops its `?person=` param. */
|
|
5127
|
+
onClearFocus?: () => void;
|
|
5124
5128
|
}): JSX.Element;
|
|
5125
5129
|
|
|
5126
5130
|
export declare function InboundCallersView({ hours: initialHours }: {
|
|
@@ -1,318 +1,347 @@
|
|
|
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 de, useQuery as M } from "@tanstack/react-query";
|
|
3
|
+
import { RotateCw as ie, Search as ce, UserX as ue, ChevronDown as Y, ChevronRight as Z } from "lucide-react";
|
|
4
|
+
import { useState as x, useEffect as me, useMemo as U, useCallback as xe } from "react";
|
|
5
|
+
import { useNivaroClient as F, useNavigation as ee, useItemNavigation as te } from "../../context.js";
|
|
6
|
+
import { get as Q, post as ae } from "../../lib/commands.js";
|
|
7
|
+
import { userErrorMessage as D } from "../../lib/safe-error.js";
|
|
8
|
+
import { cn as A, formatRelative as pe } from "../../lib/utils.js";
|
|
9
|
+
import { UserAvatar as he } from "../UserAvatar.js";
|
|
10
|
+
const K = {
|
|
11
11
|
suspended: "Suspended",
|
|
12
12
|
redacted: "Redacted",
|
|
13
13
|
anonymised: "Anonymised",
|
|
14
14
|
placeholder: "Placeholder"
|
|
15
|
-
},
|
|
15
|
+
}, re = {
|
|
16
16
|
suspended: "The account is suspended — the person cannot sign in or act.",
|
|
17
17
|
redacted: "Personal details were removed by a retention policy.",
|
|
18
18
|
anonymised: "Details were overwritten by the nightly anonymisation of departed people.",
|
|
19
19
|
placeholder: "Stands in for a legacy account that no longer exists."
|
|
20
|
-
},
|
|
20
|
+
}, fe = {
|
|
21
21
|
suspended: "bg-[#fef3c7] text-[#92400e] dark:bg-[#3a2a12] dark:text-[#f5c97a]",
|
|
22
22
|
redacted: "bg-[#ffe4e6] text-[#9f1239] dark:bg-[#3d1a20] dark:text-[#f4a3ad]",
|
|
23
23
|
anonymised: "bg-[#ffe4e6] text-[#9f1239] dark:bg-[#3d1a20] dark:text-[#f4a3ad]",
|
|
24
24
|
placeholder: "bg-[#e2e8f0] text-[#334155] dark:bg-[#2c3038] dark:text-[#cbd5e1]"
|
|
25
|
-
},
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
}, b = (l) => l.toLocaleString();
|
|
26
|
+
function qe({
|
|
27
|
+
className: l,
|
|
28
|
+
focusUserId: s,
|
|
29
|
+
onClearFocus: o
|
|
30
|
+
}) {
|
|
31
|
+
var V;
|
|
32
|
+
const y = F(), N = de(), [p, d] = x(!0), [u, k] = x(!1), [i, m] = x(!1), [g, w] = x(!0), [c, C] = x(null), [q, j] = x(""), [_, O] = x(s ?? null), [$, L] = x(s ?? null);
|
|
33
|
+
me(() => {
|
|
34
|
+
L(s ?? null), s && O(s);
|
|
35
|
+
}, [s]);
|
|
36
|
+
const [n, h] = x(0), a = M({
|
|
37
|
+
queryKey: ["inactive-user-links", n],
|
|
38
|
+
queryFn: () => y.request(Q(`/inactive-user-links${n ? "?fresh=1" : ""}`)).then((t) => t.data),
|
|
31
39
|
staleTime: 6e4
|
|
32
|
-
}),
|
|
40
|
+
}), f = U(
|
|
33
41
|
() => {
|
|
34
42
|
var t;
|
|
35
|
-
return new Map((((t =
|
|
43
|
+
return new Map((((t = a.data) == null ? void 0 : t.sources) ?? []).map((S) => [S.key, S]));
|
|
36
44
|
},
|
|
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 +(((
|
|
45
|
+
[a.data]
|
|
46
|
+
), W = xe(
|
|
47
|
+
(t) => !(!t || t.role === "audit" && !u || t.role === "own" && !i || t.role === "seat" && !g || p && t.scope !== "open" && t.role !== "seat"),
|
|
48
|
+
[p, u, i, g]
|
|
49
|
+
), z = U(() => {
|
|
50
|
+
var S;
|
|
51
|
+
const t = q.trim().toLowerCase();
|
|
52
|
+
return (((S = a.data) == null ? void 0 : S.users) ?? []).map((v) => {
|
|
53
|
+
const P = v.links.filter((R) => W(f.get(R.source))).sort(
|
|
54
|
+
(R, T) => {
|
|
55
|
+
var X, G;
|
|
56
|
+
return +(((X = f.get(R.source)) == null ? void 0 : X.role) === "seat") - +(((G = f.get(T.source)) == null ? void 0 : G.role) === "seat") || T.count - R.count;
|
|
49
57
|
}
|
|
50
58
|
);
|
|
51
|
-
return { ...
|
|
52
|
-
}).filter((
|
|
53
|
-
(
|
|
54
|
-
).sort((
|
|
55
|
-
}, [
|
|
59
|
+
return { ...v, links: P, total: P.reduce((R, T) => R + T.count, 0) };
|
|
60
|
+
}).filter((v) => v.total > 0).filter((v) => !$ || v.user.id.toUpperCase() === $.toUpperCase()).filter(
|
|
61
|
+
(v) => !t || `${v.user.name} ${v.user.email ?? ""}`.toLowerCase().includes(t)
|
|
62
|
+
).sort((v, P) => P.total - v.total);
|
|
63
|
+
}, [a.data, f, q, W, $]), H = U(() => {
|
|
56
64
|
const t = { suspended: 0, redacted: 0, anonymised: 0, placeholder: 0 };
|
|
57
|
-
for (const
|
|
65
|
+
for (const S of z) t[S.user.reason]++;
|
|
58
66
|
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
|
-
|
|
67
|
+
}, [z]), E = c ? z.filter((t) => t.user.reason === c) : z, I = U(() => {
|
|
68
|
+
var v;
|
|
69
|
+
let t = 0, S = 0;
|
|
70
|
+
for (const P of E)
|
|
71
|
+
for (const R of P.links)
|
|
72
|
+
((v = f.get(R.source)) == null ? void 0 : v.role) === "seat" ? S += R.count : t += R.count;
|
|
73
|
+
return { records: t, seats: S };
|
|
74
|
+
}, [E, f]), le = () => {
|
|
75
|
+
h((t) => t + 1), O(null);
|
|
76
|
+
}, oe = () => {
|
|
77
|
+
N.invalidateQueries({ queryKey: ["inactive-user-links"] }), N.invalidateQueries({ queryKey: ["inactive-user-records"] });
|
|
70
78
|
};
|
|
71
|
-
return /* @__PURE__ */
|
|
72
|
-
/* @__PURE__ */
|
|
73
|
-
/* @__PURE__ */
|
|
74
|
-
/* @__PURE__ */
|
|
79
|
+
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
|
+
/* @__PURE__ */ r("div", { className: "flex flex-wrap items-center gap-x-5 gap-y-3", children: [
|
|
81
|
+
/* @__PURE__ */ r("dl", { className: "flex items-baseline gap-5 text-[12px] text-slate-500 dark:text-muted-foreground", children: [
|
|
82
|
+
/* @__PURE__ */ r("div", { className: "flex items-baseline gap-1.5", children: [
|
|
75
83
|
/* @__PURE__ */ e(
|
|
76
84
|
"dd",
|
|
77
85
|
{
|
|
78
86
|
className: "text-[20px] font-semibold tabular-nums text-slate-900 dark:text-foreground",
|
|
79
87
|
"data-inactive-people": !0,
|
|
80
|
-
children:
|
|
88
|
+
children: a.isLoading ? "—" : b(E.length)
|
|
81
89
|
}
|
|
82
90
|
),
|
|
83
|
-
/* @__PURE__ */ e("dt", { children:
|
|
91
|
+
/* @__PURE__ */ e("dt", { children: E.length === 1 ? "person" : "people" })
|
|
84
92
|
] }),
|
|
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:
|
|
93
|
+
/* @__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(I.records) }),
|
|
95
|
+
/* @__PURE__ */ e("dt", { children: p ? "links on open records" : "record links" })
|
|
88
96
|
] }),
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
/* @__PURE__ */ e("dd", { className: "text-[20px] font-semibold tabular-nums text-slate-900 dark:text-foreground", children:
|
|
97
|
+
/* @__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(I.seats) }),
|
|
91
99
|
/* @__PURE__ */ e("dt", { children: "owner seats and team places" })
|
|
92
100
|
] })
|
|
93
101
|
] }),
|
|
94
|
-
/* @__PURE__ */
|
|
102
|
+
/* @__PURE__ */ r(
|
|
95
103
|
"button",
|
|
96
104
|
{
|
|
97
105
|
type: "button",
|
|
98
|
-
onClick:
|
|
99
|
-
disabled:
|
|
106
|
+
onClick: le,
|
|
107
|
+
disabled: a.isFetching,
|
|
100
108
|
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
109
|
"data-inactive-rescan": !0,
|
|
102
110
|
children: [
|
|
103
|
-
/* @__PURE__ */ e(
|
|
111
|
+
/* @__PURE__ */ e(ie, { className: A("h-3.5 w-3.5", a.isFetching && "animate-spin") }),
|
|
104
112
|
"Scan again"
|
|
105
113
|
]
|
|
106
114
|
}
|
|
107
115
|
)
|
|
108
116
|
] }),
|
|
109
|
-
/* @__PURE__ */
|
|
110
|
-
|
|
111
|
-
|
|
117
|
+
$ && /* @__PURE__ */ r(
|
|
118
|
+
"p",
|
|
119
|
+
{
|
|
120
|
+
className: "flex flex-wrap items-center gap-2 text-[12px] text-slate-600 dark:text-muted-foreground",
|
|
121
|
+
"data-inactive-focus": !0,
|
|
122
|
+
children: [
|
|
123
|
+
"Showing one person.",
|
|
124
|
+
/* @__PURE__ */ e(
|
|
125
|
+
"button",
|
|
126
|
+
{
|
|
127
|
+
type: "button",
|
|
128
|
+
onClick: () => {
|
|
129
|
+
L(null), o == null || o();
|
|
130
|
+
},
|
|
131
|
+
className: "font-medium text-slate-800 underline underline-offset-2 dark:text-foreground",
|
|
132
|
+
children: "Show everyone"
|
|
133
|
+
}
|
|
134
|
+
)
|
|
135
|
+
]
|
|
136
|
+
}
|
|
137
|
+
),
|
|
138
|
+
/* @__PURE__ */ r("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
139
|
+
/* @__PURE__ */ r("label", { className: "relative", children: [
|
|
140
|
+
/* @__PURE__ */ e(ce, { className: "pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
|
|
112
141
|
/* @__PURE__ */ e(
|
|
113
142
|
"input",
|
|
114
143
|
{
|
|
115
|
-
value:
|
|
116
|
-
onChange: (t) =>
|
|
144
|
+
value: q,
|
|
145
|
+
onChange: (t) => j(t.target.value),
|
|
117
146
|
placeholder: "Find a person",
|
|
118
147
|
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
148
|
"data-inactive-search": !0
|
|
120
149
|
}
|
|
121
150
|
)
|
|
122
151
|
] }),
|
|
123
|
-
/* @__PURE__ */ e("span", { className: "flex flex-wrap items-center gap-1", children: Object.keys(
|
|
124
|
-
(t) =>
|
|
152
|
+
/* @__PURE__ */ e("span", { className: "flex flex-wrap items-center gap-1", children: Object.keys(K).map(
|
|
153
|
+
(t) => H[t] || c === t ? /* @__PURE__ */ r(
|
|
125
154
|
"button",
|
|
126
155
|
{
|
|
127
156
|
type: "button",
|
|
128
|
-
"aria-pressed":
|
|
129
|
-
onClick: () =>
|
|
130
|
-
"data-tip":
|
|
157
|
+
"aria-pressed": c === t,
|
|
158
|
+
onClick: () => C(c === t ? null : t),
|
|
159
|
+
"data-tip": re[t],
|
|
131
160
|
"data-inactive-reason": t,
|
|
132
|
-
className:
|
|
161
|
+
className: A(
|
|
133
162
|
"h-7 rounded-md border px-2 text-[11.5px] font-medium transition-colors",
|
|
134
|
-
|
|
163
|
+
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
164
|
),
|
|
136
165
|
children: [
|
|
137
|
-
|
|
166
|
+
K[t],
|
|
138
167
|
" ",
|
|
139
|
-
/* @__PURE__ */ e("span", { className: "tabular-nums text-slate-500 dark:text-muted-foreground", children:
|
|
168
|
+
/* @__PURE__ */ e("span", { className: "tabular-nums text-slate-500 dark:text-muted-foreground", children: b(H[t]) })
|
|
140
169
|
]
|
|
141
170
|
},
|
|
142
171
|
t
|
|
143
172
|
) : null
|
|
144
173
|
) }),
|
|
145
|
-
/* @__PURE__ */
|
|
174
|
+
/* @__PURE__ */ r("span", { className: "ml-auto flex flex-wrap items-center gap-x-4 gap-y-1", children: [
|
|
146
175
|
/* @__PURE__ */ e(
|
|
147
|
-
|
|
176
|
+
B,
|
|
148
177
|
{
|
|
149
178
|
label: "Only records in an open workflow",
|
|
150
|
-
checked:
|
|
151
|
-
onChange:
|
|
179
|
+
checked: p,
|
|
180
|
+
onChange: d,
|
|
152
181
|
hook: "open"
|
|
153
182
|
}
|
|
154
183
|
),
|
|
155
184
|
/* @__PURE__ */ e(
|
|
156
|
-
|
|
185
|
+
B,
|
|
157
186
|
{
|
|
158
187
|
label: "Owner seats and team places",
|
|
159
|
-
checked:
|
|
160
|
-
onChange:
|
|
188
|
+
checked: g,
|
|
189
|
+
onChange: w,
|
|
161
190
|
hook: "seats"
|
|
162
191
|
}
|
|
163
192
|
),
|
|
164
193
|
/* @__PURE__ */ e(
|
|
165
|
-
|
|
194
|
+
B,
|
|
166
195
|
{
|
|
167
196
|
label: "Created by / updated by",
|
|
168
|
-
checked:
|
|
169
|
-
onChange:
|
|
197
|
+
checked: u,
|
|
198
|
+
onChange: k,
|
|
170
199
|
hook: "audit"
|
|
171
200
|
}
|
|
172
201
|
),
|
|
173
202
|
/* @__PURE__ */ e(
|
|
174
|
-
|
|
203
|
+
B,
|
|
175
204
|
{
|
|
176
205
|
label: "The person's own saved sets",
|
|
177
|
-
checked:
|
|
178
|
-
onChange:
|
|
206
|
+
checked: i,
|
|
207
|
+
onChange: m,
|
|
179
208
|
hook: "own"
|
|
180
209
|
}
|
|
181
210
|
)
|
|
182
211
|
] })
|
|
183
212
|
] }),
|
|
184
|
-
(
|
|
185
|
-
|
|
213
|
+
(V = a.data) != null && V.failed.length ? /* @__PURE__ */ r("p", { className: "text-[11.5px] text-amber-700 dark:text-amber-300", children: [
|
|
214
|
+
a.data.failed.length,
|
|
186
215
|
" link ",
|
|
187
|
-
|
|
216
|
+
a.data.failed.length === 1 ? "type" : "types",
|
|
188
217
|
" could not be read and are left out: ",
|
|
189
|
-
|
|
218
|
+
a.data.failed.join(", ")
|
|
190
219
|
] }) : 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:
|
|
220
|
+
/* @__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
221
|
"div",
|
|
193
222
|
{
|
|
194
223
|
className: "h-9 animate-pulse rounded",
|
|
195
224
|
style: { background: "hsl(var(--nvr-skeleton))" }
|
|
196
225
|
},
|
|
197
226
|
t
|
|
198
|
-
)) }) :
|
|
227
|
+
)) }) : a.isError ? /* @__PURE__ */ r("p", { className: "p-6 text-[12.5px] text-rose-700 dark:text-rose-300", children: [
|
|
199
228
|
"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
|
-
|
|
229
|
+
D(a.error, "")
|
|
230
|
+
] }) : E.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-1 flex-col items-center justify-center gap-2 p-10 text-center", children: [
|
|
231
|
+
/* @__PURE__ */ e(ue, { className: "h-6 w-6 text-slate-400" }),
|
|
232
|
+
/* @__PURE__ */ e("p", { className: "text-[13px] font-medium text-slate-800 dark:text-foreground", children: p ? "Nobody inactive is named on open work" : "Nothing matches" }),
|
|
233
|
+
/* @__PURE__ */ e("p", { className: "max-w-[52ch] text-[12px] text-slate-500 dark:text-muted-foreground", children: p ? "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." })
|
|
234
|
+
] }) : /* @__PURE__ */ e("ul", { className: "min-h-0 flex-1 divide-y divide-slate-100 overflow-y-auto dark:divide-border", children: E.map((t) => /* @__PURE__ */ e(
|
|
235
|
+
be,
|
|
207
236
|
{
|
|
208
237
|
person: t,
|
|
209
|
-
sources:
|
|
238
|
+
sources: f,
|
|
210
239
|
open: _ === t.user.id,
|
|
211
240
|
onToggle: () => O(_ === t.user.id ? null : t.user.id),
|
|
212
|
-
onChanged:
|
|
241
|
+
onChanged: oe
|
|
213
242
|
},
|
|
214
243
|
t.user.id
|
|
215
244
|
)) }) })
|
|
216
245
|
] });
|
|
217
246
|
}
|
|
218
|
-
function
|
|
247
|
+
function B({
|
|
219
248
|
label: l,
|
|
220
|
-
checked:
|
|
249
|
+
checked: s,
|
|
221
250
|
onChange: o,
|
|
222
|
-
hook:
|
|
251
|
+
hook: y
|
|
223
252
|
}) {
|
|
224
|
-
return /* @__PURE__ */
|
|
253
|
+
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
254
|
/* @__PURE__ */ e(
|
|
226
255
|
"input",
|
|
227
256
|
{
|
|
228
257
|
type: "checkbox",
|
|
229
|
-
checked:
|
|
230
|
-
onChange: (
|
|
258
|
+
checked: s,
|
|
259
|
+
onChange: (N) => o(N.target.checked),
|
|
231
260
|
className: "h-3.5 w-3.5 accent-slate-700",
|
|
232
|
-
"data-inactive-switch":
|
|
261
|
+
"data-inactive-switch": y
|
|
233
262
|
}
|
|
234
263
|
),
|
|
235
264
|
l
|
|
236
265
|
] });
|
|
237
266
|
}
|
|
238
|
-
function
|
|
267
|
+
function ne(l) {
|
|
239
268
|
return l.kind === "builtin" ? l.label : `${l.collection_label} · ${l.label}`;
|
|
240
269
|
}
|
|
241
|
-
function
|
|
270
|
+
function be({
|
|
242
271
|
person: l,
|
|
243
|
-
sources:
|
|
272
|
+
sources: s,
|
|
244
273
|
open: o,
|
|
245
|
-
onToggle:
|
|
246
|
-
onChanged:
|
|
274
|
+
onToggle: y,
|
|
275
|
+
onChanged: N
|
|
247
276
|
}) {
|
|
248
|
-
const
|
|
249
|
-
return /* @__PURE__ */
|
|
250
|
-
/* @__PURE__ */
|
|
277
|
+
const p = ee(), d = l.user, u = p.userUrl ? p.userUrl(d.id) : `/users/${d.id}`, k = d.name.split(/\s+/).map((i) => i[0]).join("").slice(0, 2).toUpperCase();
|
|
278
|
+
return /* @__PURE__ */ r("li", { "data-inactive-person": d.id, children: [
|
|
279
|
+
/* @__PURE__ */ r(
|
|
251
280
|
"button",
|
|
252
281
|
{
|
|
253
282
|
type: "button",
|
|
254
|
-
onClick:
|
|
283
|
+
onClick: y,
|
|
255
284
|
"aria-expanded": o,
|
|
256
285
|
className: "flex w-full items-center gap-3 px-4 py-2.5 text-left hover:bg-muted",
|
|
257
286
|
children: [
|
|
258
|
-
o ? /* @__PURE__ */ e(
|
|
287
|
+
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
288
|
/* @__PURE__ */ e(
|
|
260
|
-
|
|
289
|
+
he,
|
|
261
290
|
{
|
|
262
291
|
userId: d.id,
|
|
263
292
|
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:
|
|
293
|
+
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
294
|
}
|
|
266
295
|
),
|
|
267
|
-
/* @__PURE__ */
|
|
296
|
+
/* @__PURE__ */ r("span", { className: "min-w-0 flex-[0_1_260px]", children: [
|
|
268
297
|
/* @__PURE__ */ e("span", { className: "block truncate text-[12.5px] font-medium text-slate-900 dark:text-foreground", children: d.name }),
|
|
269
298
|
/* @__PURE__ */ e("span", { className: "block truncate text-[11px] text-slate-500 dark:text-muted-foreground", children: d.email ?? "—" })
|
|
270
299
|
] }),
|
|
271
300
|
/* @__PURE__ */ e(
|
|
272
301
|
"span",
|
|
273
302
|
{
|
|
274
|
-
className:
|
|
303
|
+
className: A(
|
|
275
304
|
"shrink-0 rounded px-1.5 py-0.5 text-[10.5px] font-medium",
|
|
276
|
-
|
|
305
|
+
fe[d.reason]
|
|
277
306
|
),
|
|
278
|
-
"data-tip":
|
|
279
|
-
children:
|
|
307
|
+
"data-tip": re[d.reason],
|
|
308
|
+
children: K[d.reason]
|
|
280
309
|
}
|
|
281
310
|
),
|
|
282
|
-
/* @__PURE__ */
|
|
311
|
+
/* @__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
312
|
l.links.slice(0, 3).map((i) => {
|
|
284
|
-
const
|
|
285
|
-
return
|
|
313
|
+
const m = s.get(i.source);
|
|
314
|
+
return m ? `${ne(m)} ${b(i.count)}` : "";
|
|
286
315
|
}).filter(Boolean).join(" · "),
|
|
287
316
|
l.links.length > 3 ? ` · +${l.links.length - 3} more` : ""
|
|
288
317
|
] }),
|
|
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:
|
|
318
|
+
/* @__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" }),
|
|
319
|
+
/* @__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
320
|
]
|
|
292
321
|
}
|
|
293
322
|
),
|
|
294
|
-
o && /* @__PURE__ */
|
|
323
|
+
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
324
|
/* @__PURE__ */ e("ul", { className: "space-y-1", children: l.links.map((i) => {
|
|
296
|
-
const
|
|
297
|
-
return
|
|
298
|
-
|
|
325
|
+
const m = s.get(i.source);
|
|
326
|
+
return m ? /* @__PURE__ */ e(
|
|
327
|
+
ge,
|
|
299
328
|
{
|
|
300
329
|
userId: d.id,
|
|
301
|
-
source:
|
|
330
|
+
source: m,
|
|
302
331
|
count: i.count,
|
|
303
|
-
onChanged:
|
|
332
|
+
onChanged: N
|
|
304
333
|
},
|
|
305
334
|
i.source
|
|
306
335
|
) : null;
|
|
307
336
|
}) }),
|
|
308
|
-
u && /* @__PURE__ */
|
|
337
|
+
u && /* @__PURE__ */ r("p", { className: "mt-3 text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
|
|
309
338
|
"Everything this person holds can also move in one pass from",
|
|
310
339
|
" ",
|
|
311
340
|
/* @__PURE__ */ e(
|
|
312
341
|
"button",
|
|
313
342
|
{
|
|
314
343
|
type: "button",
|
|
315
|
-
onClick: () =>
|
|
344
|
+
onClick: () => p.navigate(u),
|
|
316
345
|
className: "font-medium text-slate-700 underline decoration-dotted underline-offset-2 hover:text-slate-900 dark:text-foreground",
|
|
317
346
|
children: "their account page"
|
|
318
347
|
}
|
|
@@ -323,110 +352,110 @@ function me({
|
|
|
323
352
|
] })
|
|
324
353
|
] });
|
|
325
354
|
}
|
|
326
|
-
function
|
|
355
|
+
function ge({
|
|
327
356
|
userId: l,
|
|
328
|
-
source:
|
|
357
|
+
source: s,
|
|
329
358
|
count: o,
|
|
330
|
-
onChanged:
|
|
359
|
+
onChanged: y
|
|
331
360
|
}) {
|
|
332
|
-
var
|
|
333
|
-
const
|
|
334
|
-
queryKey: ["inactive-user-records", l,
|
|
335
|
-
queryFn: () =>
|
|
336
|
-
|
|
337
|
-
`/inactive-user-links/${l}/records?source=${encodeURIComponent(
|
|
361
|
+
var g, w;
|
|
362
|
+
const N = F(), { open: p } = te(), [d, u] = x(!1), k = !0, i = s.kind === "builtin", m = M({
|
|
363
|
+
queryKey: ["inactive-user-records", l, s.key],
|
|
364
|
+
queryFn: () => N.request(
|
|
365
|
+
Q(
|
|
366
|
+
`/inactive-user-links/${l}/records?source=${encodeURIComponent(s.key)}&limit=100`
|
|
338
367
|
)
|
|
339
|
-
).then((
|
|
340
|
-
enabled: d &&
|
|
368
|
+
).then((c) => c.data),
|
|
369
|
+
enabled: d && k
|
|
341
370
|
});
|
|
342
|
-
return /* @__PURE__ */
|
|
343
|
-
/* @__PURE__ */
|
|
344
|
-
/* @__PURE__ */
|
|
371
|
+
return /* @__PURE__ */ r("li", { "data-inactive-source": s.key, children: [
|
|
372
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-2 text-[12px]", children: [
|
|
373
|
+
/* @__PURE__ */ r(
|
|
345
374
|
"button",
|
|
346
375
|
{
|
|
347
376
|
type: "button",
|
|
348
|
-
disabled: !
|
|
349
|
-
onClick: () => u((
|
|
377
|
+
disabled: !k,
|
|
378
|
+
onClick: () => u((c) => !c),
|
|
350
379
|
"aria-expanded": d,
|
|
351
380
|
className: "flex min-w-0 items-center gap-1.5 text-left text-slate-700 enabled:hover:text-slate-900 dark:text-foreground",
|
|
352
381
|
children: [
|
|
353
|
-
d ? /* @__PURE__ */ e(
|
|
354
|
-
/* @__PURE__ */ e("span", { className: "truncate", children:
|
|
382
|
+
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: ne(s) })
|
|
355
384
|
]
|
|
356
385
|
}
|
|
357
386
|
),
|
|
358
|
-
/* @__PURE__ */ e("span", { className: "tabular-nums text-slate-500 dark:text-muted-foreground", children:
|
|
359
|
-
|
|
360
|
-
|
|
387
|
+
/* @__PURE__ */ e("span", { className: "tabular-nums text-slate-500 dark:text-muted-foreground", children: b(o) }),
|
|
388
|
+
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(se, { userId: l, source: s, count: o, onDone: y }) })
|
|
361
390
|
] }),
|
|
362
|
-
d &&
|
|
363
|
-
|
|
391
|
+
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
|
+
ke,
|
|
364
393
|
{
|
|
365
394
|
userId: l,
|
|
366
|
-
source:
|
|
367
|
-
entries: ((
|
|
368
|
-
onChanged:
|
|
395
|
+
source: s,
|
|
396
|
+
entries: ((g = m.data) == null ? void 0 : g.entries) ?? [],
|
|
397
|
+
onChanged: y
|
|
369
398
|
}
|
|
370
|
-
) : (
|
|
371
|
-
|
|
372
|
-
var
|
|
399
|
+
) : (w = m.data) != null && w.records.length ? /* @__PURE__ */ r("ul", { className: "flex flex-wrap gap-1", "data-inactive-records": !0, children: [
|
|
400
|
+
m.data.records.map((c) => {
|
|
401
|
+
var C;
|
|
373
402
|
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
374
403
|
"button",
|
|
375
404
|
{
|
|
376
405
|
type: "button",
|
|
377
|
-
onClick: () =>
|
|
406
|
+
onClick: () => p({ collection: c.collection, itemId: c.id }),
|
|
378
407
|
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: ((
|
|
408
|
+
children: ((C = c.label) == null ? void 0 : C.trim()) || `#${c.id}`
|
|
380
409
|
}
|
|
381
|
-
) }, `${
|
|
410
|
+
) }, `${c.collection}:${c.id}`);
|
|
382
411
|
}),
|
|
383
|
-
o >
|
|
412
|
+
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
413
|
"+",
|
|
385
|
-
|
|
414
|
+
b(o - m.data.records.length),
|
|
386
415
|
" more"
|
|
387
416
|
] })
|
|
388
417
|
] }) : /* @__PURE__ */ e("p", { className: "text-[11.5px] text-slate-500 dark:text-muted-foreground", children: "Nothing to list." }) })
|
|
389
418
|
] });
|
|
390
419
|
}
|
|
391
|
-
function
|
|
420
|
+
function se({
|
|
392
421
|
userId: l,
|
|
393
|
-
source:
|
|
422
|
+
source: s,
|
|
394
423
|
count: o,
|
|
395
|
-
ids:
|
|
396
|
-
label:
|
|
397
|
-
onDone:
|
|
424
|
+
ids: y,
|
|
425
|
+
label: N = "Hand to…",
|
|
426
|
+
onDone: p
|
|
398
427
|
}) {
|
|
399
|
-
var
|
|
400
|
-
const d =
|
|
428
|
+
var h;
|
|
429
|
+
const d = F(), [u, k] = x(!1), [i, m] = x(""), [g, w] = x(null), [c, C] = x(!1), [q, j] = x(null), [_, O] = x(null), $ = M({
|
|
401
430
|
queryKey: ["inactive-reassign-users", i],
|
|
402
|
-
queryFn: () => d.request(
|
|
403
|
-
enabled: u && !
|
|
431
|
+
queryFn: () => d.request(Q(`/users?search=${encodeURIComponent(i)}&limit=8`)).then((a) => a.data),
|
|
432
|
+
enabled: u && !g && i.trim().length >= 2,
|
|
404
433
|
staleTime: 3e4
|
|
405
|
-
}),
|
|
406
|
-
if (
|
|
407
|
-
|
|
434
|
+
}), L = (a) => [a.first_name, a.last_name].filter(Boolean).join(" ") || a.email, n = async () => {
|
|
435
|
+
if (g) {
|
|
436
|
+
C(!0), O(null);
|
|
408
437
|
try {
|
|
409
|
-
const
|
|
410
|
-
|
|
411
|
-
`${
|
|
412
|
-
),
|
|
413
|
-
} catch (
|
|
414
|
-
const
|
|
415
|
-
|
|
438
|
+
const f = (await d.request(ae(`/inactive-user-links/${l}/reassign`, { source: s.key, to: g.id, ids: y }))).data;
|
|
439
|
+
j(
|
|
440
|
+
`${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), p();
|
|
442
|
+
} catch (a) {
|
|
443
|
+
const f = a.response;
|
|
444
|
+
O((f == null ? void 0 : f.error) ?? D(a, ""));
|
|
416
445
|
} finally {
|
|
417
|
-
|
|
446
|
+
C(!1);
|
|
418
447
|
}
|
|
419
448
|
}
|
|
420
449
|
};
|
|
421
|
-
return
|
|
450
|
+
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
451
|
/* @__PURE__ */ e(
|
|
423
452
|
"button",
|
|
424
453
|
{
|
|
425
454
|
type: "button",
|
|
426
|
-
onClick: () =>
|
|
427
|
-
"data-inactive-reassign":
|
|
455
|
+
onClick: () => k((a) => !a),
|
|
456
|
+
"data-inactive-reassign": s.key,
|
|
428
457
|
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:
|
|
458
|
+
children: N
|
|
430
459
|
}
|
|
431
460
|
),
|
|
432
461
|
u && /* @__PURE__ */ e(
|
|
@@ -434,30 +463,30 @@ function te({
|
|
|
434
463
|
{
|
|
435
464
|
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
465
|
"data-inactive-reassign-panel": !0,
|
|
437
|
-
children:
|
|
438
|
-
/* @__PURE__ */
|
|
466
|
+
children: g ? /* @__PURE__ */ r("div", { className: "space-y-2", children: [
|
|
467
|
+
/* @__PURE__ */ r("p", { className: "text-[12px] text-slate-700 dark:text-foreground", children: [
|
|
439
468
|
"Put ",
|
|
440
|
-
/* @__PURE__ */ e("strong", { className: "font-semibold", children:
|
|
469
|
+
/* @__PURE__ */ e("strong", { className: "font-semibold", children: L(g) }),
|
|
441
470
|
" on",
|
|
442
471
|
" ",
|
|
443
|
-
|
|
472
|
+
b(Math.min(o, 500)),
|
|
444
473
|
" ",
|
|
445
|
-
|
|
474
|
+
s.kind === "builtin" ? o === 1 ? "place" : "places" : o === 1 ? "record" : "records",
|
|
446
475
|
" ",
|
|
447
476
|
"as ",
|
|
448
|
-
|
|
477
|
+
s.label.toLowerCase(),
|
|
449
478
|
o > 500 ? " (500 at a time)" : "",
|
|
450
479
|
"?",
|
|
451
480
|
" ",
|
|
452
|
-
|
|
481
|
+
s.kind === "builtin" ? "Places they already hold are not doubled." : "Each change is saved to the record's history."
|
|
453
482
|
] }),
|
|
454
|
-
|
|
455
|
-
/* @__PURE__ */
|
|
483
|
+
_ && /* @__PURE__ */ e("p", { className: "text-[11.5px] text-rose-700 dark:text-rose-300", children: _ }),
|
|
484
|
+
/* @__PURE__ */ r("div", { className: "flex justify-end gap-1.5", children: [
|
|
456
485
|
/* @__PURE__ */ e(
|
|
457
486
|
"button",
|
|
458
487
|
{
|
|
459
488
|
type: "button",
|
|
460
|
-
onClick: () =>
|
|
489
|
+
onClick: () => w(null),
|
|
461
490
|
className: "h-7 rounded-md px-2 text-[11.5px] text-slate-600 hover:text-slate-900 dark:text-muted-foreground",
|
|
462
491
|
children: "Back"
|
|
463
492
|
}
|
|
@@ -466,125 +495,125 @@ function te({
|
|
|
466
495
|
"button",
|
|
467
496
|
{
|
|
468
497
|
type: "button",
|
|
469
|
-
onClick:
|
|
470
|
-
disabled:
|
|
498
|
+
onClick: n,
|
|
499
|
+
disabled: c,
|
|
471
500
|
"data-inactive-reassign-confirm": !0,
|
|
472
501
|
className: "h-7 rounded-md bg-nvr-cyan px-2.5 text-[11.5px] font-medium text-white disabled:opacity-60",
|
|
473
|
-
children:
|
|
502
|
+
children: c ? "Moving…" : "Move them"
|
|
474
503
|
}
|
|
475
504
|
)
|
|
476
505
|
] })
|
|
477
|
-
] }) : /* @__PURE__ */
|
|
506
|
+
] }) : /* @__PURE__ */ r(J, { children: [
|
|
478
507
|
/* @__PURE__ */ e(
|
|
479
508
|
"input",
|
|
480
509
|
{
|
|
481
510
|
autoFocus: !0,
|
|
482
511
|
value: i,
|
|
483
|
-
onChange: (
|
|
512
|
+
onChange: (a) => m(a.target.value),
|
|
484
513
|
placeholder: "Search people",
|
|
485
514
|
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
515
|
}
|
|
487
516
|
),
|
|
488
|
-
/* @__PURE__ */
|
|
489
|
-
(
|
|
517
|
+
/* @__PURE__ */ r("ul", { className: "mt-1 max-h-56 overflow-y-auto", children: [
|
|
518
|
+
($.data ?? []).filter((a) => a.id.toLowerCase() !== l.toLowerCase()).map((a) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ r(
|
|
490
519
|
"button",
|
|
491
520
|
{
|
|
492
521
|
type: "button",
|
|
493
|
-
onClick: () =>
|
|
494
|
-
"data-inactive-candidate":
|
|
522
|
+
onClick: () => w(a),
|
|
523
|
+
"data-inactive-candidate": a.id,
|
|
495
524
|
className: "flex w-full flex-col rounded px-2 py-1 text-left hover:bg-muted",
|
|
496
525
|
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:
|
|
526
|
+
/* @__PURE__ */ e("span", { className: "text-[12px] text-slate-800 dark:text-foreground", children: L(a) }),
|
|
527
|
+
/* @__PURE__ */ e("span", { className: "text-[10.5px] text-slate-500 dark:text-muted-foreground", children: a.email })
|
|
499
528
|
]
|
|
500
529
|
}
|
|
501
|
-
) },
|
|
502
|
-
i.trim().length >= 2 &&
|
|
530
|
+
) }, a.id)),
|
|
531
|
+
i.trim().length >= 2 && !$.isLoading && !((h = $.data) != null && h.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
532
|
] })
|
|
504
533
|
] })
|
|
505
534
|
}
|
|
506
535
|
)
|
|
507
536
|
] });
|
|
508
537
|
}
|
|
509
|
-
function
|
|
538
|
+
function ke({
|
|
510
539
|
userId: l,
|
|
511
|
-
source:
|
|
540
|
+
source: s,
|
|
512
541
|
entries: o,
|
|
513
|
-
onChanged:
|
|
542
|
+
onChanged: y
|
|
514
543
|
}) {
|
|
515
|
-
const
|
|
516
|
-
const
|
|
517
|
-
return
|
|
518
|
-
}),
|
|
519
|
-
var
|
|
520
|
-
|
|
544
|
+
const N = F(), p = 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, O = (n) => k((h) => {
|
|
545
|
+
const a = new Set(h);
|
|
546
|
+
return a.has(n) ? a.delete(n) : a.add(n), a;
|
|
547
|
+
}), $ = async () => {
|
|
548
|
+
var n;
|
|
549
|
+
w(!0);
|
|
521
550
|
try {
|
|
522
|
-
const
|
|
523
|
-
|
|
551
|
+
const h = await N.request(
|
|
552
|
+
ae(`/inactive-user-links/${l}/remove`, { source: s.key, ids: j })
|
|
524
553
|
);
|
|
525
|
-
|
|
526
|
-
`${
|
|
527
|
-
),
|
|
528
|
-
} catch (
|
|
529
|
-
|
|
554
|
+
C(
|
|
555
|
+
`${b(h.data.removed)} removed${h.data.failed.length ? ` · ${b(h.data.failed.length)} refused` : ""}`
|
|
556
|
+
), k(/* @__PURE__ */ new Set()), m(!1), y();
|
|
557
|
+
} catch (h) {
|
|
558
|
+
C(((n = h.response) == null ? void 0 : n.error) ?? D(h, ""));
|
|
530
559
|
} finally {
|
|
531
|
-
|
|
560
|
+
w(!1);
|
|
532
561
|
}
|
|
533
562
|
};
|
|
534
563
|
if (!o.length)
|
|
535
564
|
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__ */
|
|
565
|
+
const L = o.filter((n) => n.sole).length;
|
|
566
|
+
return /* @__PURE__ */ r("div", { "data-inactive-entries": s.key, children: [
|
|
567
|
+
/* @__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: [
|
|
568
|
+
/* @__PURE__ */ r("label", { className: "flex cursor-pointer items-center gap-1.5", children: [
|
|
540
569
|
/* @__PURE__ */ e(
|
|
541
570
|
"input",
|
|
542
571
|
{
|
|
543
572
|
type: "checkbox",
|
|
544
|
-
checked:
|
|
545
|
-
onChange: () =>
|
|
573
|
+
checked: _,
|
|
574
|
+
onChange: () => k(_ ? /* @__PURE__ */ new Set() : new Set(o.map((n) => n.id))),
|
|
546
575
|
className: "h-3.5 w-3.5 accent-slate-700",
|
|
547
576
|
"data-inactive-entries-all": !0
|
|
548
577
|
}
|
|
549
578
|
),
|
|
550
|
-
u.size ? `${
|
|
579
|
+
u.size ? `${b(u.size)} picked` : "Pick all"
|
|
551
580
|
] }),
|
|
552
|
-
|
|
553
|
-
|
|
581
|
+
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: [
|
|
582
|
+
b(L),
|
|
554
583
|
" with nobody else who can act"
|
|
555
584
|
] }),
|
|
556
|
-
|
|
557
|
-
u.size > 0 && /* @__PURE__ */
|
|
585
|
+
c && /* @__PURE__ */ e("span", { className: "text-emerald-700 dark:text-emerald-400", children: c }),
|
|
586
|
+
u.size > 0 && /* @__PURE__ */ r("span", { className: "ml-auto flex items-center gap-1.5", children: [
|
|
558
587
|
/* @__PURE__ */ e(
|
|
559
|
-
|
|
588
|
+
se,
|
|
560
589
|
{
|
|
561
590
|
userId: l,
|
|
562
|
-
source:
|
|
591
|
+
source: s,
|
|
563
592
|
count: u.size,
|
|
564
|
-
ids:
|
|
565
|
-
label: `Hand ${
|
|
593
|
+
ids: j,
|
|
594
|
+
label: `Hand ${b(u.size)} to…`,
|
|
566
595
|
onDone: () => {
|
|
567
|
-
|
|
596
|
+
k(/* @__PURE__ */ new Set()), y();
|
|
568
597
|
}
|
|
569
598
|
}
|
|
570
599
|
),
|
|
571
|
-
|
|
600
|
+
q && (i ? /* @__PURE__ */ r(J, { children: [
|
|
572
601
|
/* @__PURE__ */ e(
|
|
573
602
|
"button",
|
|
574
603
|
{
|
|
575
604
|
type: "button",
|
|
576
|
-
onClick:
|
|
577
|
-
disabled:
|
|
605
|
+
onClick: $,
|
|
606
|
+
disabled: g,
|
|
578
607
|
"data-inactive-remove-confirm": !0,
|
|
579
608
|
className: "h-[22px] rounded-md bg-[#be123c] px-2 text-[11px] font-medium text-white disabled:opacity-60",
|
|
580
|
-
children:
|
|
609
|
+
children: g ? "Removing…" : `Remove ${b(u.size)}, no successor`
|
|
581
610
|
}
|
|
582
611
|
),
|
|
583
612
|
/* @__PURE__ */ e(
|
|
584
613
|
"button",
|
|
585
614
|
{
|
|
586
615
|
type: "button",
|
|
587
|
-
onClick: () =>
|
|
616
|
+
onClick: () => m(!1),
|
|
588
617
|
className: "text-[11px] text-slate-600 hover:text-slate-900 dark:text-muted-foreground",
|
|
589
618
|
children: "Keep"
|
|
590
619
|
}
|
|
@@ -593,7 +622,7 @@ function he({
|
|
|
593
622
|
"button",
|
|
594
623
|
{
|
|
595
624
|
type: "button",
|
|
596
|
-
onClick: () =>
|
|
625
|
+
onClick: () => m(!0),
|
|
597
626
|
"data-inactive-remove": !0,
|
|
598
627
|
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
628
|
children: "Remove…"
|
|
@@ -601,64 +630,64 @@ function he({
|
|
|
601
630
|
))
|
|
602
631
|
] })
|
|
603
632
|
] }),
|
|
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__ */
|
|
633
|
+
/* @__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 h = n.console_path ? p.consoleUrl ? p.consoleUrl(n.console_path) : n.console_path : null;
|
|
635
|
+
return /* @__PURE__ */ r(
|
|
607
636
|
"li",
|
|
608
637
|
{
|
|
609
638
|
className: "flex items-start gap-2 px-2.5 py-1.5",
|
|
610
|
-
"data-inactive-entry":
|
|
639
|
+
"data-inactive-entry": n.id,
|
|
611
640
|
children: [
|
|
612
641
|
/* @__PURE__ */ e(
|
|
613
642
|
"input",
|
|
614
643
|
{
|
|
615
644
|
type: "checkbox",
|
|
616
|
-
checked: u.has(
|
|
617
|
-
onChange: () =>
|
|
618
|
-
"aria-label": `Pick ${
|
|
645
|
+
checked: u.has(n.id),
|
|
646
|
+
onChange: () => O(n.id),
|
|
647
|
+
"aria-label": `Pick ${n.title}`,
|
|
619
648
|
className: "mt-0.5 h-3.5 w-3.5 shrink-0 accent-slate-700"
|
|
620
649
|
}
|
|
621
650
|
),
|
|
622
|
-
/* @__PURE__ */
|
|
623
|
-
/* @__PURE__ */
|
|
624
|
-
|
|
651
|
+
/* @__PURE__ */ r("div", { className: "min-w-0 flex-1", children: [
|
|
652
|
+
/* @__PURE__ */ r("div", { className: "flex flex-wrap items-baseline gap-x-2", children: [
|
|
653
|
+
n.record ? /* @__PURE__ */ e(
|
|
625
654
|
"button",
|
|
626
655
|
{
|
|
627
656
|
type: "button",
|
|
628
|
-
onClick: () =>
|
|
657
|
+
onClick: () => n.record && d({ collection: n.record.collection, itemId: n.record.id }),
|
|
629
658
|
className: "text-left text-[12px] font-medium text-slate-900 underline decoration-dotted underline-offset-2 dark:text-foreground",
|
|
630
|
-
children:
|
|
659
|
+
children: n.title
|
|
631
660
|
}
|
|
632
|
-
) :
|
|
661
|
+
) : h ? /* @__PURE__ */ e(
|
|
633
662
|
"button",
|
|
634
663
|
{
|
|
635
664
|
type: "button",
|
|
636
|
-
onClick: () => /^https?:/.test(
|
|
665
|
+
onClick: () => /^https?:/.test(h) ? window.open(h, "_blank") : p.navigate(h),
|
|
637
666
|
className: "text-left text-[12px] font-medium text-slate-900 underline decoration-dotted underline-offset-2 dark:text-foreground",
|
|
638
|
-
children:
|
|
667
|
+
children: n.title
|
|
639
668
|
}
|
|
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:
|
|
669
|
+
) : /* @__PURE__ */ e("span", { className: "text-[12px] font-medium text-slate-900 dark:text-foreground", children: n.title }),
|
|
670
|
+
/* @__PURE__ */ e("span", { className: "text-[11px] text-slate-500 dark:text-muted-foreground", children: n.facts.join(" · ") })
|
|
642
671
|
] }),
|
|
643
|
-
|
|
644
|
-
(
|
|
672
|
+
n.subtitle && /* @__PURE__ */ e("p", { className: "text-[11.5px] text-slate-600 dark:text-muted-foreground", children: n.subtitle }),
|
|
673
|
+
(s.key === "builtin:owner_seats" || s.key === "builtin:teams") && /* @__PURE__ */ e(
|
|
645
674
|
"p",
|
|
646
675
|
{
|
|
647
|
-
className:
|
|
676
|
+
className: A(
|
|
648
677
|
"text-[11px]",
|
|
649
|
-
|
|
678
|
+
n.sole ? "font-medium text-[#9f1239] dark:text-[#f4a3ad]" : "text-slate-500 dark:text-muted-foreground"
|
|
650
679
|
),
|
|
651
|
-
children:
|
|
680
|
+
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
681
|
}
|
|
653
682
|
)
|
|
654
683
|
] })
|
|
655
684
|
]
|
|
656
685
|
},
|
|
657
|
-
|
|
686
|
+
n.id
|
|
658
687
|
);
|
|
659
688
|
}) })
|
|
660
689
|
] });
|
|
661
690
|
}
|
|
662
691
|
export {
|
|
663
|
-
|
|
692
|
+
qe as InactiveUserLinksView
|
|
664
693
|
};
|