touchstudy-core 0.1.91 → 0.1.93

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.
@@ -74,8 +74,11 @@ export declare type ExamResult = {
74
74
  totalStudent: number;
75
75
  totalTime: any;
76
76
  type: string;
77
- courseId?: number;
78
- courseName?: string;
77
+ courses?: CourtInfo[];
78
+ };
79
+ export declare type CourtInfo = {
80
+ id: number;
81
+ name: string;
79
82
  };
80
83
  export declare type EffectSize = {
81
84
  id: number;
package/dist/index.js CHANGED
@@ -2251,6 +2251,7 @@ var weekly_day = "주간";
2251
2251
  var weekly_days = "주간";
2252
2252
  var enter_class_name = "수업 이름을 입력하세요";
2253
2253
  var class_required = "수업 이름은 필수 항목입니다";
2254
+ var class_name_must_be_at_least_N_characters = "클래스 이름은 {{length}}자 이상이어야 합니다";
2254
2255
  var total_teachers = "총 교사 수";
2255
2256
  var start_date_required = "시작일은 필수 항목입니다";
2256
2257
  var end_date_required = "종료일은 필수 항목입니다";
@@ -2488,6 +2489,7 @@ var manage_textbooks = "교과서 관리";
2488
2489
  var my_question = "내 질문";
2489
2490
  var update_class = "수업 업데이트";
2490
2491
  var create_class = "수업 만들기";
2492
+ var view_class = "수업 보기";
2491
2493
  var problem_number = "문제 번호";
2492
2494
  var answer = "정답";
2493
2495
  var correct = "정답";
@@ -2658,6 +2660,7 @@ var update_exam_successfully = "시험을 성공적으로 업데이트했습니
2658
2660
  var create_exam_successfully = "시험을 성공적으로 만들었습니다.";
2659
2661
  var create_notification = "알림 생성";
2660
2662
  var update_notification = "업데이트 알림";
2663
+ var view_notification = "알림 보기";
2661
2664
  var new_notification = "새로운 알림";
2662
2665
  var are_you_sure_to_delete_notification = "알림을 삭제하시겠습니까:";
2663
2666
  var answer_list = "답변 목록";
@@ -3064,6 +3067,7 @@ var lang_ko = {
3064
3067
  weekly_days: weekly_days,
3065
3068
  enter_class_name: enter_class_name,
3066
3069
  class_required: class_required,
3070
+ class_name_must_be_at_least_N_characters: class_name_must_be_at_least_N_characters,
3067
3071
  total_teachers: total_teachers,
3068
3072
  start_date_required: start_date_required,
3069
3073
  end_date_required: end_date_required,
@@ -3287,6 +3291,7 @@ var lang_ko = {
3287
3291
  my_question: my_question,
3288
3292
  update_class: update_class,
3289
3293
  create_class: create_class,
3294
+ view_class: view_class,
3290
3295
  problem_number: problem_number,
3291
3296
  answer: answer,
3292
3297
  correct: correct,
@@ -3462,6 +3467,7 @@ var lang_ko = {
3462
3467
  create_exam_successfully: create_exam_successfully,
3463
3468
  create_notification: create_notification,
3464
3469
  update_notification: update_notification,
3470
+ view_notification: view_notification,
3465
3471
  new_notification: new_notification,
3466
3472
  are_you_sure_to_delete_notification: are_you_sure_to_delete_notification,
3467
3473
  answer_list: answer_list,
@@ -3868,6 +3874,7 @@ var weekly_day$1 = "Weekly day";
3868
3874
  var weekly_days$1 = "Weekly days";
3869
3875
  var enter_class_name$1 = "Enter class name";
3870
3876
  var class_required$1 = "Class name is required";
3877
+ var class_name_must_be_at_least_N_characters$1 = "Class name must be at least {{length}} characters";
3871
3878
  var total_teachers$1 = "Total teachers";
3872
3879
  var start_date_required$1 = "Start date is required";
3873
3880
  var end_date_required$1 = "End date is required";
@@ -4123,6 +4130,7 @@ var teachers$1 = "Teachers";
4123
4130
  var lessons$1 = "Lessons";
4124
4131
  var update_class$1 = "Update class";
4125
4132
  var create_class$1 = "Create class";
4133
+ var view_class$1 = "View class";
4126
4134
  var new_test$1 = "New Test";
4127
4135
  var manage_saved_exams$1 = "Manage saved exams";
4128
4136
  var manage_textbooks$1 = "Manage Textbooks";
@@ -4292,6 +4300,7 @@ var update_exam_successfully$1 = "Update exam successfully";
4292
4300
  var create_exam_successfully$1 = "Create exam successfully";
4293
4301
  var create_notification$1 = "Create Notification";
4294
4302
  var update_notification$1 = "Update Notification";
4303
+ var view_notification$1 = "View Notification";
4295
4304
  var new_notification$1 = "New Notification";
4296
4305
  var are_you_sure_to_delete_notification$1 = "Are you sure to delete notification:";
4297
4306
  var answer_list$1 = "Answer List";
@@ -4526,7 +4535,7 @@ var delete_action$1 = "Delete";
4526
4535
  var edit_action$1 = "Edit";
4527
4536
  var view_action$1 = "View";
4528
4537
  var de_select$1 = "Deselect";
4529
- var select_output$1 = "Select output";
4538
+ var select_output$1 = "Select";
4530
4539
  var print_pdf$1 = "Print PDF";
4531
4540
  var completed$1 = "Completed";
4532
4541
  var in_progress$1 = "In Progress";
@@ -4682,6 +4691,7 @@ var lang_en = {
4682
4691
  weekly_days: weekly_days$1,
4683
4692
  enter_class_name: enter_class_name$1,
4684
4693
  class_required: class_required$1,
4694
+ class_name_must_be_at_least_N_characters: class_name_must_be_at_least_N_characters$1,
4685
4695
  total_teachers: total_teachers$1,
4686
4696
  start_date_required: start_date_required$1,
4687
4697
  end_date_required: end_date_required$1,
@@ -4923,6 +4933,7 @@ var lang_en = {
4923
4933
  lessons: lessons$1,
4924
4934
  update_class: update_class$1,
4925
4935
  create_class: create_class$1,
4936
+ view_class: view_class$1,
4926
4937
  new_test: new_test$1,
4927
4938
  manage_saved_exams: manage_saved_exams$1,
4928
4939
  manage_textbooks: manage_textbooks$1,
@@ -5097,6 +5108,7 @@ var lang_en = {
5097
5108
  create_exam_successfully: create_exam_successfully$1,
5098
5109
  create_notification: create_notification$1,
5099
5110
  update_notification: update_notification$1,
5111
+ view_notification: view_notification$1,
5100
5112
  new_notification: new_notification$1,
5101
5113
  are_you_sure_to_delete_notification: are_you_sure_to_delete_notification$1,
5102
5114
  answer_list: answer_list$1,
@@ -6066,6 +6078,7 @@ var ContentTooltip = function ContentTooltip(_ref) {
6066
6078
  style: {
6067
6079
  padding: "12px 35px"
6068
6080
  },
6081
+ className: "pointer",
6069
6082
  onClick: toggleUpdateDialog
6070
6083
  }, React__default.createElement(material.Typography, {
6071
6084
  sx: {
@@ -6081,6 +6094,7 @@ var ContentTooltip = function ContentTooltip(_ref) {
6081
6094
  style: {
6082
6095
  padding: "12px 35px"
6083
6096
  },
6097
+ className: "pointer",
6084
6098
  onClick: toggleConfirmDialog
6085
6099
  }, React__default.createElement(material.Typography, {
6086
6100
  sx: {
@@ -15315,6 +15329,7 @@ var studentNameStyle = {
15315
15329
  lineHeight: 1
15316
15330
  };
15317
15331
  var PrintExamResult = function PrintExamResult(_ref) {
15332
+ var _resultData$courses;
15318
15333
  var resultData = _ref.resultData,
15319
15334
  examTime = _ref.examTime,
15320
15335
  status = _ref.status,
@@ -15333,6 +15348,9 @@ var PrintExamResult = function PrintExamResult(_ref) {
15333
15348
  var _state$common;
15334
15349
  return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.academy;
15335
15350
  });
15351
+ var courses = resultData === null || resultData === void 0 ? void 0 : (_resultData$courses = resultData.courses) === null || _resultData$courses === void 0 ? void 0 : _resultData$courses.map(function (c) {
15352
+ return c.name;
15353
+ }).join(', ');
15336
15354
  return React__default.createElement(material.Box, {
15337
15355
  sx: {
15338
15356
  minWidth: "768px",
@@ -15371,9 +15389,9 @@ var PrintExamResult = function PrintExamResult(_ref) {
15371
15389
  sx: _extends({}, studentNameStyle, {
15372
15390
  textAlign: "end"
15373
15391
  })
15374
- }, academy.name)), resultData.courseName && React__default.createElement(material.Stack, null, React__default.createElement(material.Typography, {
15392
+ }, academy.name)), courses && React__default.createElement(material.Stack, null, React__default.createElement(material.Typography, {
15375
15393
  sx: courseNameStyle
15376
- }, resultData.courseName)), React__default.createElement(material.Box, {
15394
+ }, courses)), React__default.createElement(material.Box, {
15377
15395
  display: "flex",
15378
15396
  gap: "16px",
15379
15397
  flexDirection: "column"
@@ -15522,6 +15540,7 @@ var PrintExamResult = function PrintExamResult(_ref) {
15522
15540
  };
15523
15541
 
15524
15542
  var ExamResultV2 = function ExamResultV2(_ref) {
15543
+ var _resultData$courses;
15525
15544
  var searchParams = _ref.searchParams,
15526
15545
  history = _ref.history,
15527
15546
  _ref$examSessionId = _ref.examSessionId,
@@ -15572,6 +15591,9 @@ var ExamResultV2 = function ExamResultV2(_ref) {
15572
15591
  handlePrintPdf = _usePrintExamResult.handlePrintPdf,
15573
15592
  setRenderedChart = _usePrintExamResult.setRenderedChart;
15574
15593
  var isTabletUp = material.useMediaQuery('(min-width:900px)');
15594
+ var courses = resultData === null || resultData === void 0 ? void 0 : (_resultData$courses = resultData.courses) === null || _resultData$courses === void 0 ? void 0 : _resultData$courses.map(function (c) {
15595
+ return c.name;
15596
+ }).join(', ');
15575
15597
  return React__default.createElement(React.Fragment, null, React__default.createElement(LoadingComponent, {
15576
15598
  isLoading: !!isLoading
15577
15599
  }), timelyOrderQuestions[dataChartIndex] && longTimeSpend && resultData && effectSize ? React__default.createElement("div", {
@@ -15583,13 +15605,13 @@ var ExamResultV2 = function ExamResultV2(_ref) {
15583
15605
  padding: "24px"
15584
15606
  }, React__default.createElement(material.Grid, {
15585
15607
  item: true
15586
- }, resultData.courseName && React__default.createElement(material.Stack, null, React__default.createElement(material.Typography, {
15608
+ }, courses && React__default.createElement(material.Stack, null, React__default.createElement(material.Typography, {
15587
15609
  sx: {
15588
15610
  fontSize: "14px",
15589
15611
  fontWeight: 600,
15590
15612
  color: styles.less_dark
15591
15613
  }
15592
- }, resultData.courseName)), React__default.createElement(material.Box, {
15614
+ }, courses)), React__default.createElement(material.Box, {
15593
15615
  display: "flex",
15594
15616
  gap: "16px",
15595
15617
  flexDirection: "column"
@@ -17775,7 +17797,9 @@ var DEFAULT_LESSON_REQUEST = {
17775
17797
  };
17776
17798
  var ClassSchema = function ClassSchema(t) {
17777
17799
  return yup.object({
17778
- name: yup.string().required(t("class_required")),
17800
+ name: yup.string().required(t("class_required")).trim().min(2, t("class_name_must_be_at_least_N_characters", {
17801
+ length: 2
17802
+ })),
17779
17803
  startDate: yup.date().required(t("start_date_required")),
17780
17804
  endDate: yup.date().required(t("end_date_required")),
17781
17805
  mainTeacherId: yup.number().required(t("main_teacher_required")),
@@ -20349,7 +20373,7 @@ var ClassDetail = function ClassDetail(_ref) {
20349
20373
  pt: !!id ? "12px" : "0px"
20350
20374
  }, React__default.createElement(material.Typography, {
20351
20375
  variant: "h4"
20352
- }, t(!id ? "create_class" : "update_class"))), React__default.createElement(formik.Formik, {
20376
+ }, t(!id ? "create_class" : isAdmin ? "update_class" : "view_class"))), React__default.createElement(formik.Formik, {
20353
20377
  initialValues: DEFAULT_CLASS_REQUEST,
20354
20378
  validationSchema: schema,
20355
20379
  onSubmit: handleSubmit
@@ -22265,7 +22289,7 @@ var NotificationDetail = function NotificationDetail(_ref) {
22265
22289
  mb: 2
22266
22290
  }, React__default.createElement(material.Typography, {
22267
22291
  variant: "h4"
22268
- }, t(!id ? "create_notification" : "update_notification"))), React__default.createElement(formik.Formik, {
22292
+ }, t(!id ? "create_notification" : !isAdmin && (!(detailNotification !== null && detailNotification !== void 0 && detailNotification.isOwned) || isTeacherAdmin) ? "view_notification" : "update_notification"))), React__default.createElement(formik.Formik, {
22269
22293
  initialValues: DEFAULT_NOTIFICATION_REQUEST,
22270
22294
  validationSchema: schema,
22271
22295
  onSubmit: handleSubmit
@@ -22559,11 +22583,13 @@ var NotificationList = function NotificationList(_ref) {
22559
22583
  className: "d-flex"
22560
22584
  }, React__default.createElement(material.IconButton, {
22561
22585
  color: "default",
22562
- className: "bg-warning text-white me-1",
22586
+ className: "bg-" + (!isAdmin && (isTeacherAdmin || !i.isOwned) ? "primary" : "warning") + " text-white me-1",
22563
22587
  onClick: function onClick() {
22564
22588
  return handleUpdateNotification(i);
22565
22589
  }
22566
- }, React__default.createElement(hi.HiOutlinePencilAlt, {
22590
+ }, !isAdmin && (isTeacherAdmin || !i.isOwned) ? React__default.createElement(fa.FaEye, {
22591
+ size: 12
22592
+ }) : React__default.createElement(hi.HiOutlinePencilAlt, {
22567
22593
  size: 12
22568
22594
  })), React__default.createElement(material.IconButton, {
22569
22595
  color: "error",