@burdenoff/microfe-buildmyiq 2026.705.13 → 2026.706.10
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/BuildmyiqRoot.d.ts.map +1 -1
- package/dist/buildmyiq/BuildmyiqRoot.js +57 -49
- package/dist/buildmyiq/BuildmyiqRoot.js.map +1 -1
- package/dist/buildmyiq/BuildmyiqRoutes.d.ts.map +1 -1
- package/dist/buildmyiq/BuildmyiqRoutes.js +15 -11
- package/dist/buildmyiq/BuildmyiqRoutes.js.map +1 -1
- package/dist/buildmyiq/components/Avatar.d.ts +15 -0
- package/dist/buildmyiq/components/Avatar.d.ts.map +1 -0
- package/dist/buildmyiq/components/Avatar.js +42 -0
- package/dist/buildmyiq/components/Avatar.js.map +1 -0
- package/dist/buildmyiq/components/Viz.d.ts +25 -0
- package/dist/buildmyiq/components/Viz.d.ts.map +1 -0
- package/dist/buildmyiq/components/Viz.js +78 -0
- package/dist/buildmyiq/components/Viz.js.map +1 -0
- package/dist/buildmyiq/components/index.d.ts +2 -0
- package/dist/buildmyiq/components/index.d.ts.map +1 -1
- package/dist/buildmyiq/components/index.js +2 -0
- package/dist/buildmyiq/pages/DashboardPage.d.ts.map +1 -1
- package/dist/buildmyiq/pages/DashboardPage.js +200 -98
- package/dist/buildmyiq/pages/DashboardPage.js.map +1 -1
- package/dist/buildmyiq/pages/assessments/AssessmentDetailPage.d.ts.map +1 -1
- package/dist/buildmyiq/pages/assessments/AssessmentDetailPage.js +262 -241
- package/dist/buildmyiq/pages/assessments/AssessmentDetailPage.js.map +1 -1
- package/dist/buildmyiq/pages/assessments/AssessmentsPage.d.ts.map +1 -1
- package/dist/buildmyiq/pages/assessments/AssessmentsPage.js +142 -115
- package/dist/buildmyiq/pages/assessments/AssessmentsPage.js.map +1 -1
- package/dist/buildmyiq/pages/assessments/TakeAssessmentPage.d.ts.map +1 -1
- package/dist/buildmyiq/pages/assessments/TakeAssessmentPage.js +220 -156
- package/dist/buildmyiq/pages/assessments/TakeAssessmentPage.js.map +1 -1
- package/dist/buildmyiq/pages/authoring/AuthoringPage.d.ts.map +1 -1
- package/dist/buildmyiq/pages/authoring/AuthoringPage.js +51 -46
- package/dist/buildmyiq/pages/authoring/AuthoringPage.js.map +1 -1
- package/dist/buildmyiq/pages/authoring/CourseBuilderPage.d.ts.map +1 -1
- package/dist/buildmyiq/pages/authoring/CourseBuilderPage.js +581 -448
- package/dist/buildmyiq/pages/authoring/CourseBuilderPage.js.map +1 -1
- package/dist/buildmyiq/pages/catalog/CatalogPage.d.ts.map +1 -1
- package/dist/buildmyiq/pages/catalog/CatalogPage.js +52 -42
- package/dist/buildmyiq/pages/catalog/CatalogPage.js.map +1 -1
- package/dist/buildmyiq/pages/catalog/CourseDetailPage.d.ts.map +1 -1
- package/dist/buildmyiq/pages/catalog/CourseDetailPage.js +422 -301
- 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 +237 -151
- package/dist/buildmyiq/pages/certificates/CertificatesPage.js.map +1 -1
- package/dist/buildmyiq/pages/cohorts/CohortsPage.d.ts.map +1 -1
- package/dist/buildmyiq/pages/cohorts/CohortsPage.js +219 -138
- package/dist/buildmyiq/pages/cohorts/CohortsPage.js.map +1 -1
- package/dist/buildmyiq/pages/insights/InsightsPage.d.ts.map +1 -1
- package/dist/buildmyiq/pages/insights/InsightsPage.js +276 -152
- package/dist/buildmyiq/pages/insights/InsightsPage.js.map +1 -1
- package/dist/buildmyiq/pages/learning/LessonPlayerPage.d.ts.map +1 -1
- package/dist/buildmyiq/pages/learning/LessonPlayerPage.js +237 -174
- package/dist/buildmyiq/pages/learning/LessonPlayerPage.js.map +1 -1
- package/dist/buildmyiq/pages/learning/MyLearningPage.d.ts.map +1 -1
- package/dist/buildmyiq/pages/learning/MyLearningPage.js +307 -169
- package/dist/buildmyiq/pages/learning/MyLearningPage.js.map +1 -1
- package/dist/buildmyiq/pages/paths/PathsPage.d.ts +4 -0
- package/dist/buildmyiq/pages/paths/PathsPage.d.ts.map +1 -0
- package/dist/buildmyiq/pages/paths/PathsPage.js +187 -0
- package/dist/buildmyiq/pages/paths/PathsPage.js.map +1 -0
- package/dist/buildmyiq/pages/skills/SkillsPage.d.ts.map +1 -1
- package/dist/buildmyiq/pages/skills/SkillsPage.js +233 -140
- package/dist/buildmyiq/pages/skills/SkillsPage.js.map +1 -1
- package/dist/buildmyiq/pages/submissions/SubmissionsPage.d.ts.map +1 -1
- package/dist/buildmyiq/pages/submissions/SubmissionsPage.js +379 -275
- package/dist/buildmyiq/pages/submissions/SubmissionsPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,63 +1,86 @@
|
|
|
1
1
|
import { useBuildmyiq as e } from "../../context/BuildmyiqContext.js";
|
|
2
2
|
import { PageLayout as t } from "../../components/PageLayout.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
3
|
+
import { MetricsCard as n } from "../../components/MetricsCard.js";
|
|
4
|
+
import { formatDate as r, formatEnumLabel as i, formatNumber as a } from "../../utils/formatters.js";
|
|
5
|
+
import { StatusBadge as ee } from "../../components/StatusBadge.js";
|
|
6
|
+
import { EmptyState as te } from "../../components/EmptyState.js";
|
|
7
|
+
import { ErrorView as ne, LoadingView as re } from "../../components/StateViews.js";
|
|
8
|
+
import { DataTable as ie } from "../../components/DataTable.js";
|
|
9
|
+
import { FilterTabs as ae } from "../../components/FilterTabs.js";
|
|
9
10
|
import "../../context/index.js";
|
|
10
|
-
import { useBuiCohorts as
|
|
11
|
+
import { useBuiCohorts as o, useBuiCourses as s, useBuiCreateCohort as c } from "../../hooks/useBuildmyiqApi.js";
|
|
11
12
|
import "../../hooks/index.js";
|
|
12
13
|
import "../../components/index.js";
|
|
13
|
-
import { COHORT_STATUSES as
|
|
14
|
-
import { useMemo as
|
|
15
|
-
import { CalendarRange as
|
|
16
|
-
import { jsx as
|
|
17
|
-
import { Button as
|
|
14
|
+
import { COHORT_STATUSES as l } from "../../types/index.js";
|
|
15
|
+
import { useMemo as u, useState as d } from "react";
|
|
16
|
+
import { CalendarClock as f, CalendarRange as oe, PlayCircle as se, Plus as p, UserPlus as ce, Users as m } from "lucide-react";
|
|
17
|
+
import { Fragment as le, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
18
|
+
import { Button as _, Input as v, Label as y, ResponsiveDialog as ue, ResponsiveDialogContent as de, ResponsiveDialogDescription as b, ResponsiveDialogFooter as x, ResponsiveDialogHeader as fe, ResponsiveDialogTitle as pe, Select as S, SelectContent as C, SelectItem as w, SelectTrigger as T, SelectValue as E } from "@burdenoff/fe-libs/ui";
|
|
18
19
|
//#region src/buildmyiq/pages/cohorts/CohortsPage.tsx
|
|
19
|
-
var
|
|
20
|
+
var D = (e) => {
|
|
20
21
|
let t = e.trim();
|
|
21
22
|
if (!t) return;
|
|
22
23
|
let n = new Date(t);
|
|
23
24
|
return Number.isNaN(n.getTime()) ? void 0 : n.toISOString();
|
|
24
|
-
},
|
|
25
|
-
|
|
25
|
+
}, me = {
|
|
26
|
+
SCHEDULED: "bg-bg-sunken text-text-secondary",
|
|
27
|
+
ENROLLING: "bg-status-warning-bg-subtle text-status-warning-text",
|
|
28
|
+
ACTIVE: "bg-status-success-bg-subtle text-status-success-text",
|
|
29
|
+
COMPLETED: "bg-[var(--color-accent-soft)] text-[var(--color-accent-primary)]",
|
|
30
|
+
CANCELLED: "bg-status-error-bg-subtle text-status-error-text"
|
|
31
|
+
}, O = (e, t) => {
|
|
32
|
+
if (!e || !t) return null;
|
|
33
|
+
let n = new Date(e).getTime(), r = new Date(t).getTime();
|
|
34
|
+
return Number.isNaN(n) || Number.isNaN(r) || r < n ? null : Math.max(1, Math.round((r - n) / (10080 * 60 * 1e3)));
|
|
35
|
+
}, k = () => {
|
|
36
|
+
let { currentUser: k } = e(), [A, j] = d("ALL"), [M, N] = d("ALL"), [P, F] = d(!1), [I, L] = d(null), R = u(() => ({
|
|
26
37
|
courseId: "",
|
|
27
38
|
name: "",
|
|
28
39
|
capacity: "",
|
|
29
|
-
facilitatorId:
|
|
40
|
+
facilitatorId: k?.id ?? "",
|
|
30
41
|
startDate: "",
|
|
31
42
|
endDate: ""
|
|
32
|
-
}), [
|
|
43
|
+
}), [k?.id]), [z, B] = d(R), V = s({ limit: 100 }), H = u(() => V.data?.items ?? [], [V.data]), U = u(() => {
|
|
33
44
|
let e = /* @__PURE__ */ new Map();
|
|
34
|
-
for (let t of
|
|
45
|
+
for (let t of H) e.set(t.id, t.title);
|
|
35
46
|
return e;
|
|
36
|
-
}, [
|
|
47
|
+
}, [H]), W = o(M === "ALL" ? void 0 : M), G = c(), K = u(() => W.data ?? [], [W.data]), q = u(() => {
|
|
37
48
|
let e = {};
|
|
38
|
-
for (let t of
|
|
49
|
+
for (let t of K) e[t.status] = (e[t.status] ?? 0) + 1;
|
|
39
50
|
return e;
|
|
40
|
-
}, [
|
|
51
|
+
}, [K]), J = u(() => ({
|
|
52
|
+
total: K.length,
|
|
53
|
+
active: q.ACTIVE ?? 0,
|
|
54
|
+
enrolling: q.ENROLLING ?? 0,
|
|
55
|
+
scheduled: q.SCHEDULED ?? 0,
|
|
56
|
+
seats: K.reduce((e, t) => e + (t.capacity ?? 0), 0)
|
|
57
|
+
}), [K, q]), Y = u(() => A === "ALL" ? K : K.filter((e) => e.status === A), [K, A]), he = u(() => [{
|
|
41
58
|
value: "ALL",
|
|
42
59
|
label: "All",
|
|
43
|
-
count:
|
|
44
|
-
}, ...
|
|
60
|
+
count: K.length
|
|
61
|
+
}, ...l.map((e) => ({
|
|
45
62
|
value: e,
|
|
46
|
-
label:
|
|
47
|
-
count:
|
|
48
|
-
}))], [
|
|
63
|
+
label: i(e),
|
|
64
|
+
count: q[e] ?? 0
|
|
65
|
+
}))], [K.length, q]), X = u(() => [
|
|
49
66
|
{
|
|
50
67
|
key: "name",
|
|
51
68
|
header: "Cohort",
|
|
52
69
|
sortValue: (e) => e.name.toLowerCase(),
|
|
53
|
-
render: (e) => /* @__PURE__ */
|
|
70
|
+
render: (e) => /* @__PURE__ */ g("div", {
|
|
54
71
|
className: "flex items-center gap-3",
|
|
55
|
-
children: [/* @__PURE__ */
|
|
56
|
-
className:
|
|
57
|
-
children: /* @__PURE__ */
|
|
58
|
-
}), /* @__PURE__ */ g("
|
|
59
|
-
className: "min-w-0
|
|
60
|
-
children:
|
|
72
|
+
children: [/* @__PURE__ */ h("div", {
|
|
73
|
+
className: `flex h-9 w-9 shrink-0 items-center justify-center rounded-lg ${me[e.status]}`,
|
|
74
|
+
children: /* @__PURE__ */ h(m, { className: "h-4 w-4" })
|
|
75
|
+
}), /* @__PURE__ */ g("div", {
|
|
76
|
+
className: "min-w-0",
|
|
77
|
+
children: [/* @__PURE__ */ h("span", {
|
|
78
|
+
className: "block truncate font-semibold text-text-primary",
|
|
79
|
+
children: e.name
|
|
80
|
+
}), /* @__PURE__ */ h("span", {
|
|
81
|
+
className: "block truncate text-xs text-text-tertiary md:hidden",
|
|
82
|
+
children: U.get(e.courseId) ?? "—"
|
|
83
|
+
})]
|
|
61
84
|
})]
|
|
62
85
|
})
|
|
63
86
|
},
|
|
@@ -65,10 +88,10 @@ var A = (e) => {
|
|
|
65
88
|
key: "course",
|
|
66
89
|
header: "Course",
|
|
67
90
|
hideOnMobile: !0,
|
|
68
|
-
sortValue: (e) => (
|
|
69
|
-
render: (e) => /* @__PURE__ */
|
|
91
|
+
sortValue: (e) => (U.get(e.courseId) ?? "").toLowerCase(),
|
|
92
|
+
render: (e) => /* @__PURE__ */ h("span", {
|
|
70
93
|
className: "text-text-secondary",
|
|
71
|
-
children:
|
|
94
|
+
children: U.get(e.courseId) ?? "—"
|
|
72
95
|
})
|
|
73
96
|
},
|
|
74
97
|
{
|
|
@@ -78,13 +101,16 @@ var A = (e) => {
|
|
|
78
101
|
sortValue: (e) => e.capacity,
|
|
79
102
|
render: (e) => /* @__PURE__ */ g("span", {
|
|
80
103
|
className: "tabular-nums text-text-secondary",
|
|
81
|
-
children:
|
|
104
|
+
children: [a(e.capacity ?? 0), /* @__PURE__ */ h("span", {
|
|
105
|
+
className: "ml-1 text-text-tertiary",
|
|
106
|
+
children: "seats"
|
|
107
|
+
})]
|
|
82
108
|
})
|
|
83
109
|
},
|
|
84
110
|
{
|
|
85
111
|
key: "status",
|
|
86
112
|
header: "Status",
|
|
87
|
-
render: (e) => /* @__PURE__ */
|
|
113
|
+
render: (e) => /* @__PURE__ */ h(ee, { status: e.status })
|
|
88
114
|
},
|
|
89
115
|
{
|
|
90
116
|
key: "startDate",
|
|
@@ -92,9 +118,9 @@ var A = (e) => {
|
|
|
92
118
|
align: "right",
|
|
93
119
|
hideOnMobile: !0,
|
|
94
120
|
sortValue: (e) => e.startDate ?? "",
|
|
95
|
-
render: (e) => /* @__PURE__ */
|
|
121
|
+
render: (e) => /* @__PURE__ */ h("span", {
|
|
96
122
|
className: "text-text-tertiary",
|
|
97
|
-
children:
|
|
123
|
+
children: r(e.startDate)
|
|
98
124
|
})
|
|
99
125
|
},
|
|
100
126
|
{
|
|
@@ -103,177 +129,232 @@ var A = (e) => {
|
|
|
103
129
|
align: "right",
|
|
104
130
|
hideOnMobile: !0,
|
|
105
131
|
sortValue: (e) => e.endDate ?? "",
|
|
106
|
-
render: (e) =>
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
132
|
+
render: (e) => {
|
|
133
|
+
let t = O(e.startDate, e.endDate);
|
|
134
|
+
return /* @__PURE__ */ g("div", {
|
|
135
|
+
className: "text-right",
|
|
136
|
+
children: [/* @__PURE__ */ h("span", {
|
|
137
|
+
className: "text-text-tertiary",
|
|
138
|
+
children: r(e.endDate)
|
|
139
|
+
}), t !== null && /* @__PURE__ */ g("span", {
|
|
140
|
+
className: "block text-xs text-text-tertiary/70",
|
|
141
|
+
children: [
|
|
142
|
+
t,
|
|
143
|
+
" ",
|
|
144
|
+
t === 1 ? "week" : "weeks"
|
|
145
|
+
]
|
|
146
|
+
})]
|
|
147
|
+
});
|
|
148
|
+
}
|
|
110
149
|
}
|
|
111
|
-
], [
|
|
112
|
-
|
|
150
|
+
], [U]), Z = () => {
|
|
151
|
+
B(R), L(null), F(!0);
|
|
113
152
|
}, Q = () => {
|
|
114
|
-
|
|
115
|
-
},
|
|
116
|
-
if (!
|
|
117
|
-
|
|
153
|
+
F(!1), B(R), L(null);
|
|
154
|
+
}, ge = async () => {
|
|
155
|
+
if (!z.courseId) {
|
|
156
|
+
L("Please choose a course for this cohort.");
|
|
118
157
|
return;
|
|
119
158
|
}
|
|
120
|
-
if (!
|
|
121
|
-
|
|
159
|
+
if (!z.name.trim()) {
|
|
160
|
+
L("Cohort name is required.");
|
|
122
161
|
return;
|
|
123
162
|
}
|
|
124
|
-
let e =
|
|
163
|
+
let e = z.capacity.trim() ? Number(z.capacity) : void 0;
|
|
125
164
|
if (e !== void 0 && (!Number.isFinite(e) || e < 0)) {
|
|
126
|
-
|
|
165
|
+
L("Capacity must be a non-negative number.");
|
|
127
166
|
return;
|
|
128
167
|
}
|
|
129
|
-
let t =
|
|
168
|
+
let t = D(z.startDate), n = D(z.endDate);
|
|
130
169
|
if (t && n && new Date(n) < new Date(t)) {
|
|
131
|
-
|
|
170
|
+
L("End date cannot be before the start date.");
|
|
132
171
|
return;
|
|
133
172
|
}
|
|
134
|
-
|
|
173
|
+
L(null);
|
|
135
174
|
try {
|
|
136
|
-
await
|
|
137
|
-
courseId:
|
|
138
|
-
name:
|
|
175
|
+
await G.mutateAsync({
|
|
176
|
+
courseId: z.courseId,
|
|
177
|
+
name: z.name.trim(),
|
|
139
178
|
capacity: e,
|
|
140
|
-
facilitatorId:
|
|
179
|
+
facilitatorId: z.facilitatorId.trim() || void 0,
|
|
141
180
|
startDate: t,
|
|
142
181
|
endDate: n
|
|
143
182
|
}), Q();
|
|
144
183
|
} catch (e) {
|
|
145
|
-
|
|
184
|
+
L(e instanceof Error ? e.message : "Failed to create cohort.");
|
|
146
185
|
}
|
|
147
|
-
}, $ =
|
|
148
|
-
return /* @__PURE__ */
|
|
186
|
+
}, $ = H.length > 0, _e = !W.isLoading && !W.isError && J.total > 0;
|
|
187
|
+
return /* @__PURE__ */ g(t, {
|
|
149
188
|
title: "Cohorts",
|
|
150
189
|
description: "Scheduled, facilitator-led groups that move through a course together.",
|
|
151
190
|
titleGradient: !0,
|
|
152
191
|
aurora: !0,
|
|
153
|
-
actions: /* @__PURE__ */ _
|
|
192
|
+
actions: /* @__PURE__ */ g(_, {
|
|
154
193
|
onClick: Z,
|
|
155
194
|
disabled: !$,
|
|
156
|
-
children: [/* @__PURE__ */
|
|
195
|
+
children: [/* @__PURE__ */ h(p, { className: "mr-1.5 h-4 w-4" }), " New cohort"]
|
|
157
196
|
}),
|
|
158
197
|
children: [
|
|
159
|
-
/* @__PURE__ */
|
|
198
|
+
_e && /* @__PURE__ */ g("div", {
|
|
199
|
+
className: "mb-5 grid grid-cols-2 gap-4 sm:grid-cols-4",
|
|
200
|
+
children: [
|
|
201
|
+
/* @__PURE__ */ h(n, {
|
|
202
|
+
icon: /* @__PURE__ */ h(m, { className: "h-5 w-5" }),
|
|
203
|
+
value: J.total,
|
|
204
|
+
label: "Cohorts",
|
|
205
|
+
featured: !0,
|
|
206
|
+
footer: /* @__PURE__ */ g("p", {
|
|
207
|
+
className: "text-xs text-text-tertiary",
|
|
208
|
+
children: [a(J.seats), " seats scheduled"]
|
|
209
|
+
})
|
|
210
|
+
}),
|
|
211
|
+
/* @__PURE__ */ h(n, {
|
|
212
|
+
icon: /* @__PURE__ */ h(se, { className: "h-5 w-5" }),
|
|
213
|
+
value: J.active,
|
|
214
|
+
label: "Active",
|
|
215
|
+
accent: "success"
|
|
216
|
+
}),
|
|
217
|
+
/* @__PURE__ */ h(n, {
|
|
218
|
+
icon: /* @__PURE__ */ h(ce, { className: "h-5 w-5" }),
|
|
219
|
+
value: J.enrolling,
|
|
220
|
+
label: "Enrolling",
|
|
221
|
+
accent: "warning"
|
|
222
|
+
}),
|
|
223
|
+
/* @__PURE__ */ h(n, {
|
|
224
|
+
icon: /* @__PURE__ */ h(f, { className: "h-5 w-5" }),
|
|
225
|
+
value: J.scheduled,
|
|
226
|
+
label: "Scheduled"
|
|
227
|
+
})
|
|
228
|
+
]
|
|
229
|
+
}),
|
|
230
|
+
/* @__PURE__ */ g("div", {
|
|
160
231
|
className: "mb-5 flex flex-wrap items-center gap-3",
|
|
161
|
-
children: [/* @__PURE__ */
|
|
162
|
-
options:
|
|
232
|
+
children: [/* @__PURE__ */ h(ae, {
|
|
233
|
+
options: he,
|
|
234
|
+
value: A,
|
|
235
|
+
onChange: j
|
|
236
|
+
}), /* @__PURE__ */ g(S, {
|
|
163
237
|
value: M,
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
value: P,
|
|
167
|
-
onValueChange: (e) => F(e),
|
|
168
|
-
children: [/* @__PURE__ */ g(O, {
|
|
238
|
+
onValueChange: (e) => N(e),
|
|
239
|
+
children: [/* @__PURE__ */ h(T, {
|
|
169
240
|
className: "w-56",
|
|
170
241
|
"aria-label": "Filter by course",
|
|
171
|
-
children: /* @__PURE__ */
|
|
172
|
-
}), /* @__PURE__ */
|
|
242
|
+
children: /* @__PURE__ */ h(E, { placeholder: "All courses" })
|
|
243
|
+
}), /* @__PURE__ */ g(C, { children: [/* @__PURE__ */ h(w, {
|
|
173
244
|
value: "ALL",
|
|
174
245
|
children: "All courses"
|
|
175
|
-
}),
|
|
246
|
+
}), H.map((e) => /* @__PURE__ */ h(w, {
|
|
176
247
|
value: e.id,
|
|
177
248
|
children: e.title
|
|
178
249
|
}, e.id))] })]
|
|
179
250
|
})]
|
|
180
251
|
}),
|
|
181
|
-
|
|
252
|
+
W.isLoading ? /* @__PURE__ */ h(re, { label: "Loading cohorts…" }) : W.isError ? /* @__PURE__ */ h(ne, {
|
|
182
253
|
message: "Couldn't load cohorts.",
|
|
183
|
-
onRetry: () =>
|
|
184
|
-
}) :
|
|
185
|
-
illustration:
|
|
186
|
-
icon: /* @__PURE__ */
|
|
187
|
-
title:
|
|
188
|
-
description:
|
|
189
|
-
action:
|
|
254
|
+
onRetry: () => W.refetch()
|
|
255
|
+
}) : Y.length === 0 ? /* @__PURE__ */ h(te, {
|
|
256
|
+
illustration: A === "ALL" && M === "ALL" ? "onboarding" : "empty-search",
|
|
257
|
+
icon: /* @__PURE__ */ h(oe, { className: "h-10 w-10" }),
|
|
258
|
+
title: A === "ALL" && M === "ALL" ? "No cohorts yet" : "No cohorts match these filters",
|
|
259
|
+
description: A === "ALL" && M === "ALL" ? $ ? "Schedule a cohort to run a course with a group of learners on a shared timeline." : "Publish a course first, then schedule a cohort to run it with a group of learners." : "Try a different status or course to see more cohorts.",
|
|
260
|
+
action: A === "ALL" && M === "ALL" && $ ? /* @__PURE__ */ g(_, {
|
|
190
261
|
onClick: Z,
|
|
191
|
-
children: [/* @__PURE__ */
|
|
262
|
+
children: [/* @__PURE__ */ h(p, { className: "mr-1.5 h-4 w-4" }), " New cohort"]
|
|
192
263
|
}) : void 0
|
|
193
|
-
}) : /* @__PURE__ */ g(
|
|
194
|
-
columns:
|
|
195
|
-
rows:
|
|
264
|
+
}) : /* @__PURE__ */ g(le, { children: [/* @__PURE__ */ h(ie, {
|
|
265
|
+
columns: X,
|
|
266
|
+
rows: Y,
|
|
196
267
|
rowKey: (e) => e.id,
|
|
197
268
|
defaultSort: {
|
|
198
269
|
key: "startDate",
|
|
199
270
|
dir: "desc"
|
|
200
271
|
}
|
|
201
|
-
}),
|
|
202
|
-
|
|
203
|
-
|
|
272
|
+
}), /* @__PURE__ */ g("p", {
|
|
273
|
+
className: "mt-4 text-center text-sm text-text-tertiary tabular-nums",
|
|
274
|
+
children: [
|
|
275
|
+
"Showing ",
|
|
276
|
+
Y.length,
|
|
277
|
+
" of ",
|
|
278
|
+
K.length,
|
|
279
|
+
" ",
|
|
280
|
+
K.length === 1 ? "cohort" : "cohorts"
|
|
281
|
+
]
|
|
282
|
+
})] }),
|
|
283
|
+
/* @__PURE__ */ h(ue, {
|
|
284
|
+
open: P,
|
|
204
285
|
onOpenChange: (e) => {
|
|
205
|
-
e ?
|
|
286
|
+
e ? F(!0) : Q();
|
|
206
287
|
},
|
|
207
|
-
children: /* @__PURE__ */
|
|
288
|
+
children: /* @__PURE__ */ g(de, { children: [/* @__PURE__ */ g(fe, { children: [/* @__PURE__ */ h(pe, { children: "New cohort" }), /* @__PURE__ */ h(b, { children: "Schedule a facilitator-led group to run a course together." })] }), /* @__PURE__ */ g("form", {
|
|
208
289
|
onSubmit: (e) => {
|
|
209
|
-
e.preventDefault(),
|
|
290
|
+
e.preventDefault(), ge();
|
|
210
291
|
},
|
|
211
|
-
children: [/* @__PURE__ */
|
|
292
|
+
children: [/* @__PURE__ */ g("div", {
|
|
212
293
|
className: "grid gap-4 py-2",
|
|
213
294
|
children: [
|
|
214
|
-
/* @__PURE__ */
|
|
295
|
+
/* @__PURE__ */ g("div", {
|
|
215
296
|
className: "grid gap-1.5",
|
|
216
|
-
children: [/* @__PURE__ */
|
|
297
|
+
children: [/* @__PURE__ */ h(y, {
|
|
217
298
|
htmlFor: "cohort-course",
|
|
218
299
|
children: "Course *"
|
|
219
|
-
}), /* @__PURE__ */
|
|
220
|
-
value:
|
|
221
|
-
onValueChange: (e) =>
|
|
300
|
+
}), /* @__PURE__ */ g(S, {
|
|
301
|
+
value: z.courseId,
|
|
302
|
+
onValueChange: (e) => B((t) => ({
|
|
222
303
|
...t,
|
|
223
304
|
courseId: e
|
|
224
305
|
})),
|
|
225
|
-
children: [/* @__PURE__ */
|
|
306
|
+
children: [/* @__PURE__ */ h(T, {
|
|
226
307
|
id: "cohort-course",
|
|
227
|
-
children: /* @__PURE__ */
|
|
228
|
-
}), /* @__PURE__ */
|
|
308
|
+
children: /* @__PURE__ */ h(E, { placeholder: "Select a course" })
|
|
309
|
+
}), /* @__PURE__ */ h(C, { children: H.map((e) => /* @__PURE__ */ h(w, {
|
|
229
310
|
value: e.id,
|
|
230
311
|
children: e.title
|
|
231
312
|
}, e.id)) })]
|
|
232
313
|
})]
|
|
233
314
|
}),
|
|
234
|
-
/* @__PURE__ */
|
|
315
|
+
/* @__PURE__ */ g("div", {
|
|
235
316
|
className: "grid gap-1.5",
|
|
236
|
-
children: [/* @__PURE__ */
|
|
317
|
+
children: [/* @__PURE__ */ h(y, {
|
|
237
318
|
htmlFor: "cohort-name",
|
|
238
319
|
children: "Name *"
|
|
239
|
-
}), /* @__PURE__ */
|
|
320
|
+
}), /* @__PURE__ */ h(v, {
|
|
240
321
|
id: "cohort-name",
|
|
241
|
-
value:
|
|
242
|
-
onChange: (e) =>
|
|
322
|
+
value: z.name,
|
|
323
|
+
onChange: (e) => B((t) => ({
|
|
243
324
|
...t,
|
|
244
325
|
name: e.target.value
|
|
245
326
|
})),
|
|
246
327
|
placeholder: "Spring 2026 Cohort"
|
|
247
328
|
})]
|
|
248
329
|
}),
|
|
249
|
-
/* @__PURE__ */
|
|
330
|
+
/* @__PURE__ */ g("div", {
|
|
250
331
|
className: "grid gap-2 sm:grid-cols-2",
|
|
251
|
-
children: [/* @__PURE__ */
|
|
332
|
+
children: [/* @__PURE__ */ g("div", {
|
|
252
333
|
className: "grid gap-1.5",
|
|
253
|
-
children: [/* @__PURE__ */
|
|
334
|
+
children: [/* @__PURE__ */ h(y, {
|
|
254
335
|
htmlFor: "cohort-capacity",
|
|
255
336
|
children: "Capacity"
|
|
256
|
-
}), /* @__PURE__ */
|
|
337
|
+
}), /* @__PURE__ */ h(v, {
|
|
257
338
|
id: "cohort-capacity",
|
|
258
339
|
type: "number",
|
|
259
340
|
min: "0",
|
|
260
341
|
step: "1",
|
|
261
|
-
value:
|
|
262
|
-
onChange: (e) =>
|
|
342
|
+
value: z.capacity,
|
|
343
|
+
onChange: (e) => B((t) => ({
|
|
263
344
|
...t,
|
|
264
345
|
capacity: e.target.value
|
|
265
346
|
})),
|
|
266
347
|
placeholder: "25"
|
|
267
348
|
})]
|
|
268
|
-
}), /* @__PURE__ */
|
|
349
|
+
}), /* @__PURE__ */ g("div", {
|
|
269
350
|
className: "grid gap-1.5",
|
|
270
|
-
children: [/* @__PURE__ */
|
|
351
|
+
children: [/* @__PURE__ */ h(y, {
|
|
271
352
|
htmlFor: "cohort-facilitator",
|
|
272
353
|
children: "Facilitator (user ID)"
|
|
273
|
-
}), /* @__PURE__ */
|
|
354
|
+
}), /* @__PURE__ */ h(v, {
|
|
274
355
|
id: "cohort-facilitator",
|
|
275
|
-
value:
|
|
276
|
-
onChange: (e) =>
|
|
356
|
+
value: z.facilitatorId,
|
|
357
|
+
onChange: (e) => B((t) => ({
|
|
277
358
|
...t,
|
|
278
359
|
facilitatorId: e.target.value
|
|
279
360
|
})),
|
|
@@ -281,52 +362,52 @@ var A = (e) => {
|
|
|
281
362
|
})]
|
|
282
363
|
})]
|
|
283
364
|
}),
|
|
284
|
-
/* @__PURE__ */
|
|
365
|
+
/* @__PURE__ */ g("div", {
|
|
285
366
|
className: "grid gap-2 sm:grid-cols-2",
|
|
286
|
-
children: [/* @__PURE__ */
|
|
367
|
+
children: [/* @__PURE__ */ g("div", {
|
|
287
368
|
className: "grid gap-1.5",
|
|
288
|
-
children: [/* @__PURE__ */
|
|
369
|
+
children: [/* @__PURE__ */ h(y, {
|
|
289
370
|
htmlFor: "cohort-start",
|
|
290
371
|
children: "Start date"
|
|
291
|
-
}), /* @__PURE__ */
|
|
372
|
+
}), /* @__PURE__ */ h(v, {
|
|
292
373
|
id: "cohort-start",
|
|
293
374
|
type: "date",
|
|
294
|
-
value:
|
|
295
|
-
onChange: (e) =>
|
|
375
|
+
value: z.startDate,
|
|
376
|
+
onChange: (e) => B((t) => ({
|
|
296
377
|
...t,
|
|
297
378
|
startDate: e.target.value
|
|
298
379
|
}))
|
|
299
380
|
})]
|
|
300
|
-
}), /* @__PURE__ */
|
|
381
|
+
}), /* @__PURE__ */ g("div", {
|
|
301
382
|
className: "grid gap-1.5",
|
|
302
|
-
children: [/* @__PURE__ */
|
|
383
|
+
children: [/* @__PURE__ */ h(y, {
|
|
303
384
|
htmlFor: "cohort-end",
|
|
304
385
|
children: "End date"
|
|
305
|
-
}), /* @__PURE__ */
|
|
386
|
+
}), /* @__PURE__ */ h(v, {
|
|
306
387
|
id: "cohort-end",
|
|
307
388
|
type: "date",
|
|
308
|
-
value:
|
|
309
|
-
onChange: (e) =>
|
|
389
|
+
value: z.endDate,
|
|
390
|
+
onChange: (e) => B((t) => ({
|
|
310
391
|
...t,
|
|
311
392
|
endDate: e.target.value
|
|
312
393
|
}))
|
|
313
394
|
})]
|
|
314
395
|
})]
|
|
315
396
|
}),
|
|
316
|
-
|
|
397
|
+
I && /* @__PURE__ */ h("p", {
|
|
317
398
|
className: "text-sm text-status-error-text",
|
|
318
|
-
children:
|
|
399
|
+
children: I
|
|
319
400
|
})
|
|
320
401
|
]
|
|
321
|
-
}), /* @__PURE__ */
|
|
402
|
+
}), /* @__PURE__ */ g(x, { children: [/* @__PURE__ */ h(_, {
|
|
322
403
|
type: "button",
|
|
323
404
|
variant: "outline",
|
|
324
405
|
onClick: Q,
|
|
325
406
|
children: "Cancel"
|
|
326
|
-
}), /* @__PURE__ */
|
|
407
|
+
}), /* @__PURE__ */ h(_, {
|
|
327
408
|
type: "submit",
|
|
328
|
-
disabled:
|
|
329
|
-
children:
|
|
409
|
+
disabled: G.isPending,
|
|
410
|
+
children: G.isPending ? "Creating…" : "Create cohort"
|
|
330
411
|
})] })]
|
|
331
412
|
})] })
|
|
332
413
|
})
|
|
@@ -334,6 +415,6 @@ var A = (e) => {
|
|
|
334
415
|
});
|
|
335
416
|
};
|
|
336
417
|
//#endregion
|
|
337
|
-
export {
|
|
418
|
+
export { k as CohortsPage };
|
|
338
419
|
|
|
339
420
|
//# sourceMappingURL=CohortsPage.js.map
|