@nualang/nualang-ui-components 0.1.1233 → 0.1.1234

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.
@@ -27,7 +27,8 @@ function AssignmentCard({
27
27
  getCourses,
28
28
  deleteAssignment,
29
29
  handleEditAssignment,
30
- lastClickedExerciseId
30
+ lastClickedExerciseId,
31
+ handleViewProgress
31
32
  }) {
32
33
  const [confirm] = (0, _useConfirm.default)(t);
33
34
  const handleDeleteAssignment = async (classroomId, assignmentId) => {
@@ -242,6 +243,9 @@ function AssignmentCard({
242
243
  marginTop: 2,
243
244
  marginLeft: "15px"
244
245
  },
246
+ onClick: () => handleViewProgress({
247
+ assignmentId: assignment?.assignmentId
248
+ }),
245
249
  children: t("view_progress")
246
250
  })]
247
251
  })]
@@ -25,7 +25,8 @@ const AssignmentCardsList = ({
25
25
  getRoleplays,
26
26
  deleteAssignment,
27
27
  handleEditAssignment,
28
- refreshAssignments
28
+ refreshAssignments,
29
+ handleViewProgress
29
30
  }) => {
30
31
  const [lastClickedExerciseId, setLastClickedExerciseId] = (0, _react.useState)(null);
31
32
  (0, _react.useEffect)(() => {
@@ -134,7 +135,8 @@ const AssignmentCardsList = ({
134
135
  getRoleplays: getRoleplays,
135
136
  deleteAssignment: deleteAssignment,
136
137
  handleEditAssignment: handleEditAssignment,
137
- lastClickedExerciseId: lastClickedExerciseId
138
+ lastClickedExerciseId: lastClickedExerciseId,
139
+ handleViewProgress: handleViewProgress
138
140
  }, assignment.assignmentId))]
139
141
  })
140
142
  });
@@ -457,6 +457,12 @@ function Classroom({
457
457
  handleOpenCreatorNotSubscribedUpgradeModal();
458
458
  }
459
459
  }, [creatorSubscription]);
460
+ const handleViewProgress = ({
461
+ assignmentId
462
+ }) => {
463
+ setOverwriteValue(tabs.findIndex(tab => tab.id === "Progress"));
464
+ navigate(`?assignmentId=${assignmentId}&reportType=assignments#Progress`);
465
+ };
460
466
  (0, _react.useEffect)(() => {
461
467
  const handleHashChange = () => {
462
468
  if (window.location.hash === "#Settings" && tabs) {
@@ -874,6 +880,7 @@ function Classroom({
874
880
  TabContent: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
875
881
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_AssignmentCardsList.default, {
876
882
  t: t,
883
+ handleViewProgress: handleViewProgress,
877
884
  isCreator: isCreator,
878
885
  assignments: assignments,
879
886
  courses: courses,
@@ -811,11 +811,11 @@ function ProgressTable({
811
811
  featureFlags,
812
812
  reportType
813
813
  }) {
814
- const selectedAssignmentTopics = selectedAssignment?.exercises?.map(e => e.courseSectionTopicId);
814
+ const selectedAssignmentTopics = (selectedAssignment?.exercises || [])?.map(e => e.courseSectionTopicId);
815
815
  const assignmentTopics = courses.flatMap(c => c.sections.flatMap(s => s.topics)).filter(t => selectedAssignmentTopics?.includes(`${t.courseSectionId}|${t.topicId}`));
816
816
  const topics = reportType === "exercises" && selectedCourse && selectedSection ? selectedCourse.sections[selectedCourse.sections.findIndex(s => s.sectionId === selectedSection.sectionId)].topics : [];
817
817
  const tableTopics = reportType === "assignments" ? assignmentTopics : topics;
818
- const assignmentExercises = reportType === "assignments" && selectedTopic ? selectedAssignment?.exercises.filter(e => e.courseSectionTopicId === `${selectedTopic.courseSectionId}|${selectedTopic.topicId}`) : [];
818
+ const assignmentExercises = reportType === "assignments" && selectedTopic ? (selectedAssignment?.exercises || []).filter(e => e.courseSectionTopicId === `${selectedTopic.courseSectionId}|${selectedTopic.topicId}`) : [];
819
819
  const exercises = ["translation", "listening", "pronunciation"];
820
820
  const tableExercises = assignmentExercises && assignmentExercises.length ? exercises.filter(e => assignmentExercises.some(ae => ae.name === e)) : exercises;
821
821
  const tableRoleplays = assignmentExercises && assignmentExercises.length ? roleplays.filter(r => assignmentExercises.some(ae => ae.roleplayId === r.roleplayId)) : roleplays;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nualang/nualang-ui-components",
3
- "version": "0.1.1233",
3
+ "version": "0.1.1234",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist",