@burdenoff/microfe-buildmyiq 2026.803.1 → 2026.804.2
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/buildmyiq/hooks/useBuildmyiqApi.d.ts +21 -3
- package/dist/buildmyiq/hooks/useBuildmyiqApi.d.ts.map +1 -1
- package/dist/buildmyiq/hooks/useBuildmyiqApi.js +116 -62
- package/dist/buildmyiq/hooks/useBuildmyiqApi.js.map +1 -1
- package/dist/buildmyiq/pages/DashboardPage.d.ts.map +1 -1
- package/dist/buildmyiq/pages/DashboardPage.js +3 -4
- package/dist/buildmyiq/pages/DashboardPage.js.map +1 -1
- package/dist/buildmyiq/pages/assessments/TakeAssessmentPage.d.ts.map +1 -1
- package/dist/buildmyiq/pages/assessments/TakeAssessmentPage.js +1 -2
- package/dist/buildmyiq/pages/assessments/TakeAssessmentPage.js.map +1 -1
- package/dist/buildmyiq/pages/catalog/CourseDetailPage.d.ts.map +1 -1
- package/dist/buildmyiq/pages/catalog/CourseDetailPage.js +14 -15
- package/dist/buildmyiq/pages/catalog/CourseDetailPage.js.map +1 -1
- package/dist/buildmyiq/pages/certificates/CertificatesPage.d.ts.map +1 -1
- package/dist/buildmyiq/pages/certificates/CertificatesPage.js +175 -175
- package/dist/buildmyiq/pages/certificates/CertificatesPage.js.map +1 -1
- package/dist/buildmyiq/pages/learning/MyLearningPage.js +2 -4
- package/dist/buildmyiq/pages/learning/MyLearningPage.js.map +1 -1
- package/dist/buildmyiq/pages/paths/PathsPage.d.ts.map +1 -1
- package/dist/buildmyiq/pages/paths/PathsPage.js +1 -2
- package/dist/buildmyiq/pages/paths/PathsPage.js.map +1 -1
- package/dist/buildmyiq/pages/submissions/AnswersView.d.ts +6 -0
- package/dist/buildmyiq/pages/submissions/AnswersView.d.ts.map +1 -0
- package/dist/buildmyiq/pages/submissions/AnswersView.js +41 -0
- package/dist/buildmyiq/pages/submissions/AnswersView.js.map +1 -0
- package/dist/buildmyiq/pages/submissions/BulkGradingPage.d.ts.map +1 -1
- package/dist/buildmyiq/pages/submissions/BulkGradingPage.js +332 -173
- package/dist/buildmyiq/pages/submissions/BulkGradingPage.js.map +1 -1
- package/dist/buildmyiq/pages/submissions/SubmissionsPage.d.ts.map +1 -1
- package/dist/buildmyiq/pages/submissions/SubmissionsPage.js +221 -227
- package/dist/buildmyiq/pages/submissions/SubmissionsPage.js.map +1 -1
- package/dist/buildmyiq/pages/submissions/aiGrading.d.ts +26 -0
- package/dist/buildmyiq/pages/submissions/aiGrading.d.ts.map +1 -0
- package/dist/buildmyiq/pages/submissions/aiGrading.js +23 -0
- package/dist/buildmyiq/pages/submissions/aiGrading.js.map +1 -0
- package/dist/buildmyiq/types/index.d.ts +10 -0
- package/dist/buildmyiq/types/index.d.ts.map +1 -1
- package/dist/buildmyiq/types/index.js.map +1 -1
- package/dist/utils/pageContext.d.ts +8 -0
- package/dist/utils/pageContext.d.ts.map +1 -1
- package/dist/utils/pageContext.js +8 -0
- package/dist/utils/pageContext.js.map +1 -1
- package/package.json +2 -1
|
@@ -4,86 +4,86 @@ import { PageLayout as t } from "../../components/PageLayout.js";
|
|
|
4
4
|
import { MetricsCard as n } from "../../components/MetricsCard.js";
|
|
5
5
|
import { formatDate as r, formatPercent as ee } from "../../utils/formatters.js";
|
|
6
6
|
import { StatusBadge as te } from "../../components/StatusBadge.js";
|
|
7
|
-
import { EmptyState as
|
|
8
|
-
import { ErrorView as
|
|
9
|
-
import { DataTable as
|
|
10
|
-
import { FilterTabs as
|
|
11
|
-
import { Pagination as
|
|
12
|
-
import { Avatar as
|
|
13
|
-
import { useBuiCertificates as
|
|
7
|
+
import { EmptyState as ne } from "../../components/EmptyState.js";
|
|
8
|
+
import { ErrorView as re, LoadingView as ie } from "../../components/StateViews.js";
|
|
9
|
+
import { DataTable as ae } from "../../components/DataTable.js";
|
|
10
|
+
import { FilterTabs as oe } from "../../components/FilterTabs.js";
|
|
11
|
+
import { Pagination as se } from "../../components/Pagination.js";
|
|
12
|
+
import { Avatar as ce } from "../../components/Avatar.js";
|
|
13
|
+
import { useBuiCertificates as le, useBuiCourses as ue, useBuiIssueCertificate as de, useBuiMyCertificates as fe, useBuiRevokeCertificate as pe } from "../../hooks/useBuildmyiqApi.js";
|
|
14
14
|
import "../../hooks/index.js";
|
|
15
|
-
import { FileLink as
|
|
16
|
-
import { BuiPermissionButton as
|
|
15
|
+
import { FileLink as me } from "../../components/FileLink.js";
|
|
16
|
+
import { BuiPermissionButton as i } from "../../components/BuiPermissionButton.js";
|
|
17
17
|
import "../../components/index.js";
|
|
18
|
-
import { useMemo as
|
|
19
|
-
import { Award as
|
|
20
|
-
import { Fragment as
|
|
21
|
-
import { Button as
|
|
18
|
+
import { useMemo as a, useState as o } from "react";
|
|
19
|
+
import { Award as s, Ban as c, CalendarClock as he, Download as ge, Plus as l, Search as _e, ShieldCheck as ve } from "lucide-react";
|
|
20
|
+
import { Fragment as ye, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
21
|
+
import { Button as f, Input as p, Label as m, ResponsiveDialog as be, ResponsiveDialogContent as xe, ResponsiveDialogDescription as Se, ResponsiveDialogFooter as Ce, ResponsiveDialogHeader as we, ResponsiveDialogTitle as Te, Select as h, SelectContent as g, SelectItem as _, SelectTrigger as v, SelectValue as y } from "@burdenoff/fe-libs/ui";
|
|
22
22
|
//#region src/buildmyiq/pages/certificates/CertificatesPage.tsx
|
|
23
|
-
var
|
|
23
|
+
var b = 8, Ee = (e) => {
|
|
24
24
|
let t = e.trim();
|
|
25
25
|
if (!t) return;
|
|
26
26
|
let n = new Date(t);
|
|
27
27
|
return Number.isNaN(n.getTime()) ? void 0 : n.toISOString();
|
|
28
|
-
},
|
|
29
|
-
let { currentUser:
|
|
28
|
+
}, De = () => `BMIQ-${Date.now().toString(36).toUpperCase()}`, x = () => {
|
|
29
|
+
let { currentUser: x } = e(), S = x?.id, [C, Oe] = o(S ? "MINE" : "ALL"), [w, T] = o("ALL"), [E, ke] = o(""), [Ae, D] = o(0), [je, O] = o(!1), [k, A] = o(null), [j, M] = o(null), [N, P] = o(null), F = () => ({
|
|
30
30
|
courseId: "",
|
|
31
|
-
learnerId:
|
|
32
|
-
serial:
|
|
31
|
+
learnerId: S ?? "",
|
|
32
|
+
serial: De(),
|
|
33
33
|
finalScore: "",
|
|
34
34
|
expiresAt: ""
|
|
35
|
-
}), [
|
|
35
|
+
}), [I, L] = o(F), R = ue({ limit: 100 }), z = a(() => R.data?.items ?? [], [R.data]), B = a(() => {
|
|
36
36
|
let e = /* @__PURE__ */ new Map();
|
|
37
|
-
for (let t of
|
|
37
|
+
for (let t of z) e.set(t.id, t.title);
|
|
38
38
|
return e;
|
|
39
|
-
}, [
|
|
40
|
-
let e =
|
|
41
|
-
return e ?
|
|
42
|
-
let n = (
|
|
39
|
+
}, [z]), V = w === "ALL" ? void 0 : w, Me = fe(V, C === "MINE"), Ne = le(V, C === "ALL"), H = C === "MINE" ? Me : Ne, U = de(), Pe = pe(), W = a(() => H.data ?? [], [H.data]), G = a(() => {
|
|
40
|
+
let e = E.trim().toLowerCase();
|
|
41
|
+
return e ? W.filter((t) => {
|
|
42
|
+
let n = (B.get(t.courseId) ?? "").toLowerCase(), r = t.learnerId === S ? "you me mine" : t.learnerId.toLowerCase();
|
|
43
43
|
return t.serial.toLowerCase().includes(e) || n.includes(e) || r.includes(e);
|
|
44
|
-
}) :
|
|
44
|
+
}) : W;
|
|
45
45
|
}, [
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
]),
|
|
46
|
+
W,
|
|
47
|
+
E,
|
|
48
|
+
B,
|
|
49
|
+
S
|
|
50
|
+
]), K = a(() => {
|
|
51
51
|
let e = 0, t = 0, n = 0;
|
|
52
|
-
for (let r of
|
|
52
|
+
for (let r of W) r.status === "ISSUED" ? e += 1 : r.status === "EXPIRED" ? t += 1 : r.status === "REVOKED" && (n += 1);
|
|
53
53
|
return {
|
|
54
|
-
total:
|
|
54
|
+
total: W.length,
|
|
55
55
|
issued: e,
|
|
56
56
|
expired: t,
|
|
57
57
|
revoked: n
|
|
58
58
|
};
|
|
59
|
-
}, [
|
|
59
|
+
}, [W]), Fe = Math.max(1, Math.ceil(G.length / b)), q = Math.min(Ae, Fe - 1), J = a(() => G.slice(q * b, q * b + b), [G, q]), Ie = [{
|
|
60
60
|
value: "MINE",
|
|
61
61
|
label: "Mine"
|
|
62
62
|
}, {
|
|
63
63
|
value: "ALL",
|
|
64
64
|
label: "All"
|
|
65
|
-
}],
|
|
65
|
+
}], Le = async (e) => {
|
|
66
66
|
if (!(typeof window < "u" && !window.confirm(`Revoke certificate ${e.serial}? This cannot be undone.`))) {
|
|
67
|
-
|
|
67
|
+
M(null), P(e.id);
|
|
68
68
|
try {
|
|
69
|
-
await
|
|
69
|
+
await Pe.mutateAsync(e.id);
|
|
70
70
|
} catch (e) {
|
|
71
|
-
|
|
71
|
+
M(e instanceof Error ? e.message : "Failed to revoke certificate.");
|
|
72
72
|
} finally {
|
|
73
|
-
|
|
73
|
+
P(null);
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
},
|
|
76
|
+
}, Y = [
|
|
77
77
|
{
|
|
78
78
|
key: "serial",
|
|
79
79
|
header: "Serial",
|
|
80
80
|
sortValue: (e) => e.serial.toLowerCase(),
|
|
81
|
-
render: (e) => /* @__PURE__ */
|
|
81
|
+
render: (e) => /* @__PURE__ */ d("div", {
|
|
82
82
|
className: "flex items-center gap-3",
|
|
83
|
-
children: [/* @__PURE__ */
|
|
83
|
+
children: [/* @__PURE__ */ u("div", {
|
|
84
84
|
className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-[var(--color-accent-primary)]",
|
|
85
|
-
children: /* @__PURE__ */
|
|
86
|
-
}), /* @__PURE__ */
|
|
85
|
+
children: /* @__PURE__ */ u(s, { className: "h-4 w-4" })
|
|
86
|
+
}), /* @__PURE__ */ u("span", {
|
|
87
87
|
className: "min-w-0 truncate font-mono text-xs font-semibold text-text-primary",
|
|
88
88
|
children: e.serial
|
|
89
89
|
})]
|
|
@@ -93,28 +93,28 @@ var S = 8, Ce = (e) => {
|
|
|
93
93
|
key: "course",
|
|
94
94
|
header: "Course",
|
|
95
95
|
hideOnMobile: !0,
|
|
96
|
-
sortValue: (e) => (
|
|
97
|
-
render: (e) => /* @__PURE__ */
|
|
96
|
+
sortValue: (e) => (B.get(e.courseId) ?? "").toLowerCase(),
|
|
97
|
+
render: (e) => /* @__PURE__ */ u("span", {
|
|
98
98
|
className: "text-text-secondary",
|
|
99
|
-
children:
|
|
99
|
+
children: B.get(e.courseId) ?? "—"
|
|
100
100
|
})
|
|
101
101
|
},
|
|
102
102
|
{
|
|
103
103
|
key: "learner",
|
|
104
104
|
header: "Learner",
|
|
105
|
-
sortValue: (e) => e.learnerId ===
|
|
105
|
+
sortValue: (e) => e.learnerId === S ? "" : e.learnerId,
|
|
106
106
|
render: (e) => {
|
|
107
|
-
let t = e.learnerId ===
|
|
108
|
-
return /* @__PURE__ */
|
|
107
|
+
let t = e.learnerId === S, n = t ? x?.name ?? x?.username ?? x?.email ?? null : null;
|
|
108
|
+
return /* @__PURE__ */ d("div", {
|
|
109
109
|
className: "flex items-center gap-2.5",
|
|
110
|
-
children: [/* @__PURE__ */
|
|
110
|
+
children: [/* @__PURE__ */ u(ce, {
|
|
111
111
|
size: "sm",
|
|
112
112
|
seed: e.learnerId,
|
|
113
113
|
name: n
|
|
114
|
-
}), t ? /* @__PURE__ */
|
|
114
|
+
}), t ? /* @__PURE__ */ u("span", {
|
|
115
115
|
className: "font-medium text-text-primary",
|
|
116
116
|
children: "You"
|
|
117
|
-
}) : /* @__PURE__ */
|
|
117
|
+
}) : /* @__PURE__ */ d("span", {
|
|
118
118
|
className: "font-mono text-xs text-text-tertiary",
|
|
119
119
|
title: e.learnerId,
|
|
120
120
|
children: [e.learnerId.slice(0, 8), "…"]
|
|
@@ -125,14 +125,14 @@ var S = 8, Ce = (e) => {
|
|
|
125
125
|
{
|
|
126
126
|
key: "status",
|
|
127
127
|
header: "Status",
|
|
128
|
-
render: (e) => /* @__PURE__ */
|
|
128
|
+
render: (e) => /* @__PURE__ */ u(te, { status: e.status })
|
|
129
129
|
},
|
|
130
130
|
{
|
|
131
131
|
key: "issuedAt",
|
|
132
132
|
header: "Issued",
|
|
133
133
|
hideOnMobile: !0,
|
|
134
134
|
sortValue: (e) => e.issuedAt,
|
|
135
|
-
render: (e) => /* @__PURE__ */
|
|
135
|
+
render: (e) => /* @__PURE__ */ u("span", {
|
|
136
136
|
className: "text-text-secondary",
|
|
137
137
|
children: r(e.issuedAt)
|
|
138
138
|
})
|
|
@@ -142,7 +142,7 @@ var S = 8, Ce = (e) => {
|
|
|
142
142
|
header: "Expires",
|
|
143
143
|
hideOnMobile: !0,
|
|
144
144
|
sortValue: (e) => e.expiresAt ?? "",
|
|
145
|
-
render: (e) => /* @__PURE__ */
|
|
145
|
+
render: (e) => /* @__PURE__ */ u("span", {
|
|
146
146
|
className: "text-text-tertiary",
|
|
147
147
|
children: r(e.expiresAt)
|
|
148
148
|
})
|
|
@@ -153,7 +153,7 @@ var S = 8, Ce = (e) => {
|
|
|
153
153
|
align: "right",
|
|
154
154
|
hideOnMobile: !0,
|
|
155
155
|
sortValue: (e) => e.finalScore ?? -1,
|
|
156
|
-
render: (e) => /* @__PURE__ */
|
|
156
|
+
render: (e) => /* @__PURE__ */ u("span", {
|
|
157
157
|
className: "font-medium tabular-nums text-text-primary",
|
|
158
158
|
children: e.finalScore == null ? "—" : ee(e.finalScore)
|
|
159
159
|
})
|
|
@@ -162,7 +162,7 @@ var S = 8, Ce = (e) => {
|
|
|
162
162
|
key: "file",
|
|
163
163
|
header: "PDF",
|
|
164
164
|
hideOnMobile: !0,
|
|
165
|
-
render: (e) => e.file ? /* @__PURE__ */
|
|
165
|
+
render: (e) => e.file ? /* @__PURE__ */ u(me, { fileId: e.file.id }) : /* @__PURE__ */ u("span", {
|
|
166
166
|
className: "text-text-tertiary",
|
|
167
167
|
children: "—"
|
|
168
168
|
})
|
|
@@ -171,133 +171,133 @@ var S = 8, Ce = (e) => {
|
|
|
171
171
|
key: "actions",
|
|
172
172
|
header: "",
|
|
173
173
|
align: "right",
|
|
174
|
-
render: (e) => e.status === "ISSUED" ? /* @__PURE__ */
|
|
174
|
+
render: (e) => e.status === "ISSUED" ? /* @__PURE__ */ u(i, {
|
|
175
175
|
resource: "buildmyiq-certificate",
|
|
176
176
|
action: "update",
|
|
177
177
|
deniedBehavior: "hide",
|
|
178
|
-
children: /* @__PURE__ */
|
|
178
|
+
children: /* @__PURE__ */ d(f, {
|
|
179
179
|
variant: "ghost",
|
|
180
180
|
size: "sm",
|
|
181
181
|
className: "text-status-error-text hover:text-status-error-text",
|
|
182
|
-
disabled:
|
|
183
|
-
onClick: () => void
|
|
184
|
-
children: [/* @__PURE__ */
|
|
182
|
+
disabled: N === e.id,
|
|
183
|
+
onClick: () => void Le(e),
|
|
184
|
+
children: [/* @__PURE__ */ u(c, { className: "mr-1.5 h-4 w-4" }), N === e.id ? "Revoking…" : "Revoke"]
|
|
185
185
|
})
|
|
186
186
|
}) : null
|
|
187
187
|
}
|
|
188
188
|
], X = () => {
|
|
189
|
-
|
|
189
|
+
L(F()), A(null), O(!0);
|
|
190
190
|
}, Z = () => {
|
|
191
|
-
|
|
192
|
-
},
|
|
193
|
-
if (!
|
|
194
|
-
|
|
191
|
+
O(!1), L(F()), A(null);
|
|
192
|
+
}, Re = async () => {
|
|
193
|
+
if (!I.courseId) {
|
|
194
|
+
A("Please choose a course for this certificate.");
|
|
195
195
|
return;
|
|
196
196
|
}
|
|
197
|
-
if (!
|
|
198
|
-
|
|
197
|
+
if (!I.learnerId.trim()) {
|
|
198
|
+
A("A learner (user ID) is required.");
|
|
199
199
|
return;
|
|
200
200
|
}
|
|
201
|
-
if (!
|
|
202
|
-
|
|
201
|
+
if (!I.serial.trim()) {
|
|
202
|
+
A("A certificate serial is required.");
|
|
203
203
|
return;
|
|
204
204
|
}
|
|
205
|
-
let e =
|
|
205
|
+
let e = I.finalScore.trim() ? Number(I.finalScore) : void 0;
|
|
206
206
|
if (e !== void 0 && (!Number.isFinite(e) || e < 0)) {
|
|
207
|
-
|
|
207
|
+
A("Final score must be a non-negative number.");
|
|
208
208
|
return;
|
|
209
209
|
}
|
|
210
|
-
let t =
|
|
211
|
-
|
|
210
|
+
let t = Ee(I.expiresAt);
|
|
211
|
+
A(null);
|
|
212
212
|
try {
|
|
213
|
-
await
|
|
214
|
-
courseId:
|
|
215
|
-
learnerId:
|
|
216
|
-
serial:
|
|
213
|
+
await U.mutateAsync({
|
|
214
|
+
courseId: I.courseId,
|
|
215
|
+
learnerId: I.learnerId.trim(),
|
|
216
|
+
serial: I.serial.trim(),
|
|
217
217
|
finalScore: e,
|
|
218
218
|
expiresAt: t
|
|
219
219
|
}), Z();
|
|
220
220
|
} catch (e) {
|
|
221
|
-
|
|
221
|
+
A(e instanceof Error ? e.message : "Failed to issue certificate.");
|
|
222
222
|
}
|
|
223
|
-
}, Q =
|
|
224
|
-
return /* @__PURE__ */
|
|
223
|
+
}, Q = z.length > 0, $ = C === "MINE" || w !== "ALL" || E.trim().length > 0, ze = !H.isLoading && !H.isError && K.total > 0;
|
|
224
|
+
return /* @__PURE__ */ d(t, {
|
|
225
225
|
title: "Certificates",
|
|
226
226
|
description: "Verifiable credentials issued to learners on course completion.",
|
|
227
227
|
titleGradient: !0,
|
|
228
228
|
aurora: !0,
|
|
229
|
-
actions: /* @__PURE__ */
|
|
229
|
+
actions: /* @__PURE__ */ u(i, {
|
|
230
230
|
resource: "buildmyiq-certificate",
|
|
231
231
|
action: "create",
|
|
232
232
|
deniedBehavior: "hide",
|
|
233
|
-
children: /* @__PURE__ */
|
|
233
|
+
children: /* @__PURE__ */ d(f, {
|
|
234
234
|
onClick: X,
|
|
235
235
|
disabled: !Q,
|
|
236
|
-
children: [/* @__PURE__ */
|
|
236
|
+
children: [/* @__PURE__ */ u(l, { className: "mr-1.5 h-4 w-4" }), " Issue certificate"]
|
|
237
237
|
})
|
|
238
238
|
}),
|
|
239
239
|
children: [
|
|
240
|
-
|
|
240
|
+
ze && /* @__PURE__ */ d("div", {
|
|
241
241
|
className: "mb-5 grid grid-cols-2 gap-4 sm:grid-cols-4",
|
|
242
242
|
children: [
|
|
243
|
-
/* @__PURE__ */
|
|
244
|
-
icon: /* @__PURE__ */
|
|
245
|
-
value:
|
|
243
|
+
/* @__PURE__ */ u(n, {
|
|
244
|
+
icon: /* @__PURE__ */ u(s, { className: "h-5 w-5" }),
|
|
245
|
+
value: K.total,
|
|
246
246
|
label: "Certificates",
|
|
247
247
|
featured: !0
|
|
248
248
|
}),
|
|
249
|
-
/* @__PURE__ */
|
|
250
|
-
icon: /* @__PURE__ */
|
|
251
|
-
value:
|
|
249
|
+
/* @__PURE__ */ u(n, {
|
|
250
|
+
icon: /* @__PURE__ */ u(ve, { className: "h-5 w-5" }),
|
|
251
|
+
value: K.issued,
|
|
252
252
|
label: "Issued",
|
|
253
253
|
accent: "success"
|
|
254
254
|
}),
|
|
255
|
-
/* @__PURE__ */
|
|
256
|
-
icon: /* @__PURE__ */
|
|
257
|
-
value:
|
|
255
|
+
/* @__PURE__ */ u(n, {
|
|
256
|
+
icon: /* @__PURE__ */ u(he, { className: "h-5 w-5" }),
|
|
257
|
+
value: K.expired,
|
|
258
258
|
label: "Expired"
|
|
259
259
|
}),
|
|
260
|
-
/* @__PURE__ */
|
|
261
|
-
icon: /* @__PURE__ */
|
|
262
|
-
value:
|
|
260
|
+
/* @__PURE__ */ u(n, {
|
|
261
|
+
icon: /* @__PURE__ */ u(c, { className: "h-5 w-5" }),
|
|
262
|
+
value: K.revoked,
|
|
263
263
|
label: "Revoked",
|
|
264
264
|
accent: "error"
|
|
265
265
|
})
|
|
266
266
|
]
|
|
267
267
|
}),
|
|
268
|
-
/* @__PURE__ */
|
|
268
|
+
/* @__PURE__ */ d("div", {
|
|
269
269
|
className: "mb-5 flex flex-wrap items-center gap-3",
|
|
270
270
|
children: [
|
|
271
|
-
/* @__PURE__ */
|
|
272
|
-
options:
|
|
273
|
-
value:
|
|
271
|
+
/* @__PURE__ */ u(oe, {
|
|
272
|
+
options: Ie,
|
|
273
|
+
value: C,
|
|
274
274
|
onChange: (e) => {
|
|
275
|
-
|
|
275
|
+
Oe(e), D(0);
|
|
276
276
|
}
|
|
277
277
|
}),
|
|
278
|
-
/* @__PURE__ */
|
|
279
|
-
value:
|
|
278
|
+
/* @__PURE__ */ d(h, {
|
|
279
|
+
value: w,
|
|
280
280
|
onValueChange: (e) => {
|
|
281
|
-
|
|
281
|
+
T(e), D(0);
|
|
282
282
|
},
|
|
283
|
-
children: [/* @__PURE__ */
|
|
283
|
+
children: [/* @__PURE__ */ u(v, {
|
|
284
284
|
className: "w-56",
|
|
285
285
|
"aria-label": "Filter by course",
|
|
286
|
-
children: /* @__PURE__ */
|
|
287
|
-
}), /* @__PURE__ */
|
|
286
|
+
children: /* @__PURE__ */ u(y, { placeholder: "All courses" })
|
|
287
|
+
}), /* @__PURE__ */ d(g, { children: [/* @__PURE__ */ u(_, {
|
|
288
288
|
value: "ALL",
|
|
289
289
|
children: "All courses"
|
|
290
|
-
}),
|
|
290
|
+
}), z.map((e) => /* @__PURE__ */ u(_, {
|
|
291
291
|
value: e.id,
|
|
292
292
|
children: e.title
|
|
293
293
|
}, e.id))] })]
|
|
294
294
|
}),
|
|
295
|
-
/* @__PURE__ */
|
|
295
|
+
/* @__PURE__ */ d("div", {
|
|
296
296
|
className: "relative w-full sm:ml-auto sm:w-64",
|
|
297
|
-
children: [/* @__PURE__ */
|
|
298
|
-
value:
|
|
297
|
+
children: [/* @__PURE__ */ u(_e, { className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-tertiary" }), /* @__PURE__ */ u(p, {
|
|
298
|
+
value: E,
|
|
299
299
|
onChange: (e) => {
|
|
300
|
-
|
|
300
|
+
ke(e.target.value), D(0);
|
|
301
301
|
},
|
|
302
302
|
placeholder: "Search certificates…",
|
|
303
303
|
"aria-label": "Search certificates",
|
|
@@ -306,154 +306,154 @@ var S = 8, Ce = (e) => {
|
|
|
306
306
|
})
|
|
307
307
|
]
|
|
308
308
|
}),
|
|
309
|
-
|
|
309
|
+
j && /* @__PURE__ */ u("p", {
|
|
310
310
|
className: "mb-4 rounded-lg bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text",
|
|
311
|
-
children:
|
|
311
|
+
children: j
|
|
312
312
|
}),
|
|
313
|
-
|
|
313
|
+
H.isLoading ? /* @__PURE__ */ u(ie, { label: "Loading certificates…" }) : H.isError ? /* @__PURE__ */ u(re, {
|
|
314
314
|
message: "Couldn't load certificates.",
|
|
315
|
-
onRetry: () =>
|
|
316
|
-
}) :
|
|
315
|
+
onRetry: () => H.refetch()
|
|
316
|
+
}) : G.length === 0 ? /* @__PURE__ */ u(ne, {
|
|
317
317
|
illustration: $ ? "empty-search" : "onboarding",
|
|
318
|
-
icon: /* @__PURE__ */
|
|
318
|
+
icon: /* @__PURE__ */ u(s, { className: "h-10 w-10" }),
|
|
319
319
|
title: $ ? "No certificates match these filters" : "No certificates issued yet",
|
|
320
|
-
description: $ ?
|
|
321
|
-
action: !$ && Q ? /* @__PURE__ */
|
|
320
|
+
description: $ ? E.trim().length > 0 ? "No credentials match your search. Try a different serial, course, or learner." : C === "MINE" ? "You haven't earned a certificate for this selection yet." : "No certificates have been issued for this course yet." : Q ? "Issue a certificate to credential a learner who has completed a course." : "Publish a course first, then issue certificates to learners who complete it.",
|
|
321
|
+
action: !$ && Q ? /* @__PURE__ */ u(i, {
|
|
322
322
|
resource: "buildmyiq-certificate",
|
|
323
323
|
action: "create",
|
|
324
324
|
deniedBehavior: "hide",
|
|
325
|
-
children: /* @__PURE__ */
|
|
325
|
+
children: /* @__PURE__ */ d(f, {
|
|
326
326
|
onClick: X,
|
|
327
|
-
children: [/* @__PURE__ */
|
|
327
|
+
children: [/* @__PURE__ */ u(l, { className: "mr-1.5 h-4 w-4" }), " Issue certificate"]
|
|
328
328
|
})
|
|
329
329
|
}) : void 0
|
|
330
|
-
}) : /* @__PURE__ */
|
|
331
|
-
columns:
|
|
332
|
-
rows:
|
|
330
|
+
}) : /* @__PURE__ */ d(ye, { children: [/* @__PURE__ */ u(ae, {
|
|
331
|
+
columns: Y,
|
|
332
|
+
rows: J,
|
|
333
333
|
rowKey: (e) => e.id,
|
|
334
334
|
defaultSort: {
|
|
335
335
|
key: "issuedAt",
|
|
336
336
|
dir: "desc"
|
|
337
337
|
}
|
|
338
|
-
}), /* @__PURE__ */
|
|
339
|
-
page:
|
|
340
|
-
pageSize:
|
|
341
|
-
itemCount:
|
|
342
|
-
hasMore: (
|
|
343
|
-
onPageChange:
|
|
338
|
+
}), /* @__PURE__ */ u(se, {
|
|
339
|
+
page: q,
|
|
340
|
+
pageSize: b,
|
|
341
|
+
itemCount: J.length,
|
|
342
|
+
hasMore: (q + 1) * b < G.length,
|
|
343
|
+
onPageChange: D
|
|
344
344
|
})] }),
|
|
345
|
-
/* @__PURE__ */
|
|
346
|
-
open:
|
|
345
|
+
/* @__PURE__ */ u(be, {
|
|
346
|
+
open: je,
|
|
347
347
|
onOpenChange: (e) => {
|
|
348
|
-
e ?
|
|
348
|
+
e ? O(!0) : Z();
|
|
349
349
|
},
|
|
350
|
-
children: /* @__PURE__ */
|
|
350
|
+
children: /* @__PURE__ */ d(xe, { children: [/* @__PURE__ */ d(we, { children: [/* @__PURE__ */ u(Te, { children: "Issue certificate" }), /* @__PURE__ */ u(Se, { children: "Credential a learner for completing a course. The serial is auto-generated but editable." })] }), /* @__PURE__ */ d("form", {
|
|
351
351
|
onSubmit: (e) => {
|
|
352
|
-
e.preventDefault(),
|
|
352
|
+
e.preventDefault(), Re();
|
|
353
353
|
},
|
|
354
|
-
children: [/* @__PURE__ */
|
|
354
|
+
children: [/* @__PURE__ */ d("div", {
|
|
355
355
|
className: "grid gap-4 py-2",
|
|
356
356
|
children: [
|
|
357
|
-
/* @__PURE__ */
|
|
357
|
+
/* @__PURE__ */ d("div", {
|
|
358
358
|
className: "grid gap-1.5",
|
|
359
|
-
children: [/* @__PURE__ */
|
|
359
|
+
children: [/* @__PURE__ */ u(m, {
|
|
360
360
|
htmlFor: "cert-course",
|
|
361
361
|
children: "Course *"
|
|
362
|
-
}), /* @__PURE__ */
|
|
363
|
-
value:
|
|
364
|
-
onValueChange: (e) =>
|
|
362
|
+
}), /* @__PURE__ */ d(h, {
|
|
363
|
+
value: I.courseId,
|
|
364
|
+
onValueChange: (e) => L((t) => ({
|
|
365
365
|
...t,
|
|
366
366
|
courseId: e
|
|
367
367
|
})),
|
|
368
|
-
children: [/* @__PURE__ */
|
|
368
|
+
children: [/* @__PURE__ */ u(v, {
|
|
369
369
|
id: "cert-course",
|
|
370
370
|
className: "data-[placeholder]:text-text-secondary!",
|
|
371
|
-
children: /* @__PURE__ */
|
|
372
|
-
}), /* @__PURE__ */
|
|
371
|
+
children: /* @__PURE__ */ u(y, { placeholder: "Select a course" })
|
|
372
|
+
}), /* @__PURE__ */ u(g, { children: z.map((e) => /* @__PURE__ */ u(_, {
|
|
373
373
|
value: e.id,
|
|
374
374
|
children: e.title
|
|
375
375
|
}, e.id)) })]
|
|
376
376
|
})]
|
|
377
377
|
}),
|
|
378
|
-
/* @__PURE__ */
|
|
378
|
+
/* @__PURE__ */ d("div", {
|
|
379
379
|
className: "grid gap-1.5",
|
|
380
|
-
children: [/* @__PURE__ */
|
|
380
|
+
children: [/* @__PURE__ */ u(m, {
|
|
381
381
|
htmlFor: "cert-learner",
|
|
382
382
|
children: "Learner (user ID) *"
|
|
383
|
-
}), /* @__PURE__ */
|
|
383
|
+
}), /* @__PURE__ */ u(p, {
|
|
384
384
|
id: "cert-learner",
|
|
385
|
-
value:
|
|
386
|
-
onChange: (e) =>
|
|
385
|
+
value: I.learnerId,
|
|
386
|
+
onChange: (e) => L((t) => ({
|
|
387
387
|
...t,
|
|
388
388
|
learnerId: e.target.value
|
|
389
389
|
})),
|
|
390
390
|
placeholder: "Defaults to you"
|
|
391
391
|
})]
|
|
392
392
|
}),
|
|
393
|
-
/* @__PURE__ */
|
|
393
|
+
/* @__PURE__ */ d("div", {
|
|
394
394
|
className: "grid gap-1.5",
|
|
395
|
-
children: [/* @__PURE__ */
|
|
395
|
+
children: [/* @__PURE__ */ u(m, {
|
|
396
396
|
htmlFor: "cert-serial",
|
|
397
397
|
children: "Serial *"
|
|
398
|
-
}), /* @__PURE__ */
|
|
398
|
+
}), /* @__PURE__ */ u(p, {
|
|
399
399
|
id: "cert-serial",
|
|
400
|
-
value:
|
|
401
|
-
onChange: (e) =>
|
|
400
|
+
value: I.serial,
|
|
401
|
+
onChange: (e) => L((t) => ({
|
|
402
402
|
...t,
|
|
403
403
|
serial: e.target.value
|
|
404
404
|
})),
|
|
405
405
|
placeholder: "BMIQ-XXXXXX"
|
|
406
406
|
})]
|
|
407
407
|
}),
|
|
408
|
-
/* @__PURE__ */
|
|
408
|
+
/* @__PURE__ */ d("div", {
|
|
409
409
|
className: "grid gap-2 sm:grid-cols-2",
|
|
410
|
-
children: [/* @__PURE__ */
|
|
410
|
+
children: [/* @__PURE__ */ d("div", {
|
|
411
411
|
className: "grid gap-1.5",
|
|
412
|
-
children: [/* @__PURE__ */
|
|
412
|
+
children: [/* @__PURE__ */ u(m, {
|
|
413
413
|
htmlFor: "cert-score",
|
|
414
414
|
children: "Final score"
|
|
415
|
-
}), /* @__PURE__ */
|
|
415
|
+
}), /* @__PURE__ */ u(p, {
|
|
416
416
|
id: "cert-score",
|
|
417
417
|
type: "number",
|
|
418
418
|
min: "0",
|
|
419
419
|
step: "0.1",
|
|
420
|
-
value:
|
|
421
|
-
onChange: (e) =>
|
|
420
|
+
value: I.finalScore,
|
|
421
|
+
onChange: (e) => L((t) => ({
|
|
422
422
|
...t,
|
|
423
423
|
finalScore: e.target.value
|
|
424
424
|
})),
|
|
425
425
|
placeholder: "e.g. 92"
|
|
426
426
|
})]
|
|
427
|
-
}), /* @__PURE__ */
|
|
427
|
+
}), /* @__PURE__ */ d("div", {
|
|
428
428
|
className: "grid gap-1.5",
|
|
429
|
-
children: [/* @__PURE__ */
|
|
429
|
+
children: [/* @__PURE__ */ u(m, {
|
|
430
430
|
htmlFor: "cert-expires",
|
|
431
431
|
children: "Expires"
|
|
432
|
-
}), /* @__PURE__ */
|
|
432
|
+
}), /* @__PURE__ */ u(p, {
|
|
433
433
|
id: "cert-expires",
|
|
434
434
|
type: "date",
|
|
435
|
-
value:
|
|
436
|
-
onChange: (e) =>
|
|
435
|
+
value: I.expiresAt,
|
|
436
|
+
onChange: (e) => L((t) => ({
|
|
437
437
|
...t,
|
|
438
438
|
expiresAt: e.target.value
|
|
439
439
|
}))
|
|
440
440
|
})]
|
|
441
441
|
})]
|
|
442
442
|
}),
|
|
443
|
-
|
|
443
|
+
k && /* @__PURE__ */ u("p", {
|
|
444
444
|
className: "text-sm text-status-error-text",
|
|
445
|
-
children:
|
|
445
|
+
children: k
|
|
446
446
|
})
|
|
447
447
|
]
|
|
448
|
-
}), /* @__PURE__ */
|
|
448
|
+
}), /* @__PURE__ */ d(Ce, { children: [/* @__PURE__ */ u(f, {
|
|
449
449
|
type: "button",
|
|
450
450
|
variant: "outline",
|
|
451
451
|
onClick: Z,
|
|
452
452
|
children: "Cancel"
|
|
453
|
-
}), /* @__PURE__ */
|
|
453
|
+
}), /* @__PURE__ */ d(f, {
|
|
454
454
|
type: "submit",
|
|
455
|
-
disabled:
|
|
456
|
-
children: [/* @__PURE__ */
|
|
455
|
+
disabled: U.isPending,
|
|
456
|
+
children: [/* @__PURE__ */ u(ge, { className: "mr-1.5 h-4 w-4" }), U.isPending ? "Issuing…" : "Issue certificate"]
|
|
457
457
|
})] })]
|
|
458
458
|
})] })
|
|
459
459
|
})
|
|
@@ -461,6 +461,6 @@ var S = 8, Ce = (e) => {
|
|
|
461
461
|
});
|
|
462
462
|
};
|
|
463
463
|
//#endregion
|
|
464
|
-
export {
|
|
464
|
+
export { x as CertificatesPage };
|
|
465
465
|
|
|
466
466
|
//# sourceMappingURL=CertificatesPage.js.map
|