@local-civics/mgmt-ui 0.1.200 → 0.1.202
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/index.js +48 -54
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +48 -54
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1135,21 +1135,13 @@ var __spreadValues$c = (a, b) => {
|
|
|
1135
1135
|
};
|
|
1136
1136
|
var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
|
|
1137
1137
|
function Table$c(props) {
|
|
1138
|
-
console.group("Class Table Data Check");
|
|
1139
|
-
console.log("1. Raw props:", props);
|
|
1140
|
-
console.log("2. Raw items from prop.items:", props.items);
|
|
1141
|
-
if (props.items.length > 0) {
|
|
1142
|
-
console.log("3. Type of lastActivity (first item):", typeof props.items[0].lastActivity, props.items[0].lastActivity);
|
|
1143
|
-
}
|
|
1144
1138
|
const preparedItems = React.useMemo(() => {
|
|
1145
1139
|
return props.items.map((item) => __spreadProps$8(__spreadValues$c({}, item), {
|
|
1146
1140
|
fullName: item.givenName && item.familyName ? `${item.givenName} ${item.familyName}`.toLowerCase() : item.email.toLowerCase()
|
|
1147
1141
|
}));
|
|
1148
1142
|
}, [props.items]);
|
|
1149
|
-
console.log("4. Prepared items (before sort hook):", preparedItems);
|
|
1150
1143
|
console.groupEnd();
|
|
1151
1144
|
const { items: sortedItems, requestSort, sortConfig } = useSortableData(preparedItems);
|
|
1152
|
-
console.log("5. Final sorted items:", sortedItems);
|
|
1153
1145
|
if (props.items.length === 0) {
|
|
1154
1146
|
return /* @__PURE__ */ React.createElement(
|
|
1155
1147
|
PlaceholderBanner,
|
|
@@ -1225,12 +1217,6 @@ function Table$c(props) {
|
|
|
1225
1217
|
sortable: true,
|
|
1226
1218
|
render: (row) => row.hasAccount ? /* @__PURE__ */ React.createElement(IconCheck, { color: "green" }) : null
|
|
1227
1219
|
},
|
|
1228
|
-
{
|
|
1229
|
-
accessor: "lastActivity",
|
|
1230
|
-
title: "Last Active",
|
|
1231
|
-
sortable: true,
|
|
1232
|
-
render: (row) => row.lastActivity ? relativeTimeFromDates(row.lastActivity) : ""
|
|
1233
|
-
},
|
|
1234
1220
|
{
|
|
1235
1221
|
accessor: "actions",
|
|
1236
1222
|
title: "",
|
|
@@ -2572,7 +2558,7 @@ function Table$4(props) {
|
|
|
2572
2558
|
onChange: (value) => props.onRoleChange && props.onRoleChange(row, value),
|
|
2573
2559
|
data: [{ value: "student", label: "Student" }, { value: "educator", label: "Educator" }, { value: "admin", label: "Admin" }]
|
|
2574
2560
|
}
|
|
2575
|
-
))), /* @__PURE__ */ React.createElement("td", null, row.hasAccount && /* @__PURE__ */ React.createElement(IconCheck, { color: "green" })), /* @__PURE__ */ React.createElement("td", null, row.numberOfClasses), /* @__PURE__ */ React.createElement("td", null,
|
|
2561
|
+
))), /* @__PURE__ */ React.createElement("td", null, row.hasAccount && /* @__PURE__ */ React.createElement(IconCheck, { color: "green" })), /* @__PURE__ */ React.createElement("td", null, row.numberOfClasses), /* @__PURE__ */ React.createElement("td", null, /* @__PURE__ */ React.createElement(Group, { noWrap: true, spacing: 0, position: "right" }, !row.readonly && !!props.onDelete && /* @__PURE__ */ React.createElement(ActionIcon, { color: "red" }, /* @__PURE__ */ React.createElement(IconTrash, { onClick: () => openDeleteModal(row), size: 16, stroke: 1.5 }))))));
|
|
2576
2562
|
return /* @__PURE__ */ React.createElement(ScrollArea, null, /* @__PURE__ */ React.createElement(Table$l, { verticalSpacing: 20, sx: { minWidth: 700 }, highlightOnHover: true, striped: true }, /* @__PURE__ */ React.createElement("thead", null, /* @__PURE__ */ React.createElement("tr", null, /* @__PURE__ */ React.createElement("th", null, "Name"), /* @__PURE__ */ React.createElement("th", null, "Role"), /* @__PURE__ */ React.createElement("th", null, "Account Created?"), /* @__PURE__ */ React.createElement("th", null, "# of Classes"), /* @__PURE__ */ React.createElement("th", null, "Last Active"), /* @__PURE__ */ React.createElement("th", null))), /* @__PURE__ */ React.createElement("tbody", null, rows)));
|
|
2577
2563
|
}
|
|
2578
2564
|
|
|
@@ -3791,22 +3777,6 @@ const SplitButton = (props) => {
|
|
|
3791
3777
|
const { classes, theme } = useStyles$1();
|
|
3792
3778
|
theme.colors[theme.primaryColor][theme.colorScheme === "dark" ? 5 : 6];
|
|
3793
3779
|
return /* @__PURE__ */ React.createElement(Stack$5, { spacing: "sm" }, /* @__PURE__ */ React.createElement(
|
|
3794
|
-
Button,
|
|
3795
|
-
{
|
|
3796
|
-
component: Link,
|
|
3797
|
-
to: props.href,
|
|
3798
|
-
className: classes.button,
|
|
3799
|
-
variant: "gradient"
|
|
3800
|
-
},
|
|
3801
|
-
"Preview"
|
|
3802
|
-
), /* @__PURE__ */ React.createElement(
|
|
3803
|
-
Button,
|
|
3804
|
-
{
|
|
3805
|
-
leftIcon: /* @__PURE__ */ React.createElement(IconClipboardCopy, { size: 14 }),
|
|
3806
|
-
onClick: props.onCopyLinkClick
|
|
3807
|
-
},
|
|
3808
|
-
"Copy link"
|
|
3809
|
-
), /* @__PURE__ */ React.createElement(
|
|
3810
3780
|
Button,
|
|
3811
3781
|
{
|
|
3812
3782
|
leftIcon: /* @__PURE__ */ React.createElement(IconTableExport, { size: 14 }),
|
|
@@ -3985,25 +3955,41 @@ const useStyles = createStyles((theme) => ({
|
|
|
3985
3955
|
}));
|
|
3986
3956
|
const BadgeTable = ({ badges, students, loading }) => {
|
|
3987
3957
|
const { byBadge } = useFilteredStudents(students);
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3958
|
+
const countFiles = (students2) => students2.reduce((acc, s) => {
|
|
3959
|
+
var _a;
|
|
3960
|
+
return acc + (((_a = s.submissions) == null ? void 0 : _a.length) || 0);
|
|
3961
|
+
}, 0);
|
|
3962
|
+
return /* @__PURE__ */ React.createElement(Accordion, null, badges.map((b) => {
|
|
3963
|
+
const studentsForBadge = byBadge(b.badgeId);
|
|
3964
|
+
const fileCount = countFiles(studentsForBadge);
|
|
3965
|
+
return /* @__PURE__ */ React.createElement(Accordion.Item, { key: b.badgeId, value: b.badgeId }, /* @__PURE__ */ React.createElement(Accordion.Control, null, /* @__PURE__ */ React.createElement(Group, { position: "apart", w: "100%" }, /* @__PURE__ */ React.createElement(Text, null, b.displayName), /* @__PURE__ */ React.createElement(Badge$1, { size: "sm" }, fileCount))), /* @__PURE__ */ React.createElement(Accordion.Panel, null, /* @__PURE__ */ React.createElement(
|
|
3966
|
+
Table,
|
|
3967
|
+
{
|
|
3968
|
+
loading,
|
|
3969
|
+
items: studentsForBadge,
|
|
3970
|
+
hideBadge: true
|
|
3971
|
+
}
|
|
3972
|
+
)));
|
|
3973
|
+
}));
|
|
3996
3974
|
};
|
|
3997
3975
|
const LessonTableWrapper = ({ lessons, students, loading }) => {
|
|
3998
3976
|
const { byLesson } = useFilteredStudents(students);
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
3977
|
+
const countFiles = (students2) => students2.reduce((acc, s) => {
|
|
3978
|
+
var _a;
|
|
3979
|
+
return acc + (((_a = s.submissions) == null ? void 0 : _a.length) || 0);
|
|
3980
|
+
}, 0);
|
|
3981
|
+
return /* @__PURE__ */ React.createElement(Accordion, null, lessons.map((l) => {
|
|
3982
|
+
const studentsForLesson = byLesson(l.lessonName);
|
|
3983
|
+
const fileCount = countFiles(studentsForLesson);
|
|
3984
|
+
return /* @__PURE__ */ React.createElement(Accordion.Item, { key: l.lessonId, value: l.lessonId }, /* @__PURE__ */ React.createElement(Accordion.Control, null, /* @__PURE__ */ React.createElement(Group, { position: "apart", w: "100%" }, /* @__PURE__ */ React.createElement(Text, null, l.lessonName), /* @__PURE__ */ React.createElement(Badge$1, { size: "sm" }, fileCount))), /* @__PURE__ */ React.createElement(Accordion.Panel, null, /* @__PURE__ */ React.createElement(
|
|
3985
|
+
Table,
|
|
3986
|
+
{
|
|
3987
|
+
loading,
|
|
3988
|
+
items: studentsForLesson,
|
|
3989
|
+
hideLesson: true
|
|
3990
|
+
}
|
|
3991
|
+
)));
|
|
3992
|
+
}));
|
|
4007
3993
|
};
|
|
4008
3994
|
const PathwayTable = ({
|
|
4009
3995
|
pathways,
|
|
@@ -4012,13 +3998,21 @@ const PathwayTable = ({
|
|
|
4012
3998
|
loading
|
|
4013
3999
|
}) => {
|
|
4014
4000
|
const { byPathway } = useFilteredStudents(students);
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4001
|
+
const countFiles = (students2) => students2.reduce((acc, s) => {
|
|
4002
|
+
var _a;
|
|
4003
|
+
return acc + (((_a = s.submissions) == null ? void 0 : _a.length) || 0);
|
|
4004
|
+
}, 0);
|
|
4005
|
+
return /* @__PURE__ */ React.createElement(Accordion, null, pathways.map((p) => {
|
|
4006
|
+
const studentsForPathway = byPathway(p.pathwayId, badges);
|
|
4007
|
+
const fileCount = countFiles(studentsForPathway);
|
|
4008
|
+
return /* @__PURE__ */ React.createElement(Accordion.Item, { key: p.pathwayId, value: p.pathwayId }, /* @__PURE__ */ React.createElement(Accordion.Control, null, /* @__PURE__ */ React.createElement(Group, { position: "apart", w: "100%" }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("strong", null, p.title), /* @__PURE__ */ React.createElement("div", null, p.description)), /* @__PURE__ */ React.createElement(Badge$1, { size: "sm" }, fileCount))), /* @__PURE__ */ React.createElement(Accordion.Panel, null, /* @__PURE__ */ React.createElement(
|
|
4009
|
+
Table,
|
|
4010
|
+
{
|
|
4011
|
+
loading,
|
|
4012
|
+
items: studentsForPathway
|
|
4013
|
+
}
|
|
4014
|
+
)));
|
|
4015
|
+
}));
|
|
4022
4016
|
};
|
|
4023
4017
|
const FileLocker = (props) => {
|
|
4024
4018
|
const { classes } = useStyles();
|