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.modern.js
CHANGED
@@ -18,7 +18,7 @@ import moment from 'moment';
|
|
18
18
|
export { default as moment } from 'moment';
|
19
19
|
import { FaSave, FaCaretDown, FaTimes, FaTrash, FaSortUp, FaSortDown, FaPlusCircle, FaEye, FaPlus, FaCalendar, FaUser, FaBookOpen, FaUpload, FaPencilAlt, FaCheckCircle, FaShare, FaExchangeAlt, FaBell } from 'react-icons/fa';
|
20
20
|
import { IoMdArrowBack, IoMdSync, IoIosAlert, IoIosArrowDown, IoIosSearch, IoIosArrowUp, IoIosAdd, IoMdAdd } from 'react-icons/io';
|
21
|
-
import { IoClose, IoSearch, IoCloseOutline, IoTime, IoChevronUp, IoChevronDown, IoChatbubbleEllipsesSharp, IoPrint, IoCheckmarkCircle, IoChevronUpOutline, IoChevronDownOutline, IoReceiptSharp, IoBook, IoWarning, IoCalendarClear, IoPerson, IoInformationCircle, IoTrash, IoAddCircle,
|
21
|
+
import { IoClose, IoSearch, IoCloseOutline, IoTime, IoChevronUp, IoChevronDown, IoChatbubbleEllipsesSharp, IoPrint, IoCheckmarkCircle, IoChevronUpOutline, IoChevronDownOutline, IoReceiptSharp, IoBook, IoWarning, IoCalendarClear, IoPerson, IoInformationCircle, IoTrash, IoAddCircle, IoCloseCircle, IoLogOut } from 'react-icons/io5';
|
22
22
|
import MButton from '@mui/material/Button';
|
23
23
|
import DialogTitle$1 from '@mui/material/DialogTitle';
|
24
24
|
import DialogContent$1 from '@mui/material/DialogContent';
|
@@ -48,7 +48,7 @@ import CardMedia from '@mui/material/CardMedia';
|
|
48
48
|
import { object, string, number, date as date$2, array, mixed } from 'yup';
|
49
49
|
import { blue, grey as grey$1, yellow as yellow$1 } from '@mui/material/colors';
|
50
50
|
import { GoogleReCaptcha, GoogleReCaptchaProvider } from 'react-google-recaptcha-v3';
|
51
|
-
import { MdVisibilityOff, MdVisibility, MdAutorenew, MdMoreHoriz, MdDownload, MdExpandMore
|
51
|
+
import { MdVisibilityOff, MdVisibility, MdAutorenew, MdMoreHoriz, MdDownload, MdExpandMore } from 'react-icons/md';
|
52
52
|
import { gapi } from 'gapi-script';
|
53
53
|
import Pusher from 'pusher-js/with-encryption';
|
54
54
|
import { BiSolidError } from 'react-icons/bi';
|
@@ -73,7 +73,6 @@ import { useForm } from 'react-hook-form';
|
|
73
73
|
import { yupResolver } from '@hookform/resolvers/yup';
|
74
74
|
import { PiDotsNineLight } from 'react-icons/pi';
|
75
75
|
import Container$1 from '@mui/material/Container';
|
76
|
-
import { AiOutlineLoading3Quarters } from 'react-icons/ai';
|
77
76
|
import { BsCheckAll } from 'react-icons/bs';
|
78
77
|
import Popover$1 from '@mui/material/Popover';
|
79
78
|
import MenuItem from '@mui/material/MenuItem';
|
@@ -1034,7 +1033,6 @@ var teacher_required = "선생님은 필수입니다";
|
|
1034
1033
|
var total_users = "총 사용자";
|
1035
1034
|
var added_date = "추가된 날짜";
|
1036
1035
|
var sync_exam_results = "시험 결과 동기화";
|
1037
|
-
var sync_textbook_results = "교재 결과 동기화";
|
1038
1036
|
var update_data_fail = "데이터 업데이트 실패";
|
1039
1037
|
var add_students_to_class = "수업에 학생 추가";
|
1040
1038
|
var add_teachers_to_class = "수업에 교사 추가";
|
@@ -1045,13 +1043,9 @@ var question_management = "질문 관리";
|
|
1045
1043
|
var student_data = "학생 데이터";
|
1046
1044
|
var problem_number_question_chart = "문제 {{number}}번";
|
1047
1045
|
var are_you_sure_to_sync_exam_results_to_academy = "시험 결과를 아카데미 {{ academyName }}에 동기화하시겠습니까(백그라운드에서 실행되며 시간이 다소 소요됨)";
|
1048
|
-
var are_you_sure_to_sync_textbook_results_to_academy = "교재 학습 결과를 아카데미 {{ academyName }}에 동기화하시겠습니까? (백그라운드에서 실행되며 시간이 다소 소요됨)";
|
1049
1046
|
var messages = {
|
1050
|
-
exam_sessions_are_being_synchronized: "{{ total }} 개의 시험 세션이 동기화되고 있습니다"
|
1051
|
-
textbook_sessions_are_being_synchronized: "{{ total }} 개의 교재 학습 세션이 동기화되고 있습니다"
|
1047
|
+
exam_sessions_are_being_synchronized: "{{ total }} 개의 시험 세션이 동기화되고 있습니다"
|
1052
1048
|
};
|
1053
|
-
var sync_exam = "시험 동기화";
|
1054
|
-
var sync_textbook = "교재 동기화";
|
1055
1049
|
var submit = "제출하다";
|
1056
1050
|
var must_select_a_teacher_first = "먼저 교사를 선택해야 합니다";
|
1057
1051
|
var student_grade_is_invalid = "학생 등급은 1에서 12 사이여야 합니다";
|
@@ -1498,8 +1492,6 @@ var order_matters = "순서 상관 있음";
|
|
1498
1492
|
var order_does_not_matter = "순서 상관 없음";
|
1499
1493
|
var synonym_processing = "답 이음동의어 처리";
|
1500
1494
|
var compare_type = "비교 유형";
|
1501
|
-
var all_changes_saved = "모든 변경 사항이 저장되었습니다";
|
1502
|
-
var saving = "절약";
|
1503
1495
|
var textbook_name = "교재 이름";
|
1504
1496
|
var korean_language = "국어";
|
1505
1497
|
var answer_cannot_be_empty = "답변은 비워둘 수 없습니다";
|
@@ -1546,7 +1538,6 @@ var admin_to_teachers = "관리자에서 교사들에게";
|
|
1546
1538
|
var teacher_to_teachers = "교사에서 교사들에게";
|
1547
1539
|
var student_required = "학생은 필수입니다";
|
1548
1540
|
var teachers_required = "교사가 필요합니다";
|
1549
|
-
var all_changes_are_not_saved_yet = "아직 모든 변경 사항이 저장되지 않았습니다";
|
1550
1541
|
var lang_ko = {
|
1551
1542
|
problem_solving: problem_solving,
|
1552
1543
|
my_story: my_story,
|
@@ -2226,7 +2217,6 @@ var lang_ko = {
|
|
2226
2217
|
total_users: total_users,
|
2227
2218
|
added_date: added_date,
|
2228
2219
|
sync_exam_results: sync_exam_results,
|
2229
|
-
sync_textbook_results: sync_textbook_results,
|
2230
2220
|
update_data_fail: update_data_fail,
|
2231
2221
|
add_students_to_class: add_students_to_class,
|
2232
2222
|
add_teachers_to_class: add_teachers_to_class,
|
@@ -2237,10 +2227,7 @@ var lang_ko = {
|
|
2237
2227
|
student_data: student_data,
|
2238
2228
|
problem_number_question_chart: problem_number_question_chart,
|
2239
2229
|
are_you_sure_to_sync_exam_results_to_academy: are_you_sure_to_sync_exam_results_to_academy,
|
2240
|
-
are_you_sure_to_sync_textbook_results_to_academy: are_you_sure_to_sync_textbook_results_to_academy,
|
2241
2230
|
messages: messages,
|
2242
|
-
sync_exam: sync_exam,
|
2243
|
-
sync_textbook: sync_textbook,
|
2244
2231
|
submit: submit,
|
2245
2232
|
must_select_a_teacher_first: must_select_a_teacher_first,
|
2246
2233
|
student_grade_is_invalid: student_grade_is_invalid,
|
@@ -2675,8 +2662,6 @@ var lang_ko = {
|
|
2675
2662
|
order_does_not_matter: order_does_not_matter,
|
2676
2663
|
synonym_processing: synonym_processing,
|
2677
2664
|
compare_type: compare_type,
|
2678
|
-
all_changes_saved: all_changes_saved,
|
2679
|
-
saving: saving,
|
2680
2665
|
textbook_name: textbook_name,
|
2681
2666
|
korean_language: korean_language,
|
2682
2667
|
answer_cannot_be_empty: answer_cannot_be_empty,
|
@@ -2722,8 +2707,7 @@ var lang_ko = {
|
|
2722
2707
|
admin_to_teachers: admin_to_teachers,
|
2723
2708
|
teacher_to_teachers: teacher_to_teachers,
|
2724
2709
|
student_required: student_required,
|
2725
|
-
teachers_required: teachers_required
|
2726
|
-
all_changes_are_not_saved_yet: all_changes_are_not_saved_yet
|
2710
|
+
teachers_required: teachers_required
|
2727
2711
|
};
|
2728
2712
|
|
2729
2713
|
var problem_solving$1 = "Problem Solving";
|
@@ -3410,7 +3394,6 @@ var teacher_required$1 = "Teacher is required";
|
|
3410
3394
|
var total_users$1 = "Total users";
|
3411
3395
|
var added_date$1 = "Added date";
|
3412
3396
|
var sync_exam_results$1 = "Sync exam results";
|
3413
|
-
var sync_textbook_results$1 = "Sync textbook results";
|
3414
3397
|
var update_data_fail$1 = "Update data fail";
|
3415
3398
|
var add_students_to_class$1 = "Add students to class";
|
3416
3399
|
var add_teachers_to_class$1 = "Add teachers to class";
|
@@ -3421,13 +3404,9 @@ var question_management$1 = "Question Management";
|
|
3421
3404
|
var student_data$1 = "Student Data";
|
3422
3405
|
var problem_number_question_chart$1 = "Q. {{number}}";
|
3423
3406
|
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)";
|
3424
|
-
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)";
|
3425
3407
|
var messages$1 = {
|
3426
|
-
exam_sessions_are_being_synchronized: "{{ total }} exam sessions are being synchronized"
|
3427
|
-
textbook_sessions_are_being_synchronized: "{{ total }} textbook sessions are being synchronized"
|
3408
|
+
exam_sessions_are_being_synchronized: "{{ total }} exam sessions are being synchronized"
|
3428
3409
|
};
|
3429
|
-
var sync_exam$1 = "Sync Exam";
|
3430
|
-
var sync_textbook$1 = "Sync Textbook";
|
3431
3410
|
var submit$1 = "Submit";
|
3432
3411
|
var must_select_a_teacher_first$1 = "Must select a teacher first";
|
3433
3412
|
var student_grade_is_invalid$1 = "Student grade must be from 1 to 12";
|
@@ -3875,8 +3854,6 @@ var order_matters$1 = "Order matters";
|
|
3875
3854
|
var order_does_not_matter$1 = "Order doesn't matter";
|
3876
3855
|
var synonym_processing$1 = "Answer Synonym processing";
|
3877
3856
|
var compare_type$1 = "Compare Type";
|
3878
|
-
var all_changes_saved$1 = "All changes saved";
|
3879
|
-
var saving$1 = "Saving";
|
3880
3857
|
var textbook_name$1 = "Textbook name";
|
3881
3858
|
var korean_language$1 = "Korean";
|
3882
3859
|
var answer_cannot_be_empty$1 = "Answer cannot be empty";
|
@@ -3923,7 +3900,6 @@ var admin_to_teachers$1 = "Admin to teachers";
|
|
3923
3900
|
var teacher_to_teachers$1 = "Teacher to teachers";
|
3924
3901
|
var student_required$1 = "Student is required";
|
3925
3902
|
var teachers_required$1 = "Teachers are required";
|
3926
|
-
var all_changes_are_not_saved_yet$1 = "All changes are not saved yet";
|
3927
3903
|
var lang_en = {
|
3928
3904
|
problem_solving: problem_solving$1,
|
3929
3905
|
my_story: my_story$1,
|
@@ -4604,7 +4580,6 @@ var lang_en = {
|
|
4604
4580
|
total_users: total_users$1,
|
4605
4581
|
added_date: added_date$1,
|
4606
4582
|
sync_exam_results: sync_exam_results$1,
|
4607
|
-
sync_textbook_results: sync_textbook_results$1,
|
4608
4583
|
update_data_fail: update_data_fail$1,
|
4609
4584
|
add_students_to_class: add_students_to_class$1,
|
4610
4585
|
add_teachers_to_class: add_teachers_to_class$1,
|
@@ -4615,10 +4590,7 @@ var lang_en = {
|
|
4615
4590
|
student_data: student_data$1,
|
4616
4591
|
problem_number_question_chart: problem_number_question_chart$1,
|
4617
4592
|
are_you_sure_to_sync_exam_results_to_academy: are_you_sure_to_sync_exam_results_to_academy$1,
|
4618
|
-
are_you_sure_to_sync_textbook_results_to_academy: are_you_sure_to_sync_textbook_results_to_academy$1,
|
4619
4593
|
messages: messages$1,
|
4620
|
-
sync_exam: sync_exam$1,
|
4621
|
-
sync_textbook: sync_textbook$1,
|
4622
4594
|
submit: submit$1,
|
4623
4595
|
must_select_a_teacher_first: must_select_a_teacher_first$1,
|
4624
4596
|
student_grade_is_invalid: student_grade_is_invalid$1,
|
@@ -5054,8 +5026,6 @@ var lang_en = {
|
|
5054
5026
|
order_does_not_matter: order_does_not_matter$1,
|
5055
5027
|
synonym_processing: synonym_processing$1,
|
5056
5028
|
compare_type: compare_type$1,
|
5057
|
-
all_changes_saved: all_changes_saved$1,
|
5058
|
-
saving: saving$1,
|
5059
5029
|
textbook_name: textbook_name$1,
|
5060
5030
|
korean_language: korean_language$1,
|
5061
5031
|
answer_cannot_be_empty: answer_cannot_be_empty$1,
|
@@ -5101,8 +5071,7 @@ var lang_en = {
|
|
5101
5071
|
admin_to_teachers: admin_to_teachers$1,
|
5102
5072
|
teacher_to_teachers: teacher_to_teachers$1,
|
5103
5073
|
student_required: student_required$1,
|
5104
|
-
teachers_required: teachers_required$1
|
5105
|
-
all_changes_are_not_saved_yet: all_changes_are_not_saved_yet$1
|
5074
|
+
teachers_required: teachers_required$1
|
5106
5075
|
};
|
5107
5076
|
|
5108
5077
|
i18n.use(initReactI18next).init({
|
@@ -6308,12 +6277,6 @@ var TextbookEditorType;
|
|
6308
6277
|
TextbookEditorType[TextbookEditorType["Korea"] = 1] = "Korea";
|
6309
6278
|
TextbookEditorType[TextbookEditorType["Math"] = 2] = "Math";
|
6310
6279
|
})(TextbookEditorType || (TextbookEditorType = {}));
|
6311
|
-
var PrintStatus;
|
6312
|
-
(function (PrintStatus) {
|
6313
|
-
PrintStatus[PrintStatus["Idle"] = 0] = "Idle";
|
6314
|
-
PrintStatus[PrintStatus["Saving"] = 1] = "Saving";
|
6315
|
-
PrintStatus[PrintStatus["Saved"] = 2] = "Saved";
|
6316
|
-
})(PrintStatus || (PrintStatus = {}));
|
6317
6280
|
|
6318
6281
|
var SchoolType$1;
|
6319
6282
|
(function (SchoolType) {
|
@@ -13035,8 +12998,8 @@ var DayOfWeek;
|
|
13035
12998
|
})(DayOfWeek || (DayOfWeek = {}));
|
13036
12999
|
var TeacherSortBy;
|
13037
13000
|
(function (TeacherSortBy) {
|
13038
|
-
TeacherSortBy["Name"] = "UserProfile.FullName";
|
13039
|
-
TeacherSortBy["Email"] = "UserProfile.Email";
|
13001
|
+
TeacherSortBy["Name"] = "User.UserProfile.FullName";
|
13002
|
+
TeacherSortBy["Email"] = "User.UserProfile.Email";
|
13040
13003
|
})(TeacherSortBy || (TeacherSortBy = {}));
|
13041
13004
|
var ClassStatus;
|
13042
13005
|
(function (ClassStatus) {
|
@@ -13314,23 +13277,29 @@ var DEFAULT_USER_FILTERS = {
|
|
13314
13277
|
|
13315
13278
|
var styles$3 = {"avatar":"_2rJkZ","date-picker":"_1iqE2","time-picker":"_20xtc","teacher-selector-wrapper":"_3L1Oj"};
|
13316
13279
|
|
13317
|
-
var _excluded$7 = ["teachers", "value"];
|
13318
13280
|
var TeacherSelector = function TeacherSelector(_ref) {
|
13319
13281
|
var teachers = _ref.teachers,
|
13320
|
-
value = _ref.value
|
13321
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$7);
|
13282
|
+
value = _ref.value;
|
13322
13283
|
var teacherOptions = teachers.map(function (i) {
|
13323
13284
|
return {
|
13324
13285
|
label: i.teacherName + "/" + i.teacherEmail,
|
13325
13286
|
value: i.id
|
13326
13287
|
};
|
13327
13288
|
});
|
13328
|
-
return React__default.createElement(CustomAsyncSelect,
|
13289
|
+
return React__default.createElement(CustomAsyncSelect, {
|
13329
13290
|
options: teacherOptions,
|
13330
|
-
value: value
|
13331
|
-
|
13291
|
+
value: value,
|
13292
|
+
menuPlacement: "bottom",
|
13293
|
+
styles: {
|
13294
|
+
menuPortal: function menuPortal(base) {
|
13295
|
+
return _extends({}, base, {
|
13296
|
+
zIndex: 9999
|
13297
|
+
});
|
13298
|
+
}
|
13299
|
+
},
|
13300
|
+
menuPortalTarget: document.body,
|
13332
13301
|
isClearable: true
|
13333
|
-
})
|
13302
|
+
});
|
13334
13303
|
};
|
13335
13304
|
|
13336
13305
|
var ErrorHandler = function ErrorHandler(_ref) {
|
@@ -20298,12 +20267,12 @@ function CreateNewQuestionDialog(_ref) {
|
|
20298
20267
|
});
|
20299
20268
|
}
|
20300
20269
|
|
20301
|
-
var _excluded$
|
20270
|
+
var _excluded$7 = ["children", "value", "index"];
|
20302
20271
|
var CustomTabPanel = function CustomTabPanel(props) {
|
20303
20272
|
var children = props.children,
|
20304
20273
|
value = props.value,
|
20305
20274
|
index = props.index,
|
20306
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
20275
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$7);
|
20307
20276
|
return React__default.createElement("div", Object.assign({
|
20308
20277
|
role: "tabpanel",
|
20309
20278
|
hidden: value !== index,
|
@@ -24360,7 +24329,7 @@ var ChapterProblemSolvingResultsDialog = function ChapterProblemSolvingResultsDi
|
|
24360
24329
|
}, t("cancel"))))));
|
24361
24330
|
};
|
24362
24331
|
|
24363
|
-
var _excluded$
|
24332
|
+
var _excluded$8 = ["onChange"];
|
24364
24333
|
var StartPageDialog = function StartPageDialog(_ref) {
|
24365
24334
|
var t = _ref.t,
|
24366
24335
|
onClose = _ref.onClose,
|
@@ -24426,7 +24395,7 @@ var StartPageDialog = function StartPageDialog(_ref) {
|
|
24426
24395
|
}, t("page_to_start_with")), React__default.createElement(Field, {
|
24427
24396
|
name: "startPage",
|
24428
24397
|
render: function render(_ref3) {
|
24429
|
-
var field = _objectWithoutPropertiesLoose(_ref3, _excluded$
|
24398
|
+
var field = _objectWithoutPropertiesLoose(_ref3, _excluded$8);
|
24430
24399
|
return React__default.createElement(CustomSelectOption, Object.assign({
|
24431
24400
|
maxMenuHeight: 150,
|
24432
24401
|
menuPosition: "fixed",
|
@@ -26058,10 +26027,10 @@ var DrawerTextbookResultTab = function DrawerTextbookResultTab(_ref) {
|
|
26058
26027
|
};
|
26059
26028
|
|
26060
26029
|
var _styled$1;
|
26061
|
-
var _excluded$
|
26030
|
+
var _excluded$9 = ["className"];
|
26062
26031
|
var CustomTooltip$1 = styled(function (_ref) {
|
26063
26032
|
var className = _ref.className,
|
26064
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
26033
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$9);
|
26065
26034
|
return React__default.createElement(Tooltip, Object.assign({}, props, {
|
26066
26035
|
classes: {
|
26067
26036
|
popper: className
|
@@ -27542,7 +27511,7 @@ var useTeacherList = function useTeacherList() {
|
|
27542
27511
|
};
|
27543
27512
|
};
|
27544
27513
|
|
27545
|
-
var _excluded$
|
27514
|
+
var _excluded$a = ["getStudents"],
|
27546
27515
|
_excluded2 = ["getTeachers"],
|
27547
27516
|
_excluded3 = ["getLessons"];
|
27548
27517
|
var PAGE_TITLE$4 = "classes";
|
@@ -27593,7 +27562,7 @@ var useClassDetail = function useClassDetail(_ref) {
|
|
27593
27562
|
};
|
27594
27563
|
var _useStudentClassList = useStudentClassList(classId),
|
27595
27564
|
getStudents = _useStudentClassList.getStudents,
|
27596
|
-
studentListProps = _objectWithoutPropertiesLoose(_useStudentClassList, _excluded$
|
27565
|
+
studentListProps = _objectWithoutPropertiesLoose(_useStudentClassList, _excluded$a);
|
27597
27566
|
var _useTeacherClassList = useTeacherClassList(classId),
|
27598
27567
|
getTeachers = _useTeacherClassList.getTeachers,
|
27599
27568
|
teacherListProps = _objectWithoutPropertiesLoose(_useTeacherClassList, _excluded2);
|
@@ -28981,14 +28950,14 @@ var CSV_PREFIX = "data:text/csv;charset=utf-8,";
|
|
28981
28950
|
|
28982
28951
|
var styles$8 = {"action-btn":"_1jXbz","action-btn--pencil":"_at4xP","icon-rotate-180":"_12gv9","drop-area":"_R4bn5"};
|
28983
28952
|
|
28984
|
-
var _excluded$
|
28953
|
+
var _excluded$b = ["text", "isRequired", "className"];
|
28985
28954
|
var LabelRequired = function LabelRequired(_ref) {
|
28986
28955
|
var text = _ref.text,
|
28987
28956
|
_ref$isRequired = _ref.isRequired,
|
28988
28957
|
isRequired = _ref$isRequired === void 0 ? true : _ref$isRequired,
|
28989
28958
|
_ref$className = _ref.className,
|
28990
28959
|
className = _ref$className === void 0 ? "" : _ref$className,
|
28991
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
28960
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$b);
|
28992
28961
|
return React__default.createElement(FormLabel, Object.assign({
|
28993
28962
|
className: "fw-medium mb-1 " + className
|
28994
28963
|
}, rest), text, isRequired && React__default.createElement("span", {
|
@@ -29042,7 +29011,7 @@ var deleteUserApi = function deleteUserApi(id) {
|
|
29042
29011
|
return api["delete"](USER_URL$1 + "/delete/" + id);
|
29043
29012
|
};
|
29044
29013
|
|
29045
|
-
var _excluded$
|
29014
|
+
var _excluded$c = ["ref"],
|
29046
29015
|
_excluded2$1 = ["ref"],
|
29047
29016
|
_excluded3$1 = ["ref"],
|
29048
29017
|
_excluded4 = ["ref"],
|
@@ -29072,7 +29041,7 @@ var UserDialog = function UserDialog(_ref) {
|
|
29072
29041
|
t = _useTranslation.t;
|
29073
29042
|
var _register = register("fullName"),
|
29074
29043
|
fullNameRef = _register.ref,
|
29075
|
-
fullNameBio = _objectWithoutPropertiesLoose(_register, _excluded$
|
29044
|
+
fullNameBio = _objectWithoutPropertiesLoose(_register, _excluded$c);
|
29076
29045
|
var _register2 = register("email"),
|
29077
29046
|
emailRef = _register2.ref,
|
29078
29047
|
emailBio = _objectWithoutPropertiesLoose(_register2, _excluded2$1);
|
@@ -33143,12 +33112,12 @@ var ArticleDialog = function ArticleDialog(_ref) {
|
|
33143
33112
|
|
33144
33113
|
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"};
|
33145
33114
|
|
33146
|
-
var _excluded$
|
33115
|
+
var _excluded$d = ["isOpen", "onClose", "handleSaveExam"];
|
33147
33116
|
var CreateExamDrawer = function CreateExamDrawer(props) {
|
33148
33117
|
var isOpen = props.isOpen,
|
33149
33118
|
onClose = props.onClose,
|
33150
33119
|
handleSaveExam = props.handleSaveExam,
|
33151
|
-
examDetailViewProps = _objectWithoutPropertiesLoose(props, _excluded$
|
33120
|
+
examDetailViewProps = _objectWithoutPropertiesLoose(props, _excluded$d);
|
33152
33121
|
var _useTranslation = useTranslation(),
|
33153
33122
|
t = _useTranslation.t;
|
33154
33123
|
var theme = useTheme();
|
@@ -33910,11 +33879,11 @@ var TextbookRow = function TextbookRow(_ref) {
|
|
33910
33879
|
});
|
33911
33880
|
var _useTranslation = useTranslation(),
|
33912
33881
|
t = _useTranslation.t;
|
33913
|
-
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) {
|
33882
|
+
var isEditable = (!onAcademy || isAdminSite || isSuperAdmin || isSuperAdminUser || !isAdmin && data.isShared && (((_data$createdBy = data.createdBy) === null || _data$createdBy === void 0 ? void 0 : _data$createdBy.id) === (infoUser === null || infoUser === void 0 ? void 0 : infoUser.id) || ((_data$textbookOwners = data.textbookOwners) === null || _data$textbookOwners === void 0 ? void 0 : _data$textbookOwners.some(function (i) {
|
33914
33883
|
var _infoUser$email, _infoUser$email$trim;
|
33915
33884
|
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);
|
33916
|
-
})));
|
33917
|
-
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);
|
33885
|
+
})))) && data.totalUses <= 0;
|
33886
|
+
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;
|
33918
33887
|
var isSharable = !data.isPublic && data.isShared && onAcademy && (isAdminSite || isSuperAdminUser || !isAdmin && data.createdBy.id === infoUser.id);
|
33919
33888
|
var handleUpdateTextbook = function handleUpdateTextbook() {
|
33920
33889
|
onUpdateTextbook(data);
|
@@ -34301,12 +34270,12 @@ var useNotificationDetail = function useNotificationDetail(_ref) {
|
|
34301
34270
|
|
34302
34271
|
var styles$b = {"avatar":"_8niRT"};
|
34303
34272
|
|
34304
|
-
var _excluded$
|
34273
|
+
var _excluded$e = ["value", "disabled", "optionTypeNotification"];
|
34305
34274
|
var TypeSelector = function TypeSelector(_ref) {
|
34306
34275
|
var value = _ref.value,
|
34307
34276
|
disabled = _ref.disabled,
|
34308
34277
|
optionTypeNotification = _ref.optionTypeNotification,
|
34309
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
34278
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$e);
|
34310
34279
|
return React__default.createElement(CustomAsyncSelect, Object.assign({
|
34311
34280
|
options: optionTypeNotification,
|
34312
34281
|
value: value
|
@@ -34699,11 +34668,11 @@ var useNotificationList = function useNotificationList(_ref) {
|
|
34699
34668
|
};
|
34700
34669
|
};
|
34701
34670
|
|
34702
|
-
var _excluded$
|
34671
|
+
var _excluded$f = ["value", "optionTypeNotification"];
|
34703
34672
|
var SelectFilterType = function SelectFilterType(_ref) {
|
34704
34673
|
var value = _ref.value,
|
34705
34674
|
optionTypeNotification = _ref.optionTypeNotification,
|
34706
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
34675
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$f);
|
34707
34676
|
return React__default.createElement(CustomAsyncSelect, Object.assign({
|
34708
34677
|
options: optionTypeNotification,
|
34709
34678
|
value: value
|
@@ -34935,10 +34904,10 @@ var useTextbookManagement = function useTextbookManagement(_ref) {
|
|
34935
34904
|
var isAdminSite = role === Role.Admin;
|
34936
34905
|
var onAcademy = !!(user !== null && user !== void 0 && user.academyDomain);
|
34937
34906
|
var isSuperAdminUser = !!user && user.isSuperAdmin;
|
34938
|
-
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) {
|
34907
|
+
var isEditable = !selectedTextbook || (!onAcademy || isAdminSite || isSuperAdmin || isSuperAdminUser || !isAdmin && selectedTextbook.isShared && (((_selectedTextbook$cre = selectedTextbook.createdBy) === null || _selectedTextbook$cre === void 0 ? void 0 : _selectedTextbook$cre.id) === (user === null || user === void 0 ? void 0 : user.id) || selectedTextbook.textbookOwners.some(function (i) {
|
34939
34908
|
var _user$email, _user$email$trim;
|
34940
34909
|
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);
|
34941
|
-
}));
|
34910
|
+
}))) && selectedTextbook.totalUses <= 0;
|
34942
34911
|
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);
|
34943
34912
|
var handleOpenConfirmDeleteChapterDialog = function handleOpenConfirmDeleteChapterDialog(chapter) {
|
34944
34913
|
setSelectedChapter(chapter);
|
@@ -35040,24 +35009,6 @@ var useTextbookManagement = function useTextbookManagement(_ref) {
|
|
35040
35009
|
return Promise.reject(e);
|
35041
35010
|
}
|
35042
35011
|
};
|
35043
|
-
var handleSaveData = useCallback(function (values) {
|
35044
|
-
try {
|
35045
|
-
if (!coverImage && !(values !== null && values !== void 0 && values.coverImage)) {
|
35046
|
-
return Promise.resolve();
|
35047
|
-
}
|
35048
|
-
return Promise.resolve(_catch(function () {
|
35049
|
-
var coverImg = coverImage || (values === null || values === void 0 ? void 0 : values.coverImage);
|
35050
|
-
return Promise.resolve(updateTextbookApi$1(_extends({}, values, {
|
35051
|
-
coverImage: coverImg
|
35052
|
-
}), (selectedTextbook === null || selectedTextbook === void 0 ? void 0 : selectedTextbook.id) || 0, isSuperAdmin)).then(function () {});
|
35053
|
-
}, function (error) {
|
35054
|
-
toast.error(getErrorMessage(t, error));
|
35055
|
-
throw error;
|
35056
|
-
}));
|
35057
|
-
} catch (e) {
|
35058
|
-
return Promise.reject(e);
|
35059
|
-
}
|
35060
|
-
}, [coverImage, isSuperAdmin, JSON.stringify(selectedTextbook)]);
|
35061
35012
|
useEffect(function () {
|
35062
35013
|
if (!textbookId) return;
|
35063
35014
|
handleGetTextbookDetail();
|
@@ -35076,7 +35027,6 @@ var useTextbookManagement = function useTextbookManagement(_ref) {
|
|
35076
35027
|
isSuperAdminUser: isSuperAdminUser,
|
35077
35028
|
openDialog: openDialog,
|
35078
35029
|
handleSubmit: handleSubmit,
|
35079
|
-
handleSaveData: handleSaveData,
|
35080
35030
|
selectedTextbook: selectedTextbook,
|
35081
35031
|
handleOpenDialog: handleOpenDialog,
|
35082
35032
|
handleCloseDialog: handleCloseDialog,
|
@@ -35370,8 +35320,6 @@ var CompareTypeOptions = [{
|
|
35370
35320
|
label: "synonym_processing",
|
35371
35321
|
value: QuestionAnswerType.SynonymProcessing
|
35372
35322
|
}];
|
35373
|
-
var SAVE_TIME_INTERVAL_IN_MILLISECONDS = 60 * 1000;
|
35374
|
-
var SAVE_TIME_MAX_DIFF_IN_MILLISECONDS = 500;
|
35375
35323
|
|
35376
35324
|
var CustomTextbookTab = function CustomTextbookTab(props) {
|
35377
35325
|
var children = props.children,
|
@@ -35980,7 +35928,7 @@ var isEqual$1 = function isEqual(prev, next) {
|
|
35980
35928
|
};
|
35981
35929
|
var QuestionShortInput$1 = memo(QuestionShortInput, isEqual$1);
|
35982
35930
|
|
35983
|
-
var _excluded$
|
35931
|
+
var _excluded$g = ["onChange"];
|
35984
35932
|
var _$2 = _$8;
|
35985
35933
|
var BpIcon$1 = styled("span")(function (_ref) {
|
35986
35934
|
var theme = _ref.theme;
|
@@ -36291,7 +36239,7 @@ var QuestionBlock = function QuestionBlock(_ref2) {
|
|
36291
36239
|
name: path + ".questionTypeId",
|
36292
36240
|
render: function render(_ref5) {
|
36293
36241
|
var _ref5$field = _ref5.field,
|
36294
|
-
field = _objectWithoutPropertiesLoose(_ref5$field, _excluded$
|
36242
|
+
field = _objectWithoutPropertiesLoose(_ref5$field, _excluded$g);
|
36295
36243
|
return React__default.createElement(CustomSelectOption, Object.assign({}, field, {
|
36296
36244
|
isDisabled: disabled,
|
36297
36245
|
value: data.questionType,
|
@@ -36340,7 +36288,7 @@ var isEqual$2 = function isEqual(prev, next) {
|
|
36340
36288
|
};
|
36341
36289
|
var QuestionBlock$1 = memo(QuestionBlock, isEqual$2);
|
36342
36290
|
|
36343
|
-
var _excluded$
|
36291
|
+
var _excluded$h = ["data", "path", "isMath", "open", "isLoadingCategories", "isLoadingQuestionTypes", "optionKey", "categories", "questionTypes", "disabled", "onQuestioStartOrderChange", "onDelete", "onOpenSubCategoryMenu", "onOpenCategoryMenu", "onCloseCategoryMenu", "onCloseQuestionTypeMenu", "onOpenQuestionTypeMenu"];
|
36344
36292
|
var _$3 = _$8;
|
36345
36293
|
var QuestionGroupBlockBody = function QuestionGroupBlockBody(_ref) {
|
36346
36294
|
var _data$articles$3, _data$articles$3$cate, _data$articles$4, _data$articles$4$cate, _questions$2;
|
@@ -36361,7 +36309,7 @@ var QuestionGroupBlockBody = function QuestionGroupBlockBody(_ref) {
|
|
36361
36309
|
onCloseCategoryMenu = _ref.onCloseCategoryMenu,
|
36362
36310
|
onCloseQuestionTypeMenu = _ref.onCloseQuestionTypeMenu,
|
36363
36311
|
onOpenQuestionTypeMenu = _ref.onOpenQuestionTypeMenu,
|
36364
|
-
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$
|
36312
|
+
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$h);
|
36365
36313
|
var errors = formikProps.errors;
|
36366
36314
|
var startOrderRef = useRef(null);
|
36367
36315
|
var articles = data.articles,
|
@@ -36504,7 +36452,7 @@ var isEqual$3 = function isEqual(prev, next) {
|
|
36504
36452
|
};
|
36505
36453
|
var QuestionGroupBlockBody$1 = memo(QuestionGroupBlockBody, isEqual$3);
|
36506
36454
|
|
36507
|
-
var _excluded$
|
36455
|
+
var _excluded$i = ["expandedIndex", "open", "paths", "path", "isMath", "data", "categories", "isLoadingCategories", "isLoadingQuestionTypes", "questionTypes", "optionKey", "disabled", "onToggle", "onQuestionCountChange", "onDelete", "onOpenSubCategoryMenu", "onOpenCategoryMenu", "onCloseCategoryMenu", "onCopiedPrevQuestionGroup", "onCloseQuestionTypeMenu", "onOpenQuestionTypeMenu"];
|
36508
36456
|
var _$4 = _$8;
|
36509
36457
|
var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
|
36510
36458
|
var _data$articles$3, _data$articles$3$cate, _data$articles$3$cate2, _data$articles$4, _data$articles$4$cate, _data$articles$4$cate2;
|
@@ -36529,7 +36477,7 @@ var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
|
|
36529
36477
|
onCopiedPrevQuestionGroup = _ref.onCopiedPrevQuestionGroup,
|
36530
36478
|
onCloseQuestionTypeMenu = _ref.onCloseQuestionTypeMenu,
|
36531
36479
|
onOpenQuestionTypeMenu = _ref.onOpenQuestionTypeMenu,
|
36532
|
-
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$
|
36480
|
+
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$i);
|
36533
36481
|
var errors = formikProps.errors,
|
36534
36482
|
setFieldValue = formikProps.setFieldValue;
|
36535
36483
|
var _useTranslation = useTranslation(),
|
@@ -36992,7 +36940,7 @@ var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
|
|
36992
36940
|
}, formikProps)))));
|
36993
36941
|
};
|
36994
36942
|
|
36995
|
-
var _excluded$
|
36943
|
+
var _excluded$j = ["path", "paths", "isMath", "isLoadingCategories", "isLoadingQuestionTypes", "optionKey", "questionGroups", "subChapters", "categories", "questionTypes", "disabled", "onDelete", "onOpenSubCategoryMenu", "onOpenCategoryMenu", "onCloseCategoryMenu", "onCopiedPrevQuestionGroup", "onCloseQuestionTypeMenu", "onOpenQuestionTypeMenu"];
|
36996
36944
|
var ChapterBlockBody = function ChapterBlockBody(_ref) {
|
36997
36945
|
var path = _ref.path,
|
36998
36946
|
paths = _ref.paths,
|
@@ -37012,7 +36960,7 @@ var ChapterBlockBody = function ChapterBlockBody(_ref) {
|
|
37012
36960
|
onCopiedPrevQuestionGroup = _ref.onCopiedPrevQuestionGroup,
|
37013
36961
|
onCloseQuestionTypeMenu = _ref.onCloseQuestionTypeMenu,
|
37014
36962
|
onOpenQuestionTypeMenu = _ref.onOpenQuestionTypeMenu,
|
37015
|
-
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$
|
36963
|
+
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$j);
|
37016
36964
|
var _useTranslation = useTranslation(),
|
37017
36965
|
t = _useTranslation.t;
|
37018
36966
|
var setFieldValue = formikProps.setFieldValue;
|
@@ -37191,7 +37139,7 @@ var ChapterBlockBody = function ChapterBlockBody(_ref) {
|
|
37191
37139
|
}));
|
37192
37140
|
};
|
37193
37141
|
|
37194
|
-
var _excluded$
|
37142
|
+
var _excluded$k = ["data", "expandedIndex", "open", "path", "paths", "isMath", "isLoadingCategories", "isLoadingQuestionTypes", "categories", "questionTypes", "optionKey", "disabled", "onToggle", "onDelete", "onCopiedPrevQuestionGroup", "onCloseCategoryMenu", "onOpenCategoryMenu", "onOpenSubCategoryMenu", "onOpenQuestionTypeMenu", "onCloseQuestionTypeMenu"];
|
37195
37143
|
var _$5 = _$8;
|
37196
37144
|
var ChapterBlock = function ChapterBlock(_ref) {
|
37197
37145
|
var data = _ref.data,
|
@@ -37214,7 +37162,7 @@ var ChapterBlock = function ChapterBlock(_ref) {
|
|
37214
37162
|
onOpenSubCategoryMenu = _ref.onOpenSubCategoryMenu,
|
37215
37163
|
onOpenQuestionTypeMenu = _ref.onOpenQuestionTypeMenu,
|
37216
37164
|
onCloseQuestionTypeMenu = _ref.onCloseQuestionTypeMenu,
|
37217
|
-
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$
|
37165
|
+
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$k);
|
37218
37166
|
var errors = formikProps.errors;
|
37219
37167
|
var _useTranslation = useTranslation(),
|
37220
37168
|
t = _useTranslation.t;
|
@@ -37905,7 +37853,7 @@ var TextbookContentsTab = function TextbookContentsTab(props) {
|
|
37905
37853
|
}));
|
37906
37854
|
};
|
37907
37855
|
|
37908
|
-
var _excluded$
|
37856
|
+
var _excluded$l = ["value"];
|
37909
37857
|
var VisuallyHiddenInput = styled("input")({
|
37910
37858
|
clip: "rect(0 0 0 0)",
|
37911
37859
|
clipPath: "inset(50%)",
|
@@ -38073,7 +38021,7 @@ var TextbookInfoTab = function TextbookInfoTab(_ref) {
|
|
38073
38021
|
render: function render(_ref4) {
|
38074
38022
|
var _ref4$field = _ref4.field,
|
38075
38023
|
value = _ref4$field.value,
|
38076
|
-
action = _objectWithoutPropertiesLoose(_ref4$field, _excluded$
|
38024
|
+
action = _objectWithoutPropertiesLoose(_ref4$field, _excluded$l);
|
38077
38025
|
return React__default.createElement(LocalizationProvider$1, {
|
38078
38026
|
dateAdapter: AdapterMoment
|
38079
38027
|
}, React__default.createElement(DatePicker$1, Object.assign({}, action, {
|
@@ -38547,7 +38495,7 @@ var TextbookOwnersTab = function TextbookOwnersTab(_ref) {
|
|
38547
38495
|
}));
|
38548
38496
|
};
|
38549
38497
|
|
38550
|
-
var _excluded$
|
38498
|
+
var _excluded$m = ["isCreatedByAdmin", "isSuperAdminUser", "isSuperAdmin", "isAdmin", "textbookId", "selected", "coverImage", "disabled", "ownersDisabled", "onChangeTab", "onUploadImage"];
|
38551
38499
|
var PreparedTextbookForm = function PreparedTextbookForm(_ref) {
|
38552
38500
|
var isCreatedByAdmin = _ref.isCreatedByAdmin,
|
38553
38501
|
isSuperAdminUser = _ref.isSuperAdminUser,
|
@@ -38558,33 +38506,14 @@ var PreparedTextbookForm = function PreparedTextbookForm(_ref) {
|
|
38558
38506
|
coverImage = _ref.coverImage,
|
38559
38507
|
disabled = _ref.disabled,
|
38560
38508
|
ownersDisabled = _ref.ownersDisabled,
|
38561
|
-
selectedTextbook = _ref.selectedTextbook,
|
38562
|
-
handleSaveData = _ref.handleSaveData,
|
38563
38509
|
onChangeTab = _ref.onChangeTab,
|
38564
38510
|
onUploadImage = _ref.onUploadImage,
|
38565
|
-
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$
|
38511
|
+
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$m);
|
38566
38512
|
var values = formikProps.values,
|
38567
38513
|
errors = formikProps.errors,
|
38568
38514
|
dirty = formikProps.dirty,
|
38569
38515
|
submitCount = formikProps.submitCount,
|
38570
38516
|
setValues = formikProps.setValues;
|
38571
|
-
var theme = useTheme();
|
38572
|
-
var savedRunRef = useRef(Date.now());
|
38573
|
-
var runTimeRef = useRef(Date.now());
|
38574
|
-
var valuesTextbook = useRef(null);
|
38575
|
-
var isFirstLoad = true;
|
38576
|
-
var _React$useState = React__default.useState(PrintStatus.Idle),
|
38577
|
-
saveStatus = _React$useState[0],
|
38578
|
-
setSaveStatus = _React$useState[1];
|
38579
|
-
var timeoutRef = useRef(null);
|
38580
|
-
var isProcessingRef = useRef(false);
|
38581
|
-
var pendingValuesRef = useRef(null);
|
38582
|
-
var _useState = useState(),
|
38583
|
-
saved = _useState[0],
|
38584
|
-
setSaved = _useState[1];
|
38585
|
-
var _useState2 = useState(),
|
38586
|
-
lastEdited = _useState2[0],
|
38587
|
-
setLastEdited = _useState2[1];
|
38588
38517
|
useEffect(function () {
|
38589
38518
|
var handleBeforeUnload = function handleBeforeUnload(event) {
|
38590
38519
|
var message = t$1("are_you_sure_you_want_to_quit_yours_changes_may_not_be_saved");
|
@@ -38605,100 +38534,9 @@ var PreparedTextbookForm = function PreparedTextbookForm(_ref) {
|
|
38605
38534
|
var newValues = _resetAllCategoriesAndQuestionTypesBySubject(values, val);
|
38606
38535
|
setValues(newValues);
|
38607
38536
|
};
|
38608
|
-
useEffect(function () {
|
38609
|
-
if (!valuesTextbook.current && isFirstLoad && !_$8.isEqual(values, DEFAULT_TEXTBOOK_REQUEST)) {
|
38610
|
-
valuesTextbook.current = _$8.cloneDeep(values);
|
38611
|
-
isFirstLoad = false;
|
38612
|
-
}
|
38613
|
-
}, [values]);
|
38614
|
-
var _handleSave = function handleSave(valuesProps) {
|
38615
|
-
try {
|
38616
|
-
var _temp = _finallyRethrows(function () {
|
38617
|
-
return _catch(function () {
|
38618
|
-
isProcessingRef.current = true;
|
38619
|
-
setSaveStatus(PrintStatus.Saving);
|
38620
|
-
var valuesToSave = valuesProps || values;
|
38621
|
-
return Promise.resolve(handleSaveData(valuesToSave)).then(function () {
|
38622
|
-
valuesTextbook.current = _$8.cloneDeep(valuesToSave);
|
38623
|
-
var now = Date.now();
|
38624
|
-
savedRunRef.current = now;
|
38625
|
-
runTimeRef.current = now;
|
38626
|
-
setSaveStatus(PrintStatus.Saved);
|
38627
|
-
setSaved(valuesToSave);
|
38628
|
-
});
|
38629
|
-
}, function (error) {
|
38630
|
-
setSaveStatus(PrintStatus.Idle);
|
38631
|
-
console.error(error);
|
38632
|
-
});
|
38633
|
-
}, function (_wasThrown, _result) {
|
38634
|
-
isProcessingRef.current = false;
|
38635
|
-
if (pendingValuesRef.current) {
|
38636
|
-
if (timeoutRef.current) {
|
38637
|
-
clearTimeout(timeoutRef.current);
|
38638
|
-
}
|
38639
|
-
timeoutRef.current = setTimeout(function () {
|
38640
|
-
timeoutRef.current = null;
|
38641
|
-
var pendingValues = pendingValuesRef.current;
|
38642
|
-
if (pendingValues) {
|
38643
|
-
_handleSave(pendingValues);
|
38644
|
-
pendingValuesRef.current = null;
|
38645
|
-
}
|
38646
|
-
}, SAVE_TIME_INTERVAL_IN_MILLISECONDS);
|
38647
|
-
}
|
38648
|
-
if (_wasThrown) throw _result;
|
38649
|
-
return _result;
|
38650
|
-
});
|
38651
|
-
return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
|
38652
|
-
} catch (e) {
|
38653
|
-
return Promise.reject(e);
|
38654
|
-
}
|
38655
|
-
};
|
38656
|
-
useEffect(function () {
|
38657
|
-
var now = Date.now();
|
38658
|
-
if (valuesTextbook.current && !_$8.isEqual(values, valuesTextbook.current)) setLastEdited(now);
|
38659
|
-
if (!_$8.isEmpty(errors) || !valuesTextbook.current || !(selectedTextbook !== null && selectedTextbook !== void 0 && selectedTextbook.id)) return;
|
38660
|
-
if (valuesTextbook.current && _$8.isEqual(values, valuesTextbook.current)) return;
|
38661
|
-
if (isProcessingRef.current) {
|
38662
|
-
pendingValuesRef.current = _$8.cloneDeep(values);
|
38663
|
-
return;
|
38664
|
-
}
|
38665
|
-
var timeSinceLastRun = now - runTimeRef.current;
|
38666
|
-
var maxTime = SAVE_TIME_INTERVAL_IN_MILLISECONDS + SAVE_TIME_MAX_DIFF_IN_MILLISECONDS;
|
38667
|
-
if (timeSinceLastRun > maxTime) {
|
38668
|
-
runTimeRef.current = now;
|
38669
|
-
timeSinceLastRun = 0;
|
38670
|
-
}
|
38671
|
-
if (timeSinceLastRun >= SAVE_TIME_INTERVAL_IN_MILLISECONDS) {
|
38672
|
-
if (timeoutRef.current) {
|
38673
|
-
clearTimeout(timeoutRef.current);
|
38674
|
-
timeoutRef.current = null;
|
38675
|
-
pendingValuesRef.current = null;
|
38676
|
-
}
|
38677
|
-
_handleSave();
|
38678
|
-
} else {
|
38679
|
-
pendingValuesRef.current = _$8.cloneDeep(values);
|
38680
|
-
var intevalTime = SAVE_TIME_INTERVAL_IN_MILLISECONDS - timeSinceLastRun;
|
38681
|
-
timeoutRef.current = setTimeout(function () {
|
38682
|
-
timeoutRef.current = null;
|
38683
|
-
var pendingValues = pendingValuesRef.current;
|
38684
|
-
if (pendingValues) {
|
38685
|
-
clearTimeout(timeoutRef.current);
|
38686
|
-
_handleSave(pendingValues);
|
38687
|
-
pendingValuesRef.current = null;
|
38688
|
-
}
|
38689
|
-
}, intevalTime);
|
38690
|
-
}
|
38691
|
-
return function () {
|
38692
|
-
if (timeoutRef.current) {
|
38693
|
-
clearTimeout(timeoutRef.current);
|
38694
|
-
}
|
38695
|
-
};
|
38696
|
-
}, [values, errors]);
|
38697
38537
|
var inforErrors = errors.coverImage || errors.grade || errors.isbn || errors.preparedType || errors.publicationDate || errors.publisher;
|
38698
38538
|
var contentsErrors = errors.chapters;
|
38699
38539
|
var textbookOwnersErrors = errors.textbookOwners;
|
38700
|
-
var hasError = !_$8.isEmpty(errors);
|
38701
|
-
var isSaved = !lastEdited || _$8.isEqual(values, saved != null ? saved : {});
|
38702
38540
|
return React__default.createElement(Form, null, React__default.createElement(Stack, {
|
38703
38541
|
direction: "column",
|
38704
38542
|
gap: 3
|
@@ -38786,45 +38624,7 @@ var PreparedTextbookForm = function PreparedTextbookForm(_ref) {
|
|
38786
38624
|
}), React__default.createElement(FormLabel, {
|
38787
38625
|
htmlFor: "type",
|
38788
38626
|
className: "text-center"
|
38789
|
-
}, t$1("math"))))), React__default.createElement(
|
38790
|
-
flexDirection: "row",
|
38791
|
-
gap: "8px"
|
38792
|
-
}, React__default.createElement(Stack, {
|
38793
|
-
padding: "6px 12px",
|
38794
|
-
sx: {
|
38795
|
-
transition: "opacity 0.3s ease",
|
38796
|
-
opacity: saveStatus === PrintStatus.Idle && isSaved ? 0 : 1,
|
38797
|
-
pointerEvents: "none",
|
38798
|
-
gap: "8px",
|
38799
|
-
flexDirection: "row",
|
38800
|
-
justifyContent: "center",
|
38801
|
-
alignItems: "center"
|
38802
|
-
}
|
38803
|
-
}, saveStatus === PrintStatus.Saving && React__default.createElement(AiOutlineLoading3Quarters, {
|
38804
|
-
style: {
|
38805
|
-
animation: "spin 1s linear infinite"
|
38806
|
-
}
|
38807
|
-
}), saveStatus === PrintStatus.Saved && isSaved && React__default.createElement(IoCheckmark, null), saveStatus !== PrintStatus.Saving && !isSaved && React__default.createElement(Fragment$1, null, hasError ? React__default.createElement(MdError, {
|
38808
|
-
color: red[900]
|
38809
|
-
}) : React__default.createElement(FaClockRotateLeft, {
|
38810
|
-
size: "14px"
|
38811
|
-
})), React__default.createElement(Typography, {
|
38812
|
-
sx: {
|
38813
|
-
color: theme.palette.grey[700],
|
38814
|
-
fontSize: "14px",
|
38815
|
-
display: "flex",
|
38816
|
-
alignItems: "center",
|
38817
|
-
gap: 1,
|
38818
|
-
"@keyframes spin": {
|
38819
|
-
"0%": {
|
38820
|
-
transform: "rotate(0deg)"
|
38821
|
-
},
|
38822
|
-
"100%": {
|
38823
|
-
transform: "rotate(360deg)"
|
38824
|
-
}
|
38825
|
-
}
|
38826
|
-
}
|
38827
|
-
}, saveStatus === PrintStatus.Saving && t$1("saving"), saveStatus === PrintStatus.Saved && isSaved && t$1("all_changes_saved"), saveStatus !== PrintStatus.Saving && (selectedTextbook === null || selectedTextbook === void 0 ? void 0 : selectedTextbook.id) && !isSaved && t$1("all_changes_are_not_saved_yet"))), React__default.createElement(Button, {
|
38627
|
+
}, t$1("math"))))), React__default.createElement(Box, null, React__default.createElement(Button, {
|
38828
38628
|
type: "submit",
|
38829
38629
|
sx: {
|
38830
38630
|
width: "fit-content"
|
@@ -38931,7 +38731,6 @@ var PreparedTextbookView = function PreparedTextbookView(_ref) {
|
|
38931
38731
|
isSuperAdminUser = _useTextbookManagemen.isSuperAdminUser,
|
38932
38732
|
isAdmin = _useTextbookManagemen.isAdmin,
|
38933
38733
|
coverImage = _useTextbookManagemen.coverImage,
|
38934
|
-
handleSaveData = _useTextbookManagemen.handleSaveData,
|
38935
38734
|
selectedTextbook = _useTextbookManagemen.selectedTextbook,
|
38936
38735
|
handleSubmit = _useTextbookManagemen.handleSubmit,
|
38937
38736
|
handleUploadImage = _useTextbookManagemen.handleUploadImage;
|
@@ -38954,9 +38753,7 @@ var PreparedTextbookView = function PreparedTextbookView(_ref) {
|
|
38954
38753
|
isAdmin: isAdmin,
|
38955
38754
|
isSuperAdmin: isSuperAdmin,
|
38956
38755
|
selected: selected,
|
38957
|
-
handleSaveData: handleSaveData,
|
38958
38756
|
textbookId: textbookId,
|
38959
|
-
selectedTextbook: selectedTextbook,
|
38960
38757
|
onChangeTab: handleChangeTab,
|
38961
38758
|
onUploadImage: handleUploadImage,
|
38962
38759
|
coverImage: coverImage,
|