react-semaphor 0.1.165 → 0.1.167
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/chunks/dashboard-controls-Bp5qe0eo.js +26 -0
- package/dist/chunks/{dashboard-controls-BA7vyPHM.js → dashboard-controls-ominVbei.js} +273 -298
- package/dist/chunks/{dashboard-json-C8YFsFVt.js → dashboard-json-C4i7Yq69.js} +1 -1
- package/dist/chunks/{dashboard-json-B4UTFvyR.js → dashboard-json-Dx_6Ejec.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-BMBiT_V_.js → edit-dashboard-visual-C8JlV4-w.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-DKqjPVRM.js → edit-dashboard-visual-Cd-a5PlC.js} +2 -2
- package/dist/chunks/{editor-action-buttons-De18jUjn.js → editor-action-buttons-BbqakkOy.js} +2 -2
- package/dist/chunks/{editor-action-buttons-xrbSWcSm.js → editor-action-buttons-DgLZlX3X.js} +1 -1
- package/dist/chunks/{index-5dE6RqWv.js → index-DK6LMjBA.js} +15724 -15488
- package/dist/chunks/{index-odiH0LJA.js → index-o_l1PmNv.js} +193 -193
- package/dist/chunks/{resource-management-panel-CjWRsuif.js → resource-management-panel-Bcr9R2mo.js} +128 -128
- package/dist/chunks/{resource-management-panel-CK-wL4Jy.js → resource-management-panel-C-ijbO2j.js} +1 -1
- package/dist/chunks/schedule-dashboard-DwdOvSX8.js +416 -0
- package/dist/chunks/schedule-dashboard-_UAuGQ_4.js +6 -0
- package/dist/chunks/{use-role-aware-display-preferences-Bj_-I3oD.js → use-role-aware-display-preferences-Bg5K1xOj.js} +1 -1
- package/dist/chunks/{use-role-aware-display-preferences-Cm7hg_Us.js → use-role-aware-display-preferences-D-icyP5A.js} +1 -1
- package/dist/chunks/{use-visual-utils-Du173Ucu.js → use-visual-utils--qc4n_jK.js} +1 -1
- package/dist/chunks/{use-visual-utils-DwnVUHSd.js → use-visual-utils-BwfHhd-4.js} +10 -10
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +58 -58
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +1 -1
- package/dist/types/dashboard.d.ts +5 -0
- package/dist/types/main.d.ts +5 -0
- package/dist/types/surfboard.d.ts +5 -0
- package/dist/types/types.d.ts +5 -0
- package/package.json +1 -1
- package/dist/chunks/dashboard-controls-CEnWdjuE.js +0 -26
- package/dist/chunks/dashboard-export-dialog-9nJsWzgJ.js +0 -6
- package/dist/chunks/dashboard-export-dialog-CEVJnrSj.js +0 -602
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsxs as r, jsx as e, Fragment as E } from "react/jsx-runtime";
|
|
2
|
-
import { l as X,
|
|
2
|
+
import { l as X, bE as $s, bF as qs, u as y, aS as Be, aT as Je, B as L, aV as We, aW as fe, bG as Me, o as Xe, aA as U, aF as ke, bH as zs, bc as Le, aG as Ae, aH as Ie, aI as Te, aJ as Ye, aK as be, bI as W, aO as js, K as $, bJ as Vs, bg as Hs, bK as Qs, bL as Ve, bM as Ze, c as ie, bN as es, p as le, bO as ce, t as k, bP as ss, aM as Ks, bQ as Bs, L as q, bf as z, bR as Js, bS as Ws, bT as Ne, bU as Xs, bV as Ys, bW as as, bX as ts, bY as ne, bZ as oe, bB as ye, bm as xe, b_ as we, bh as rs, b$ as Ce, aN as ns, e as os, c0 as Zs, a_ as is, a$ as ls, b0 as cs, b2 as ds, b3 as us, b4 as ms, b5 as hs, b6 as Se, c1 as ea, ba as sa, c2 as aa, T as ta, n as He, R as te, $ as ra, V as ve, c3 as na, c4 as oa, c5 as ia, c6 as la, bd as ca, a6 as da, c7 as ua, c8 as ma, c9 as ha, ca as pa, cb as ga, _ as fa, a5 as va } from "./index-DK6LMjBA.js";
|
|
3
3
|
import * as M from "react";
|
|
4
|
-
import { useState as b, useMemo as
|
|
4
|
+
import { useState as b, useMemo as re, useEffect as ba } from "react";
|
|
5
5
|
import "react-dom";
|
|
6
|
-
import {
|
|
7
|
-
import { u as Sa } from "./use-role-aware-display-preferences-
|
|
8
|
-
import { S as
|
|
6
|
+
import { u as Na, A as ya, V as xa, S as wa, U as Ca } from "./schedule-dashboard-DwdOvSX8.js";
|
|
7
|
+
import { u as Sa } from "./use-role-aware-display-preferences-D-icyP5A.js";
|
|
8
|
+
import { S as Qe } from "./editor-action-buttons-BbqakkOy.js";
|
|
9
9
|
/**
|
|
10
10
|
* @license lucide-react v0.453.0 - ISC
|
|
11
11
|
*
|
|
12
12
|
* This source code is licensed under the ISC license.
|
|
13
13
|
* See the LICENSE file in the root directory of this source tree.
|
|
14
14
|
*/
|
|
15
|
-
const
|
|
15
|
+
const Da = X("Glasses", [
|
|
16
16
|
["circle", { cx: "6", cy: "15", r: "4", key: "vux9w4" }],
|
|
17
17
|
["circle", { cx: "18", cy: "15", r: "4", key: "18o8ve" }],
|
|
18
18
|
["path", { d: "M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2", key: "1ag4bs" }],
|
|
@@ -25,7 +25,7 @@ const Ma = X("Glasses", [
|
|
|
25
25
|
* This source code is licensed under the ISC license.
|
|
26
26
|
* See the LICENSE file in the root directory of this source tree.
|
|
27
27
|
*/
|
|
28
|
-
const
|
|
28
|
+
const Ma = X("Menu", [
|
|
29
29
|
["line", { x1: "4", x2: "20", y1: "12", y2: "12", key: "1e0a9i" }],
|
|
30
30
|
["line", { x1: "4", x2: "20", y1: "6", y2: "6", key: "1owob3" }],
|
|
31
31
|
["line", { x1: "4", x2: "20", y1: "18", y2: "18", key: "yk5zj1" }]
|
|
@@ -36,7 +36,7 @@ const ka = X("Menu", [
|
|
|
36
36
|
* This source code is licensed under the ISC license.
|
|
37
37
|
* See the LICENSE file in the root directory of this source tree.
|
|
38
38
|
*/
|
|
39
|
-
const
|
|
39
|
+
const ka = X("Moon", [
|
|
40
40
|
["path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z", key: "a7tn18" }]
|
|
41
41
|
]);
|
|
42
42
|
/**
|
|
@@ -45,7 +45,7 @@ const La = X("Moon", [
|
|
|
45
45
|
* This source code is licensed under the ISC license.
|
|
46
46
|
* See the LICENSE file in the root directory of this source tree.
|
|
47
47
|
*/
|
|
48
|
-
const
|
|
48
|
+
const La = X("ShieldX", [
|
|
49
49
|
[
|
|
50
50
|
"path",
|
|
51
51
|
{
|
|
@@ -62,7 +62,7 @@ const Aa = X("ShieldX", [
|
|
|
62
62
|
* This source code is licensed under the ISC license.
|
|
63
63
|
* See the LICENSE file in the root directory of this source tree.
|
|
64
64
|
*/
|
|
65
|
-
const
|
|
65
|
+
const Aa = X("Sun", [
|
|
66
66
|
["circle", { cx: "12", cy: "12", r: "4", key: "4exip2" }],
|
|
67
67
|
["path", { d: "M12 2v2", key: "tus03m" }],
|
|
68
68
|
["path", { d: "M12 20v2", key: "1lh1kg" }],
|
|
@@ -73,22 +73,22 @@ const Ia = X("Sun", [
|
|
|
73
73
|
["path", { d: "m6.34 17.66-1.41 1.41", key: "1m8zz5" }],
|
|
74
74
|
["path", { d: "m19.07 4.93-1.41 1.41", key: "1shlcs" }]
|
|
75
75
|
]);
|
|
76
|
-
var
|
|
76
|
+
var Ia = $s();
|
|
77
77
|
function Ta() {
|
|
78
|
-
const { setTheme: s } =
|
|
78
|
+
const { setTheme: s } = qs(), n = y(
|
|
79
79
|
(a) => a.actions.setDashboardTheme
|
|
80
80
|
);
|
|
81
|
-
return /* @__PURE__ */ r(
|
|
82
|
-
/* @__PURE__ */ e(Je, { asChild: !0, children: /* @__PURE__ */ r(
|
|
81
|
+
return /* @__PURE__ */ r(Be, { children: [
|
|
82
|
+
/* @__PURE__ */ e(Je, { asChild: !0, children: /* @__PURE__ */ r(L, { className: "h-7 p-2", variant: "ghost", size: "sm", children: [
|
|
83
83
|
/* @__PURE__ */ e(
|
|
84
|
-
|
|
84
|
+
Aa,
|
|
85
85
|
{
|
|
86
86
|
strokeWidth: 1.5,
|
|
87
87
|
className: "h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"
|
|
88
88
|
}
|
|
89
89
|
),
|
|
90
90
|
/* @__PURE__ */ e(
|
|
91
|
-
|
|
91
|
+
ka,
|
|
92
92
|
{
|
|
93
93
|
strokeWidth: 1.5,
|
|
94
94
|
className: "absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"
|
|
@@ -127,7 +127,7 @@ function Ta() {
|
|
|
127
127
|
] })
|
|
128
128
|
] });
|
|
129
129
|
}
|
|
130
|
-
async function
|
|
130
|
+
async function Ea(s, n, a, t, l) {
|
|
131
131
|
if (!l)
|
|
132
132
|
return null;
|
|
133
133
|
const o = JSON.stringify(a), c = `${s}/v1/lens`;
|
|
@@ -138,7 +138,7 @@ async function Pa(s, n, a, t, l) {
|
|
|
138
138
|
operation: "create"
|
|
139
139
|
});
|
|
140
140
|
}
|
|
141
|
-
async function
|
|
141
|
+
async function De(s, n, a) {
|
|
142
142
|
if (!a)
|
|
143
143
|
return null;
|
|
144
144
|
const { id: t, template: l, filterValues: o, isDefault: c, shared: u } = n, p = `${s}/v1/lens`;
|
|
@@ -151,7 +151,7 @@ async function Se(s, n, a) {
|
|
|
151
151
|
operation: "update"
|
|
152
152
|
});
|
|
153
153
|
}
|
|
154
|
-
async function
|
|
154
|
+
async function Pa(s, n, a) {
|
|
155
155
|
if (!a)
|
|
156
156
|
return null;
|
|
157
157
|
const t = `${s}/v1/lens`;
|
|
@@ -160,11 +160,11 @@ async function Ga(s, n, a) {
|
|
|
160
160
|
lensId: n
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
|
-
function
|
|
163
|
+
function Ga() {
|
|
164
164
|
const [s, n] = b(""), [a, t] = b(!1), l = y((C) => C.lenses), { setLenses: o, setSelectedLensId: c } = Xe(), [u, p] = b(!1), [f, d] = b(!1), m = y((C) => C.dashboard), g = y((C) => C.filterValues), { authToken: v, tokenProps: N } = U();
|
|
165
|
-
async function
|
|
165
|
+
async function x() {
|
|
166
166
|
p(!0);
|
|
167
|
-
const C = await
|
|
167
|
+
const C = await Ea(
|
|
168
168
|
N.apiServiceUrl,
|
|
169
169
|
s,
|
|
170
170
|
m,
|
|
@@ -174,8 +174,8 @@ function Fa() {
|
|
|
174
174
|
C && (o([...l || [], C]), c(C.id), d(!1)), p(!1);
|
|
175
175
|
}
|
|
176
176
|
return /* @__PURE__ */ r(ke, { open: f, onOpenChange: d, children: [
|
|
177
|
-
/* @__PURE__ */ e(
|
|
178
|
-
|
|
177
|
+
/* @__PURE__ */ e(zs, { asChild: !0, children: /* @__PURE__ */ r(
|
|
178
|
+
L,
|
|
179
179
|
{
|
|
180
180
|
variant: "secondary",
|
|
181
181
|
className: "h-7 p-2",
|
|
@@ -188,8 +188,8 @@ function Fa() {
|
|
|
188
188
|
) }),
|
|
189
189
|
/* @__PURE__ */ r(Ae, { className: "sm:max-w-[425px]", children: [
|
|
190
190
|
/* @__PURE__ */ r(Ie, { children: [
|
|
191
|
-
/* @__PURE__ */ e(
|
|
192
|
-
/* @__PURE__ */ e(
|
|
191
|
+
/* @__PURE__ */ e(Te, { children: "Create Lens" }),
|
|
192
|
+
/* @__PURE__ */ e(Ye, { children: "Lenses are private by default and are only visible to you." })
|
|
193
193
|
] }),
|
|
194
194
|
/* @__PURE__ */ e("div", { className: "grid gap-4 py-4", children: /* @__PURE__ */ r("div", { className: "grid grid-cols-8 items-center gap-4", children: [
|
|
195
195
|
/* @__PURE__ */ e(be, { className: "text-right", children: "Name" }),
|
|
@@ -207,12 +207,12 @@ function Fa() {
|
|
|
207
207
|
] }) }),
|
|
208
208
|
a && /* @__PURE__ */ e("p", { className: "text-sm", children: "The lens name already exists. Use a differnet name." }),
|
|
209
209
|
/* @__PURE__ */ e(js, { children: /* @__PURE__ */ e(
|
|
210
|
-
|
|
210
|
+
L,
|
|
211
211
|
{
|
|
212
212
|
size: "sm",
|
|
213
213
|
variant: "outline",
|
|
214
214
|
type: "submit",
|
|
215
|
-
onClick:
|
|
215
|
+
onClick: x,
|
|
216
216
|
disabled: u,
|
|
217
217
|
children: u ? "Creating..." : "Add"
|
|
218
218
|
}
|
|
@@ -220,23 +220,23 @@ function Fa() {
|
|
|
220
220
|
] })
|
|
221
221
|
] });
|
|
222
222
|
}
|
|
223
|
-
function
|
|
223
|
+
function Fa() {
|
|
224
224
|
const [s, n] = b(!1), a = y((m) => m.lenses), t = y((m) => m.selectedLensId), { setLenses: l, setSelectedLensId: o } = Xe(), { authToken: c, tokenProps: u } = U();
|
|
225
225
|
async function p(m) {
|
|
226
226
|
o(m);
|
|
227
227
|
}
|
|
228
228
|
async function f(m) {
|
|
229
|
-
if (await
|
|
229
|
+
if (await Pa(u.apiServiceUrl, m, c == null ? void 0 : c.accessToken)) {
|
|
230
230
|
const v = a == null ? void 0 : a.filter((N) => N.id !== m);
|
|
231
231
|
l(v || []), o("original");
|
|
232
232
|
}
|
|
233
233
|
}
|
|
234
234
|
async function d(m) {
|
|
235
|
-
const g = a == null ? void 0 : a.map((
|
|
236
|
-
...
|
|
235
|
+
const g = a == null ? void 0 : a.map((x) => x.id === m.id ? {
|
|
236
|
+
...x,
|
|
237
237
|
isDefault: !m.isDefault
|
|
238
238
|
} : {
|
|
239
|
-
...
|
|
239
|
+
...x,
|
|
240
240
|
isDefault: !1
|
|
241
241
|
});
|
|
242
242
|
l(g || []);
|
|
@@ -244,23 +244,23 @@ function Ra() {
|
|
|
244
244
|
...m,
|
|
245
245
|
isDefault: !m.isDefault
|
|
246
246
|
};
|
|
247
|
-
await
|
|
248
|
-
const N = a == null ? void 0 : a.find((
|
|
247
|
+
await De(u.apiServiceUrl, v, c == null ? void 0 : c.accessToken);
|
|
248
|
+
const N = a == null ? void 0 : a.find((x) => x.isDefault);
|
|
249
249
|
if (N && N.id !== m.id) {
|
|
250
|
-
const
|
|
250
|
+
const x = {
|
|
251
251
|
...N,
|
|
252
252
|
isDefault: !1
|
|
253
253
|
};
|
|
254
|
-
await
|
|
254
|
+
await De(u.apiServiceUrl, x, c == null ? void 0 : c.accessToken);
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
|
-
return /* @__PURE__ */ r(
|
|
258
|
-
/* @__PURE__ */ e(Je, { asChild: !0, children: /* @__PURE__ */ e(
|
|
257
|
+
return /* @__PURE__ */ r(Be, { open: s, onOpenChange: n, children: [
|
|
258
|
+
/* @__PURE__ */ e(Je, { asChild: !0, children: /* @__PURE__ */ e($, { tooltip: "Lenses", className: "h-7 p-2", children: /* @__PURE__ */ e(Da, { className: "h-4 w-4" }) }) }),
|
|
259
259
|
/* @__PURE__ */ r(We, { align: "end", className: "w-60", children: [
|
|
260
260
|
/* @__PURE__ */ e(Vs, { className: "px-3", children: "Lenses" }),
|
|
261
|
-
/* @__PURE__ */ e(
|
|
261
|
+
/* @__PURE__ */ e(Hs, {}),
|
|
262
262
|
/* @__PURE__ */ r(
|
|
263
|
-
|
|
263
|
+
Qs,
|
|
264
264
|
{
|
|
265
265
|
value: t,
|
|
266
266
|
onValueChange: p,
|
|
@@ -275,12 +275,12 @@ function Ra() {
|
|
|
275
275
|
/* @__PURE__ */ e("p", { children: m.name }),
|
|
276
276
|
/* @__PURE__ */ r("span", { className: "flex items-center gap-3", children: [
|
|
277
277
|
/* @__PURE__ */ e(
|
|
278
|
-
|
|
278
|
+
Ze,
|
|
279
279
|
{
|
|
280
280
|
onClick: (g) => {
|
|
281
281
|
g.preventDefault(), d(m);
|
|
282
282
|
},
|
|
283
|
-
className:
|
|
283
|
+
className: ie(
|
|
284
284
|
"size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
|
|
285
285
|
{
|
|
286
286
|
invisible: !m.isDefault,
|
|
@@ -311,35 +311,10 @@ function Ra() {
|
|
|
311
311
|
] })
|
|
312
312
|
] });
|
|
313
313
|
}
|
|
314
|
-
|
|
315
|
-
iconClassName: s
|
|
316
|
-
}) {
|
|
317
|
-
const [n, a] = b(!1), t = y((l) => l.isDownloadingPdf);
|
|
318
|
-
return /* @__PURE__ */ r(E, { children: [
|
|
319
|
-
/* @__PURE__ */ e(
|
|
320
|
-
k,
|
|
321
|
-
{
|
|
322
|
-
variant: "ghost",
|
|
323
|
-
size: "sm",
|
|
324
|
-
className: "h-7 p-2",
|
|
325
|
-
disabled: t,
|
|
326
|
-
onClick: () => a(!0),
|
|
327
|
-
children: /* @__PURE__ */ e(Bs, { className: Z("size-4", s) })
|
|
328
|
-
}
|
|
329
|
-
),
|
|
330
|
-
/* @__PURE__ */ e(
|
|
331
|
-
Na,
|
|
332
|
-
{
|
|
333
|
-
open: n,
|
|
334
|
-
onOpenChange: a
|
|
335
|
-
}
|
|
336
|
-
)
|
|
337
|
-
] });
|
|
338
|
-
}
|
|
339
|
-
const Ua = async (s, n, a) => {
|
|
314
|
+
const Ra = async (s, n, a) => {
|
|
340
315
|
const t = `${s}/management/v1/groups`;
|
|
341
316
|
return await ss(t, n, a);
|
|
342
|
-
},
|
|
317
|
+
}, Oa = async (s, n, a) => {
|
|
343
318
|
const t = `${s}/management/v1/groups/${a}`, l = await fetch(t, {
|
|
344
319
|
method: "DELETE",
|
|
345
320
|
headers: {
|
|
@@ -350,10 +325,10 @@ const Ua = async (s, n, a) => {
|
|
|
350
325
|
const o = await l.text();
|
|
351
326
|
throw new Error(o || "Failed to delete group");
|
|
352
327
|
}
|
|
353
|
-
},
|
|
328
|
+
}, Ua = async (s, n, a, t) => {
|
|
354
329
|
const l = `${s}/management/v1/groups/${a}/members`;
|
|
355
330
|
return await ss(l, n, t);
|
|
356
|
-
},
|
|
331
|
+
}, _a = async (s, n, a, t) => {
|
|
357
332
|
const l = `${s}/management/v1/groups/${a}/members`, o = await fetch(l, {
|
|
358
333
|
method: "DELETE",
|
|
359
334
|
headers: {
|
|
@@ -367,78 +342,78 @@ const Ua = async (s, n, a) => {
|
|
|
367
342
|
throw new Error(c || "Failed to remove group members");
|
|
368
343
|
}
|
|
369
344
|
};
|
|
370
|
-
function
|
|
345
|
+
function $a() {
|
|
371
346
|
const { authToken: s, tokenProps: n } = U(), a = le();
|
|
372
347
|
return ce({
|
|
373
|
-
mutationFn: (t) =>
|
|
348
|
+
mutationFn: (t) => Ra(n.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t),
|
|
374
349
|
onSuccess: () => {
|
|
375
|
-
a.invalidateQueries({ queryKey: ["groups"] }),
|
|
350
|
+
a.invalidateQueries({ queryKey: ["groups"] }), k.success("Group created successfully");
|
|
376
351
|
},
|
|
377
352
|
onError: (t) => {
|
|
378
|
-
console.error("Failed to create group:", t),
|
|
353
|
+
console.error("Failed to create group:", t), k.error("Failed to create group", {
|
|
379
354
|
description: t.message
|
|
380
355
|
});
|
|
381
356
|
}
|
|
382
357
|
});
|
|
383
358
|
}
|
|
384
|
-
function
|
|
359
|
+
function qa() {
|
|
385
360
|
const { authToken: s, tokenProps: n } = U(), a = le();
|
|
386
361
|
return ce({
|
|
387
|
-
mutationFn: (t) =>
|
|
362
|
+
mutationFn: (t) => Oa(n.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t),
|
|
388
363
|
onSuccess: (t, l) => {
|
|
389
|
-
a.invalidateQueries({ queryKey: ["groups"] }), a.removeQueries({ queryKey: ["group", l] }),
|
|
364
|
+
a.invalidateQueries({ queryKey: ["groups"] }), a.removeQueries({ queryKey: ["group", l] }), k.success("Group deleted successfully");
|
|
390
365
|
},
|
|
391
366
|
onError: (t) => {
|
|
392
|
-
console.error("Failed to delete group:", t),
|
|
367
|
+
console.error("Failed to delete group:", t), k.error("Failed to delete group", {
|
|
393
368
|
description: t.message
|
|
394
369
|
});
|
|
395
370
|
}
|
|
396
371
|
});
|
|
397
372
|
}
|
|
398
|
-
function
|
|
373
|
+
function za() {
|
|
399
374
|
const { authToken: s, tokenProps: n } = U(), a = le();
|
|
400
375
|
return ce({
|
|
401
376
|
mutationFn: ({
|
|
402
377
|
groupId: t,
|
|
403
378
|
data: l
|
|
404
|
-
}) =>
|
|
379
|
+
}) => Ua(n.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t, l),
|
|
405
380
|
onSuccess: (t, l) => {
|
|
406
381
|
a.invalidateQueries({ queryKey: ["group", l.groupId] }), a.invalidateQueries({
|
|
407
382
|
queryKey: ["group-members", l.groupId]
|
|
408
|
-
}), a.invalidateQueries({ queryKey: ["groups"] }),
|
|
383
|
+
}), a.invalidateQueries({ queryKey: ["groups"] }), k.success("Members added successfully");
|
|
409
384
|
},
|
|
410
385
|
onError: (t) => {
|
|
411
|
-
console.error("Failed to add group members:", t),
|
|
386
|
+
console.error("Failed to add group members:", t), k.error("Failed to add members", {
|
|
412
387
|
description: t.message
|
|
413
388
|
});
|
|
414
389
|
}
|
|
415
390
|
});
|
|
416
391
|
}
|
|
417
|
-
function
|
|
392
|
+
function ja() {
|
|
418
393
|
const { authToken: s, tokenProps: n } = U(), a = le();
|
|
419
394
|
return ce({
|
|
420
395
|
mutationFn: ({
|
|
421
396
|
groupId: t,
|
|
422
397
|
data: l
|
|
423
|
-
}) =>
|
|
398
|
+
}) => _a(n.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t, l),
|
|
424
399
|
onSuccess: (t, l) => {
|
|
425
400
|
a.invalidateQueries({ queryKey: ["group", l.groupId] }), a.invalidateQueries({
|
|
426
401
|
queryKey: ["group-members", l.groupId]
|
|
427
|
-
}), a.invalidateQueries({ queryKey: ["groups"] }),
|
|
402
|
+
}), a.invalidateQueries({ queryKey: ["groups"] }), k.success("Members removed successfully");
|
|
428
403
|
},
|
|
429
404
|
onError: (t) => {
|
|
430
|
-
console.error("Failed to remove group members:", t),
|
|
405
|
+
console.error("Failed to remove group members:", t), k.error("Failed to remove members", {
|
|
431
406
|
description: t.message
|
|
432
407
|
});
|
|
433
408
|
}
|
|
434
409
|
});
|
|
435
410
|
}
|
|
436
|
-
function
|
|
411
|
+
function Va({
|
|
437
412
|
onSuccess: s,
|
|
438
413
|
tenantId: n,
|
|
439
414
|
isTenantUser: a
|
|
440
415
|
}) {
|
|
441
|
-
const [t, l] = b(""), [o, c] = b(""), [u, p] = b({}), f =
|
|
416
|
+
const [t, l] = b(""), [o, c] = b(""), [u, p] = b({}), f = $a(), d = () => {
|
|
442
417
|
const g = {};
|
|
443
418
|
return t.trim() ? t.length < 3 ? g.name = "Group name must be at least 3 characters" : t.length > 50 && (g.name = "Group name must be less than 50 characters") : g.name = "Group name is required", o && o.length > 200 && (g.description = "Description must be less than 200 characters"), p(g), Object.keys(g).length === 0;
|
|
444
419
|
};
|
|
@@ -503,13 +478,13 @@ function Ha({
|
|
|
503
478
|
] })
|
|
504
479
|
] }),
|
|
505
480
|
/* @__PURE__ */ e("div", { className: "rounded-lg border bg-muted/50 p-4", children: /* @__PURE__ */ r("div", { className: "flex gap-3", children: [
|
|
506
|
-
/* @__PURE__ */ e(
|
|
481
|
+
/* @__PURE__ */ e(Bs, { className: "h-4 w-4 mt-0.5 text-muted-foreground" }),
|
|
507
482
|
/* @__PURE__ */ e("div", { className: "text-sm text-muted-foreground", children: "This group will be accessible to users in your workspace. You can add members after creating the group." })
|
|
508
483
|
] }) })
|
|
509
484
|
] }),
|
|
510
485
|
/* @__PURE__ */ r("div", { className: "flex justify-end gap-3", children: [
|
|
511
486
|
/* @__PURE__ */ e(
|
|
512
|
-
|
|
487
|
+
L,
|
|
513
488
|
{
|
|
514
489
|
type: "button",
|
|
515
490
|
variant: "outline",
|
|
@@ -521,15 +496,15 @@ function Ha({
|
|
|
521
496
|
}
|
|
522
497
|
),
|
|
523
498
|
/* @__PURE__ */ e(
|
|
524
|
-
|
|
499
|
+
L,
|
|
525
500
|
{
|
|
526
501
|
type: "submit",
|
|
527
502
|
disabled: f.isPending || !t.trim(),
|
|
528
503
|
children: f.isPending ? /* @__PURE__ */ r(E, { children: [
|
|
529
|
-
/* @__PURE__ */ e(
|
|
504
|
+
/* @__PURE__ */ e(q, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
530
505
|
"Creating..."
|
|
531
506
|
] }) : /* @__PURE__ */ r(E, { children: [
|
|
532
|
-
/* @__PURE__ */ e(
|
|
507
|
+
/* @__PURE__ */ e(z, { className: "mr-2 h-4 w-4" }),
|
|
533
508
|
"Create Group"
|
|
534
509
|
] })
|
|
535
510
|
}
|
|
@@ -537,7 +512,7 @@ function Ha({
|
|
|
537
512
|
] })
|
|
538
513
|
] });
|
|
539
514
|
}
|
|
540
|
-
function
|
|
515
|
+
function Ha(s, n = []) {
|
|
541
516
|
let a = [];
|
|
542
517
|
function t(o, c) {
|
|
543
518
|
const u = M.createContext(c);
|
|
@@ -546,13 +521,13 @@ function Ba(s, n = []) {
|
|
|
546
521
|
a = [...a, c];
|
|
547
522
|
const f = (m) => {
|
|
548
523
|
var R;
|
|
549
|
-
const { scope: g, children: v, ...N } = m,
|
|
550
|
-
return /* @__PURE__ */ e(
|
|
524
|
+
const { scope: g, children: v, ...N } = m, x = ((R = g == null ? void 0 : g[s]) == null ? void 0 : R[p]) || u, C = M.useMemo(() => N, Object.values(N));
|
|
525
|
+
return /* @__PURE__ */ e(x.Provider, { value: C, children: v });
|
|
551
526
|
};
|
|
552
527
|
f.displayName = o + "Provider";
|
|
553
528
|
function d(m, g) {
|
|
554
|
-
var
|
|
555
|
-
const v = ((
|
|
529
|
+
var x;
|
|
530
|
+
const v = ((x = g == null ? void 0 : g[s]) == null ? void 0 : x[p]) || u, N = M.useContext(v);
|
|
556
531
|
if (N) return N;
|
|
557
532
|
if (c !== void 0) return c;
|
|
558
533
|
throw new Error(`\`${m}\` must be used within \`${o}\``);
|
|
@@ -569,9 +544,9 @@ function Ba(s, n = []) {
|
|
|
569
544
|
);
|
|
570
545
|
};
|
|
571
546
|
};
|
|
572
|
-
return l.scopeName = s, [t,
|
|
547
|
+
return l.scopeName = s, [t, Qa(l, ...n)];
|
|
573
548
|
}
|
|
574
|
-
function
|
|
549
|
+
function Qa(...s) {
|
|
575
550
|
const n = s[0];
|
|
576
551
|
if (s.length === 1) return n;
|
|
577
552
|
const a = () => {
|
|
@@ -589,7 +564,7 @@ function Ka(...s) {
|
|
|
589
564
|
};
|
|
590
565
|
return a.scopeName = n.scopeName, a;
|
|
591
566
|
}
|
|
592
|
-
var
|
|
567
|
+
var Ka = [
|
|
593
568
|
"a",
|
|
594
569
|
"button",
|
|
595
570
|
"div",
|
|
@@ -607,34 +582,34 @@ var Ja = [
|
|
|
607
582
|
"span",
|
|
608
583
|
"svg",
|
|
609
584
|
"ul"
|
|
610
|
-
],
|
|
611
|
-
const a =
|
|
585
|
+
], Ee = Ka.reduce((s, n) => {
|
|
586
|
+
const a = Js(`Primitive.${n}`), t = M.forwardRef((l, o) => {
|
|
612
587
|
const { asChild: c, ...u } = l, p = c ? a : n;
|
|
613
588
|
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ e(p, { ...u, ref: o });
|
|
614
589
|
});
|
|
615
590
|
return t.displayName = `Primitive.${n}`, { ...s, [n]: t };
|
|
616
591
|
}, {});
|
|
617
|
-
function
|
|
618
|
-
return
|
|
619
|
-
|
|
592
|
+
function Ba() {
|
|
593
|
+
return Ia.useSyncExternalStore(
|
|
594
|
+
Ja,
|
|
620
595
|
() => !0,
|
|
621
596
|
() => !1
|
|
622
597
|
);
|
|
623
598
|
}
|
|
624
|
-
function
|
|
599
|
+
function Ja() {
|
|
625
600
|
return () => {
|
|
626
601
|
};
|
|
627
602
|
}
|
|
628
|
-
var Pe = "Avatar", [
|
|
603
|
+
var Pe = "Avatar", [Wa] = Ha(Pe), [Xa, ps] = Wa(Pe), gs = M.forwardRef(
|
|
629
604
|
(s, n) => {
|
|
630
605
|
const { __scopeAvatar: a, ...t } = s, [l, o] = M.useState("idle");
|
|
631
606
|
return /* @__PURE__ */ e(
|
|
632
|
-
|
|
607
|
+
Xa,
|
|
633
608
|
{
|
|
634
609
|
scope: a,
|
|
635
610
|
imageLoadingStatus: l,
|
|
636
611
|
onImageLoadingStatusChange: o,
|
|
637
|
-
children: /* @__PURE__ */ e(
|
|
612
|
+
children: /* @__PURE__ */ e(Ee.span, { ...t, ref: n })
|
|
638
613
|
}
|
|
639
614
|
);
|
|
640
615
|
}
|
|
@@ -643,12 +618,12 @@ gs.displayName = Pe;
|
|
|
643
618
|
var fs = "AvatarImage", vs = M.forwardRef(
|
|
644
619
|
(s, n) => {
|
|
645
620
|
const { __scopeAvatar: a, src: t, onLoadingStatusChange: l = () => {
|
|
646
|
-
}, ...o } = s, c = ps(fs, a), u =
|
|
621
|
+
}, ...o } = s, c = ps(fs, a), u = Ya(t, o), p = Ws((f) => {
|
|
647
622
|
l(f), c.onImageLoadingStatusChange(f);
|
|
648
623
|
});
|
|
649
624
|
return Ne(() => {
|
|
650
625
|
u !== "idle" && p(u);
|
|
651
|
-
}, [u, p]), u === "loaded" ? /* @__PURE__ */ e(
|
|
626
|
+
}, [u, p]), u === "loaded" ? /* @__PURE__ */ e(Ee.img, { ...o, ref: n, src: t }) : null;
|
|
652
627
|
}
|
|
653
628
|
);
|
|
654
629
|
vs.displayName = fs;
|
|
@@ -660,19 +635,19 @@ var bs = "AvatarFallback", Ns = M.forwardRef(
|
|
|
660
635
|
const p = window.setTimeout(() => u(!0), t);
|
|
661
636
|
return () => window.clearTimeout(p);
|
|
662
637
|
}
|
|
663
|
-
}, [t]), c && o.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(
|
|
638
|
+
}, [t]), c && o.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(Ee.span, { ...l, ref: n }) : null;
|
|
664
639
|
}
|
|
665
640
|
);
|
|
666
641
|
Ns.displayName = bs;
|
|
667
|
-
function
|
|
642
|
+
function Ke(s, n) {
|
|
668
643
|
return s ? n ? (s.src !== n && (s.src = n), s.complete && s.naturalWidth > 0 ? "loaded" : "loading") : "error" : "idle";
|
|
669
644
|
}
|
|
670
|
-
function
|
|
671
|
-
const t =
|
|
672
|
-
() =>
|
|
645
|
+
function Ya(s, { referrerPolicy: n, crossOrigin: a }) {
|
|
646
|
+
const t = Ba(), l = M.useRef(null), o = t ? (l.current || (l.current = new window.Image()), l.current) : null, [c, u] = M.useState(
|
|
647
|
+
() => Ke(o, s)
|
|
673
648
|
);
|
|
674
649
|
return Ne(() => {
|
|
675
|
-
u(
|
|
650
|
+
u(Ke(o, s));
|
|
676
651
|
}, [o, s]), Ne(() => {
|
|
677
652
|
const p = (m) => () => {
|
|
678
653
|
u(m);
|
|
@@ -684,12 +659,12 @@ function et(s, { referrerPolicy: n, crossOrigin: a }) {
|
|
|
684
659
|
};
|
|
685
660
|
}, [o, a, n]), c;
|
|
686
661
|
}
|
|
687
|
-
var ys = gs,
|
|
662
|
+
var ys = gs, xs = vs, ws = Ns;
|
|
688
663
|
const Ge = M.forwardRef(({ className: s, ...n }, a) => /* @__PURE__ */ e(
|
|
689
664
|
ys,
|
|
690
665
|
{
|
|
691
666
|
ref: a,
|
|
692
|
-
className:
|
|
667
|
+
className: ie(
|
|
693
668
|
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
|
|
694
669
|
s
|
|
695
670
|
),
|
|
@@ -697,54 +672,54 @@ const Ge = M.forwardRef(({ className: s, ...n }, a) => /* @__PURE__ */ e(
|
|
|
697
672
|
}
|
|
698
673
|
));
|
|
699
674
|
Ge.displayName = ys.displayName;
|
|
700
|
-
const
|
|
701
|
-
|
|
675
|
+
const Za = M.forwardRef(({ className: s, ...n }, a) => /* @__PURE__ */ e(
|
|
676
|
+
xs,
|
|
702
677
|
{
|
|
703
678
|
ref: a,
|
|
704
|
-
className:
|
|
679
|
+
className: ie("aspect-square h-full w-full", s),
|
|
705
680
|
...n
|
|
706
681
|
}
|
|
707
682
|
));
|
|
708
|
-
|
|
683
|
+
Za.displayName = xs.displayName;
|
|
709
684
|
const Fe = M.forwardRef(({ className: s, ...n }, a) => /* @__PURE__ */ e(
|
|
710
|
-
|
|
685
|
+
ws,
|
|
711
686
|
{
|
|
712
687
|
ref: a,
|
|
713
|
-
className:
|
|
688
|
+
className: ie(
|
|
714
689
|
"flex h-full w-full items-center justify-center rounded-full bg-muted",
|
|
715
690
|
s
|
|
716
691
|
),
|
|
717
692
|
...n
|
|
718
693
|
}
|
|
719
694
|
));
|
|
720
|
-
Fe.displayName =
|
|
721
|
-
function
|
|
695
|
+
Fe.displayName = ws.displayName;
|
|
696
|
+
function et({
|
|
722
697
|
open: s,
|
|
723
698
|
onOpenChange: n,
|
|
724
699
|
group: a,
|
|
725
700
|
onUpdate: t
|
|
726
701
|
}) {
|
|
727
|
-
const [l, o] = b("members"), [c, u] = b(""), [p, f] = b([]), [d, m] = b([]), { data: g, isLoading: v, refetch: N } =
|
|
728
|
-
type:
|
|
702
|
+
const [l, o] = b("members"), [c, u] = b(""), [p, f] = b([]), [d, m] = b([]), { data: g, isLoading: v, refetch: N } = Xs(a.id), x = a.type === "TENANT_GROUP" ? "tenant" : "organization", { users: C, isLoading: R } = Ys({
|
|
703
|
+
type: x,
|
|
729
704
|
tenantId: a.tenantId || void 0,
|
|
730
705
|
active: !0,
|
|
731
706
|
limit: 100
|
|
732
|
-
}), O =
|
|
707
|
+
}), O = za(), G = ja(), A = (g == null ? void 0 : g.members) || [], F = re(() => new Set(A.map((h) => h.userId)), [A]), P = re(() => C.filter((h) => !F.has(h.id)), [C, F]), j = re(() => {
|
|
733
708
|
if (!c) return P;
|
|
734
709
|
const h = c.toLowerCase();
|
|
735
710
|
return P.filter(
|
|
736
|
-
(
|
|
737
|
-
var I,
|
|
738
|
-
return ((I =
|
|
711
|
+
(D) => {
|
|
712
|
+
var I, _;
|
|
713
|
+
return ((I = D.name) == null ? void 0 : I.toLowerCase().includes(h)) || ((_ = D.email) == null ? void 0 : _.toLowerCase().includes(h));
|
|
739
714
|
}
|
|
740
715
|
);
|
|
741
|
-
}, [P, c]),
|
|
716
|
+
}, [P, c]), w = re(() => {
|
|
742
717
|
if (!c) return A;
|
|
743
718
|
const h = c.toLowerCase();
|
|
744
719
|
return A.filter(
|
|
745
|
-
(
|
|
746
|
-
var I,
|
|
747
|
-
return ((
|
|
720
|
+
(D) => {
|
|
721
|
+
var I, _, Y, H;
|
|
722
|
+
return ((_ = (I = D.user) == null ? void 0 : I.name) == null ? void 0 : _.toLowerCase().includes(h)) || ((H = (Y = D.user) == null ? void 0 : Y.email) == null ? void 0 : H.toLowerCase().includes(h));
|
|
748
723
|
}
|
|
749
724
|
);
|
|
750
725
|
}, [A, c]), V = async () => {
|
|
@@ -754,7 +729,7 @@ function at({
|
|
|
754
729
|
groupId: a.id,
|
|
755
730
|
data: {
|
|
756
731
|
userIds: p,
|
|
757
|
-
userType:
|
|
732
|
+
userType: x === "tenant" ? "tenant" : "org"
|
|
758
733
|
}
|
|
759
734
|
}), f([]), o("members"), N(), t == null || t();
|
|
760
735
|
} catch (h) {
|
|
@@ -774,16 +749,16 @@ function at({
|
|
|
774
749
|
}
|
|
775
750
|
}, ue = (h) => {
|
|
776
751
|
f(
|
|
777
|
-
(
|
|
752
|
+
(D) => D.includes(h) ? D.filter((I) => I !== h) : [...D, h]
|
|
778
753
|
);
|
|
779
|
-
},
|
|
754
|
+
}, S = (h) => {
|
|
780
755
|
m(
|
|
781
|
-
(
|
|
756
|
+
(D) => D.includes(h) ? D.filter((I) => I !== h) : [...D, h]
|
|
782
757
|
);
|
|
783
758
|
};
|
|
784
759
|
return /* @__PURE__ */ e(E, { children: /* @__PURE__ */ e(ke, { open: s, onOpenChange: n, children: /* @__PURE__ */ r(Ae, { className: "max-w-3xl max-h-[80vh]", "aria-describedby": "group-members-description", children: [
|
|
785
760
|
/* @__PURE__ */ r(Ie, { children: [
|
|
786
|
-
/* @__PURE__ */ e(
|
|
761
|
+
/* @__PURE__ */ e(Te, { children: a.name }),
|
|
787
762
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2 mt-1", children: /* @__PURE__ */ r("p", { className: "text-sm text-muted-foreground", children: [
|
|
788
763
|
A.length,
|
|
789
764
|
" ",
|
|
@@ -799,10 +774,10 @@ function at({
|
|
|
799
774
|
o(h), u(""), m([]);
|
|
800
775
|
}, className: "mt-4", children: [
|
|
801
776
|
/* @__PURE__ */ r(ts, { className: "grid w-full grid-cols-2", children: [
|
|
802
|
-
/* @__PURE__ */ e(
|
|
803
|
-
/* @__PURE__ */ e(
|
|
777
|
+
/* @__PURE__ */ e(ne, { value: "members", children: "Current Members" }),
|
|
778
|
+
/* @__PURE__ */ e(ne, { value: "add", children: "Add Members" })
|
|
804
779
|
] }),
|
|
805
|
-
/* @__PURE__ */ r(
|
|
780
|
+
/* @__PURE__ */ r(oe, { value: "members", className: "mt-4 space-y-4", children: [
|
|
806
781
|
/* @__PURE__ */ r("div", { className: "relative", children: [
|
|
807
782
|
/* @__PURE__ */ e(ye, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
808
783
|
/* @__PURE__ */ e(
|
|
@@ -815,16 +790,16 @@ function at({
|
|
|
815
790
|
}
|
|
816
791
|
)
|
|
817
792
|
] }),
|
|
818
|
-
/* @__PURE__ */ e(
|
|
819
|
-
/* @__PURE__ */ e(
|
|
793
|
+
/* @__PURE__ */ e(xe, { className: d.length > 0 ? "h-[300px]" : "h-[350px]", children: v ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((h) => /* @__PURE__ */ e(we, { className: "h-16 w-full" }, h)) }) : w.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
|
|
794
|
+
/* @__PURE__ */ e(z, { className: "h-12 w-12 mb-3 opacity-50" }),
|
|
820
795
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: c ? "No members found" : "No members yet" }),
|
|
821
796
|
/* @__PURE__ */ e("p", { className: "text-xs mt-1", children: c ? "Try a different search" : 'Switch to the "Add Members" tab to add people to this group' })
|
|
822
|
-
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children:
|
|
823
|
-
|
|
797
|
+
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: w.map((h) => /* @__PURE__ */ e(
|
|
798
|
+
st,
|
|
824
799
|
{
|
|
825
800
|
member: h,
|
|
826
801
|
selected: d.includes(h.userId),
|
|
827
|
-
onToggle: () =>
|
|
802
|
+
onToggle: () => S(h.userId)
|
|
828
803
|
},
|
|
829
804
|
h.id
|
|
830
805
|
)) }) }),
|
|
@@ -836,14 +811,14 @@ function at({
|
|
|
836
811
|
" selected"
|
|
837
812
|
] }),
|
|
838
813
|
/* @__PURE__ */ e(
|
|
839
|
-
|
|
814
|
+
L,
|
|
840
815
|
{
|
|
841
816
|
variant: "destructive",
|
|
842
817
|
size: "sm",
|
|
843
818
|
onClick: de,
|
|
844
819
|
disabled: G.isPending,
|
|
845
820
|
children: G.isPending ? /* @__PURE__ */ r(E, { children: [
|
|
846
|
-
/* @__PURE__ */ e(
|
|
821
|
+
/* @__PURE__ */ e(q, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
847
822
|
"Removing..."
|
|
848
823
|
] }) : /* @__PURE__ */ r(E, { children: [
|
|
849
824
|
/* @__PURE__ */ e(rs, { className: "mr-2 h-4 w-4" }),
|
|
@@ -853,7 +828,7 @@ function at({
|
|
|
853
828
|
)
|
|
854
829
|
] })
|
|
855
830
|
] }),
|
|
856
|
-
/* @__PURE__ */ r(
|
|
831
|
+
/* @__PURE__ */ r(oe, { value: "add", className: "mt-4 space-y-4", children: [
|
|
857
832
|
/* @__PURE__ */ r("div", { className: "relative", children: [
|
|
858
833
|
/* @__PURE__ */ e(ye, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
859
834
|
/* @__PURE__ */ e(
|
|
@@ -866,12 +841,12 @@ function at({
|
|
|
866
841
|
}
|
|
867
842
|
)
|
|
868
843
|
] }),
|
|
869
|
-
/* @__PURE__ */ e(
|
|
844
|
+
/* @__PURE__ */ e(xe, { className: "h-[300px]", children: R ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((h) => /* @__PURE__ */ e(we, { className: "h-16 w-full" }, h)) }) : j.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
|
|
870
845
|
/* @__PURE__ */ e(Ce, { className: "h-12 w-12 mb-3 opacity-50" }),
|
|
871
846
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: "No available users" }),
|
|
872
847
|
/* @__PURE__ */ e("p", { className: "text-xs mt-1", children: c ? "Try a different search" : "All eligible users are already members" })
|
|
873
848
|
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: j.map((h) => /* @__PURE__ */ e(
|
|
874
|
-
|
|
849
|
+
at,
|
|
875
850
|
{
|
|
876
851
|
user: h,
|
|
877
852
|
selected: p.includes(h.id),
|
|
@@ -887,12 +862,12 @@ function at({
|
|
|
887
862
|
" selected"
|
|
888
863
|
] }),
|
|
889
864
|
/* @__PURE__ */ e(
|
|
890
|
-
|
|
865
|
+
L,
|
|
891
866
|
{
|
|
892
867
|
onClick: V,
|
|
893
868
|
disabled: O.isPending,
|
|
894
869
|
children: O.isPending ? /* @__PURE__ */ r(E, { children: [
|
|
895
|
-
/* @__PURE__ */ e(
|
|
870
|
+
/* @__PURE__ */ e(q, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
896
871
|
"Adding..."
|
|
897
872
|
] }) : /* @__PURE__ */ r(E, { children: [
|
|
898
873
|
/* @__PURE__ */ e(Ce, { className: "mr-2 h-4 w-4" }),
|
|
@@ -905,7 +880,7 @@ function at({
|
|
|
905
880
|
] })
|
|
906
881
|
] }) }) });
|
|
907
882
|
}
|
|
908
|
-
function
|
|
883
|
+
function st({
|
|
909
884
|
member: s,
|
|
910
885
|
selected: n,
|
|
911
886
|
onToggle: a
|
|
@@ -928,7 +903,7 @@ function tt({
|
|
|
928
903
|
}
|
|
929
904
|
);
|
|
930
905
|
}
|
|
931
|
-
function
|
|
906
|
+
function at({
|
|
932
907
|
user: s,
|
|
933
908
|
selected: n,
|
|
934
909
|
onToggle: a
|
|
@@ -951,52 +926,52 @@ function rt({
|
|
|
951
926
|
}
|
|
952
927
|
);
|
|
953
928
|
}
|
|
954
|
-
function
|
|
929
|
+
function tt({
|
|
955
930
|
open: s,
|
|
956
931
|
onOpenChange: n
|
|
957
932
|
}) {
|
|
958
|
-
const [a, t] = b("groups"), [l, o] = b(""), [c, u] = b(null), [p, f] = b(!1), [d, m] = b(null), { tokenProps: g } = U(), { currentUser: v } = os(), N =
|
|
959
|
-
type:
|
|
960
|
-
tenantId:
|
|
933
|
+
const [a, t] = b("groups"), [l, o] = b(""), [c, u] = b(null), [p, f] = b(!1), [d, m] = b(null), { tokenProps: g } = U(), { currentUser: v } = os(), N = qa(), x = (v == null ? void 0 : v.type) === "tenant", C = g == null ? void 0 : g.tenantId, { groups: R, isLoading: O, refetch: G } = Zs({
|
|
934
|
+
type: x ? "TENANT_GROUP" : "all",
|
|
935
|
+
tenantId: x ? C : void 0,
|
|
961
936
|
includeMembers: !1
|
|
962
937
|
}), A = R.filter(
|
|
963
|
-
(
|
|
938
|
+
(w) => {
|
|
964
939
|
var V;
|
|
965
|
-
return
|
|
940
|
+
return w.name.toLowerCase().includes(l.toLowerCase()) || ((V = w.description) == null ? void 0 : V.toLowerCase().includes(l.toLowerCase()));
|
|
966
941
|
}
|
|
967
942
|
), F = async () => {
|
|
968
943
|
if (d)
|
|
969
944
|
try {
|
|
970
945
|
await N.mutateAsync(d.id), m(null), G();
|
|
971
|
-
} catch (
|
|
972
|
-
console.error("Failed to delete group:",
|
|
946
|
+
} catch (w) {
|
|
947
|
+
console.error("Failed to delete group:", w);
|
|
973
948
|
}
|
|
974
|
-
}, P = (
|
|
975
|
-
u(
|
|
949
|
+
}, P = (w) => {
|
|
950
|
+
u(w), f(!0);
|
|
976
951
|
}, j = () => {
|
|
977
952
|
t("groups"), G();
|
|
978
953
|
};
|
|
979
954
|
return /* @__PURE__ */ r(E, { children: [
|
|
980
955
|
/* @__PURE__ */ e(ke, { open: s, onOpenChange: n, children: /* @__PURE__ */ r(Ae, { className: "max-w-4xl max-h-[80vh]", children: [
|
|
981
956
|
/* @__PURE__ */ r(Ie, { children: [
|
|
982
|
-
/* @__PURE__ */ r(
|
|
983
|
-
/* @__PURE__ */ e(
|
|
957
|
+
/* @__PURE__ */ r(Te, { className: "flex items-center gap-2", children: [
|
|
958
|
+
/* @__PURE__ */ e(z, { className: "h-5 w-5" }),
|
|
984
959
|
"Group Management"
|
|
985
960
|
] }),
|
|
986
|
-
/* @__PURE__ */ e(
|
|
961
|
+
/* @__PURE__ */ e(Ye, { children: "Manage your groups, create new groups, and control group membership" })
|
|
987
962
|
] }),
|
|
988
963
|
/* @__PURE__ */ r(as, { value: a, onValueChange: t, className: "mt-4", children: [
|
|
989
964
|
/* @__PURE__ */ r(ts, { className: "grid w-full grid-cols-2", children: [
|
|
990
|
-
/* @__PURE__ */ r(
|
|
991
|
-
/* @__PURE__ */ e(
|
|
965
|
+
/* @__PURE__ */ r(ne, { value: "groups", className: "flex items-center gap-2", children: [
|
|
966
|
+
/* @__PURE__ */ e(z, { className: "h-4 w-4" }),
|
|
992
967
|
"Groups"
|
|
993
968
|
] }),
|
|
994
|
-
/* @__PURE__ */ r(
|
|
969
|
+
/* @__PURE__ */ r(ne, { value: "create", className: "flex items-center gap-2", children: [
|
|
995
970
|
/* @__PURE__ */ e(Le, { className: "h-4 w-4" }),
|
|
996
971
|
"Create Group"
|
|
997
972
|
] })
|
|
998
973
|
] }),
|
|
999
|
-
/* @__PURE__ */ e(
|
|
974
|
+
/* @__PURE__ */ e(oe, { value: "groups", className: "mt-4", children: /* @__PURE__ */ r("div", { className: "space-y-4", children: [
|
|
1000
975
|
/* @__PURE__ */ r("div", { className: "relative", children: [
|
|
1001
976
|
/* @__PURE__ */ e(ye, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
1002
977
|
/* @__PURE__ */ e(
|
|
@@ -1004,38 +979,38 @@ function nt({
|
|
|
1004
979
|
{
|
|
1005
980
|
placeholder: "Search groups...",
|
|
1006
981
|
value: l,
|
|
1007
|
-
onChange: (
|
|
982
|
+
onChange: (w) => o(w.target.value),
|
|
1008
983
|
className: "pl-10"
|
|
1009
984
|
}
|
|
1010
985
|
)
|
|
1011
986
|
] }),
|
|
1012
|
-
/* @__PURE__ */ e(
|
|
1013
|
-
/* @__PURE__ */ e(
|
|
987
|
+
/* @__PURE__ */ e(xe, { className: "h-[400px]", children: O ? /* @__PURE__ */ e("div", { className: "space-y-3", children: [1, 2, 3].map((w) => /* @__PURE__ */ e(we, { className: "h-24 w-full" }, w)) }) : A.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
|
|
988
|
+
/* @__PURE__ */ e(z, { className: "h-12 w-12 mb-3 opacity-50" }),
|
|
1014
989
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: "No groups found" }),
|
|
1015
990
|
/* @__PURE__ */ e("p", { className: "text-xs mt-1", children: l ? "Try a different search" : "Create your first group to get started" })
|
|
1016
|
-
] }) : /* @__PURE__ */ e("div", { className: "space-y-3", children: A.map((
|
|
1017
|
-
|
|
991
|
+
] }) : /* @__PURE__ */ e("div", { className: "space-y-3", children: A.map((w) => /* @__PURE__ */ e(
|
|
992
|
+
rt,
|
|
1018
993
|
{
|
|
1019
|
-
group:
|
|
1020
|
-
onManageMembers: () => P(
|
|
1021
|
-
onDelete: () => m(
|
|
994
|
+
group: w,
|
|
995
|
+
onManageMembers: () => P(w),
|
|
996
|
+
onDelete: () => m(w),
|
|
1022
997
|
currentUserId: v == null ? void 0 : v.id
|
|
1023
998
|
},
|
|
1024
|
-
|
|
999
|
+
w.id
|
|
1025
1000
|
)) }) })
|
|
1026
1001
|
] }) }),
|
|
1027
|
-
/* @__PURE__ */ e(
|
|
1028
|
-
|
|
1002
|
+
/* @__PURE__ */ e(oe, { value: "create", className: "mt-4", children: /* @__PURE__ */ e(
|
|
1003
|
+
Va,
|
|
1029
1004
|
{
|
|
1030
1005
|
onSuccess: j,
|
|
1031
1006
|
tenantId: C,
|
|
1032
|
-
isTenantUser:
|
|
1007
|
+
isTenantUser: x
|
|
1033
1008
|
}
|
|
1034
1009
|
) })
|
|
1035
1010
|
] })
|
|
1036
1011
|
] }) }),
|
|
1037
1012
|
c && /* @__PURE__ */ e(
|
|
1038
|
-
|
|
1013
|
+
et,
|
|
1039
1014
|
{
|
|
1040
1015
|
open: p,
|
|
1041
1016
|
onOpenChange: f,
|
|
@@ -1060,13 +1035,13 @@ function nt({
|
|
|
1060
1035
|
/* @__PURE__ */ r(ms, { children: [
|
|
1061
1036
|
/* @__PURE__ */ e(hs, { children: "Cancel" }),
|
|
1062
1037
|
/* @__PURE__ */ e(
|
|
1063
|
-
|
|
1038
|
+
Se,
|
|
1064
1039
|
{
|
|
1065
1040
|
onClick: F,
|
|
1066
1041
|
disabled: N.isPending,
|
|
1067
1042
|
className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
1068
1043
|
children: N.isPending ? /* @__PURE__ */ r(E, { children: [
|
|
1069
|
-
/* @__PURE__ */ e(
|
|
1044
|
+
/* @__PURE__ */ e(q, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
1070
1045
|
"Deleting..."
|
|
1071
1046
|
] }) : "Delete Group"
|
|
1072
1047
|
}
|
|
@@ -1077,7 +1052,7 @@ function nt({
|
|
|
1077
1052
|
)
|
|
1078
1053
|
] });
|
|
1079
1054
|
}
|
|
1080
|
-
function
|
|
1055
|
+
function rt({
|
|
1081
1056
|
group: s,
|
|
1082
1057
|
onManageMembers: n,
|
|
1083
1058
|
onDelete: a,
|
|
@@ -1092,20 +1067,20 @@ function ot({
|
|
|
1092
1067
|
] }),
|
|
1093
1068
|
/* @__PURE__ */ r("div", { className: "flex flex-wrap items-center gap-3 text-xs text-muted-foreground", children: [
|
|
1094
1069
|
/* @__PURE__ */ r("span", { className: "flex items-center gap-1", children: [
|
|
1095
|
-
/* @__PURE__ */ e(
|
|
1070
|
+
/* @__PURE__ */ e(z, { className: "h-3 w-3" }),
|
|
1096
1071
|
s.memberCount,
|
|
1097
1072
|
" ",
|
|
1098
1073
|
s.memberCount === 1 ? "member" : "members"
|
|
1099
1074
|
] }),
|
|
1100
1075
|
/* @__PURE__ */ r("span", { children: [
|
|
1101
1076
|
"Created ",
|
|
1102
|
-
|
|
1077
|
+
ea(new Date(s.createdAt), "MMM d, yyyy")
|
|
1103
1078
|
] })
|
|
1104
1079
|
] })
|
|
1105
1080
|
] }),
|
|
1106
1081
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-1", children: [
|
|
1107
1082
|
/* @__PURE__ */ e(
|
|
1108
|
-
|
|
1083
|
+
L,
|
|
1109
1084
|
{
|
|
1110
1085
|
variant: "ghost",
|
|
1111
1086
|
size: "sm",
|
|
@@ -1115,7 +1090,7 @@ function ot({
|
|
|
1115
1090
|
}
|
|
1116
1091
|
),
|
|
1117
1092
|
l && /* @__PURE__ */ e(
|
|
1118
|
-
|
|
1093
|
+
L,
|
|
1119
1094
|
{
|
|
1120
1095
|
variant: "ghost",
|
|
1121
1096
|
size: "sm",
|
|
@@ -1128,40 +1103,40 @@ function ot({
|
|
|
1128
1103
|
] })
|
|
1129
1104
|
] }) });
|
|
1130
1105
|
}
|
|
1131
|
-
function
|
|
1132
|
-
var
|
|
1106
|
+
function ht() {
|
|
1107
|
+
var qe, ze, je;
|
|
1133
1108
|
const {
|
|
1134
1109
|
authToken: s,
|
|
1135
1110
|
tokenProps: n,
|
|
1136
1111
|
id: a
|
|
1137
|
-
} = U(), { isLocalDev: t } =
|
|
1112
|
+
} = U(), { isLocalDev: t } = sa(), { permissions: l } = Sa(), o = aa(), { isLoading: c } = ta();
|
|
1138
1113
|
y((i) => i.theme);
|
|
1139
1114
|
const u = y((i) => i.lenses), p = y((i) => i.selectedLensId), f = u == null ? void 0 : u.find((i) => i.id === p), d = y((i) => i.dashboard);
|
|
1140
1115
|
y((i) => i.selectedSheetId);
|
|
1141
1116
|
const m = y(
|
|
1142
1117
|
(i) => i.isDashboardEditing
|
|
1143
|
-
), { setDashboardTitle: g } = y((i) => i.actions), [v, N] = b(!1), [
|
|
1118
|
+
), { setDashboardTitle: g } = y((i) => i.actions), [v, N] = b(!1), [x, C] = b(!1), [R, O] = b(!1), [G, A] = b(!1), [F, P] = b(null), [j, w] = b(!1), V = y((i) => i.isDashboardPanelOpen), de = y(
|
|
1144
1119
|
(i) => i.actions.setIsDashboardPanelOpen
|
|
1145
|
-
), ue = y((i) => i.filterValues),
|
|
1146
|
-
|
|
1147
|
-
const h =
|
|
1120
|
+
), ue = y((i) => i.filterValues), S = y((i) => i.isVisualEditing);
|
|
1121
|
+
He((i) => i.card);
|
|
1122
|
+
const h = te(
|
|
1148
1123
|
(i) => i.selectedDashboard
|
|
1149
|
-
),
|
|
1124
|
+
), D = te(
|
|
1150
1125
|
(i) => i.initialDashboard
|
|
1151
1126
|
);
|
|
1152
|
-
|
|
1153
|
-
const I = h ? (
|
|
1127
|
+
te((i) => i.selectedVisual), y((i) => i.selectedFrameId), He((i) => i.frame);
|
|
1128
|
+
const I = h ? (ze = h == null ? void 0 : h.permissions) == null ? void 0 : ze.canEdit : (qe = D == null ? void 0 : D.permissions) == null ? void 0 : qe.canEdit, _ = y((i) => i.showFilters), Y = y(
|
|
1154
1129
|
(i) => i.showDashboardJSON
|
|
1155
|
-
),
|
|
1130
|
+
), H = y((i) => i.onSaveFunction), Cs = y(
|
|
1156
1131
|
(i) => i.actions.setShowFilters
|
|
1157
1132
|
), { setIsDashboardEditing: Re, setShowDashboardJSON: Oe } = y(
|
|
1158
1133
|
(i) => i.actions
|
|
1159
|
-
), { setInitialDashboard: Ue, clearSelectedDashboard:
|
|
1134
|
+
), { setInitialDashboard: Ue, clearSelectedDashboard: Ss } = te(
|
|
1160
1135
|
(i) => i.actions
|
|
1161
|
-
), { resources:
|
|
1162
|
-
id:
|
|
1163
|
-
title: (d == null ? void 0 : d.title) ||
|
|
1164
|
-
} : null, { handleAddNewFrame: ks } =
|
|
1136
|
+
), { resources: Z } = ra(ve.DASHBOARD), { currentUser: Ds } = os(), Ms = na(Ds), Q = h || D, _e = Q ? {
|
|
1137
|
+
id: Q.id,
|
|
1138
|
+
title: (d == null ? void 0 : d.title) || Q.title || "Dashboard"
|
|
1139
|
+
} : null, { handleAddNewFrame: ks } = oa(), [K, me] = b(!1), [Ls, ee] = b(!1), se = ia(ve.DASHBOARD), [B, he] = b(
|
|
1165
1140
|
null
|
|
1166
1141
|
), As = async (i, T) => {
|
|
1167
1142
|
if (!(d != null && d.id)) {
|
|
@@ -1172,69 +1147,69 @@ function gt() {
|
|
|
1172
1147
|
dashboardId: d.id,
|
|
1173
1148
|
newTitle: i,
|
|
1174
1149
|
previousTitle: T
|
|
1175
|
-
}),
|
|
1150
|
+
}), se.mutate(
|
|
1176
1151
|
{
|
|
1177
1152
|
resourceId: d.id,
|
|
1178
1153
|
data: { title: i }
|
|
1179
1154
|
},
|
|
1180
1155
|
{
|
|
1181
1156
|
onSuccess: () => {
|
|
1182
|
-
console.log("Dashboard title updated successfully"),
|
|
1157
|
+
console.log("Dashboard title updated successfully"), k.success("Dashboard title updated");
|
|
1183
1158
|
},
|
|
1184
1159
|
onError: (J) => {
|
|
1185
|
-
console.error("Failed to update dashboard title:", J),
|
|
1160
|
+
console.error("Failed to update dashboard title:", J), k.error("Failed to update dashboard title"), g(T);
|
|
1186
1161
|
}
|
|
1187
1162
|
}
|
|
1188
1163
|
);
|
|
1189
1164
|
};
|
|
1190
1165
|
ba(() => {
|
|
1191
|
-
if (
|
|
1166
|
+
if (Z && Z.length > 0) {
|
|
1192
1167
|
const i = d == null ? void 0 : d.id;
|
|
1193
1168
|
if (i) {
|
|
1194
|
-
const T =
|
|
1169
|
+
const T = Z.find(
|
|
1195
1170
|
(J) => J.id === i
|
|
1196
1171
|
);
|
|
1197
1172
|
T && Ue(T);
|
|
1198
1173
|
}
|
|
1199
1174
|
}
|
|
1200
|
-
}, [
|
|
1201
|
-
const
|
|
1175
|
+
}, [Z, d == null ? void 0 : d.id, Ue]);
|
|
1176
|
+
const ae = n.orgUserId || n.tenantId, Is = m && !S && ae && I, { setDashboard: Ts } = y((i) => i.actions), Es = () => {
|
|
1202
1177
|
Re(!0);
|
|
1203
1178
|
}, pe = () => {
|
|
1204
1179
|
Re(!1), Oe(!1), he(null);
|
|
1205
1180
|
};
|
|
1206
|
-
|
|
1181
|
+
Na(
|
|
1207
1182
|
m,
|
|
1208
1183
|
d,
|
|
1209
|
-
|
|
1184
|
+
B,
|
|
1210
1185
|
(i) => he(i)
|
|
1211
1186
|
);
|
|
1212
|
-
const Ps = () =>
|
|
1213
|
-
Ps() ?
|
|
1187
|
+
const Ps = () => B ? JSON.stringify(d) !== JSON.stringify(B) : !1, Gs = () => {
|
|
1188
|
+
Ps() ? ee(!0) : pe();
|
|
1214
1189
|
}, Fs = async () => {
|
|
1215
1190
|
await ge({ closeAfterSave: !0 });
|
|
1216
1191
|
}, Rs = () => {
|
|
1217
|
-
|
|
1192
|
+
B && Ts(B), pe(), ee(!1);
|
|
1218
1193
|
};
|
|
1219
1194
|
async function ge(i) {
|
|
1220
1195
|
const T = (i == null ? void 0 : i.closeAfterSave) ?? j;
|
|
1221
|
-
|
|
1196
|
+
w(T), T && ee(!1);
|
|
1222
1197
|
const J = va(d);
|
|
1223
1198
|
A(!0), P(null), me(!0);
|
|
1224
|
-
const
|
|
1199
|
+
const _s = {
|
|
1225
1200
|
template: d
|
|
1226
1201
|
};
|
|
1227
|
-
|
|
1202
|
+
se.mutate(
|
|
1228
1203
|
{
|
|
1229
1204
|
resourceId: d.id,
|
|
1230
|
-
data:
|
|
1205
|
+
data: _s
|
|
1231
1206
|
},
|
|
1232
1207
|
{
|
|
1233
1208
|
onSuccess: () => {
|
|
1234
|
-
me(!1),
|
|
1209
|
+
me(!1), k.success("Dashboard saved!"), he(J), A(!1), w(!1), T && pe();
|
|
1235
1210
|
},
|
|
1236
1211
|
onError: () => {
|
|
1237
|
-
me(!1), P("Failed to save dashboard. Please try again."),
|
|
1212
|
+
me(!1), P("Failed to save dashboard. Please try again."), k.error("Failed to save dashboard");
|
|
1238
1213
|
}
|
|
1239
1214
|
}
|
|
1240
1215
|
);
|
|
@@ -1246,15 +1221,15 @@ function gt() {
|
|
|
1246
1221
|
template: i,
|
|
1247
1222
|
filterValues: ue
|
|
1248
1223
|
};
|
|
1249
|
-
await
|
|
1224
|
+
await De(
|
|
1250
1225
|
n.apiServiceUrl,
|
|
1251
1226
|
T,
|
|
1252
1227
|
s == null ? void 0 : s.accessToken
|
|
1253
|
-
),
|
|
1228
|
+
), k.success("Lens saved"), H == null || H(d), N(!1);
|
|
1254
1229
|
}
|
|
1255
|
-
const
|
|
1256
|
-
|
|
1257
|
-
title:
|
|
1230
|
+
const $e = (f == null ? void 0 : f.name) || d.title;
|
|
1231
|
+
se.isPending && console.log("Title during update:", {
|
|
1232
|
+
title: $e,
|
|
1258
1233
|
dashboardStateTitle: d.title,
|
|
1259
1234
|
dashboardId: d == null ? void 0 : d.id,
|
|
1260
1235
|
currentLensName: f == null ? void 0 : f.name
|
|
@@ -1269,7 +1244,7 @@ function gt() {
|
|
|
1269
1244
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
1270
1245
|
Us && /* @__PURE__ */ r(E, { children: [
|
|
1271
1246
|
/* @__PURE__ */ e(
|
|
1272
|
-
|
|
1247
|
+
$,
|
|
1273
1248
|
{
|
|
1274
1249
|
"aria-label": "Manage Dashboards",
|
|
1275
1250
|
tooltip: "Manage Dashboards",
|
|
@@ -1277,27 +1252,27 @@ function gt() {
|
|
|
1277
1252
|
de(!V);
|
|
1278
1253
|
},
|
|
1279
1254
|
className: "h-7 p-2",
|
|
1280
|
-
children: /* @__PURE__ */ e(
|
|
1255
|
+
children: /* @__PURE__ */ e(Ma, { className: "h-4 w-4" })
|
|
1281
1256
|
}
|
|
1282
1257
|
),
|
|
1283
|
-
o && !
|
|
1284
|
-
|
|
1258
|
+
o && !S && /* @__PURE__ */ e(
|
|
1259
|
+
$,
|
|
1285
1260
|
{
|
|
1286
1261
|
"aria-label": "Dashboard Hub",
|
|
1287
1262
|
tooltip: "Dashboard Hub",
|
|
1288
|
-
onClick: () =>
|
|
1263
|
+
onClick: () => Ss(),
|
|
1289
1264
|
className: "h-7 p-2",
|
|
1290
|
-
children: /* @__PURE__ */ e(
|
|
1265
|
+
children: /* @__PURE__ */ e(Ze, { className: "h-4 w-4" })
|
|
1291
1266
|
}
|
|
1292
1267
|
)
|
|
1293
1268
|
] }),
|
|
1294
|
-
!
|
|
1295
|
-
/* @__PURE__ */ e(
|
|
1269
|
+
!S && o && (c ? /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
1270
|
+
/* @__PURE__ */ e(q, { className: "h-3 w-3 animate-spin text-muted-foreground" }),
|
|
1296
1271
|
/* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground", children: "Loading..." })
|
|
1297
1272
|
] }) : /* @__PURE__ */ e(
|
|
1298
|
-
|
|
1273
|
+
la,
|
|
1299
1274
|
{
|
|
1300
|
-
value:
|
|
1275
|
+
value: $e || "Untitled Dashboard",
|
|
1301
1276
|
onSave: (i) => {
|
|
1302
1277
|
console.log("EditableText onSave called:", {
|
|
1303
1278
|
newTitle: i,
|
|
@@ -1311,51 +1286,51 @@ function gt() {
|
|
|
1311
1286
|
displayClassName: "text-sm font-medium",
|
|
1312
1287
|
inputClassName: "text-sm font-medium",
|
|
1313
1288
|
placeholder: "Dashboard Title",
|
|
1314
|
-
isPending:
|
|
1289
|
+
isPending: se.isPending
|
|
1315
1290
|
}
|
|
1316
1291
|
))
|
|
1317
1292
|
] }),
|
|
1318
1293
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
1319
|
-
|
|
1320
|
-
/* @__PURE__ */ e(
|
|
1294
|
+
S && /* @__PURE__ */ r(E, { children: [
|
|
1295
|
+
/* @__PURE__ */ e(ya, { className: "mr-2" }),
|
|
1321
1296
|
/* @__PURE__ */ e(xa, { className: "h-7" })
|
|
1322
1297
|
] }),
|
|
1323
|
-
t && !
|
|
1298
|
+
t && !S && /* @__PURE__ */ r(E, { children: [
|
|
1324
1299
|
/* @__PURE__ */ e(
|
|
1325
|
-
|
|
1300
|
+
$,
|
|
1326
1301
|
{
|
|
1327
1302
|
tooltip: "Copy Token",
|
|
1328
1303
|
onClick: () => {
|
|
1329
1304
|
var i;
|
|
1330
|
-
s != null && s.accessToken && ((i = navigator == null ? void 0 : navigator.clipboard) != null && i.writeText ? navigator.clipboard.writeText(s.accessToken).then(() =>
|
|
1305
|
+
s != null && s.accessToken && ((i = navigator == null ? void 0 : navigator.clipboard) != null && i.writeText ? navigator.clipboard.writeText(s.accessToken).then(() => k.success("Token copied to clipboard")).catch(() => k.error("Unable to copy token")) : k.error("Clipboard not available"));
|
|
1331
1306
|
},
|
|
1332
1307
|
className: "h-7 p-2",
|
|
1333
|
-
children: /* @__PURE__ */ e(
|
|
1308
|
+
children: /* @__PURE__ */ e(ca, { className: "h-4 w-4" })
|
|
1334
1309
|
}
|
|
1335
1310
|
),
|
|
1336
1311
|
/* @__PURE__ */ e(
|
|
1337
|
-
|
|
1312
|
+
$,
|
|
1338
1313
|
{
|
|
1339
1314
|
tooltip: "Invalidate Token",
|
|
1340
|
-
onClick: () =>
|
|
1315
|
+
onClick: () => da(n.apiServiceUrl),
|
|
1341
1316
|
className: "h-7 p-2",
|
|
1342
|
-
children: /* @__PURE__ */ e(
|
|
1317
|
+
children: /* @__PURE__ */ e(La, { className: "h-4 w-4" })
|
|
1343
1318
|
}
|
|
1344
1319
|
)
|
|
1345
1320
|
] }),
|
|
1346
|
-
!
|
|
1347
|
-
!
|
|
1348
|
-
!
|
|
1349
|
-
|
|
1321
|
+
!S && o && /* @__PURE__ */ e(ua, {}),
|
|
1322
|
+
!S && o && /* @__PURE__ */ e(wa, {}),
|
|
1323
|
+
!S && o && Ms && /* @__PURE__ */ e(
|
|
1324
|
+
$,
|
|
1350
1325
|
{
|
|
1351
1326
|
tooltip: "Manage Groups",
|
|
1352
1327
|
onClick: () => O(!0),
|
|
1353
1328
|
className: "h-7 p-2",
|
|
1354
|
-
children: /* @__PURE__ */ e(
|
|
1329
|
+
children: /* @__PURE__ */ e(z, { className: "h-4 w-4" })
|
|
1355
1330
|
}
|
|
1356
1331
|
),
|
|
1357
|
-
!
|
|
1358
|
-
|
|
1332
|
+
!S && o && ((je = Q == null ? void 0 : Q.permissions) == null ? void 0 : je.canShare) && /* @__PURE__ */ e(
|
|
1333
|
+
$,
|
|
1359
1334
|
{
|
|
1360
1335
|
tooltip: "Share Dashboard",
|
|
1361
1336
|
onClick: () => C(!0),
|
|
@@ -1363,8 +1338,8 @@ function gt() {
|
|
|
1363
1338
|
children: /* @__PURE__ */ e(ma, { className: "h-4 w-4" })
|
|
1364
1339
|
}
|
|
1365
1340
|
),
|
|
1366
|
-
!
|
|
1367
|
-
|
|
1341
|
+
!_ && !S && m && l.canUseFilters && o && /* @__PURE__ */ e(
|
|
1342
|
+
L,
|
|
1368
1343
|
{
|
|
1369
1344
|
className: "h-7 p-2",
|
|
1370
1345
|
variant: "outline",
|
|
@@ -1373,10 +1348,10 @@ function gt() {
|
|
|
1373
1348
|
children: /* @__PURE__ */ e(ha, { className: "h-4 w-4" })
|
|
1374
1349
|
}
|
|
1375
1350
|
),
|
|
1376
|
-
m && !
|
|
1377
|
-
!
|
|
1378
|
-
m && !
|
|
1379
|
-
|
|
1351
|
+
m && !S && ae && t && o && /* @__PURE__ */ e(Ga, {}),
|
|
1352
|
+
!S && ae && t && o && /* @__PURE__ */ e(Fa, {}),
|
|
1353
|
+
m && !S && ae && f && t && o && /* @__PURE__ */ r(
|
|
1354
|
+
L,
|
|
1380
1355
|
{
|
|
1381
1356
|
className: "h-7 p-2",
|
|
1382
1357
|
variant: "secondary",
|
|
@@ -1384,13 +1359,13 @@ function gt() {
|
|
|
1384
1359
|
onClick: Os,
|
|
1385
1360
|
size: "sm",
|
|
1386
1361
|
children: [
|
|
1387
|
-
/* @__PURE__ */ e(
|
|
1362
|
+
/* @__PURE__ */ e(Qe, { className: "mr-2 h-4 w-4" }),
|
|
1388
1363
|
"Save Lens"
|
|
1389
1364
|
]
|
|
1390
1365
|
}
|
|
1391
1366
|
),
|
|
1392
|
-
m && !
|
|
1393
|
-
|
|
1367
|
+
m && !S && o && /* @__PURE__ */ r(
|
|
1368
|
+
L,
|
|
1394
1369
|
{
|
|
1395
1370
|
variant: "outline",
|
|
1396
1371
|
className: "h-7 p-2",
|
|
@@ -1403,12 +1378,12 @@ function gt() {
|
|
|
1403
1378
|
]
|
|
1404
1379
|
}
|
|
1405
1380
|
),
|
|
1406
|
-
!
|
|
1407
|
-
|
|
1381
|
+
!S && !m && I && o && /* @__PURE__ */ r(
|
|
1382
|
+
L,
|
|
1408
1383
|
{
|
|
1409
1384
|
variant: "outline",
|
|
1410
1385
|
className: "h-7 p-2",
|
|
1411
|
-
onClick:
|
|
1386
|
+
onClick: Es,
|
|
1412
1387
|
size: "sm",
|
|
1413
1388
|
children: [
|
|
1414
1389
|
/* @__PURE__ */ e(pa, { className: "mr-2 h-4 w-4" }),
|
|
@@ -1417,20 +1392,20 @@ function gt() {
|
|
|
1417
1392
|
}
|
|
1418
1393
|
),
|
|
1419
1394
|
Is && o && /* @__PURE__ */ r(
|
|
1420
|
-
|
|
1395
|
+
L,
|
|
1421
1396
|
{
|
|
1422
1397
|
className: "h-7 p-2",
|
|
1423
|
-
disabled:
|
|
1398
|
+
disabled: K,
|
|
1424
1399
|
onClick: () => ge(),
|
|
1425
1400
|
size: "sm",
|
|
1426
1401
|
children: [
|
|
1427
|
-
|
|
1428
|
-
|
|
1402
|
+
K ? /* @__PURE__ */ e(q, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ e(Qe, { className: "mr-2 h-4 w-4" }),
|
|
1403
|
+
K ? "Saving..." : "Save"
|
|
1429
1404
|
]
|
|
1430
1405
|
}
|
|
1431
1406
|
),
|
|
1432
|
-
!
|
|
1433
|
-
|
|
1407
|
+
!S && m && t && o && /* @__PURE__ */ e("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ e(
|
|
1408
|
+
L,
|
|
1434
1409
|
{
|
|
1435
1410
|
className: "h-7 p-2",
|
|
1436
1411
|
onClick: () => Oe(!Y),
|
|
@@ -1439,9 +1414,9 @@ function gt() {
|
|
|
1439
1414
|
children: /* @__PURE__ */ e(ga, { className: "h-4 w-4" })
|
|
1440
1415
|
}
|
|
1441
1416
|
) }),
|
|
1442
|
-
!
|
|
1443
|
-
m && !
|
|
1444
|
-
|
|
1417
|
+
!S && t && /* @__PURE__ */ e(Ta, {}),
|
|
1418
|
+
m && !S && o && /* @__PURE__ */ r(
|
|
1419
|
+
L,
|
|
1445
1420
|
{
|
|
1446
1421
|
variant: "outline",
|
|
1447
1422
|
className: "h-7 p-2",
|
|
@@ -1452,16 +1427,16 @@ function gt() {
|
|
|
1452
1427
|
]
|
|
1453
1428
|
}
|
|
1454
1429
|
),
|
|
1455
|
-
|
|
1430
|
+
x && _e && /* @__PURE__ */ e(
|
|
1456
1431
|
fa,
|
|
1457
1432
|
{
|
|
1458
|
-
resource:
|
|
1433
|
+
resource: _e,
|
|
1459
1434
|
resourceType: ve.DASHBOARD,
|
|
1460
1435
|
onClose: () => C(!1)
|
|
1461
1436
|
}
|
|
1462
1437
|
),
|
|
1463
1438
|
/* @__PURE__ */ e(
|
|
1464
|
-
|
|
1439
|
+
tt,
|
|
1465
1440
|
{
|
|
1466
1441
|
open: R,
|
|
1467
1442
|
onOpenChange: O
|
|
@@ -1472,7 +1447,7 @@ function gt() {
|
|
|
1472
1447
|
{
|
|
1473
1448
|
open: G,
|
|
1474
1449
|
onOpenChange: (i) => {
|
|
1475
|
-
!i &&
|
|
1450
|
+
!i && K && !F || (A(i), i || (P(null), w(!1)));
|
|
1476
1451
|
},
|
|
1477
1452
|
children: /* @__PURE__ */ r(ls, { className: "max-w-sm", children: [
|
|
1478
1453
|
/* @__PURE__ */ r(cs, { children: [
|
|
@@ -1484,14 +1459,14 @@ function gt() {
|
|
|
1484
1459
|
hs,
|
|
1485
1460
|
{
|
|
1486
1461
|
onClick: () => {
|
|
1487
|
-
A(!1), P(null),
|
|
1462
|
+
A(!1), P(null), w(!1);
|
|
1488
1463
|
},
|
|
1489
1464
|
className: "m-0",
|
|
1490
1465
|
children: "Close"
|
|
1491
1466
|
}
|
|
1492
1467
|
),
|
|
1493
1468
|
/* @__PURE__ */ e(
|
|
1494
|
-
|
|
1469
|
+
Se,
|
|
1495
1470
|
{
|
|
1496
1471
|
onClick: () => ge(),
|
|
1497
1472
|
className: "m-0",
|
|
@@ -1499,12 +1474,12 @@ function gt() {
|
|
|
1499
1474
|
}
|
|
1500
1475
|
)
|
|
1501
1476
|
] }) : /* @__PURE__ */ r(
|
|
1502
|
-
|
|
1477
|
+
Se,
|
|
1503
1478
|
{
|
|
1504
1479
|
disabled: !0,
|
|
1505
1480
|
className: "m-0 cursor-default",
|
|
1506
1481
|
children: [
|
|
1507
|
-
/* @__PURE__ */ e(
|
|
1482
|
+
/* @__PURE__ */ e(q, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
1508
1483
|
"Saving..."
|
|
1509
1484
|
]
|
|
1510
1485
|
}
|
|
@@ -1513,13 +1488,13 @@ function gt() {
|
|
|
1513
1488
|
}
|
|
1514
1489
|
),
|
|
1515
1490
|
/* @__PURE__ */ e(
|
|
1516
|
-
|
|
1491
|
+
Ca,
|
|
1517
1492
|
{
|
|
1518
1493
|
open: Ls,
|
|
1519
|
-
onOpenChange:
|
|
1494
|
+
onOpenChange: ee,
|
|
1520
1495
|
onSave: Fs,
|
|
1521
1496
|
onDiscard: Rs,
|
|
1522
|
-
isSaving:
|
|
1497
|
+
isSaving: K
|
|
1523
1498
|
}
|
|
1524
1499
|
)
|
|
1525
1500
|
] })
|
|
@@ -1528,5 +1503,5 @@ function gt() {
|
|
|
1528
1503
|
);
|
|
1529
1504
|
}
|
|
1530
1505
|
export {
|
|
1531
|
-
|
|
1506
|
+
ht as default
|
|
1532
1507
|
};
|