mario-core 2.0.97-release → 2.0.98-release
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/Dashboard-D2zLzwFR.mjs +206 -0
- package/dist/Dashboard-dOwpd3sn.js +1 -0
- package/dist/EmailTemplateDetail-D07dUCZL.js +1 -0
- package/dist/EmailTemplateDetail-uNlh3Otz.mjs +443 -0
- package/dist/EmailTemplateList-B5ee4Byb.js +1 -0
- package/dist/EmailTemplateList-EZ_sAp6W.mjs +170 -0
- package/dist/GalleryList-CdyApn-m.mjs +329 -0
- package/dist/GalleryList-DFuoYp_Q.js +1 -0
- package/dist/Login-8c69l-hn.js +1 -0
- package/dist/Login-MzPc2sA6.mjs +1684 -0
- package/dist/NotificationList-BP871ggG.mjs +3982 -0
- package/dist/NotificationList-CzX65qMV.js +2 -0
- package/dist/SkillList-C-aJeufd.mjs +386 -0
- package/dist/SkillList-hMvqDcsQ.js +1 -0
- package/dist/TeacherSelector-CV9c0Cn8.js +1 -0
- package/dist/TeacherSelector-XuYxdZgr.mjs +30 -0
- package/dist/TheContent-BfT4R2Gc.mjs +38 -0
- package/dist/TheContent-BicDxizL.js +1 -0
- package/dist/UserContainer-DR6lGYNl.js +5 -0
- package/dist/UserContainer-Ip-sYnrv.mjs +2902 -0
- package/dist/UserDetail-iw6l5L3a.mjs +903 -0
- package/dist/UserDetail-uR6dMDOB.js +1 -0
- package/dist/UserList-DLC9FDWG.mjs +1252 -0
- package/dist/UserList-DUiZTiTR.js +7 -0
- package/dist/constants-DUelcmx7.js +1 -0
- package/dist/constants-QjFnVl1d.mjs +286 -0
- package/dist/index--POWjYN0.mjs +19073 -0
- package/dist/index-KWXe_Hjz.js +15 -0
- package/dist/index.js +1 -1
- package/dist/index.modern.js +1 -1
- package/dist/mailCategoryService-B9Yboyna.mjs +11 -0
- package/dist/mailCategoryService-DAw3X_PE.js +1 -0
- package/dist/services/userService.d.ts +1 -0
- package/dist/userService-DEwtByu1.js +1 -0
- package/dist/userService-DxucAe6U.mjs +56 -0
- package/package.json +1 -1
|
@@ -0,0 +1,1252 @@
|
|
|
1
|
+
import { jsxs as b, jsx as t, Fragment as ke } from "react/jsx-runtime";
|
|
2
|
+
import { Button as ye, Popover as De, PopoverBody as Le, Label as Y, Input as X, FormGroup as de, Row as Se, Col as Q, Table as Fe } from "reactstrap";
|
|
3
|
+
import { l as Me, t as ve, m as Pe, n as ze, s as He, o as je, p as Ve, q as Je, v as Ge, w as Ke, x as qe } from "./userService-DxucAe6U.mjs";
|
|
4
|
+
import { useTranslation as ce } from "react-i18next";
|
|
5
|
+
import { useState as P, useMemo as re, useCallback as z, useEffect as V, useRef as Ce, Fragment as We } from "react";
|
|
6
|
+
import { useSelector as oe, useDispatch as ee } from "react-redux";
|
|
7
|
+
import { useNavigate as Ye, useLocation as Qe } from "react-router-dom";
|
|
8
|
+
import { a9 as be, b as I, aa as me, c as A, O as Z, u as Xe, I as Ze, d as Ee, N as et, ab as tt, G as K, s as $, ac as Oe, ad as Ie, a6 as te, B as Te, i as st, ae as nt, Q as at, af as rt, S as ot, T as ct, U as lt, ag as it } from "./index--POWjYN0.mjs";
|
|
9
|
+
import { d as dt, u as mt, e as ht, S as G, f as pt, C as Ne, g as ut } from "./constants-QjFnVl1d.mjs";
|
|
10
|
+
import { L as gt } from "./types-BvnbDeJF.mjs";
|
|
11
|
+
import { differenceInCalendarYears as ft, parseISO as yt } from "date-fns";
|
|
12
|
+
import _e from "papaparse";
|
|
13
|
+
function St(e, s) {
|
|
14
|
+
Me(2, arguments);
|
|
15
|
+
var m = ve(e), c = ve(s);
|
|
16
|
+
return m.getFullYear() - c.getFullYear();
|
|
17
|
+
}
|
|
18
|
+
const vt = () => {
|
|
19
|
+
const [e, s] = P(dt);
|
|
20
|
+
return { filters: e, setFilters: s, changeFilters: (c) => {
|
|
21
|
+
const S = {
|
|
22
|
+
...e,
|
|
23
|
+
...c
|
|
24
|
+
};
|
|
25
|
+
S.searchString && c.searchString && c.searchString != e.searchString && (S.currentPage = 1), s(S);
|
|
26
|
+
} };
|
|
27
|
+
}, Ct = "/admin/user", bt = "/admin/create-user", Et = "User list", ae = "/home", Nt = "/home", _t = "/admin/home", Rt = "/parent", xt = "/admin/schools", wt = "/list-student", Ot = () => {
|
|
28
|
+
const e = Ye(), m = new URLSearchParams(location.search).get("query"), c = oe((n) => n.users.userList), S = oe((n) => n.users.totalItems), { filters: f, changeFilters: r } = vt(), y = m || "", [u, E] = P([]), l = window.location.host.includes("-district"), o = ee(), { t: h } = ce(), U = (n) => {
|
|
29
|
+
const g = u.find((p) => p == n);
|
|
30
|
+
E(g ? u.filter((p) => p != n) : u.concat([n]));
|
|
31
|
+
}, _ = re(() => (c || []).length > 0 && (c || []).every((n) => u.includes(n.id)), [c, u]), w = z(() => {
|
|
32
|
+
if (_) {
|
|
33
|
+
const g = new Set((c || []).map((p) => p.id));
|
|
34
|
+
E((p) => p.filter((a) => !g.has(a)));
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const n = (c || []).map((g) => g.id).filter((g) => !u.includes(g));
|
|
38
|
+
E((g) => [...g, ...n]);
|
|
39
|
+
}, [c, _, u]), N = z(
|
|
40
|
+
async () => {
|
|
41
|
+
if (f.searchBy !== void 0 && f.searchByStrings !== void 0 && f.searchByStrings.length === 0) {
|
|
42
|
+
o(be({ userList: [], totalItems: 0 }));
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
o(I(!0));
|
|
46
|
+
try {
|
|
47
|
+
const n = await Pe(f), { items: g, totalItems: p } = n.data;
|
|
48
|
+
for (const a of g)
|
|
49
|
+
a.roles = a.roles.map((d) => d != me.EDUTEACHER ? d : "EduTeacher"), a.msRoles && (a.msRoles = a.msRoles.map((d) => d != me.EDUTEACHER ? d : "EduTeacher")), a.esRoles && (a.esRoles = a.esRoles.map((d) => d != me.EDUTEACHER ? d : "EduTeacher"));
|
|
50
|
+
o(be({ userList: g, totalItems: p }));
|
|
51
|
+
} catch (n) {
|
|
52
|
+
o(
|
|
53
|
+
A({
|
|
54
|
+
type: "danger",
|
|
55
|
+
message: n.response?.data?.title || n.message
|
|
56
|
+
})
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
o(I(!1));
|
|
60
|
+
},
|
|
61
|
+
[o, f]
|
|
62
|
+
), v = async () => {
|
|
63
|
+
o(I(!0));
|
|
64
|
+
try {
|
|
65
|
+
const g = (await je()).data?.message || h("sync_roster_running_in_background", "Roster synchronization is currently running in the background. Please wait a few moments before refreshing the page.");
|
|
66
|
+
o(
|
|
67
|
+
Z({
|
|
68
|
+
isOpen: !0,
|
|
69
|
+
type: "success",
|
|
70
|
+
message: g
|
|
71
|
+
})
|
|
72
|
+
);
|
|
73
|
+
} catch (n) {
|
|
74
|
+
o(
|
|
75
|
+
Z({
|
|
76
|
+
isOpen: !0,
|
|
77
|
+
type: "danger",
|
|
78
|
+
message: n.response?.data?.message || n.response?.data?.title || n.message
|
|
79
|
+
})
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
o(I(!1));
|
|
83
|
+
}, C = (n) => {
|
|
84
|
+
if (!n) return "";
|
|
85
|
+
const g = [], { sourcedId: p, rosterUser: a } = n;
|
|
86
|
+
if (p && a && g.push(p), a) {
|
|
87
|
+
const { givenName: d, middleName: T, familyName: x, email: F } = a, M = [];
|
|
88
|
+
x && M.push(x), T && M.push(T), d && M.push(d), g.push(M.join(" ") || ""), g.push(F || "");
|
|
89
|
+
}
|
|
90
|
+
return g.join(" / ");
|
|
91
|
+
};
|
|
92
|
+
V(() => {
|
|
93
|
+
document.title = Et;
|
|
94
|
+
}, []), V(() => {
|
|
95
|
+
r({
|
|
96
|
+
...f,
|
|
97
|
+
searchString: y
|
|
98
|
+
});
|
|
99
|
+
}, [y]), V(() => {
|
|
100
|
+
N();
|
|
101
|
+
}, [JSON.stringify(f)]);
|
|
102
|
+
const R = z(
|
|
103
|
+
(n) => {
|
|
104
|
+
o(
|
|
105
|
+
Z({
|
|
106
|
+
isOpen: !0,
|
|
107
|
+
type: "warning",
|
|
108
|
+
message: h("do_you_want_to_remove_this_user"),
|
|
109
|
+
onConfirm: async () => {
|
|
110
|
+
o(I(!0));
|
|
111
|
+
try {
|
|
112
|
+
await ze(n), o(
|
|
113
|
+
A({
|
|
114
|
+
type: "success",
|
|
115
|
+
message: "Remove user successfully"
|
|
116
|
+
})
|
|
117
|
+
), f.currentPage !== 1 ? r({ currentPage: 1 }) : N();
|
|
118
|
+
} catch (g) {
|
|
119
|
+
o(
|
|
120
|
+
A({
|
|
121
|
+
type: "danger",
|
|
122
|
+
message: g.response?.data?.title || g.message
|
|
123
|
+
})
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
o(I(!1));
|
|
127
|
+
}
|
|
128
|
+
})
|
|
129
|
+
);
|
|
130
|
+
},
|
|
131
|
+
[JSON.stringify(f)]
|
|
132
|
+
), L = [
|
|
133
|
+
{ role: "Admin", path: _t },
|
|
134
|
+
{ role: "Teacher", path: ae },
|
|
135
|
+
{ role: "Assistant", path: ae },
|
|
136
|
+
{ role: "Student", path: Nt },
|
|
137
|
+
{ role: "Parent", path: Rt },
|
|
138
|
+
{ role: "EduTeacher", path: wt },
|
|
139
|
+
{ role: "Counselor", path: ae },
|
|
140
|
+
{ role: "SecondaryTeacher", path: ae }
|
|
141
|
+
], B = (n) => {
|
|
142
|
+
const g = sessionStorage.getItem(Ze), p = n.data?.token;
|
|
143
|
+
let a = n.data.msRoles || [], d = n.data.esRoles || [];
|
|
144
|
+
const T = n.data.roles || n.data.userRoles || [], x = (n.data.appType || "").toUpperCase();
|
|
145
|
+
a.length === 0 && d.length === 0 && T.length > 0 && (x.includes("ES") && !x.includes("MS") ? d = T : x.includes("MS") && !x.includes("ES") ? a = T : (a = T, d = T));
|
|
146
|
+
let F = "MS", M = "/home", k = !1;
|
|
147
|
+
for (const { role: J, path: se } of L) {
|
|
148
|
+
const q = a.includes(J), W = d.includes(J);
|
|
149
|
+
if (!(!q && !W)) {
|
|
150
|
+
F = q ? "MS" : "ES", M = se, k = !0;
|
|
151
|
+
break;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
k || (F = a.length > 0 ? "MS" : d.length > 0 ? "ES" : "MS");
|
|
155
|
+
const D = F === "ES" ? d : a;
|
|
156
|
+
g ? sessionStorage.setItem(Ee, p) : localStorage.setItem(Ee, p), D.includes("Admin") ? localStorage.setItem("ROLES", "Admin") : D.length > 0 && localStorage.setItem("ROLES", D.toString()), localStorage.removeItem(et), l && (M = xt);
|
|
157
|
+
const j = F === "ES" && !D.includes("Admin") ? `/es${M}` : M;
|
|
158
|
+
window.location.href = j;
|
|
159
|
+
}, O = z(
|
|
160
|
+
async (n) => {
|
|
161
|
+
try {
|
|
162
|
+
const p = (await He(n)).data;
|
|
163
|
+
o(
|
|
164
|
+
Z({
|
|
165
|
+
isOpen: !0,
|
|
166
|
+
type: "warning",
|
|
167
|
+
message: h("do_you_want_to_impersonate_this_user"),
|
|
168
|
+
onConfirm: async () => {
|
|
169
|
+
o(I(!0));
|
|
170
|
+
try {
|
|
171
|
+
const a = {
|
|
172
|
+
email: p.email,
|
|
173
|
+
password: "default",
|
|
174
|
+
accessToken: p.token,
|
|
175
|
+
loginType: gt.Impersonate
|
|
176
|
+
}, d = await Xe(a), T = {};
|
|
177
|
+
for (let x = 0; x < localStorage.length; x++) {
|
|
178
|
+
const F = localStorage.key(x);
|
|
179
|
+
F && (F === "SELECTED_TIER" || F.startsWith("SELECTED_TIER_")) && (T[F] = localStorage.getItem(F) || "");
|
|
180
|
+
}
|
|
181
|
+
localStorage.clear(), Object.keys(T).forEach((x) => {
|
|
182
|
+
localStorage.setItem(x, T[x]);
|
|
183
|
+
}), B(d);
|
|
184
|
+
} catch (a) {
|
|
185
|
+
A({
|
|
186
|
+
type: "danger",
|
|
187
|
+
message: a.response?.data?.title || a.message
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
o(I(!1));
|
|
191
|
+
}
|
|
192
|
+
})
|
|
193
|
+
);
|
|
194
|
+
} catch (g) {
|
|
195
|
+
o(
|
|
196
|
+
A({
|
|
197
|
+
type: "danger",
|
|
198
|
+
message: g.response?.data?.title || g.message
|
|
199
|
+
})
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
[f]
|
|
204
|
+
);
|
|
205
|
+
return {
|
|
206
|
+
userList: c,
|
|
207
|
+
totalItems: S,
|
|
208
|
+
filters: f,
|
|
209
|
+
queryName: m,
|
|
210
|
+
fullName: y,
|
|
211
|
+
getData: N,
|
|
212
|
+
removeData: R,
|
|
213
|
+
changeFilters: r,
|
|
214
|
+
reDirectDetailPage: (n) => {
|
|
215
|
+
const g = n ? `${Ct}/${n}` : bt;
|
|
216
|
+
e(g);
|
|
217
|
+
},
|
|
218
|
+
switchUser: O,
|
|
219
|
+
handleSyncRosterUsers: v,
|
|
220
|
+
rosterUserInfo: C,
|
|
221
|
+
userIds: u,
|
|
222
|
+
onSelectAllUser: w,
|
|
223
|
+
onSelectUser: U,
|
|
224
|
+
isCheckAll: _
|
|
225
|
+
};
|
|
226
|
+
}, It = {
|
|
227
|
+
fontWeight: 500
|
|
228
|
+
}, Tt = {
|
|
229
|
+
height: 38,
|
|
230
|
+
background: "#316cd9"
|
|
231
|
+
}, At = ({
|
|
232
|
+
text: e,
|
|
233
|
+
onClick: s,
|
|
234
|
+
className: m = ""
|
|
235
|
+
}) => /* @__PURE__ */ b(
|
|
236
|
+
ye,
|
|
237
|
+
{
|
|
238
|
+
onClick: s,
|
|
239
|
+
color: "primary",
|
|
240
|
+
style: Tt,
|
|
241
|
+
className: `d-flex align-items-center ${m} gap-2`,
|
|
242
|
+
children: [
|
|
243
|
+
/* @__PURE__ */ t(tt, {}),
|
|
244
|
+
/* @__PURE__ */ t("span", { style: It, children: e })
|
|
245
|
+
]
|
|
246
|
+
}
|
|
247
|
+
);
|
|
248
|
+
function Ut(e) {
|
|
249
|
+
return K({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M21 3H5a1 1 0 0 0-1 1v2.59c0 .523.213 1.037.583 1.407L10 13.414V21a1.001 1.001 0 0 0 1.447.895l4-2c.339-.17.553-.516.553-.895v-5.586l5.417-5.417c.37-.37.583-.884.583-1.407V4a1 1 0 0 0-1-1zm-6.707 9.293A.996.996 0 0 0 14 13v5.382l-2 1V13a.996.996 0 0 0-.293-.707L6 6.59V5h14.001l.002 1.583-5.71 5.71z" } }] })(e);
|
|
250
|
+
}
|
|
251
|
+
function Bt(e) {
|
|
252
|
+
return K({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M19.023 16.977a35.13 35.13 0 0 1-1.367-1.384c-.372-.378-.596-.653-.596-.653l-2.8-1.337A6.962 6.962 0 0 0 16 9c0-3.859-3.14-7-7-7S2 5.141 2 9s3.14 7 7 7c1.763 0 3.37-.66 4.603-1.739l1.337 2.8s.275.224.653.596c.387.363.896.854 1.384 1.367l1.358 1.392.604.646 2.121-2.121-.646-.604c-.379-.372-.885-.866-1.391-1.36zM9 14c-2.757 0-5-2.243-5-5s2.243-5 5-5 5 2.243 5 5-2.243 5-5 5z" } }] })(e);
|
|
253
|
+
}
|
|
254
|
+
function $t(e) {
|
|
255
|
+
return K({ attr: { viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true" }, child: [{ tag: "path", attr: { fillRule: "evenodd", d: "M3 3a1 1 0 011-1h12a1 1 0 011 1v3a1 1 0 01-.293.707L12 11.414V15a1 1 0 01-.293.707l-2 2A1 1 0 018 17v-5.586L3.293 6.707A1 1 0 013 6V3z", clipRule: "evenodd" } }] })(e);
|
|
256
|
+
}
|
|
257
|
+
function ds(e) {
|
|
258
|
+
return K({ attr: { viewBox: "0 0 1024 1024" }, child: [{ tag: "path", attr: { d: "M505.7 661a8 8 0 0 0 12.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z" } }] })(e);
|
|
259
|
+
}
|
|
260
|
+
function Ae(e) {
|
|
261
|
+
return K({ attr: { viewBox: "0 0 1024 1024" }, child: [{ tag: "path", attr: { d: "M839.6 433.8L749 150.5a9.24 9.24 0 0 0-8.9-6.5h-77.4c-4.1 0-7.6 2.6-8.9 6.5l-91.3 283.3c-.3.9-.5 1.9-.5 2.9 0 5.1 4.2 9.3 9.3 9.3h56.4c4.2 0 7.8-2.8 9-6.8l17.5-61.6h89l17.3 61.5c1.1 4 4.8 6.8 9 6.8h61.2c1 0 1.9-.1 2.8-.4 2.4-.8 4.3-2.4 5.5-4.6 1.1-2.2 1.3-4.7.6-7.1zM663.3 325.5l32.8-116.9h6.3l32.1 116.9h-71.2zm143.5 492.9H677.2v-.4l132.6-188.9c1.1-1.6 1.7-3.4 1.7-5.4v-36.4c0-5.1-4.2-9.3-9.3-9.3h-204c-5.1 0-9.3 4.2-9.3 9.3v43c0 5.1 4.2 9.3 9.3 9.3h122.6v.4L587.7 828.9a9.35 9.35 0 0 0-1.7 5.4v36.4c0 5.1 4.2 9.3 9.3 9.3h211.4c5.1 0 9.3-4.2 9.3-9.3v-43a9.2 9.2 0 0 0-9.2-9.3zM416 702h-76V172c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v530h-76c-6.7 0-10.5 7.8-6.3 13l112 141.9a8 8 0 0 0 12.6 0l112-141.9c4.1-5.2.4-13-6.3-13z" } }] })(e);
|
|
262
|
+
}
|
|
263
|
+
function Ue(e) {
|
|
264
|
+
return K({ attr: { viewBox: "0 0 1024 1024" }, child: [{ tag: "path", attr: { d: "M839.6 433.8L749 150.5a9.24 9.24 0 0 0-8.9-6.5h-77.4c-4.1 0-7.6 2.6-8.9 6.5l-91.3 283.3c-.3.9-.5 1.9-.5 2.9 0 5.1 4.2 9.3 9.3 9.3h56.4c4.2 0 7.8-2.8 9-6.8l17.5-61.6h89l17.3 61.5c1.1 4 4.8 6.8 9 6.8h61.2c1 0 1.9-.1 2.8-.4 2.4-.8 4.3-2.4 5.5-4.6 1.1-2.2 1.3-4.7.6-7.1zM663.3 325.5l32.8-116.9h6.3l32.1 116.9h-71.2zm143.5 492.9H677.2v-.4l132.6-188.9c1.1-1.6 1.7-3.4 1.7-5.4v-36.4c0-5.1-4.2-9.3-9.3-9.3h-204c-5.1 0-9.3 4.2-9.3 9.3v43c0 5.1 4.2 9.3 9.3 9.3h122.6v.4L587.7 828.9a9.35 9.35 0 0 0-1.7 5.4v36.4c0 5.1 4.2 9.3 9.3 9.3h211.4c5.1 0 9.3-4.2 9.3-9.3v-43a9.2 9.2 0 0 0-9.2-9.3zM310.3 167.1a8 8 0 0 0-12.6 0L185.7 309c-4.2 5.3-.4 13 6.3 13h76v530c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V322h76c6.7 0 10.5-7.8 6.3-13l-112-141.9z" } }] })(e);
|
|
265
|
+
}
|
|
266
|
+
const kt = (e, s) => {
|
|
267
|
+
V(() => {
|
|
268
|
+
function m(c) {
|
|
269
|
+
e.current && !e.current.contains(c.target) && s?.();
|
|
270
|
+
}
|
|
271
|
+
return document.addEventListener("mousedown", m), () => {
|
|
272
|
+
document.removeEventListener("mousedown", m);
|
|
273
|
+
};
|
|
274
|
+
}, [e.current]);
|
|
275
|
+
}, Dt = (e) => {
|
|
276
|
+
const {
|
|
277
|
+
isOpen: s,
|
|
278
|
+
sortBy: m,
|
|
279
|
+
filters: c,
|
|
280
|
+
users: S,
|
|
281
|
+
searchBy: f,
|
|
282
|
+
defaultOptions: r,
|
|
283
|
+
selectedOptions: y,
|
|
284
|
+
searchKey: u,
|
|
285
|
+
onChangeSearchKey: E,
|
|
286
|
+
onOptionsChange: l,
|
|
287
|
+
onSearch: o,
|
|
288
|
+
onClose: h,
|
|
289
|
+
onChangeFilters: U,
|
|
290
|
+
getOption: _
|
|
291
|
+
} = e, [w, N] = P(), [v, C] = P([]), R = Ce(null), L = Ce(null);
|
|
292
|
+
kt(R, h);
|
|
293
|
+
const { t: B } = ce(), O = z(
|
|
294
|
+
() => {
|
|
295
|
+
if (!s) return;
|
|
296
|
+
const k = u?.trim?.() ?? "";
|
|
297
|
+
f != null && !r && o?.(k, f), f != null && r && C(r.filter((D) => D.label.toLowerCase().includes(k.toLowerCase())));
|
|
298
|
+
},
|
|
299
|
+
[f, u, JSON.stringify(r), s]
|
|
300
|
+
), i = () => {
|
|
301
|
+
L.current && clearTimeout(L.current), L.current = setTimeout(O, 500);
|
|
302
|
+
}, n = (k) => {
|
|
303
|
+
const D = k.target.value;
|
|
304
|
+
E(D);
|
|
305
|
+
}, g = z(() => {
|
|
306
|
+
l?.(w, f), h?.();
|
|
307
|
+
}, [JSON.stringify(w)]), p = z((k) => {
|
|
308
|
+
const D = k.target.value ?? "";
|
|
309
|
+
let j = w ?? [], J = j.indexOf(D);
|
|
310
|
+
J > -1 ? j.splice(J, 1) : j = [...j, D], N(j == null ? j : [...j]);
|
|
311
|
+
}, [JSON.stringify(w)]), a = z((k) => {
|
|
312
|
+
const D = k.target.checked;
|
|
313
|
+
N(D ? void 0 : []);
|
|
314
|
+
}, []), d = z(() => {
|
|
315
|
+
U?.({
|
|
316
|
+
...c,
|
|
317
|
+
sortBy: m,
|
|
318
|
+
isDescending: !0
|
|
319
|
+
}), h?.();
|
|
320
|
+
}, [JSON.stringify(c), f]), T = z(() => {
|
|
321
|
+
U?.({
|
|
322
|
+
...c,
|
|
323
|
+
sortBy: m,
|
|
324
|
+
isDescending: !1
|
|
325
|
+
}), h?.();
|
|
326
|
+
}, [JSON.stringify(c), f]), x = re(() => _ ? S.map((k) => _(k, B)) : [], [JSON.stringify(S), JSON.stringify(_)]), F = c?.isDescending == !1 && c.sortBy === m, M = !!c?.isDescending && c.sortBy === m;
|
|
327
|
+
return V(() => {
|
|
328
|
+
c?.searchBy !== f ? N(void 0) : N(y);
|
|
329
|
+
}, [JSON.stringify(y), c?.searchBy]), V(() => {
|
|
330
|
+
C(r || []);
|
|
331
|
+
}, [JSON.stringify(r)]), V(() => {
|
|
332
|
+
i();
|
|
333
|
+
}, [u, s]), {
|
|
334
|
+
ref: R,
|
|
335
|
+
options: x,
|
|
336
|
+
inputRef: L,
|
|
337
|
+
sOptions: w,
|
|
338
|
+
isAscending: F,
|
|
339
|
+
isDescending: M,
|
|
340
|
+
filteredOptions: v,
|
|
341
|
+
searchKey: u,
|
|
342
|
+
handleSearch: O,
|
|
343
|
+
handleApplyFilter: g,
|
|
344
|
+
handleOptionSelected: p,
|
|
345
|
+
handleOptionSelectedAll: a,
|
|
346
|
+
handleSortDesc: d,
|
|
347
|
+
handleSortAsc: T,
|
|
348
|
+
handleChangeSearchKey: n
|
|
349
|
+
};
|
|
350
|
+
}, Lt = (e) => {
|
|
351
|
+
const {
|
|
352
|
+
defaultOptions: s,
|
|
353
|
+
onClose: m,
|
|
354
|
+
getOption: c
|
|
355
|
+
} = e, {
|
|
356
|
+
ref: S,
|
|
357
|
+
inputRef: f,
|
|
358
|
+
options: r,
|
|
359
|
+
sOptions: y,
|
|
360
|
+
isAscending: u,
|
|
361
|
+
isDescending: E,
|
|
362
|
+
filteredOptions: l,
|
|
363
|
+
searchKey: o,
|
|
364
|
+
handleChangeSearchKey: h,
|
|
365
|
+
handleApplyFilter: U,
|
|
366
|
+
handleOptionSelected: _,
|
|
367
|
+
handleOptionSelectedAll: w,
|
|
368
|
+
handleSortDesc: N,
|
|
369
|
+
handleSortAsc: v
|
|
370
|
+
} = Dt(e);
|
|
371
|
+
return /* @__PURE__ */ t(De, { ...e, hideArrow: !0, className: $["popover-zindex"], children: /* @__PURE__ */ t(Le, { className: "pb-3", children: /* @__PURE__ */ b("div", { ref: S, className: $.popover, children: [
|
|
372
|
+
/* @__PURE__ */ b(
|
|
373
|
+
"div",
|
|
374
|
+
{
|
|
375
|
+
className: `d-flex flex-column ${$.popover__sort}`,
|
|
376
|
+
children: [
|
|
377
|
+
/* @__PURE__ */ t(Y, { className: "font-weight-bold", children: "Sort" }),
|
|
378
|
+
/* @__PURE__ */ b(
|
|
379
|
+
"div",
|
|
380
|
+
{
|
|
381
|
+
className: `px-1 ${$.popover__sort__item} ${u && $["popover__sort__item--active"]}`,
|
|
382
|
+
onClick: v,
|
|
383
|
+
children: [
|
|
384
|
+
/* @__PURE__ */ t(Ae, { className: "mr-1" }),
|
|
385
|
+
"Ascending"
|
|
386
|
+
]
|
|
387
|
+
}
|
|
388
|
+
),
|
|
389
|
+
/* @__PURE__ */ b(
|
|
390
|
+
"div",
|
|
391
|
+
{
|
|
392
|
+
className: `px-1 mt-1 ${$.popover__sort__item} ${E && $["popover__sort__item--active"]}`,
|
|
393
|
+
onClick: N,
|
|
394
|
+
children: [
|
|
395
|
+
/* @__PURE__ */ t(Ue, { className: "mr-1" }),
|
|
396
|
+
"Descending"
|
|
397
|
+
]
|
|
398
|
+
}
|
|
399
|
+
)
|
|
400
|
+
]
|
|
401
|
+
}
|
|
402
|
+
),
|
|
403
|
+
(typeof c < "u" || !!s) && /* @__PURE__ */ b(We, { children: [
|
|
404
|
+
/* @__PURE__ */ t("div", { className: "border border-top-1 border-bottom-0 mx-1 my-2" }),
|
|
405
|
+
/* @__PURE__ */ b("div", { className: "d-flex flex-column", children: [
|
|
406
|
+
/* @__PURE__ */ t(Y, { className: "font-weight-bold", children: "Filter" }),
|
|
407
|
+
/* @__PURE__ */ b("div", { className: `position-relative px-1 ${$.popover__search}`, children: [
|
|
408
|
+
/* @__PURE__ */ t(
|
|
409
|
+
Bt,
|
|
410
|
+
{
|
|
411
|
+
className: `position-absolute ${$.popover__search__icon}`
|
|
412
|
+
}
|
|
413
|
+
),
|
|
414
|
+
/* @__PURE__ */ t(
|
|
415
|
+
X,
|
|
416
|
+
{
|
|
417
|
+
ref: f,
|
|
418
|
+
className: $.popover__search__input,
|
|
419
|
+
value: o,
|
|
420
|
+
onChange: h
|
|
421
|
+
}
|
|
422
|
+
)
|
|
423
|
+
] }),
|
|
424
|
+
/* @__PURE__ */ b(
|
|
425
|
+
"div",
|
|
426
|
+
{
|
|
427
|
+
className: `mx-1 mt-2 p-2 bg-light ${$.popover__options}`,
|
|
428
|
+
children: [
|
|
429
|
+
/* @__PURE__ */ b(
|
|
430
|
+
de,
|
|
431
|
+
{
|
|
432
|
+
className: "d-flex align-items-center",
|
|
433
|
+
check: !0,
|
|
434
|
+
style: { gap: "8px" },
|
|
435
|
+
children: [
|
|
436
|
+
/* @__PURE__ */ t(
|
|
437
|
+
X,
|
|
438
|
+
{
|
|
439
|
+
type: "checkbox",
|
|
440
|
+
onChange: w,
|
|
441
|
+
checked: y == null
|
|
442
|
+
}
|
|
443
|
+
),
|
|
444
|
+
" ",
|
|
445
|
+
/* @__PURE__ */ t(Y, { check: !0, children: "(Select all)" })
|
|
446
|
+
]
|
|
447
|
+
}
|
|
448
|
+
),
|
|
449
|
+
!!c && !s && r.map((C) => /* @__PURE__ */ b(
|
|
450
|
+
de,
|
|
451
|
+
{
|
|
452
|
+
className: "d-flex align-items-center",
|
|
453
|
+
check: !0,
|
|
454
|
+
style: { gap: "8px" },
|
|
455
|
+
children: [
|
|
456
|
+
/* @__PURE__ */ t(
|
|
457
|
+
X,
|
|
458
|
+
{
|
|
459
|
+
type: "checkbox",
|
|
460
|
+
value: C.value,
|
|
461
|
+
onChange: _,
|
|
462
|
+
checked: y?.includes(C.value) || y == null
|
|
463
|
+
}
|
|
464
|
+
),
|
|
465
|
+
" ",
|
|
466
|
+
/* @__PURE__ */ t(Y, { check: !0, children: C.label })
|
|
467
|
+
]
|
|
468
|
+
},
|
|
469
|
+
C.value
|
|
470
|
+
)),
|
|
471
|
+
!!s && l.map((C) => /* @__PURE__ */ b(
|
|
472
|
+
de,
|
|
473
|
+
{
|
|
474
|
+
className: "d-flex align-items-center",
|
|
475
|
+
check: !0,
|
|
476
|
+
style: { gap: "8px" },
|
|
477
|
+
children: [
|
|
478
|
+
/* @__PURE__ */ t(
|
|
479
|
+
X,
|
|
480
|
+
{
|
|
481
|
+
type: "checkbox",
|
|
482
|
+
value: C.value,
|
|
483
|
+
onChange: _,
|
|
484
|
+
checked: y?.includes(C.value) || y == null
|
|
485
|
+
}
|
|
486
|
+
),
|
|
487
|
+
" ",
|
|
488
|
+
/* @__PURE__ */ t(Y, { check: !0, children: C.label })
|
|
489
|
+
]
|
|
490
|
+
},
|
|
491
|
+
C.value
|
|
492
|
+
))
|
|
493
|
+
]
|
|
494
|
+
}
|
|
495
|
+
)
|
|
496
|
+
] }),
|
|
497
|
+
/* @__PURE__ */ b("div", { className: "d-flex justify-content-end mt-3", style: { gap: "8px" }, children: [
|
|
498
|
+
/* @__PURE__ */ t(
|
|
499
|
+
ye,
|
|
500
|
+
{
|
|
501
|
+
color: "primary",
|
|
502
|
+
className: "mr-2",
|
|
503
|
+
size: "sm",
|
|
504
|
+
onClick: U,
|
|
505
|
+
children: "Apply Filter"
|
|
506
|
+
}
|
|
507
|
+
),
|
|
508
|
+
/* @__PURE__ */ t(
|
|
509
|
+
ye,
|
|
510
|
+
{
|
|
511
|
+
color: "secondary",
|
|
512
|
+
size: "sm",
|
|
513
|
+
onClick: m,
|
|
514
|
+
children: "Cancel"
|
|
515
|
+
}
|
|
516
|
+
)
|
|
517
|
+
] })
|
|
518
|
+
] })
|
|
519
|
+
] }) }) });
|
|
520
|
+
}, Ft = ({
|
|
521
|
+
data: e,
|
|
522
|
+
popoverId: s,
|
|
523
|
+
filters: m,
|
|
524
|
+
searchString: c,
|
|
525
|
+
users: S,
|
|
526
|
+
selectedOptions: f,
|
|
527
|
+
onOptionsChange: r,
|
|
528
|
+
onSearch: y,
|
|
529
|
+
onChangeFilters: u,
|
|
530
|
+
onOpenFilter: E,
|
|
531
|
+
onClose: l,
|
|
532
|
+
isCenter: o,
|
|
533
|
+
isActive: h = !1
|
|
534
|
+
}) => {
|
|
535
|
+
const { t: U } = ce(), [_, w] = P(""), N = re(
|
|
536
|
+
() => e.sortBy != null ? mt[e.sortBy] : "",
|
|
537
|
+
[e.sortBy]
|
|
538
|
+
), v = re(() => s === N, [N, s]), C = () => {
|
|
539
|
+
E?.(N, e.searchBy, _, e.sortBy);
|
|
540
|
+
}, R = (L) => {
|
|
541
|
+
w(L);
|
|
542
|
+
};
|
|
543
|
+
return /* @__PURE__ */ t("th", { className: e.className, children: N && e.sortBy !== void 0 ? /* @__PURE__ */ b("div", { className: `w-100 d-flex ${o ? "justify-content-center" : "justify-content-between"} align-items-center ${$["table-filter-icon"]}`, children: [
|
|
544
|
+
U(e.name),
|
|
545
|
+
/* @__PURE__ */ b(
|
|
546
|
+
"div",
|
|
547
|
+
{
|
|
548
|
+
className: "ml-2 p-1",
|
|
549
|
+
id: N,
|
|
550
|
+
onClick: C,
|
|
551
|
+
style: {
|
|
552
|
+
cursor: "pointer"
|
|
553
|
+
},
|
|
554
|
+
children: [
|
|
555
|
+
e.sortBy !== void 0 && e.sortBy === m?.sortBy && /* @__PURE__ */ t("span", { children: m.isDescending ? /* @__PURE__ */ t(Ue, {}) : /* @__PURE__ */ t(Ae, {}) }),
|
|
556
|
+
m?.searchByStrings?.length && e.searchBy === m?.searchBy ? /* @__PURE__ */ t($t, { color: h ? "#007bff" : "#242424" }) : /* @__PURE__ */ t(Ut, { color: h ? "#007bff" : "#242424" })
|
|
557
|
+
]
|
|
558
|
+
}
|
|
559
|
+
),
|
|
560
|
+
/* @__PURE__ */ t(
|
|
561
|
+
Lt,
|
|
562
|
+
{
|
|
563
|
+
placement: "bottom-end",
|
|
564
|
+
target: N,
|
|
565
|
+
users: S,
|
|
566
|
+
isOpen: v,
|
|
567
|
+
filters: m,
|
|
568
|
+
sortBy: e.sortBy,
|
|
569
|
+
searchKey: _,
|
|
570
|
+
searchBy: e.searchBy,
|
|
571
|
+
searchString: c,
|
|
572
|
+
defaultOptions: e.options,
|
|
573
|
+
selectedOptions: f,
|
|
574
|
+
onClose: l,
|
|
575
|
+
onSearch: y,
|
|
576
|
+
getOption: e.getOption,
|
|
577
|
+
onChangeFilters: u,
|
|
578
|
+
onOptionsChange: r,
|
|
579
|
+
onChangeSearchKey: R
|
|
580
|
+
}
|
|
581
|
+
)
|
|
582
|
+
] }) : U(e.name) });
|
|
583
|
+
}, Mt = (e) => {
|
|
584
|
+
const {
|
|
585
|
+
filters: s,
|
|
586
|
+
onChangeFilters: m,
|
|
587
|
+
isStudentFilter: c,
|
|
588
|
+
teacherOptions: S,
|
|
589
|
+
assistantOptions: f,
|
|
590
|
+
counselorOptions: r,
|
|
591
|
+
secondaryTeacherOptions: y
|
|
592
|
+
} = e, [u, E] = P(), [l, o] = P([]), [h, U] = P({
|
|
593
|
+
...ht,
|
|
594
|
+
isDescending: s.isDescending,
|
|
595
|
+
searchString: s.searchString
|
|
596
|
+
}), _ = ee(), w = Qe(), N = z(
|
|
597
|
+
async (B) => {
|
|
598
|
+
try {
|
|
599
|
+
const i = (c ? await Je(h) : await Ve({ ...h, byStudent: B })).data?.items || [];
|
|
600
|
+
o(i);
|
|
601
|
+
} catch (O) {
|
|
602
|
+
_(
|
|
603
|
+
A({
|
|
604
|
+
type: "danger",
|
|
605
|
+
message: O.response?.data?.title || O.message
|
|
606
|
+
})
|
|
607
|
+
);
|
|
608
|
+
}
|
|
609
|
+
},
|
|
610
|
+
[JSON.stringify(h), c]
|
|
611
|
+
), v = z((B, O, i, n) => {
|
|
612
|
+
E(B), U({
|
|
613
|
+
...h,
|
|
614
|
+
searchBy: O,
|
|
615
|
+
searchStringBy: i,
|
|
616
|
+
isDescending: s.sortBy === n ? s.isDescending : void 0,
|
|
617
|
+
searchString: s.searchString
|
|
618
|
+
});
|
|
619
|
+
}, [JSON.stringify(h), s.isDescending, s.searchString]), C = () => {
|
|
620
|
+
E("");
|
|
621
|
+
}, R = z((B, O) => {
|
|
622
|
+
U({
|
|
623
|
+
...h,
|
|
624
|
+
searchBy: O,
|
|
625
|
+
searchStringBy: B
|
|
626
|
+
});
|
|
627
|
+
}, [JSON.stringify(h)]), L = z((B, O) => {
|
|
628
|
+
O && m?.({
|
|
629
|
+
...s,
|
|
630
|
+
[G[O]]: B
|
|
631
|
+
});
|
|
632
|
+
}, [JSON.stringify(s)]);
|
|
633
|
+
return V(() => {
|
|
634
|
+
if (!w.pathname.includes("users/assign-student")) return;
|
|
635
|
+
const B = (i) => i.sort((n, g) => n.localeCompare(g)), O = h.searchStringBy?.toLowerCase() || "";
|
|
636
|
+
if (h.searchBy === G.Grade)
|
|
637
|
+
o(pt);
|
|
638
|
+
else {
|
|
639
|
+
let i = [];
|
|
640
|
+
switch (h.searchBy) {
|
|
641
|
+
case G.Name:
|
|
642
|
+
N(!0);
|
|
643
|
+
break;
|
|
644
|
+
case G.Teacher:
|
|
645
|
+
i = S?.map((a) => a.label).filter(Boolean) || [];
|
|
646
|
+
break;
|
|
647
|
+
case G.Assistant:
|
|
648
|
+
i = f?.map((a) => a.label).filter(Boolean) || [];
|
|
649
|
+
break;
|
|
650
|
+
case G.Counselor:
|
|
651
|
+
i = r?.map((a) => a.label).filter(Boolean) || [];
|
|
652
|
+
break;
|
|
653
|
+
case G.SecondaryTeacher:
|
|
654
|
+
i = y?.map((a) => a.label).filter(Boolean) || [];
|
|
655
|
+
break;
|
|
656
|
+
}
|
|
657
|
+
const n = Array.from(new Set(i)), g = O ? n.filter(
|
|
658
|
+
(a) => a.toLowerCase().includes(O)
|
|
659
|
+
) : n, p = B(g);
|
|
660
|
+
o(p);
|
|
661
|
+
}
|
|
662
|
+
}, [
|
|
663
|
+
JSON.stringify(h),
|
|
664
|
+
S,
|
|
665
|
+
f,
|
|
666
|
+
r,
|
|
667
|
+
y,
|
|
668
|
+
w.pathname
|
|
669
|
+
]), V(() => {
|
|
670
|
+
!(w.pathname.includes("users/assign-student") && h.searchBy !== void 0) && h.searchBy !== void 0 && N();
|
|
671
|
+
}, [
|
|
672
|
+
JSON.stringify(h),
|
|
673
|
+
w.pathname
|
|
674
|
+
]), {
|
|
675
|
+
popoverFilters: h,
|
|
676
|
+
popoverId: u,
|
|
677
|
+
users: l,
|
|
678
|
+
handleFilterIcon: v,
|
|
679
|
+
handleCloseFilter: C,
|
|
680
|
+
handleSearch: R,
|
|
681
|
+
handleChangeFilters: L
|
|
682
|
+
};
|
|
683
|
+
}, Pt = ({
|
|
684
|
+
headers: e,
|
|
685
|
+
filters: s,
|
|
686
|
+
onChangeFilters: m,
|
|
687
|
+
isStudentFilter: c,
|
|
688
|
+
teacherOptions: S = [],
|
|
689
|
+
assistantOptions: f = [],
|
|
690
|
+
counselorOptions: r = [],
|
|
691
|
+
secondaryTeacherOptions: y = []
|
|
692
|
+
}) => {
|
|
693
|
+
const {
|
|
694
|
+
popoverId: u,
|
|
695
|
+
users: E,
|
|
696
|
+
handleFilterIcon: l,
|
|
697
|
+
handleCloseFilter: o,
|
|
698
|
+
handleSearch: h,
|
|
699
|
+
handleChangeFilters: U
|
|
700
|
+
} = Mt({
|
|
701
|
+
filters: s,
|
|
702
|
+
onChangeFilters: m,
|
|
703
|
+
isStudentFilter: c,
|
|
704
|
+
teacherOptions: S,
|
|
705
|
+
assistantOptions: f,
|
|
706
|
+
counselorOptions: r,
|
|
707
|
+
secondaryTeacherOptions: y
|
|
708
|
+
}), _ = Object.entries(s).filter(
|
|
709
|
+
([v, C]) => C !== "" && !(Array.isArray(C) && C.length === 0) && C !== null && C !== void 0
|
|
710
|
+
).map(([v]) => v), w = Object.entries(G).filter(([v, C]) => isNaN(Number(v))), N = _.map((v) => w.find(([C]) => C === v)).filter((v) => !!v);
|
|
711
|
+
return /* @__PURE__ */ t("tr", { children: e.map((v) => v.onSelectAll ? /* @__PURE__ */ t("th", { className: `align-middle text-center ${v.className}`, children: /* @__PURE__ */ t(
|
|
712
|
+
"input",
|
|
713
|
+
{
|
|
714
|
+
type: "checkbox",
|
|
715
|
+
onChange: () => v.onSelectAll?.(),
|
|
716
|
+
checked: v.isCheckAll ?? !1
|
|
717
|
+
}
|
|
718
|
+
) }, v.name) : /* @__PURE__ */ t(
|
|
719
|
+
Ft,
|
|
720
|
+
{
|
|
721
|
+
users: E,
|
|
722
|
+
data: v,
|
|
723
|
+
isCenter: v.isCenter,
|
|
724
|
+
filters: s,
|
|
725
|
+
popoverId: u,
|
|
726
|
+
selectedOptions: s.searchByStrings,
|
|
727
|
+
onSearch: h,
|
|
728
|
+
onClose: o,
|
|
729
|
+
onOpenFilter: l,
|
|
730
|
+
onChangeFilters: m,
|
|
731
|
+
onOptionsChange: U,
|
|
732
|
+
isActive: typeof v.searchBy == "number" && N.some(([C, R]) => R === v.searchBy)
|
|
733
|
+
},
|
|
734
|
+
v.name
|
|
735
|
+
)) });
|
|
736
|
+
}, zt = () => {
|
|
737
|
+
const e = ee(), s = oe((y) => y?.common?.user?.schoolName) || "", m = async (y) => {
|
|
738
|
+
e(I(!0));
|
|
739
|
+
try {
|
|
740
|
+
const u = await Ke(y), E = u.data.items || u.data, l = c(E), o = document.createElement("a");
|
|
741
|
+
o.href = l, o.download = `${s}_Users_Report.csv`, o.click();
|
|
742
|
+
} catch (u) {
|
|
743
|
+
e(
|
|
744
|
+
A({
|
|
745
|
+
type: "danger",
|
|
746
|
+
message: u.response?.data?.title || u.message
|
|
747
|
+
})
|
|
748
|
+
);
|
|
749
|
+
}
|
|
750
|
+
e(I(!1));
|
|
751
|
+
}, c = (y) => {
|
|
752
|
+
let u = `First Name,Last Name,Email,Phone,Age,Grade,Tiers,Role,Active Status,Create Time,Roster Sourced Id,Roster Status,Roster Family Name,Roster Middle Name,Roster Given Name,Roster Email,Roster Role,Roster Grades,Teachers,Assistants,Counselors,SupportTeachers,EduTeachers
|
|
753
|
+
`;
|
|
754
|
+
const E = y.map((l) => {
|
|
755
|
+
const o = l.dateOfBirth !== Oe ? ft(
|
|
756
|
+
/* @__PURE__ */ new Date(),
|
|
757
|
+
yt(l.dateOfBirth)
|
|
758
|
+
) : "";
|
|
759
|
+
return `${r(l.firstName)},${r(l.lastName)},${r(l.email)},${r(l.phoneNumber)},${o},${r(l.grade)},${r(l.appType || "")},${r(l.roles.join(", ").replace("SecondaryTeacher", "SupportTeacher"))},${l.isActive ? "Active" : "Inactive"},${Ie(l?.createTime, "yyyy-MM-dd HH:mm")},${r(l.sourcedId)},${r(l.rosterUser?.status)},${r(l.rosterUser?.familyName)},${r(l.rosterUser?.middleName)},${r(l.rosterUser?.givenName)},${r(l.rosterUser?.email)},${r(l.rosterUser?.role)},${r(l.rosterUser?.grades)},${r(l.teachers)},${r(l.assistants)},${r(l.counselors)},${r(l.supportTeachers)},${r(l.eduTeachers)}`;
|
|
760
|
+
}).join(`
|
|
761
|
+
`);
|
|
762
|
+
return `${Ne}${u}${encodeURIComponent(E)}`;
|
|
763
|
+
}, S = async (y) => {
|
|
764
|
+
e(I(!0));
|
|
765
|
+
try {
|
|
766
|
+
const u = await Ge(y), E = u?.data?.items || u?.data || [], l = f(E), o = document.createElement("a");
|
|
767
|
+
o.href = l, o.download = "Classcode.csv", o.click();
|
|
768
|
+
} catch (u) {
|
|
769
|
+
e(
|
|
770
|
+
A({
|
|
771
|
+
type: "danger",
|
|
772
|
+
message: u.response?.data?.title || u.message
|
|
773
|
+
})
|
|
774
|
+
);
|
|
775
|
+
}
|
|
776
|
+
e(I(!1));
|
|
777
|
+
}, f = (y) => {
|
|
778
|
+
let u = `Teacher name,Teacher Email,Teacher code
|
|
779
|
+
`;
|
|
780
|
+
const o = (Array.isArray(y) ? y : []).filter((h) => h.roles && h.roles.includes("Teacher")).map((h) => `${r(h.fullName)},${r(h.email)},${r(h?.assignCode || "")}`).join(`
|
|
781
|
+
`);
|
|
782
|
+
return `${Ne}${u}${encodeURIComponent(o)}`;
|
|
783
|
+
}, r = (y) => y ? `"${y.replace(/"/g, '""').replaceAll(/\n/g, " ")}"` : "";
|
|
784
|
+
return {
|
|
785
|
+
exportUsers: m,
|
|
786
|
+
exportClassCodes: S
|
|
787
|
+
};
|
|
788
|
+
}, Be = `${Te}/api/ImportCsv/csv`, le = `${Te}/api/Teacher`, Ht = (e, s) => te.post(`${Be}/${s}`, e), Re = (e) => te.post(`${Be}/importClassReflection`, e), jt = (e, s) => te.post(`${le}/adminImportStudentByTeacherId/${e}`, s), Vt = (e) => te.post(`${le}/adminImport`, e), Jt = (e = !0) => st.get(`${le}/download-template-file-user?hasEsSchool=${e}`), ms = (e, s, m = !0) => te.post(`${le}/validate-csv-template-student/${s}?hasEsSchool=${m}`, e);
|
|
789
|
+
var $e = /* @__PURE__ */ ((e) => (e.Students = "students", e.Subjects = "subjects", e.Grades = "grades", e.Attendances = "attendances", e.ClassReflection = "classReflection", e.Others = "others", e.AllUser = "allUser", e))($e || {});
|
|
790
|
+
const he = "csvupload", xe = {
|
|
791
|
+
teacherName: "",
|
|
792
|
+
teacherEmail: "",
|
|
793
|
+
studentIds: [],
|
|
794
|
+
file: ""
|
|
795
|
+
}, Gt = () => {
|
|
796
|
+
const e = ee(), s = oe((p) => p.common.isLoading), [m, c] = P(null), [S, f] = P(), [r, y] = P([]), [u, E] = P(
|
|
797
|
+
xe
|
|
798
|
+
), [l, o] = P(), h = window.location.hostname, U = h.includes("isb") || h.includes("stage"), [_, w] = P(0), [N, v] = P(""), C = async () => {
|
|
799
|
+
e(I(!0));
|
|
800
|
+
try {
|
|
801
|
+
const d = await Jt();
|
|
802
|
+
var p = new Blob([d.data.content], { type: "text/csv" });
|
|
803
|
+
const T = window.URL.createObjectURL(p);
|
|
804
|
+
var a = document.createElement("a");
|
|
805
|
+
a.href = T, a.setAttribute("download", d.data.nameFile), a.click(), e(
|
|
806
|
+
A({
|
|
807
|
+
type: "success",
|
|
808
|
+
message: "Download successfully"
|
|
809
|
+
})
|
|
810
|
+
);
|
|
811
|
+
} catch (d) {
|
|
812
|
+
e(
|
|
813
|
+
A({
|
|
814
|
+
type: "danger",
|
|
815
|
+
message: d.message
|
|
816
|
+
})
|
|
817
|
+
);
|
|
818
|
+
}
|
|
819
|
+
e(I(!1));
|
|
820
|
+
}, R = z(
|
|
821
|
+
async (p) => {
|
|
822
|
+
if (!m || !p) return;
|
|
823
|
+
e(I(!0));
|
|
824
|
+
try {
|
|
825
|
+
const x = new FormData();
|
|
826
|
+
if (x.append("file", p, p.name), m == "allUser") {
|
|
827
|
+
let M = (await p.text()).trim();
|
|
828
|
+
const k = M.split(`
|
|
829
|
+
`).map((H) => H.trim()), D = k.findIndex(
|
|
830
|
+
(H) => H.split(",").includes("FirstName")
|
|
831
|
+
);
|
|
832
|
+
if (D === 0)
|
|
833
|
+
throw new Error("Invalid CSV: Missing header row.");
|
|
834
|
+
M = k.slice(D).join(`
|
|
835
|
+
`);
|
|
836
|
+
const j = _e.parse(M, {
|
|
837
|
+
header: !0,
|
|
838
|
+
skipEmptyLines: !0
|
|
839
|
+
}), J = j.meta.fields, se = j.data;
|
|
840
|
+
if (!J)
|
|
841
|
+
throw new Error("Unable to determine header from CSV file");
|
|
842
|
+
const q = 20, W = [];
|
|
843
|
+
for (let H = 0; H < se.length; H += q) {
|
|
844
|
+
const ie = se.slice(H, H + q), ne = _e.unparse({
|
|
845
|
+
fields: J,
|
|
846
|
+
data: ie
|
|
847
|
+
});
|
|
848
|
+
W.push(ne);
|
|
849
|
+
}
|
|
850
|
+
for (let H = 0; H < W.length; H++) {
|
|
851
|
+
const ie = new Blob([W[H]], { type: "text/csv" }), ne = new FormData();
|
|
852
|
+
ne.append(
|
|
853
|
+
"file",
|
|
854
|
+
ie,
|
|
855
|
+
`students_chunk${H + 1}.csv`
|
|
856
|
+
), await Vt(ne);
|
|
857
|
+
}
|
|
858
|
+
} else
|
|
859
|
+
U ? m == "classReflection" && await Re(x) : await Ht(x, m.toString());
|
|
860
|
+
e(
|
|
861
|
+
A({
|
|
862
|
+
type: "success",
|
|
863
|
+
message: "Import CSV successfully"
|
|
864
|
+
})
|
|
865
|
+
);
|
|
866
|
+
} catch (x) {
|
|
867
|
+
e(
|
|
868
|
+
A({
|
|
869
|
+
type: "danger",
|
|
870
|
+
message: x.response?.data?.title || x.message
|
|
871
|
+
})
|
|
872
|
+
);
|
|
873
|
+
}
|
|
874
|
+
e(I(!1));
|
|
875
|
+
const a = document.getElementById(he), d = document.getElementById("import-student"), T = document.getElementById(
|
|
876
|
+
"import-classReflection"
|
|
877
|
+
);
|
|
878
|
+
a && (a.value = ""), d && (d.value = ""), T && (T.value = "");
|
|
879
|
+
},
|
|
880
|
+
[m]
|
|
881
|
+
), L = async (p) => {
|
|
882
|
+
if (!_) {
|
|
883
|
+
e(
|
|
884
|
+
A({
|
|
885
|
+
type: "danger",
|
|
886
|
+
message: "Select teacher before import csv"
|
|
887
|
+
})
|
|
888
|
+
);
|
|
889
|
+
return;
|
|
890
|
+
}
|
|
891
|
+
if (!m || !p) return;
|
|
892
|
+
e(I(!0));
|
|
893
|
+
try {
|
|
894
|
+
const d = new FormData();
|
|
895
|
+
d.append("file", p, p.name), await jt(_, d), e(
|
|
896
|
+
A({
|
|
897
|
+
type: "success",
|
|
898
|
+
message: "Import CSV successfully"
|
|
899
|
+
})
|
|
900
|
+
);
|
|
901
|
+
} catch (d) {
|
|
902
|
+
e(
|
|
903
|
+
A({
|
|
904
|
+
type: "danger",
|
|
905
|
+
message: d.response?.data?.title || d.message
|
|
906
|
+
})
|
|
907
|
+
);
|
|
908
|
+
}
|
|
909
|
+
e(I(!1));
|
|
910
|
+
const a = document.getElementById("teacherSelector");
|
|
911
|
+
a && (a.value = "");
|
|
912
|
+
}, B = async (p) => {
|
|
913
|
+
if (!S || !S) return;
|
|
914
|
+
e(I(!0));
|
|
915
|
+
try {
|
|
916
|
+
const d = new FormData();
|
|
917
|
+
d.append("file", S, S.name), d.append("teacherName", p.teacherName), d.append("teacherEmail", p.teacherEmail), p.studentIds.forEach((T) => {
|
|
918
|
+
d.append("studentIds", T);
|
|
919
|
+
}), await Re(d), e(
|
|
920
|
+
A({
|
|
921
|
+
type: "success",
|
|
922
|
+
message: "Import CSV successfully"
|
|
923
|
+
})
|
|
924
|
+
), E(xe);
|
|
925
|
+
} catch (d) {
|
|
926
|
+
e(
|
|
927
|
+
A({
|
|
928
|
+
type: "danger",
|
|
929
|
+
message: d.response?.data?.title || d.message
|
|
930
|
+
})
|
|
931
|
+
);
|
|
932
|
+
}
|
|
933
|
+
e(I(!1));
|
|
934
|
+
const a = document.getElementById(he);
|
|
935
|
+
a && (a.value = "");
|
|
936
|
+
}, O = (p) => {
|
|
937
|
+
w(p.value);
|
|
938
|
+
}, i = (p) => {
|
|
939
|
+
o(p), v(p?.name || "");
|
|
940
|
+
}, n = () => {
|
|
941
|
+
if (!l) {
|
|
942
|
+
e(
|
|
943
|
+
A({
|
|
944
|
+
type: "danger",
|
|
945
|
+
message: "Select CSV to import"
|
|
946
|
+
})
|
|
947
|
+
);
|
|
948
|
+
return;
|
|
949
|
+
}
|
|
950
|
+
L(l);
|
|
951
|
+
};
|
|
952
|
+
return {
|
|
953
|
+
isLoading: s,
|
|
954
|
+
id: he,
|
|
955
|
+
setType: c,
|
|
956
|
+
upload: R,
|
|
957
|
+
initImportReflection: u,
|
|
958
|
+
setInitImportReflection: E,
|
|
959
|
+
onConfirm: B,
|
|
960
|
+
CSVType: $e,
|
|
961
|
+
dataFile: S,
|
|
962
|
+
setDataFile: f,
|
|
963
|
+
setArrStudent: y,
|
|
964
|
+
arrStudent: r,
|
|
965
|
+
isCheckDomainIBS: U,
|
|
966
|
+
onChangeTeacher: O,
|
|
967
|
+
uploadByTeacherId: L,
|
|
968
|
+
setDataFileImportStudent: i,
|
|
969
|
+
onUpLoadStudentFile: n,
|
|
970
|
+
defaultTeacher: _,
|
|
971
|
+
fileName: N,
|
|
972
|
+
onStudentSubmit: () => {
|
|
973
|
+
e(
|
|
974
|
+
Z({
|
|
975
|
+
isOpen: !0,
|
|
976
|
+
type: "warning",
|
|
977
|
+
message: "Are you sure upload this file?",
|
|
978
|
+
onConfirm: () => {
|
|
979
|
+
n();
|
|
980
|
+
}
|
|
981
|
+
})
|
|
982
|
+
);
|
|
983
|
+
},
|
|
984
|
+
downloadTemplateUser: C
|
|
985
|
+
};
|
|
986
|
+
}, Kt = () => {
|
|
987
|
+
const e = ee(), s = async (S) => {
|
|
988
|
+
e(I(!0));
|
|
989
|
+
try {
|
|
990
|
+
await qe(S), e(
|
|
991
|
+
A({
|
|
992
|
+
type: "success",
|
|
993
|
+
message: "Send Successfully"
|
|
994
|
+
})
|
|
995
|
+
);
|
|
996
|
+
} catch (f) {
|
|
997
|
+
e(
|
|
998
|
+
A({
|
|
999
|
+
type: "danger",
|
|
1000
|
+
message: f.response?.data?.title || f.message
|
|
1001
|
+
})
|
|
1002
|
+
);
|
|
1003
|
+
}
|
|
1004
|
+
e(I(!1));
|
|
1005
|
+
};
|
|
1006
|
+
return {
|
|
1007
|
+
handleSendMultiUsers: (S) => {
|
|
1008
|
+
s({ userIds: [...S] });
|
|
1009
|
+
},
|
|
1010
|
+
handleSendSingleUser: (S) => {
|
|
1011
|
+
s({ userIds: [S] });
|
|
1012
|
+
}
|
|
1013
|
+
};
|
|
1014
|
+
}, pe = {
|
|
1015
|
+
fontWeight: 500
|
|
1016
|
+
}, ue = {
|
|
1017
|
+
height: 38,
|
|
1018
|
+
backgroundColor: "#2eb85c",
|
|
1019
|
+
borderColor: "#2eb85c"
|
|
1020
|
+
}, qt = {
|
|
1021
|
+
display: "inline-block",
|
|
1022
|
+
fontSize: 11,
|
|
1023
|
+
fontWeight: 700,
|
|
1024
|
+
color: "#3b4ba8",
|
|
1025
|
+
backgroundColor: "#e9ecfb",
|
|
1026
|
+
borderRadius: 4,
|
|
1027
|
+
padding: "1px 6px",
|
|
1028
|
+
marginRight: 6,
|
|
1029
|
+
textTransform: "uppercase"
|
|
1030
|
+
}, we = ({ label: e }) => /* @__PURE__ */ t("span", { style: qt, children: e }), ge = ({ label: e }) => /* @__PURE__ */ t("span", { style: {
|
|
1031
|
+
display: "inline-flex",
|
|
1032
|
+
alignItems: "center",
|
|
1033
|
+
justifyContent: "center",
|
|
1034
|
+
fontSize: 11,
|
|
1035
|
+
fontWeight: 700,
|
|
1036
|
+
color: "#3b4ba8",
|
|
1037
|
+
backgroundColor: "#e9ecfb",
|
|
1038
|
+
borderRadius: 4,
|
|
1039
|
+
padding: "3px 8px",
|
|
1040
|
+
textTransform: "uppercase"
|
|
1041
|
+
}, children: e }), Wt = ({ isActive: e, t: s }) => /* @__PURE__ */ b("span", { style: {
|
|
1042
|
+
display: "inline-flex",
|
|
1043
|
+
alignItems: "center",
|
|
1044
|
+
fontSize: 12,
|
|
1045
|
+
fontWeight: 600,
|
|
1046
|
+
color: e ? "#047857" : "#6b7280",
|
|
1047
|
+
backgroundColor: e ? "#d1fae5" : "#f3f4f6",
|
|
1048
|
+
borderRadius: "20px",
|
|
1049
|
+
padding: "4px 12px"
|
|
1050
|
+
}, children: [
|
|
1051
|
+
/* @__PURE__ */ t("span", { style: {
|
|
1052
|
+
width: "6px",
|
|
1053
|
+
height: "6px",
|
|
1054
|
+
borderRadius: "50%",
|
|
1055
|
+
backgroundColor: e ? "#10b981" : "#9ca3af",
|
|
1056
|
+
marginRight: "8px"
|
|
1057
|
+
} }),
|
|
1058
|
+
s(e ? "active" : "inactive")
|
|
1059
|
+
] }), fe = (e) => (e || []).map((s) => s === "SecondaryTeacher" ? "SupportTeacher" : s).join(", "), Yt = "user", Qt = () => {
|
|
1060
|
+
const {
|
|
1061
|
+
queryName: e,
|
|
1062
|
+
userList: s,
|
|
1063
|
+
totalItems: m,
|
|
1064
|
+
filters: c,
|
|
1065
|
+
fullName: S,
|
|
1066
|
+
removeData: f,
|
|
1067
|
+
changeFilters: r,
|
|
1068
|
+
reDirectDetailPage: y,
|
|
1069
|
+
switchUser: u,
|
|
1070
|
+
handleSyncRosterUsers: E,
|
|
1071
|
+
rosterUserInfo: l,
|
|
1072
|
+
onSelectUser: o,
|
|
1073
|
+
userIds: h,
|
|
1074
|
+
onSelectAllUser: U,
|
|
1075
|
+
isCheckAll: _
|
|
1076
|
+
} = Ot(), { handleSendMultiUsers: w } = Kt(), { upload: N } = Gt(), {
|
|
1077
|
+
exportUsers: v,
|
|
1078
|
+
exportClassCodes: C
|
|
1079
|
+
} = zt(), { t: R } = ce(), L = () => v(c), B = () => C(c), O = [
|
|
1080
|
+
{
|
|
1081
|
+
name: "",
|
|
1082
|
+
isCenter: !0,
|
|
1083
|
+
onSelectAll: U,
|
|
1084
|
+
isCheckAll: _
|
|
1085
|
+
}
|
|
1086
|
+
].concat(ut);
|
|
1087
|
+
return /* @__PURE__ */ b("div", { className: `fadeIn animated h-100 ${it <= 767 ? $["p-0-12"] : ""}`, children: [
|
|
1088
|
+
/* @__PURE__ */ t("h5", { className: "mt-4 mb-2", children: R(`${Yt}`) }),
|
|
1089
|
+
/* @__PURE__ */ b(Se, { className: "my-2", children: [
|
|
1090
|
+
/* @__PURE__ */ t(Q, { md: 8, children: /* @__PURE__ */ t(
|
|
1091
|
+
nt,
|
|
1092
|
+
{
|
|
1093
|
+
text: R("create_user"),
|
|
1094
|
+
onClick: () => y(),
|
|
1095
|
+
initValue: e || "",
|
|
1096
|
+
onSearch: (i) => r({
|
|
1097
|
+
searchString: i
|
|
1098
|
+
}),
|
|
1099
|
+
placeholder: R("type_something_to_search_by_user_name")
|
|
1100
|
+
}
|
|
1101
|
+
) }),
|
|
1102
|
+
/* @__PURE__ */ b(
|
|
1103
|
+
Q,
|
|
1104
|
+
{
|
|
1105
|
+
md: 4,
|
|
1106
|
+
className: "d-flex justify-content-end align-items-center",
|
|
1107
|
+
children: [
|
|
1108
|
+
R("total_of_users"),
|
|
1109
|
+
" : ",
|
|
1110
|
+
m
|
|
1111
|
+
]
|
|
1112
|
+
}
|
|
1113
|
+
),
|
|
1114
|
+
/* @__PURE__ */ b(Q, { md: 12, className: "d-flex justify-content-end my-2 flex-wrap", style: { gap: "8px" }, children: [
|
|
1115
|
+
/* @__PURE__ */ t(
|
|
1116
|
+
"button",
|
|
1117
|
+
{
|
|
1118
|
+
className: "btn btn-success d-flex align-items-center border-0",
|
|
1119
|
+
style: ue,
|
|
1120
|
+
onClick: () => w(h),
|
|
1121
|
+
children: /* @__PURE__ */ t("p", { className: `${$["button-content"]} mb-0`, style: pe, children: R("welcome_email_resend") })
|
|
1122
|
+
}
|
|
1123
|
+
),
|
|
1124
|
+
/* @__PURE__ */ t(
|
|
1125
|
+
X,
|
|
1126
|
+
{
|
|
1127
|
+
id: "import-user",
|
|
1128
|
+
className: "d-none",
|
|
1129
|
+
type: "file",
|
|
1130
|
+
onChange: (i) => N(i.target.files[0]),
|
|
1131
|
+
accept: "text/csv"
|
|
1132
|
+
}
|
|
1133
|
+
),
|
|
1134
|
+
/* @__PURE__ */ t(At, { text: R("sync_roster_users"), onClick: E }),
|
|
1135
|
+
/* @__PURE__ */ b(
|
|
1136
|
+
"button",
|
|
1137
|
+
{
|
|
1138
|
+
className: "btn btn-success d-flex align-items-center border-0 p-0",
|
|
1139
|
+
style: ue,
|
|
1140
|
+
onClick: B,
|
|
1141
|
+
children: [
|
|
1142
|
+
/* @__PURE__ */ t("div", { className: `${$["button-icon"]}`, children: /* @__PURE__ */ t("img", { src: "images/export-icon.svg", alt: "" }) }),
|
|
1143
|
+
/* @__PURE__ */ t("p", { className: `${$["button-content"]} mb-0`, style: pe, children: R("export_class_code_to_csv") })
|
|
1144
|
+
]
|
|
1145
|
+
}
|
|
1146
|
+
),
|
|
1147
|
+
/* @__PURE__ */ b(
|
|
1148
|
+
"button",
|
|
1149
|
+
{
|
|
1150
|
+
className: "btn btn-success d-flex align-items-center border-0 p-0",
|
|
1151
|
+
style: ue,
|
|
1152
|
+
onClick: L,
|
|
1153
|
+
children: [
|
|
1154
|
+
/* @__PURE__ */ t("div", { className: `${$["button-icon"]}`, children: /* @__PURE__ */ t("img", { src: "images/export-icon.svg", alt: "" }) }),
|
|
1155
|
+
/* @__PURE__ */ t("p", { className: `${$["button-content"]} mb-0`, style: pe, children: R("export_to_csv") })
|
|
1156
|
+
]
|
|
1157
|
+
}
|
|
1158
|
+
)
|
|
1159
|
+
] })
|
|
1160
|
+
] }),
|
|
1161
|
+
/* @__PURE__ */ b(Se, { className: "mb-2", children: [
|
|
1162
|
+
/* @__PURE__ */ t(Q, { md: 12, children: /* @__PURE__ */ t("div", { style: { overflow: "auto" }, children: /* @__PURE__ */ b(Fe, { bordered: !0, hover: !0, striped: !0, size: "sm", children: [
|
|
1163
|
+
/* @__PURE__ */ t("thead", { children: /* @__PURE__ */ t(
|
|
1164
|
+
Pt,
|
|
1165
|
+
{
|
|
1166
|
+
headers: O,
|
|
1167
|
+
filters: c,
|
|
1168
|
+
fullName: S,
|
|
1169
|
+
onChangeFilters: r
|
|
1170
|
+
}
|
|
1171
|
+
) }),
|
|
1172
|
+
/* @__PURE__ */ b("tbody", { children: [
|
|
1173
|
+
s && s.length > 0 && s.map((i) => {
|
|
1174
|
+
const n = (i.appType || "").toUpperCase(), g = n.includes("ES") && n.includes("MS");
|
|
1175
|
+
return /* @__PURE__ */ b("tr", { children: [
|
|
1176
|
+
/* @__PURE__ */ t("td", { className: "align-middle", children: /* @__PURE__ */ t(
|
|
1177
|
+
"input",
|
|
1178
|
+
{
|
|
1179
|
+
type: "checkbox",
|
|
1180
|
+
onChange: () => o(i.id),
|
|
1181
|
+
checked: h.includes(i.id) ?? !1
|
|
1182
|
+
}
|
|
1183
|
+
) }),
|
|
1184
|
+
/* @__PURE__ */ t("td", { className: "align-middle", children: /* @__PURE__ */ t(
|
|
1185
|
+
at,
|
|
1186
|
+
{
|
|
1187
|
+
label: `${i.fullName}`,
|
|
1188
|
+
onClick: () => y(i.id)
|
|
1189
|
+
}
|
|
1190
|
+
) }),
|
|
1191
|
+
/* @__PURE__ */ t("td", { className: "align-middle", children: i.email }),
|
|
1192
|
+
/* @__PURE__ */ t("td", { className: "align-middle", children: i.dateOfBirth !== Oe && St(
|
|
1193
|
+
/* @__PURE__ */ new Date(),
|
|
1194
|
+
new Date(i.dateOfBirth)
|
|
1195
|
+
) }),
|
|
1196
|
+
/* @__PURE__ */ t("td", { className: "align-middle", children: g ? /* @__PURE__ */ b(ke, { children: [
|
|
1197
|
+
/* @__PURE__ */ b("div", { children: [
|
|
1198
|
+
/* @__PURE__ */ t(we, { label: "ES" }),
|
|
1199
|
+
fe(i.esRoles)
|
|
1200
|
+
] }),
|
|
1201
|
+
/* @__PURE__ */ b("div", { className: "mt-1", children: [
|
|
1202
|
+
/* @__PURE__ */ t(we, { label: "MS" }),
|
|
1203
|
+
fe(i.msRoles)
|
|
1204
|
+
] })
|
|
1205
|
+
] }) : !!i.roles && fe(i.roles) }),
|
|
1206
|
+
/* @__PURE__ */ t("td", { className: "align-middle text-uppercase", children: g ? /* @__PURE__ */ b("div", { style: { display: "flex", flexDirection: "column", gap: "4px", alignItems: "center", width: "fit-content" }, children: [
|
|
1207
|
+
/* @__PURE__ */ t(ge, { label: "ES" }),
|
|
1208
|
+
/* @__PURE__ */ t(ge, { label: "MS" })
|
|
1209
|
+
] }) : i.appType ? /* @__PURE__ */ t(ge, { label: i.appType }) : null }),
|
|
1210
|
+
/* @__PURE__ */ t("td", { className: "align-middle", children: /* @__PURE__ */ t(Wt, { isActive: i.isActive, t: R }) }),
|
|
1211
|
+
/* @__PURE__ */ t("td", { className: "align-middle", children: Ie(i?.createTime, "yyyy-MM-dd HH:mm") }),
|
|
1212
|
+
/* @__PURE__ */ t("td", { children: l(i) }),
|
|
1213
|
+
/* @__PURE__ */ t("td", { className: "align-middle", children: /* @__PURE__ */ t(
|
|
1214
|
+
rt,
|
|
1215
|
+
{
|
|
1216
|
+
style: { fontSize: "18px", margin: "0 10px", cursor: "pointer" },
|
|
1217
|
+
onClick: () => u(i.id)
|
|
1218
|
+
}
|
|
1219
|
+
) }),
|
|
1220
|
+
/* @__PURE__ */ t("td", { className: "align-middle", style: { padding: "0 15px" }, children: /* @__PURE__ */ t(
|
|
1221
|
+
ot,
|
|
1222
|
+
{
|
|
1223
|
+
onClick: () => f(i.id)
|
|
1224
|
+
}
|
|
1225
|
+
) })
|
|
1226
|
+
] }, `${i.id}_${i.appType || ""}`);
|
|
1227
|
+
}),
|
|
1228
|
+
(!s || !s.length) && /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", { colSpan: 12, className: "p-0", children: /* @__PURE__ */ t(ct, { className: "mb-0", label: R("user") }) }) })
|
|
1229
|
+
] })
|
|
1230
|
+
] }) }) }),
|
|
1231
|
+
/* @__PURE__ */ t(Q, { md: 12, children: /* @__PURE__ */ t(
|
|
1232
|
+
lt,
|
|
1233
|
+
{
|
|
1234
|
+
filters: c,
|
|
1235
|
+
totalRecordCount: m,
|
|
1236
|
+
changePageSize: (i) => r({ pageSize: i }),
|
|
1237
|
+
changePage: (i) => r({ currentPage: i })
|
|
1238
|
+
}
|
|
1239
|
+
) })
|
|
1240
|
+
] })
|
|
1241
|
+
] });
|
|
1242
|
+
}, hs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1243
|
+
__proto__: null,
|
|
1244
|
+
default: Qt
|
|
1245
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1246
|
+
export {
|
|
1247
|
+
ds as A,
|
|
1248
|
+
Pt as T,
|
|
1249
|
+
Qt as U,
|
|
1250
|
+
hs as a,
|
|
1251
|
+
ms as v
|
|
1252
|
+
};
|