@burdenoff/microfe-buildmyiq 2026.710.3 → 2026.715.1
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/BuildmyiqAdminRoot.d.ts +10 -0
- package/dist/buildmyiq/BuildmyiqAdminRoot.d.ts.map +1 -0
- package/dist/buildmyiq/BuildmyiqAdminRoot.js +597 -0
- package/dist/buildmyiq/BuildmyiqAdminRoot.js.map +1 -0
- package/dist/buildmyiq/index.d.ts +1 -0
- package/dist/buildmyiq/index.d.ts.map +1 -1
- package/dist/buildmyiq/index.js +1 -0
- package/dist/index.js +3 -2
- package/dist/services/createSandboxAssistantTransport.d.ts +8 -24
- package/dist/services/createSandboxAssistantTransport.d.ts.map +1 -1
- package/dist/services/createSandboxAssistantTransport.js +8 -114
- package/dist/services/createSandboxAssistantTransport.js.map +1 -1
- package/package.json +2 -2
- package/dist/services/assistantApi.d.ts +0 -76
- package/dist/services/assistantApi.d.ts.map +0 -1
- package/dist/services/assistantApi.js +0 -272
- package/dist/services/assistantApi.js.map +0 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { BuildmyiqRootProps } from './types';
|
|
3
|
+
|
|
4
|
+
export interface BuildmyiqAdminRootProps extends BuildmyiqRootProps {
|
|
5
|
+
/** Workspace token is supplied by admin-app for workspace-scoped MFEs; not used directly by BUI hooks. */
|
|
6
|
+
workspaceToken?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const BuildmyiqAdminRoot: FC<BuildmyiqAdminRootProps>;
|
|
9
|
+
export { BuildmyiqAdminRoot as BuildMyIQAdminRoot };
|
|
10
|
+
//# sourceMappingURL=BuildmyiqAdminRoot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BuildmyiqAdminRoot.d.ts","sourceRoot":"","sources":["../../src/buildmyiq/BuildmyiqAdminRoot.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAwBhC,OAAO,KAAK,EACV,kBAAkB,EAQnB,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,uBAAwB,SAAQ,kBAAkB;IACjE,0GAA0G;IAC1G,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAkoBD,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,uBAAuB,CAgB1D,CAAC;AAEF,OAAO,EAAE,kBAAkB,IAAI,kBAAkB,EAAE,CAAC"}
|
|
@@ -0,0 +1,597 @@
|
|
|
1
|
+
import { BuildmyiqProvider as e } from "./context/BuildmyiqContext.js";
|
|
2
|
+
import { PageLayout as t } from "./components/PageLayout.js";
|
|
3
|
+
import { formatDate as n, formatDateTime as r, formatHours as i, formatNumber as a, formatPercent as o } from "./utils/formatters.js";
|
|
4
|
+
import { StatusBadge as s } from "./components/StatusBadge.js";
|
|
5
|
+
import { EmptyState as c } from "./components/EmptyState.js";
|
|
6
|
+
import { ErrorView as l, LoadingView as u, Section as d } from "./components/StateViews.js";
|
|
7
|
+
import { DataTable as f } from "./components/DataTable.js";
|
|
8
|
+
import { FilterTabs as p } from "./components/FilterTabs.js";
|
|
9
|
+
import { Tabs as m } from "./components/Tabs.js";
|
|
10
|
+
import { Pagination as h } from "./components/Pagination.js";
|
|
11
|
+
import { useBuiArchiveCourse as g, useBuiAssessments as _, useBuiCourses as v, useBuiEnrollments as y, useBuiPublishCourse as b, useBuiSubmissions as x } from "./hooks/useBuildmyiqApi.js";
|
|
12
|
+
import { useMemo as S, useState as C } from "react";
|
|
13
|
+
import { QueryClient as w, QueryClientProvider as T } from "@tanstack/react-query";
|
|
14
|
+
import { FeatureFlagProvider as E } from "@burdenoff/fe-libs/shared/feature-flags";
|
|
15
|
+
import { BookOpen as D, CheckSquare as O, ClipboardCheck as k, GraduationCap as A, Users as j } from "lucide-react";
|
|
16
|
+
import { Fragment as M, jsx as N, jsxs as P } from "react/jsx-runtime";
|
|
17
|
+
import { Button as F } from "@burdenoff/fe-libs/ui";
|
|
18
|
+
//#region src/buildmyiq/BuildmyiqAdminRoot.tsx
|
|
19
|
+
var I = new w({ defaultOptions: { queries: {
|
|
20
|
+
staleTime: 30 * 1e3,
|
|
21
|
+
retry: 1,
|
|
22
|
+
refetchOnWindowFocus: !1
|
|
23
|
+
} } }), L = 12, R = [
|
|
24
|
+
{
|
|
25
|
+
value: "ALL",
|
|
26
|
+
label: "All"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
value: "DRAFT",
|
|
30
|
+
label: "Draft"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
value: "IN_REVIEW",
|
|
34
|
+
label: "In Review"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
value: "PUBLISHED",
|
|
38
|
+
label: "Published"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
value: "ARCHIVED",
|
|
42
|
+
label: "Archived"
|
|
43
|
+
}
|
|
44
|
+
], z = [
|
|
45
|
+
{
|
|
46
|
+
value: "ALL",
|
|
47
|
+
label: "All"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
value: "ENROLLED",
|
|
51
|
+
label: "Enrolled"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
value: "IN_PROGRESS",
|
|
55
|
+
label: "In Progress"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
value: "COMPLETED",
|
|
59
|
+
label: "Completed"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
value: "DROPPED",
|
|
63
|
+
label: "Dropped"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
value: "EXPIRED",
|
|
67
|
+
label: "Expired"
|
|
68
|
+
}
|
|
69
|
+
], B = [
|
|
70
|
+
{
|
|
71
|
+
value: "ALL",
|
|
72
|
+
label: "All"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
value: "SUBMITTED",
|
|
76
|
+
label: "Submitted"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
value: "GRADING",
|
|
80
|
+
label: "Grading"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
value: "GRADED",
|
|
84
|
+
label: "Graded"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
value: "RETURNED",
|
|
88
|
+
label: "Returned"
|
|
89
|
+
}
|
|
90
|
+
];
|
|
91
|
+
function V({ course: e }) {
|
|
92
|
+
let t = b(), n = g();
|
|
93
|
+
return /* @__PURE__ */ P("div", {
|
|
94
|
+
className: "flex flex-wrap items-center gap-2",
|
|
95
|
+
children: [
|
|
96
|
+
e.status === "DRAFT" && /* @__PURE__ */ N(F, {
|
|
97
|
+
variant: "outline",
|
|
98
|
+
size: "sm",
|
|
99
|
+
onClick: () => t.mutate(e.id),
|
|
100
|
+
disabled: t.isPending,
|
|
101
|
+
children: "Publish"
|
|
102
|
+
}),
|
|
103
|
+
e.status !== "ARCHIVED" && /* @__PURE__ */ N(F, {
|
|
104
|
+
variant: "outline",
|
|
105
|
+
size: "sm",
|
|
106
|
+
onClick: () => n.mutate(e.id),
|
|
107
|
+
disabled: n.isPending,
|
|
108
|
+
children: "Archive"
|
|
109
|
+
}),
|
|
110
|
+
e.status === "ARCHIVED" && /* @__PURE__ */ N("span", {
|
|
111
|
+
className: "text-xs text-text-secondary",
|
|
112
|
+
children: "Archived"
|
|
113
|
+
})
|
|
114
|
+
]
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
function H() {
|
|
118
|
+
let [e, t] = C("ALL"), [r, o] = C(0), [m, g] = C([]), _ = r > 0 ? m[r - 1] : void 0, { data: y, isLoading: b, error: x, refetch: w } = v({
|
|
119
|
+
status: e === "ALL" ? void 0 : e,
|
|
120
|
+
cursor: _,
|
|
121
|
+
limit: L
|
|
122
|
+
}), T = S(() => [
|
|
123
|
+
{
|
|
124
|
+
key: "title",
|
|
125
|
+
header: "Course",
|
|
126
|
+
render: (e) => /* @__PURE__ */ P("div", {
|
|
127
|
+
className: "min-w-0",
|
|
128
|
+
children: [/* @__PURE__ */ N("p", {
|
|
129
|
+
className: "font-medium text-text-primary truncate",
|
|
130
|
+
children: e.title
|
|
131
|
+
}), /* @__PURE__ */ N("p", {
|
|
132
|
+
className: "text-xs text-text-secondary",
|
|
133
|
+
children: e.slug
|
|
134
|
+
})]
|
|
135
|
+
}),
|
|
136
|
+
sortValue: (e) => e.title.toLowerCase()
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
key: "status",
|
|
140
|
+
header: "Status",
|
|
141
|
+
render: (e) => /* @__PURE__ */ N(s, { status: e.status })
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
key: "level",
|
|
145
|
+
header: "Level",
|
|
146
|
+
render: (e) => /* @__PURE__ */ N(s, { status: e.level })
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
key: "lessons",
|
|
150
|
+
header: "Lessons",
|
|
151
|
+
align: "right",
|
|
152
|
+
render: (e) => a(e.lessons?.length ?? 0),
|
|
153
|
+
sortValue: (e) => e.lessons?.length ?? 0
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
key: "hours",
|
|
157
|
+
header: "Est. Hours",
|
|
158
|
+
align: "right",
|
|
159
|
+
render: (e) => i(e.estimatedHours),
|
|
160
|
+
sortValue: (e) => e.estimatedHours
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
key: "public",
|
|
164
|
+
header: "Visibility",
|
|
165
|
+
render: (e) => e.isPublic ? "Public" : "Private"
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
key: "created",
|
|
169
|
+
header: "Created",
|
|
170
|
+
render: (e) => n(e.createdAt),
|
|
171
|
+
sortValue: (e) => new Date(e.createdAt).getTime()
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
key: "actions",
|
|
175
|
+
header: "Actions",
|
|
176
|
+
align: "right",
|
|
177
|
+
render: (e) => /* @__PURE__ */ N(V, { course: e })
|
|
178
|
+
}
|
|
179
|
+
], []), E = (e) => {
|
|
180
|
+
e > r && y?.pageInfo.cursor ? g((e) => [...e, y.pageInfo.cursor]) : e < r && g((e) => e.slice(0, -1)), o(e);
|
|
181
|
+
};
|
|
182
|
+
if (b) return /* @__PURE__ */ N(u, { label: "Loading courses…" });
|
|
183
|
+
if (x) return /* @__PURE__ */ N(l, {
|
|
184
|
+
title: "Could not load courses",
|
|
185
|
+
message: x.message,
|
|
186
|
+
onRetry: w
|
|
187
|
+
});
|
|
188
|
+
let O = y?.items ?? [];
|
|
189
|
+
return /* @__PURE__ */ P(d, {
|
|
190
|
+
title: "Course catalog",
|
|
191
|
+
description: "Publish, archive and inspect courses.",
|
|
192
|
+
children: [/* @__PURE__ */ N("div", {
|
|
193
|
+
className: "mb-4",
|
|
194
|
+
children: /* @__PURE__ */ N(p, {
|
|
195
|
+
options: R,
|
|
196
|
+
value: e,
|
|
197
|
+
onChange: (e) => {
|
|
198
|
+
t(e), o(0), g([]);
|
|
199
|
+
}
|
|
200
|
+
})
|
|
201
|
+
}), O.length === 0 ? /* @__PURE__ */ N(c, {
|
|
202
|
+
icon: /* @__PURE__ */ N(D, { size: 40 }),
|
|
203
|
+
title: "No courses found",
|
|
204
|
+
description: `There are no ${e === "ALL" ? "" : e.toLowerCase()} courses in this workspace.`
|
|
205
|
+
}) : /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N(f, {
|
|
206
|
+
columns: T,
|
|
207
|
+
rows: O,
|
|
208
|
+
rowKey: (e) => e.id,
|
|
209
|
+
defaultSort: {
|
|
210
|
+
key: "created",
|
|
211
|
+
dir: "desc"
|
|
212
|
+
}
|
|
213
|
+
}), /* @__PURE__ */ N(h, {
|
|
214
|
+
page: r,
|
|
215
|
+
pageSize: L,
|
|
216
|
+
itemCount: O.length,
|
|
217
|
+
hasMore: y?.pageInfo.hasMore ?? !1,
|
|
218
|
+
onPageChange: E
|
|
219
|
+
})] })]
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
function U() {
|
|
223
|
+
let [e, t] = C(""), { data: n, isLoading: r, error: i } = v({
|
|
224
|
+
status: "PUBLISHED",
|
|
225
|
+
limit: 100
|
|
226
|
+
}), { data: p, isLoading: m, error: h } = _(e || void 0), g = S(() => [
|
|
227
|
+
{
|
|
228
|
+
key: "title",
|
|
229
|
+
header: "Assessment",
|
|
230
|
+
render: (e) => /* @__PURE__ */ P("div", {
|
|
231
|
+
className: "min-w-0",
|
|
232
|
+
children: [/* @__PURE__ */ N("p", {
|
|
233
|
+
className: "font-medium text-text-primary truncate",
|
|
234
|
+
children: e.title
|
|
235
|
+
}), /* @__PURE__ */ N("p", {
|
|
236
|
+
className: "text-xs text-text-secondary",
|
|
237
|
+
children: e.type
|
|
238
|
+
})]
|
|
239
|
+
}),
|
|
240
|
+
sortValue: (e) => e.title.toLowerCase()
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
key: "status",
|
|
244
|
+
header: "Status",
|
|
245
|
+
render: (e) => /* @__PURE__ */ N(s, { status: e.status })
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
key: "questions",
|
|
249
|
+
header: "Questions",
|
|
250
|
+
align: "right",
|
|
251
|
+
render: (e) => a(e.questions?.length ?? 0),
|
|
252
|
+
sortValue: (e) => e.questions?.length ?? 0
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
key: "passing",
|
|
256
|
+
header: "Passing Score",
|
|
257
|
+
align: "right",
|
|
258
|
+
render: (e) => o(e.passingScore)
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
key: "attempts",
|
|
262
|
+
header: "Max Attempts",
|
|
263
|
+
align: "right",
|
|
264
|
+
render: (e) => a(e.maxAttempts)
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
key: "time",
|
|
268
|
+
header: "Time Limit",
|
|
269
|
+
align: "right",
|
|
270
|
+
render: (e) => e.timeLimitMin > 0 ? `${e.timeLimitMin} min` : "—"
|
|
271
|
+
}
|
|
272
|
+
], []);
|
|
273
|
+
if (r) return /* @__PURE__ */ N(u, { label: "Loading courses…" });
|
|
274
|
+
if (i) return /* @__PURE__ */ N(l, {
|
|
275
|
+
title: "Could not load courses",
|
|
276
|
+
message: i.message
|
|
277
|
+
});
|
|
278
|
+
let y = n?.items ?? [];
|
|
279
|
+
return /* @__PURE__ */ N(d, {
|
|
280
|
+
title: "Assessments",
|
|
281
|
+
description: "Inspect assessments attached to a published course.",
|
|
282
|
+
action: /* @__PURE__ */ P("div", {
|
|
283
|
+
className: "min-w-[16rem]",
|
|
284
|
+
children: [/* @__PURE__ */ N("label", {
|
|
285
|
+
htmlFor: "bui-admin-course-select",
|
|
286
|
+
className: "sr-only",
|
|
287
|
+
children: "Select course"
|
|
288
|
+
}), /* @__PURE__ */ P("select", {
|
|
289
|
+
id: "bui-admin-course-select",
|
|
290
|
+
value: e,
|
|
291
|
+
onChange: (e) => t(e.target.value),
|
|
292
|
+
className: "w-full rounded-lg border border-border-seam bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-action-primary-bg",
|
|
293
|
+
children: [/* @__PURE__ */ N("option", {
|
|
294
|
+
value: "",
|
|
295
|
+
children: "Choose a course…"
|
|
296
|
+
}), y.map((e) => /* @__PURE__ */ N("option", {
|
|
297
|
+
value: e.id,
|
|
298
|
+
children: e.title
|
|
299
|
+
}, e.id))]
|
|
300
|
+
})]
|
|
301
|
+
}),
|
|
302
|
+
children: e ? m ? /* @__PURE__ */ N(u, { label: "Loading assessments…" }) : h ? /* @__PURE__ */ N(l, {
|
|
303
|
+
title: "Could not load assessments",
|
|
304
|
+
message: h.message
|
|
305
|
+
}) : p?.length === 0 ? /* @__PURE__ */ N(c, {
|
|
306
|
+
icon: /* @__PURE__ */ N(k, { size: 40 }),
|
|
307
|
+
title: "No assessments",
|
|
308
|
+
description: "This course has no assessments yet."
|
|
309
|
+
}) : /* @__PURE__ */ N(f, {
|
|
310
|
+
columns: g,
|
|
311
|
+
rows: p ?? [],
|
|
312
|
+
rowKey: (e) => e.id,
|
|
313
|
+
defaultSort: {
|
|
314
|
+
key: "title",
|
|
315
|
+
dir: "asc"
|
|
316
|
+
}
|
|
317
|
+
}) : /* @__PURE__ */ N(c, {
|
|
318
|
+
icon: /* @__PURE__ */ N(k, { size: 40 }),
|
|
319
|
+
title: "Select a course",
|
|
320
|
+
description: "Choose a published course above to view its assessments."
|
|
321
|
+
})
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
function W() {
|
|
325
|
+
let [e, t] = C("ALL"), [n, i] = C(0), [a, m] = C([]), g = n > 0 ? a[n - 1] : void 0, { data: _, isLoading: v, error: b, refetch: x } = y({
|
|
326
|
+
status: e === "ALL" ? void 0 : e,
|
|
327
|
+
cursor: g,
|
|
328
|
+
limit: L
|
|
329
|
+
}), w = S(() => [
|
|
330
|
+
{
|
|
331
|
+
key: "learner",
|
|
332
|
+
header: "Learner",
|
|
333
|
+
render: (e) => /* @__PURE__ */ N("span", {
|
|
334
|
+
className: "font-mono text-xs text-text-secondary",
|
|
335
|
+
children: e.learnerId
|
|
336
|
+
})
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
key: "course",
|
|
340
|
+
header: "Course ID",
|
|
341
|
+
render: (e) => /* @__PURE__ */ N("span", {
|
|
342
|
+
className: "font-mono text-xs text-text-secondary",
|
|
343
|
+
children: e.courseId
|
|
344
|
+
})
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
key: "status",
|
|
348
|
+
header: "Status",
|
|
349
|
+
render: (e) => /* @__PURE__ */ N(s, { status: e.status })
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
key: "progress",
|
|
353
|
+
header: "Progress",
|
|
354
|
+
align: "right",
|
|
355
|
+
render: (e) => o(e.progressPct),
|
|
356
|
+
sortValue: (e) => e.progressPct
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
key: "cohort",
|
|
360
|
+
header: "Cohort",
|
|
361
|
+
render: (e) => e.cohort?.name ?? "—"
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
key: "enrolled",
|
|
365
|
+
header: "Enrolled",
|
|
366
|
+
render: (e) => r(e.enrolledAt),
|
|
367
|
+
sortValue: (e) => new Date(e.enrolledAt).getTime(),
|
|
368
|
+
hideOnMobile: !0
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
key: "lastActive",
|
|
372
|
+
header: "Last Active",
|
|
373
|
+
render: (e) => e.lastActiveAt ? G(e.lastActiveAt) : "—",
|
|
374
|
+
sortValue: (e) => e.lastActiveAt ? new Date(e.lastActiveAt).getTime() : 0,
|
|
375
|
+
hideOnMobile: !0
|
|
376
|
+
}
|
|
377
|
+
], []), T = (e) => {
|
|
378
|
+
e > n && _?.pageInfo.cursor ? m((e) => [...e, _.pageInfo.cursor]) : e < n && m((e) => e.slice(0, -1)), i(e);
|
|
379
|
+
};
|
|
380
|
+
if (v) return /* @__PURE__ */ N(u, { label: "Loading enrollments…" });
|
|
381
|
+
if (b) return /* @__PURE__ */ N(l, {
|
|
382
|
+
title: "Could not load enrollments",
|
|
383
|
+
message: b.message,
|
|
384
|
+
onRetry: x
|
|
385
|
+
});
|
|
386
|
+
let E = _?.items ?? [];
|
|
387
|
+
return /* @__PURE__ */ P(d, {
|
|
388
|
+
title: "Enrollments",
|
|
389
|
+
description: "Workspace-wide learner enrollment overview.",
|
|
390
|
+
children: [/* @__PURE__ */ N("div", {
|
|
391
|
+
className: "mb-4",
|
|
392
|
+
children: /* @__PURE__ */ N(p, {
|
|
393
|
+
options: z,
|
|
394
|
+
value: e,
|
|
395
|
+
onChange: (e) => {
|
|
396
|
+
t(e), i(0), m([]);
|
|
397
|
+
}
|
|
398
|
+
})
|
|
399
|
+
}), E.length === 0 ? /* @__PURE__ */ N(c, {
|
|
400
|
+
icon: /* @__PURE__ */ N(j, { size: 40 }),
|
|
401
|
+
title: "No enrollments",
|
|
402
|
+
description: `There are no ${e === "ALL" ? "" : e.toLowerCase()} enrollments in this workspace.`
|
|
403
|
+
}) : /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N(f, {
|
|
404
|
+
columns: w,
|
|
405
|
+
rows: E,
|
|
406
|
+
rowKey: (e) => e.id,
|
|
407
|
+
defaultSort: {
|
|
408
|
+
key: "enrolled",
|
|
409
|
+
dir: "desc"
|
|
410
|
+
}
|
|
411
|
+
}), /* @__PURE__ */ N(h, {
|
|
412
|
+
page: n,
|
|
413
|
+
pageSize: L,
|
|
414
|
+
itemCount: E.length,
|
|
415
|
+
hasMore: _?.pageInfo.hasMore ?? !1,
|
|
416
|
+
onPageChange: T
|
|
417
|
+
})] })]
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
function G(e) {
|
|
421
|
+
let t = typeof e == "string" ? new Date(e) : e, n = /* @__PURE__ */ new Date(), r = t.getTime() - n.getTime(), i = r >= 0, a = Math.floor(Math.abs(r) / 1e3), o = Math.floor(a / 60), s = Math.floor(o / 60), c = Math.floor(s / 24), l = (e, t) => {
|
|
422
|
+
let n = `${e} ${t}${e === 1 ? "" : "s"}`;
|
|
423
|
+
return i ? `in ${n}` : `${n} ago`;
|
|
424
|
+
};
|
|
425
|
+
return a < 60 ? i ? "soon" : "just now" : o < 60 ? l(o, "min") : s < 24 ? l(s, "hour") : l(c, "day");
|
|
426
|
+
}
|
|
427
|
+
function K() {
|
|
428
|
+
let [e, t] = C("ALL"), [n, i] = C(0), [m, g] = C([]), _ = n > 0 ? m[n - 1] : void 0, { data: v, isLoading: y, error: b, refetch: w } = x({
|
|
429
|
+
status: e === "ALL" ? void 0 : e,
|
|
430
|
+
cursor: _,
|
|
431
|
+
limit: L
|
|
432
|
+
}), T = S(() => [
|
|
433
|
+
{
|
|
434
|
+
key: "learner",
|
|
435
|
+
header: "Learner",
|
|
436
|
+
render: (e) => /* @__PURE__ */ N("span", {
|
|
437
|
+
className: "font-mono text-xs text-text-secondary",
|
|
438
|
+
children: e.learnerId
|
|
439
|
+
})
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
key: "assessment",
|
|
443
|
+
header: "Assessment ID",
|
|
444
|
+
render: (e) => /* @__PURE__ */ N("span", {
|
|
445
|
+
className: "font-mono text-xs text-text-secondary",
|
|
446
|
+
children: e.assessmentId
|
|
447
|
+
})
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
key: "attempt",
|
|
451
|
+
header: "Attempt",
|
|
452
|
+
align: "right",
|
|
453
|
+
render: (e) => a(e.attempt)
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
key: "status",
|
|
457
|
+
header: "Status",
|
|
458
|
+
render: (e) => /* @__PURE__ */ N(s, { status: e.status })
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
key: "score",
|
|
462
|
+
header: "Score",
|
|
463
|
+
align: "right",
|
|
464
|
+
render: (e) => e.score == null ? "—" : o(e.score),
|
|
465
|
+
sortValue: (e) => e.score ?? -1
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
key: "passed",
|
|
469
|
+
header: "Passed",
|
|
470
|
+
align: "center",
|
|
471
|
+
render: (e) => e.passed == null ? "—" : e.passed ? "Yes" : "No"
|
|
472
|
+
},
|
|
473
|
+
{
|
|
474
|
+
key: "submitted",
|
|
475
|
+
header: "Submitted",
|
|
476
|
+
render: (e) => e.submittedAt ? r(e.submittedAt) : "—",
|
|
477
|
+
sortValue: (e) => e.submittedAt ? new Date(e.submittedAt).getTime() : 0,
|
|
478
|
+
hideOnMobile: !0
|
|
479
|
+
},
|
|
480
|
+
{
|
|
481
|
+
key: "actions",
|
|
482
|
+
header: "Review",
|
|
483
|
+
align: "right",
|
|
484
|
+
render: () => /* @__PURE__ */ N(F, {
|
|
485
|
+
variant: "ghost",
|
|
486
|
+
size: "sm",
|
|
487
|
+
disabled: !0,
|
|
488
|
+
children: "Open"
|
|
489
|
+
})
|
|
490
|
+
}
|
|
491
|
+
], []), E = (e) => {
|
|
492
|
+
e > n && v?.pageInfo.cursor ? g((e) => [...e, v.pageInfo.cursor]) : e < n && g((e) => e.slice(0, -1)), i(e);
|
|
493
|
+
};
|
|
494
|
+
if (y) return /* @__PURE__ */ N(u, { label: "Loading submissions…" });
|
|
495
|
+
if (b) return /* @__PURE__ */ N(l, {
|
|
496
|
+
title: "Could not load submissions",
|
|
497
|
+
message: b.message,
|
|
498
|
+
onRetry: w
|
|
499
|
+
});
|
|
500
|
+
let D = v?.items ?? [];
|
|
501
|
+
return /* @__PURE__ */ P(d, {
|
|
502
|
+
title: "Submission review",
|
|
503
|
+
description: "Review learner submissions and grading status.",
|
|
504
|
+
children: [/* @__PURE__ */ N("div", {
|
|
505
|
+
className: "mb-4",
|
|
506
|
+
children: /* @__PURE__ */ N(p, {
|
|
507
|
+
options: B,
|
|
508
|
+
value: e,
|
|
509
|
+
onChange: (e) => {
|
|
510
|
+
t(e), i(0), g([]);
|
|
511
|
+
}
|
|
512
|
+
})
|
|
513
|
+
}), D.length === 0 ? /* @__PURE__ */ N(c, {
|
|
514
|
+
icon: /* @__PURE__ */ N(O, { size: 40 }),
|
|
515
|
+
title: "No submissions",
|
|
516
|
+
description: `There are no ${e === "ALL" ? "" : e.toLowerCase()} submissions in this workspace.`
|
|
517
|
+
}) : /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N(f, {
|
|
518
|
+
columns: T,
|
|
519
|
+
rows: D,
|
|
520
|
+
rowKey: (e) => e.id,
|
|
521
|
+
defaultSort: {
|
|
522
|
+
key: "submitted",
|
|
523
|
+
dir: "desc"
|
|
524
|
+
}
|
|
525
|
+
}), /* @__PURE__ */ N(h, {
|
|
526
|
+
page: n,
|
|
527
|
+
pageSize: L,
|
|
528
|
+
itemCount: D.length,
|
|
529
|
+
hasMore: v?.pageInfo.hasMore ?? !1,
|
|
530
|
+
onPageChange: E
|
|
531
|
+
})] })]
|
|
532
|
+
});
|
|
533
|
+
}
|
|
534
|
+
function q() {
|
|
535
|
+
let [e, n] = C("courses"), r = S(() => [
|
|
536
|
+
{
|
|
537
|
+
value: "courses",
|
|
538
|
+
label: "Courses",
|
|
539
|
+
icon: /* @__PURE__ */ N(D, { size: 18 })
|
|
540
|
+
},
|
|
541
|
+
{
|
|
542
|
+
value: "assessments",
|
|
543
|
+
label: "Assessments",
|
|
544
|
+
icon: /* @__PURE__ */ N(k, { size: 18 })
|
|
545
|
+
},
|
|
546
|
+
{
|
|
547
|
+
value: "enrollments",
|
|
548
|
+
label: "Enrollments",
|
|
549
|
+
icon: /* @__PURE__ */ N(j, { size: 18 })
|
|
550
|
+
},
|
|
551
|
+
{
|
|
552
|
+
value: "submissions",
|
|
553
|
+
label: "Submissions",
|
|
554
|
+
icon: /* @__PURE__ */ N(O, { size: 18 })
|
|
555
|
+
}
|
|
556
|
+
], []);
|
|
557
|
+
return /* @__PURE__ */ P(t, {
|
|
558
|
+
title: "BuildMyIQ Admin",
|
|
559
|
+
description: "Course, assessment, enrollment and submission governance.",
|
|
560
|
+
actions: /* @__PURE__ */ P("span", {
|
|
561
|
+
className: "inline-flex items-center gap-2 text-sm text-text-secondary",
|
|
562
|
+
children: [/* @__PURE__ */ N(A, { size: 18 }), "Workspace-scoped"]
|
|
563
|
+
}),
|
|
564
|
+
children: [/* @__PURE__ */ N(m, {
|
|
565
|
+
items: r,
|
|
566
|
+
value: e,
|
|
567
|
+
onChange: (e) => n(e)
|
|
568
|
+
}), /* @__PURE__ */ P("div", {
|
|
569
|
+
className: "mt-6",
|
|
570
|
+
children: [
|
|
571
|
+
e === "courses" && /* @__PURE__ */ N(H, {}),
|
|
572
|
+
e === "assessments" && /* @__PURE__ */ N(U, {}),
|
|
573
|
+
e === "enrollments" && /* @__PURE__ */ N(W, {}),
|
|
574
|
+
e === "submissions" && /* @__PURE__ */ N(K, {})
|
|
575
|
+
]
|
|
576
|
+
})]
|
|
577
|
+
});
|
|
578
|
+
}
|
|
579
|
+
var J = (t) => {
|
|
580
|
+
let { workspaceToken: n, ...r } = t;
|
|
581
|
+
return /* @__PURE__ */ N(T, {
|
|
582
|
+
client: I,
|
|
583
|
+
children: /* @__PURE__ */ N(E, {
|
|
584
|
+
workspaceId: t.workspaceId ?? null,
|
|
585
|
+
gateway: "global",
|
|
586
|
+
defaultEnabled: !0,
|
|
587
|
+
children: /* @__PURE__ */ N(e, {
|
|
588
|
+
...r,
|
|
589
|
+
children: /* @__PURE__ */ N(q, {})
|
|
590
|
+
})
|
|
591
|
+
})
|
|
592
|
+
});
|
|
593
|
+
};
|
|
594
|
+
//#endregion
|
|
595
|
+
export { J as BuildmyiqAdminRoot };
|
|
596
|
+
|
|
597
|
+
//# sourceMappingURL=BuildmyiqAdminRoot.js.map
|