react-semaphor 0.1.172 → 0.1.174
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-BuKUWOU1.js → dashboard-controls-BdFhbpoS.js} +6 -6
- package/dist/chunks/{dashboard-controls-DA-lJWSK.js → dashboard-controls-Bxjvkywu.js} +354 -352
- package/dist/chunks/{dashboard-json-CUTAJhWz.js → dashboard-json-BCH4SQkg.js} +1 -1
- package/dist/chunks/{dashboard-json-BTWzsbui.js → dashboard-json-ClK3yCs7.js} +1 -1
- package/dist/chunks/edit-dashboard-visual-BEAKONcQ.js +189 -0
- package/dist/chunks/{edit-dashboard-visual-BEWMIe7g.js → edit-dashboard-visual-CSI-cZoT.js} +4835 -4809
- package/dist/chunks/{editor-action-buttons-WGWavDMB.js → editor-action-buttons-BaHzz3CT.js} +1 -1
- package/dist/chunks/{editor-action-buttons-C5Ejuo4M.js → editor-action-buttons-DIFwpB2w.js} +2 -2
- package/dist/chunks/{index-DMR0K1Nf.js → index-BAb30JIE.js} +75 -75
- package/dist/chunks/{index-C8T45uat.js → index-CtuIHKSY.js} +4370 -4304
- package/dist/chunks/{resource-management-panel-DFC27hgo.js → resource-management-panel-Cs7tkTxZ.js} +1 -1
- package/dist/chunks/{resource-management-panel-BKAs9Em0.js → resource-management-panel-DRMNQIkI.js} +3 -3
- package/dist/chunks/{schedule-dashboard-r_XMtRaW.js → schedule-dashboard-Bj4mXU5g.js} +38 -38
- package/dist/chunks/{schedule-dashboard-DC7XeEaW.js → schedule-dashboard-CInkuI61.js} +2 -2
- package/dist/chunks/{use-role-aware-display-preferences-CAbBsXoz.js → use-role-aware-display-preferences-BGTLQ_rf.js} +1 -1
- package/dist/chunks/{use-role-aware-display-preferences-BOpxNd8x.js → use-role-aware-display-preferences-DgSkQ7I0.js} +1 -1
- package/dist/chunks/use-visual-utils-BmwT7aG_.js +338 -0
- package/dist/chunks/use-visual-utils-CeBDoiB8.js +1 -0
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +4 -4
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +1 -1
- package/dist/types/main.d.ts +36 -0
- package/package.json +1 -1
- package/dist/chunks/edit-dashboard-visual-_uEu62dm.js +0 -189
- package/dist/chunks/use-visual-utils-BJxotk2m.js +0 -331
- package/dist/chunks/use-visual-utils-DG7j82aL.js +0 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsxs as r, jsx as e, Fragment as E } from "react/jsx-runtime";
|
|
2
|
-
import { l as
|
|
2
|
+
import { l as W, bE as qs, bF as zs, u as y, aS as Je, aT as We, B as L, aV as Xe, aW as ve, bG as ke, o as Ye, aA as U, aF as Le, bH as js, bc as Ae, aG as Ie, aH as Te, aI as Ee, aJ as Ze, aK as Ne, bI as J, aO as Vs, K as $, bJ as Hs, bg as Qs, bK as Ks, bL as He, bM as es, c as ie, bN as ss, p as le, bO as ce, t as k, bP as as, aM as Bs, bQ as Js, L as q, bf as z, bR as Ws, bS as Xs, bT as ye, bU as Ys, bV as Zs, bW as ts, bX as rs, bY as ne, bZ as oe, bB as xe, bm as we, b_ as Ce, bh as ns, b$ as Se, aN as os, e as is, c0 as ea, a_ as ls, a$ as cs, b0 as ds, b2 as us, b3 as ms, b4 as hs, b5 as ps, b6 as De, c1 as sa, ba as aa, c2 as ta, T as ra, n as Qe, R as te, c3 as na, $ as oa, V as be, c4 as ia, c5 as la, c6 as ca, c7 as da, bd as ua, a6 as ma, c8 as ha, c9 as pa, ca as ga, cb as fa, cc as va, _ as ba, a5 as Na } from "./index-CtuIHKSY.js";
|
|
3
3
|
import * as M from "react";
|
|
4
|
-
import { useState as b, useMemo as re, useEffect as
|
|
4
|
+
import { useState as b, useMemo as re, useEffect as ya } from "react";
|
|
5
5
|
import "react-dom";
|
|
6
|
-
import { u as
|
|
7
|
-
import { u as
|
|
8
|
-
import { S as
|
|
6
|
+
import { u as xa, A as wa, V as Ca, S as Sa, U as Da } from "./schedule-dashboard-Bj4mXU5g.js";
|
|
7
|
+
import { u as Ma } from "./use-role-aware-display-preferences-BGTLQ_rf.js";
|
|
8
|
+
import { S as Ke } from "./editor-action-buttons-DIFwpB2w.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 ka = W("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 Da = 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 La = W("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 Ma = 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 Aa = W("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 ka = 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 Ia = W("ShieldX", [
|
|
49
49
|
[
|
|
50
50
|
"path",
|
|
51
51
|
{
|
|
@@ -62,7 +62,7 @@ const La = 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 Ta = W("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 Aa = 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
|
|
77
|
-
function
|
|
78
|
-
const { setTheme: s } =
|
|
76
|
+
var Ea = qs();
|
|
77
|
+
function Pa() {
|
|
78
|
+
const { setTheme: s } = zs(), n = y(
|
|
79
79
|
(a) => a.actions.setDashboardTheme
|
|
80
80
|
);
|
|
81
|
-
return /* @__PURE__ */ r(
|
|
82
|
-
/* @__PURE__ */ e(
|
|
81
|
+
return /* @__PURE__ */ r(Je, { children: [
|
|
82
|
+
/* @__PURE__ */ e(We, { asChild: !0, children: /* @__PURE__ */ r(L, { className: "h-7 p-2", variant: "ghost", size: "sm", children: [
|
|
83
83
|
/* @__PURE__ */ e(
|
|
84
|
-
|
|
84
|
+
Ta,
|
|
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
|
+
Aa,
|
|
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"
|
|
@@ -96,9 +96,9 @@ function Ta() {
|
|
|
96
96
|
),
|
|
97
97
|
/* @__PURE__ */ e("span", { className: "sr-only", children: "Toggle theme" })
|
|
98
98
|
] }) }),
|
|
99
|
-
/* @__PURE__ */ r(
|
|
99
|
+
/* @__PURE__ */ r(Xe, { align: "end", children: [
|
|
100
100
|
/* @__PURE__ */ e(
|
|
101
|
-
|
|
101
|
+
ve,
|
|
102
102
|
{
|
|
103
103
|
onClick: () => {
|
|
104
104
|
s("light"), n("light");
|
|
@@ -107,7 +107,7 @@ function Ta() {
|
|
|
107
107
|
}
|
|
108
108
|
),
|
|
109
109
|
/* @__PURE__ */ e(
|
|
110
|
-
|
|
110
|
+
ve,
|
|
111
111
|
{
|
|
112
112
|
onClick: () => {
|
|
113
113
|
s("dark"), n("dark");
|
|
@@ -116,7 +116,7 @@ function Ta() {
|
|
|
116
116
|
}
|
|
117
117
|
),
|
|
118
118
|
/* @__PURE__ */ e(
|
|
119
|
-
|
|
119
|
+
ve,
|
|
120
120
|
{
|
|
121
121
|
onClick: () => {
|
|
122
122
|
s("system"), n("system");
|
|
@@ -127,74 +127,74 @@ function Ta() {
|
|
|
127
127
|
] })
|
|
128
128
|
] });
|
|
129
129
|
}
|
|
130
|
-
async function
|
|
130
|
+
async function Ga(s, n, a, t, l) {
|
|
131
131
|
if (!l)
|
|
132
132
|
return null;
|
|
133
|
-
const
|
|
134
|
-
return await
|
|
133
|
+
const i = JSON.stringify(a), c = `${s}/v1/lens`;
|
|
134
|
+
return await ke(c, l, {
|
|
135
135
|
name: n,
|
|
136
|
-
template:
|
|
136
|
+
template: i,
|
|
137
137
|
filterValues: t,
|
|
138
138
|
operation: "create"
|
|
139
139
|
});
|
|
140
140
|
}
|
|
141
|
-
async function
|
|
141
|
+
async function Me(s, n, a) {
|
|
142
142
|
if (!a)
|
|
143
143
|
return null;
|
|
144
|
-
const { id: t, template: l, filterValues:
|
|
145
|
-
return await
|
|
144
|
+
const { id: t, template: l, filterValues: i, isDefault: c, shared: u } = n, p = `${s}/v1/lens`;
|
|
145
|
+
return await ke(p, a, {
|
|
146
146
|
lensId: t,
|
|
147
147
|
template: l,
|
|
148
|
-
filterValues:
|
|
148
|
+
filterValues: i,
|
|
149
149
|
isDefault: c,
|
|
150
150
|
shared: u,
|
|
151
151
|
operation: "update"
|
|
152
152
|
});
|
|
153
153
|
}
|
|
154
|
-
async function
|
|
154
|
+
async function Fa(s, n, a) {
|
|
155
155
|
if (!a)
|
|
156
156
|
return null;
|
|
157
157
|
const t = `${s}/v1/lens`;
|
|
158
|
-
return await
|
|
158
|
+
return await ke(t, a, {
|
|
159
159
|
operation: "delete",
|
|
160
160
|
lensId: n
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
|
-
function
|
|
164
|
-
const [s, n] = b(""), [a, t] = b(!1), l = y((C) => C.lenses), { setLenses:
|
|
163
|
+
function Oa() {
|
|
164
|
+
const [s, n] = b(""), [a, t] = b(!1), l = y((C) => C.lenses), { setLenses: i, setSelectedLensId: c } = Ye(), [u, p] = b(!1), [f, d] = b(!1), m = y((C) => C.dashboard), g = y((C) => C.filterValues), { authToken: v, tokenProps: N } = U();
|
|
165
165
|
async function x() {
|
|
166
166
|
p(!0);
|
|
167
|
-
const C = await
|
|
167
|
+
const C = await Ga(
|
|
168
168
|
N.apiServiceUrl,
|
|
169
169
|
s,
|
|
170
170
|
m,
|
|
171
171
|
g,
|
|
172
172
|
v == null ? void 0 : v.accessToken
|
|
173
173
|
);
|
|
174
|
-
C && (
|
|
174
|
+
C && (i([...l || [], C]), c(C.id), d(!1)), p(!1);
|
|
175
175
|
}
|
|
176
|
-
return /* @__PURE__ */ r(
|
|
177
|
-
/* @__PURE__ */ e(
|
|
176
|
+
return /* @__PURE__ */ r(Le, { open: f, onOpenChange: d, children: [
|
|
177
|
+
/* @__PURE__ */ e(js, { asChild: !0, children: /* @__PURE__ */ r(
|
|
178
178
|
L,
|
|
179
179
|
{
|
|
180
180
|
variant: "secondary",
|
|
181
181
|
className: "h-7 p-2",
|
|
182
182
|
size: "sm",
|
|
183
183
|
children: [
|
|
184
|
-
/* @__PURE__ */ e(
|
|
184
|
+
/* @__PURE__ */ e(Ae, { className: "mr-2 h-4 w-4" }),
|
|
185
185
|
"Lens"
|
|
186
186
|
]
|
|
187
187
|
}
|
|
188
188
|
) }),
|
|
189
|
-
/* @__PURE__ */ r(
|
|
190
|
-
/* @__PURE__ */ r(
|
|
191
|
-
/* @__PURE__ */ e(
|
|
192
|
-
/* @__PURE__ */ e(
|
|
189
|
+
/* @__PURE__ */ r(Ie, { className: "sm:max-w-[425px]", children: [
|
|
190
|
+
/* @__PURE__ */ r(Te, { children: [
|
|
191
|
+
/* @__PURE__ */ e(Ee, { children: "Create Lens" }),
|
|
192
|
+
/* @__PURE__ */ e(Ze, { 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
|
-
/* @__PURE__ */ e(
|
|
195
|
+
/* @__PURE__ */ e(Ne, { className: "text-right", children: "Name" }),
|
|
196
196
|
/* @__PURE__ */ e(
|
|
197
|
-
|
|
197
|
+
J,
|
|
198
198
|
{
|
|
199
199
|
value: s,
|
|
200
200
|
onChange: (C) => {
|
|
@@ -206,7 +206,7 @@ function Ga() {
|
|
|
206
206
|
)
|
|
207
207
|
] }) }),
|
|
208
208
|
a && /* @__PURE__ */ e("p", { className: "text-sm", children: "The lens name already exists. Use a differnet name." }),
|
|
209
|
-
/* @__PURE__ */ e(
|
|
209
|
+
/* @__PURE__ */ e(Vs, { children: /* @__PURE__ */ e(
|
|
210
210
|
L,
|
|
211
211
|
{
|
|
212
212
|
size: "sm",
|
|
@@ -220,15 +220,15 @@ function Ga() {
|
|
|
220
220
|
] })
|
|
221
221
|
] });
|
|
222
222
|
}
|
|
223
|
-
function
|
|
224
|
-
const [s, n] = b(!1), a = y((m) => m.lenses), t = y((m) => m.selectedLensId), { setLenses: l, setSelectedLensId:
|
|
223
|
+
function Ra() {
|
|
224
|
+
const [s, n] = b(!1), a = y((m) => m.lenses), t = y((m) => m.selectedLensId), { setLenses: l, setSelectedLensId: i } = Ye(), { authToken: c, tokenProps: u } = U();
|
|
225
225
|
async function p(m) {
|
|
226
|
-
|
|
226
|
+
i(m);
|
|
227
227
|
}
|
|
228
228
|
async function f(m) {
|
|
229
|
-
if (await
|
|
229
|
+
if (await Fa(u.apiServiceUrl, m, c == null ? void 0 : c.accessToken)) {
|
|
230
230
|
const v = a == null ? void 0 : a.filter((N) => N.id !== m);
|
|
231
|
-
l(v || []),
|
|
231
|
+
l(v || []), i("original");
|
|
232
232
|
}
|
|
233
233
|
}
|
|
234
234
|
async function d(m) {
|
|
@@ -244,30 +244,30 @@ function Fa() {
|
|
|
244
244
|
...m,
|
|
245
245
|
isDefault: !m.isDefault
|
|
246
246
|
};
|
|
247
|
-
await
|
|
247
|
+
await Me(u.apiServiceUrl, v, c == null ? void 0 : c.accessToken);
|
|
248
248
|
const N = a == null ? void 0 : a.find((x) => x.isDefault);
|
|
249
249
|
if (N && N.id !== m.id) {
|
|
250
250
|
const x = {
|
|
251
251
|
...N,
|
|
252
252
|
isDefault: !1
|
|
253
253
|
};
|
|
254
|
-
await
|
|
254
|
+
await Me(u.apiServiceUrl, x, c == null ? void 0 : c.accessToken);
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
|
-
return /* @__PURE__ */ r(
|
|
258
|
-
/* @__PURE__ */ e(
|
|
259
|
-
/* @__PURE__ */ r(
|
|
260
|
-
/* @__PURE__ */ e(
|
|
261
|
-
/* @__PURE__ */ e(
|
|
257
|
+
return /* @__PURE__ */ r(Je, { open: s, onOpenChange: n, children: [
|
|
258
|
+
/* @__PURE__ */ e(We, { asChild: !0, children: /* @__PURE__ */ e($, { tooltip: "Lenses", className: "h-7 p-2", children: /* @__PURE__ */ e(ka, { className: "h-4 w-4" }) }) }),
|
|
259
|
+
/* @__PURE__ */ r(Xe, { align: "end", className: "w-60", children: [
|
|
260
|
+
/* @__PURE__ */ e(Hs, { className: "px-3", children: "Lenses" }),
|
|
261
|
+
/* @__PURE__ */ e(Qs, {}),
|
|
262
262
|
/* @__PURE__ */ r(
|
|
263
|
-
|
|
263
|
+
Ks,
|
|
264
264
|
{
|
|
265
265
|
value: t,
|
|
266
266
|
onValueChange: p,
|
|
267
267
|
children: [
|
|
268
|
-
/* @__PURE__ */ e(
|
|
268
|
+
/* @__PURE__ */ e(He, { value: "original", children: "Original" }),
|
|
269
269
|
a == null ? void 0 : a.map((m) => /* @__PURE__ */ r(
|
|
270
|
-
|
|
270
|
+
He,
|
|
271
271
|
{
|
|
272
272
|
className: "group flex justify-between gap-2",
|
|
273
273
|
value: m.id,
|
|
@@ -275,7 +275,7 @@ function Fa() {
|
|
|
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
|
+
es,
|
|
279
279
|
{
|
|
280
280
|
onClick: (g) => {
|
|
281
281
|
g.preventDefault(), d(m);
|
|
@@ -291,7 +291,7 @@ function Fa() {
|
|
|
291
291
|
}
|
|
292
292
|
),
|
|
293
293
|
/* @__PURE__ */ e(
|
|
294
|
-
|
|
294
|
+
ss,
|
|
295
295
|
{
|
|
296
296
|
onClick: (g) => {
|
|
297
297
|
g.preventDefault(), f(m.id);
|
|
@@ -311,10 +311,10 @@ function Fa() {
|
|
|
311
311
|
] })
|
|
312
312
|
] });
|
|
313
313
|
}
|
|
314
|
-
const
|
|
314
|
+
const Ua = async (s, n, a) => {
|
|
315
315
|
const t = `${s}/management/v1/groups`;
|
|
316
|
-
return await
|
|
317
|
-
},
|
|
316
|
+
return await as(t, n, a);
|
|
317
|
+
}, _a = async (s, n, a) => {
|
|
318
318
|
const t = `${s}/management/v1/groups/${a}`, l = await fetch(t, {
|
|
319
319
|
method: "DELETE",
|
|
320
320
|
headers: {
|
|
@@ -322,14 +322,14 @@ const Ra = async (s, n, a) => {
|
|
|
322
322
|
}
|
|
323
323
|
});
|
|
324
324
|
if (!l.ok) {
|
|
325
|
-
const
|
|
326
|
-
throw new Error(
|
|
325
|
+
const i = await l.text();
|
|
326
|
+
throw new Error(i || "Failed to delete group");
|
|
327
327
|
}
|
|
328
|
-
},
|
|
328
|
+
}, $a = async (s, n, a, t) => {
|
|
329
329
|
const l = `${s}/management/v1/groups/${a}/members`;
|
|
330
|
-
return await
|
|
331
|
-
},
|
|
332
|
-
const l = `${s}/management/v1/groups/${a}/members`,
|
|
330
|
+
return await as(l, n, t);
|
|
331
|
+
}, qa = async (s, n, a, t) => {
|
|
332
|
+
const l = `${s}/management/v1/groups/${a}/members`, i = await fetch(l, {
|
|
333
333
|
method: "DELETE",
|
|
334
334
|
headers: {
|
|
335
335
|
"Content-Type": "application/json",
|
|
@@ -337,15 +337,15 @@ const Ra = async (s, n, a) => {
|
|
|
337
337
|
},
|
|
338
338
|
body: JSON.stringify(t)
|
|
339
339
|
});
|
|
340
|
-
if (!
|
|
341
|
-
const c = await
|
|
340
|
+
if (!i.ok) {
|
|
341
|
+
const c = await i.text();
|
|
342
342
|
throw new Error(c || "Failed to remove group members");
|
|
343
343
|
}
|
|
344
344
|
};
|
|
345
|
-
function
|
|
345
|
+
function za() {
|
|
346
346
|
const { authToken: s, tokenProps: n } = U(), a = le();
|
|
347
347
|
return ce({
|
|
348
|
-
mutationFn: (t) =>
|
|
348
|
+
mutationFn: (t) => Ua(n.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t),
|
|
349
349
|
onSuccess: () => {
|
|
350
350
|
a.invalidateQueries({ queryKey: ["groups"] }), k.success("Group created successfully");
|
|
351
351
|
},
|
|
@@ -356,10 +356,10 @@ function $a() {
|
|
|
356
356
|
}
|
|
357
357
|
});
|
|
358
358
|
}
|
|
359
|
-
function
|
|
359
|
+
function ja() {
|
|
360
360
|
const { authToken: s, tokenProps: n } = U(), a = le();
|
|
361
361
|
return ce({
|
|
362
|
-
mutationFn: (t) =>
|
|
362
|
+
mutationFn: (t) => _a(n.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t),
|
|
363
363
|
onSuccess: (t, l) => {
|
|
364
364
|
a.invalidateQueries({ queryKey: ["groups"] }), a.removeQueries({ queryKey: ["group", l] }), k.success("Group deleted successfully");
|
|
365
365
|
},
|
|
@@ -370,13 +370,13 @@ function qa() {
|
|
|
370
370
|
}
|
|
371
371
|
});
|
|
372
372
|
}
|
|
373
|
-
function
|
|
373
|
+
function Va() {
|
|
374
374
|
const { authToken: s, tokenProps: n } = U(), a = le();
|
|
375
375
|
return ce({
|
|
376
376
|
mutationFn: ({
|
|
377
377
|
groupId: t,
|
|
378
378
|
data: l
|
|
379
|
-
}) =>
|
|
379
|
+
}) => $a(n.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t, l),
|
|
380
380
|
onSuccess: (t, l) => {
|
|
381
381
|
a.invalidateQueries({ queryKey: ["group", l.groupId] }), a.invalidateQueries({
|
|
382
382
|
queryKey: ["group-members", l.groupId]
|
|
@@ -389,13 +389,13 @@ function za() {
|
|
|
389
389
|
}
|
|
390
390
|
});
|
|
391
391
|
}
|
|
392
|
-
function
|
|
392
|
+
function Ha() {
|
|
393
393
|
const { authToken: s, tokenProps: n } = U(), a = le();
|
|
394
394
|
return ce({
|
|
395
395
|
mutationFn: ({
|
|
396
396
|
groupId: t,
|
|
397
397
|
data: l
|
|
398
|
-
}) =>
|
|
398
|
+
}) => qa(n.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t, l),
|
|
399
399
|
onSuccess: (t, l) => {
|
|
400
400
|
a.invalidateQueries({ queryKey: ["group", l.groupId] }), a.invalidateQueries({
|
|
401
401
|
queryKey: ["group-members", l.groupId]
|
|
@@ -408,20 +408,20 @@ function ja() {
|
|
|
408
408
|
}
|
|
409
409
|
});
|
|
410
410
|
}
|
|
411
|
-
function
|
|
411
|
+
function Qa({
|
|
412
412
|
onSuccess: s,
|
|
413
413
|
tenantId: n,
|
|
414
414
|
isTenantUser: a
|
|
415
415
|
}) {
|
|
416
|
-
const [t, l] = b(""), [
|
|
416
|
+
const [t, l] = b(""), [i, c] = b(""), [u, p] = b({}), f = za(), d = () => {
|
|
417
417
|
const g = {};
|
|
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",
|
|
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", i && i.length > 200 && (g.description = "Description must be less than 200 characters"), p(g), Object.keys(g).length === 0;
|
|
419
419
|
};
|
|
420
420
|
return /* @__PURE__ */ r("form", { onSubmit: async (g) => {
|
|
421
421
|
if (g.preventDefault(), !d()) return;
|
|
422
422
|
const v = {
|
|
423
423
|
name: t.trim(),
|
|
424
|
-
description:
|
|
424
|
+
description: i.trim() || void 0,
|
|
425
425
|
type: a ? "TENANT_GROUP" : "ORG_GROUP",
|
|
426
426
|
...a && n ? { tenantId: n } : {}
|
|
427
427
|
};
|
|
@@ -433,12 +433,12 @@ function Va({
|
|
|
433
433
|
}, className: "space-y-6", children: [
|
|
434
434
|
/* @__PURE__ */ r("div", { className: "space-y-4", children: [
|
|
435
435
|
/* @__PURE__ */ r("div", { className: "space-y-2", children: [
|
|
436
|
-
/* @__PURE__ */ r(
|
|
436
|
+
/* @__PURE__ */ r(Ne, { htmlFor: "group-name", children: [
|
|
437
437
|
"Group Name ",
|
|
438
438
|
/* @__PURE__ */ e("span", { className: "text-destructive", children: "*" })
|
|
439
439
|
] }),
|
|
440
440
|
/* @__PURE__ */ e(
|
|
441
|
-
|
|
441
|
+
J,
|
|
442
442
|
{
|
|
443
443
|
id: "group-name",
|
|
444
444
|
placeholder: "e.g., Marketing Team, Engineering Squad",
|
|
@@ -453,16 +453,16 @@ function Va({
|
|
|
453
453
|
u.name && /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: u.name })
|
|
454
454
|
] }),
|
|
455
455
|
/* @__PURE__ */ r("div", { className: "space-y-2", children: [
|
|
456
|
-
/* @__PURE__ */ r(
|
|
456
|
+
/* @__PURE__ */ r(Ne, { htmlFor: "group-description", children: [
|
|
457
457
|
"Description",
|
|
458
458
|
/* @__PURE__ */ e("span", { className: "ml-2 text-xs text-muted-foreground", children: "(optional)" })
|
|
459
459
|
] }),
|
|
460
460
|
/* @__PURE__ */ e(
|
|
461
|
-
|
|
461
|
+
Bs,
|
|
462
462
|
{
|
|
463
463
|
id: "group-description",
|
|
464
464
|
placeholder: "Describe the purpose of this group...",
|
|
465
|
-
value:
|
|
465
|
+
value: i,
|
|
466
466
|
onChange: (g) => {
|
|
467
467
|
c(g.target.value), u.description && p((v) => ({ ...v, description: "" }));
|
|
468
468
|
},
|
|
@@ -473,12 +473,12 @@ function Va({
|
|
|
473
473
|
),
|
|
474
474
|
u.description && /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: u.description }),
|
|
475
475
|
/* @__PURE__ */ r("p", { className: "text-xs text-muted-foreground", children: [
|
|
476
|
-
|
|
476
|
+
i.length,
|
|
477
477
|
"/200 characters"
|
|
478
478
|
] })
|
|
479
479
|
] }),
|
|
480
480
|
/* @__PURE__ */ e("div", { className: "rounded-lg border bg-muted/50 p-4", children: /* @__PURE__ */ r("div", { className: "flex gap-3", children: [
|
|
481
|
-
/* @__PURE__ */ e(
|
|
481
|
+
/* @__PURE__ */ e(Js, { className: "h-4 w-4 mt-0.5 text-muted-foreground" }),
|
|
482
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." })
|
|
483
483
|
] }) })
|
|
484
484
|
] }),
|
|
@@ -512,41 +512,41 @@ function Va({
|
|
|
512
512
|
] })
|
|
513
513
|
] });
|
|
514
514
|
}
|
|
515
|
-
function
|
|
515
|
+
function Ka(s, n = []) {
|
|
516
516
|
let a = [];
|
|
517
|
-
function t(
|
|
517
|
+
function t(i, c) {
|
|
518
518
|
const u = M.createContext(c);
|
|
519
|
-
u.displayName =
|
|
519
|
+
u.displayName = i + "Context";
|
|
520
520
|
const p = a.length;
|
|
521
521
|
a = [...a, c];
|
|
522
522
|
const f = (m) => {
|
|
523
|
-
var
|
|
524
|
-
const { scope: g, children: v, ...N } = m, x = ((
|
|
523
|
+
var O;
|
|
524
|
+
const { scope: g, children: v, ...N } = m, x = ((O = g == null ? void 0 : g[s]) == null ? void 0 : O[p]) || u, C = M.useMemo(() => N, Object.values(N));
|
|
525
525
|
return /* @__PURE__ */ e(x.Provider, { value: C, children: v });
|
|
526
526
|
};
|
|
527
|
-
f.displayName =
|
|
527
|
+
f.displayName = i + "Provider";
|
|
528
528
|
function d(m, g) {
|
|
529
529
|
var x;
|
|
530
530
|
const v = ((x = g == null ? void 0 : g[s]) == null ? void 0 : x[p]) || u, N = M.useContext(v);
|
|
531
531
|
if (N) return N;
|
|
532
532
|
if (c !== void 0) return c;
|
|
533
|
-
throw new Error(`\`${m}\` must be used within \`${
|
|
533
|
+
throw new Error(`\`${m}\` must be used within \`${i}\``);
|
|
534
534
|
}
|
|
535
535
|
return [f, d];
|
|
536
536
|
}
|
|
537
537
|
const l = () => {
|
|
538
|
-
const
|
|
538
|
+
const i = a.map((c) => M.createContext(c));
|
|
539
539
|
return function(u) {
|
|
540
|
-
const p = (u == null ? void 0 : u[s]) ||
|
|
540
|
+
const p = (u == null ? void 0 : u[s]) || i;
|
|
541
541
|
return M.useMemo(
|
|
542
542
|
() => ({ [`__scope${s}`]: { ...u, [s]: p } }),
|
|
543
543
|
[u, p]
|
|
544
544
|
);
|
|
545
545
|
};
|
|
546
546
|
};
|
|
547
|
-
return l.scopeName = s, [t,
|
|
547
|
+
return l.scopeName = s, [t, Ba(l, ...n)];
|
|
548
548
|
}
|
|
549
|
-
function
|
|
549
|
+
function Ba(...s) {
|
|
550
550
|
const n = s[0];
|
|
551
551
|
if (s.length === 1) return n;
|
|
552
552
|
const a = () => {
|
|
@@ -554,9 +554,9 @@ function Qa(...s) {
|
|
|
554
554
|
useScope: l(),
|
|
555
555
|
scopeName: l.scopeName
|
|
556
556
|
}));
|
|
557
|
-
return function(
|
|
557
|
+
return function(i) {
|
|
558
558
|
const c = t.reduce((u, { useScope: p, scopeName: f }) => {
|
|
559
|
-
const m = p(
|
|
559
|
+
const m = p(i)[`__scope${f}`];
|
|
560
560
|
return { ...u, ...m };
|
|
561
561
|
}, {});
|
|
562
562
|
return M.useMemo(() => ({ [`__scope${n.scopeName}`]: c }), [c]);
|
|
@@ -564,7 +564,7 @@ function Qa(...s) {
|
|
|
564
564
|
};
|
|
565
565
|
return a.scopeName = n.scopeName, a;
|
|
566
566
|
}
|
|
567
|
-
var
|
|
567
|
+
var Ja = [
|
|
568
568
|
"a",
|
|
569
569
|
"button",
|
|
570
570
|
"div",
|
|
@@ -582,86 +582,86 @@ var Ka = [
|
|
|
582
582
|
"span",
|
|
583
583
|
"svg",
|
|
584
584
|
"ul"
|
|
585
|
-
],
|
|
586
|
-
const a =
|
|
585
|
+
], Pe = Ja.reduce((s, n) => {
|
|
586
|
+
const a = Ws(`Primitive.${n}`), t = M.forwardRef((l, i) => {
|
|
587
587
|
const { asChild: c, ...u } = l, p = c ? a : n;
|
|
588
|
-
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ e(p, { ...u, ref:
|
|
588
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ e(p, { ...u, ref: i });
|
|
589
589
|
});
|
|
590
590
|
return t.displayName = `Primitive.${n}`, { ...s, [n]: t };
|
|
591
591
|
}, {});
|
|
592
|
-
function
|
|
593
|
-
return
|
|
594
|
-
|
|
592
|
+
function Wa() {
|
|
593
|
+
return Ea.useSyncExternalStore(
|
|
594
|
+
Xa,
|
|
595
595
|
() => !0,
|
|
596
596
|
() => !1
|
|
597
597
|
);
|
|
598
598
|
}
|
|
599
|
-
function
|
|
599
|
+
function Xa() {
|
|
600
600
|
return () => {
|
|
601
601
|
};
|
|
602
602
|
}
|
|
603
|
-
var
|
|
603
|
+
var Ge = "Avatar", [Ya] = Ka(Ge), [Za, gs] = Ya(Ge), fs = M.forwardRef(
|
|
604
604
|
(s, n) => {
|
|
605
|
-
const { __scopeAvatar: a, ...t } = s, [l,
|
|
605
|
+
const { __scopeAvatar: a, ...t } = s, [l, i] = M.useState("idle");
|
|
606
606
|
return /* @__PURE__ */ e(
|
|
607
|
-
|
|
607
|
+
Za,
|
|
608
608
|
{
|
|
609
609
|
scope: a,
|
|
610
610
|
imageLoadingStatus: l,
|
|
611
|
-
onImageLoadingStatusChange:
|
|
612
|
-
children: /* @__PURE__ */ e(
|
|
611
|
+
onImageLoadingStatusChange: i,
|
|
612
|
+
children: /* @__PURE__ */ e(Pe.span, { ...t, ref: n })
|
|
613
613
|
}
|
|
614
614
|
);
|
|
615
615
|
}
|
|
616
616
|
);
|
|
617
|
-
|
|
618
|
-
var
|
|
617
|
+
fs.displayName = Ge;
|
|
618
|
+
var vs = "AvatarImage", bs = M.forwardRef(
|
|
619
619
|
(s, n) => {
|
|
620
620
|
const { __scopeAvatar: a, src: t, onLoadingStatusChange: l = () => {
|
|
621
|
-
}, ...
|
|
621
|
+
}, ...i } = s, c = gs(vs, a), u = et(t, i), p = Xs((f) => {
|
|
622
622
|
l(f), c.onImageLoadingStatusChange(f);
|
|
623
623
|
});
|
|
624
|
-
return
|
|
624
|
+
return ye(() => {
|
|
625
625
|
u !== "idle" && p(u);
|
|
626
|
-
}, [u, p]), u === "loaded" ? /* @__PURE__ */ e(
|
|
626
|
+
}, [u, p]), u === "loaded" ? /* @__PURE__ */ e(Pe.img, { ...i, ref: n, src: t }) : null;
|
|
627
627
|
}
|
|
628
628
|
);
|
|
629
|
-
|
|
630
|
-
var
|
|
629
|
+
bs.displayName = vs;
|
|
630
|
+
var Ns = "AvatarFallback", ys = M.forwardRef(
|
|
631
631
|
(s, n) => {
|
|
632
|
-
const { __scopeAvatar: a, delayMs: t, ...l } = s,
|
|
632
|
+
const { __scopeAvatar: a, delayMs: t, ...l } = s, i = gs(Ns, a), [c, u] = M.useState(t === void 0);
|
|
633
633
|
return M.useEffect(() => {
|
|
634
634
|
if (t !== void 0) {
|
|
635
635
|
const p = window.setTimeout(() => u(!0), t);
|
|
636
636
|
return () => window.clearTimeout(p);
|
|
637
637
|
}
|
|
638
|
-
}, [t]), c &&
|
|
638
|
+
}, [t]), c && i.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(Pe.span, { ...l, ref: n }) : null;
|
|
639
639
|
}
|
|
640
640
|
);
|
|
641
|
-
|
|
642
|
-
function
|
|
641
|
+
ys.displayName = Ns;
|
|
642
|
+
function Be(s, n) {
|
|
643
643
|
return s ? n ? (s.src !== n && (s.src = n), s.complete && s.naturalWidth > 0 ? "loaded" : "loading") : "error" : "idle";
|
|
644
644
|
}
|
|
645
|
-
function
|
|
646
|
-
const t =
|
|
647
|
-
() =>
|
|
645
|
+
function et(s, { referrerPolicy: n, crossOrigin: a }) {
|
|
646
|
+
const t = Wa(), l = M.useRef(null), i = t ? (l.current || (l.current = new window.Image()), l.current) : null, [c, u] = M.useState(
|
|
647
|
+
() => Be(i, s)
|
|
648
648
|
);
|
|
649
|
-
return
|
|
650
|
-
u(
|
|
651
|
-
}, [
|
|
649
|
+
return ye(() => {
|
|
650
|
+
u(Be(i, s));
|
|
651
|
+
}, [i, s]), ye(() => {
|
|
652
652
|
const p = (m) => () => {
|
|
653
653
|
u(m);
|
|
654
654
|
};
|
|
655
|
-
if (!
|
|
655
|
+
if (!i) return;
|
|
656
656
|
const f = p("loaded"), d = p("error");
|
|
657
|
-
return
|
|
658
|
-
|
|
657
|
+
return i.addEventListener("load", f), i.addEventListener("error", d), n && (i.referrerPolicy = n), typeof a == "string" && (i.crossOrigin = a), () => {
|
|
658
|
+
i.removeEventListener("load", f), i.removeEventListener("error", d);
|
|
659
659
|
};
|
|
660
|
-
}, [
|
|
660
|
+
}, [i, a, n]), c;
|
|
661
661
|
}
|
|
662
|
-
var
|
|
663
|
-
const
|
|
664
|
-
|
|
662
|
+
var xs = fs, ws = bs, Cs = ys;
|
|
663
|
+
const Fe = M.forwardRef(({ className: s, ...n }, a) => /* @__PURE__ */ e(
|
|
664
|
+
xs,
|
|
665
665
|
{
|
|
666
666
|
ref: a,
|
|
667
667
|
className: ie(
|
|
@@ -671,18 +671,18 @@ const Ge = M.forwardRef(({ className: s, ...n }, a) => /* @__PURE__ */ e(
|
|
|
671
671
|
...n
|
|
672
672
|
}
|
|
673
673
|
));
|
|
674
|
-
|
|
675
|
-
const
|
|
676
|
-
|
|
674
|
+
Fe.displayName = xs.displayName;
|
|
675
|
+
const st = M.forwardRef(({ className: s, ...n }, a) => /* @__PURE__ */ e(
|
|
676
|
+
ws,
|
|
677
677
|
{
|
|
678
678
|
ref: a,
|
|
679
679
|
className: ie("aspect-square h-full w-full", s),
|
|
680
680
|
...n
|
|
681
681
|
}
|
|
682
682
|
));
|
|
683
|
-
|
|
684
|
-
const
|
|
685
|
-
|
|
683
|
+
st.displayName = ws.displayName;
|
|
684
|
+
const Oe = M.forwardRef(({ className: s, ...n }, a) => /* @__PURE__ */ e(
|
|
685
|
+
Cs,
|
|
686
686
|
{
|
|
687
687
|
ref: a,
|
|
688
688
|
className: ie(
|
|
@@ -692,19 +692,19 @@ const Fe = M.forwardRef(({ className: s, ...n }, a) => /* @__PURE__ */ e(
|
|
|
692
692
|
...n
|
|
693
693
|
}
|
|
694
694
|
));
|
|
695
|
-
|
|
696
|
-
function
|
|
695
|
+
Oe.displayName = Cs.displayName;
|
|
696
|
+
function at({
|
|
697
697
|
open: s,
|
|
698
698
|
onOpenChange: n,
|
|
699
699
|
group: a,
|
|
700
700
|
onUpdate: t
|
|
701
701
|
}) {
|
|
702
|
-
const [l,
|
|
702
|
+
const [l, i] = b("members"), [c, u] = b(""), [p, f] = b([]), [d, m] = b([]), { data: g, isLoading: v, refetch: N } = Ys(a.id), x = a.type === "TENANT_GROUP" ? "tenant" : "organization", { users: C, isLoading: O } = Zs({
|
|
703
703
|
type: x,
|
|
704
704
|
tenantId: a.tenantId || void 0,
|
|
705
705
|
active: !0,
|
|
706
706
|
limit: 100
|
|
707
|
-
}),
|
|
707
|
+
}), R = Va(), G = Ha(), 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(() => {
|
|
708
708
|
if (!c) return P;
|
|
709
709
|
const h = c.toLowerCase();
|
|
710
710
|
return P.filter(
|
|
@@ -718,20 +718,20 @@ function et({
|
|
|
718
718
|
const h = c.toLowerCase();
|
|
719
719
|
return A.filter(
|
|
720
720
|
(D) => {
|
|
721
|
-
var I, _,
|
|
722
|
-
return ((_ = (I = D.user) == null ? void 0 : I.name) == null ? void 0 : _.toLowerCase().includes(h)) || ((
|
|
721
|
+
var I, _, X, Y;
|
|
722
|
+
return ((_ = (I = D.user) == null ? void 0 : I.name) == null ? void 0 : _.toLowerCase().includes(h)) || ((Y = (X = D.user) == null ? void 0 : X.email) == null ? void 0 : Y.toLowerCase().includes(h));
|
|
723
723
|
}
|
|
724
724
|
);
|
|
725
725
|
}, [A, c]), V = async () => {
|
|
726
726
|
if (p.length !== 0)
|
|
727
727
|
try {
|
|
728
|
-
await
|
|
728
|
+
await R.mutateAsync({
|
|
729
729
|
groupId: a.id,
|
|
730
730
|
data: {
|
|
731
731
|
userIds: p,
|
|
732
732
|
userType: x === "tenant" ? "tenant" : "org"
|
|
733
733
|
}
|
|
734
|
-
}), f([]),
|
|
734
|
+
}), f([]), i("members"), N(), t == null || t();
|
|
735
735
|
} catch (h) {
|
|
736
736
|
console.error("Failed to add members:", h);
|
|
737
737
|
}
|
|
@@ -756,9 +756,9 @@ function et({
|
|
|
756
756
|
(D) => D.includes(h) ? D.filter((I) => I !== h) : [...D, h]
|
|
757
757
|
);
|
|
758
758
|
};
|
|
759
|
-
return /* @__PURE__ */ e(E, { children: /* @__PURE__ */ e(
|
|
760
|
-
/* @__PURE__ */ r(
|
|
761
|
-
/* @__PURE__ */ e(
|
|
759
|
+
return /* @__PURE__ */ e(E, { children: /* @__PURE__ */ e(Le, { open: s, onOpenChange: n, children: /* @__PURE__ */ r(Ie, { className: "max-w-3xl max-h-[80vh]", "aria-describedby": "group-members-description", children: [
|
|
760
|
+
/* @__PURE__ */ r(Te, { children: [
|
|
761
|
+
/* @__PURE__ */ e(Ee, { children: a.name }),
|
|
762
762
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2 mt-1", children: /* @__PURE__ */ r("p", { className: "text-sm text-muted-foreground", children: [
|
|
763
763
|
A.length,
|
|
764
764
|
" ",
|
|
@@ -770,18 +770,18 @@ function et({
|
|
|
770
770
|
" group"
|
|
771
771
|
] })
|
|
772
772
|
] }),
|
|
773
|
-
/* @__PURE__ */ r(
|
|
774
|
-
|
|
773
|
+
/* @__PURE__ */ r(ts, { value: l, onValueChange: (h) => {
|
|
774
|
+
i(h), u(""), m([]);
|
|
775
775
|
}, className: "mt-4", children: [
|
|
776
|
-
/* @__PURE__ */ r(
|
|
776
|
+
/* @__PURE__ */ r(rs, { className: "grid w-full grid-cols-2", children: [
|
|
777
777
|
/* @__PURE__ */ e(ne, { value: "members", children: "Current Members" }),
|
|
778
778
|
/* @__PURE__ */ e(ne, { value: "add", children: "Add Members" })
|
|
779
779
|
] }),
|
|
780
780
|
/* @__PURE__ */ r(oe, { value: "members", className: "mt-4 space-y-4", children: [
|
|
781
781
|
/* @__PURE__ */ r("div", { className: "relative", children: [
|
|
782
|
-
/* @__PURE__ */ e(
|
|
782
|
+
/* @__PURE__ */ e(xe, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
783
783
|
/* @__PURE__ */ e(
|
|
784
|
-
|
|
784
|
+
J,
|
|
785
785
|
{
|
|
786
786
|
placeholder: "Search members...",
|
|
787
787
|
value: c,
|
|
@@ -790,12 +790,12 @@ function et({
|
|
|
790
790
|
}
|
|
791
791
|
)
|
|
792
792
|
] }),
|
|
793
|
-
/* @__PURE__ */ e(
|
|
793
|
+
/* @__PURE__ */ e(we, { 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(Ce, { 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
794
|
/* @__PURE__ */ e(z, { className: "h-12 w-12 mb-3 opacity-50" }),
|
|
795
795
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: c ? "No members found" : "No members yet" }),
|
|
796
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' })
|
|
797
797
|
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: w.map((h) => /* @__PURE__ */ e(
|
|
798
|
-
|
|
798
|
+
tt,
|
|
799
799
|
{
|
|
800
800
|
member: h,
|
|
801
801
|
selected: d.includes(h.userId),
|
|
@@ -821,7 +821,7 @@ function et({
|
|
|
821
821
|
/* @__PURE__ */ e(q, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
822
822
|
"Removing..."
|
|
823
823
|
] }) : /* @__PURE__ */ r(E, { children: [
|
|
824
|
-
/* @__PURE__ */ e(
|
|
824
|
+
/* @__PURE__ */ e(ns, { className: "mr-2 h-4 w-4" }),
|
|
825
825
|
"Remove Selected"
|
|
826
826
|
] })
|
|
827
827
|
}
|
|
@@ -830,9 +830,9 @@ function et({
|
|
|
830
830
|
] }),
|
|
831
831
|
/* @__PURE__ */ r(oe, { value: "add", className: "mt-4 space-y-4", children: [
|
|
832
832
|
/* @__PURE__ */ r("div", { className: "relative", children: [
|
|
833
|
-
/* @__PURE__ */ e(
|
|
833
|
+
/* @__PURE__ */ e(xe, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
834
834
|
/* @__PURE__ */ e(
|
|
835
|
-
|
|
835
|
+
J,
|
|
836
836
|
{
|
|
837
837
|
placeholder: "Search users to add...",
|
|
838
838
|
value: c,
|
|
@@ -841,12 +841,12 @@ function et({
|
|
|
841
841
|
}
|
|
842
842
|
)
|
|
843
843
|
] }),
|
|
844
|
-
/* @__PURE__ */ e(
|
|
845
|
-
/* @__PURE__ */ e(
|
|
844
|
+
/* @__PURE__ */ e(we, { className: "h-[300px]", children: O ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((h) => /* @__PURE__ */ e(Ce, { 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: [
|
|
845
|
+
/* @__PURE__ */ e(Se, { className: "h-12 w-12 mb-3 opacity-50" }),
|
|
846
846
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: "No available users" }),
|
|
847
847
|
/* @__PURE__ */ e("p", { className: "text-xs mt-1", children: c ? "Try a different search" : "All eligible users are already members" })
|
|
848
848
|
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: j.map((h) => /* @__PURE__ */ e(
|
|
849
|
-
|
|
849
|
+
rt,
|
|
850
850
|
{
|
|
851
851
|
user: h,
|
|
852
852
|
selected: p.includes(h.id),
|
|
@@ -865,12 +865,12 @@ function et({
|
|
|
865
865
|
L,
|
|
866
866
|
{
|
|
867
867
|
onClick: V,
|
|
868
|
-
disabled:
|
|
869
|
-
children:
|
|
868
|
+
disabled: R.isPending,
|
|
869
|
+
children: R.isPending ? /* @__PURE__ */ r(E, { children: [
|
|
870
870
|
/* @__PURE__ */ e(q, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
871
871
|
"Adding..."
|
|
872
872
|
] }) : /* @__PURE__ */ r(E, { children: [
|
|
873
|
-
/* @__PURE__ */ e(
|
|
873
|
+
/* @__PURE__ */ e(Se, { className: "mr-2 h-4 w-4" }),
|
|
874
874
|
"Add Members"
|
|
875
875
|
] })
|
|
876
876
|
}
|
|
@@ -880,21 +880,21 @@ function et({
|
|
|
880
880
|
] })
|
|
881
881
|
] }) }) });
|
|
882
882
|
}
|
|
883
|
-
function
|
|
883
|
+
function tt({
|
|
884
884
|
member: s,
|
|
885
885
|
selected: n,
|
|
886
886
|
onToggle: a
|
|
887
887
|
}) {
|
|
888
|
-
var l,
|
|
889
|
-
const t = ((
|
|
888
|
+
var l, i, c, u;
|
|
889
|
+
const t = ((i = (l = s.user) == null ? void 0 : l.name) == null ? void 0 : i.split(" ").map((p) => p[0]).join("").toUpperCase()) || "?";
|
|
890
890
|
return /* @__PURE__ */ r(
|
|
891
891
|
"div",
|
|
892
892
|
{
|
|
893
893
|
className: "flex items-center gap-3 p-3 rounded-lg border bg-card hover:bg-muted/50 cursor-pointer",
|
|
894
894
|
onClick: a,
|
|
895
895
|
children: [
|
|
896
|
-
/* @__PURE__ */ e(
|
|
897
|
-
/* @__PURE__ */ e(
|
|
896
|
+
/* @__PURE__ */ e(os, { checked: n }),
|
|
897
|
+
/* @__PURE__ */ e(Fe, { className: "h-8 w-8", children: /* @__PURE__ */ e(Oe, { className: "text-xs", children: t }) }),
|
|
898
898
|
/* @__PURE__ */ r("div", { className: "flex-1", children: [
|
|
899
899
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: ((c = s.user) == null ? void 0 : c.name) || "Unknown User" }),
|
|
900
900
|
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: (u = s.user) == null ? void 0 : u.email })
|
|
@@ -903,21 +903,21 @@ function st({
|
|
|
903
903
|
}
|
|
904
904
|
);
|
|
905
905
|
}
|
|
906
|
-
function
|
|
906
|
+
function rt({
|
|
907
907
|
user: s,
|
|
908
908
|
selected: n,
|
|
909
909
|
onToggle: a
|
|
910
910
|
}) {
|
|
911
911
|
var l;
|
|
912
|
-
const t = ((l = s.name) == null ? void 0 : l.split(" ").map((
|
|
912
|
+
const t = ((l = s.name) == null ? void 0 : l.split(" ").map((i) => i[0]).join("").toUpperCase()) || "?";
|
|
913
913
|
return /* @__PURE__ */ r(
|
|
914
914
|
"div",
|
|
915
915
|
{
|
|
916
916
|
className: "flex items-center gap-3 p-3 rounded-lg border bg-card hover:bg-muted/50 cursor-pointer",
|
|
917
917
|
onClick: a,
|
|
918
918
|
children: [
|
|
919
|
-
/* @__PURE__ */ e(
|
|
920
|
-
/* @__PURE__ */ e(
|
|
919
|
+
/* @__PURE__ */ e(os, { checked: n }),
|
|
920
|
+
/* @__PURE__ */ e(Fe, { className: "h-8 w-8", children: /* @__PURE__ */ e(Oe, { className: "text-xs", children: t }) }),
|
|
921
921
|
/* @__PURE__ */ r("div", { className: "flex-1", children: [
|
|
922
922
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: s.name }),
|
|
923
923
|
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: s.email })
|
|
@@ -926,15 +926,15 @@ function at({
|
|
|
926
926
|
}
|
|
927
927
|
);
|
|
928
928
|
}
|
|
929
|
-
function
|
|
929
|
+
function nt({
|
|
930
930
|
open: s,
|
|
931
931
|
onOpenChange: n
|
|
932
932
|
}) {
|
|
933
|
-
const [a, t] = b("groups"), [l,
|
|
933
|
+
const [a, t] = b("groups"), [l, i] = b(""), [c, u] = b(null), [p, f] = b(!1), [d, m] = b(null), { tokenProps: g } = U(), { currentUser: v } = is(), N = ja(), x = (v == null ? void 0 : v.type) === "tenant", C = g == null ? void 0 : g.tenantId, { groups: O, isLoading: R, refetch: G } = ea({
|
|
934
934
|
type: x ? "TENANT_GROUP" : "all",
|
|
935
935
|
tenantId: x ? C : void 0,
|
|
936
936
|
includeMembers: !1
|
|
937
|
-
}), A =
|
|
937
|
+
}), A = O.filter(
|
|
938
938
|
(w) => {
|
|
939
939
|
var V;
|
|
940
940
|
return w.name.toLowerCase().includes(l.toLowerCase()) || ((V = w.description) == null ? void 0 : V.toLowerCase().includes(l.toLowerCase()));
|
|
@@ -952,44 +952,44 @@ function tt({
|
|
|
952
952
|
t("groups"), G();
|
|
953
953
|
};
|
|
954
954
|
return /* @__PURE__ */ r(E, { children: [
|
|
955
|
-
/* @__PURE__ */ e(
|
|
956
|
-
/* @__PURE__ */ r(
|
|
957
|
-
/* @__PURE__ */ r(
|
|
955
|
+
/* @__PURE__ */ e(Le, { open: s, onOpenChange: n, children: /* @__PURE__ */ r(Ie, { className: "max-w-4xl max-h-[80vh]", children: [
|
|
956
|
+
/* @__PURE__ */ r(Te, { children: [
|
|
957
|
+
/* @__PURE__ */ r(Ee, { className: "flex items-center gap-2", children: [
|
|
958
958
|
/* @__PURE__ */ e(z, { className: "h-5 w-5" }),
|
|
959
959
|
"Group Management"
|
|
960
960
|
] }),
|
|
961
|
-
/* @__PURE__ */ e(
|
|
961
|
+
/* @__PURE__ */ e(Ze, { children: "Manage your groups, create new groups, and control group membership" })
|
|
962
962
|
] }),
|
|
963
|
-
/* @__PURE__ */ r(
|
|
964
|
-
/* @__PURE__ */ r(
|
|
963
|
+
/* @__PURE__ */ r(ts, { value: a, onValueChange: t, className: "mt-4", children: [
|
|
964
|
+
/* @__PURE__ */ r(rs, { className: "grid w-full grid-cols-2", children: [
|
|
965
965
|
/* @__PURE__ */ r(ne, { value: "groups", className: "flex items-center gap-2", children: [
|
|
966
966
|
/* @__PURE__ */ e(z, { className: "h-4 w-4" }),
|
|
967
967
|
"Groups"
|
|
968
968
|
] }),
|
|
969
969
|
/* @__PURE__ */ r(ne, { value: "create", className: "flex items-center gap-2", children: [
|
|
970
|
-
/* @__PURE__ */ e(
|
|
970
|
+
/* @__PURE__ */ e(Ae, { className: "h-4 w-4" }),
|
|
971
971
|
"Create Group"
|
|
972
972
|
] })
|
|
973
973
|
] }),
|
|
974
974
|
/* @__PURE__ */ e(oe, { value: "groups", className: "mt-4", children: /* @__PURE__ */ r("div", { className: "space-y-4", children: [
|
|
975
975
|
/* @__PURE__ */ r("div", { className: "relative", children: [
|
|
976
|
-
/* @__PURE__ */ e(
|
|
976
|
+
/* @__PURE__ */ e(xe, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
977
977
|
/* @__PURE__ */ e(
|
|
978
|
-
|
|
978
|
+
J,
|
|
979
979
|
{
|
|
980
980
|
placeholder: "Search groups...",
|
|
981
981
|
value: l,
|
|
982
|
-
onChange: (w) =>
|
|
982
|
+
onChange: (w) => i(w.target.value),
|
|
983
983
|
className: "pl-10"
|
|
984
984
|
}
|
|
985
985
|
)
|
|
986
986
|
] }),
|
|
987
|
-
/* @__PURE__ */ e(
|
|
987
|
+
/* @__PURE__ */ e(we, { className: "h-[400px]", children: R ? /* @__PURE__ */ e("div", { className: "space-y-3", children: [1, 2, 3].map((w) => /* @__PURE__ */ e(Ce, { 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
988
|
/* @__PURE__ */ e(z, { className: "h-12 w-12 mb-3 opacity-50" }),
|
|
989
989
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: "No groups found" }),
|
|
990
990
|
/* @__PURE__ */ e("p", { className: "text-xs mt-1", children: l ? "Try a different search" : "Create your first group to get started" })
|
|
991
991
|
] }) : /* @__PURE__ */ e("div", { className: "space-y-3", children: A.map((w) => /* @__PURE__ */ e(
|
|
992
|
-
|
|
992
|
+
ot,
|
|
993
993
|
{
|
|
994
994
|
group: w,
|
|
995
995
|
onManageMembers: () => P(w),
|
|
@@ -1000,7 +1000,7 @@ function tt({
|
|
|
1000
1000
|
)) }) })
|
|
1001
1001
|
] }) }),
|
|
1002
1002
|
/* @__PURE__ */ e(oe, { value: "create", className: "mt-4", children: /* @__PURE__ */ e(
|
|
1003
|
-
|
|
1003
|
+
Qa,
|
|
1004
1004
|
{
|
|
1005
1005
|
onSuccess: j,
|
|
1006
1006
|
tenantId: C,
|
|
@@ -1010,7 +1010,7 @@ function tt({
|
|
|
1010
1010
|
] })
|
|
1011
1011
|
] }) }),
|
|
1012
1012
|
c && /* @__PURE__ */ e(
|
|
1013
|
-
|
|
1013
|
+
at,
|
|
1014
1014
|
{
|
|
1015
1015
|
open: p,
|
|
1016
1016
|
onOpenChange: f,
|
|
@@ -1019,23 +1019,23 @@ function tt({
|
|
|
1019
1019
|
}
|
|
1020
1020
|
),
|
|
1021
1021
|
/* @__PURE__ */ e(
|
|
1022
|
-
|
|
1022
|
+
ls,
|
|
1023
1023
|
{
|
|
1024
1024
|
open: !!d,
|
|
1025
1025
|
onOpenChange: () => m(null),
|
|
1026
|
-
children: /* @__PURE__ */ r(
|
|
1027
|
-
/* @__PURE__ */ r(
|
|
1028
|
-
/* @__PURE__ */ e(
|
|
1029
|
-
/* @__PURE__ */ r(
|
|
1026
|
+
children: /* @__PURE__ */ r(cs, { children: [
|
|
1027
|
+
/* @__PURE__ */ r(ds, { children: [
|
|
1028
|
+
/* @__PURE__ */ e(us, { children: "Delete Group" }),
|
|
1029
|
+
/* @__PURE__ */ r(ms, { children: [
|
|
1030
1030
|
'Are you sure you want to delete "',
|
|
1031
1031
|
d == null ? void 0 : d.name,
|
|
1032
1032
|
'"? This action cannot be undone and will remove all members from the group.'
|
|
1033
1033
|
] })
|
|
1034
1034
|
] }),
|
|
1035
|
-
/* @__PURE__ */ r(
|
|
1036
|
-
/* @__PURE__ */ e(
|
|
1035
|
+
/* @__PURE__ */ r(hs, { children: [
|
|
1036
|
+
/* @__PURE__ */ e(ps, { children: "Cancel" }),
|
|
1037
1037
|
/* @__PURE__ */ e(
|
|
1038
|
-
|
|
1038
|
+
De,
|
|
1039
1039
|
{
|
|
1040
1040
|
onClick: F,
|
|
1041
1041
|
disabled: N.isPending,
|
|
@@ -1052,7 +1052,7 @@ function tt({
|
|
|
1052
1052
|
)
|
|
1053
1053
|
] });
|
|
1054
1054
|
}
|
|
1055
|
-
function
|
|
1055
|
+
function ot({
|
|
1056
1056
|
group: s,
|
|
1057
1057
|
onManageMembers: n,
|
|
1058
1058
|
onDelete: a,
|
|
@@ -1074,7 +1074,7 @@ function rt({
|
|
|
1074
1074
|
] }),
|
|
1075
1075
|
/* @__PURE__ */ r("span", { children: [
|
|
1076
1076
|
"Created ",
|
|
1077
|
-
|
|
1077
|
+
sa(new Date(s.createdAt), "MMM d, yyyy")
|
|
1078
1078
|
] })
|
|
1079
1079
|
] })
|
|
1080
1080
|
] }),
|
|
@@ -1086,7 +1086,7 @@ function rt({
|
|
|
1086
1086
|
size: "sm",
|
|
1087
1087
|
onClick: n,
|
|
1088
1088
|
title: "Manage members",
|
|
1089
|
-
children: /* @__PURE__ */ e(
|
|
1089
|
+
children: /* @__PURE__ */ e(Se, { className: "h-4 w-4" })
|
|
1090
1090
|
}
|
|
1091
1091
|
),
|
|
1092
1092
|
l && /* @__PURE__ */ e(
|
|
@@ -1097,152 +1097,152 @@ function rt({
|
|
|
1097
1097
|
onClick: a,
|
|
1098
1098
|
title: "Delete group",
|
|
1099
1099
|
className: "text-destructive hover:text-destructive",
|
|
1100
|
-
children: /* @__PURE__ */ e(
|
|
1100
|
+
children: /* @__PURE__ */ e(ns, { className: "h-4 w-4" })
|
|
1101
1101
|
}
|
|
1102
1102
|
)
|
|
1103
1103
|
] })
|
|
1104
1104
|
] }) });
|
|
1105
1105
|
}
|
|
1106
|
-
function
|
|
1107
|
-
var
|
|
1106
|
+
function gt() {
|
|
1107
|
+
var ze, je, Ve;
|
|
1108
1108
|
const {
|
|
1109
1109
|
authToken: s,
|
|
1110
1110
|
tokenProps: n,
|
|
1111
1111
|
id: a
|
|
1112
|
-
} = U(), { isLocalDev: t } =
|
|
1113
|
-
y((
|
|
1114
|
-
const u = y((
|
|
1115
|
-
y((
|
|
1112
|
+
} = U(), { isLocalDev: t } = aa(), { permissions: l } = Ma(), i = ta(), { isLoading: c } = ra();
|
|
1113
|
+
y((o) => o.theme);
|
|
1114
|
+
const u = y((o) => o.lenses), p = y((o) => o.selectedLensId), f = u == null ? void 0 : u.find((o) => o.id === p), d = y((o) => o.dashboard);
|
|
1115
|
+
y((o) => o.selectedSheetId);
|
|
1116
1116
|
const m = y(
|
|
1117
|
-
(
|
|
1118
|
-
), { setDashboardTitle: g } = y((
|
|
1119
|
-
(
|
|
1120
|
-
), ue = y((
|
|
1121
|
-
|
|
1117
|
+
(o) => o.isDashboardEditing
|
|
1118
|
+
), { setDashboardTitle: g } = y((o) => o.actions), [v, N] = b(!1), [x, C] = b(!1), [O, R] = b(!1), [G, A] = b(!1), [F, P] = b(null), [j, w] = b(!1), V = y((o) => o.isDashboardPanelOpen), de = y(
|
|
1119
|
+
(o) => o.actions.setIsDashboardPanelOpen
|
|
1120
|
+
), ue = y((o) => o.filterValues), S = y((o) => o.isVisualEditing);
|
|
1121
|
+
Qe((o) => o.card);
|
|
1122
1122
|
const h = te(
|
|
1123
|
-
(
|
|
1123
|
+
(o) => o.selectedDashboard
|
|
1124
1124
|
), D = te(
|
|
1125
|
-
(
|
|
1125
|
+
(o) => o.initialDashboard
|
|
1126
1126
|
);
|
|
1127
|
-
te((
|
|
1128
|
-
const I = h ? (
|
|
1129
|
-
(
|
|
1130
|
-
),
|
|
1131
|
-
(
|
|
1132
|
-
), { setIsDashboardEditing: Re, setShowDashboardJSON:
|
|
1133
|
-
(
|
|
1134
|
-
), { setInitialDashboard:
|
|
1135
|
-
(
|
|
1136
|
-
), { resources: Z } =
|
|
1137
|
-
id:
|
|
1138
|
-
title: (d == null ? void 0 : d.title) ||
|
|
1139
|
-
} : null, { handleAddNewFrame:
|
|
1127
|
+
te((o) => o.selectedVisual), y((o) => o.selectedFrameId), Qe((o) => o.frame);
|
|
1128
|
+
const I = h ? (je = h == null ? void 0 : h.permissions) == null ? void 0 : je.canEdit : (ze = D == null ? void 0 : D.permissions) == null ? void 0 : ze.canEdit, _ = y((o) => o.showFilters), X = na((o) => o.setPanelOpen), Y = y(
|
|
1129
|
+
(o) => o.showDashboardJSON
|
|
1130
|
+
), me = y((o) => o.onSaveFunction), Ss = y(
|
|
1131
|
+
(o) => o.actions.setShowFilters
|
|
1132
|
+
), { setIsDashboardEditing: Re, setShowDashboardJSON: Ue } = y(
|
|
1133
|
+
(o) => o.actions
|
|
1134
|
+
), { setInitialDashboard: _e, clearSelectedDashboard: Ds } = te(
|
|
1135
|
+
(o) => o.actions
|
|
1136
|
+
), { resources: Z } = oa(be.DASHBOARD), { currentUser: Ms } = is(), ks = ia(Ms), H = h || D, $e = H ? {
|
|
1137
|
+
id: H.id,
|
|
1138
|
+
title: (d == null ? void 0 : d.title) || H.title || "Dashboard"
|
|
1139
|
+
} : null, { handleAddNewFrame: Ls } = la(), [Q, he] = b(!1), [As, ee] = b(!1), se = ca(be.DASHBOARD), [K, pe] = b(
|
|
1140
1140
|
null
|
|
1141
|
-
),
|
|
1141
|
+
), Is = async (o, T) => {
|
|
1142
1142
|
if (!(d != null && d.id)) {
|
|
1143
1143
|
console.log("No dashboard ID found");
|
|
1144
1144
|
return;
|
|
1145
1145
|
}
|
|
1146
1146
|
console.log("Updating dashboard title:", {
|
|
1147
1147
|
dashboardId: d.id,
|
|
1148
|
-
newTitle:
|
|
1148
|
+
newTitle: o,
|
|
1149
1149
|
previousTitle: T
|
|
1150
1150
|
}), se.mutate(
|
|
1151
1151
|
{
|
|
1152
1152
|
resourceId: d.id,
|
|
1153
|
-
data: { title:
|
|
1153
|
+
data: { title: o }
|
|
1154
1154
|
},
|
|
1155
1155
|
{
|
|
1156
1156
|
onSuccess: () => {
|
|
1157
1157
|
console.log("Dashboard title updated successfully"), k.success("Dashboard title updated");
|
|
1158
1158
|
},
|
|
1159
|
-
onError: (
|
|
1160
|
-
console.error("Failed to update dashboard title:",
|
|
1159
|
+
onError: (B) => {
|
|
1160
|
+
console.error("Failed to update dashboard title:", B), k.error("Failed to update dashboard title"), g(T);
|
|
1161
1161
|
}
|
|
1162
1162
|
}
|
|
1163
1163
|
);
|
|
1164
1164
|
};
|
|
1165
|
-
|
|
1165
|
+
ya(() => {
|
|
1166
1166
|
if (Z && Z.length > 0) {
|
|
1167
|
-
const
|
|
1168
|
-
if (
|
|
1167
|
+
const o = d == null ? void 0 : d.id;
|
|
1168
|
+
if (o) {
|
|
1169
1169
|
const T = Z.find(
|
|
1170
|
-
(
|
|
1170
|
+
(B) => B.id === o
|
|
1171
1171
|
);
|
|
1172
|
-
T &&
|
|
1172
|
+
T && _e(T);
|
|
1173
1173
|
}
|
|
1174
1174
|
}
|
|
1175
|
-
}, [Z, d == null ? void 0 : d.id,
|
|
1176
|
-
const ae = n.orgUserId || n.tenantId,
|
|
1175
|
+
}, [Z, d == null ? void 0 : d.id, _e]);
|
|
1176
|
+
const ae = n.orgUserId || n.tenantId, Ts = m && !S && ae && I, { setDashboard: Es } = y((o) => o.actions), Ps = () => {
|
|
1177
1177
|
Re(!0);
|
|
1178
|
-
},
|
|
1179
|
-
Re(!1),
|
|
1178
|
+
}, ge = () => {
|
|
1179
|
+
Re(!1), Ue(!1), pe(null);
|
|
1180
1180
|
};
|
|
1181
|
-
|
|
1181
|
+
xa(
|
|
1182
1182
|
m,
|
|
1183
1183
|
d,
|
|
1184
|
-
|
|
1185
|
-
(
|
|
1184
|
+
K,
|
|
1185
|
+
(o) => pe(o)
|
|
1186
1186
|
);
|
|
1187
|
-
const
|
|
1188
|
-
|
|
1189
|
-
},
|
|
1190
|
-
await
|
|
1187
|
+
const Gs = () => K ? JSON.stringify(d) !== JSON.stringify(K) : !1, Fs = () => {
|
|
1188
|
+
Gs() ? ee(!0) : ge();
|
|
1189
|
+
}, Os = async () => {
|
|
1190
|
+
await fe({ closeAfterSave: !0 });
|
|
1191
1191
|
}, Rs = () => {
|
|
1192
|
-
|
|
1192
|
+
K && Es(K), ge(), ee(!1);
|
|
1193
1193
|
};
|
|
1194
|
-
async function
|
|
1195
|
-
const T = (
|
|
1194
|
+
async function fe(o) {
|
|
1195
|
+
const T = (o == null ? void 0 : o.closeAfterSave) ?? j;
|
|
1196
1196
|
w(T), T && ee(!1);
|
|
1197
|
-
const
|
|
1198
|
-
A(!0), P(null),
|
|
1199
|
-
const
|
|
1197
|
+
const B = Na(d);
|
|
1198
|
+
A(!0), P(null), he(!0);
|
|
1199
|
+
const $s = {
|
|
1200
1200
|
template: d
|
|
1201
1201
|
};
|
|
1202
1202
|
se.mutate(
|
|
1203
1203
|
{
|
|
1204
1204
|
resourceId: d.id,
|
|
1205
|
-
data:
|
|
1205
|
+
data: $s
|
|
1206
1206
|
},
|
|
1207
1207
|
{
|
|
1208
1208
|
onSuccess: () => {
|
|
1209
|
-
|
|
1209
|
+
he(!1), k.success("Dashboard saved!"), pe(B), A(!1), w(!1), T && ge();
|
|
1210
1210
|
},
|
|
1211
1211
|
onError: () => {
|
|
1212
|
-
|
|
1212
|
+
he(!1), P("Failed to save dashboard. Please try again."), k.error("Failed to save dashboard");
|
|
1213
1213
|
}
|
|
1214
1214
|
}
|
|
1215
1215
|
);
|
|
1216
1216
|
}
|
|
1217
|
-
async function
|
|
1217
|
+
async function Us() {
|
|
1218
1218
|
if (N(!0), !p || !f) return;
|
|
1219
|
-
const
|
|
1219
|
+
const o = JSON.stringify(d), T = {
|
|
1220
1220
|
...f,
|
|
1221
|
-
template:
|
|
1221
|
+
template: o,
|
|
1222
1222
|
filterValues: ue
|
|
1223
1223
|
};
|
|
1224
|
-
await
|
|
1224
|
+
await Me(
|
|
1225
1225
|
n.apiServiceUrl,
|
|
1226
1226
|
T,
|
|
1227
1227
|
s == null ? void 0 : s.accessToken
|
|
1228
|
-
), k.success("Lens saved"),
|
|
1228
|
+
), k.success("Lens saved"), me == null || me(d), N(!1);
|
|
1229
1229
|
}
|
|
1230
|
-
const
|
|
1230
|
+
const qe = (f == null ? void 0 : f.name) || d.title;
|
|
1231
1231
|
se.isPending && console.log("Title during update:", {
|
|
1232
|
-
title:
|
|
1232
|
+
title: qe,
|
|
1233
1233
|
dashboardStateTitle: d.title,
|
|
1234
1234
|
dashboardId: d == null ? void 0 : d.id,
|
|
1235
1235
|
currentLensName: f == null ? void 0 : f.name
|
|
1236
1236
|
});
|
|
1237
|
-
const
|
|
1237
|
+
const _s = n.orgUserId || n.tenantId && n.endUserId && n.endUserEmail;
|
|
1238
1238
|
return /* @__PURE__ */ r(
|
|
1239
1239
|
"div",
|
|
1240
1240
|
{
|
|
1241
|
-
className: "flex h-11 items-center justify-between gap-2 border-b px-4 py-2",
|
|
1241
|
+
className: "flex h-11 items-center justify-between gap-2 overflow-x-auto border-b px-4 py-2",
|
|
1242
1242
|
role: "dashboard-controls",
|
|
1243
1243
|
children: [
|
|
1244
1244
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
1245
|
-
|
|
1245
|
+
_s && /* @__PURE__ */ r(E, { children: [
|
|
1246
1246
|
/* @__PURE__ */ e(
|
|
1247
1247
|
$,
|
|
1248
1248
|
{
|
|
@@ -1252,35 +1252,35 @@ function ht() {
|
|
|
1252
1252
|
de(!V);
|
|
1253
1253
|
},
|
|
1254
1254
|
className: "h-7 p-2",
|
|
1255
|
-
children: /* @__PURE__ */ e(
|
|
1255
|
+
children: /* @__PURE__ */ e(La, { className: "h-4 w-4" })
|
|
1256
1256
|
}
|
|
1257
1257
|
),
|
|
1258
|
-
|
|
1258
|
+
i && !S && /* @__PURE__ */ e(
|
|
1259
1259
|
$,
|
|
1260
1260
|
{
|
|
1261
1261
|
"aria-label": "Dashboard Hub",
|
|
1262
1262
|
tooltip: "Dashboard Hub",
|
|
1263
|
-
onClick: () =>
|
|
1263
|
+
onClick: () => Ds(),
|
|
1264
1264
|
className: "h-7 p-2",
|
|
1265
|
-
children: /* @__PURE__ */ e(
|
|
1265
|
+
children: /* @__PURE__ */ e(es, { className: "h-4 w-4" })
|
|
1266
1266
|
}
|
|
1267
1267
|
)
|
|
1268
1268
|
] }),
|
|
1269
|
-
!S &&
|
|
1269
|
+
!S && i && (c ? /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
1270
1270
|
/* @__PURE__ */ e(q, { className: "h-3 w-3 animate-spin text-muted-foreground" }),
|
|
1271
1271
|
/* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground", children: "Loading..." })
|
|
1272
1272
|
] }) : /* @__PURE__ */ e(
|
|
1273
|
-
|
|
1273
|
+
da,
|
|
1274
1274
|
{
|
|
1275
|
-
value:
|
|
1276
|
-
onSave: (
|
|
1275
|
+
value: qe || "Untitled Dashboard",
|
|
1276
|
+
onSave: (o) => {
|
|
1277
1277
|
console.log("EditableText onSave called:", {
|
|
1278
|
-
newTitle:
|
|
1278
|
+
newTitle: o,
|
|
1279
1279
|
canEditDashboard: I,
|
|
1280
1280
|
dashboardId: d == null ? void 0 : d.id
|
|
1281
1281
|
});
|
|
1282
1282
|
const T = (d == null ? void 0 : d.title) || "";
|
|
1283
|
-
g(
|
|
1283
|
+
g(o), Is(o, T);
|
|
1284
1284
|
},
|
|
1285
1285
|
isEditable: I && !f,
|
|
1286
1286
|
displayClassName: "text-sm font-medium",
|
|
@@ -1292,8 +1292,8 @@ function ht() {
|
|
|
1292
1292
|
] }),
|
|
1293
1293
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
1294
1294
|
S && /* @__PURE__ */ r(E, { children: [
|
|
1295
|
-
/* @__PURE__ */ e(
|
|
1296
|
-
/* @__PURE__ */ e(
|
|
1295
|
+
/* @__PURE__ */ e(wa, { className: "mr-2" }),
|
|
1296
|
+
/* @__PURE__ */ e(Ca, { className: "h-7" })
|
|
1297
1297
|
] }),
|
|
1298
1298
|
t && !S && /* @__PURE__ */ r(E, { children: [
|
|
1299
1299
|
/* @__PURE__ */ e(
|
|
@@ -1301,162 +1301,164 @@ function ht() {
|
|
|
1301
1301
|
{
|
|
1302
1302
|
tooltip: "Copy Token",
|
|
1303
1303
|
onClick: () => {
|
|
1304
|
-
var
|
|
1305
|
-
s != null && s.accessToken && ((
|
|
1304
|
+
var o;
|
|
1305
|
+
s != null && s.accessToken && ((o = navigator == null ? void 0 : navigator.clipboard) != null && o.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"));
|
|
1306
1306
|
},
|
|
1307
1307
|
className: "h-7 p-2",
|
|
1308
|
-
children: /* @__PURE__ */ e(
|
|
1308
|
+
children: /* @__PURE__ */ e(ua, { className: "h-4 w-4" })
|
|
1309
1309
|
}
|
|
1310
1310
|
),
|
|
1311
1311
|
/* @__PURE__ */ e(
|
|
1312
1312
|
$,
|
|
1313
1313
|
{
|
|
1314
1314
|
tooltip: "Invalidate Token",
|
|
1315
|
-
onClick: () =>
|
|
1315
|
+
onClick: () => ma(n.apiServiceUrl),
|
|
1316
1316
|
className: "h-7 p-2",
|
|
1317
|
-
children: /* @__PURE__ */ e(
|
|
1317
|
+
children: /* @__PURE__ */ e(Ia, { className: "h-4 w-4" })
|
|
1318
1318
|
}
|
|
1319
1319
|
)
|
|
1320
1320
|
] }),
|
|
1321
|
-
!S &&
|
|
1322
|
-
!S &&
|
|
1323
|
-
!S &&
|
|
1321
|
+
!S && i && /* @__PURE__ */ e(ha, {}),
|
|
1322
|
+
!S && i && /* @__PURE__ */ e(Sa, {}),
|
|
1323
|
+
!S && i && ks && /* @__PURE__ */ e(
|
|
1324
1324
|
$,
|
|
1325
1325
|
{
|
|
1326
1326
|
tooltip: "Manage Groups",
|
|
1327
|
-
onClick: () =>
|
|
1327
|
+
onClick: () => R(!0),
|
|
1328
1328
|
className: "h-7 p-2",
|
|
1329
1329
|
children: /* @__PURE__ */ e(z, { className: "h-4 w-4" })
|
|
1330
1330
|
}
|
|
1331
1331
|
),
|
|
1332
|
-
!S &&
|
|
1332
|
+
!S && i && ((Ve = H == null ? void 0 : H.permissions) == null ? void 0 : Ve.canShare) && /* @__PURE__ */ e(
|
|
1333
1333
|
$,
|
|
1334
1334
|
{
|
|
1335
1335
|
tooltip: "Share Dashboard",
|
|
1336
1336
|
onClick: () => C(!0),
|
|
1337
1337
|
className: "h-7 p-2",
|
|
1338
|
-
children: /* @__PURE__ */ e(
|
|
1338
|
+
children: /* @__PURE__ */ e(pa, { className: "h-4 w-4" })
|
|
1339
1339
|
}
|
|
1340
1340
|
),
|
|
1341
|
-
!_ && !S && m && l.canUseFilters &&
|
|
1341
|
+
!_ && !S && m && l.canUseFilters && i && /* @__PURE__ */ e(
|
|
1342
1342
|
L,
|
|
1343
1343
|
{
|
|
1344
1344
|
className: "h-7 p-2",
|
|
1345
1345
|
variant: "outline",
|
|
1346
|
-
onClick: () =>
|
|
1346
|
+
onClick: () => {
|
|
1347
|
+
X("dashboard", !1), Ss(!0);
|
|
1348
|
+
},
|
|
1347
1349
|
size: "sm",
|
|
1348
|
-
children: /* @__PURE__ */ e(
|
|
1350
|
+
children: /* @__PURE__ */ e(ga, { className: "h-4 w-4" })
|
|
1349
1351
|
}
|
|
1350
1352
|
),
|
|
1351
|
-
m && !S && ae && t &&
|
|
1352
|
-
!S && ae && t &&
|
|
1353
|
-
m && !S && ae && f && t &&
|
|
1353
|
+
m && !S && ae && t && i && /* @__PURE__ */ e(Oa, {}),
|
|
1354
|
+
!S && ae && t && i && /* @__PURE__ */ e(Ra, {}),
|
|
1355
|
+
m && !S && ae && f && t && i && /* @__PURE__ */ r(
|
|
1354
1356
|
L,
|
|
1355
1357
|
{
|
|
1356
1358
|
className: "h-7 p-2",
|
|
1357
1359
|
variant: "secondary",
|
|
1358
1360
|
disabled: v,
|
|
1359
|
-
onClick:
|
|
1361
|
+
onClick: Us,
|
|
1360
1362
|
size: "sm",
|
|
1361
1363
|
children: [
|
|
1362
|
-
/* @__PURE__ */ e(
|
|
1364
|
+
/* @__PURE__ */ e(Ke, { className: "mr-2 h-4 w-4" }),
|
|
1363
1365
|
"Save Lens"
|
|
1364
1366
|
]
|
|
1365
1367
|
}
|
|
1366
1368
|
),
|
|
1367
|
-
m && !S &&
|
|
1369
|
+
m && !S && i && /* @__PURE__ */ r(
|
|
1368
1370
|
L,
|
|
1369
1371
|
{
|
|
1370
1372
|
variant: "outline",
|
|
1371
1373
|
className: "h-7 p-2",
|
|
1372
1374
|
size: "sm",
|
|
1373
1375
|
disabled: !m,
|
|
1374
|
-
onClick: () =>
|
|
1376
|
+
onClick: () => Ls(),
|
|
1375
1377
|
children: [
|
|
1376
|
-
/* @__PURE__ */ e(
|
|
1378
|
+
/* @__PURE__ */ e(Ae, { className: "mr-2 h-4 w-4" }),
|
|
1377
1379
|
"Visual"
|
|
1378
1380
|
]
|
|
1379
1381
|
}
|
|
1380
1382
|
),
|
|
1381
|
-
!S && !m && I &&
|
|
1383
|
+
!S && !m && I && i && /* @__PURE__ */ r(
|
|
1382
1384
|
L,
|
|
1383
1385
|
{
|
|
1384
1386
|
variant: "outline",
|
|
1385
1387
|
className: "h-7 p-2",
|
|
1386
|
-
onClick:
|
|
1388
|
+
onClick: Ps,
|
|
1387
1389
|
size: "sm",
|
|
1388
1390
|
children: [
|
|
1389
|
-
/* @__PURE__ */ e(
|
|
1391
|
+
/* @__PURE__ */ e(fa, { className: "mr-2 h-4 w-4" }),
|
|
1390
1392
|
"Edit"
|
|
1391
1393
|
]
|
|
1392
1394
|
}
|
|
1393
1395
|
),
|
|
1394
|
-
|
|
1396
|
+
Ts && i && /* @__PURE__ */ r(
|
|
1395
1397
|
L,
|
|
1396
1398
|
{
|
|
1397
1399
|
className: "h-7 p-2",
|
|
1398
|
-
disabled:
|
|
1399
|
-
onClick: () =>
|
|
1400
|
+
disabled: Q,
|
|
1401
|
+
onClick: () => fe(),
|
|
1400
1402
|
size: "sm",
|
|
1401
1403
|
children: [
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
+
Q ? /* @__PURE__ */ e(q, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ e(Ke, { className: "mr-2 h-4 w-4" }),
|
|
1405
|
+
Q ? "Saving..." : "Save"
|
|
1404
1406
|
]
|
|
1405
1407
|
}
|
|
1406
1408
|
),
|
|
1407
|
-
!S && m && t &&
|
|
1409
|
+
!S && m && t && i && /* @__PURE__ */ e("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ e(
|
|
1408
1410
|
L,
|
|
1409
1411
|
{
|
|
1410
1412
|
className: "h-7 p-2",
|
|
1411
|
-
onClick: () =>
|
|
1413
|
+
onClick: () => Ue(!Y),
|
|
1412
1414
|
size: "sm",
|
|
1413
1415
|
variant: "ghost",
|
|
1414
|
-
children: /* @__PURE__ */ e(
|
|
1416
|
+
children: /* @__PURE__ */ e(va, { className: "h-4 w-4" })
|
|
1415
1417
|
}
|
|
1416
1418
|
) }),
|
|
1417
|
-
!S && t && /* @__PURE__ */ e(
|
|
1418
|
-
m && !S &&
|
|
1419
|
+
!S && t && /* @__PURE__ */ e(Pa, {}),
|
|
1420
|
+
m && !S && i && /* @__PURE__ */ r(
|
|
1419
1421
|
L,
|
|
1420
1422
|
{
|
|
1421
1423
|
variant: "outline",
|
|
1422
1424
|
className: "h-7 p-2",
|
|
1423
|
-
onClick:
|
|
1425
|
+
onClick: Fs,
|
|
1424
1426
|
children: [
|
|
1425
|
-
/* @__PURE__ */ e(
|
|
1427
|
+
/* @__PURE__ */ e(ss, { className: "mr-2 h-4 w-4" }),
|
|
1426
1428
|
"Close"
|
|
1427
1429
|
]
|
|
1428
1430
|
}
|
|
1429
1431
|
),
|
|
1430
|
-
x &&
|
|
1431
|
-
|
|
1432
|
+
x && $e && /* @__PURE__ */ e(
|
|
1433
|
+
ba,
|
|
1432
1434
|
{
|
|
1433
|
-
resource:
|
|
1434
|
-
resourceType:
|
|
1435
|
+
resource: $e,
|
|
1436
|
+
resourceType: be.DASHBOARD,
|
|
1435
1437
|
onClose: () => C(!1)
|
|
1436
1438
|
}
|
|
1437
1439
|
),
|
|
1438
1440
|
/* @__PURE__ */ e(
|
|
1439
|
-
|
|
1441
|
+
nt,
|
|
1440
1442
|
{
|
|
1441
|
-
open:
|
|
1442
|
-
onOpenChange:
|
|
1443
|
+
open: O,
|
|
1444
|
+
onOpenChange: R
|
|
1443
1445
|
}
|
|
1444
1446
|
),
|
|
1445
1447
|
/* @__PURE__ */ e(
|
|
1446
|
-
|
|
1448
|
+
ls,
|
|
1447
1449
|
{
|
|
1448
1450
|
open: G,
|
|
1449
|
-
onOpenChange: (
|
|
1450
|
-
!
|
|
1451
|
+
onOpenChange: (o) => {
|
|
1452
|
+
!o && Q && !F || (A(o), o || (P(null), w(!1)));
|
|
1451
1453
|
},
|
|
1452
|
-
children: /* @__PURE__ */ r(
|
|
1453
|
-
/* @__PURE__ */ r(
|
|
1454
|
-
/* @__PURE__ */ e(
|
|
1455
|
-
/* @__PURE__ */ e(
|
|
1454
|
+
children: /* @__PURE__ */ r(cs, { className: "max-w-sm", children: [
|
|
1455
|
+
/* @__PURE__ */ r(ds, { children: [
|
|
1456
|
+
/* @__PURE__ */ e(us, { children: F ? "Save failed" : "Saving dashboard" }),
|
|
1457
|
+
/* @__PURE__ */ e(ms, { className: "pt-2", children: F ? "We could not save the dashboard. Please try again." : "Please wait while we save your changes." })
|
|
1456
1458
|
] }),
|
|
1457
|
-
/* @__PURE__ */ e(
|
|
1459
|
+
/* @__PURE__ */ e(hs, { className: "flex-col gap-2 sm:flex-row sm:justify-end", children: F ? /* @__PURE__ */ r(E, { children: [
|
|
1458
1460
|
/* @__PURE__ */ e(
|
|
1459
|
-
|
|
1461
|
+
ps,
|
|
1460
1462
|
{
|
|
1461
1463
|
onClick: () => {
|
|
1462
1464
|
A(!1), P(null), w(!1);
|
|
@@ -1466,15 +1468,15 @@ function ht() {
|
|
|
1466
1468
|
}
|
|
1467
1469
|
),
|
|
1468
1470
|
/* @__PURE__ */ e(
|
|
1469
|
-
|
|
1471
|
+
De,
|
|
1470
1472
|
{
|
|
1471
|
-
onClick: () =>
|
|
1473
|
+
onClick: () => fe(),
|
|
1472
1474
|
className: "m-0",
|
|
1473
1475
|
children: "Retry"
|
|
1474
1476
|
}
|
|
1475
1477
|
)
|
|
1476
1478
|
] }) : /* @__PURE__ */ r(
|
|
1477
|
-
|
|
1479
|
+
De,
|
|
1478
1480
|
{
|
|
1479
1481
|
disabled: !0,
|
|
1480
1482
|
className: "m-0 cursor-default",
|
|
@@ -1488,13 +1490,13 @@ function ht() {
|
|
|
1488
1490
|
}
|
|
1489
1491
|
),
|
|
1490
1492
|
/* @__PURE__ */ e(
|
|
1491
|
-
|
|
1493
|
+
Da,
|
|
1492
1494
|
{
|
|
1493
|
-
open:
|
|
1495
|
+
open: As,
|
|
1494
1496
|
onOpenChange: ee,
|
|
1495
|
-
onSave:
|
|
1497
|
+
onSave: Os,
|
|
1496
1498
|
onDiscard: Rs,
|
|
1497
|
-
isSaving:
|
|
1499
|
+
isSaving: Q
|
|
1498
1500
|
}
|
|
1499
1501
|
)
|
|
1500
1502
|
] })
|
|
@@ -1503,5 +1505,5 @@ function ht() {
|
|
|
1503
1505
|
);
|
|
1504
1506
|
}
|
|
1505
1507
|
export {
|
|
1506
|
-
|
|
1508
|
+
gt as default
|
|
1507
1509
|
};
|