@nualang/nualang-ui-components 0.1.1236 → 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.
|
@@ -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();
|