touchstudy-core 0.1.172 → 0.1.173
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 +57 -260
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +59 -262
- package/dist/index.modern.js.map +1 -1
- package/dist/layouts/HeaderLink.d.ts +8 -0
- package/dist/layouts/TimerDropdown.d.ts +3 -0
- 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({
|
@@ -6293,12 +6262,6 @@ var HighSchoolGrade;
|
|
6293
6262
|
TextbookEditorType[TextbookEditorType["Korea"] = 1] = "Korea";
|
6294
6263
|
TextbookEditorType[TextbookEditorType["Math"] = 2] = "Math";
|
6295
6264
|
})(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
6265
|
|
6303
6266
|
(function (SchoolType) {
|
6304
6267
|
SchoolType[SchoolType["Default"] = 0] = "Default";
|
@@ -13017,8 +12980,8 @@ var DayOfWeek;
|
|
13017
12980
|
})(DayOfWeek || (DayOfWeek = {}));
|
13018
12981
|
var TeacherSortBy;
|
13019
12982
|
(function (TeacherSortBy) {
|
13020
|
-
TeacherSortBy["Name"] = "UserProfile.FullName";
|
13021
|
-
TeacherSortBy["Email"] = "UserProfile.Email";
|
12983
|
+
TeacherSortBy["Name"] = "User.UserProfile.FullName";
|
12984
|
+
TeacherSortBy["Email"] = "User.UserProfile.Email";
|
13022
12985
|
})(TeacherSortBy || (TeacherSortBy = {}));
|
13023
12986
|
var ClassStatus;
|
13024
12987
|
(function (ClassStatus) {
|
@@ -13296,23 +13259,29 @@ var DEFAULT_USER_FILTERS = {
|
|
13296
13259
|
|
13297
13260
|
var styles$3 = {"avatar":"_2rJkZ","date-picker":"_1iqE2","time-picker":"_20xtc","teacher-selector-wrapper":"_3L1Oj"};
|
13298
13261
|
|
13299
|
-
var _excluded$7 = ["teachers", "value"];
|
13300
13262
|
var TeacherSelector = function TeacherSelector(_ref) {
|
13301
13263
|
var teachers = _ref.teachers,
|
13302
|
-
value = _ref.value
|
13303
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$7);
|
13264
|
+
value = _ref.value;
|
13304
13265
|
var teacherOptions = teachers.map(function (i) {
|
13305
13266
|
return {
|
13306
13267
|
label: i.teacherName + "/" + i.teacherEmail,
|
13307
13268
|
value: i.id
|
13308
13269
|
};
|
13309
13270
|
});
|
13310
|
-
return React__default.createElement(CustomAsyncSelect,
|
13271
|
+
return React__default.createElement(CustomAsyncSelect, {
|
13311
13272
|
options: teacherOptions,
|
13312
|
-
value: value
|
13313
|
-
|
13273
|
+
value: value,
|
13274
|
+
menuPlacement: "bottom",
|
13275
|
+
styles: {
|
13276
|
+
menuPortal: function menuPortal(base) {
|
13277
|
+
return _extends({}, base, {
|
13278
|
+
zIndex: 9999
|
13279
|
+
});
|
13280
|
+
}
|
13281
|
+
},
|
13282
|
+
menuPortalTarget: document.body,
|
13314
13283
|
isClearable: true
|
13315
|
-
})
|
13284
|
+
});
|
13316
13285
|
};
|
13317
13286
|
|
13318
13287
|
var ErrorHandler = function ErrorHandler(_ref) {
|
@@ -20280,12 +20249,12 @@ function CreateNewQuestionDialog(_ref) {
|
|
20280
20249
|
});
|
20281
20250
|
}
|
20282
20251
|
|
20283
|
-
var _excluded$
|
20252
|
+
var _excluded$7 = ["children", "value", "index"];
|
20284
20253
|
var CustomTabPanel = function CustomTabPanel(props) {
|
20285
20254
|
var children = props.children,
|
20286
20255
|
value = props.value,
|
20287
20256
|
index = props.index,
|
20288
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
20257
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$7);
|
20289
20258
|
return React__default.createElement("div", Object.assign({
|
20290
20259
|
role: "tabpanel",
|
20291
20260
|
hidden: value !== index,
|
@@ -24342,7 +24311,7 @@ var ChapterProblemSolvingResultsDialog = function ChapterProblemSolvingResultsDi
|
|
24342
24311
|
}, t("cancel"))))));
|
24343
24312
|
};
|
24344
24313
|
|
24345
|
-
var _excluded$
|
24314
|
+
var _excluded$8 = ["onChange"];
|
24346
24315
|
var StartPageDialog = function StartPageDialog(_ref) {
|
24347
24316
|
var t = _ref.t,
|
24348
24317
|
onClose = _ref.onClose,
|
@@ -24408,7 +24377,7 @@ var StartPageDialog = function StartPageDialog(_ref) {
|
|
24408
24377
|
}, t("page_to_start_with")), React__default.createElement(formik.Field, {
|
24409
24378
|
name: "startPage",
|
24410
24379
|
render: function render(_ref3) {
|
24411
|
-
var field = _objectWithoutPropertiesLoose(_ref3, _excluded$
|
24380
|
+
var field = _objectWithoutPropertiesLoose(_ref3, _excluded$8);
|
24412
24381
|
return React__default.createElement(CustomSelectOption, Object.assign({
|
24413
24382
|
maxMenuHeight: 150,
|
24414
24383
|
menuPosition: "fixed",
|
@@ -26040,10 +26009,10 @@ var DrawerTextbookResultTab = function DrawerTextbookResultTab(_ref) {
|
|
26040
26009
|
};
|
26041
26010
|
|
26042
26011
|
var _styled$1;
|
26043
|
-
var _excluded$
|
26012
|
+
var _excluded$9 = ["className"];
|
26044
26013
|
var CustomTooltip$1 = material.styled(function (_ref) {
|
26045
26014
|
var className = _ref.className,
|
26046
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
26015
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$9);
|
26047
26016
|
return React__default.createElement(material.Tooltip, Object.assign({}, props, {
|
26048
26017
|
classes: {
|
26049
26018
|
popper: className
|
@@ -27524,7 +27493,7 @@ var useTeacherList = function useTeacherList() {
|
|
27524
27493
|
};
|
27525
27494
|
};
|
27526
27495
|
|
27527
|
-
var _excluded$
|
27496
|
+
var _excluded$a = ["getStudents"],
|
27528
27497
|
_excluded2 = ["getTeachers"],
|
27529
27498
|
_excluded3 = ["getLessons"];
|
27530
27499
|
var PAGE_TITLE$4 = "classes";
|
@@ -27575,7 +27544,7 @@ var useClassDetail = function useClassDetail(_ref) {
|
|
27575
27544
|
};
|
27576
27545
|
var _useStudentClassList = useStudentClassList(classId),
|
27577
27546
|
getStudents = _useStudentClassList.getStudents,
|
27578
|
-
studentListProps = _objectWithoutPropertiesLoose(_useStudentClassList, _excluded$
|
27547
|
+
studentListProps = _objectWithoutPropertiesLoose(_useStudentClassList, _excluded$a);
|
27579
27548
|
var _useTeacherClassList = useTeacherClassList(classId),
|
27580
27549
|
getTeachers = _useTeacherClassList.getTeachers,
|
27581
27550
|
teacherListProps = _objectWithoutPropertiesLoose(_useTeacherClassList, _excluded2);
|
@@ -28963,14 +28932,14 @@ var CSV_PREFIX = "data:text/csv;charset=utf-8,";
|
|
28963
28932
|
|
28964
28933
|
var styles$8 = {"action-btn":"_1jXbz","action-btn--pencil":"_at4xP","icon-rotate-180":"_12gv9","drop-area":"_R4bn5"};
|
28965
28934
|
|
28966
|
-
var _excluded$
|
28935
|
+
var _excluded$b = ["text", "isRequired", "className"];
|
28967
28936
|
var LabelRequired = function LabelRequired(_ref) {
|
28968
28937
|
var text = _ref.text,
|
28969
28938
|
_ref$isRequired = _ref.isRequired,
|
28970
28939
|
isRequired = _ref$isRequired === void 0 ? true : _ref$isRequired,
|
28971
28940
|
_ref$className = _ref.className,
|
28972
28941
|
className = _ref$className === void 0 ? "" : _ref$className,
|
28973
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
28942
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$b);
|
28974
28943
|
return React__default.createElement(material.FormLabel, Object.assign({
|
28975
28944
|
className: "fw-medium mb-1 " + className
|
28976
28945
|
}, rest), text, isRequired && React__default.createElement("span", {
|
@@ -29024,7 +28993,7 @@ var deleteUserApi = function deleteUserApi(id) {
|
|
29024
28993
|
return api["delete"](USER_URL$1 + "/delete/" + id);
|
29025
28994
|
};
|
29026
28995
|
|
29027
|
-
var _excluded$
|
28996
|
+
var _excluded$c = ["ref"],
|
29028
28997
|
_excluded2$1 = ["ref"],
|
29029
28998
|
_excluded3$1 = ["ref"],
|
29030
28999
|
_excluded4 = ["ref"],
|
@@ -29054,7 +29023,7 @@ var UserDialog = function UserDialog(_ref) {
|
|
29054
29023
|
t = _useTranslation.t;
|
29055
29024
|
var _register = register("fullName"),
|
29056
29025
|
fullNameRef = _register.ref,
|
29057
|
-
fullNameBio = _objectWithoutPropertiesLoose(_register, _excluded$
|
29026
|
+
fullNameBio = _objectWithoutPropertiesLoose(_register, _excluded$c);
|
29058
29027
|
var _register2 = register("email"),
|
29059
29028
|
emailRef = _register2.ref,
|
29060
29029
|
emailBio = _objectWithoutPropertiesLoose(_register2, _excluded2$1);
|
@@ -33125,12 +33094,12 @@ var ArticleDialog = function ArticleDialog(_ref) {
|
|
33125
33094
|
|
33126
33095
|
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
33096
|
|
33128
|
-
var _excluded$
|
33097
|
+
var _excluded$d = ["isOpen", "onClose", "handleSaveExam"];
|
33129
33098
|
var CreateExamDrawer = function CreateExamDrawer(props) {
|
33130
33099
|
var isOpen = props.isOpen,
|
33131
33100
|
onClose = props.onClose,
|
33132
33101
|
handleSaveExam = props.handleSaveExam,
|
33133
|
-
examDetailViewProps = _objectWithoutPropertiesLoose(props, _excluded$
|
33102
|
+
examDetailViewProps = _objectWithoutPropertiesLoose(props, _excluded$d);
|
33134
33103
|
var _useTranslation = reactI18next.useTranslation(),
|
33135
33104
|
t = _useTranslation.t;
|
33136
33105
|
var theme = material.useTheme();
|
@@ -33892,11 +33861,11 @@ var TextbookRow = function TextbookRow(_ref) {
|
|
33892
33861
|
});
|
33893
33862
|
var _useTranslation = reactI18next.useTranslation(),
|
33894
33863
|
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) {
|
33864
|
+
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
33865
|
var _infoUser$email, _infoUser$email$trim;
|
33897
33866
|
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);
|
33867
|
+
})))) && data.totalUses <= 0;
|
33868
|
+
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
33869
|
var isSharable = !data.isPublic && data.isShared && onAcademy && (isAdminSite || isSuperAdminUser || !isAdmin && data.createdBy.id === infoUser.id);
|
33901
33870
|
var handleUpdateTextbook = function handleUpdateTextbook() {
|
33902
33871
|
onUpdateTextbook(data);
|
@@ -34283,12 +34252,12 @@ var useNotificationDetail = function useNotificationDetail(_ref) {
|
|
34283
34252
|
|
34284
34253
|
var styles$b = {"avatar":"_8niRT"};
|
34285
34254
|
|
34286
|
-
var _excluded$
|
34255
|
+
var _excluded$e = ["value", "disabled", "optionTypeNotification"];
|
34287
34256
|
var TypeSelector = function TypeSelector(_ref) {
|
34288
34257
|
var value = _ref.value,
|
34289
34258
|
disabled = _ref.disabled,
|
34290
34259
|
optionTypeNotification = _ref.optionTypeNotification,
|
34291
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
34260
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$e);
|
34292
34261
|
return React__default.createElement(CustomAsyncSelect, Object.assign({
|
34293
34262
|
options: optionTypeNotification,
|
34294
34263
|
value: value
|
@@ -34681,11 +34650,11 @@ var useNotificationList = function useNotificationList(_ref) {
|
|
34681
34650
|
};
|
34682
34651
|
};
|
34683
34652
|
|
34684
|
-
var _excluded$
|
34653
|
+
var _excluded$f = ["value", "optionTypeNotification"];
|
34685
34654
|
var SelectFilterType = function SelectFilterType(_ref) {
|
34686
34655
|
var value = _ref.value,
|
34687
34656
|
optionTypeNotification = _ref.optionTypeNotification,
|
34688
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
34657
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$f);
|
34689
34658
|
return React__default.createElement(CustomAsyncSelect, Object.assign({
|
34690
34659
|
options: optionTypeNotification,
|
34691
34660
|
value: value
|
@@ -34917,10 +34886,10 @@ var useTextbookManagement = function useTextbookManagement(_ref) {
|
|
34917
34886
|
var isAdminSite = role === exports.Role.Admin;
|
34918
34887
|
var onAcademy = !!(user !== null && user !== void 0 && user.academyDomain);
|
34919
34888
|
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) {
|
34889
|
+
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
34890
|
var _user$email, _user$email$trim;
|
34922
34891
|
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
|
-
}));
|
34892
|
+
}))) && selectedTextbook.totalUses <= 0;
|
34924
34893
|
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
34894
|
var handleOpenConfirmDeleteChapterDialog = function handleOpenConfirmDeleteChapterDialog(chapter) {
|
34926
34895
|
setSelectedChapter(chapter);
|
@@ -35022,24 +34991,6 @@ var useTextbookManagement = function useTextbookManagement(_ref) {
|
|
35022
34991
|
return Promise.reject(e);
|
35023
34992
|
}
|
35024
34993
|
};
|
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
34994
|
React.useEffect(function () {
|
35044
34995
|
if (!textbookId) return;
|
35045
34996
|
handleGetTextbookDetail();
|
@@ -35058,7 +35009,6 @@ var useTextbookManagement = function useTextbookManagement(_ref) {
|
|
35058
35009
|
isSuperAdminUser: isSuperAdminUser,
|
35059
35010
|
openDialog: openDialog,
|
35060
35011
|
handleSubmit: handleSubmit,
|
35061
|
-
handleSaveData: handleSaveData,
|
35062
35012
|
selectedTextbook: selectedTextbook,
|
35063
35013
|
handleOpenDialog: handleOpenDialog,
|
35064
35014
|
handleCloseDialog: handleCloseDialog,
|
@@ -35352,8 +35302,6 @@ var CompareTypeOptions = [{
|
|
35352
35302
|
label: "synonym_processing",
|
35353
35303
|
value: exports.QuestionAnswerType.SynonymProcessing
|
35354
35304
|
}];
|
35355
|
-
var SAVE_TIME_INTERVAL_IN_MILLISECONDS = 60 * 1000;
|
35356
|
-
var SAVE_TIME_MAX_DIFF_IN_MILLISECONDS = 500;
|
35357
35305
|
|
35358
35306
|
var CustomTextbookTab = function CustomTextbookTab(props) {
|
35359
35307
|
var children = props.children,
|
@@ -35962,7 +35910,7 @@ var isEqual$1 = function isEqual(prev, next) {
|
|
35962
35910
|
};
|
35963
35911
|
var QuestionShortInput$1 = React.memo(QuestionShortInput, isEqual$1);
|
35964
35912
|
|
35965
|
-
var _excluded$
|
35913
|
+
var _excluded$g = ["onChange"];
|
35966
35914
|
var _$2 = _$8;
|
35967
35915
|
var BpIcon$1 = material.styled("span")(function (_ref) {
|
35968
35916
|
var theme = _ref.theme;
|
@@ -36273,7 +36221,7 @@ var QuestionBlock = function QuestionBlock(_ref2) {
|
|
36273
36221
|
name: path + ".questionTypeId",
|
36274
36222
|
render: function render(_ref5) {
|
36275
36223
|
var _ref5$field = _ref5.field,
|
36276
|
-
field = _objectWithoutPropertiesLoose(_ref5$field, _excluded$
|
36224
|
+
field = _objectWithoutPropertiesLoose(_ref5$field, _excluded$g);
|
36277
36225
|
return React__default.createElement(CustomSelectOption, Object.assign({}, field, {
|
36278
36226
|
isDisabled: disabled,
|
36279
36227
|
value: data.questionType,
|
@@ -36322,7 +36270,7 @@ var isEqual$2 = function isEqual(prev, next) {
|
|
36322
36270
|
};
|
36323
36271
|
var QuestionBlock$1 = React.memo(QuestionBlock, isEqual$2);
|
36324
36272
|
|
36325
|
-
var _excluded$
|
36273
|
+
var _excluded$h = ["data", "path", "isMath", "open", "isLoadingCategories", "isLoadingQuestionTypes", "optionKey", "categories", "questionTypes", "disabled", "onQuestioStartOrderChange", "onDelete", "onOpenSubCategoryMenu", "onOpenCategoryMenu", "onCloseCategoryMenu", "onCloseQuestionTypeMenu", "onOpenQuestionTypeMenu"];
|
36326
36274
|
var _$3 = _$8;
|
36327
36275
|
var QuestionGroupBlockBody = function QuestionGroupBlockBody(_ref) {
|
36328
36276
|
var _data$articles$3, _data$articles$3$cate, _data$articles$4, _data$articles$4$cate, _questions$2;
|
@@ -36343,7 +36291,7 @@ var QuestionGroupBlockBody = function QuestionGroupBlockBody(_ref) {
|
|
36343
36291
|
onCloseCategoryMenu = _ref.onCloseCategoryMenu,
|
36344
36292
|
onCloseQuestionTypeMenu = _ref.onCloseQuestionTypeMenu,
|
36345
36293
|
onOpenQuestionTypeMenu = _ref.onOpenQuestionTypeMenu,
|
36346
|
-
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$
|
36294
|
+
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$h);
|
36347
36295
|
var errors = formikProps.errors;
|
36348
36296
|
var startOrderRef = React.useRef(null);
|
36349
36297
|
var articles = data.articles,
|
@@ -36486,7 +36434,7 @@ var isEqual$3 = function isEqual(prev, next) {
|
|
36486
36434
|
};
|
36487
36435
|
var QuestionGroupBlockBody$1 = React.memo(QuestionGroupBlockBody, isEqual$3);
|
36488
36436
|
|
36489
|
-
var _excluded$
|
36437
|
+
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
36438
|
var _$4 = _$8;
|
36491
36439
|
var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
|
36492
36440
|
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 +36459,7 @@ var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
|
|
36511
36459
|
onCopiedPrevQuestionGroup = _ref.onCopiedPrevQuestionGroup,
|
36512
36460
|
onCloseQuestionTypeMenu = _ref.onCloseQuestionTypeMenu,
|
36513
36461
|
onOpenQuestionTypeMenu = _ref.onOpenQuestionTypeMenu,
|
36514
|
-
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$
|
36462
|
+
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$i);
|
36515
36463
|
var errors = formikProps.errors,
|
36516
36464
|
setFieldValue = formikProps.setFieldValue;
|
36517
36465
|
var _useTranslation = reactI18next.useTranslation(),
|
@@ -36974,7 +36922,7 @@ var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
|
|
36974
36922
|
}, formikProps)))));
|
36975
36923
|
};
|
36976
36924
|
|
36977
|
-
var _excluded$
|
36925
|
+
var _excluded$j = ["path", "paths", "isMath", "isLoadingCategories", "isLoadingQuestionTypes", "optionKey", "questionGroups", "subChapters", "categories", "questionTypes", "disabled", "onDelete", "onOpenSubCategoryMenu", "onOpenCategoryMenu", "onCloseCategoryMenu", "onCopiedPrevQuestionGroup", "onCloseQuestionTypeMenu", "onOpenQuestionTypeMenu"];
|
36978
36926
|
var ChapterBlockBody = function ChapterBlockBody(_ref) {
|
36979
36927
|
var path = _ref.path,
|
36980
36928
|
paths = _ref.paths,
|
@@ -36994,7 +36942,7 @@ var ChapterBlockBody = function ChapterBlockBody(_ref) {
|
|
36994
36942
|
onCopiedPrevQuestionGroup = _ref.onCopiedPrevQuestionGroup,
|
36995
36943
|
onCloseQuestionTypeMenu = _ref.onCloseQuestionTypeMenu,
|
36996
36944
|
onOpenQuestionTypeMenu = _ref.onOpenQuestionTypeMenu,
|
36997
|
-
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$
|
36945
|
+
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$j);
|
36998
36946
|
var _useTranslation = reactI18next.useTranslation(),
|
36999
36947
|
t = _useTranslation.t;
|
37000
36948
|
var setFieldValue = formikProps.setFieldValue;
|
@@ -37173,7 +37121,7 @@ var ChapterBlockBody = function ChapterBlockBody(_ref) {
|
|
37173
37121
|
}));
|
37174
37122
|
};
|
37175
37123
|
|
37176
|
-
var _excluded$
|
37124
|
+
var _excluded$k = ["data", "expandedIndex", "open", "path", "paths", "isMath", "isLoadingCategories", "isLoadingQuestionTypes", "categories", "questionTypes", "optionKey", "disabled", "onToggle", "onDelete", "onCopiedPrevQuestionGroup", "onCloseCategoryMenu", "onOpenCategoryMenu", "onOpenSubCategoryMenu", "onOpenQuestionTypeMenu", "onCloseQuestionTypeMenu"];
|
37177
37125
|
var _$5 = _$8;
|
37178
37126
|
var ChapterBlock = function ChapterBlock(_ref) {
|
37179
37127
|
var data = _ref.data,
|
@@ -37196,7 +37144,7 @@ var ChapterBlock = function ChapterBlock(_ref) {
|
|
37196
37144
|
onOpenSubCategoryMenu = _ref.onOpenSubCategoryMenu,
|
37197
37145
|
onOpenQuestionTypeMenu = _ref.onOpenQuestionTypeMenu,
|
37198
37146
|
onCloseQuestionTypeMenu = _ref.onCloseQuestionTypeMenu,
|
37199
|
-
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$
|
37147
|
+
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$k);
|
37200
37148
|
var errors = formikProps.errors;
|
37201
37149
|
var _useTranslation = reactI18next.useTranslation(),
|
37202
37150
|
t = _useTranslation.t;
|
@@ -37887,7 +37835,7 @@ var TextbookContentsTab = function TextbookContentsTab(props) {
|
|
37887
37835
|
}));
|
37888
37836
|
};
|
37889
37837
|
|
37890
|
-
var _excluded$
|
37838
|
+
var _excluded$l = ["value"];
|
37891
37839
|
var VisuallyHiddenInput = material.styled("input")({
|
37892
37840
|
clip: "rect(0 0 0 0)",
|
37893
37841
|
clipPath: "inset(50%)",
|
@@ -38055,7 +38003,7 @@ var TextbookInfoTab = function TextbookInfoTab(_ref) {
|
|
38055
38003
|
render: function render(_ref4) {
|
38056
38004
|
var _ref4$field = _ref4.field,
|
38057
38005
|
value = _ref4$field.value,
|
38058
|
-
action = _objectWithoutPropertiesLoose(_ref4$field, _excluded$
|
38006
|
+
action = _objectWithoutPropertiesLoose(_ref4$field, _excluded$l);
|
38059
38007
|
return React__default.createElement(xDatePickers.LocalizationProvider, {
|
38060
38008
|
dateAdapter: AdapterMoment.AdapterMoment
|
38061
38009
|
}, React__default.createElement(xDatePickers.DatePicker, Object.assign({}, action, {
|
@@ -38529,7 +38477,7 @@ var TextbookOwnersTab = function TextbookOwnersTab(_ref) {
|
|
38529
38477
|
}));
|
38530
38478
|
};
|
38531
38479
|
|
38532
|
-
var _excluded$
|
38480
|
+
var _excluded$m = ["isCreatedByAdmin", "isSuperAdminUser", "isSuperAdmin", "isAdmin", "textbookId", "selected", "coverImage", "disabled", "ownersDisabled", "onChangeTab", "onUploadImage"];
|
38533
38481
|
var PreparedTextbookForm = function PreparedTextbookForm(_ref) {
|
38534
38482
|
var isCreatedByAdmin = _ref.isCreatedByAdmin,
|
38535
38483
|
isSuperAdminUser = _ref.isSuperAdminUser,
|
@@ -38540,33 +38488,14 @@ var PreparedTextbookForm = function PreparedTextbookForm(_ref) {
|
|
38540
38488
|
coverImage = _ref.coverImage,
|
38541
38489
|
disabled = _ref.disabled,
|
38542
38490
|
ownersDisabled = _ref.ownersDisabled,
|
38543
|
-
selectedTextbook = _ref.selectedTextbook,
|
38544
|
-
handleSaveData = _ref.handleSaveData,
|
38545
38491
|
onChangeTab = _ref.onChangeTab,
|
38546
38492
|
onUploadImage = _ref.onUploadImage,
|
38547
|
-
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$
|
38493
|
+
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$m);
|
38548
38494
|
var values = formikProps.values,
|
38549
38495
|
errors = formikProps.errors,
|
38550
38496
|
dirty = formikProps.dirty,
|
38551
38497
|
submitCount = formikProps.submitCount,
|
38552
38498
|
setValues = formikProps.setValues;
|
38553
|
-
var theme = material.useTheme();
|
38554
|
-
var savedRunRef = React.useRef(Date.now());
|
38555
|
-
var runTimeRef = React.useRef(Date.now());
|
38556
|
-
var valuesTextbook = React.useRef(null);
|
38557
|
-
var isFirstLoad = true;
|
38558
|
-
var _React$useState = React__default.useState(PrintStatus.Idle),
|
38559
|
-
saveStatus = _React$useState[0],
|
38560
|
-
setSaveStatus = _React$useState[1];
|
38561
|
-
var timeoutRef = React.useRef(null);
|
38562
|
-
var isProcessingRef = React.useRef(false);
|
38563
|
-
var pendingValuesRef = React.useRef(null);
|
38564
|
-
var _useState = React.useState(),
|
38565
|
-
saved = _useState[0],
|
38566
|
-
setSaved = _useState[1];
|
38567
|
-
var _useState2 = React.useState(),
|
38568
|
-
lastEdited = _useState2[0],
|
38569
|
-
setLastEdited = _useState2[1];
|
38570
38499
|
React.useEffect(function () {
|
38571
38500
|
var handleBeforeUnload = function handleBeforeUnload(event) {
|
38572
38501
|
var message = i18n.t("are_you_sure_you_want_to_quit_yours_changes_may_not_be_saved");
|
@@ -38587,100 +38516,9 @@ var PreparedTextbookForm = function PreparedTextbookForm(_ref) {
|
|
38587
38516
|
var newValues = _resetAllCategoriesAndQuestionTypesBySubject(values, val);
|
38588
38517
|
setValues(newValues);
|
38589
38518
|
};
|
38590
|
-
React.useEffect(function () {
|
38591
|
-
if (!valuesTextbook.current && isFirstLoad && !_$8.isEqual(values, DEFAULT_TEXTBOOK_REQUEST)) {
|
38592
|
-
valuesTextbook.current = _$8.cloneDeep(values);
|
38593
|
-
isFirstLoad = false;
|
38594
|
-
}
|
38595
|
-
}, [values]);
|
38596
|
-
var _handleSave = function handleSave(valuesProps) {
|
38597
|
-
try {
|
38598
|
-
var _temp = _finallyRethrows(function () {
|
38599
|
-
return _catch(function () {
|
38600
|
-
isProcessingRef.current = true;
|
38601
|
-
setSaveStatus(PrintStatus.Saving);
|
38602
|
-
var valuesToSave = valuesProps || values;
|
38603
|
-
return Promise.resolve(handleSaveData(valuesToSave)).then(function () {
|
38604
|
-
valuesTextbook.current = _$8.cloneDeep(valuesToSave);
|
38605
|
-
var now = Date.now();
|
38606
|
-
savedRunRef.current = now;
|
38607
|
-
runTimeRef.current = now;
|
38608
|
-
setSaveStatus(PrintStatus.Saved);
|
38609
|
-
setSaved(valuesToSave);
|
38610
|
-
});
|
38611
|
-
}, function (error) {
|
38612
|
-
setSaveStatus(PrintStatus.Idle);
|
38613
|
-
console.error(error);
|
38614
|
-
});
|
38615
|
-
}, function (_wasThrown, _result) {
|
38616
|
-
isProcessingRef.current = false;
|
38617
|
-
if (pendingValuesRef.current) {
|
38618
|
-
if (timeoutRef.current) {
|
38619
|
-
clearTimeout(timeoutRef.current);
|
38620
|
-
}
|
38621
|
-
timeoutRef.current = setTimeout(function () {
|
38622
|
-
timeoutRef.current = null;
|
38623
|
-
var pendingValues = pendingValuesRef.current;
|
38624
|
-
if (pendingValues) {
|
38625
|
-
_handleSave(pendingValues);
|
38626
|
-
pendingValuesRef.current = null;
|
38627
|
-
}
|
38628
|
-
}, SAVE_TIME_INTERVAL_IN_MILLISECONDS);
|
38629
|
-
}
|
38630
|
-
if (_wasThrown) throw _result;
|
38631
|
-
return _result;
|
38632
|
-
});
|
38633
|
-
return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
|
38634
|
-
} catch (e) {
|
38635
|
-
return Promise.reject(e);
|
38636
|
-
}
|
38637
|
-
};
|
38638
|
-
React.useEffect(function () {
|
38639
|
-
var now = Date.now();
|
38640
|
-
if (valuesTextbook.current && !_$8.isEqual(values, valuesTextbook.current)) setLastEdited(now);
|
38641
|
-
if (!_$8.isEmpty(errors) || !valuesTextbook.current || !(selectedTextbook !== null && selectedTextbook !== void 0 && selectedTextbook.id)) return;
|
38642
|
-
if (valuesTextbook.current && _$8.isEqual(values, valuesTextbook.current)) return;
|
38643
|
-
if (isProcessingRef.current) {
|
38644
|
-
pendingValuesRef.current = _$8.cloneDeep(values);
|
38645
|
-
return;
|
38646
|
-
}
|
38647
|
-
var timeSinceLastRun = now - runTimeRef.current;
|
38648
|
-
var maxTime = SAVE_TIME_INTERVAL_IN_MILLISECONDS + SAVE_TIME_MAX_DIFF_IN_MILLISECONDS;
|
38649
|
-
if (timeSinceLastRun > maxTime) {
|
38650
|
-
runTimeRef.current = now;
|
38651
|
-
timeSinceLastRun = 0;
|
38652
|
-
}
|
38653
|
-
if (timeSinceLastRun >= SAVE_TIME_INTERVAL_IN_MILLISECONDS) {
|
38654
|
-
if (timeoutRef.current) {
|
38655
|
-
clearTimeout(timeoutRef.current);
|
38656
|
-
timeoutRef.current = null;
|
38657
|
-
pendingValuesRef.current = null;
|
38658
|
-
}
|
38659
|
-
_handleSave();
|
38660
|
-
} else {
|
38661
|
-
pendingValuesRef.current = _$8.cloneDeep(values);
|
38662
|
-
var intevalTime = SAVE_TIME_INTERVAL_IN_MILLISECONDS - timeSinceLastRun;
|
38663
|
-
timeoutRef.current = setTimeout(function () {
|
38664
|
-
timeoutRef.current = null;
|
38665
|
-
var pendingValues = pendingValuesRef.current;
|
38666
|
-
if (pendingValues) {
|
38667
|
-
clearTimeout(timeoutRef.current);
|
38668
|
-
_handleSave(pendingValues);
|
38669
|
-
pendingValuesRef.current = null;
|
38670
|
-
}
|
38671
|
-
}, intevalTime);
|
38672
|
-
}
|
38673
|
-
return function () {
|
38674
|
-
if (timeoutRef.current) {
|
38675
|
-
clearTimeout(timeoutRef.current);
|
38676
|
-
}
|
38677
|
-
};
|
38678
|
-
}, [values, errors]);
|
38679
38519
|
var inforErrors = errors.coverImage || errors.grade || errors.isbn || errors.preparedType || errors.publicationDate || errors.publisher;
|
38680
38520
|
var contentsErrors = errors.chapters;
|
38681
38521
|
var textbookOwnersErrors = errors.textbookOwners;
|
38682
|
-
var hasError = !_$8.isEmpty(errors);
|
38683
|
-
var isSaved = !lastEdited || _$8.isEqual(values, saved != null ? saved : {});
|
38684
38522
|
return React__default.createElement(formik.Form, null, React__default.createElement(material.Stack, {
|
38685
38523
|
direction: "column",
|
38686
38524
|
gap: 3
|
@@ -38768,45 +38606,7 @@ var PreparedTextbookForm = function PreparedTextbookForm(_ref) {
|
|
38768
38606
|
}), React__default.createElement(material.FormLabel, {
|
38769
38607
|
htmlFor: "type",
|
38770
38608
|
className: "text-center"
|
38771
|
-
}, i18n.t("math"))))), React__default.createElement(material.
|
38772
|
-
flexDirection: "row",
|
38773
|
-
gap: "8px"
|
38774
|
-
}, React__default.createElement(material.Stack, {
|
38775
|
-
padding: "6px 12px",
|
38776
|
-
sx: {
|
38777
|
-
transition: "opacity 0.3s ease",
|
38778
|
-
opacity: saveStatus === PrintStatus.Idle && isSaved ? 0 : 1,
|
38779
|
-
pointerEvents: "none",
|
38780
|
-
gap: "8px",
|
38781
|
-
flexDirection: "row",
|
38782
|
-
justifyContent: "center",
|
38783
|
-
alignItems: "center"
|
38784
|
-
}
|
38785
|
-
}, saveStatus === PrintStatus.Saving && React__default.createElement(ai.AiOutlineLoading3Quarters, {
|
38786
|
-
style: {
|
38787
|
-
animation: "spin 1s linear infinite"
|
38788
|
-
}
|
38789
|
-
}), 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, {
|
38790
|
-
color: red[900]
|
38791
|
-
}) : React__default.createElement(fa6.FaClockRotateLeft, {
|
38792
|
-
size: "14px"
|
38793
|
-
})), React__default.createElement(material.Typography, {
|
38794
|
-
sx: {
|
38795
|
-
color: theme.palette.grey[700],
|
38796
|
-
fontSize: "14px",
|
38797
|
-
display: "flex",
|
38798
|
-
alignItems: "center",
|
38799
|
-
gap: 1,
|
38800
|
-
"@keyframes spin": {
|
38801
|
-
"0%": {
|
38802
|
-
transform: "rotate(0deg)"
|
38803
|
-
},
|
38804
|
-
"100%": {
|
38805
|
-
transform: "rotate(360deg)"
|
38806
|
-
}
|
38807
|
-
}
|
38808
|
-
}
|
38809
|
-
}, 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, {
|
38609
|
+
}, i18n.t("math"))))), React__default.createElement(material.Box, null, React__default.createElement(material.Button, {
|
38810
38610
|
type: "submit",
|
38811
38611
|
sx: {
|
38812
38612
|
width: "fit-content"
|
@@ -38913,7 +38713,6 @@ var PreparedTextbookView = function PreparedTextbookView(_ref) {
|
|
38913
38713
|
isSuperAdminUser = _useTextbookManagemen.isSuperAdminUser,
|
38914
38714
|
isAdmin = _useTextbookManagemen.isAdmin,
|
38915
38715
|
coverImage = _useTextbookManagemen.coverImage,
|
38916
|
-
handleSaveData = _useTextbookManagemen.handleSaveData,
|
38917
38716
|
selectedTextbook = _useTextbookManagemen.selectedTextbook,
|
38918
38717
|
handleSubmit = _useTextbookManagemen.handleSubmit,
|
38919
38718
|
handleUploadImage = _useTextbookManagemen.handleUploadImage;
|
@@ -38936,9 +38735,7 @@ var PreparedTextbookView = function PreparedTextbookView(_ref) {
|
|
38936
38735
|
isAdmin: isAdmin,
|
38937
38736
|
isSuperAdmin: isSuperAdmin,
|
38938
38737
|
selected: selected,
|
38939
|
-
handleSaveData: handleSaveData,
|
38940
38738
|
textbookId: textbookId,
|
38941
|
-
selectedTextbook: selectedTextbook,
|
38942
38739
|
onChangeTab: handleChangeTab,
|
38943
38740
|
onUploadImage: handleUploadImage,
|
38944
38741
|
coverImage: coverImage,
|