touchstudy-core 0.1.174 → 0.1.175
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/configs/types.d.ts +2 -2
- 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.js +58 -257
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +60 -259
- package/dist/index.modern.js.map +1 -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'));
|
@@ -1030,7 +1029,6 @@ var teacher_required = "선생님은 필수입니다";
|
|
1030
1029
|
var total_users = "총 사용자";
|
1031
1030
|
var added_date = "추가된 날짜";
|
1032
1031
|
var sync_exam_results = "시험 결과 동기화";
|
1033
|
-
var sync_textbook_results = "교재 결과 동기화";
|
1034
1032
|
var update_data_fail = "데이터 업데이트 실패";
|
1035
1033
|
var add_students_to_class = "수업에 학생 추가";
|
1036
1034
|
var add_teachers_to_class = "수업에 교사 추가";
|
@@ -1041,13 +1039,9 @@ var question_management = "질문 관리";
|
|
1041
1039
|
var student_data = "학생 데이터";
|
1042
1040
|
var problem_number_question_chart = "문제 {{number}}번";
|
1043
1041
|
var are_you_sure_to_sync_exam_results_to_academy = "시험 결과를 아카데미 {{ academyName }}에 동기화하시겠습니까(백그라운드에서 실행되며 시간이 다소 소요됨)";
|
1044
|
-
var are_you_sure_to_sync_textbook_results_to_academy = "교재 학습 결과를 아카데미 {{ academyName }}에 동기화하시겠습니까? (백그라운드에서 실행되며 시간이 다소 소요됨)";
|
1045
1042
|
var messages = {
|
1046
|
-
exam_sessions_are_being_synchronized: "{{ total }} 개의 시험 세션이 동기화되고 있습니다"
|
1047
|
-
textbook_sessions_are_being_synchronized: "{{ total }} 개의 교재 학습 세션이 동기화되고 있습니다"
|
1043
|
+
exam_sessions_are_being_synchronized: "{{ total }} 개의 시험 세션이 동기화되고 있습니다"
|
1048
1044
|
};
|
1049
|
-
var sync_exam = "시험 동기화";
|
1050
|
-
var sync_textbook = "교재 동기화";
|
1051
1045
|
var submit = "제출하다";
|
1052
1046
|
var must_select_a_teacher_first = "먼저 교사를 선택해야 합니다";
|
1053
1047
|
var student_grade_is_invalid = "학생 등급은 1에서 12 사이여야 합니다";
|
@@ -1494,8 +1488,6 @@ var order_matters = "순서 상관 있음";
|
|
1494
1488
|
var order_does_not_matter = "순서 상관 없음";
|
1495
1489
|
var synonym_processing = "답 이음동의어 처리";
|
1496
1490
|
var compare_type = "비교 유형";
|
1497
|
-
var all_changes_saved = "모든 변경 사항이 저장되었습니다";
|
1498
|
-
var saving = "절약";
|
1499
1491
|
var textbook_name = "교재 이름";
|
1500
1492
|
var korean_language = "국어";
|
1501
1493
|
var answer_cannot_be_empty = "답변은 비워둘 수 없습니다";
|
@@ -1542,7 +1534,6 @@ var admin_to_teachers = "관리자에서 교사들에게";
|
|
1542
1534
|
var teacher_to_teachers = "교사에서 교사들에게";
|
1543
1535
|
var student_required = "학생은 필수입니다";
|
1544
1536
|
var teachers_required = "교사가 필요합니다";
|
1545
|
-
var all_changes_are_not_saved_yet = "아직 모든 변경 사항이 저장되지 않았습니다";
|
1546
1537
|
var lang_ko = {
|
1547
1538
|
problem_solving: problem_solving,
|
1548
1539
|
my_story: my_story,
|
@@ -2222,7 +2213,6 @@ var lang_ko = {
|
|
2222
2213
|
total_users: total_users,
|
2223
2214
|
added_date: added_date,
|
2224
2215
|
sync_exam_results: sync_exam_results,
|
2225
|
-
sync_textbook_results: sync_textbook_results,
|
2226
2216
|
update_data_fail: update_data_fail,
|
2227
2217
|
add_students_to_class: add_students_to_class,
|
2228
2218
|
add_teachers_to_class: add_teachers_to_class,
|
@@ -2233,10 +2223,7 @@ var lang_ko = {
|
|
2233
2223
|
student_data: student_data,
|
2234
2224
|
problem_number_question_chart: problem_number_question_chart,
|
2235
2225
|
are_you_sure_to_sync_exam_results_to_academy: are_you_sure_to_sync_exam_results_to_academy,
|
2236
|
-
are_you_sure_to_sync_textbook_results_to_academy: are_you_sure_to_sync_textbook_results_to_academy,
|
2237
2226
|
messages: messages,
|
2238
|
-
sync_exam: sync_exam,
|
2239
|
-
sync_textbook: sync_textbook,
|
2240
2227
|
submit: submit,
|
2241
2228
|
must_select_a_teacher_first: must_select_a_teacher_first,
|
2242
2229
|
student_grade_is_invalid: student_grade_is_invalid,
|
@@ -2671,8 +2658,6 @@ var lang_ko = {
|
|
2671
2658
|
order_does_not_matter: order_does_not_matter,
|
2672
2659
|
synonym_processing: synonym_processing,
|
2673
2660
|
compare_type: compare_type,
|
2674
|
-
all_changes_saved: all_changes_saved,
|
2675
|
-
saving: saving,
|
2676
2661
|
textbook_name: textbook_name,
|
2677
2662
|
korean_language: korean_language,
|
2678
2663
|
answer_cannot_be_empty: answer_cannot_be_empty,
|
@@ -2718,8 +2703,7 @@ var lang_ko = {
|
|
2718
2703
|
admin_to_teachers: admin_to_teachers,
|
2719
2704
|
teacher_to_teachers: teacher_to_teachers,
|
2720
2705
|
student_required: student_required,
|
2721
|
-
teachers_required: teachers_required
|
2722
|
-
all_changes_are_not_saved_yet: all_changes_are_not_saved_yet
|
2706
|
+
teachers_required: teachers_required
|
2723
2707
|
};
|
2724
2708
|
|
2725
2709
|
var problem_solving$1 = "Problem Solving";
|
@@ -3406,7 +3390,6 @@ var teacher_required$1 = "Teacher is required";
|
|
3406
3390
|
var total_users$1 = "Total users";
|
3407
3391
|
var added_date$1 = "Added date";
|
3408
3392
|
var sync_exam_results$1 = "Sync exam results";
|
3409
|
-
var sync_textbook_results$1 = "Sync textbook results";
|
3410
3393
|
var update_data_fail$1 = "Update data fail";
|
3411
3394
|
var add_students_to_class$1 = "Add students to class";
|
3412
3395
|
var add_teachers_to_class$1 = "Add teachers to class";
|
@@ -3417,13 +3400,9 @@ var question_management$1 = "Question Management";
|
|
3417
3400
|
var student_data$1 = "Student Data";
|
3418
3401
|
var problem_number_question_chart$1 = "Q. {{number}}";
|
3419
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)";
|
3420
|
-
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)";
|
3421
3403
|
var messages$1 = {
|
3422
|
-
exam_sessions_are_being_synchronized: "{{ total }} exam sessions are being synchronized"
|
3423
|
-
textbook_sessions_are_being_synchronized: "{{ total }} textbook sessions are being synchronized"
|
3404
|
+
exam_sessions_are_being_synchronized: "{{ total }} exam sessions are being synchronized"
|
3424
3405
|
};
|
3425
|
-
var sync_exam$1 = "Sync Exam";
|
3426
|
-
var sync_textbook$1 = "Sync Textbook";
|
3427
3406
|
var submit$1 = "Submit";
|
3428
3407
|
var must_select_a_teacher_first$1 = "Must select a teacher first";
|
3429
3408
|
var student_grade_is_invalid$1 = "Student grade must be from 1 to 12";
|
@@ -3871,8 +3850,6 @@ var order_matters$1 = "Order matters";
|
|
3871
3850
|
var order_does_not_matter$1 = "Order doesn't matter";
|
3872
3851
|
var synonym_processing$1 = "Answer Synonym processing";
|
3873
3852
|
var compare_type$1 = "Compare Type";
|
3874
|
-
var all_changes_saved$1 = "All changes saved";
|
3875
|
-
var saving$1 = "Saving";
|
3876
3853
|
var textbook_name$1 = "Textbook name";
|
3877
3854
|
var korean_language$1 = "Korean";
|
3878
3855
|
var answer_cannot_be_empty$1 = "Answer cannot be empty";
|
@@ -3919,7 +3896,6 @@ var admin_to_teachers$1 = "Admin to teachers";
|
|
3919
3896
|
var teacher_to_teachers$1 = "Teacher to teachers";
|
3920
3897
|
var student_required$1 = "Student is required";
|
3921
3898
|
var teachers_required$1 = "Teachers are required";
|
3922
|
-
var all_changes_are_not_saved_yet$1 = "All changes are not saved yet";
|
3923
3899
|
var lang_en = {
|
3924
3900
|
problem_solving: problem_solving$1,
|
3925
3901
|
my_story: my_story$1,
|
@@ -4600,7 +4576,6 @@ var lang_en = {
|
|
4600
4576
|
total_users: total_users$1,
|
4601
4577
|
added_date: added_date$1,
|
4602
4578
|
sync_exam_results: sync_exam_results$1,
|
4603
|
-
sync_textbook_results: sync_textbook_results$1,
|
4604
4579
|
update_data_fail: update_data_fail$1,
|
4605
4580
|
add_students_to_class: add_students_to_class$1,
|
4606
4581
|
add_teachers_to_class: add_teachers_to_class$1,
|
@@ -4611,10 +4586,7 @@ var lang_en = {
|
|
4611
4586
|
student_data: student_data$1,
|
4612
4587
|
problem_number_question_chart: problem_number_question_chart$1,
|
4613
4588
|
are_you_sure_to_sync_exam_results_to_academy: are_you_sure_to_sync_exam_results_to_academy$1,
|
4614
|
-
are_you_sure_to_sync_textbook_results_to_academy: are_you_sure_to_sync_textbook_results_to_academy$1,
|
4615
4589
|
messages: messages$1,
|
4616
|
-
sync_exam: sync_exam$1,
|
4617
|
-
sync_textbook: sync_textbook$1,
|
4618
4590
|
submit: submit$1,
|
4619
4591
|
must_select_a_teacher_first: must_select_a_teacher_first$1,
|
4620
4592
|
student_grade_is_invalid: student_grade_is_invalid$1,
|
@@ -5050,8 +5022,6 @@ var lang_en = {
|
|
5050
5022
|
order_does_not_matter: order_does_not_matter$1,
|
5051
5023
|
synonym_processing: synonym_processing$1,
|
5052
5024
|
compare_type: compare_type$1,
|
5053
|
-
all_changes_saved: all_changes_saved$1,
|
5054
|
-
saving: saving$1,
|
5055
5025
|
textbook_name: textbook_name$1,
|
5056
5026
|
korean_language: korean_language$1,
|
5057
5027
|
answer_cannot_be_empty: answer_cannot_be_empty$1,
|
@@ -5097,8 +5067,7 @@ var lang_en = {
|
|
5097
5067
|
admin_to_teachers: admin_to_teachers$1,
|
5098
5068
|
teacher_to_teachers: teacher_to_teachers$1,
|
5099
5069
|
student_required: student_required$1,
|
5100
|
-
teachers_required: teachers_required$1
|
5101
|
-
all_changes_are_not_saved_yet: all_changes_are_not_saved_yet$1
|
5070
|
+
teachers_required: teachers_required$1
|
5102
5071
|
};
|
5103
5072
|
|
5104
5073
|
i18n__default.use(reactI18next.initReactI18next).init({
|
@@ -6129,6 +6098,7 @@ var CustomSelect = function CustomSelect(_ref) {
|
|
6129
6098
|
Option: CustomOption
|
6130
6099
|
},
|
6131
6100
|
styles: _extends({}, customStyles, styles),
|
6101
|
+
isMulti: isMulti,
|
6132
6102
|
placeholder: t("select_placeholder")
|
6133
6103
|
}, rest));
|
6134
6104
|
};
|
@@ -6293,12 +6263,6 @@ var HighSchoolGrade;
|
|
6293
6263
|
TextbookEditorType[TextbookEditorType["Korea"] = 1] = "Korea";
|
6294
6264
|
TextbookEditorType[TextbookEditorType["Math"] = 2] = "Math";
|
6295
6265
|
})(exports.TextbookEditorType || (exports.TextbookEditorType = {}));
|
6296
|
-
var PrintStatus;
|
6297
|
-
(function (PrintStatus) {
|
6298
|
-
PrintStatus[PrintStatus["Idle"] = 0] = "Idle";
|
6299
|
-
PrintStatus[PrintStatus["Saving"] = 1] = "Saving";
|
6300
|
-
PrintStatus[PrintStatus["Saved"] = 2] = "Saved";
|
6301
|
-
})(PrintStatus || (PrintStatus = {}));
|
6302
6266
|
|
6303
6267
|
(function (SchoolType) {
|
6304
6268
|
SchoolType[SchoolType["Default"] = 0] = "Default";
|
@@ -13017,8 +12981,8 @@ var DayOfWeek;
|
|
13017
12981
|
})(DayOfWeek || (DayOfWeek = {}));
|
13018
12982
|
var TeacherSortBy;
|
13019
12983
|
(function (TeacherSortBy) {
|
13020
|
-
TeacherSortBy["Name"] = "UserProfile.FullName";
|
13021
|
-
TeacherSortBy["Email"] = "UserProfile.Email";
|
12984
|
+
TeacherSortBy["Name"] = "User.UserProfile.FullName";
|
12985
|
+
TeacherSortBy["Email"] = "User.UserProfile.Email";
|
13022
12986
|
})(TeacherSortBy || (TeacherSortBy = {}));
|
13023
12987
|
var ClassStatus;
|
13024
12988
|
(function (ClassStatus) {
|
@@ -13296,23 +13260,29 @@ var DEFAULT_USER_FILTERS = {
|
|
13296
13260
|
|
13297
13261
|
var styles$3 = {"avatar":"_2rJkZ","date-picker":"_1iqE2","time-picker":"_20xtc","teacher-selector-wrapper":"_3L1Oj"};
|
13298
13262
|
|
13299
|
-
var _excluded$7 = ["teachers", "value"];
|
13300
13263
|
var TeacherSelector = function TeacherSelector(_ref) {
|
13301
13264
|
var teachers = _ref.teachers,
|
13302
|
-
value = _ref.value
|
13303
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$7);
|
13265
|
+
value = _ref.value;
|
13304
13266
|
var teacherOptions = teachers.map(function (i) {
|
13305
13267
|
return {
|
13306
13268
|
label: i.teacherName + "/" + i.teacherEmail,
|
13307
13269
|
value: i.id
|
13308
13270
|
};
|
13309
13271
|
});
|
13310
|
-
return React__default.createElement(CustomAsyncSelect,
|
13272
|
+
return React__default.createElement(CustomAsyncSelect, {
|
13311
13273
|
options: teacherOptions,
|
13312
|
-
value: value
|
13313
|
-
|
13274
|
+
value: value,
|
13275
|
+
menuPlacement: "bottom",
|
13276
|
+
styles: {
|
13277
|
+
menuPortal: function menuPortal(base) {
|
13278
|
+
return _extends({}, base, {
|
13279
|
+
zIndex: 9999
|
13280
|
+
});
|
13281
|
+
}
|
13282
|
+
},
|
13283
|
+
menuPortalTarget: document.body,
|
13314
13284
|
isClearable: true
|
13315
|
-
})
|
13285
|
+
});
|
13316
13286
|
};
|
13317
13287
|
|
13318
13288
|
var ErrorHandler = function ErrorHandler(_ref) {
|
@@ -20280,12 +20250,12 @@ function CreateNewQuestionDialog(_ref) {
|
|
20280
20250
|
});
|
20281
20251
|
}
|
20282
20252
|
|
20283
|
-
var _excluded$
|
20253
|
+
var _excluded$7 = ["children", "value", "index"];
|
20284
20254
|
var CustomTabPanel = function CustomTabPanel(props) {
|
20285
20255
|
var children = props.children,
|
20286
20256
|
value = props.value,
|
20287
20257
|
index = props.index,
|
20288
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
20258
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$7);
|
20289
20259
|
return React__default.createElement("div", Object.assign({
|
20290
20260
|
role: "tabpanel",
|
20291
20261
|
hidden: value !== index,
|
@@ -24342,7 +24312,7 @@ var ChapterProblemSolvingResultsDialog = function ChapterProblemSolvingResultsDi
|
|
24342
24312
|
}, t("cancel"))))));
|
24343
24313
|
};
|
24344
24314
|
|
24345
|
-
var _excluded$
|
24315
|
+
var _excluded$8 = ["onChange"];
|
24346
24316
|
var StartPageDialog = function StartPageDialog(_ref) {
|
24347
24317
|
var t = _ref.t,
|
24348
24318
|
onClose = _ref.onClose,
|
@@ -24408,7 +24378,7 @@ var StartPageDialog = function StartPageDialog(_ref) {
|
|
24408
24378
|
}, t("page_to_start_with")), React__default.createElement(formik.Field, {
|
24409
24379
|
name: "startPage",
|
24410
24380
|
render: function render(_ref3) {
|
24411
|
-
var field = _objectWithoutPropertiesLoose(_ref3, _excluded$
|
24381
|
+
var field = _objectWithoutPropertiesLoose(_ref3, _excluded$8);
|
24412
24382
|
return React__default.createElement(CustomSelectOption, Object.assign({
|
24413
24383
|
maxMenuHeight: 150,
|
24414
24384
|
menuPosition: "fixed",
|
@@ -26040,10 +26010,10 @@ var DrawerTextbookResultTab = function DrawerTextbookResultTab(_ref) {
|
|
26040
26010
|
};
|
26041
26011
|
|
26042
26012
|
var _styled$1;
|
26043
|
-
var _excluded$
|
26013
|
+
var _excluded$9 = ["className"];
|
26044
26014
|
var CustomTooltip$1 = material.styled(function (_ref) {
|
26045
26015
|
var className = _ref.className,
|
26046
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
26016
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$9);
|
26047
26017
|
return React__default.createElement(material.Tooltip, Object.assign({}, props, {
|
26048
26018
|
classes: {
|
26049
26019
|
popper: className
|
@@ -27524,7 +27494,7 @@ var useTeacherList = function useTeacherList() {
|
|
27524
27494
|
};
|
27525
27495
|
};
|
27526
27496
|
|
27527
|
-
var _excluded$
|
27497
|
+
var _excluded$a = ["getStudents"],
|
27528
27498
|
_excluded2 = ["getTeachers"],
|
27529
27499
|
_excluded3 = ["getLessons"];
|
27530
27500
|
var PAGE_TITLE$4 = "classes";
|
@@ -27575,7 +27545,7 @@ var useClassDetail = function useClassDetail(_ref) {
|
|
27575
27545
|
};
|
27576
27546
|
var _useStudentClassList = useStudentClassList(classId),
|
27577
27547
|
getStudents = _useStudentClassList.getStudents,
|
27578
|
-
studentListProps = _objectWithoutPropertiesLoose(_useStudentClassList, _excluded$
|
27548
|
+
studentListProps = _objectWithoutPropertiesLoose(_useStudentClassList, _excluded$a);
|
27579
27549
|
var _useTeacherClassList = useTeacherClassList(classId),
|
27580
27550
|
getTeachers = _useTeacherClassList.getTeachers,
|
27581
27551
|
teacherListProps = _objectWithoutPropertiesLoose(_useTeacherClassList, _excluded2);
|
@@ -28963,14 +28933,14 @@ var CSV_PREFIX = "data:text/csv;charset=utf-8,";
|
|
28963
28933
|
|
28964
28934
|
var styles$8 = {"action-btn":"_1jXbz","action-btn--pencil":"_at4xP","icon-rotate-180":"_12gv9","drop-area":"_R4bn5"};
|
28965
28935
|
|
28966
|
-
var _excluded$
|
28936
|
+
var _excluded$b = ["text", "isRequired", "className"];
|
28967
28937
|
var LabelRequired = function LabelRequired(_ref) {
|
28968
28938
|
var text = _ref.text,
|
28969
28939
|
_ref$isRequired = _ref.isRequired,
|
28970
28940
|
isRequired = _ref$isRequired === void 0 ? true : _ref$isRequired,
|
28971
28941
|
_ref$className = _ref.className,
|
28972
28942
|
className = _ref$className === void 0 ? "" : _ref$className,
|
28973
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
28943
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$b);
|
28974
28944
|
return React__default.createElement(material.FormLabel, Object.assign({
|
28975
28945
|
className: "fw-medium mb-1 " + className
|
28976
28946
|
}, rest), text, isRequired && React__default.createElement("span", {
|
@@ -29024,7 +28994,7 @@ var deleteUserApi = function deleteUserApi(id) {
|
|
29024
28994
|
return api["delete"](USER_URL$1 + "/delete/" + id);
|
29025
28995
|
};
|
29026
28996
|
|
29027
|
-
var _excluded$
|
28997
|
+
var _excluded$c = ["ref"],
|
29028
28998
|
_excluded2$1 = ["ref"],
|
29029
28999
|
_excluded3$1 = ["ref"],
|
29030
29000
|
_excluded4 = ["ref"],
|
@@ -29054,7 +29024,7 @@ var UserDialog = function UserDialog(_ref) {
|
|
29054
29024
|
t = _useTranslation.t;
|
29055
29025
|
var _register = register("fullName"),
|
29056
29026
|
fullNameRef = _register.ref,
|
29057
|
-
fullNameBio = _objectWithoutPropertiesLoose(_register, _excluded$
|
29027
|
+
fullNameBio = _objectWithoutPropertiesLoose(_register, _excluded$c);
|
29058
29028
|
var _register2 = register("email"),
|
29059
29029
|
emailRef = _register2.ref,
|
29060
29030
|
emailBio = _objectWithoutPropertiesLoose(_register2, _excluded2$1);
|
@@ -33125,12 +33095,12 @@ var ArticleDialog = function ArticleDialog(_ref) {
|
|
33125
33095
|
|
33126
33096
|
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"};
|
33127
33097
|
|
33128
|
-
var _excluded$
|
33098
|
+
var _excluded$d = ["isOpen", "onClose", "handleSaveExam"];
|
33129
33099
|
var CreateExamDrawer = function CreateExamDrawer(props) {
|
33130
33100
|
var isOpen = props.isOpen,
|
33131
33101
|
onClose = props.onClose,
|
33132
33102
|
handleSaveExam = props.handleSaveExam,
|
33133
|
-
examDetailViewProps = _objectWithoutPropertiesLoose(props, _excluded$
|
33103
|
+
examDetailViewProps = _objectWithoutPropertiesLoose(props, _excluded$d);
|
33134
33104
|
var _useTranslation = reactI18next.useTranslation(),
|
33135
33105
|
t = _useTranslation.t;
|
33136
33106
|
var theme = material.useTheme();
|
@@ -33892,11 +33862,11 @@ var TextbookRow = function TextbookRow(_ref) {
|
|
33892
33862
|
});
|
33893
33863
|
var _useTranslation = reactI18next.useTranslation(),
|
33894
33864
|
t = _useTranslation.t;
|
33895
|
-
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) {
|
33865
|
+
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) {
|
33896
33866
|
var _infoUser$email, _infoUser$email$trim;
|
33897
33867
|
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);
|
33898
|
-
})));
|
33899
|
-
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);
|
33868
|
+
})))) && data.totalUses <= 0;
|
33869
|
+
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;
|
33900
33870
|
var isSharable = !data.isPublic && data.isShared && onAcademy && (isAdminSite || isSuperAdminUser || !isAdmin && data.createdBy.id === infoUser.id);
|
33901
33871
|
var handleUpdateTextbook = function handleUpdateTextbook() {
|
33902
33872
|
onUpdateTextbook(data);
|
@@ -34283,12 +34253,12 @@ var useNotificationDetail = function useNotificationDetail(_ref) {
|
|
34283
34253
|
|
34284
34254
|
var styles$b = {"avatar":"_8niRT"};
|
34285
34255
|
|
34286
|
-
var _excluded$
|
34256
|
+
var _excluded$e = ["value", "disabled", "optionTypeNotification"];
|
34287
34257
|
var TypeSelector = function TypeSelector(_ref) {
|
34288
34258
|
var value = _ref.value,
|
34289
34259
|
disabled = _ref.disabled,
|
34290
34260
|
optionTypeNotification = _ref.optionTypeNotification,
|
34291
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
34261
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$e);
|
34292
34262
|
return React__default.createElement(CustomAsyncSelect, Object.assign({
|
34293
34263
|
options: optionTypeNotification,
|
34294
34264
|
value: value
|
@@ -34681,11 +34651,11 @@ var useNotificationList = function useNotificationList(_ref) {
|
|
34681
34651
|
};
|
34682
34652
|
};
|
34683
34653
|
|
34684
|
-
var _excluded$
|
34654
|
+
var _excluded$f = ["value", "optionTypeNotification"];
|
34685
34655
|
var SelectFilterType = function SelectFilterType(_ref) {
|
34686
34656
|
var value = _ref.value,
|
34687
34657
|
optionTypeNotification = _ref.optionTypeNotification,
|
34688
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
34658
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$f);
|
34689
34659
|
return React__default.createElement(CustomAsyncSelect, Object.assign({
|
34690
34660
|
options: optionTypeNotification,
|
34691
34661
|
value: value
|
@@ -34917,10 +34887,10 @@ var useTextbookManagement = function useTextbookManagement(_ref) {
|
|
34917
34887
|
var isAdminSite = role === exports.Role.Admin;
|
34918
34888
|
var onAcademy = !!(user !== null && user !== void 0 && user.academyDomain);
|
34919
34889
|
var isSuperAdminUser = !!user && user.isSuperAdmin;
|
34920
|
-
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) {
|
34890
|
+
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) {
|
34921
34891
|
var _user$email, _user$email$trim;
|
34922
34892
|
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);
|
34923
|
-
}));
|
34893
|
+
}))) && selectedTextbook.totalUses <= 0;
|
34924
34894
|
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);
|
34925
34895
|
var handleOpenConfirmDeleteChapterDialog = function handleOpenConfirmDeleteChapterDialog(chapter) {
|
34926
34896
|
setSelectedChapter(chapter);
|
@@ -35022,24 +34992,6 @@ var useTextbookManagement = function useTextbookManagement(_ref) {
|
|
35022
34992
|
return Promise.reject(e);
|
35023
34993
|
}
|
35024
34994
|
};
|
35025
|
-
var handleSaveData = React.useCallback(function (values) {
|
35026
|
-
try {
|
35027
|
-
if (!coverImage && !(values !== null && values !== void 0 && values.coverImage)) {
|
35028
|
-
return Promise.resolve();
|
35029
|
-
}
|
35030
|
-
return Promise.resolve(_catch(function () {
|
35031
|
-
var coverImg = coverImage || (values === null || values === void 0 ? void 0 : values.coverImage);
|
35032
|
-
return Promise.resolve(updateTextbookApi$1(_extends({}, values, {
|
35033
|
-
coverImage: coverImg
|
35034
|
-
}), (selectedTextbook === null || selectedTextbook === void 0 ? void 0 : selectedTextbook.id) || 0, isSuperAdmin)).then(function () {});
|
35035
|
-
}, function (error) {
|
35036
|
-
reactToastify.toast.error(getErrorMessage(t, error));
|
35037
|
-
throw error;
|
35038
|
-
}));
|
35039
|
-
} catch (e) {
|
35040
|
-
return Promise.reject(e);
|
35041
|
-
}
|
35042
|
-
}, [coverImage, isSuperAdmin, JSON.stringify(selectedTextbook)]);
|
35043
34995
|
React.useEffect(function () {
|
35044
34996
|
if (!textbookId) return;
|
35045
34997
|
handleGetTextbookDetail();
|
@@ -35058,7 +35010,6 @@ var useTextbookManagement = function useTextbookManagement(_ref) {
|
|
35058
35010
|
isSuperAdminUser: isSuperAdminUser,
|
35059
35011
|
openDialog: openDialog,
|
35060
35012
|
handleSubmit: handleSubmit,
|
35061
|
-
handleSaveData: handleSaveData,
|
35062
35013
|
selectedTextbook: selectedTextbook,
|
35063
35014
|
handleOpenDialog: handleOpenDialog,
|
35064
35015
|
handleCloseDialog: handleCloseDialog,
|
@@ -35352,8 +35303,6 @@ var CompareTypeOptions = [{
|
|
35352
35303
|
label: "synonym_processing",
|
35353
35304
|
value: exports.QuestionAnswerType.SynonymProcessing
|
35354
35305
|
}];
|
35355
|
-
var SAVE_TIME_INTERVAL_IN_MILLISECONDS = 60 * 1000;
|
35356
|
-
var SAVE_TIME_MAX_DIFF_IN_MILLISECONDS = 1000;
|
35357
35306
|
|
35358
35307
|
var CustomTextbookTab = function CustomTextbookTab(props) {
|
35359
35308
|
var children = props.children,
|
@@ -35962,7 +35911,7 @@ var isEqual$1 = function isEqual(prev, next) {
|
|
35962
35911
|
};
|
35963
35912
|
var QuestionShortInput$1 = React.memo(QuestionShortInput, isEqual$1);
|
35964
35913
|
|
35965
|
-
var _excluded$
|
35914
|
+
var _excluded$g = ["onChange"];
|
35966
35915
|
var _$2 = _$8;
|
35967
35916
|
var BpIcon$1 = material.styled("span")(function (_ref) {
|
35968
35917
|
var theme = _ref.theme;
|
@@ -36273,7 +36222,7 @@ var QuestionBlock = function QuestionBlock(_ref2) {
|
|
36273
36222
|
name: path + ".questionTypeId",
|
36274
36223
|
render: function render(_ref5) {
|
36275
36224
|
var _ref5$field = _ref5.field,
|
36276
|
-
field = _objectWithoutPropertiesLoose(_ref5$field, _excluded$
|
36225
|
+
field = _objectWithoutPropertiesLoose(_ref5$field, _excluded$g);
|
36277
36226
|
return React__default.createElement(CustomSelectOption, Object.assign({}, field, {
|
36278
36227
|
isDisabled: disabled,
|
36279
36228
|
value: data.questionType,
|
@@ -36322,7 +36271,7 @@ var isEqual$2 = function isEqual(prev, next) {
|
|
36322
36271
|
};
|
36323
36272
|
var QuestionBlock$1 = React.memo(QuestionBlock, isEqual$2);
|
36324
36273
|
|
36325
|
-
var _excluded$
|
36274
|
+
var _excluded$h = ["data", "path", "isMath", "open", "isLoadingCategories", "isLoadingQuestionTypes", "optionKey", "categories", "questionTypes", "disabled", "onQuestioStartOrderChange", "onDelete", "onOpenSubCategoryMenu", "onOpenCategoryMenu", "onCloseCategoryMenu", "onCloseQuestionTypeMenu", "onOpenQuestionTypeMenu"];
|
36326
36275
|
var _$3 = _$8;
|
36327
36276
|
var QuestionGroupBlockBody = function QuestionGroupBlockBody(_ref) {
|
36328
36277
|
var _data$articles$3, _data$articles$3$cate, _data$articles$4, _data$articles$4$cate, _questions$2;
|
@@ -36343,7 +36292,7 @@ var QuestionGroupBlockBody = function QuestionGroupBlockBody(_ref) {
|
|
36343
36292
|
onCloseCategoryMenu = _ref.onCloseCategoryMenu,
|
36344
36293
|
onCloseQuestionTypeMenu = _ref.onCloseQuestionTypeMenu,
|
36345
36294
|
onOpenQuestionTypeMenu = _ref.onOpenQuestionTypeMenu,
|
36346
|
-
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$
|
36295
|
+
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$h);
|
36347
36296
|
var errors = formikProps.errors;
|
36348
36297
|
var startOrderRef = React.useRef(null);
|
36349
36298
|
var articles = data.articles,
|
@@ -36486,7 +36435,7 @@ var isEqual$3 = function isEqual(prev, next) {
|
|
36486
36435
|
};
|
36487
36436
|
var QuestionGroupBlockBody$1 = React.memo(QuestionGroupBlockBody, isEqual$3);
|
36488
36437
|
|
36489
|
-
var _excluded$
|
36438
|
+
var _excluded$i = ["expandedIndex", "open", "paths", "path", "isMath", "data", "categories", "isLoadingCategories", "isLoadingQuestionTypes", "questionTypes", "optionKey", "disabled", "onToggle", "onQuestionCountChange", "onDelete", "onOpenSubCategoryMenu", "onOpenCategoryMenu", "onCloseCategoryMenu", "onCopiedPrevQuestionGroup", "onCloseQuestionTypeMenu", "onOpenQuestionTypeMenu"];
|
36490
36439
|
var _$4 = _$8;
|
36491
36440
|
var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
|
36492
36441
|
var _data$articles$3, _data$articles$3$cate, _data$articles$3$cate2, _data$articles$4, _data$articles$4$cate, _data$articles$4$cate2;
|
@@ -36511,7 +36460,7 @@ var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
|
|
36511
36460
|
onCopiedPrevQuestionGroup = _ref.onCopiedPrevQuestionGroup,
|
36512
36461
|
onCloseQuestionTypeMenu = _ref.onCloseQuestionTypeMenu,
|
36513
36462
|
onOpenQuestionTypeMenu = _ref.onOpenQuestionTypeMenu,
|
36514
|
-
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$
|
36463
|
+
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$i);
|
36515
36464
|
var errors = formikProps.errors,
|
36516
36465
|
setFieldValue = formikProps.setFieldValue;
|
36517
36466
|
var _useTranslation = reactI18next.useTranslation(),
|
@@ -36974,7 +36923,7 @@ var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
|
|
36974
36923
|
}, formikProps)))));
|
36975
36924
|
};
|
36976
36925
|
|
36977
|
-
var _excluded$
|
36926
|
+
var _excluded$j = ["path", "paths", "isMath", "isLoadingCategories", "isLoadingQuestionTypes", "optionKey", "questionGroups", "subChapters", "categories", "questionTypes", "disabled", "onDelete", "onOpenSubCategoryMenu", "onOpenCategoryMenu", "onCloseCategoryMenu", "onCopiedPrevQuestionGroup", "onCloseQuestionTypeMenu", "onOpenQuestionTypeMenu"];
|
36978
36927
|
var ChapterBlockBody = function ChapterBlockBody(_ref) {
|
36979
36928
|
var path = _ref.path,
|
36980
36929
|
paths = _ref.paths,
|
@@ -36994,7 +36943,7 @@ var ChapterBlockBody = function ChapterBlockBody(_ref) {
|
|
36994
36943
|
onCopiedPrevQuestionGroup = _ref.onCopiedPrevQuestionGroup,
|
36995
36944
|
onCloseQuestionTypeMenu = _ref.onCloseQuestionTypeMenu,
|
36996
36945
|
onOpenQuestionTypeMenu = _ref.onOpenQuestionTypeMenu,
|
36997
|
-
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$
|
36946
|
+
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$j);
|
36998
36947
|
var _useTranslation = reactI18next.useTranslation(),
|
36999
36948
|
t = _useTranslation.t;
|
37000
36949
|
var setFieldValue = formikProps.setFieldValue;
|
@@ -37173,7 +37122,7 @@ var ChapterBlockBody = function ChapterBlockBody(_ref) {
|
|
37173
37122
|
}));
|
37174
37123
|
};
|
37175
37124
|
|
37176
|
-
var _excluded$
|
37125
|
+
var _excluded$k = ["data", "expandedIndex", "open", "path", "paths", "isMath", "isLoadingCategories", "isLoadingQuestionTypes", "categories", "questionTypes", "optionKey", "disabled", "onToggle", "onDelete", "onCopiedPrevQuestionGroup", "onCloseCategoryMenu", "onOpenCategoryMenu", "onOpenSubCategoryMenu", "onOpenQuestionTypeMenu", "onCloseQuestionTypeMenu"];
|
37177
37126
|
var _$5 = _$8;
|
37178
37127
|
var ChapterBlock = function ChapterBlock(_ref) {
|
37179
37128
|
var data = _ref.data,
|
@@ -37196,7 +37145,7 @@ var ChapterBlock = function ChapterBlock(_ref) {
|
|
37196
37145
|
onOpenSubCategoryMenu = _ref.onOpenSubCategoryMenu,
|
37197
37146
|
onOpenQuestionTypeMenu = _ref.onOpenQuestionTypeMenu,
|
37198
37147
|
onCloseQuestionTypeMenu = _ref.onCloseQuestionTypeMenu,
|
37199
|
-
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$
|
37148
|
+
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$k);
|
37200
37149
|
var errors = formikProps.errors;
|
37201
37150
|
var _useTranslation = reactI18next.useTranslation(),
|
37202
37151
|
t = _useTranslation.t;
|
@@ -37887,7 +37836,7 @@ var TextbookContentsTab = function TextbookContentsTab(props) {
|
|
37887
37836
|
}));
|
37888
37837
|
};
|
37889
37838
|
|
37890
|
-
var _excluded$
|
37839
|
+
var _excluded$l = ["value"];
|
37891
37840
|
var VisuallyHiddenInput = material.styled("input")({
|
37892
37841
|
clip: "rect(0 0 0 0)",
|
37893
37842
|
clipPath: "inset(50%)",
|
@@ -38055,7 +38004,7 @@ var TextbookInfoTab = function TextbookInfoTab(_ref) {
|
|
38055
38004
|
render: function render(_ref4) {
|
38056
38005
|
var _ref4$field = _ref4.field,
|
38057
38006
|
value = _ref4$field.value,
|
38058
|
-
action = _objectWithoutPropertiesLoose(_ref4$field, _excluded$
|
38007
|
+
action = _objectWithoutPropertiesLoose(_ref4$field, _excluded$l);
|
38059
38008
|
return React__default.createElement(xDatePickers.LocalizationProvider, {
|
38060
38009
|
dateAdapter: AdapterMoment.AdapterMoment
|
38061
38010
|
}, React__default.createElement(xDatePickers.DatePicker, Object.assign({}, action, {
|
@@ -38529,9 +38478,8 @@ var TextbookOwnersTab = function TextbookOwnersTab(_ref) {
|
|
38529
38478
|
}));
|
38530
38479
|
};
|
38531
38480
|
|
38532
|
-
var _excluded$
|
38481
|
+
var _excluded$m = ["isCreatedByAdmin", "isSuperAdminUser", "isSuperAdmin", "isAdmin", "textbookId", "selected", "coverImage", "disabled", "ownersDisabled", "onChangeTab", "onUploadImage"];
|
38533
38482
|
var PreparedTextbookForm = function PreparedTextbookForm(_ref) {
|
38534
|
-
var _valuesTextbook$curre;
|
38535
38483
|
var isCreatedByAdmin = _ref.isCreatedByAdmin,
|
38536
38484
|
isSuperAdminUser = _ref.isSuperAdminUser,
|
38537
38485
|
isSuperAdmin = _ref.isSuperAdmin,
|
@@ -38541,30 +38489,14 @@ var PreparedTextbookForm = function PreparedTextbookForm(_ref) {
|
|
38541
38489
|
coverImage = _ref.coverImage,
|
38542
38490
|
disabled = _ref.disabled,
|
38543
38491
|
ownersDisabled = _ref.ownersDisabled,
|
38544
|
-
selectedTextbook = _ref.selectedTextbook,
|
38545
|
-
handleSaveData = _ref.handleSaveData,
|
38546
38492
|
onChangeTab = _ref.onChangeTab,
|
38547
38493
|
onUploadImage = _ref.onUploadImage,
|
38548
|
-
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$
|
38494
|
+
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$m);
|
38549
38495
|
var values = formikProps.values,
|
38550
38496
|
errors = formikProps.errors,
|
38551
38497
|
dirty = formikProps.dirty,
|
38552
38498
|
submitCount = formikProps.submitCount,
|
38553
38499
|
setValues = formikProps.setValues;
|
38554
|
-
var theme = material.useTheme();
|
38555
|
-
var savedRunRef = React.useRef(Date.now());
|
38556
|
-
var runTimeRef = React.useRef(Date.now());
|
38557
|
-
var valuesTextbook = React.useRef(null);
|
38558
|
-
var isFirstLoadRef = React.useRef(true);
|
38559
|
-
var _React$useState = React__default.useState(PrintStatus.Idle),
|
38560
|
-
saveStatus = _React$useState[0],
|
38561
|
-
setSaveStatus = _React$useState[1];
|
38562
|
-
var timeoutRef = React.useRef(null);
|
38563
|
-
var isProcessingRef = React.useRef(false);
|
38564
|
-
var pendingValuesRef = React.useRef(null);
|
38565
|
-
var _useState = React.useState(),
|
38566
|
-
lastEdited = _useState[0],
|
38567
|
-
setLastEdited = _useState[1];
|
38568
38500
|
React.useEffect(function () {
|
38569
38501
|
var handleBeforeUnload = function handleBeforeUnload(event) {
|
38570
38502
|
var message = i18n.t("are_you_sure_you_want_to_quit_yours_changes_may_not_be_saved");
|
@@ -38585,99 +38517,9 @@ var PreparedTextbookForm = function PreparedTextbookForm(_ref) {
|
|
38585
38517
|
var newValues = _resetAllCategoriesAndQuestionTypesBySubject(values, val);
|
38586
38518
|
setValues(newValues);
|
38587
38519
|
};
|
38588
|
-
React.useEffect(function () {
|
38589
|
-
if (!valuesTextbook.current && isFirstLoadRef.current && !_$8.isEqual(values, DEFAULT_TEXTBOOK_REQUEST)) {
|
38590
|
-
valuesTextbook.current = _$8.cloneDeep(values);
|
38591
|
-
isFirstLoadRef.current = false;
|
38592
|
-
}
|
38593
|
-
}, [values]);
|
38594
|
-
var _handleSave = function handleSave(valuesProps) {
|
38595
|
-
try {
|
38596
|
-
var _temp = _finallyRethrows(function () {
|
38597
|
-
return _catch(function () {
|
38598
|
-
isProcessingRef.current = true;
|
38599
|
-
setSaveStatus(PrintStatus.Saving);
|
38600
|
-
var valuesToSave = valuesProps || values;
|
38601
|
-
return Promise.resolve(handleSaveData(valuesToSave)).then(function () {
|
38602
|
-
valuesTextbook.current = _$8.cloneDeep(valuesToSave);
|
38603
|
-
var now = Date.now();
|
38604
|
-
savedRunRef.current = now;
|
38605
|
-
runTimeRef.current = now;
|
38606
|
-
setSaveStatus(PrintStatus.Saved);
|
38607
|
-
});
|
38608
|
-
}, function (error) {
|
38609
|
-
setSaveStatus(PrintStatus.Idle);
|
38610
|
-
console.error(error);
|
38611
|
-
});
|
38612
|
-
}, function (_wasThrown, _result) {
|
38613
|
-
isProcessingRef.current = false;
|
38614
|
-
if (pendingValuesRef.current) {
|
38615
|
-
if (timeoutRef.current) {
|
38616
|
-
clearTimeout(timeoutRef.current);
|
38617
|
-
}
|
38618
|
-
timeoutRef.current = setTimeout(function () {
|
38619
|
-
timeoutRef.current = null;
|
38620
|
-
var pendingValues = pendingValuesRef.current;
|
38621
|
-
if (pendingValues) {
|
38622
|
-
_handleSave(pendingValues);
|
38623
|
-
pendingValuesRef.current = null;
|
38624
|
-
}
|
38625
|
-
}, SAVE_TIME_INTERVAL_IN_MILLISECONDS);
|
38626
|
-
}
|
38627
|
-
if (_wasThrown) throw _result;
|
38628
|
-
return _result;
|
38629
|
-
});
|
38630
|
-
return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
|
38631
|
-
} catch (e) {
|
38632
|
-
return Promise.reject(e);
|
38633
|
-
}
|
38634
|
-
};
|
38635
|
-
React.useEffect(function () {
|
38636
|
-
var now = Date.now();
|
38637
|
-
if (valuesTextbook.current && !_$8.isEqual(values, valuesTextbook.current)) setLastEdited(now);
|
38638
|
-
if (!_$8.isEmpty(errors) || !valuesTextbook.current || !(selectedTextbook !== null && selectedTextbook !== void 0 && selectedTextbook.id)) return;
|
38639
|
-
if (valuesTextbook.current && _$8.isEqual(values, valuesTextbook.current)) return;
|
38640
|
-
if (isProcessingRef.current) {
|
38641
|
-
pendingValuesRef.current = _$8.cloneDeep(values);
|
38642
|
-
return;
|
38643
|
-
}
|
38644
|
-
var timeSinceLastRun = now - runTimeRef.current;
|
38645
|
-
var maxTime = SAVE_TIME_INTERVAL_IN_MILLISECONDS + SAVE_TIME_MAX_DIFF_IN_MILLISECONDS;
|
38646
|
-
if (timeSinceLastRun > maxTime) {
|
38647
|
-
runTimeRef.current = now;
|
38648
|
-
timeSinceLastRun = 0;
|
38649
|
-
}
|
38650
|
-
if (timeSinceLastRun >= SAVE_TIME_INTERVAL_IN_MILLISECONDS) {
|
38651
|
-
if (timeoutRef.current) {
|
38652
|
-
clearTimeout(timeoutRef.current);
|
38653
|
-
timeoutRef.current = null;
|
38654
|
-
pendingValuesRef.current = null;
|
38655
|
-
}
|
38656
|
-
_handleSave();
|
38657
|
-
} else {
|
38658
|
-
pendingValuesRef.current = _$8.cloneDeep(values);
|
38659
|
-
var intevalTime = SAVE_TIME_INTERVAL_IN_MILLISECONDS - timeSinceLastRun;
|
38660
|
-
timeoutRef.current = setTimeout(function () {
|
38661
|
-
timeoutRef.current = null;
|
38662
|
-
var pendingValues = pendingValuesRef.current;
|
38663
|
-
if (pendingValues) {
|
38664
|
-
clearTimeout(timeoutRef.current);
|
38665
|
-
_handleSave(pendingValues);
|
38666
|
-
pendingValuesRef.current = null;
|
38667
|
-
}
|
38668
|
-
}, intevalTime);
|
38669
|
-
}
|
38670
|
-
return function () {
|
38671
|
-
if (timeoutRef.current) {
|
38672
|
-
clearTimeout(timeoutRef.current);
|
38673
|
-
}
|
38674
|
-
};
|
38675
|
-
}, [values, errors]);
|
38676
38520
|
var inforErrors = errors.coverImage || errors.grade || errors.isbn || errors.preparedType || errors.publicationDate || errors.publisher;
|
38677
38521
|
var contentsErrors = errors.chapters;
|
38678
38522
|
var textbookOwnersErrors = errors.textbookOwners;
|
38679
|
-
var hasError = !_$8.isEmpty(errors);
|
38680
|
-
var isSaved = !lastEdited || _$8.isEqual(values, (_valuesTextbook$curre = valuesTextbook.current) != null ? _valuesTextbook$curre : {});
|
38681
38523
|
return React__default.createElement(formik.Form, null, React__default.createElement(material.Stack, {
|
38682
38524
|
direction: "column",
|
38683
38525
|
gap: 3
|
@@ -38765,45 +38607,7 @@ var PreparedTextbookForm = function PreparedTextbookForm(_ref) {
|
|
38765
38607
|
}), React__default.createElement(material.FormLabel, {
|
38766
38608
|
htmlFor: "type",
|
38767
38609
|
className: "text-center"
|
38768
|
-
}, i18n.t("math"))))), React__default.createElement(material.
|
38769
|
-
flexDirection: "row",
|
38770
|
-
gap: "8px"
|
38771
|
-
}, React__default.createElement(material.Stack, {
|
38772
|
-
padding: "6px 12px",
|
38773
|
-
sx: {
|
38774
|
-
transition: "opacity 0.3s ease",
|
38775
|
-
opacity: saveStatus === PrintStatus.Idle && isSaved ? 0 : 1,
|
38776
|
-
pointerEvents: "none",
|
38777
|
-
gap: "8px",
|
38778
|
-
flexDirection: "row",
|
38779
|
-
justifyContent: "center",
|
38780
|
-
alignItems: "center"
|
38781
|
-
}
|
38782
|
-
}, saveStatus === PrintStatus.Saving && React__default.createElement(ai.AiOutlineLoading3Quarters, {
|
38783
|
-
style: {
|
38784
|
-
animation: "spin 1s linear infinite"
|
38785
|
-
}
|
38786
|
-
}), 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, {
|
38787
|
-
color: red[900]
|
38788
|
-
}) : React__default.createElement(fa6.FaClockRotateLeft, {
|
38789
|
-
size: "14px"
|
38790
|
-
})), React__default.createElement(material.Typography, {
|
38791
|
-
sx: {
|
38792
|
-
color: theme.palette.grey[700],
|
38793
|
-
fontSize: "14px",
|
38794
|
-
display: "flex",
|
38795
|
-
alignItems: "center",
|
38796
|
-
gap: 1,
|
38797
|
-
"@keyframes spin": {
|
38798
|
-
"0%": {
|
38799
|
-
transform: "rotate(0deg)"
|
38800
|
-
},
|
38801
|
-
"100%": {
|
38802
|
-
transform: "rotate(360deg)"
|
38803
|
-
}
|
38804
|
-
}
|
38805
|
-
}
|
38806
|
-
}, 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, {
|
38610
|
+
}, i18n.t("math"))))), React__default.createElement(material.Box, null, React__default.createElement(material.Button, {
|
38807
38611
|
type: "submit",
|
38808
38612
|
sx: {
|
38809
38613
|
width: "fit-content"
|
@@ -38910,7 +38714,6 @@ var PreparedTextbookView = function PreparedTextbookView(_ref) {
|
|
38910
38714
|
isSuperAdminUser = _useTextbookManagemen.isSuperAdminUser,
|
38911
38715
|
isAdmin = _useTextbookManagemen.isAdmin,
|
38912
38716
|
coverImage = _useTextbookManagemen.coverImage,
|
38913
|
-
handleSaveData = _useTextbookManagemen.handleSaveData,
|
38914
38717
|
selectedTextbook = _useTextbookManagemen.selectedTextbook,
|
38915
38718
|
handleSubmit = _useTextbookManagemen.handleSubmit,
|
38916
38719
|
handleUploadImage = _useTextbookManagemen.handleUploadImage;
|
@@ -38933,9 +38736,7 @@ var PreparedTextbookView = function PreparedTextbookView(_ref) {
|
|
38933
38736
|
isAdmin: isAdmin,
|
38934
38737
|
isSuperAdmin: isSuperAdmin,
|
38935
38738
|
selected: selected,
|
38936
|
-
handleSaveData: handleSaveData,
|
38937
38739
|
textbookId: textbookId,
|
38938
|
-
selectedTextbook: selectedTextbook,
|
38939
38740
|
onChangeTab: handleChangeTab,
|
38940
38741
|
onUploadImage: handleUploadImage,
|
38941
38742
|
coverImage: coverImage,
|