touchstudy-core 0.1.176 → 0.1.177
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/containers/Classes/components/TeacherSelector.d.ts +1 -1
- package/dist/containers/Classes/configs/types.d.ts +4 -0
- package/dist/containers/Notes/components/NoteItemList.d.ts +1 -0
- package/dist/containers/Notes/views/NoteList.d.ts +1 -0
- package/dist/containers/Notes/views/NoteTabs.d.ts +1 -0
- package/dist/containers/PreparedTextbook/components/PreparedTextbookForm.d.ts +1 -3
- package/dist/containers/PreparedTextbook/configs/constants.d.ts +0 -2
- package/dist/containers/PreparedTextbook/configs/enums.d.ts +0 -5
- package/dist/containers/PreparedTextbook/hooks/useTextbookManagement.d.ts +1 -2
- package/dist/index.css +0 -13
- package/dist/index.js +124 -823
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +127 -826
- package/dist/index.modern.js.map +1 -1
- package/dist/layouts/Header.d.ts +1 -1
- package/dist/services/subjectService.d.ts +0 -4
- package/dist/theme/palette.d.ts +0 -1
- package/dist/utils/enums/index.d.ts +0 -1
- package/dist/utils/functions/times.d.ts +0 -1
- package/dist/utils/types/index.d.ts +0 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -70,7 +70,6 @@ var reactHookForm = require('react-hook-form');
|
|
70
70
|
var yup$1 = require('@hookform/resolvers/yup');
|
71
71
|
var pi = require('react-icons/pi');
|
72
72
|
var Container = _interopDefault(require('@mui/material/Container'));
|
73
|
-
var ai = require('react-icons/ai');
|
74
73
|
var bs = require('react-icons/bs');
|
75
74
|
var Popover = _interopDefault(require('@mui/material/Popover'));
|
76
75
|
var MenuItem = _interopDefault(require('@mui/material/MenuItem'));
|
@@ -537,7 +536,6 @@ var teacher_in_charge = "담당 교사";
|
|
537
536
|
var counselor = "상담교사";
|
538
537
|
var new_question = "새로운 질문";
|
539
538
|
var hour = "시간";
|
540
|
-
var hour_h = "시간";
|
541
539
|
var minute = "분";
|
542
540
|
var second = "두번째";
|
543
541
|
var question_order = "{{number}} 번";
|
@@ -1031,7 +1029,6 @@ var teacher_required = "선생님은 필수입니다";
|
|
1031
1029
|
var total_users = "총 사용자";
|
1032
1030
|
var added_date = "추가된 날짜";
|
1033
1031
|
var sync_exam_results = "시험 결과 동기화";
|
1034
|
-
var sync_textbook_results = "교재 결과 동기화";
|
1035
1032
|
var update_data_fail = "데이터 업데이트 실패";
|
1036
1033
|
var add_students_to_class = "수업에 학생 추가";
|
1037
1034
|
var add_teachers_to_class = "수업에 교사 추가";
|
@@ -1042,13 +1039,9 @@ var question_management = "질문 관리";
|
|
1042
1039
|
var student_data = "학생 데이터";
|
1043
1040
|
var problem_number_question_chart = "문제 {{number}}번";
|
1044
1041
|
var are_you_sure_to_sync_exam_results_to_academy = "시험 결과를 아카데미 {{ academyName }}에 동기화하시겠습니까(백그라운드에서 실행되며 시간이 다소 소요됨)";
|
1045
|
-
var are_you_sure_to_sync_textbook_results_to_academy = "교재 학습 결과를 아카데미 {{ academyName }}에 동기화하시겠습니까? (백그라운드에서 실행되며 시간이 다소 소요됨)";
|
1046
1042
|
var messages = {
|
1047
|
-
exam_sessions_are_being_synchronized: "{{ total }} 개의 시험 세션이 동기화되고 있습니다"
|
1048
|
-
textbook_sessions_are_being_synchronized: "{{ total }} 개의 교재 학습 세션이 동기화되고 있습니다"
|
1043
|
+
exam_sessions_are_being_synchronized: "{{ total }} 개의 시험 세션이 동기화되고 있습니다"
|
1049
1044
|
};
|
1050
|
-
var sync_exam = "시험 동기화";
|
1051
|
-
var sync_textbook = "교재 동기화";
|
1052
1045
|
var submit = "제출하다";
|
1053
1046
|
var must_select_a_teacher_first = "먼저 교사를 선택해야 합니다";
|
1054
1047
|
var student_grade_is_invalid = "학생 등급은 1에서 12 사이여야 합니다";
|
@@ -1112,7 +1105,6 @@ var academy_invite_detail = "아카데미 초대 세부정보";
|
|
1112
1105
|
var are_you_sure_to_delete_academy_invite = "이 아카데미 초대를 삭제하시겠습니까?";
|
1113
1106
|
var day = "낮";
|
1114
1107
|
var days = "날";
|
1115
|
-
var month = "월";
|
1116
1108
|
var emails = "이메일";
|
1117
1109
|
var is_accepted = "승인됨";
|
1118
1110
|
var re_send = "다시 보내기";
|
@@ -1496,8 +1488,6 @@ var order_matters = "순서 상관 있음";
|
|
1496
1488
|
var order_does_not_matter = "순서 상관 없음";
|
1497
1489
|
var synonym_processing = "답 이음동의어 처리";
|
1498
1490
|
var compare_type = "비교 유형";
|
1499
|
-
var all_changes_saved = "모든 변경 사항이 저장되었습니다";
|
1500
|
-
var saving = "절약";
|
1501
1491
|
var textbook_name = "교재 이름";
|
1502
1492
|
var korean_language = "국어";
|
1503
1493
|
var answer_cannot_be_empty = "답변은 비워둘 수 없습니다";
|
@@ -1544,13 +1534,6 @@ var admin_to_teachers = "관리자에서 교사들에게";
|
|
1544
1534
|
var teacher_to_teachers = "교사에서 교사들에게";
|
1545
1535
|
var student_required = "학생은 필수입니다";
|
1546
1536
|
var teachers_required = "교사가 필요합니다";
|
1547
|
-
var all_changes_are_not_saved_yet = "아직 모든 변경 사항이 저장되지 않았습니다";
|
1548
|
-
var pause = "일시정지";
|
1549
|
-
var press_to_start = "눌러서 시작하기";
|
1550
|
-
var study_timer = "순공 타이머";
|
1551
|
-
var show_timer = "타이머 표시";
|
1552
|
-
var failed_to_pause_the_subject_name = "과목 '{{name}}'를 일시 중지하는 데 실패했습니다";
|
1553
|
-
var failed_to_start_the_subject_name = "과목 '{{name}}'를 시작하는 데 실패했습니다";
|
1554
1537
|
var lang_ko = {
|
1555
1538
|
problem_solving: problem_solving,
|
1556
1539
|
my_story: my_story,
|
@@ -1742,7 +1725,6 @@ var lang_ko = {
|
|
1742
1725
|
counselor: counselor,
|
1743
1726
|
new_question: new_question,
|
1744
1727
|
hour: hour,
|
1745
|
-
hour_h: hour_h,
|
1746
1728
|
minute: minute,
|
1747
1729
|
second: second,
|
1748
1730
|
question_order: question_order,
|
@@ -2231,7 +2213,6 @@ var lang_ko = {
|
|
2231
2213
|
total_users: total_users,
|
2232
2214
|
added_date: added_date,
|
2233
2215
|
sync_exam_results: sync_exam_results,
|
2234
|
-
sync_textbook_results: sync_textbook_results,
|
2235
2216
|
update_data_fail: update_data_fail,
|
2236
2217
|
add_students_to_class: add_students_to_class,
|
2237
2218
|
add_teachers_to_class: add_teachers_to_class,
|
@@ -2242,10 +2223,7 @@ var lang_ko = {
|
|
2242
2223
|
student_data: student_data,
|
2243
2224
|
problem_number_question_chart: problem_number_question_chart,
|
2244
2225
|
are_you_sure_to_sync_exam_results_to_academy: are_you_sure_to_sync_exam_results_to_academy,
|
2245
|
-
are_you_sure_to_sync_textbook_results_to_academy: are_you_sure_to_sync_textbook_results_to_academy,
|
2246
2226
|
messages: messages,
|
2247
|
-
sync_exam: sync_exam,
|
2248
|
-
sync_textbook: sync_textbook,
|
2249
2227
|
submit: submit,
|
2250
2228
|
must_select_a_teacher_first: must_select_a_teacher_first,
|
2251
2229
|
student_grade_is_invalid: student_grade_is_invalid,
|
@@ -2309,7 +2287,6 @@ var lang_ko = {
|
|
2309
2287
|
are_you_sure_to_delete_academy_invite: are_you_sure_to_delete_academy_invite,
|
2310
2288
|
day: day,
|
2311
2289
|
days: days,
|
2312
|
-
month: month,
|
2313
2290
|
emails: emails,
|
2314
2291
|
is_accepted: is_accepted,
|
2315
2292
|
re_send: re_send,
|
@@ -2681,8 +2658,6 @@ var lang_ko = {
|
|
2681
2658
|
order_does_not_matter: order_does_not_matter,
|
2682
2659
|
synonym_processing: synonym_processing,
|
2683
2660
|
compare_type: compare_type,
|
2684
|
-
all_changes_saved: all_changes_saved,
|
2685
|
-
saving: saving,
|
2686
2661
|
textbook_name: textbook_name,
|
2687
2662
|
korean_language: korean_language,
|
2688
2663
|
answer_cannot_be_empty: answer_cannot_be_empty,
|
@@ -2728,14 +2703,7 @@ var lang_ko = {
|
|
2728
2703
|
admin_to_teachers: admin_to_teachers,
|
2729
2704
|
teacher_to_teachers: teacher_to_teachers,
|
2730
2705
|
student_required: student_required,
|
2731
|
-
teachers_required: teachers_required
|
2732
|
-
all_changes_are_not_saved_yet: all_changes_are_not_saved_yet,
|
2733
|
-
pause: pause,
|
2734
|
-
press_to_start: press_to_start,
|
2735
|
-
study_timer: study_timer,
|
2736
|
-
show_timer: show_timer,
|
2737
|
-
failed_to_pause_the_subject_name: failed_to_pause_the_subject_name,
|
2738
|
-
failed_to_start_the_subject_name: failed_to_start_the_subject_name
|
2706
|
+
teachers_required: teachers_required
|
2739
2707
|
};
|
2740
2708
|
|
2741
2709
|
var problem_solving$1 = "Problem Solving";
|
@@ -2954,7 +2922,6 @@ var counselor$1 = "Counselor";
|
|
2954
2922
|
var new_question$1 = "New Question";
|
2955
2923
|
var hour$1 = "hr";
|
2956
2924
|
var hours = "hrs";
|
2957
|
-
var hour_h$1 = "h";
|
2958
2925
|
var minute$1 = "min";
|
2959
2926
|
var second$1 = "second";
|
2960
2927
|
var question_order$1 = "Number {{number}}";
|
@@ -3423,7 +3390,6 @@ var teacher_required$1 = "Teacher is required";
|
|
3423
3390
|
var total_users$1 = "Total users";
|
3424
3391
|
var added_date$1 = "Added date";
|
3425
3392
|
var sync_exam_results$1 = "Sync exam results";
|
3426
|
-
var sync_textbook_results$1 = "Sync textbook results";
|
3427
3393
|
var update_data_fail$1 = "Update data fail";
|
3428
3394
|
var add_students_to_class$1 = "Add students to class";
|
3429
3395
|
var add_teachers_to_class$1 = "Add teachers to class";
|
@@ -3434,13 +3400,9 @@ var question_management$1 = "Question Management";
|
|
3434
3400
|
var student_data$1 = "Student Data";
|
3435
3401
|
var problem_number_question_chart$1 = "Q. {{number}}";
|
3436
3402
|
var are_you_sure_to_sync_exam_results_to_academy$1 = "Are you sure to sync exam results to academy \"{{ academyName }}\" (it will run in the background and take a while)";
|
3437
|
-
var are_you_sure_to_sync_textbook_results_to_academy$1 = "Are you sure to sync textbook results to academy \"{{ academyName }}\" (it will run in the background and take a while)";
|
3438
3403
|
var messages$1 = {
|
3439
|
-
exam_sessions_are_being_synchronized: "{{ total }} exam sessions are being synchronized"
|
3440
|
-
textbook_sessions_are_being_synchronized: "{{ total }} textbook sessions are being synchronized"
|
3404
|
+
exam_sessions_are_being_synchronized: "{{ total }} exam sessions are being synchronized"
|
3441
3405
|
};
|
3442
|
-
var sync_exam$1 = "Sync Exam";
|
3443
|
-
var sync_textbook$1 = "Sync Textbook";
|
3444
3406
|
var submit$1 = "Submit";
|
3445
3407
|
var must_select_a_teacher_first$1 = "Must select a teacher first";
|
3446
3408
|
var student_grade_is_invalid$1 = "Student grade must be from 1 to 12";
|
@@ -3504,7 +3466,6 @@ var academy_invite_detail$1 = "Academy Invite Detail";
|
|
3504
3466
|
var are_you_sure_to_delete_academy_invite$1 = "Are you sure to delete this academy invite?";
|
3505
3467
|
var day$1 = "day";
|
3506
3468
|
var days$1 = "days";
|
3507
|
-
var month$1 = "month";
|
3508
3469
|
var emails$1 = "Emails";
|
3509
3470
|
var is_accepted$1 = "Is Accepted";
|
3510
3471
|
var re_send$1 = "Resend";
|
@@ -3889,8 +3850,6 @@ var order_matters$1 = "Order matters";
|
|
3889
3850
|
var order_does_not_matter$1 = "Order doesn't matter";
|
3890
3851
|
var synonym_processing$1 = "Answer Synonym processing";
|
3891
3852
|
var compare_type$1 = "Compare Type";
|
3892
|
-
var all_changes_saved$1 = "All changes saved";
|
3893
|
-
var saving$1 = "Saving";
|
3894
3853
|
var textbook_name$1 = "Textbook name";
|
3895
3854
|
var korean_language$1 = "Korean";
|
3896
3855
|
var answer_cannot_be_empty$1 = "Answer cannot be empty";
|
@@ -3937,13 +3896,6 @@ var admin_to_teachers$1 = "Admin to teachers";
|
|
3937
3896
|
var teacher_to_teachers$1 = "Teacher to teachers";
|
3938
3897
|
var student_required$1 = "Student is required";
|
3939
3898
|
var teachers_required$1 = "Teachers are required";
|
3940
|
-
var all_changes_are_not_saved_yet$1 = "All changes are not saved yet";
|
3941
|
-
var pause$1 = "Pause";
|
3942
|
-
var press_to_start$1 = "Press to start";
|
3943
|
-
var study_timer$1 = "Focused Study Timer";
|
3944
|
-
var show_timer$1 = "Show timer";
|
3945
|
-
var failed_to_pause_the_subject_name$1 = "Failed to pause the subject '{{name}}'";
|
3946
|
-
var failed_to_start_the_subject_name$1 = "Failed to start the subject '{{name}}'";
|
3947
3899
|
var lang_en = {
|
3948
3900
|
problem_solving: problem_solving$1,
|
3949
3901
|
my_story: my_story$1,
|
@@ -4161,7 +4113,6 @@ var lang_en = {
|
|
4161
4113
|
new_question: new_question$1,
|
4162
4114
|
hour: hour$1,
|
4163
4115
|
hours: hours,
|
4164
|
-
hour_h: hour_h$1,
|
4165
4116
|
minute: minute$1,
|
4166
4117
|
second: second$1,
|
4167
4118
|
question_order: question_order$1,
|
@@ -4625,7 +4576,6 @@ var lang_en = {
|
|
4625
4576
|
total_users: total_users$1,
|
4626
4577
|
added_date: added_date$1,
|
4627
4578
|
sync_exam_results: sync_exam_results$1,
|
4628
|
-
sync_textbook_results: sync_textbook_results$1,
|
4629
4579
|
update_data_fail: update_data_fail$1,
|
4630
4580
|
add_students_to_class: add_students_to_class$1,
|
4631
4581
|
add_teachers_to_class: add_teachers_to_class$1,
|
@@ -4636,10 +4586,7 @@ var lang_en = {
|
|
4636
4586
|
student_data: student_data$1,
|
4637
4587
|
problem_number_question_chart: problem_number_question_chart$1,
|
4638
4588
|
are_you_sure_to_sync_exam_results_to_academy: are_you_sure_to_sync_exam_results_to_academy$1,
|
4639
|
-
are_you_sure_to_sync_textbook_results_to_academy: are_you_sure_to_sync_textbook_results_to_academy$1,
|
4640
4589
|
messages: messages$1,
|
4641
|
-
sync_exam: sync_exam$1,
|
4642
|
-
sync_textbook: sync_textbook$1,
|
4643
4590
|
submit: submit$1,
|
4644
4591
|
must_select_a_teacher_first: must_select_a_teacher_first$1,
|
4645
4592
|
student_grade_is_invalid: student_grade_is_invalid$1,
|
@@ -4703,7 +4650,6 @@ var lang_en = {
|
|
4703
4650
|
are_you_sure_to_delete_academy_invite: are_you_sure_to_delete_academy_invite$1,
|
4704
4651
|
day: day$1,
|
4705
4652
|
days: days$1,
|
4706
|
-
month: month$1,
|
4707
4653
|
emails: emails$1,
|
4708
4654
|
is_accepted: is_accepted$1,
|
4709
4655
|
re_send: re_send$1,
|
@@ -5076,8 +5022,6 @@ var lang_en = {
|
|
5076
5022
|
order_does_not_matter: order_does_not_matter$1,
|
5077
5023
|
synonym_processing: synonym_processing$1,
|
5078
5024
|
compare_type: compare_type$1,
|
5079
|
-
all_changes_saved: all_changes_saved$1,
|
5080
|
-
saving: saving$1,
|
5081
5025
|
textbook_name: textbook_name$1,
|
5082
5026
|
korean_language: korean_language$1,
|
5083
5027
|
answer_cannot_be_empty: answer_cannot_be_empty$1,
|
@@ -5123,14 +5067,7 @@ var lang_en = {
|
|
5123
5067
|
admin_to_teachers: admin_to_teachers$1,
|
5124
5068
|
teacher_to_teachers: teacher_to_teachers$1,
|
5125
5069
|
student_required: student_required$1,
|
5126
|
-
teachers_required: teachers_required$1
|
5127
|
-
all_changes_are_not_saved_yet: all_changes_are_not_saved_yet$1,
|
5128
|
-
pause: pause$1,
|
5129
|
-
press_to_start: press_to_start$1,
|
5130
|
-
study_timer: study_timer$1,
|
5131
|
-
show_timer: show_timer$1,
|
5132
|
-
failed_to_pause_the_subject_name: failed_to_pause_the_subject_name$1,
|
5133
|
-
failed_to_start_the_subject_name: failed_to_start_the_subject_name$1
|
5070
|
+
teachers_required: teachers_required$1
|
5134
5071
|
};
|
5135
5072
|
|
5136
5073
|
i18n__default.use(reactI18next.initReactI18next).init({
|
@@ -5586,7 +5523,7 @@ var PrintExamView2 = function PrintExamView2(_ref) {
|
|
5586
5523
|
}, t("print_pdf"))));
|
5587
5524
|
};
|
5588
5525
|
|
5589
|
-
var styles = {"lighter":"#F0FFF6","light":"#89F0B2","less_dark":"#3DC674","dark":"#349056","darker":"#18442A","gray_50":"#FBFBF9","gray_100":"#EAEAE5","gray_300":"#D0D0C8","gray_500":"#9A9A98","gray_700":"#5D5D5B","gray_900":"#363634","red_900":"#DB4D4D","green_support_900":"#3ACB46","yellow_900":"#FEAF06","purple_900":"#C3099A","btn-login-google":"_2HqmH","math-jax":"_3Pfdk","block-login":"_wWIyO","box-login":"_38Lo1","btn-primary":"_rd4Uy","dropdown-menu":"_1krbH","header-avatar":"_RQaHE","dropdown-menu-flag":"_XK8oS","dropdown-content":"_3ys4W","dropdown-change":"_ToOW_","item-address":"_3sQlR","item-logout":"_3bqSM","title-address":"_1jgSI","img-avatar":"_35Ttz","item-contact":"_1wc7o","content-text":"_3S4f2","dropdown-content-language":"_3ajui","dropdown-item-language":"_3Y_y4","dropdown-item-language-active":"_CzNMi","dropdown-academy":"_3CMVp","image-academy":"_2ibYC","academy-btn":"_1JMRU","switch-icon":"_N4FNf","dropdown-content-academy":"_31Dr0","dropdown-academy-item":"_3bjcz","noGutters":"_31ZQk","custom-col-2":"_3yXyK","custom-col-3":"_1RsJQ","custom-col-5":"_L42CP","custom-col-10":"_2u6eL","custom-row":"_8x7OP","custom-col":"_1JmTh","custom-col-4":"_3HO1e","custom-col-8":"_Oy31M","custom-col-12":"_3aUKo","custom-container":"_39LRs","form-label":"__Ut-u","form-control":"_2k4dX","btn-outline-primary":"_2PWdX","sort-icons":"_mQvLF","active":"_3oAH-","form-select":"_3W3aw","truncate":"_3NJzN","headers":"_3xnI5","logo-container":"_3YG70","tabBox":"_1CQPn","routerBox":"_3hx2T","tabText":"_3UyhW","router-link-active":"_1TGKA","router-link":"_1AqMh","userImg":"_2RI6G","disabled-link":"_3aVHg","line-clamp":"_3fpky"
|
5526
|
+
var styles = {"lighter":"#F0FFF6","light":"#89F0B2","less_dark":"#3DC674","dark":"#349056","darker":"#18442A","gray_50":"#FBFBF9","gray_100":"#EAEAE5","gray_300":"#D0D0C8","gray_500":"#9A9A98","gray_700":"#5D5D5B","gray_900":"#363634","red_900":"#DB4D4D","green_support_900":"#3ACB46","yellow_900":"#FEAF06","purple_900":"#C3099A","btn-login-google":"_2HqmH","math-jax":"_3Pfdk","block-login":"_wWIyO","box-login":"_38Lo1","btn-primary":"_rd4Uy","dropdown-menu":"_1krbH","header-avatar":"_RQaHE","dropdown-menu-flag":"_XK8oS","dropdown-content":"_3ys4W","dropdown-change":"_ToOW_","item-address":"_3sQlR","item-logout":"_3bqSM","title-address":"_1jgSI","img-avatar":"_35Ttz","item-contact":"_1wc7o","content-text":"_3S4f2","dropdown-content-language":"_3ajui","dropdown-item-language":"_3Y_y4","dropdown-item-language-active":"_CzNMi","dropdown-academy":"_3CMVp","image-academy":"_2ibYC","academy-btn":"_1JMRU","switch-icon":"_N4FNf","dropdown-content-academy":"_31Dr0","dropdown-academy-item":"_3bjcz","noGutters":"_31ZQk","custom-col-2":"_3yXyK","custom-col-3":"_1RsJQ","custom-col-5":"_L42CP","custom-col-10":"_2u6eL","custom-row":"_8x7OP","custom-col":"_1JmTh","custom-col-4":"_3HO1e","custom-col-8":"_Oy31M","custom-col-12":"_3aUKo","custom-container":"_39LRs","form-label":"__Ut-u","form-control":"_2k4dX","btn-outline-primary":"_2PWdX","sort-icons":"_mQvLF","active":"_3oAH-","form-select":"_3W3aw","truncate":"_3NJzN","headers":"_3xnI5","logo-container":"_3YG70","tabBox":"_1CQPn","routerBox":"_3hx2T","tabText":"_3UyhW","router-link-active":"_1TGKA","router-link":"_1AqMh","userImg":"_2RI6G","disabled-link":"_3aVHg","line-clamp":"_3fpky"};
|
5590
5527
|
|
5591
5528
|
var config = {
|
5592
5529
|
loader: {
|
@@ -6056,6 +5993,7 @@ var customStyles = {
|
|
6056
5993
|
|
6057
5994
|
var _excluded = ["isDefault", "defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
|
6058
5995
|
var CustomAsyncSelect = function CustomAsyncSelect(_ref) {
|
5996
|
+
var _value$;
|
6059
5997
|
var isDefault = _ref.isDefault,
|
6060
5998
|
options = _ref.options,
|
6061
5999
|
isDisabled = _ref.isDisabled,
|
@@ -6063,7 +6001,8 @@ var CustomAsyncSelect = function CustomAsyncSelect(_ref) {
|
|
6063
6001
|
value = _ref.value,
|
6064
6002
|
isMulti = _ref.isMulti,
|
6065
6003
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
6066
|
-
var
|
6004
|
+
var isOptionValue = (value === null || value === void 0 ? void 0 : value.value) || (value === null || value === void 0 ? void 0 : (_value$ = value[0]) === null || _value$ === void 0 ? void 0 : _value$.value);
|
6005
|
+
var initialValues = isOptionValue ? value : Array.isArray(value) ? options.filter(function (i) {
|
6067
6006
|
return value.includes(i.value);
|
6068
6007
|
}) : isMulti ? options.filter(function (i) {
|
6069
6008
|
return i.value == value;
|
@@ -6326,12 +6265,6 @@ var HighSchoolGrade;
|
|
6326
6265
|
TextbookEditorType[TextbookEditorType["Korea"] = 1] = "Korea";
|
6327
6266
|
TextbookEditorType[TextbookEditorType["Math"] = 2] = "Math";
|
6328
6267
|
})(exports.TextbookEditorType || (exports.TextbookEditorType = {}));
|
6329
|
-
var PrintStatus;
|
6330
|
-
(function (PrintStatus) {
|
6331
|
-
PrintStatus[PrintStatus["Idle"] = 0] = "Idle";
|
6332
|
-
PrintStatus[PrintStatus["Saving"] = 1] = "Saving";
|
6333
|
-
PrintStatus[PrintStatus["Saved"] = 2] = "Saved";
|
6334
|
-
})(PrintStatus || (PrintStatus = {}));
|
6335
6268
|
|
6336
6269
|
(function (SchoolType) {
|
6337
6270
|
SchoolType[SchoolType["Default"] = 0] = "Default";
|
@@ -6340,12 +6273,6 @@ var PrintStatus;
|
|
6340
6273
|
SchoolType[SchoolType["High"] = 3] = "High";
|
6341
6274
|
})(exports.SchoolType || (exports.SchoolType = {}));
|
6342
6275
|
|
6343
|
-
(function (SubjectTimerStatus) {
|
6344
|
-
SubjectTimerStatus[SubjectTimerStatus["NotStarted"] = 0] = "NotStarted";
|
6345
|
-
SubjectTimerStatus[SubjectTimerStatus["Started"] = 1] = "Started";
|
6346
|
-
SubjectTimerStatus[SubjectTimerStatus["Paused"] = 2] = "Paused";
|
6347
|
-
})(exports.SubjectTimerStatus || (exports.SubjectTimerStatus = {}));
|
6348
|
-
|
6349
6276
|
var canAccess = function canAccess(userRoles, componentRoles) {
|
6350
6277
|
if (!Array.isArray(userRoles)) {
|
6351
6278
|
return false;
|
@@ -6595,11 +6522,6 @@ var getRemainTime = function getRemainTime(startTime, duration) {
|
|
6595
6522
|
if (timePass > durationInNumber) return 0;
|
6596
6523
|
return durationInNumber - timePass;
|
6597
6524
|
};
|
6598
|
-
var getCountTime = function getCountTime(startTime, duration) {
|
6599
|
-
var timePass = diffFromNow(startTime, "second");
|
6600
|
-
if (typeof timePass !== "number") return null;
|
6601
|
-
return duration + timePass;
|
6602
|
-
};
|
6603
6525
|
|
6604
6526
|
var formatDateTime = function formatDateTime(inputDate) {
|
6605
6527
|
var date = new Date(inputDate);
|
@@ -8324,27 +8246,6 @@ var getSubjectListApi = function getSubjectListApi(textSearch) {
|
|
8324
8246
|
return Promise.reject(e);
|
8325
8247
|
}
|
8326
8248
|
};
|
8327
|
-
var getStudentSubjectListApi = function getStudentSubjectListApi() {
|
8328
|
-
try {
|
8329
|
-
return Promise.resolve(api.get(SUBJECT_URL + "/timers"));
|
8330
|
-
} catch (e) {
|
8331
|
-
return Promise.reject(e);
|
8332
|
-
}
|
8333
|
-
};
|
8334
|
-
var startStudentSubjectTimerApi = function startStudentSubjectTimerApi(subjectId) {
|
8335
|
-
try {
|
8336
|
-
return Promise.resolve(api.post(SUBJECT_URL + "/" + subjectId + "/timers"));
|
8337
|
-
} catch (e) {
|
8338
|
-
return Promise.reject(e);
|
8339
|
-
}
|
8340
|
-
};
|
8341
|
-
var pauseStudentSubjectApi = function pauseStudentSubjectApi(subjectId, recordId, data) {
|
8342
|
-
try {
|
8343
|
-
return Promise.resolve(api.post(SUBJECT_URL + "/" + subjectId + "/timers/" + recordId, data));
|
8344
|
-
} catch (e) {
|
8345
|
-
return Promise.reject(e);
|
8346
|
-
}
|
8347
|
-
};
|
8348
8249
|
|
8349
8250
|
var SubjectSelector = function SubjectSelector(_ref) {
|
8350
8251
|
var value = _ref.value,
|
@@ -10414,7 +10315,6 @@ var grey = {
|
|
10414
10315
|
var green = {
|
10415
10316
|
0: '#FFFFFF',
|
10416
10317
|
100: '#F0FFF6',
|
10417
|
-
200: '#D2FFE4',
|
10418
10318
|
300: '#89F0B2',
|
10419
10319
|
500: '#3DC674',
|
10420
10320
|
700: '#349056',
|
@@ -13206,7 +13106,7 @@ var DefaultLessonFilter = {
|
|
13206
13106
|
};
|
13207
13107
|
var DefaultTeacherFilter = {
|
13208
13108
|
currentPage: 1,
|
13209
|
-
pageSize:
|
13109
|
+
pageSize: 100,
|
13210
13110
|
sortColumnDirection: OrderBy$1.DESC,
|
13211
13111
|
sortColumnName: TeacherSortBy.Name,
|
13212
13112
|
textSearch: ""
|
@@ -13362,16 +13262,18 @@ var DEFAULT_USER_FILTERS = {
|
|
13362
13262
|
|
13363
13263
|
var styles$3 = {"avatar":"_2rJkZ","date-picker":"_1iqE2","time-picker":"_20xtc","teacher-selector-wrapper":"_3L1Oj"};
|
13364
13264
|
|
13265
|
+
var _excluded$7 = ["teachers", "value"];
|
13365
13266
|
var TeacherSelector = function TeacherSelector(_ref) {
|
13366
13267
|
var teachers = _ref.teachers,
|
13367
|
-
value = _ref.value
|
13268
|
+
value = _ref.value,
|
13269
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$7);
|
13368
13270
|
var teacherOptions = teachers.map(function (i) {
|
13369
13271
|
return {
|
13370
13272
|
label: i.teacherName + "/" + i.teacherEmail,
|
13371
13273
|
value: i.id
|
13372
13274
|
};
|
13373
13275
|
});
|
13374
|
-
return React__default.createElement(CustomAsyncSelect, {
|
13276
|
+
return React__default.createElement(CustomAsyncSelect, Object.assign({
|
13375
13277
|
options: teacherOptions,
|
13376
13278
|
value: value,
|
13377
13279
|
menuPlacement: "bottom",
|
@@ -13384,7 +13286,7 @@ var TeacherSelector = function TeacherSelector(_ref) {
|
|
13384
13286
|
},
|
13385
13287
|
menuPortalTarget: document.body,
|
13386
13288
|
isClearable: true
|
13387
|
-
});
|
13289
|
+
}, rest));
|
13388
13290
|
};
|
13389
13291
|
|
13390
13292
|
var ErrorHandler = function ErrorHandler(_ref) {
|
@@ -13469,6 +13371,7 @@ var ClassForm = function ClassForm(_ref) {
|
|
13469
13371
|
};
|
13470
13372
|
var handleChangeTeacher = function handleChangeTeacher(val) {
|
13471
13373
|
formikProp.setFieldValue("mainTeacherId", val === null || val === void 0 ? void 0 : val.value);
|
13374
|
+
formikProp.setFieldValue("mainTeacher", val);
|
13472
13375
|
};
|
13473
13376
|
var handleChangeWeeklyDayTime = function handleChangeWeeklyDayTime(key, newValue, currentValue) {
|
13474
13377
|
var _extends2;
|
@@ -13634,7 +13537,7 @@ var ClassForm = function ClassForm(_ref) {
|
|
13634
13537
|
}, "*")), React__default.createElement("div", {
|
13635
13538
|
className: "" + styles$3["teacher-selector-wrapper"]
|
13636
13539
|
}, React__default.createElement(TeacherSelector, {
|
13637
|
-
value: formikProp.values.
|
13540
|
+
value: formikProp.values.mainTeacher,
|
13638
13541
|
teachers: teachers,
|
13639
13542
|
onInputChange: onSearchTeachers,
|
13640
13543
|
onChange: handleChangeTeacher,
|
@@ -16024,14 +15927,15 @@ var getNoteType = function getNoteType(t, type) {
|
|
16024
15927
|
};
|
16025
15928
|
|
16026
15929
|
var NoteItemList = function NoteItemList(_ref) {
|
16027
|
-
var _data$reciever, _data$
|
15930
|
+
var _data$reciever, _data$recievers;
|
16028
15931
|
var data = _ref.data,
|
16029
15932
|
index = _ref.index,
|
16030
15933
|
role = _ref.role,
|
16031
15934
|
calcOrderNumber = _ref.calcOrderNumber,
|
16032
15935
|
onDelete = _ref.onDelete,
|
16033
15936
|
onUpdate = _ref.onUpdate,
|
16034
|
-
onView = _ref.onView
|
15937
|
+
onView = _ref.onView,
|
15938
|
+
onViewStudentInfo = _ref.onViewStudentInfo;
|
16035
15939
|
var isAdminUser = reactRedux.useSelector(function (state) {
|
16036
15940
|
var _state$common, _state$common$user, _state$common$user$ro;
|
16037
15941
|
return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : (_state$common$user = _state$common.user) === null || _state$common$user === void 0 ? void 0 : (_state$common$user$ro = _state$common$user.roles) === null || _state$common$user$ro === void 0 ? void 0 : _state$common$user$ro.includes(exports.Role.Admin);
|
@@ -16054,6 +15958,9 @@ var NoteItemList = function NoteItemList(_ref) {
|
|
16054
15958
|
var handleView = function handleView() {
|
16055
15959
|
onView(data);
|
16056
15960
|
};
|
15961
|
+
var handleViewStudentInfo = function handleViewStudentInfo() {
|
15962
|
+
onViewStudentInfo(data);
|
15963
|
+
};
|
16057
15964
|
var disabled = !data.isOwned && (!isAdminUser || data.type == undefined || data.type == exports.NoteType.TeacherToAllAdmin || data.type == exports.NoteType.TeacherToTeachers);
|
16058
15965
|
var cleanedRichText = React.useMemo(function () {
|
16059
15966
|
return cleanRichText(data.content);
|
@@ -16075,10 +15982,15 @@ var NoteItemList = function NoteItemList(_ref) {
|
|
16075
15982
|
display: "inline-block",
|
16076
15983
|
color: colors.grey[600],
|
16077
15984
|
fontWeight: 600
|
16078
|
-
}, "(", " " + t("me"), ")")), React__default.createElement(material.Typography, null, data.sender.email))), data.type === exports.NoteType.ToAcademy || data.type === exports.NoteType.ToStudent ? React__default.createElement(TableCell, null, React__default.createElement(material.
|
16079
|
-
|
16080
|
-
|
16081
|
-
|
15985
|
+
}, "(", " " + t("me"), ")")), React__default.createElement(material.Typography, null, data.sender.email))), data.type === exports.NoteType.ToAcademy || data.type === exports.NoteType.ToStudent ? React__default.createElement(TableCell, null, React__default.createElement(material.Button, {
|
15986
|
+
variant: "text",
|
15987
|
+
color: "success",
|
15988
|
+
sx: {
|
15989
|
+
color: colors.blue[700],
|
15990
|
+
fontWeight: 600
|
15991
|
+
},
|
15992
|
+
onClick: handleViewStudentInfo
|
15993
|
+
}, (_data$reciever = data.reciever) === null || _data$reciever === void 0 ? void 0 : _data$reciever.fullName)) : data.type === exports.NoteType.TeacherToTeachers ? React__default.createElement(TableCell, null, React__default.createElement(material.Stack, {
|
16082
15994
|
direction: "column"
|
16083
15995
|
}, (_data$recievers = data.recievers) === null || _data$recievers === void 0 ? void 0 : _data$recievers.slice(0, 2).map(function (i) {
|
16084
15996
|
return React__default.createElement(material.Typography, null, i.fullName, " - ", i.email);
|
@@ -16716,10 +16628,12 @@ var GeneralNoteDialog = function GeneralNoteDialog(_ref) {
|
|
16716
16628
|
};
|
16717
16629
|
|
16718
16630
|
var NoteList = function NoteList(_ref) {
|
16631
|
+
var _selectedStudentNote$;
|
16719
16632
|
var defaultFilter = _ref.defaultFilter,
|
16720
16633
|
role = _ref.role,
|
16721
16634
|
headers = _ref.headers,
|
16722
|
-
isAdmin = _ref.isAdmin
|
16635
|
+
isAdmin = _ref.isAdmin,
|
16636
|
+
onViewQA = _ref.onViewQA;
|
16723
16637
|
var _useTranslation = reactI18next.useTranslation(),
|
16724
16638
|
t = _useTranslation.t;
|
16725
16639
|
var _useList = useList(function (filter) {
|
@@ -16753,6 +16667,16 @@ var NoteList = function NoteList(_ref) {
|
|
16753
16667
|
var _useState5 = React.useState(false),
|
16754
16668
|
openDeleteNoteDialog = _useState5[0],
|
16755
16669
|
setOpenDeleteNoteDialog = _useState5[1];
|
16670
|
+
var _useState6 = React.useState(),
|
16671
|
+
selectedStudentNote = _useState6[0],
|
16672
|
+
setSelectedStudentNote = _useState6[1];
|
16673
|
+
var handleChangeSelectedStudentNote = function handleChangeSelectedStudentNote(note) {
|
16674
|
+
if (note.type !== exports.NoteType.ToAcademy && note.type !== exports.NoteType.ToStudent) return;
|
16675
|
+
setSelectedStudentNote(note);
|
16676
|
+
};
|
16677
|
+
var handleCloseStudentInfo = function handleCloseStudentInfo() {
|
16678
|
+
setSelectedStudentNote(undefined);
|
16679
|
+
};
|
16756
16680
|
var handleOpenCreateNoteDialog = function handleOpenCreateNoteDialog() {
|
16757
16681
|
var _defaultFilter$types;
|
16758
16682
|
if (((_defaultFilter$types = defaultFilter.types) === null || _defaultFilter$types === void 0 ? void 0 : _defaultFilter$types.length) === 1) setOpenNoteDialog(defaultFilter.types[0]);else if (defaultFilter.types && defaultFilter.types.length > 1) {
|
@@ -16906,7 +16830,8 @@ var NoteList = function NoteList(_ref) {
|
|
16906
16830
|
role: role,
|
16907
16831
|
onDelete: handleOpenDeleteNoteDialog,
|
16908
16832
|
onUpdate: handleOpenNoteDialog,
|
16909
|
-
onView: handleOpenNoteDrawer
|
16833
|
+
onView: handleOpenNoteDrawer,
|
16834
|
+
onViewStudentInfo: handleChangeSelectedStudentNote
|
16910
16835
|
});
|
16911
16836
|
}
|
16912
16837
|
}), !data.length && !isLoading && React__default.createElement(material.TableRow, null, React__default.createElement(material.TableCell, {
|
@@ -16954,6 +16879,16 @@ var NoteList = function NoteList(_ref) {
|
|
16954
16879
|
title: t("delete_note"),
|
16955
16880
|
okText: t("delete_note"),
|
16956
16881
|
cancelText: t("cancel")
|
16882
|
+
}), React__default.createElement(StudentInfoDrawer, {
|
16883
|
+
role: role,
|
16884
|
+
open: !!selectedStudentNote,
|
16885
|
+
studentId: (selectedStudentNote === null || selectedStudentNote === void 0 ? void 0 : (_selectedStudentNote$ = selectedStudentNote.reciever) === null || _selectedStudentNote$ === void 0 ? void 0 : _selectedStudentNote$.id) || 0,
|
16886
|
+
onClose: handleCloseStudentInfo,
|
16887
|
+
anchor: "right",
|
16888
|
+
width: "80dvw",
|
16889
|
+
history: history,
|
16890
|
+
inert: true,
|
16891
|
+
onViewQA: onViewQA
|
16957
16892
|
}));
|
16958
16893
|
};
|
16959
16894
|
|
@@ -17062,7 +16997,8 @@ var TEACHER_NOTE_FILTER = {
|
|
17062
16997
|
};
|
17063
16998
|
|
17064
16999
|
var NoteTabs = function NoteTabs(_ref) {
|
17065
|
-
var role = _ref.role
|
17000
|
+
var role = _ref.role,
|
17001
|
+
onViewQA = _ref.onViewQA;
|
17066
17002
|
var roles = reactRedux.useSelector(function (state) {
|
17067
17003
|
var _state$common$user$ro, _state$common, _state$common$user;
|
17068
17004
|
return (_state$common$user$ro = state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : (_state$common$user = _state$common.user) === null || _state$common$user === void 0 ? void 0 : _state$common$user.roles) != null ? _state$common$user$ro : [];
|
@@ -17109,7 +17045,8 @@ var NoteTabs = function NoteTabs(_ref) {
|
|
17109
17045
|
role: role,
|
17110
17046
|
isAdmin: isAdmin,
|
17111
17047
|
defaultFilter: ACADEMY_NOTE_FILTER,
|
17112
|
-
headers: NOTE_STUDENT_HEADERS
|
17048
|
+
headers: NOTE_STUDENT_HEADERS,
|
17049
|
+
onViewQA: onViewQA
|
17113
17050
|
})), React__default.createElement(NotetabPanel, {
|
17114
17051
|
value: value,
|
17115
17052
|
index: 1
|
@@ -17117,7 +17054,8 @@ var NoteTabs = function NoteTabs(_ref) {
|
|
17117
17054
|
role: role,
|
17118
17055
|
isAdmin: isAdmin,
|
17119
17056
|
defaultFilter: STUDENT_PARENTS_NOTE_FILTER,
|
17120
|
-
headers: NOTE_STUDENT_HEADERS
|
17057
|
+
headers: NOTE_STUDENT_HEADERS,
|
17058
|
+
onViewQA: onViewQA
|
17121
17059
|
})), React__default.createElement(NotetabPanel, {
|
17122
17060
|
value: value,
|
17123
17061
|
index: 2
|
@@ -20352,12 +20290,12 @@ function CreateNewQuestionDialog(_ref) {
|
|
20352
20290
|
});
|
20353
20291
|
}
|
20354
20292
|
|
20355
|
-
var _excluded$
|
20293
|
+
var _excluded$8 = ["children", "value", "index"];
|
20356
20294
|
var CustomTabPanel = function CustomTabPanel(props) {
|
20357
20295
|
var children = props.children,
|
20358
20296
|
value = props.value,
|
20359
20297
|
index = props.index,
|
20360
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
20298
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$8);
|
20361
20299
|
return React__default.createElement("div", Object.assign({
|
20362
20300
|
role: "tabpanel",
|
20363
20301
|
hidden: value !== index,
|
@@ -24414,7 +24352,7 @@ var ChapterProblemSolvingResultsDialog = function ChapterProblemSolvingResultsDi
|
|
24414
24352
|
}, t("cancel"))))));
|
24415
24353
|
};
|
24416
24354
|
|
24417
|
-
var _excluded$
|
24355
|
+
var _excluded$9 = ["onChange"];
|
24418
24356
|
var StartPageDialog = function StartPageDialog(_ref) {
|
24419
24357
|
var t = _ref.t,
|
24420
24358
|
onClose = _ref.onClose,
|
@@ -24480,7 +24418,7 @@ var StartPageDialog = function StartPageDialog(_ref) {
|
|
24480
24418
|
}, t("page_to_start_with")), React__default.createElement(formik.Field, {
|
24481
24419
|
name: "startPage",
|
24482
24420
|
render: function render(_ref3) {
|
24483
|
-
var field = _objectWithoutPropertiesLoose(_ref3, _excluded$
|
24421
|
+
var field = _objectWithoutPropertiesLoose(_ref3, _excluded$9);
|
24484
24422
|
return React__default.createElement(CustomSelectOption, Object.assign({
|
24485
24423
|
maxMenuHeight: 150,
|
24486
24424
|
menuPosition: "fixed",
|
@@ -26112,10 +26050,10 @@ var DrawerTextbookResultTab = function DrawerTextbookResultTab(_ref) {
|
|
26112
26050
|
};
|
26113
26051
|
|
26114
26052
|
var _styled$1;
|
26115
|
-
var _excluded$
|
26053
|
+
var _excluded$a = ["className"];
|
26116
26054
|
var CustomTooltip$1 = material.styled(function (_ref) {
|
26117
26055
|
var className = _ref.className,
|
26118
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
26056
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$a);
|
26119
26057
|
return React__default.createElement(material.Tooltip, Object.assign({}, props, {
|
26120
26058
|
classes: {
|
26121
26059
|
popper: className
|
@@ -27596,7 +27534,7 @@ var useTeacherList = function useTeacherList() {
|
|
27596
27534
|
};
|
27597
27535
|
};
|
27598
27536
|
|
27599
|
-
var _excluded$
|
27537
|
+
var _excluded$b = ["getStudents"],
|
27600
27538
|
_excluded2 = ["getTeachers"],
|
27601
27539
|
_excluded3 = ["getLessons"];
|
27602
27540
|
var PAGE_TITLE$4 = "classes";
|
@@ -27647,7 +27585,7 @@ var useClassDetail = function useClassDetail(_ref) {
|
|
27647
27585
|
};
|
27648
27586
|
var _useStudentClassList = useStudentClassList(classId),
|
27649
27587
|
getStudents = _useStudentClassList.getStudents,
|
27650
|
-
studentListProps = _objectWithoutPropertiesLoose(_useStudentClassList, _excluded$
|
27588
|
+
studentListProps = _objectWithoutPropertiesLoose(_useStudentClassList, _excluded$b);
|
27651
27589
|
var _useTeacherClassList = useTeacherClassList(classId),
|
27652
27590
|
getTeachers = _useTeacherClassList.getTeachers,
|
27653
27591
|
teacherListProps = _objectWithoutPropertiesLoose(_useTeacherClassList, _excluded2);
|
@@ -27707,7 +27645,11 @@ var useClassDetail = function useClassDetail(_ref) {
|
|
27707
27645
|
startTime: timeSpanToLocalMoment(i.startTime, course.startDate),
|
27708
27646
|
endTime: timeSpanToLocalMoment(i.endTime, course.startDate)
|
27709
27647
|
});
|
27710
|
-
})
|
27648
|
+
}),
|
27649
|
+
mainTeacher: course.mainTeacherId ? {
|
27650
|
+
label: course.mainTeacherName + "/" + course.mainTeacherEmail,
|
27651
|
+
value: course.mainTeacherId
|
27652
|
+
} : null
|
27711
27653
|
});
|
27712
27654
|
}, [JSON.stringify(course)]);
|
27713
27655
|
var convertToRequestBody = function convertToRequestBody(request) {
|
@@ -28093,6 +28035,7 @@ var LessonFormBody = function LessonFormBody(_ref) {
|
|
28093
28035
|
setOpenPicker = _useState[1];
|
28094
28036
|
var handleChangeTeacher = function handleChangeTeacher(val) {
|
28095
28037
|
formikProp.setFieldValue("mainTeacherId", val === null || val === void 0 ? void 0 : val.value);
|
28038
|
+
formikProp.setFieldValue("mainTeacher", val);
|
28096
28039
|
};
|
28097
28040
|
React.useEffect(function () {
|
28098
28041
|
if (open && data) formikProp.setValues(data);else formikProp.setValues(DEFAULT_LESSON_REQUEST);
|
@@ -28136,7 +28079,7 @@ var LessonFormBody = function LessonFormBody(_ref) {
|
|
28136
28079
|
}, "*")), React__default.createElement("div", {
|
28137
28080
|
className: "" + styles$3["teacher-selector-wrapper"]
|
28138
28081
|
}, React__default.createElement(TeacherSelector, {
|
28139
|
-
value: formikProp.values.
|
28082
|
+
value: formikProp.values.mainTeacher,
|
28140
28083
|
teachers: teachers,
|
28141
28084
|
onInputChange: onSearchTeachers,
|
28142
28085
|
onChange: handleChangeTeacher
|
@@ -28244,7 +28187,11 @@ var LessonFormDialog = function LessonFormDialog(_ref) {
|
|
28244
28187
|
return _extends({}, data, {
|
28245
28188
|
date: moment.utc(data.date).local(),
|
28246
28189
|
startTime: timeSpanToLocalMoment(data.startTime, data.date),
|
28247
|
-
endTime: timeSpanToLocalMoment(data.endTime, data.date)
|
28190
|
+
endTime: timeSpanToLocalMoment(data.endTime, data.date),
|
28191
|
+
mainTeacher: data.mainTeacherId ? {
|
28192
|
+
label: data.mainTeacherName + "/" + data.mainTeacherEmail,
|
28193
|
+
value: data.mainTeacherId
|
28194
|
+
} : null
|
28248
28195
|
});
|
28249
28196
|
};
|
28250
28197
|
var lessonRequest = React.useMemo(convertLessonRequest, [JSON.stringify(data)]);
|
@@ -29035,14 +28982,14 @@ var CSV_PREFIX = "data:text/csv;charset=utf-8,";
|
|
29035
28982
|
|
29036
28983
|
var styles$8 = {"action-btn":"_1jXbz","action-btn--pencil":"_at4xP","icon-rotate-180":"_12gv9","drop-area":"_R4bn5"};
|
29037
28984
|
|
29038
|
-
var _excluded$
|
28985
|
+
var _excluded$c = ["text", "isRequired", "className"];
|
29039
28986
|
var LabelRequired = function LabelRequired(_ref) {
|
29040
28987
|
var text = _ref.text,
|
29041
28988
|
_ref$isRequired = _ref.isRequired,
|
29042
28989
|
isRequired = _ref$isRequired === void 0 ? true : _ref$isRequired,
|
29043
28990
|
_ref$className = _ref.className,
|
29044
28991
|
className = _ref$className === void 0 ? "" : _ref$className,
|
29045
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
28992
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$c);
|
29046
28993
|
return React__default.createElement(material.FormLabel, Object.assign({
|
29047
28994
|
className: "fw-medium mb-1 " + className
|
29048
28995
|
}, rest), text, isRequired && React__default.createElement("span", {
|
@@ -29096,7 +29043,7 @@ var deleteUserApi = function deleteUserApi(id) {
|
|
29096
29043
|
return api["delete"](USER_URL$1 + "/delete/" + id);
|
29097
29044
|
};
|
29098
29045
|
|
29099
|
-
var _excluded$
|
29046
|
+
var _excluded$d = ["ref"],
|
29100
29047
|
_excluded2$1 = ["ref"],
|
29101
29048
|
_excluded3$1 = ["ref"],
|
29102
29049
|
_excluded4 = ["ref"],
|
@@ -29126,7 +29073,7 @@ var UserDialog = function UserDialog(_ref) {
|
|
29126
29073
|
t = _useTranslation.t;
|
29127
29074
|
var _register = register("fullName"),
|
29128
29075
|
fullNameRef = _register.ref,
|
29129
|
-
fullNameBio = _objectWithoutPropertiesLoose(_register, _excluded$
|
29076
|
+
fullNameBio = _objectWithoutPropertiesLoose(_register, _excluded$d);
|
29130
29077
|
var _register2 = register("email"),
|
29131
29078
|
emailRef = _register2.ref,
|
29132
29079
|
emailBio = _objectWithoutPropertiesLoose(_register2, _excluded2$1);
|
@@ -33197,12 +33144,12 @@ var ArticleDialog = function ArticleDialog(_ref) {
|
|
33197
33144
|
|
33198
33145
|
var styles$a = {"drawer":"_11aYm","open":"_3Ydwm","drawer-overlay":"_3SQDf","drawer-header":"_2BwOx","drawer-form":"_2Zo7R","dropdown-content-academy":"_1lzjD","dropdown-change":"_1y7K9","dropdown-academy-item":"_1Y-55","dropdown-content-language":"_1fBXY","dropdown-item-language":"_3Szun","dropdown-item-language-active":"_2HhLb","item-address":"_3WYHC","item-logout":"_2-9ix","title-address":"_1r4pn","image-academy":"_2ZozT"};
|
33199
33146
|
|
33200
|
-
var _excluded$
|
33147
|
+
var _excluded$e = ["isOpen", "onClose", "handleSaveExam"];
|
33201
33148
|
var CreateExamDrawer = function CreateExamDrawer(props) {
|
33202
33149
|
var isOpen = props.isOpen,
|
33203
33150
|
onClose = props.onClose,
|
33204
33151
|
handleSaveExam = props.handleSaveExam,
|
33205
|
-
examDetailViewProps = _objectWithoutPropertiesLoose(props, _excluded$
|
33152
|
+
examDetailViewProps = _objectWithoutPropertiesLoose(props, _excluded$e);
|
33206
33153
|
var _useTranslation = reactI18next.useTranslation(),
|
33207
33154
|
t = _useTranslation.t;
|
33208
33155
|
var theme = material.useTheme();
|
@@ -33964,11 +33911,11 @@ var TextbookRow = function TextbookRow(_ref) {
|
|
33964
33911
|
});
|
33965
33912
|
var _useTranslation = reactI18next.useTranslation(),
|
33966
33913
|
t = _useTranslation.t;
|
33967
|
-
var isEditable = !onAcademy || isAdminSite || isSuperAdmin || isSuperAdminUser || !isAdmin && data.isShared && (((_data$createdBy = data.createdBy) === null || _data$createdBy === void 0 ? void 0 : _data$createdBy.id) === (infoUser === null || infoUser === void 0 ? void 0 : infoUser.id) || ((_data$textbookOwners = data.textbookOwners) === null || _data$textbookOwners === void 0 ? void 0 : _data$textbookOwners.some(function (i) {
|
33914
|
+
var isEditable = (!onAcademy || isAdminSite || isSuperAdmin || isSuperAdminUser || !isAdmin && data.isShared && (((_data$createdBy = data.createdBy) === null || _data$createdBy === void 0 ? void 0 : _data$createdBy.id) === (infoUser === null || infoUser === void 0 ? void 0 : infoUser.id) || ((_data$textbookOwners = data.textbookOwners) === null || _data$textbookOwners === void 0 ? void 0 : _data$textbookOwners.some(function (i) {
|
33968
33915
|
var _infoUser$email, _infoUser$email$trim;
|
33969
33916
|
return (i === null || i === void 0 ? void 0 : i.email.trim().toUpperCase()) === (infoUser === null || infoUser === void 0 ? void 0 : (_infoUser$email = infoUser.email) === null || _infoUser$email === void 0 ? void 0 : (_infoUser$email$trim = _infoUser$email.trim()) === null || _infoUser$email$trim === void 0 ? void 0 : _infoUser$email$trim.toUpperCase()) && (i === null || i === void 0 ? void 0 : i.academyId) === (academy === null || academy === void 0 ? void 0 : academy.id);
|
33970
|
-
})));
|
33971
|
-
var isDeleteAble = !onAcademy || isAdminSite || isSuperAdmin || isSuperAdminUser || !isAdmin && data.isShared && ((_data$createdBy2 = data.createdBy) === null || _data$createdBy2 === void 0 ? void 0 : _data$createdBy2.id) === (infoUser === null || infoUser === void 0 ? void 0 : infoUser.id);
|
33917
|
+
})))) && data.totalUses <= 0;
|
33918
|
+
var isDeleteAble = !onAcademy || isAdminSite || isSuperAdmin || isSuperAdminUser || !isAdmin && data.isShared && ((_data$createdBy2 = data.createdBy) === null || _data$createdBy2 === void 0 ? void 0 : _data$createdBy2.id) === (infoUser === null || infoUser === void 0 ? void 0 : infoUser.id) && data.totalUses <= 0;
|
33972
33919
|
var isSharable = !data.isPublic && data.isShared && onAcademy && (isAdminSite || isSuperAdminUser || !isAdmin && data.createdBy.id === infoUser.id);
|
33973
33920
|
var handleUpdateTextbook = function handleUpdateTextbook() {
|
33974
33921
|
onUpdateTextbook(data);
|
@@ -34355,12 +34302,12 @@ var useNotificationDetail = function useNotificationDetail(_ref) {
|
|
34355
34302
|
|
34356
34303
|
var styles$b = {"avatar":"_8niRT"};
|
34357
34304
|
|
34358
|
-
var _excluded$
|
34305
|
+
var _excluded$f = ["value", "disabled", "optionTypeNotification"];
|
34359
34306
|
var TypeSelector = function TypeSelector(_ref) {
|
34360
34307
|
var value = _ref.value,
|
34361
34308
|
disabled = _ref.disabled,
|
34362
34309
|
optionTypeNotification = _ref.optionTypeNotification,
|
34363
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
34310
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$f);
|
34364
34311
|
return React__default.createElement(CustomAsyncSelect, Object.assign({
|
34365
34312
|
options: optionTypeNotification,
|
34366
34313
|
value: value
|
@@ -34753,11 +34700,11 @@ var useNotificationList = function useNotificationList(_ref) {
|
|
34753
34700
|
};
|
34754
34701
|
};
|
34755
34702
|
|
34756
|
-
var _excluded$
|
34703
|
+
var _excluded$g = ["value", "optionTypeNotification"];
|
34757
34704
|
var SelectFilterType = function SelectFilterType(_ref) {
|
34758
34705
|
var value = _ref.value,
|
34759
34706
|
optionTypeNotification = _ref.optionTypeNotification,
|
34760
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
34707
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$g);
|
34761
34708
|
return React__default.createElement(CustomAsyncSelect, Object.assign({
|
34762
34709
|
options: optionTypeNotification,
|
34763
34710
|
value: value
|
@@ -34989,10 +34936,10 @@ var useTextbookManagement = function useTextbookManagement(_ref) {
|
|
34989
34936
|
var isAdminSite = role === exports.Role.Admin;
|
34990
34937
|
var onAcademy = !!(user !== null && user !== void 0 && user.academyDomain);
|
34991
34938
|
var isSuperAdminUser = !!user && user.isSuperAdmin;
|
34992
|
-
var isEditable = !selectedTextbook || !onAcademy || isAdminSite || isSuperAdmin || isSuperAdminUser || !isAdmin && selectedTextbook.isShared && (((_selectedTextbook$cre = selectedTextbook.createdBy) === null || _selectedTextbook$cre === void 0 ? void 0 : _selectedTextbook$cre.id) === (user === null || user === void 0 ? void 0 : user.id) || selectedTextbook.textbookOwners.some(function (i) {
|
34939
|
+
var isEditable = !selectedTextbook || (!onAcademy || isAdminSite || isSuperAdmin || isSuperAdminUser || !isAdmin && selectedTextbook.isShared && (((_selectedTextbook$cre = selectedTextbook.createdBy) === null || _selectedTextbook$cre === void 0 ? void 0 : _selectedTextbook$cre.id) === (user === null || user === void 0 ? void 0 : user.id) || selectedTextbook.textbookOwners.some(function (i) {
|
34993
34940
|
var _user$email, _user$email$trim;
|
34994
34941
|
return i.email.trim().toUpperCase() === (user === null || user === void 0 ? void 0 : (_user$email = user.email) === null || _user$email === void 0 ? void 0 : (_user$email$trim = _user$email.trim()) === null || _user$email$trim === void 0 ? void 0 : _user$email$trim.toUpperCase()) && i.academyId === (academy === null || academy === void 0 ? void 0 : academy.id);
|
34995
|
-
}));
|
34942
|
+
}))) && selectedTextbook.totalUses <= 0;
|
34996
34943
|
var disabledTextbookOwners = !selectedTextbook && isAdmin || selectedTextbook && (!isEditable || isTeacher && ((_selectedTextbook$cre2 = selectedTextbook.createdBy) === null || _selectedTextbook$cre2 === void 0 ? void 0 : _selectedTextbook$cre2.id) !== (user === null || user === void 0 ? void 0 : user.id) || isAdmin && !isSuperAdminUser);
|
34997
34944
|
var handleOpenConfirmDeleteChapterDialog = function handleOpenConfirmDeleteChapterDialog(chapter) {
|
34998
34945
|
setSelectedChapter(chapter);
|
@@ -35094,24 +35041,6 @@ var useTextbookManagement = function useTextbookManagement(_ref) {
|
|
35094
35041
|
return Promise.reject(e);
|
35095
35042
|
}
|
35096
35043
|
};
|
35097
|
-
var handleSaveData = React.useCallback(function (values) {
|
35098
|
-
try {
|
35099
|
-
if (!coverImage && !(values !== null && values !== void 0 && values.coverImage)) {
|
35100
|
-
return Promise.resolve();
|
35101
|
-
}
|
35102
|
-
return Promise.resolve(_catch(function () {
|
35103
|
-
var coverImg = coverImage || (values === null || values === void 0 ? void 0 : values.coverImage);
|
35104
|
-
return Promise.resolve(updateTextbookApi$1(_extends({}, values, {
|
35105
|
-
coverImage: coverImg
|
35106
|
-
}), (selectedTextbook === null || selectedTextbook === void 0 ? void 0 : selectedTextbook.id) || 0, isSuperAdmin)).then(function () {});
|
35107
|
-
}, function (error) {
|
35108
|
-
reactToastify.toast.error(getErrorMessage(t, error));
|
35109
|
-
throw error;
|
35110
|
-
}));
|
35111
|
-
} catch (e) {
|
35112
|
-
return Promise.reject(e);
|
35113
|
-
}
|
35114
|
-
}, [coverImage, isSuperAdmin, JSON.stringify(selectedTextbook)]);
|
35115
35044
|
React.useEffect(function () {
|
35116
35045
|
if (!textbookId) return;
|
35117
35046
|
handleGetTextbookDetail();
|
@@ -35130,7 +35059,6 @@ var useTextbookManagement = function useTextbookManagement(_ref) {
|
|
35130
35059
|
isSuperAdminUser: isSuperAdminUser,
|
35131
35060
|
openDialog: openDialog,
|
35132
35061
|
handleSubmit: handleSubmit,
|
35133
|
-
handleSaveData: handleSaveData,
|
35134
35062
|
selectedTextbook: selectedTextbook,
|
35135
35063
|
handleOpenDialog: handleOpenDialog,
|
35136
35064
|
handleCloseDialog: handleCloseDialog,
|
@@ -35424,8 +35352,6 @@ var CompareTypeOptions = [{
|
|
35424
35352
|
label: "synonym_processing",
|
35425
35353
|
value: exports.QuestionAnswerType.SynonymProcessing
|
35426
35354
|
}];
|
35427
|
-
var SAVE_TIME_INTERVAL_IN_MILLISECONDS = 60 * 1000;
|
35428
|
-
var SAVE_TIME_MAX_DIFF_IN_MILLISECONDS = 1000;
|
35429
35355
|
|
35430
35356
|
var CustomTextbookTab = function CustomTextbookTab(props) {
|
35431
35357
|
var children = props.children,
|
@@ -36034,7 +35960,7 @@ var isEqual$1 = function isEqual(prev, next) {
|
|
36034
35960
|
};
|
36035
35961
|
var QuestionShortInput$1 = React.memo(QuestionShortInput, isEqual$1);
|
36036
35962
|
|
36037
|
-
var _excluded$
|
35963
|
+
var _excluded$h = ["onChange"];
|
36038
35964
|
var _$2 = _$8;
|
36039
35965
|
var BpIcon$1 = material.styled("span")(function (_ref) {
|
36040
35966
|
var theme = _ref.theme;
|
@@ -36345,7 +36271,7 @@ var QuestionBlock = function QuestionBlock(_ref2) {
|
|
36345
36271
|
name: path + ".questionTypeId",
|
36346
36272
|
render: function render(_ref5) {
|
36347
36273
|
var _ref5$field = _ref5.field,
|
36348
|
-
field = _objectWithoutPropertiesLoose(_ref5$field, _excluded$
|
36274
|
+
field = _objectWithoutPropertiesLoose(_ref5$field, _excluded$h);
|
36349
36275
|
return React__default.createElement(CustomSelectOption, Object.assign({}, field, {
|
36350
36276
|
isDisabled: disabled,
|
36351
36277
|
value: data.questionType,
|
@@ -36394,7 +36320,7 @@ var isEqual$2 = function isEqual(prev, next) {
|
|
36394
36320
|
};
|
36395
36321
|
var QuestionBlock$1 = React.memo(QuestionBlock, isEqual$2);
|
36396
36322
|
|
36397
|
-
var _excluded$
|
36323
|
+
var _excluded$i = ["data", "path", "isMath", "open", "isLoadingCategories", "isLoadingQuestionTypes", "optionKey", "categories", "questionTypes", "disabled", "onQuestioStartOrderChange", "onDelete", "onOpenSubCategoryMenu", "onOpenCategoryMenu", "onCloseCategoryMenu", "onCloseQuestionTypeMenu", "onOpenQuestionTypeMenu"];
|
36398
36324
|
var _$3 = _$8;
|
36399
36325
|
var QuestionGroupBlockBody = function QuestionGroupBlockBody(_ref) {
|
36400
36326
|
var _data$articles$3, _data$articles$3$cate, _data$articles$4, _data$articles$4$cate, _questions$2;
|
@@ -36415,7 +36341,7 @@ var QuestionGroupBlockBody = function QuestionGroupBlockBody(_ref) {
|
|
36415
36341
|
onCloseCategoryMenu = _ref.onCloseCategoryMenu,
|
36416
36342
|
onCloseQuestionTypeMenu = _ref.onCloseQuestionTypeMenu,
|
36417
36343
|
onOpenQuestionTypeMenu = _ref.onOpenQuestionTypeMenu,
|
36418
|
-
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$
|
36344
|
+
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$i);
|
36419
36345
|
var errors = formikProps.errors;
|
36420
36346
|
var startOrderRef = React.useRef(null);
|
36421
36347
|
var articles = data.articles,
|
@@ -36558,7 +36484,7 @@ var isEqual$3 = function isEqual(prev, next) {
|
|
36558
36484
|
};
|
36559
36485
|
var QuestionGroupBlockBody$1 = React.memo(QuestionGroupBlockBody, isEqual$3);
|
36560
36486
|
|
36561
|
-
var _excluded$
|
36487
|
+
var _excluded$j = ["expandedIndex", "open", "paths", "path", "isMath", "data", "categories", "isLoadingCategories", "isLoadingQuestionTypes", "questionTypes", "optionKey", "disabled", "onToggle", "onQuestionCountChange", "onDelete", "onOpenSubCategoryMenu", "onOpenCategoryMenu", "onCloseCategoryMenu", "onCopiedPrevQuestionGroup", "onCloseQuestionTypeMenu", "onOpenQuestionTypeMenu"];
|
36562
36488
|
var _$4 = _$8;
|
36563
36489
|
var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
|
36564
36490
|
var _data$articles$3, _data$articles$3$cate, _data$articles$3$cate2, _data$articles$4, _data$articles$4$cate, _data$articles$4$cate2;
|
@@ -36583,7 +36509,7 @@ var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
|
|
36583
36509
|
onCopiedPrevQuestionGroup = _ref.onCopiedPrevQuestionGroup,
|
36584
36510
|
onCloseQuestionTypeMenu = _ref.onCloseQuestionTypeMenu,
|
36585
36511
|
onOpenQuestionTypeMenu = _ref.onOpenQuestionTypeMenu,
|
36586
|
-
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$
|
36512
|
+
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$j);
|
36587
36513
|
var errors = formikProps.errors,
|
36588
36514
|
setFieldValue = formikProps.setFieldValue;
|
36589
36515
|
var _useTranslation = reactI18next.useTranslation(),
|
@@ -37046,7 +36972,7 @@ var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
|
|
37046
36972
|
}, formikProps)))));
|
37047
36973
|
};
|
37048
36974
|
|
37049
|
-
var _excluded$
|
36975
|
+
var _excluded$k = ["path", "paths", "isMath", "isLoadingCategories", "isLoadingQuestionTypes", "optionKey", "questionGroups", "subChapters", "categories", "questionTypes", "disabled", "onDelete", "onOpenSubCategoryMenu", "onOpenCategoryMenu", "onCloseCategoryMenu", "onCopiedPrevQuestionGroup", "onCloseQuestionTypeMenu", "onOpenQuestionTypeMenu"];
|
37050
36976
|
var ChapterBlockBody = function ChapterBlockBody(_ref) {
|
37051
36977
|
var path = _ref.path,
|
37052
36978
|
paths = _ref.paths,
|
@@ -37066,7 +36992,7 @@ var ChapterBlockBody = function ChapterBlockBody(_ref) {
|
|
37066
36992
|
onCopiedPrevQuestionGroup = _ref.onCopiedPrevQuestionGroup,
|
37067
36993
|
onCloseQuestionTypeMenu = _ref.onCloseQuestionTypeMenu,
|
37068
36994
|
onOpenQuestionTypeMenu = _ref.onOpenQuestionTypeMenu,
|
37069
|
-
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$
|
36995
|
+
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$k);
|
37070
36996
|
var _useTranslation = reactI18next.useTranslation(),
|
37071
36997
|
t = _useTranslation.t;
|
37072
36998
|
var setFieldValue = formikProps.setFieldValue;
|
@@ -37245,7 +37171,7 @@ var ChapterBlockBody = function ChapterBlockBody(_ref) {
|
|
37245
37171
|
}));
|
37246
37172
|
};
|
37247
37173
|
|
37248
|
-
var _excluded$
|
37174
|
+
var _excluded$l = ["data", "expandedIndex", "open", "path", "paths", "isMath", "isLoadingCategories", "isLoadingQuestionTypes", "categories", "questionTypes", "optionKey", "disabled", "onToggle", "onDelete", "onCopiedPrevQuestionGroup", "onCloseCategoryMenu", "onOpenCategoryMenu", "onOpenSubCategoryMenu", "onOpenQuestionTypeMenu", "onCloseQuestionTypeMenu"];
|
37249
37175
|
var _$5 = _$8;
|
37250
37176
|
var ChapterBlock = function ChapterBlock(_ref) {
|
37251
37177
|
var data = _ref.data,
|
@@ -37268,7 +37194,7 @@ var ChapterBlock = function ChapterBlock(_ref) {
|
|
37268
37194
|
onOpenSubCategoryMenu = _ref.onOpenSubCategoryMenu,
|
37269
37195
|
onOpenQuestionTypeMenu = _ref.onOpenQuestionTypeMenu,
|
37270
37196
|
onCloseQuestionTypeMenu = _ref.onCloseQuestionTypeMenu,
|
37271
|
-
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$
|
37197
|
+
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$l);
|
37272
37198
|
var errors = formikProps.errors;
|
37273
37199
|
var _useTranslation = reactI18next.useTranslation(),
|
37274
37200
|
t = _useTranslation.t;
|
@@ -37959,7 +37885,7 @@ var TextbookContentsTab = function TextbookContentsTab(props) {
|
|
37959
37885
|
}));
|
37960
37886
|
};
|
37961
37887
|
|
37962
|
-
var _excluded$
|
37888
|
+
var _excluded$m = ["value"];
|
37963
37889
|
var VisuallyHiddenInput = material.styled("input")({
|
37964
37890
|
clip: "rect(0 0 0 0)",
|
37965
37891
|
clipPath: "inset(50%)",
|
@@ -38127,7 +38053,7 @@ var TextbookInfoTab = function TextbookInfoTab(_ref) {
|
|
38127
38053
|
render: function render(_ref4) {
|
38128
38054
|
var _ref4$field = _ref4.field,
|
38129
38055
|
value = _ref4$field.value,
|
38130
|
-
action = _objectWithoutPropertiesLoose(_ref4$field, _excluded$
|
38056
|
+
action = _objectWithoutPropertiesLoose(_ref4$field, _excluded$m);
|
38131
38057
|
return React__default.createElement(xDatePickers.LocalizationProvider, {
|
38132
38058
|
dateAdapter: AdapterMoment.AdapterMoment
|
38133
38059
|
}, React__default.createElement(xDatePickers.DatePicker, Object.assign({}, action, {
|
@@ -38601,9 +38527,8 @@ var TextbookOwnersTab = function TextbookOwnersTab(_ref) {
|
|
38601
38527
|
}));
|
38602
38528
|
};
|
38603
38529
|
|
38604
|
-
var _excluded$
|
38530
|
+
var _excluded$n = ["isCreatedByAdmin", "isSuperAdminUser", "isSuperAdmin", "isAdmin", "textbookId", "selected", "coverImage", "disabled", "ownersDisabled", "onChangeTab", "onUploadImage"];
|
38605
38531
|
var PreparedTextbookForm = function PreparedTextbookForm(_ref) {
|
38606
|
-
var _valuesTextbook$curre;
|
38607
38532
|
var isCreatedByAdmin = _ref.isCreatedByAdmin,
|
38608
38533
|
isSuperAdminUser = _ref.isSuperAdminUser,
|
38609
38534
|
isSuperAdmin = _ref.isSuperAdmin,
|
@@ -38613,30 +38538,14 @@ var PreparedTextbookForm = function PreparedTextbookForm(_ref) {
|
|
38613
38538
|
coverImage = _ref.coverImage,
|
38614
38539
|
disabled = _ref.disabled,
|
38615
38540
|
ownersDisabled = _ref.ownersDisabled,
|
38616
|
-
selectedTextbook = _ref.selectedTextbook,
|
38617
|
-
handleSaveData = _ref.handleSaveData,
|
38618
38541
|
onChangeTab = _ref.onChangeTab,
|
38619
38542
|
onUploadImage = _ref.onUploadImage,
|
38620
|
-
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$
|
38543
|
+
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$n);
|
38621
38544
|
var values = formikProps.values,
|
38622
38545
|
errors = formikProps.errors,
|
38623
38546
|
dirty = formikProps.dirty,
|
38624
38547
|
submitCount = formikProps.submitCount,
|
38625
38548
|
setValues = formikProps.setValues;
|
38626
|
-
var theme = material.useTheme();
|
38627
|
-
var savedRunRef = React.useRef(Date.now());
|
38628
|
-
var runTimeRef = React.useRef(Date.now());
|
38629
|
-
var valuesTextbook = React.useRef(null);
|
38630
|
-
var isFirstLoadRef = React.useRef(true);
|
38631
|
-
var _React$useState = React__default.useState(PrintStatus.Idle),
|
38632
|
-
saveStatus = _React$useState[0],
|
38633
|
-
setSaveStatus = _React$useState[1];
|
38634
|
-
var timeoutRef = React.useRef(null);
|
38635
|
-
var isProcessingRef = React.useRef(false);
|
38636
|
-
var pendingValuesRef = React.useRef(null);
|
38637
|
-
var _useState = React.useState(),
|
38638
|
-
lastEdited = _useState[0],
|
38639
|
-
setLastEdited = _useState[1];
|
38640
38549
|
React.useEffect(function () {
|
38641
38550
|
var handleBeforeUnload = function handleBeforeUnload(event) {
|
38642
38551
|
var message = i18n.t("are_you_sure_you_want_to_quit_yours_changes_may_not_be_saved");
|
@@ -38657,99 +38566,9 @@ var PreparedTextbookForm = function PreparedTextbookForm(_ref) {
|
|
38657
38566
|
var newValues = _resetAllCategoriesAndQuestionTypesBySubject(values, val);
|
38658
38567
|
setValues(newValues);
|
38659
38568
|
};
|
38660
|
-
React.useEffect(function () {
|
38661
|
-
if (!valuesTextbook.current && isFirstLoadRef.current && !_$8.isEqual(values, DEFAULT_TEXTBOOK_REQUEST)) {
|
38662
|
-
valuesTextbook.current = _$8.cloneDeep(values);
|
38663
|
-
isFirstLoadRef.current = false;
|
38664
|
-
}
|
38665
|
-
}, [values]);
|
38666
|
-
var _handleSave = function handleSave(valuesProps) {
|
38667
|
-
try {
|
38668
|
-
var _temp = _finallyRethrows(function () {
|
38669
|
-
return _catch(function () {
|
38670
|
-
isProcessingRef.current = true;
|
38671
|
-
setSaveStatus(PrintStatus.Saving);
|
38672
|
-
var valuesToSave = valuesProps || values;
|
38673
|
-
return Promise.resolve(handleSaveData(valuesToSave)).then(function () {
|
38674
|
-
valuesTextbook.current = _$8.cloneDeep(valuesToSave);
|
38675
|
-
var now = Date.now();
|
38676
|
-
savedRunRef.current = now;
|
38677
|
-
runTimeRef.current = now;
|
38678
|
-
setSaveStatus(PrintStatus.Saved);
|
38679
|
-
});
|
38680
|
-
}, function (error) {
|
38681
|
-
setSaveStatus(PrintStatus.Idle);
|
38682
|
-
console.error(error);
|
38683
|
-
});
|
38684
|
-
}, function (_wasThrown, _result) {
|
38685
|
-
isProcessingRef.current = false;
|
38686
|
-
if (pendingValuesRef.current) {
|
38687
|
-
if (timeoutRef.current) {
|
38688
|
-
clearTimeout(timeoutRef.current);
|
38689
|
-
}
|
38690
|
-
timeoutRef.current = setTimeout(function () {
|
38691
|
-
timeoutRef.current = null;
|
38692
|
-
var pendingValues = pendingValuesRef.current;
|
38693
|
-
if (pendingValues) {
|
38694
|
-
_handleSave(pendingValues);
|
38695
|
-
pendingValuesRef.current = null;
|
38696
|
-
}
|
38697
|
-
}, SAVE_TIME_INTERVAL_IN_MILLISECONDS);
|
38698
|
-
}
|
38699
|
-
if (_wasThrown) throw _result;
|
38700
|
-
return _result;
|
38701
|
-
});
|
38702
|
-
return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
|
38703
|
-
} catch (e) {
|
38704
|
-
return Promise.reject(e);
|
38705
|
-
}
|
38706
|
-
};
|
38707
|
-
React.useEffect(function () {
|
38708
|
-
var now = Date.now();
|
38709
|
-
if (valuesTextbook.current && !_$8.isEqual(values, valuesTextbook.current)) setLastEdited(now);
|
38710
|
-
if (!_$8.isEmpty(errors) || !valuesTextbook.current || !(selectedTextbook !== null && selectedTextbook !== void 0 && selectedTextbook.id)) return;
|
38711
|
-
if (valuesTextbook.current && _$8.isEqual(values, valuesTextbook.current)) return;
|
38712
|
-
if (isProcessingRef.current) {
|
38713
|
-
pendingValuesRef.current = _$8.cloneDeep(values);
|
38714
|
-
return;
|
38715
|
-
}
|
38716
|
-
var timeSinceLastRun = now - runTimeRef.current;
|
38717
|
-
var maxTime = SAVE_TIME_INTERVAL_IN_MILLISECONDS + SAVE_TIME_MAX_DIFF_IN_MILLISECONDS;
|
38718
|
-
if (timeSinceLastRun > maxTime) {
|
38719
|
-
runTimeRef.current = now;
|
38720
|
-
timeSinceLastRun = 0;
|
38721
|
-
}
|
38722
|
-
if (timeSinceLastRun >= SAVE_TIME_INTERVAL_IN_MILLISECONDS) {
|
38723
|
-
if (timeoutRef.current) {
|
38724
|
-
clearTimeout(timeoutRef.current);
|
38725
|
-
timeoutRef.current = null;
|
38726
|
-
pendingValuesRef.current = null;
|
38727
|
-
}
|
38728
|
-
_handleSave();
|
38729
|
-
} else {
|
38730
|
-
pendingValuesRef.current = _$8.cloneDeep(values);
|
38731
|
-
var intevalTime = SAVE_TIME_INTERVAL_IN_MILLISECONDS - timeSinceLastRun;
|
38732
|
-
timeoutRef.current = setTimeout(function () {
|
38733
|
-
timeoutRef.current = null;
|
38734
|
-
var pendingValues = pendingValuesRef.current;
|
38735
|
-
if (pendingValues) {
|
38736
|
-
clearTimeout(timeoutRef.current);
|
38737
|
-
_handleSave(pendingValues);
|
38738
|
-
pendingValuesRef.current = null;
|
38739
|
-
}
|
38740
|
-
}, intevalTime);
|
38741
|
-
}
|
38742
|
-
return function () {
|
38743
|
-
if (timeoutRef.current) {
|
38744
|
-
clearTimeout(timeoutRef.current);
|
38745
|
-
}
|
38746
|
-
};
|
38747
|
-
}, [values, errors]);
|
38748
38569
|
var inforErrors = errors.coverImage || errors.grade || errors.isbn || errors.preparedType || errors.publicationDate || errors.publisher;
|
38749
38570
|
var contentsErrors = errors.chapters;
|
38750
38571
|
var textbookOwnersErrors = errors.textbookOwners;
|
38751
|
-
var hasError = !_$8.isEmpty(errors);
|
38752
|
-
var isSaved = !lastEdited || _$8.isEqual(values, (_valuesTextbook$curre = valuesTextbook.current) != null ? _valuesTextbook$curre : {});
|
38753
38572
|
return React__default.createElement(formik.Form, null, React__default.createElement(material.Stack, {
|
38754
38573
|
direction: "column",
|
38755
38574
|
gap: 3
|
@@ -38837,45 +38656,7 @@ var PreparedTextbookForm = function PreparedTextbookForm(_ref) {
|
|
38837
38656
|
}), React__default.createElement(material.FormLabel, {
|
38838
38657
|
htmlFor: "type",
|
38839
38658
|
className: "text-center"
|
38840
|
-
}, i18n.t("math"))))), React__default.createElement(material.
|
38841
|
-
flexDirection: "row",
|
38842
|
-
gap: "8px"
|
38843
|
-
}, React__default.createElement(material.Stack, {
|
38844
|
-
padding: "6px 12px",
|
38845
|
-
sx: {
|
38846
|
-
transition: "opacity 0.3s ease",
|
38847
|
-
opacity: saveStatus === PrintStatus.Idle && isSaved ? 0 : 1,
|
38848
|
-
pointerEvents: "none",
|
38849
|
-
gap: "8px",
|
38850
|
-
flexDirection: "row",
|
38851
|
-
justifyContent: "center",
|
38852
|
-
alignItems: "center"
|
38853
|
-
}
|
38854
|
-
}, saveStatus === PrintStatus.Saving && React__default.createElement(ai.AiOutlineLoading3Quarters, {
|
38855
|
-
style: {
|
38856
|
-
animation: "spin 1s linear infinite"
|
38857
|
-
}
|
38858
|
-
}), saveStatus === PrintStatus.Saved && isSaved && React__default.createElement(io5.IoCheckmark, null), saveStatus !== PrintStatus.Saving && !isSaved && React__default.createElement(React.Fragment, null, hasError ? React__default.createElement(md.MdError, {
|
38859
|
-
color: red[900]
|
38860
|
-
}) : React__default.createElement(fa6.FaClockRotateLeft, {
|
38861
|
-
size: "14px"
|
38862
|
-
})), React__default.createElement(material.Typography, {
|
38863
|
-
sx: {
|
38864
|
-
color: theme.palette.grey[700],
|
38865
|
-
fontSize: "14px",
|
38866
|
-
display: "flex",
|
38867
|
-
alignItems: "center",
|
38868
|
-
gap: 1,
|
38869
|
-
"@keyframes spin": {
|
38870
|
-
"0%": {
|
38871
|
-
transform: "rotate(0deg)"
|
38872
|
-
},
|
38873
|
-
"100%": {
|
38874
|
-
transform: "rotate(360deg)"
|
38875
|
-
}
|
38876
|
-
}
|
38877
|
-
}
|
38878
|
-
}, saveStatus === PrintStatus.Saving && i18n.t("saving"), saveStatus === PrintStatus.Saved && isSaved && i18n.t("all_changes_saved"), saveStatus !== PrintStatus.Saving && (selectedTextbook === null || selectedTextbook === void 0 ? void 0 : selectedTextbook.id) && !isSaved && i18n.t("all_changes_are_not_saved_yet"))), React__default.createElement(material.Button, {
|
38659
|
+
}, i18n.t("math"))))), React__default.createElement(material.Box, null, React__default.createElement(material.Button, {
|
38879
38660
|
type: "submit",
|
38880
38661
|
sx: {
|
38881
38662
|
width: "fit-content"
|
@@ -38982,7 +38763,6 @@ var PreparedTextbookView = function PreparedTextbookView(_ref) {
|
|
38982
38763
|
isSuperAdminUser = _useTextbookManagemen.isSuperAdminUser,
|
38983
38764
|
isAdmin = _useTextbookManagemen.isAdmin,
|
38984
38765
|
coverImage = _useTextbookManagemen.coverImage,
|
38985
|
-
handleSaveData = _useTextbookManagemen.handleSaveData,
|
38986
38766
|
selectedTextbook = _useTextbookManagemen.selectedTextbook,
|
38987
38767
|
handleSubmit = _useTextbookManagemen.handleSubmit,
|
38988
38768
|
handleUploadImage = _useTextbookManagemen.handleUploadImage;
|
@@ -39005,9 +38785,7 @@ var PreparedTextbookView = function PreparedTextbookView(_ref) {
|
|
39005
38785
|
isAdmin: isAdmin,
|
39006
38786
|
isSuperAdmin: isSuperAdmin,
|
39007
38787
|
selected: selected,
|
39008
|
-
handleSaveData: handleSaveData,
|
39009
38788
|
textbookId: textbookId,
|
39010
|
-
selectedTextbook: selectedTextbook,
|
39011
38789
|
onChangeTab: handleChangeTab,
|
39012
38790
|
onUploadImage: handleUploadImage,
|
39013
38791
|
coverImage: coverImage,
|
@@ -40524,491 +40302,6 @@ var singleLogo = function singleLogo(_ref) {
|
|
40524
40302
|
}))));
|
40525
40303
|
};
|
40526
40304
|
|
40527
|
-
var TimerItem = function TimerItem(_ref) {
|
40528
|
-
var data = _ref.data,
|
40529
|
-
seconds = _ref.seconds,
|
40530
|
-
loading = _ref.loading,
|
40531
|
-
activeTimerId = _ref.activeTimerId,
|
40532
|
-
onStartOrPauseTimer = _ref.onStartOrPauseTimer;
|
40533
|
-
var theme = material.useTheme();
|
40534
|
-
var _useTranslation = reactI18next.useTranslation(),
|
40535
|
-
t = _useTranslation.t;
|
40536
|
-
var handleStartOrPauseTimer = function handleStartOrPauseTimer() {
|
40537
|
-
onStartOrPauseTimer(data);
|
40538
|
-
};
|
40539
|
-
var isStarted = activeTimerId === data.id && data.status === exports.SubjectTimerStatus.Started;
|
40540
|
-
var displayedTime = React.useMemo(function () {
|
40541
|
-
switch (data.status) {
|
40542
|
-
case exports.SubjectTimerStatus.Started:
|
40543
|
-
return activeTimerId !== data.id ? formatTime$2(Math.floor(data.duration / 1000), t) : formatTime$2(seconds != null ? seconds : 0, t);
|
40544
|
-
case exports.SubjectTimerStatus.NotStarted:
|
40545
|
-
return t("press_to_start");
|
40546
|
-
default:
|
40547
|
-
return formatTime$2(Math.floor(data.duration / 1000), t);
|
40548
|
-
}
|
40549
|
-
}, [data.id, data.status, data.duration, seconds, activeTimerId, t]);
|
40550
|
-
return React__default.createElement(MenuItem, {
|
40551
|
-
className: "" + styles["timer-menu-item"],
|
40552
|
-
sx: {
|
40553
|
-
py: 1,
|
40554
|
-
bgcolor: theme.palette.background.paper,
|
40555
|
-
borderRadius: 0.75,
|
40556
|
-
minHeight: "52px"
|
40557
|
-
},
|
40558
|
-
disabled: loading,
|
40559
|
-
onClick: handleStartOrPauseTimer
|
40560
|
-
}, React__default.createElement(material.Stack, {
|
40561
|
-
direction: "row",
|
40562
|
-
gap: 1,
|
40563
|
-
sx: {
|
40564
|
-
justifyContent: "space-between",
|
40565
|
-
alignItems: "center",
|
40566
|
-
width: "100%"
|
40567
|
-
}
|
40568
|
-
}, React__default.createElement(material.Typography, {
|
40569
|
-
className: styles["subject-name"] + " " + styles["truncate"],
|
40570
|
-
fontSize: "14px",
|
40571
|
-
fontWeight: 600
|
40572
|
-
}, data.name), React__default.createElement(material.Box, {
|
40573
|
-
sx: {
|
40574
|
-
display: "flex",
|
40575
|
-
alignItems: "center",
|
40576
|
-
gap: 1.5
|
40577
|
-
}
|
40578
|
-
}, React__default.createElement(material.Typography, {
|
40579
|
-
className: "" + styles["duration"],
|
40580
|
-
sx: {
|
40581
|
-
color: isStarted ? theme.palette.common.black : theme.palette.success.light,
|
40582
|
-
fontSize: "14px",
|
40583
|
-
fontWeight: 700
|
40584
|
-
}
|
40585
|
-
}, displayedTime), !isStarted && React__default.createElement(material.Box, {
|
40586
|
-
className: "" + styles["icon-start"]
|
40587
|
-
}, React__default.createElement(io5.IoPlayCircleSharp, {
|
40588
|
-
size: 20
|
40589
|
-
})))));
|
40590
|
-
};
|
40591
|
-
var TOTAL_SECONDS_IN_A_MINUTE = 60;
|
40592
|
-
var TOTAL_SECONDS_IN_AN_HOUR = 60 * 60;
|
40593
|
-
var formatTime$2 = function formatTime(totalSeconds, t) {
|
40594
|
-
var hours = Math.floor(totalSeconds / TOTAL_SECONDS_IN_AN_HOUR);
|
40595
|
-
var minutes = Math.floor(totalSeconds % TOTAL_SECONDS_IN_AN_HOUR / TOTAL_SECONDS_IN_A_MINUTE);
|
40596
|
-
var seconds = totalSeconds % TOTAL_SECONDS_IN_A_MINUTE;
|
40597
|
-
if (hours > 0) {
|
40598
|
-
return "" + hours.toString().padStart(2, "0") + t("hour_h") + " " + minutes.toString().padStart(2, "0") + t("minutes") + " " + seconds.toString().padStart(2, "0") + t("seconds");
|
40599
|
-
}
|
40600
|
-
if (minutes > 0) {
|
40601
|
-
return "" + minutes.toString().padStart(2, "0") + t("minutes") + " " + seconds.toString().padStart(2, "0") + t("seconds");
|
40602
|
-
}
|
40603
|
-
return "" + seconds.toString().padStart(2, "0") + t("seconds");
|
40604
|
-
};
|
40605
|
-
|
40606
|
-
var TimerCountItem = function TimerCountItem(_ref) {
|
40607
|
-
var data = _ref.data,
|
40608
|
-
activeTimerId = _ref.activeTimerId,
|
40609
|
-
onChangeTime = _ref.onChangeTime;
|
40610
|
-
var requestAnimationRef = React.useRef(null);
|
40611
|
-
var user = reactRedux.useSelector(function (state) {
|
40612
|
-
var _state$common;
|
40613
|
-
return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.user;
|
40614
|
-
});
|
40615
|
-
React.useEffect(function () {
|
40616
|
-
if (data.status !== exports.SubjectTimerStatus.Started || !(user !== null && user !== void 0 && user.academyDomain) && !(user !== null && user !== void 0 && user.isLearningSpace) || data.id !== activeTimerId) return;
|
40617
|
-
var _animate = function animate() {
|
40618
|
-
var startTime = data.startTime,
|
40619
|
-
lastResumeTime = data.lastResumeTime,
|
40620
|
-
duration = data.duration;
|
40621
|
-
var startOfTime = lastResumeTime !== DATE_TIME_MIN_VALUE ? lastResumeTime : startTime;
|
40622
|
-
if (startOfTime === DATE_TIME_MIN_VALUE) return;
|
40623
|
-
var time = getCountTime(startOfTime, Math.floor(duration / 1000));
|
40624
|
-
if (typeof time !== "number") {
|
40625
|
-
onChangeTime(data, undefined);
|
40626
|
-
return;
|
40627
|
-
}
|
40628
|
-
onChangeTime(data, time);
|
40629
|
-
requestAnimationRef.current = requestAnimationFrame(_animate);
|
40630
|
-
};
|
40631
|
-
requestAnimationRef.current = requestAnimationFrame(_animate);
|
40632
|
-
return function () {
|
40633
|
-
!!requestAnimationRef.current && cancelAnimationFrame(requestAnimationRef.current);
|
40634
|
-
};
|
40635
|
-
}, [JSON.stringify(data), user === null || user === void 0 ? void 0 : user.id, user === null || user === void 0 ? void 0 : user.academyDomain, user === null || user === void 0 ? void 0 : user.isLearningSpace, activeTimerId]);
|
40636
|
-
return React__default.createElement(React.Fragment, null);
|
40637
|
-
};
|
40638
|
-
|
40639
|
-
var formatDate = function formatDate(t, date) {
|
40640
|
-
return utcToLocalTime(date, t("date_format"));
|
40641
|
-
};
|
40642
|
-
var TimerDropdown = function TimerDropdown() {
|
40643
|
-
var _user$academyDomain$t, _user$academyDomain, _user$academyDomain$t2;
|
40644
|
-
var _useTranslation = reactI18next.useTranslation(),
|
40645
|
-
t = _useTranslation.t;
|
40646
|
-
var theme = material.useTheme();
|
40647
|
-
var user = reactRedux.useSelector(function (state) {
|
40648
|
-
var _state$common;
|
40649
|
-
return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.user;
|
40650
|
-
});
|
40651
|
-
var _useState = React.useState(null),
|
40652
|
-
open = _useState[0],
|
40653
|
-
setOpen = _useState[1];
|
40654
|
-
var _useState2 = React.useState([]),
|
40655
|
-
timers = _useState2[0],
|
40656
|
-
setTimers = _useState2[1];
|
40657
|
-
var _useState3 = React.useState(),
|
40658
|
-
seconds = _useState3[0],
|
40659
|
-
setSeconds = _useState3[1];
|
40660
|
-
var _useState4 = React.useState(),
|
40661
|
-
activeTimerId = _useState4[0],
|
40662
|
-
setActiveTimerId = _useState4[1];
|
40663
|
-
var _useState5 = React.useState(false),
|
40664
|
-
loadingItem = _useState5[0],
|
40665
|
-
setLoadingItem = _useState5[1];
|
40666
|
-
var _useState6 = React.useState(false),
|
40667
|
-
isFetching = _useState6[0],
|
40668
|
-
setFetching = _useState6[1];
|
40669
|
-
var fetchedRef = React.useRef();
|
40670
|
-
var academyDomain = (_user$academyDomain$t = user === null || user === void 0 ? void 0 : (_user$academyDomain = user.academyDomain) === null || _user$academyDomain === void 0 ? void 0 : (_user$academyDomain$t2 = _user$academyDomain.toLowerCase) === null || _user$academyDomain$t2 === void 0 ? void 0 : _user$academyDomain$t2.call(_user$academyDomain)) != null ? _user$academyDomain$t : "";
|
40671
|
-
var handleChangeTime = function handleChangeTime(data, time) {
|
40672
|
-
if (!(user !== null && user !== void 0 && user.id) || !academyDomain && !(user !== null && user !== void 0 && user.isLearningSpace)) return;
|
40673
|
-
if (academyDomain !== fetchedRef.current && data.id !== activeTimerId) return;
|
40674
|
-
setSeconds(time);
|
40675
|
-
var key = user.id + "-" + data.id + "-" + SUBJECT_TIMER_KEY + academyDomain;
|
40676
|
-
saveDuration(key, time * 1000);
|
40677
|
-
};
|
40678
|
-
var handleOpen = function handleOpen(event) {
|
40679
|
-
setOpen(event.currentTarget);
|
40680
|
-
};
|
40681
|
-
var handleClose = function handleClose() {
|
40682
|
-
setOpen(null);
|
40683
|
-
};
|
40684
|
-
var handleStartOrPauseTimer = function handleStartOrPauseTimer(data) {
|
40685
|
-
try {
|
40686
|
-
var _temp2 = function _temp2(_result3) {
|
40687
|
-
if (_exit) return _result3;
|
40688
|
-
setLoadingItem(false);
|
40689
|
-
};
|
40690
|
-
var _exit = false;
|
40691
|
-
var isActive = activeTimerId === data.id;
|
40692
|
-
var isPaused = data.status === exports.SubjectTimerStatus.Paused;
|
40693
|
-
setLoadingItem(true);
|
40694
|
-
var _temp = _catch(function () {
|
40695
|
-
return Promise.resolve(handlePauseAllTimers(data.id)).then(function () {
|
40696
|
-
return function () {
|
40697
|
-
if (data.recordId) {
|
40698
|
-
return function () {
|
40699
|
-
if (!isActive && !isPaused) {
|
40700
|
-
setActiveTimerId(data.id);
|
40701
|
-
setTimers(function (timers) {
|
40702
|
-
return timers.map(function (timer) {
|
40703
|
-
return timer.id === data.id ? _extends({}, timer, {
|
40704
|
-
lastResumeTime: moment().utc().toISOString()
|
40705
|
-
}) : timer;
|
40706
|
-
});
|
40707
|
-
});
|
40708
|
-
setLoadingItem(false);
|
40709
|
-
_exit = true;
|
40710
|
-
} else {
|
40711
|
-
return Promise.resolve(pauseStudentSubjectApi(data.id, data.recordId, {
|
40712
|
-
status: isPaused ? exports.SubjectTimerStatus.Started : exports.SubjectTimerStatus.Paused,
|
40713
|
-
startTime: isPaused ? moment().utc().valueOf() : 0,
|
40714
|
-
pauseTime: !isPaused ? moment().utc().valueOf() : 0,
|
40715
|
-
duration: isActive && seconds ? seconds * 1000 : data.duration
|
40716
|
-
})).then(function (res) {
|
40717
|
-
setTimers(function (timers) {
|
40718
|
-
return timers.map(function (timer) {
|
40719
|
-
return timer.id === data.id ? res.data : timer;
|
40720
|
-
});
|
40721
|
-
});
|
40722
|
-
setActiveTimerId(!isPaused && isActive ? undefined : data.id);
|
40723
|
-
});
|
40724
|
-
}
|
40725
|
-
}();
|
40726
|
-
} else {
|
40727
|
-
return Promise.resolve(startStudentSubjectTimerApi(data.id)).then(function (res) {
|
40728
|
-
setTimers(function (timers) {
|
40729
|
-
return timers.map(function (timer) {
|
40730
|
-
return timer.id === data.id ? res.data : timer;
|
40731
|
-
});
|
40732
|
-
});
|
40733
|
-
setActiveTimerId(!isPaused && isActive ? undefined : data.id);
|
40734
|
-
});
|
40735
|
-
}
|
40736
|
-
}();
|
40737
|
-
});
|
40738
|
-
}, function () {
|
40739
|
-
reactToastify.toast.error(t(isPaused ? "failed_to_start_the_subject_name" : "failed_to_pause_the_subject_name", {
|
40740
|
-
name: data.name
|
40741
|
-
}));
|
40742
|
-
});
|
40743
|
-
return Promise.resolve(_temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp));
|
40744
|
-
} catch (e) {
|
40745
|
-
return Promise.reject(e);
|
40746
|
-
}
|
40747
|
-
};
|
40748
|
-
var handlePauseAllTimers = function handlePauseAllTimers(exceptId) {
|
40749
|
-
try {
|
40750
|
-
!exceptId && setLoadingItem(true);
|
40751
|
-
var tasks = timers.filter(function (i) {
|
40752
|
-
return i.status === exports.SubjectTimerStatus.Started && i.id !== exceptId;
|
40753
|
-
}).map(function (i) {
|
40754
|
-
return handlePauseTimer(i);
|
40755
|
-
});
|
40756
|
-
return Promise.resolve(Promise.all(tasks)).then(function () {
|
40757
|
-
!exceptId && setLoadingItem(false);
|
40758
|
-
});
|
40759
|
-
} catch (e) {
|
40760
|
-
return Promise.reject(e);
|
40761
|
-
}
|
40762
|
-
};
|
40763
|
-
var handlePauseTimer = function handlePauseTimer(data, updateState) {
|
40764
|
-
if (updateState === void 0) {
|
40765
|
-
updateState = true;
|
40766
|
-
}
|
40767
|
-
try {
|
40768
|
-
if (data.status === exports.SubjectTimerStatus.Paused) return Promise.resolve(data);
|
40769
|
-
return Promise.resolve(_catch(function () {
|
40770
|
-
return Promise.resolve(pauseStudentSubjectApi(data.id, data.recordId, {
|
40771
|
-
status: exports.SubjectTimerStatus.Paused,
|
40772
|
-
duration: activeTimerId === data.id && seconds ? seconds * 1000 : data.duration,
|
40773
|
-
pauseTime: moment().utc().valueOf()
|
40774
|
-
})).then(function (res) {
|
40775
|
-
if (updateState) setTimers(function (state) {
|
40776
|
-
return state.map(function (i) {
|
40777
|
-
return i.id === data.id ? res.data : i;
|
40778
|
-
});
|
40779
|
-
});
|
40780
|
-
return res.data;
|
40781
|
-
});
|
40782
|
-
}, function () {
|
40783
|
-
activeTimerId === data.id && reactToastify.toast.error(t("failed_to_pause_the_subject_name", {
|
40784
|
-
name: data.name
|
40785
|
-
}));
|
40786
|
-
}));
|
40787
|
-
} catch (e) {
|
40788
|
-
return Promise.reject(e);
|
40789
|
-
}
|
40790
|
-
};
|
40791
|
-
var getDataFromLocalStorage = React.useCallback(function (items) {
|
40792
|
-
if (fetchedRef.current !== academyDomain) return [];
|
40793
|
-
return items.map(function (item) {
|
40794
|
-
var key = (user === null || user === void 0 ? void 0 : user.id) + "-" + item.id + "-" + SUBJECT_TIMER_KEY + academyDomain;
|
40795
|
-
var duration = getLocalDuration(key, item);
|
40796
|
-
var lastResumeTime = moment().utc().toISOString();
|
40797
|
-
return _extends({}, item, {
|
40798
|
-
duration: duration !== null ? duration : item.duration,
|
40799
|
-
lastResumeTime: lastResumeTime
|
40800
|
-
});
|
40801
|
-
});
|
40802
|
-
}, [user === null || user === void 0 ? void 0 : user.id, academyDomain]);
|
40803
|
-
React.useEffect(function () {
|
40804
|
-
var fetchData = function fetchData() {
|
40805
|
-
try {
|
40806
|
-
var _temp4 = function _temp4() {
|
40807
|
-
setFetching(false);
|
40808
|
-
};
|
40809
|
-
if (!(user !== null && user !== void 0 && user.id) || !academyDomain && !(user !== null && user !== void 0 && user.isLearningSpace)) return Promise.resolve();
|
40810
|
-
if (fetchedRef.current == academyDomain && !open) return Promise.resolve();
|
40811
|
-
setFetching(true);
|
40812
|
-
var _temp3 = _catch(function () {
|
40813
|
-
return Promise.resolve(getStudentSubjectListApi()).then(function (res) {
|
40814
|
-
var _items$find;
|
40815
|
-
var _res$data$items = res.data.items,
|
40816
|
-
items = _res$data$items === void 0 ? [] : _res$data$items;
|
40817
|
-
fetchedRef.current = academyDomain;
|
40818
|
-
setTimers(getDataFromLocalStorage(items));
|
40819
|
-
setActiveTimerId((_items$find = items.find(function (i) {
|
40820
|
-
return i.status === exports.SubjectTimerStatus.Started;
|
40821
|
-
})) === null || _items$find === void 0 ? void 0 : _items$find.id);
|
40822
|
-
});
|
40823
|
-
}, function (error) {
|
40824
|
-
reactToastify.toast.error(getErrorMessage(t, error));
|
40825
|
-
});
|
40826
|
-
return Promise.resolve(_temp3 && _temp3.then ? _temp3.then(_temp4) : _temp4(_temp3));
|
40827
|
-
} catch (e) {
|
40828
|
-
return Promise.reject(e);
|
40829
|
-
}
|
40830
|
-
};
|
40831
|
-
fetchData();
|
40832
|
-
}, [t, getDataFromLocalStorage, user === null || user === void 0 ? void 0 : user.isLearningSpace, open]);
|
40833
|
-
var today = formatDate(t);
|
40834
|
-
var isRunning = timers.some(function (timer) {
|
40835
|
-
return timer.status === exports.SubjectTimerStatus.Started;
|
40836
|
-
});
|
40837
|
-
var selectedTimer = timers.find(function (i) {
|
40838
|
-
return i.id === activeTimerId;
|
40839
|
-
});
|
40840
|
-
return React__default.createElement(React.Fragment, null, React__default.createElement(IconButton, {
|
40841
|
-
onClick: handleOpen,
|
40842
|
-
sx: {
|
40843
|
-
width: 44,
|
40844
|
-
height: 44,
|
40845
|
-
mx: 1,
|
40846
|
-
borderRadius: "6px",
|
40847
|
-
padding: "8px",
|
40848
|
-
background: !isRunning ? grey[50] : green[100],
|
40849
|
-
"&: hover": {
|
40850
|
-
background: !isRunning ? grey[200] : green[200]
|
40851
|
-
}
|
40852
|
-
}
|
40853
|
-
}, React__default.createElement(material.Stack, {
|
40854
|
-
justifyContent: "center",
|
40855
|
-
alignItems: "center",
|
40856
|
-
width: "100%",
|
40857
|
-
height: "100%",
|
40858
|
-
sx: {
|
40859
|
-
borderRadius: "50%",
|
40860
|
-
backgroundColor: "#FFF"
|
40861
|
-
}
|
40862
|
-
}, React__default.createElement(io5.IoTimer, {
|
40863
|
-
color: !isRunning ? grey[700] : green[500],
|
40864
|
-
size: "16.25px"
|
40865
|
-
}))), selectedTimer && React__default.createElement(TimerCountItem, {
|
40866
|
-
data: selectedTimer,
|
40867
|
-
activeTimerId: activeTimerId,
|
40868
|
-
onChangeTime: handleChangeTime
|
40869
|
-
}), React__default.createElement(Popover, {
|
40870
|
-
open: !!open,
|
40871
|
-
anchorEl: open,
|
40872
|
-
onClose: handleClose,
|
40873
|
-
anchorOrigin: {
|
40874
|
-
vertical: "bottom",
|
40875
|
-
horizontal: "right"
|
40876
|
-
},
|
40877
|
-
transformOrigin: {
|
40878
|
-
vertical: "top",
|
40879
|
-
horizontal: "right"
|
40880
|
-
},
|
40881
|
-
slotProps: {
|
40882
|
-
paper: {
|
40883
|
-
sx: {
|
40884
|
-
px: 2,
|
40885
|
-
mt: 1,
|
40886
|
-
ml: 0.75,
|
40887
|
-
width: 320,
|
40888
|
-
borderRadius: 2,
|
40889
|
-
boxShadow: 3,
|
40890
|
-
bgcolor: theme.palette.grey[50]
|
40891
|
-
}
|
40892
|
-
}
|
40893
|
-
}
|
40894
|
-
}, React__default.createElement(material.Box, {
|
40895
|
-
sx: {
|
40896
|
-
py: 2,
|
40897
|
-
display: "flex",
|
40898
|
-
alignItems: "center",
|
40899
|
-
justifyContent: "space-between"
|
40900
|
-
}
|
40901
|
-
}, React__default.createElement(material.Box, {
|
40902
|
-
sx: {
|
40903
|
-
display: "flex",
|
40904
|
-
gap: 1,
|
40905
|
-
alignItems: "center"
|
40906
|
-
}
|
40907
|
-
}, React__default.createElement(material.Box, {
|
40908
|
-
display: "flex",
|
40909
|
-
alignItems: "center"
|
40910
|
-
}, React__default.createElement(io5.IoTimer, null)), React__default.createElement(material.Typography, {
|
40911
|
-
variant: "subtitle1",
|
40912
|
-
fontWeight: "bold",
|
40913
|
-
fontSize: "14px"
|
40914
|
-
}, t("study_timer"))), React__default.createElement(material.Typography, {
|
40915
|
-
color: "textSecondary",
|
40916
|
-
whiteSpace: "nowrap",
|
40917
|
-
fontSize: "14px"
|
40918
|
-
}, today)), React__default.createElement(material.Divider, {
|
40919
|
-
sx: {
|
40920
|
-
bgcolor: theme.palette.grey[700]
|
40921
|
-
}
|
40922
|
-
}), React__default.createElement(material.Stack, {
|
40923
|
-
className: "" + styles["timer-menu"],
|
40924
|
-
gap: 1.5,
|
40925
|
-
flexDirection: "column",
|
40926
|
-
sx: {
|
40927
|
-
py: 2,
|
40928
|
-
maxHeight: "360px"
|
40929
|
-
}
|
40930
|
-
}, !isFetching && React__default.createElement(ListView, {
|
40931
|
-
data: timers,
|
40932
|
-
render: function render(item, index) {
|
40933
|
-
return React__default.createElement(TimerItem, {
|
40934
|
-
key: index,
|
40935
|
-
data: item,
|
40936
|
-
loading: loadingItem,
|
40937
|
-
seconds: activeTimerId === item.id ? seconds : undefined,
|
40938
|
-
activeTimerId: activeTimerId,
|
40939
|
-
onStartOrPauseTimer: handleStartOrPauseTimer
|
40940
|
-
});
|
40941
|
-
}
|
40942
|
-
}), isFetching && React__default.createElement(material.Stack, {
|
40943
|
-
sx: {
|
40944
|
-
width: "100%",
|
40945
|
-
py: 2
|
40946
|
-
},
|
40947
|
-
justifyContent: "center",
|
40948
|
-
alignItems: "center"
|
40949
|
-
}, React__default.createElement(material.Typography, {
|
40950
|
-
className: "text-muted"
|
40951
|
-
}, React__default.createElement(material.CircularProgress, {
|
40952
|
-
size: "16px",
|
40953
|
-
color: "success"
|
40954
|
-
}))), !timers.length && !isFetching && React__default.createElement(material.Box, null, React__default.createElement(material.Typography, {
|
40955
|
-
className: "text-muted"
|
40956
|
-
}, t("no_data")))), React__default.createElement(material.Divider, {
|
40957
|
-
sx: {
|
40958
|
-
bgcolor: theme.palette.grey[700]
|
40959
|
-
}
|
40960
|
-
}), React__default.createElement(material.Box, {
|
40961
|
-
sx: {
|
40962
|
-
p: 2,
|
40963
|
-
textAlign: "right"
|
40964
|
-
}
|
40965
|
-
}, React__default.createElement(material.Button, {
|
40966
|
-
disableTouchRipple: true,
|
40967
|
-
onClick: function onClick() {
|
40968
|
-
return handlePauseAllTimers();
|
40969
|
-
},
|
40970
|
-
disabled: loadingItem,
|
40971
|
-
sx: {
|
40972
|
-
fontWeight: 700,
|
40973
|
-
color: theme.palette.success.main,
|
40974
|
-
padding: "8px 12px",
|
40975
|
-
bgcolor: theme.palette.background.paper,
|
40976
|
-
"&:hover": {
|
40977
|
-
bgcolor: theme.palette.grey[200]
|
40978
|
-
},
|
40979
|
-
"&:disabled": {
|
40980
|
-
opacity: 0.5
|
40981
|
-
}
|
40982
|
-
}
|
40983
|
-
}, loadingItem ? t("saving") : t("pause")))));
|
40984
|
-
};
|
40985
|
-
var SUBJECT_TIMER_KEY = "stk";
|
40986
|
-
var saveDuration = function saveDuration(key, duration) {
|
40987
|
-
localStorage.setItem(key, "" + duration);
|
40988
|
-
};
|
40989
|
-
var getLocalDuration = function getLocalDuration(key, timer) {
|
40990
|
-
try {
|
40991
|
-
var res = localStorage.getItem(key);
|
40992
|
-
var duration = +(res != null ? res : "");
|
40993
|
-
if (!duration || Number.isNaN(duration) || duration <= timer.duration) return null;
|
40994
|
-
return duration;
|
40995
|
-
} catch (error) {
|
40996
|
-
return null;
|
40997
|
-
}
|
40998
|
-
};
|
40999
|
-
|
41000
|
-
var HeaderLink = function HeaderLink(_ref) {
|
41001
|
-
var data = _ref.data,
|
41002
|
-
render = _ref.render;
|
41003
|
-
var activePaths = data.activePaths,
|
41004
|
-
path = data.path;
|
41005
|
-
var pathname = window.location.pathname.toLowerCase();
|
41006
|
-
var isActive = (activePaths === null || activePaths === void 0 ? void 0 : activePaths.some(function (a) {
|
41007
|
-
return pathname.startsWith(a);
|
41008
|
-
})) || pathname.startsWith(path);
|
41009
|
-
return React__default.createElement(React.Fragment, null, render(data, isActive));
|
41010
|
-
};
|
41011
|
-
|
41012
40305
|
var Header = function Header(_ref) {
|
41013
40306
|
var academyListRoute = _ref.academyListRoute,
|
41014
40307
|
homeRoute = _ref.homeRoute,
|
@@ -41131,9 +40424,7 @@ var Header = function Header(_ref) {
|
|
41131
40424
|
justifyContent: "center",
|
41132
40425
|
height: "100%",
|
41133
40426
|
className: styles["logo"] + " d-flex d-lg-none"
|
41134
|
-
}, React__default.createElement(singleLogo, null))),
|
41135
|
-
className: "me-2 ms-2"
|
41136
|
-
}, React__default.createElement(TimerDropdown, null)), React__default.createElement(material.Stack, {
|
40427
|
+
}, React__default.createElement(singleLogo, null))), React__default.createElement(material.Stack, {
|
41137
40428
|
className: "me-2",
|
41138
40429
|
display: "none"
|
41139
40430
|
}, React__default.createElement(TheLanguageDropdown, null)), showAnnouncement && renderNotificationLink && React__default.createElement(AnnouncementContainer, {
|
@@ -41142,6 +40433,17 @@ var Header = function Header(_ref) {
|
|
41142
40433
|
renderViewNoteLink: renderViewNoteLink
|
41143
40434
|
})));
|
41144
40435
|
};
|
40436
|
+
var HeaderLink = function HeaderLink(_ref3) {
|
40437
|
+
var data = _ref3.data,
|
40438
|
+
render = _ref3.render;
|
40439
|
+
var activePaths = data.activePaths,
|
40440
|
+
path = data.path;
|
40441
|
+
var pathname = location.pathname.toLowerCase();
|
40442
|
+
var isActive = (activePaths === null || activePaths === void 0 ? void 0 : activePaths.some(function (a) {
|
40443
|
+
return pathname.startsWith(a);
|
40444
|
+
})) || pathname.startsWith(path);
|
40445
|
+
return React__default.createElement(React.Fragment, null, render(data, isActive));
|
40446
|
+
};
|
41145
40447
|
|
41146
40448
|
var useLayoutContext = function useLayoutContext(role, showLoadingAcademy, domain) {
|
41147
40449
|
var _currentPusher$connec2;
|
@@ -41526,7 +40828,6 @@ exports.formatTime = formatTime;
|
|
41526
40828
|
exports.formatTimeSecond = formatTimeSecond;
|
41527
40829
|
exports.getAcademyDomain = getAcademyDomain;
|
41528
40830
|
exports.getAccessToken = getAccessToken;
|
41529
|
-
exports.getCountTime = getCountTime;
|
41530
40831
|
exports.getErrorMessage = getErrorMessage;
|
41531
40832
|
exports.getLanguage = getLanguage;
|
41532
40833
|
exports.getLearningSpace = getLearningSpace;
|