@nualang/nualang-ui-components 0.1.1235 → 0.1.1237
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/Assignments/AssignmentCard/AssignmentCard.js +3 -0
- package/dist/Assignments/AssignmentCardsList/AssignmentCardsList.js +2 -1
- package/dist/Assignments/CreateAssignmentDialog/CreateAssignmentDialog.js +8 -0
- package/dist/Tables/Progress/Progress.js +1 -1
- package/dist/Tables/Progress/ProgressTable.js +6 -6
- package/package.json +1 -1
|
@@ -18,6 +18,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
18
18
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
19
19
|
function AssignmentCard({
|
|
20
20
|
t = text => text,
|
|
21
|
+
index = 0,
|
|
21
22
|
assignment,
|
|
22
23
|
handleStartExercise,
|
|
23
24
|
username,
|
|
@@ -154,12 +155,14 @@ function AssignmentCard({
|
|
|
154
155
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Tooltip, {
|
|
155
156
|
title: t("edit"),
|
|
156
157
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.IconButton, {
|
|
158
|
+
"data-cy": `edit-assignment-${index}`,
|
|
157
159
|
onClick: () => handleEditAssignment(assignment),
|
|
158
160
|
children: [" ", /*#__PURE__*/(0, _jsxRuntime.jsx)(_iconsMaterial.Edit, {}), " "]
|
|
159
161
|
})
|
|
160
162
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Tooltip, {
|
|
161
163
|
title: t("delete"),
|
|
162
164
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.IconButton, {
|
|
165
|
+
"data-cy": `delete-assignment-${index}`,
|
|
163
166
|
onClick: () => {
|
|
164
167
|
handleDeleteAssignment(assignment.classroomId, assignment.assignmentId);
|
|
165
168
|
},
|
|
@@ -126,7 +126,8 @@ const AssignmentCardsList = ({
|
|
|
126
126
|
if (isCreator) return true;
|
|
127
127
|
if (!assignment.scheduleDate) return true;
|
|
128
128
|
return new Date(assignment.scheduleDate) <= new Date();
|
|
129
|
-
}).map(assignment => /*#__PURE__*/(0, _jsxRuntime.jsx)(_AssignmentCard.default, {
|
|
129
|
+
}).map((assignment, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_AssignmentCard.default, {
|
|
130
|
+
index: index,
|
|
130
131
|
assignment: assignment,
|
|
131
132
|
t: t,
|
|
132
133
|
isCreator: isCreator,
|
|
@@ -222,6 +222,7 @@ function CreateAssignmentDialog({
|
|
|
222
222
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Select, {
|
|
223
223
|
labelId: "classroom-label",
|
|
224
224
|
id: "classroom",
|
|
225
|
+
"data-cy": "select-classroom-dropdown",
|
|
225
226
|
value: assignment.classroomId,
|
|
226
227
|
label: t("select_classroom"),
|
|
227
228
|
onChange: handleChange("classroomId"),
|
|
@@ -246,12 +247,14 @@ function CreateAssignmentDialog({
|
|
|
246
247
|
}, classroom.classroomId))
|
|
247
248
|
})]
|
|
248
249
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.TextField, {
|
|
250
|
+
"data-cy": "assignment-title-input",
|
|
249
251
|
label: t("assignment_title"),
|
|
250
252
|
fullWidth: true,
|
|
251
253
|
value: assignment.title,
|
|
252
254
|
onChange: handleChange("title"),
|
|
253
255
|
required: true
|
|
254
256
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.TextField, {
|
|
257
|
+
"data-cy": "assignment-description-input",
|
|
255
258
|
label: t("assignment_description"),
|
|
256
259
|
fullWidth: true,
|
|
257
260
|
multiline: true,
|
|
@@ -259,6 +262,7 @@ function CreateAssignmentDialog({
|
|
|
259
262
|
value: assignment.instructions,
|
|
260
263
|
onChange: handleChange("instructions")
|
|
261
264
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Button, {
|
|
265
|
+
"data-cy": "assignment-exercise-selector-button",
|
|
262
266
|
variant: "outlined",
|
|
263
267
|
color: "primary",
|
|
264
268
|
sx: {
|
|
@@ -302,6 +306,7 @@ function CreateAssignmentDialog({
|
|
|
302
306
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Select, {
|
|
303
307
|
labelId: "members-label",
|
|
304
308
|
id: "assignedStudents",
|
|
309
|
+
"data-cy": "assignment-members-selector",
|
|
305
310
|
label: t("select_members"),
|
|
306
311
|
multiple: true,
|
|
307
312
|
required: true,
|
|
@@ -325,6 +330,7 @@ function CreateAssignmentDialog({
|
|
|
325
330
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_LocalizationProvider.LocalizationProvider, {
|
|
326
331
|
dateAdapter: _AdapterDayjs.AdapterDayjs,
|
|
327
332
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DatePicker.DatePicker, {
|
|
333
|
+
"data-cy": "assignment-date-picker",
|
|
328
334
|
label: t("due_date"),
|
|
329
335
|
value: assignment.dueDate,
|
|
330
336
|
onChange: date => setAssignment(prev => ({
|
|
@@ -361,6 +367,7 @@ function CreateAssignmentDialog({
|
|
|
361
367
|
borderRadius: 10
|
|
362
368
|
},
|
|
363
369
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Button, {
|
|
370
|
+
"data-cy": "assignment-assign-button",
|
|
364
371
|
disabled: !assignment.assignedStudents?.length || !assignment.scheduleDate || !assignment.dueDate || !assignment.title || !assignment.classroomId || !assignment.exercises?.length,
|
|
365
372
|
onClick: handleCreateAssignment,
|
|
366
373
|
children: t("assign")
|
|
@@ -406,6 +413,7 @@ function CreateAssignmentDialog({
|
|
|
406
413
|
variant: "outlined",
|
|
407
414
|
color: "primary",
|
|
408
415
|
fullWidth: true,
|
|
416
|
+
"data-cy": "assignment-schedule-button",
|
|
409
417
|
onClick: () => {
|
|
410
418
|
handleCreateAssignment();
|
|
411
419
|
handleMenuClose();
|
|
@@ -210,7 +210,7 @@ function Progress({
|
|
|
210
210
|
const [bots, setBots] = (0, _react.useState)([]);
|
|
211
211
|
const reportFilters = ["percentage_complete", "correct_answer_percentage", "avg_pronunciation_score"];
|
|
212
212
|
const [filter, setFilter] = (0, _react.useState)(reportFilters[0]);
|
|
213
|
-
const reportTypes = isVideoChatEnabled ? ["
|
|
213
|
+
const reportTypes = isVideoChatEnabled ? ["courses", "assignments", "discuss"] : ["courses", "assignments"];
|
|
214
214
|
const [reportType, setReportType] = (0, _react.useState)(reportTypes[0]);
|
|
215
215
|
(0, _react.useEffect)(() => {
|
|
216
216
|
if (selectedTopic) {
|
|
@@ -690,7 +690,7 @@ function TableRow({
|
|
|
690
690
|
children: t("view_activity")
|
|
691
691
|
})]
|
|
692
692
|
})]
|
|
693
|
-
}), reportType === "
|
|
693
|
+
}), reportType === "courses" && currentView === "all_courses" && courses.map((c, i) => {
|
|
694
694
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(CourseCellData, {
|
|
695
695
|
t: t,
|
|
696
696
|
data: tableData[c.courseId],
|
|
@@ -701,7 +701,7 @@ function TableRow({
|
|
|
701
701
|
,
|
|
702
702
|
filter: filter
|
|
703
703
|
}, `student-progress-data-cell-${i}`);
|
|
704
|
-
}), reportType === "
|
|
704
|
+
}), reportType === "courses" && currentView === "course" && selectedCourse.sections.map((s, i) => {
|
|
705
705
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(SectionCellData, {
|
|
706
706
|
t: t,
|
|
707
707
|
data: tableData[selectedCourse.courseId]?.sections[s.sectionId],
|
|
@@ -814,7 +814,7 @@ function ProgressTable({
|
|
|
814
814
|
}) {
|
|
815
815
|
const selectedAssignmentTopics = (selectedAssignment?.exercises || [])?.map(e => e.courseSectionTopicId);
|
|
816
816
|
const assignmentTopics = courses.flatMap(c => c.sections.flatMap(s => s.topics)).filter(t => selectedAssignmentTopics?.includes(`${t.courseSectionId}|${t.topicId}`));
|
|
817
|
-
const topics = reportType === "
|
|
817
|
+
const topics = reportType === "courses" && selectedCourse && selectedSection ? selectedCourse.sections[selectedCourse.sections.findIndex(s => s.sectionId === selectedSection.sectionId)].topics : [];
|
|
818
818
|
const tableTopics = reportType === "assignments" ? assignmentTopics : topics;
|
|
819
819
|
const assignmentExercises = reportType === "assignments" && selectedTopic ? (selectedAssignment?.exercises || []).filter(e => e.courseSectionTopicId === `${selectedTopic.courseSectionId}|${selectedTopic.topicId}`) : [];
|
|
820
820
|
const exercises = ["translation", "listening", "pronunciation"];
|
|
@@ -905,7 +905,7 @@ function ProgressTable({
|
|
|
905
905
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("tr", {
|
|
906
906
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("th", {
|
|
907
907
|
scope: "col",
|
|
908
|
-
children: [reportType === "
|
|
908
|
+
children: [reportType === "courses" && currentView === "all_courses" && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
909
909
|
sx: {
|
|
910
910
|
width: "100%",
|
|
911
911
|
justifyContent: "center"
|
|
@@ -1214,7 +1214,7 @@ function ProgressTable({
|
|
|
1214
1214
|
})]
|
|
1215
1215
|
})
|
|
1216
1216
|
})]
|
|
1217
|
-
}), reportType === "
|
|
1217
|
+
}), reportType === "courses" && currentView === "all_courses" && courses.map((c, i) => /*#__PURE__*/(0, _jsxRuntime.jsxs)("th", {
|
|
1218
1218
|
scope: "col",
|
|
1219
1219
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
1220
1220
|
sx: {
|
|
@@ -1252,7 +1252,7 @@ function ProgressTable({
|
|
|
1252
1252
|
},
|
|
1253
1253
|
children: t("view_course")
|
|
1254
1254
|
})]
|
|
1255
|
-
}, i)), reportType === "
|
|
1255
|
+
}, i)), reportType === "courses" && currentView === "course" && selectedCourse.sections.map((s, i) => /*#__PURE__*/(0, _jsxRuntime.jsxs)("th", {
|
|
1256
1256
|
scope: "col",
|
|
1257
1257
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
1258
1258
|
sx: {
|