touchstudy-core 0.1.144 → 0.1.145
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/components/List/configs/interfaces.d.ts +1 -1
- package/dist/components/List/partials/VirtualListItem.d.ts +1 -1
- package/dist/components/Selects/CustomSelect.d.ts +1 -1
- package/dist/components/Tables/VirtualTableRowItem.d.ts +5 -6
- package/dist/components/Tables/VirtualTableView.d.ts +1 -1
- package/dist/components/Tables/configs/interfaces.d.ts +4 -11
- package/dist/containers/Notes/components/NoteItem.d.ts +0 -1
- package/dist/containers/PreparedTextbook/apiClients/textbookService.d.ts +1 -1
- package/dist/containers/PreparedTextbook/components/AcademySelector.d.ts +1 -1
- package/dist/containers/PreparedTextbook/components/ArticleBlock.d.ts +0 -1
- package/dist/containers/PreparedTextbook/components/ChapterBlock.d.ts +0 -1
- package/dist/containers/PreparedTextbook/components/ChapterBlockBody.d.ts +0 -1
- package/dist/containers/PreparedTextbook/components/CourseSelector.d.ts +1 -1
- package/dist/containers/PreparedTextbook/components/OwnerSelector.d.ts +2 -3
- package/dist/containers/PreparedTextbook/components/PreparedTextbookForm.d.ts +0 -5
- package/dist/containers/PreparedTextbook/components/QuestionBlock.d.ts +1 -1
- package/dist/containers/PreparedTextbook/components/QuestionGroupBlock.d.ts +1 -1
- package/dist/containers/PreparedTextbook/components/QuestionGroupBlockBody.d.ts +0 -1
- package/dist/containers/PreparedTextbook/components/TextbookContentsTab.d.ts +0 -1
- package/dist/containers/PreparedTextbook/components/TextbookInfoTab.d.ts +1 -3
- package/dist/containers/PreparedTextbook/components/TextbookOwnersTab.d.ts +1 -2
- package/dist/containers/PreparedTextbook/configs/constants.d.ts +0 -2
- package/dist/containers/PreparedTextbook/configs/enums.d.ts +0 -5
- package/dist/containers/PreparedTextbook/configs/functions.d.ts +3 -17
- package/dist/containers/PreparedTextbook/configs/interfaces.d.ts +0 -2
- package/dist/containers/PreparedTextbook/configs/types.d.ts +3 -5
- package/dist/containers/PreparedTextbook/hooks/useSelect.d.ts +10 -8
- package/dist/containers/PreparedTextbook/hooks/useTextbookManagement.d.ts +1 -8
- package/dist/containers/Textbooks/configs/types.d.ts +0 -2
- package/dist/containers/Textbooks/hooks/useTextbookList.d.ts +2 -5
- package/dist/containers/Textbooks/hooks/useTextbookShare.d.ts +2 -0
- package/dist/index.css +3 -3
- package/dist/index.js +749 -1342
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +761 -1345
- package/dist/index.modern.js.map +1 -1
- package/dist/utils/constants.d.ts +10 -2
- package/dist/utils/index.d.ts +0 -1
- package/package.json +2 -2
package/dist/index.modern.js
CHANGED
@@ -12,11 +12,11 @@ import { AdapterMoment } from '@mui/x-date-pickers/AdapterMoment';
|
|
12
12
|
export { AdapterMoment } from '@mui/x-date-pickers/AdapterMoment';
|
13
13
|
import { DemoContainer } from '@mui/x-date-pickers/internals/demo';
|
14
14
|
export { DemoContainer } from '@mui/x-date-pickers/internals/demo';
|
15
|
-
import React__default, { useState, useEffect, Fragment as Fragment$1, useRef, useCallback, useMemo,
|
16
|
-
import { useTheme, Container, Typography, Stack, List, ListItem, FormGroup, FormControlLabel, Checkbox, Button, Box, Dialog, DialogTitle, IconButton, DialogContent, TextField, DialogActions, styled, FormLabel, Pagination, Paper, InputBase, Tooltip, tooltipClasses, Grid, ClickAwayListener, useMediaQuery, CircularProgress, InputAdornment, Card as Card$1, Avatar, Table, TableHead, TableRow, TableCell, TableBody, TableContainer, RadioGroup, Radio, FormControl, InputLabel, Chip, Accordion, AccordionSummary, AccordionDetails, Switch, Tabs, Tab, Divider, CardMedia as CardMedia$1, MenuList } from '@mui/material';
|
15
|
+
import React__default, { useState, useEffect, Fragment as Fragment$1, useRef, useCallback, useMemo, createElement, memo } from 'react';
|
16
|
+
import { useTheme, Container, Typography, Stack, List, ListItem, FormGroup, FormControlLabel, Checkbox, Button, Box, Dialog, DialogTitle, IconButton, DialogContent, TextField, DialogActions, styled, FormLabel, Pagination, Paper, InputBase, Tooltip, tooltipClasses, Grid, ClickAwayListener, useMediaQuery, CircularProgress, InputAdornment, Card as Card$1, Avatar, Table, TableHead, TableRow, TableCell, TableBody, TableContainer, RadioGroup, Radio, FormControl, InputLabel, Chip, Accordion, AccordionSummary, AccordionDetails, Select as Select$1, MenuItem, Switch, Tabs, Tab, Divider, CardMedia as CardMedia$1, MenuList } from '@mui/material';
|
17
17
|
import moment from 'moment';
|
18
18
|
export { default as moment } from 'moment';
|
19
|
-
import { FaSave, FaCaretDown, FaTimes, FaTrash, FaSortUp, FaSortDown, FaPlus, FaPlusCircle, FaUpload, FaEye as FaEye$1, FaPencilAlt,
|
19
|
+
import { FaSave, FaCaretDown, FaTimes, FaTrash, FaSortUp, FaSortDown, FaPlus, FaPlusCircle, FaUpload, FaEye as FaEye$1, FaPencilAlt, FaShare, FaExchangeAlt, FaBookOpen } from 'react-icons/fa';
|
20
20
|
import { IoMdArrowBack, IoIosAdd, IoMdAdd, IoIosAlert, IoIosArrowDown, IoIosSearch, IoIosArrowUp } from 'react-icons/io';
|
21
21
|
import { IoClose, IoSearch, IoCloseOutline, IoChevronUp, IoChevronDown, IoChatbubbleEllipsesSharp, IoPrint, IoWarning, IoCheckmarkCircle, IoChevronUpOutline, IoChevronDownOutline, IoReceiptSharp, IoBook, IoCalendarClear, IoPerson, IoInformationCircle, IoTrash, IoAddCircle, IoCloseCircle, IoLogOut } from 'react-icons/io5';
|
22
22
|
import { useSelector, useDispatch } from 'react-redux';
|
@@ -27,10 +27,8 @@ import _$5 from 'lodash';
|
|
27
27
|
import { useGoogleLogout, GoogleLogin } from '@leecheuk/react-google-login';
|
28
28
|
import 'moment/locale/ko.js';
|
29
29
|
import 'moment/locale/en-au.js';
|
30
|
-
import { CellMeasurerCache, CellMeasurer, AutoSizer, List as List$1, MultiGrid } from 'react-virtualized';
|
31
|
-
export { CellMeasurerCache, MultiGrid } from 'react-virtualized';
|
32
30
|
import { Formik, Form, Field, FieldArray } from 'formik';
|
33
|
-
import {
|
31
|
+
import { AutoSizer } from 'react-virtualized';
|
34
32
|
import tinymce from 'tinymce';
|
35
33
|
import '@wiris/mathtype-tinymce6';
|
36
34
|
import { Editor } from '@tinymce/tinymce-react';
|
@@ -42,7 +40,7 @@ import CardContent from '@mui/material/CardContent';
|
|
42
40
|
import CardMedia from '@mui/material/CardMedia';
|
43
41
|
import MButton from '@mui/material/Button';
|
44
42
|
import { object, string, number, date as date$2, array } from 'yup';
|
45
|
-
import { blue
|
43
|
+
import { blue } from '@mui/material/colors';
|
46
44
|
import { GoogleReCaptcha, GoogleReCaptchaProvider } from 'react-google-recaptcha-v3';
|
47
45
|
import { MdVisibilityOff, MdVisibility, MdAutorenew, MdMoreHoriz, MdDownload, MdExpandMore } from 'react-icons/md';
|
48
46
|
import { gapi } from 'gapi-script';
|
@@ -70,10 +68,11 @@ import { useForm } from 'react-hook-form';
|
|
70
68
|
import { yupResolver } from '@hookform/resolvers/yup';
|
71
69
|
import { PiDotsNineLight } from 'react-icons/pi';
|
72
70
|
import Container$1 from '@mui/material/Container';
|
71
|
+
import { alpha } from '@mui/material/styles';
|
73
72
|
import Slider from 'react-slick';
|
74
73
|
import { GrNext, GrPrevious } from 'react-icons/gr';
|
75
74
|
import Popover from '@mui/material/Popover';
|
76
|
-
import MenuItem from '@mui/material/MenuItem';
|
75
|
+
import MenuItem$1 from '@mui/material/MenuItem';
|
77
76
|
import { GoArrowSwitch } from 'react-icons/go';
|
78
77
|
import Pusher$1 from 'pusher-js';
|
79
78
|
|
@@ -825,7 +824,7 @@ var delete_users_csv = "사용자 CSV 삭제";
|
|
825
824
|
var are_you_sure_to_delete_users = "사용자를 삭제하시겠습니까?";
|
826
825
|
var enter_phone_number = "전화번호를 입력하세요";
|
827
826
|
var enter_school_name = "학교 이름을 입력하세요";
|
828
|
-
var enter_grade = "성적 입력";
|
827
|
+
var enter_grade = "성적 입력 (먼저 학교 이름을 입력하세요)";
|
829
828
|
var enter_major_name = "부서명을 입력하세요";
|
830
829
|
var enter_parent_name = "부모 이름을 입력하세요";
|
831
830
|
var enter_parent_phone_number = "부모 전화번호를 입력하세요";
|
@@ -1247,7 +1246,7 @@ var number_of_participants = "참가자 수";
|
|
1247
1246
|
var chapter = "챕터";
|
1248
1247
|
var published = "Published";
|
1249
1248
|
var privated = "Privated";
|
1250
|
-
var solution_results = "
|
1249
|
+
var solution_results = "버튼 텍스트";
|
1251
1250
|
var do_you_want_to_reset_your_search_criteria = "검색 조건을 초기화 하시겠습니까?";
|
1252
1251
|
var the_search_keywords_you_enter_will_be_saved = "입력한 검색 키워드는 저장됩니다.";
|
1253
1252
|
var no_search_results = "검색 결과가 없어요.";
|
@@ -1427,44 +1426,18 @@ var current_correct_answer_entered = "현재 입력한 정답";
|
|
1427
1426
|
var correct_answer_is_required = "정답은 필수입니다.";
|
1428
1427
|
var cancel_2 = "취소하기";
|
1429
1428
|
var article_required = "기사가 필요합니다";
|
1430
|
-
var elementary_school_1st_grade = "
|
1431
|
-
var elementary_school_2nd_grade = "
|
1432
|
-
var elementary_school_3rd_grade = "
|
1433
|
-
var elementary_school_4th_grade = "
|
1434
|
-
var elementary_school_5th_grade = "
|
1435
|
-
var elementary_school_6th_grade = "
|
1436
|
-
var middle_school_1st_grade = "
|
1437
|
-
var middle_school_2nd_grade = "
|
1438
|
-
var middle_school_3rd_grade = "
|
1439
|
-
var high_school_1st_grade = "
|
1440
|
-
var high_school_2nd_grade = "
|
1441
|
-
var high_school_3rd_grade = "
|
1442
|
-
var n_year_retaker = "N수생";
|
1443
|
-
var es_1st = "초1";
|
1444
|
-
var es_2nd = "초2";
|
1445
|
-
var es_3rd = "초3";
|
1446
|
-
var es_4th = "초4";
|
1447
|
-
var es_5th = "초5";
|
1448
|
-
var es_6th = "초6";
|
1449
|
-
var ms_1st = "중1";
|
1450
|
-
var ms_2nd = "중2";
|
1451
|
-
var ms_3rd = "중3";
|
1452
|
-
var hs_1st = "고1";
|
1453
|
-
var hs_2nd = "고2";
|
1454
|
-
var hs_3rd = "고3";
|
1455
|
-
var n_retaker = "N수생";
|
1456
|
-
var today_class = "오늘 수업";
|
1457
|
-
var unit_number = "대단원 {{number}}";
|
1458
|
-
var sub_unit_number = "소단원 {{number}}";
|
1459
|
-
var text_group_n = "지문 그룹 {{n}}";
|
1460
|
-
var text_detail_n = "지문 상세 {{n}}";
|
1461
|
-
var question_group_n = "문제 그룹 {{n}}";
|
1462
|
-
var placeholder_teacher_selector = "선생님을 검색하려면 최소 2글자를 입력하세요.";
|
1463
|
-
var teacher_personal_textbook = "교사의 개인 교과서";
|
1464
|
-
var textbook_owner_email_is_required = "교재 소유자의 이메일은 필수입니다";
|
1465
|
-
var invalid_textbook_owner_email_address = "유효하지 않은 교재 소유자 이메일 주소입니다";
|
1466
|
-
var textbook_owner_academy_is_required = "교재 소유자의 학원은 필수입니다";
|
1467
|
-
var textbook_owner_course_is_required = "교재 소유자의 수업은 필수입니다";
|
1429
|
+
var elementary_school_1st_grade = "초등학교 1학년";
|
1430
|
+
var elementary_school_2nd_grade = "초등학교 2학년";
|
1431
|
+
var elementary_school_3rd_grade = "초등학교 3학년";
|
1432
|
+
var elementary_school_4th_grade = "초등학교 4학년";
|
1433
|
+
var elementary_school_5th_grade = "초등학교 5학년";
|
1434
|
+
var elementary_school_6th_grade = "초등학교 6학년";
|
1435
|
+
var middle_school_1st_grade = "중학교 1학년";
|
1436
|
+
var middle_school_2nd_grade = "중학교 2학년";
|
1437
|
+
var middle_school_3rd_grade = "중학교 3학년";
|
1438
|
+
var high_school_1st_grade = "고등학교 1학년";
|
1439
|
+
var high_school_2nd_grade = "고등학교 2학년";
|
1440
|
+
var high_school_3rd_grade = "고등학교 3학년";
|
1468
1441
|
var lang_ko = {
|
1469
1442
|
problem_solving: problem_solving,
|
1470
1443
|
my_story: my_story,
|
@@ -2537,33 +2510,7 @@ var lang_ko = {
|
|
2537
2510
|
middle_school_3rd_grade: middle_school_3rd_grade,
|
2538
2511
|
high_school_1st_grade: high_school_1st_grade,
|
2539
2512
|
high_school_2nd_grade: high_school_2nd_grade,
|
2540
|
-
high_school_3rd_grade: high_school_3rd_grade
|
2541
|
-
n_year_retaker: n_year_retaker,
|
2542
|
-
es_1st: es_1st,
|
2543
|
-
es_2nd: es_2nd,
|
2544
|
-
es_3rd: es_3rd,
|
2545
|
-
es_4th: es_4th,
|
2546
|
-
es_5th: es_5th,
|
2547
|
-
es_6th: es_6th,
|
2548
|
-
ms_1st: ms_1st,
|
2549
|
-
ms_2nd: ms_2nd,
|
2550
|
-
ms_3rd: ms_3rd,
|
2551
|
-
hs_1st: hs_1st,
|
2552
|
-
hs_2nd: hs_2nd,
|
2553
|
-
hs_3rd: hs_3rd,
|
2554
|
-
n_retaker: n_retaker,
|
2555
|
-
today_class: today_class,
|
2556
|
-
unit_number: unit_number,
|
2557
|
-
sub_unit_number: sub_unit_number,
|
2558
|
-
text_group_n: text_group_n,
|
2559
|
-
text_detail_n: text_detail_n,
|
2560
|
-
question_group_n: question_group_n,
|
2561
|
-
placeholder_teacher_selector: placeholder_teacher_selector,
|
2562
|
-
teacher_personal_textbook: teacher_personal_textbook,
|
2563
|
-
textbook_owner_email_is_required: textbook_owner_email_is_required,
|
2564
|
-
invalid_textbook_owner_email_address: invalid_textbook_owner_email_address,
|
2565
|
-
textbook_owner_academy_is_required: textbook_owner_academy_is_required,
|
2566
|
-
textbook_owner_course_is_required: textbook_owner_course_is_required
|
2513
|
+
high_school_3rd_grade: high_school_3rd_grade
|
2567
2514
|
};
|
2568
2515
|
|
2569
2516
|
var problem_solving$1 = "Problem Solving";
|
@@ -3067,7 +3014,7 @@ var delete_users_csv$1 = "Delete users csv";
|
|
3067
3014
|
var are_you_sure_to_delete_users$1 = "Are you sure to delete users?";
|
3068
3015
|
var enter_phone_number$1 = "Enter phone number";
|
3069
3016
|
var enter_school_name$1 = "Enter school name";
|
3070
|
-
var enter_grade$1 = "Enter grade";
|
3017
|
+
var enter_grade$1 = "Enter grade (please enter school name first)";
|
3071
3018
|
var enter_major_name$1 = "Enter department name";
|
3072
3019
|
var enter_parent_name$1 = "Enter parent name";
|
3073
3020
|
var enter_parent_phone_number$1 = "Enter parent phone number";
|
@@ -3659,32 +3606,6 @@ var middle_school_3rd_grade$1 = "Middle school 3rd grade";
|
|
3659
3606
|
var high_school_1st_grade$1 = "High school 1st grade";
|
3660
3607
|
var high_school_2nd_grade$1 = "High school 2nd grade";
|
3661
3608
|
var high_school_3rd_grade$1 = "High school 3rd grade";
|
3662
|
-
var n_year_retaker$1 = "N-year retaker";
|
3663
|
-
var es_1st$1 = "1st ES";
|
3664
|
-
var es_2nd$1 = "2nd ES";
|
3665
|
-
var es_3rd$1 = "3rd ES";
|
3666
|
-
var es_4th$1 = "4th ES";
|
3667
|
-
var es_5th$1 = "5th ES";
|
3668
|
-
var es_6th$1 = "6th ES";
|
3669
|
-
var ms_1st$1 = "1st MS";
|
3670
|
-
var ms_2nd$1 = "2nd MS";
|
3671
|
-
var ms_3rd$1 = "3rd MS";
|
3672
|
-
var hs_1st$1 = "1st HS";
|
3673
|
-
var hs_2nd$1 = "2nd HS";
|
3674
|
-
var hs_3rd$1 = "3rd HS";
|
3675
|
-
var n_retaker$1 = "N-retaker";
|
3676
|
-
var today_class$1 = "Today's class";
|
3677
|
-
var unit_number$1 = "Unit {{number}}";
|
3678
|
-
var sub_unit_number$1 = "Sub-unit {{number}}";
|
3679
|
-
var text_group_n$1 = "Text group {{n}}";
|
3680
|
-
var text_detail_n$1 = "Text details {{n}}";
|
3681
|
-
var question_group_n$1 = "Question group {{n}}";
|
3682
|
-
var placeholder_teacher_selector$1 = "Type at least 2 characters to search teacher";
|
3683
|
-
var teacher_personal_textbook$1 = "Teacher personal textbook";
|
3684
|
-
var textbook_owner_email_is_required$1 = "Textbook owner email is required";
|
3685
|
-
var invalid_textbook_owner_email_address$1 = "Invalid textbook owner email address";
|
3686
|
-
var textbook_owner_academy_is_required$1 = "Textbook owner academy is required";
|
3687
|
-
var textbook_owner_course_is_required$1 = "Textbook owner class is required";
|
3688
3609
|
var lang_en = {
|
3689
3610
|
problem_solving: problem_solving$1,
|
3690
3611
|
my_story: my_story$1,
|
@@ -4759,33 +4680,7 @@ var lang_en = {
|
|
4759
4680
|
middle_school_3rd_grade: middle_school_3rd_grade$1,
|
4760
4681
|
high_school_1st_grade: high_school_1st_grade$1,
|
4761
4682
|
high_school_2nd_grade: high_school_2nd_grade$1,
|
4762
|
-
high_school_3rd_grade: high_school_3rd_grade$1
|
4763
|
-
n_year_retaker: n_year_retaker$1,
|
4764
|
-
es_1st: es_1st$1,
|
4765
|
-
es_2nd: es_2nd$1,
|
4766
|
-
es_3rd: es_3rd$1,
|
4767
|
-
es_4th: es_4th$1,
|
4768
|
-
es_5th: es_5th$1,
|
4769
|
-
es_6th: es_6th$1,
|
4770
|
-
ms_1st: ms_1st$1,
|
4771
|
-
ms_2nd: ms_2nd$1,
|
4772
|
-
ms_3rd: ms_3rd$1,
|
4773
|
-
hs_1st: hs_1st$1,
|
4774
|
-
hs_2nd: hs_2nd$1,
|
4775
|
-
hs_3rd: hs_3rd$1,
|
4776
|
-
n_retaker: n_retaker$1,
|
4777
|
-
today_class: today_class$1,
|
4778
|
-
unit_number: unit_number$1,
|
4779
|
-
sub_unit_number: sub_unit_number$1,
|
4780
|
-
text_group_n: text_group_n$1,
|
4781
|
-
text_detail_n: text_detail_n$1,
|
4782
|
-
question_group_n: question_group_n$1,
|
4783
|
-
placeholder_teacher_selector: placeholder_teacher_selector$1,
|
4784
|
-
teacher_personal_textbook: teacher_personal_textbook$1,
|
4785
|
-
textbook_owner_email_is_required: textbook_owner_email_is_required$1,
|
4786
|
-
invalid_textbook_owner_email_address: invalid_textbook_owner_email_address$1,
|
4787
|
-
textbook_owner_academy_is_required: textbook_owner_academy_is_required$1,
|
4788
|
-
textbook_owner_course_is_required: textbook_owner_course_is_required$1
|
4683
|
+
high_school_3rd_grade: high_school_3rd_grade$1
|
4789
4684
|
};
|
4790
4685
|
|
4791
4686
|
i18n.use(initReactI18next).init({
|
@@ -4812,6 +4707,71 @@ var PrintState;
|
|
4812
4707
|
PrintState[PrintState["Paused"] = 3] = "Paused";
|
4813
4708
|
})(PrintState || (PrintState = {}));
|
4814
4709
|
|
4710
|
+
var PreparedType;
|
4711
|
+
(function (PreparedType) {
|
4712
|
+
PreparedType[PreparedType["csat_past_questions"] = 1] = "csat_past_questions";
|
4713
|
+
PreparedType[PreparedType["official_mock_exam"] = 2] = "official_mock_exam";
|
4714
|
+
PreparedType[PreparedType["private_mock_exam"] = 3] = "private_mock_exam";
|
4715
|
+
})(PreparedType || (PreparedType = {}));
|
4716
|
+
|
4717
|
+
var ExamEvent;
|
4718
|
+
(function (ExamEvent) {
|
4719
|
+
ExamEvent["StartExam"] = "start-exam";
|
4720
|
+
ExamEvent["TerminateExam"] = "terminate-exam";
|
4721
|
+
ExamEvent["AddExtraDuration"] = "add-extra-duration-exam";
|
4722
|
+
ExamEvent["TeacherKickOutStudent"] = "teacher-kick-out-student";
|
4723
|
+
})(ExamEvent || (ExamEvent = {}));
|
4724
|
+
|
4725
|
+
var ExamStatus;
|
4726
|
+
(function (ExamStatus) {
|
4727
|
+
ExamStatus[ExamStatus["Default"] = 0] = "Default";
|
4728
|
+
ExamStatus[ExamStatus["Pending"] = 1] = "Pending";
|
4729
|
+
ExamStatus[ExamStatus["InProgress"] = 2] = "InProgress";
|
4730
|
+
ExamStatus[ExamStatus["Completed"] = 3] = "Completed";
|
4731
|
+
})(ExamStatus || (ExamStatus = {}));
|
4732
|
+
var QuestionAnswerType;
|
4733
|
+
(function (QuestionAnswerType) {
|
4734
|
+
QuestionAnswerType[QuestionAnswerType["SingleChoice"] = 0] = "SingleChoice";
|
4735
|
+
QuestionAnswerType[QuestionAnswerType["MultipleChoice"] = 1] = "MultipleChoice";
|
4736
|
+
QuestionAnswerType[QuestionAnswerType["ShortAnswer"] = 2] = "ShortAnswer";
|
4737
|
+
})(QuestionAnswerType || (QuestionAnswerType = {}));
|
4738
|
+
|
4739
|
+
var OrderType;
|
4740
|
+
(function (OrderType) {
|
4741
|
+
OrderType["ASC"] = "ASC";
|
4742
|
+
OrderType["DESC"] = "DESC";
|
4743
|
+
})(OrderType || (OrderType = {}));
|
4744
|
+
|
4745
|
+
var RecentUserAction;
|
4746
|
+
(function (RecentUserAction) {
|
4747
|
+
RecentUserAction["ViewedUser"] = "ViewedUser";
|
4748
|
+
RecentUserAction["ViewedQNA"] = "ViewedQNA";
|
4749
|
+
RecentUserAction["ViewedExamResult"] = "ViewedExamResult";
|
4750
|
+
RecentUserAction["PrintedExamResult"] = "PrintedExamResult";
|
4751
|
+
RecentUserAction["ViewedAttendance"] = "ViewedAttendance";
|
4752
|
+
})(RecentUserAction || (RecentUserAction = {}));
|
4753
|
+
|
4754
|
+
var UserSortColumn;
|
4755
|
+
(function (UserSortColumn) {
|
4756
|
+
UserSortColumn["CreatedAt"] = "CreatedAt";
|
4757
|
+
UserSortColumn["FullName"] = "FullName";
|
4758
|
+
UserSortColumn["PhoneNumber"] = "PhoneNumber";
|
4759
|
+
UserSortColumn["Email"] = "Email";
|
4760
|
+
UserSortColumn["SchoolName"] = "SchoolName";
|
4761
|
+
UserSortColumn["Major"] = "Major";
|
4762
|
+
UserSortColumn["ParentName"] = "ParentName";
|
4763
|
+
UserSortColumn["ParentPhoneNumber"] = "ParentPhoneNumber";
|
4764
|
+
UserSortColumn["Grade"] = "Grade";
|
4765
|
+
})(UserSortColumn || (UserSortColumn = {}));
|
4766
|
+
|
4767
|
+
var SchoolType;
|
4768
|
+
(function (SchoolType) {
|
4769
|
+
SchoolType[SchoolType["Default"] = 0] = "Default";
|
4770
|
+
SchoolType[SchoolType["Elementary"] = 1] = "Elementary";
|
4771
|
+
SchoolType[SchoolType["Middle"] = 2] = "Middle";
|
4772
|
+
SchoolType[SchoolType["High"] = 3] = "High";
|
4773
|
+
})(SchoolType || (SchoolType = {}));
|
4774
|
+
|
4815
4775
|
var GOOGLE_RECAPTCHA_KEY = process.env.REACT_APP_GOOGLE_RECAPTCHA_KEY || "";
|
4816
4776
|
var GOOGLE_CLIENT_ID = process.env.REACT_APP_GOOGLE_CLIENT_ID || "";
|
4817
4777
|
var GOOGLE_RECAPTCHA_ID = process.env.REACT_APP_GOOGLE_RECAPTCHA_ID || "";
|
@@ -4882,7 +4842,17 @@ var DEFAULT_PAGING_RESPONSE = {
|
|
4882
4842
|
totalItems: 0,
|
4883
4843
|
totalPages: 0
|
4884
4844
|
};
|
4885
|
-
var
|
4845
|
+
var SCHOOL_OPTIONS = [{
|
4846
|
+
label: "elementary_school",
|
4847
|
+
value: SchoolType.Elementary
|
4848
|
+
}, {
|
4849
|
+
label: "middle_school",
|
4850
|
+
value: SchoolType.Middle
|
4851
|
+
}, {
|
4852
|
+
label: "high_school",
|
4853
|
+
value: SchoolType.High
|
4854
|
+
}];
|
4855
|
+
var ELEMENTARY_GRADES = [{
|
4886
4856
|
label: "elementary_school_1st_grade",
|
4887
4857
|
value: 1
|
4888
4858
|
}, {
|
@@ -4900,67 +4870,26 @@ var GRADE_OPTIONS = [{
|
|
4900
4870
|
}, {
|
4901
4871
|
label: "elementary_school_6th_grade",
|
4902
4872
|
value: 6
|
4903
|
-
}
|
4873
|
+
}];
|
4874
|
+
var MIDDLE_GRADES = [{
|
4904
4875
|
label: "middle_school_1st_grade",
|
4905
|
-
value:
|
4876
|
+
value: 1
|
4906
4877
|
}, {
|
4907
4878
|
label: "middle_school_2nd_grade",
|
4908
|
-
value:
|
4879
|
+
value: 2
|
4909
4880
|
}, {
|
4910
4881
|
label: "middle_school_3rd_grade",
|
4911
|
-
value:
|
4912
|
-
}, {
|
4913
|
-
label: "high_school_1st_grade",
|
4914
|
-
value: 10
|
4915
|
-
}, {
|
4916
|
-
label: "high_school_2nd_grade",
|
4917
|
-
value: 11
|
4918
|
-
}, {
|
4919
|
-
label: "high_school_3rd_grade",
|
4920
|
-
value: 12
|
4921
|
-
}, {
|
4922
|
-
label: "n_year_retaker",
|
4923
|
-
value: 13
|
4882
|
+
value: 3
|
4924
4883
|
}];
|
4925
|
-
var
|
4926
|
-
label: "
|
4884
|
+
var HIGH_GRADES = [{
|
4885
|
+
label: "high_school_1st_grade",
|
4927
4886
|
value: 1
|
4928
4887
|
}, {
|
4929
|
-
label: "
|
4888
|
+
label: "high_school_2nd_grade",
|
4930
4889
|
value: 2
|
4931
4890
|
}, {
|
4932
|
-
label: "
|
4891
|
+
label: "high_school_3rd_grade",
|
4933
4892
|
value: 3
|
4934
|
-
}, {
|
4935
|
-
label: "es_4th",
|
4936
|
-
value: 4
|
4937
|
-
}, {
|
4938
|
-
label: "es_5th",
|
4939
|
-
value: 5
|
4940
|
-
}, {
|
4941
|
-
label: "es_6th",
|
4942
|
-
value: 6
|
4943
|
-
}, {
|
4944
|
-
label: "ms_1st",
|
4945
|
-
value: 7
|
4946
|
-
}, {
|
4947
|
-
label: "ms_2nd",
|
4948
|
-
value: 8
|
4949
|
-
}, {
|
4950
|
-
label: "ms_3rd",
|
4951
|
-
value: 9
|
4952
|
-
}, {
|
4953
|
-
label: "hs_1st",
|
4954
|
-
value: 10
|
4955
|
-
}, {
|
4956
|
-
label: "hs_2nd",
|
4957
|
-
value: 11
|
4958
|
-
}, {
|
4959
|
-
label: "hs_3rd",
|
4960
|
-
value: 12
|
4961
|
-
}, {
|
4962
|
-
label: "n_retaker",
|
4963
|
-
value: 13
|
4964
4893
|
}];
|
4965
4894
|
|
4966
4895
|
var utcToLocalTime = (function (time, FORMAT) {
|
@@ -5901,7 +5830,7 @@ var CustomCreatable = function CustomCreatable(_ref) {
|
|
5901
5830
|
}, rest));
|
5902
5831
|
};
|
5903
5832
|
|
5904
|
-
var _excluded$2 = ["isDefault", "defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti", "optionValue"
|
5833
|
+
var _excluded$2 = ["isDefault", "defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti", "optionValue"];
|
5905
5834
|
var CustomSelect = function CustomSelect(_ref) {
|
5906
5835
|
var isDefault = _ref.isDefault,
|
5907
5836
|
options = _ref.options,
|
@@ -5910,7 +5839,6 @@ var CustomSelect = function CustomSelect(_ref) {
|
|
5910
5839
|
value = _ref.value,
|
5911
5840
|
isMulti = _ref.isMulti,
|
5912
5841
|
optionValue = _ref.optionValue,
|
5913
|
-
styles = _ref.styles,
|
5914
5842
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
5915
5843
|
var _useTranslation = useTranslation(),
|
5916
5844
|
t = _useTranslation.t;
|
@@ -5935,7 +5863,7 @@ var CustomSelect = function CustomSelect(_ref) {
|
|
5935
5863
|
DropdownIndicator: DropdownIndicator,
|
5936
5864
|
Option: CustomOption
|
5937
5865
|
},
|
5938
|
-
styles:
|
5866
|
+
styles: customStyles,
|
5939
5867
|
placeholder: t("select_placeholder")
|
5940
5868
|
}, rest));
|
5941
5869
|
};
|
@@ -6107,71 +6035,6 @@ function _finally(body, finalizer) {
|
|
6107
6035
|
return finalizer();
|
6108
6036
|
}
|
6109
6037
|
|
6110
|
-
var PreparedType;
|
6111
|
-
(function (PreparedType) {
|
6112
|
-
PreparedType[PreparedType["csat_past_questions"] = 1] = "csat_past_questions";
|
6113
|
-
PreparedType[PreparedType["official_mock_exam"] = 2] = "official_mock_exam";
|
6114
|
-
PreparedType[PreparedType["private_mock_exam"] = 3] = "private_mock_exam";
|
6115
|
-
})(PreparedType || (PreparedType = {}));
|
6116
|
-
|
6117
|
-
var ExamEvent;
|
6118
|
-
(function (ExamEvent) {
|
6119
|
-
ExamEvent["StartExam"] = "start-exam";
|
6120
|
-
ExamEvent["TerminateExam"] = "terminate-exam";
|
6121
|
-
ExamEvent["AddExtraDuration"] = "add-extra-duration-exam";
|
6122
|
-
ExamEvent["TeacherKickOutStudent"] = "teacher-kick-out-student";
|
6123
|
-
})(ExamEvent || (ExamEvent = {}));
|
6124
|
-
|
6125
|
-
var ExamStatus;
|
6126
|
-
(function (ExamStatus) {
|
6127
|
-
ExamStatus[ExamStatus["Default"] = 0] = "Default";
|
6128
|
-
ExamStatus[ExamStatus["Pending"] = 1] = "Pending";
|
6129
|
-
ExamStatus[ExamStatus["InProgress"] = 2] = "InProgress";
|
6130
|
-
ExamStatus[ExamStatus["Completed"] = 3] = "Completed";
|
6131
|
-
})(ExamStatus || (ExamStatus = {}));
|
6132
|
-
var QuestionAnswerType;
|
6133
|
-
(function (QuestionAnswerType) {
|
6134
|
-
QuestionAnswerType[QuestionAnswerType["SingleChoice"] = 0] = "SingleChoice";
|
6135
|
-
QuestionAnswerType[QuestionAnswerType["MultipleChoice"] = 1] = "MultipleChoice";
|
6136
|
-
QuestionAnswerType[QuestionAnswerType["ShortAnswer"] = 2] = "ShortAnswer";
|
6137
|
-
})(QuestionAnswerType || (QuestionAnswerType = {}));
|
6138
|
-
|
6139
|
-
var OrderType;
|
6140
|
-
(function (OrderType) {
|
6141
|
-
OrderType["ASC"] = "ASC";
|
6142
|
-
OrderType["DESC"] = "DESC";
|
6143
|
-
})(OrderType || (OrderType = {}));
|
6144
|
-
|
6145
|
-
var RecentUserAction;
|
6146
|
-
(function (RecentUserAction) {
|
6147
|
-
RecentUserAction["ViewedUser"] = "ViewedUser";
|
6148
|
-
RecentUserAction["ViewedQNA"] = "ViewedQNA";
|
6149
|
-
RecentUserAction["ViewedExamResult"] = "ViewedExamResult";
|
6150
|
-
RecentUserAction["PrintedExamResult"] = "PrintedExamResult";
|
6151
|
-
RecentUserAction["ViewedAttendance"] = "ViewedAttendance";
|
6152
|
-
})(RecentUserAction || (RecentUserAction = {}));
|
6153
|
-
|
6154
|
-
var UserSortColumn;
|
6155
|
-
(function (UserSortColumn) {
|
6156
|
-
UserSortColumn["CreatedAt"] = "CreatedAt";
|
6157
|
-
UserSortColumn["FullName"] = "FullName";
|
6158
|
-
UserSortColumn["PhoneNumber"] = "PhoneNumber";
|
6159
|
-
UserSortColumn["Email"] = "Email";
|
6160
|
-
UserSortColumn["SchoolName"] = "SchoolName";
|
6161
|
-
UserSortColumn["Major"] = "Major";
|
6162
|
-
UserSortColumn["ParentName"] = "ParentName";
|
6163
|
-
UserSortColumn["ParentPhoneNumber"] = "ParentPhoneNumber";
|
6164
|
-
UserSortColumn["Grade"] = "Grade";
|
6165
|
-
})(UserSortColumn || (UserSortColumn = {}));
|
6166
|
-
|
6167
|
-
var SchoolType;
|
6168
|
-
(function (SchoolType) {
|
6169
|
-
SchoolType[SchoolType["Default"] = 0] = "Default";
|
6170
|
-
SchoolType[SchoolType["Elementary"] = 1] = "Elementary";
|
6171
|
-
SchoolType[SchoolType["Middle"] = 2] = "Middle";
|
6172
|
-
SchoolType[SchoolType["High"] = 3] = "High";
|
6173
|
-
})(SchoolType || (SchoolType = {}));
|
6174
|
-
|
6175
6038
|
var canAccess = function canAccess(userRoles, componentRoles) {
|
6176
6039
|
if (!Array.isArray(userRoles)) {
|
6177
6040
|
return false;
|
@@ -9635,198 +9498,7 @@ var ListView = function ListView(_ref) {
|
|
9635
9498
|
}));
|
9636
9499
|
};
|
9637
9500
|
|
9638
|
-
var
|
9639
|
-
var data = props.data,
|
9640
|
-
loading = props.loading,
|
9641
|
-
onLoadMore = props.onLoadMore;
|
9642
|
-
var handleLoadMore = function handleLoadMore() {
|
9643
|
-
if (loading) return;
|
9644
|
-
onLoadMore === null || onLoadMore === void 0 ? void 0 : onLoadMore();
|
9645
|
-
};
|
9646
|
-
var onScroll = function onScroll(_ref) {
|
9647
|
-
var scrollTop = _ref.scrollTop,
|
9648
|
-
clientHeight = _ref.clientHeight,
|
9649
|
-
scrollHeight = _ref.scrollHeight;
|
9650
|
-
if (scrollTop + clientHeight >= scrollHeight - 100) {
|
9651
|
-
handleLoadMore();
|
9652
|
-
}
|
9653
|
-
};
|
9654
|
-
var rowCount = data.length + (loading ? 1 : 0);
|
9655
|
-
return {
|
9656
|
-
rowCount: rowCount,
|
9657
|
-
onScroll: onScroll
|
9658
|
-
};
|
9659
|
-
};
|
9660
|
-
|
9661
|
-
var cellMeasurerCache = new CellMeasurerCache({
|
9662
|
-
fixedWidth: true,
|
9663
|
-
defaultHeight: 50
|
9664
|
-
});
|
9665
|
-
|
9666
|
-
var grey = {
|
9667
|
-
0: '#FFFFFF',
|
9668
|
-
50: "#FBFBF9",
|
9669
|
-
100: '#EAEAE5',
|
9670
|
-
200: '#F4F6F8',
|
9671
|
-
300: '#D0D0C8',
|
9672
|
-
400: '#C4CDD5',
|
9673
|
-
500: '#9A9A98',
|
9674
|
-
600: '#637381',
|
9675
|
-
700: '#5D5D5B',
|
9676
|
-
800: '#212B36',
|
9677
|
-
900: '#363634'
|
9678
|
-
};
|
9679
|
-
var green = {
|
9680
|
-
0: '#FFFFFF',
|
9681
|
-
100: '#F0FFF6',
|
9682
|
-
300: '#89F0B2',
|
9683
|
-
500: '#3DC674',
|
9684
|
-
700: '#349056',
|
9685
|
-
900: '#18442A'
|
9686
|
-
};
|
9687
|
-
var main_theme = {
|
9688
|
-
lighter: green[100],
|
9689
|
-
light: green[300],
|
9690
|
-
less_dark: green[500],
|
9691
|
-
dark: green[700],
|
9692
|
-
darker: green[900]
|
9693
|
-
};
|
9694
|
-
var primary = {
|
9695
|
-
lighter: '#D0ECFE',
|
9696
|
-
light: '#73BAFB',
|
9697
|
-
main: '#1877F2',
|
9698
|
-
dark: '#0C44AE',
|
9699
|
-
darker: '#042174',
|
9700
|
-
contrastText: '#FFFFFF'
|
9701
|
-
};
|
9702
|
-
var secondary = {
|
9703
|
-
lighter: '#EFD6FF',
|
9704
|
-
light: '#C684FF',
|
9705
|
-
main: '#8E33FF',
|
9706
|
-
dark: '#5119B7',
|
9707
|
-
darker: '#27097A',
|
9708
|
-
contrastText: '#FFFFFF'
|
9709
|
-
};
|
9710
|
-
var info = {
|
9711
|
-
lighter: '#CAFDF5',
|
9712
|
-
light: '#61F3F3',
|
9713
|
-
main: '#00B8D9',
|
9714
|
-
dark: '#006C9C',
|
9715
|
-
darker: '#003768',
|
9716
|
-
contrastText: '#FFFFFF'
|
9717
|
-
};
|
9718
|
-
var success = {
|
9719
|
-
lighter: '#C8FAD6',
|
9720
|
-
light: '#5BE49B',
|
9721
|
-
main: '#00A76F',
|
9722
|
-
dark: '#007867',
|
9723
|
-
darker: '#004B50',
|
9724
|
-
contrastText: '#FFFFFF'
|
9725
|
-
};
|
9726
|
-
var warning$1 = {
|
9727
|
-
lighter: '#FFF5CC',
|
9728
|
-
light: '#FFD666',
|
9729
|
-
main: '#FFAB00',
|
9730
|
-
dark: '#B76E00',
|
9731
|
-
darker: '#7A4100',
|
9732
|
-
contrastText: grey[800]
|
9733
|
-
};
|
9734
|
-
var error = {
|
9735
|
-
lighter: '#FFE9D5',
|
9736
|
-
light: '#FFAC82',
|
9737
|
-
main: '#FF5630',
|
9738
|
-
dark: '#B71D18',
|
9739
|
-
darker: '#7A0916',
|
9740
|
-
contrastText: '#FFFFFF'
|
9741
|
-
};
|
9742
|
-
var red = {
|
9743
|
-
100: '#FEF8F8',
|
9744
|
-
300: '#FEF8F8',
|
9745
|
-
500: '#F4CACA',
|
9746
|
-
900: '#DB4D4D'
|
9747
|
-
};
|
9748
|
-
var yellow = {
|
9749
|
-
900: '#FEAF06'
|
9750
|
-
};
|
9751
|
-
var green_support = {
|
9752
|
-
100: '#F6FDF7',
|
9753
|
-
500: '#AEEAB3',
|
9754
|
-
900: '#3ACB46'
|
9755
|
-
};
|
9756
|
-
var purple = {
|
9757
|
-
900: '#C3099A'
|
9758
|
-
};
|
9759
|
-
var dark_purple = {
|
9760
|
-
900: '#6B0861'
|
9761
|
-
};
|
9762
|
-
var dark_red = {
|
9763
|
-
900: '#800202'
|
9764
|
-
};
|
9765
|
-
var common = {
|
9766
|
-
black: '#000000',
|
9767
|
-
white: '#FFFFFF'
|
9768
|
-
};
|
9769
|
-
var action$2 = {
|
9770
|
-
hover: alpha(grey[500], 0.08),
|
9771
|
-
selected: alpha(grey[500], 0.16),
|
9772
|
-
disabled: alpha(grey[500], 0.8),
|
9773
|
-
disabledBackground: alpha(grey[500], 0.24),
|
9774
|
-
focus: alpha(grey[500], 0.24),
|
9775
|
-
hoverOpacity: 0.08,
|
9776
|
-
disabledOpacity: 0.48
|
9777
|
-
};
|
9778
|
-
var base = {
|
9779
|
-
primary: primary,
|
9780
|
-
secondary: secondary,
|
9781
|
-
info: info,
|
9782
|
-
main_theme: main_theme,
|
9783
|
-
success: success,
|
9784
|
-
warning: warning$1,
|
9785
|
-
error: error,
|
9786
|
-
grey: grey,
|
9787
|
-
common: common,
|
9788
|
-
red: red,
|
9789
|
-
yellow: yellow,
|
9790
|
-
green_support: green_support,
|
9791
|
-
purple: purple,
|
9792
|
-
dark_purple: dark_purple,
|
9793
|
-
dark_red: dark_red,
|
9794
|
-
divider: alpha(grey[500], 0.2),
|
9795
|
-
action: action$2
|
9796
|
-
};
|
9797
|
-
|
9798
|
-
var VirtualListItem = function VirtualListItem(_ref) {
|
9799
|
-
var isLoading = _ref.isLoading,
|
9800
|
-
rowData = _ref.rowData,
|
9801
|
-
style = _ref.style,
|
9802
|
-
parent = _ref.parent,
|
9803
|
-
index = _ref.index,
|
9804
|
-
renderItem = _ref.renderItem,
|
9805
|
-
loadingElement = _ref.loadingElement;
|
9806
|
-
return React__default.createElement(CellMeasurer, {
|
9807
|
-
cache: cellMeasurerCache,
|
9808
|
-
columnIndex: 0,
|
9809
|
-
rowIndex: index,
|
9810
|
-
key: rowData === null || rowData === void 0 ? void 0 : rowData.id,
|
9811
|
-
parent: parent
|
9812
|
-
}, function (_ref2) {
|
9813
|
-
var measure = _ref2.measure;
|
9814
|
-
return React__default.createElement("div", {
|
9815
|
-
key: rowData === null || rowData === void 0 ? void 0 : rowData.id,
|
9816
|
-
style: style
|
9817
|
-
}, isLoading && !!loadingElement && loadingElement, isLoading && !loadingElement && React__default.createElement(Box, {
|
9818
|
-
p: 1,
|
9819
|
-
className: "d-flex justify-content-center align-items-center w-100"
|
9820
|
-
}, React__default.createElement(CircularProgress, {
|
9821
|
-
size: 24,
|
9822
|
-
sx: {
|
9823
|
-
color: grey[700]
|
9824
|
-
}
|
9825
|
-
})), !isLoading && renderItem(rowData, index, measure));
|
9826
|
-
});
|
9827
|
-
};
|
9828
|
-
|
9829
|
-
var VirtualEmptyItem = function VirtualEmptyItem(_ref) {
|
9501
|
+
var VirtualTableEmpty = function VirtualTableEmpty(_ref) {
|
9830
9502
|
var emptyElement = _ref.emptyElement;
|
9831
9503
|
var _useTranslation = useTranslation(),
|
9832
9504
|
t = _useTranslation.t;
|
@@ -9839,195 +9511,70 @@ var VirtualEmptyItem = function VirtualEmptyItem(_ref) {
|
|
9839
9511
|
var VirtualListView = function VirtualListView(props) {
|
9840
9512
|
var data = props.data,
|
9841
9513
|
containerProps = props.containerProps,
|
9842
|
-
listHeight = props.listHeight,
|
9843
|
-
_props$overscanRowCou = props.overscanRowCount,
|
9844
|
-
overscanRowCount = _props$overscanRowCou === void 0 ? 5 : _props$overscanRowCou,
|
9845
9514
|
renderItem = props.renderItem,
|
9846
9515
|
emptyElement = props.emptyElement,
|
9847
|
-
|
9848
|
-
|
9849
|
-
|
9850
|
-
onScroll = _useVirtualListView.onScroll;
|
9851
|
-
var rowRenderer = function rowRenderer(props) {
|
9852
|
-
var index = props.index;
|
9853
|
-
var isLoading = index === data.length;
|
9854
|
-
var rowData = isLoading ? undefined : data[index];
|
9855
|
-
return React__default.createElement(VirtualListItem, Object.assign({}, props, {
|
9856
|
-
rowData: rowData,
|
9857
|
-
isLoading: isLoading,
|
9858
|
-
renderItem: renderItem,
|
9859
|
-
loadingElement: loadingElement
|
9860
|
-
}));
|
9861
|
-
};
|
9862
|
-
var noRowsRenderer = function noRowsRenderer() {
|
9863
|
-
return React__default.createElement(VirtualEmptyItem, {
|
9864
|
-
emptyElement: emptyElement
|
9865
|
-
});
|
9866
|
-
};
|
9516
|
+
loading = props.loading,
|
9517
|
+
loadingElement = props.loadingElement,
|
9518
|
+
listHeight = props.listHeight;
|
9867
9519
|
return React__default.createElement(Box, Object.assign({}, containerProps), React__default.createElement(AutoSizer, {
|
9868
9520
|
disableHeight: !!listHeight
|
9869
9521
|
}, function (_ref) {
|
9870
9522
|
var width = _ref.width,
|
9871
9523
|
height = _ref.height;
|
9872
|
-
return React__default.createElement(
|
9524
|
+
return React__default.createElement(Box, {
|
9873
9525
|
width: width,
|
9874
|
-
height:
|
9875
|
-
|
9876
|
-
|
9877
|
-
rowRenderer: rowRenderer,
|
9878
|
-
deferredMeasurementCache: cellMeasurerCache,
|
9879
|
-
overscanRowCount: overscanRowCount,
|
9880
|
-
noRowsRenderer: noRowsRenderer,
|
9881
|
-
onScroll: onScroll
|
9882
|
-
});
|
9883
|
-
}));
|
9884
|
-
};
|
9885
|
-
|
9886
|
-
var cellMeasurerCache$1 = new CellMeasurerCache({
|
9887
|
-
defaultWidth: 100,
|
9888
|
-
defaultHeight: 50
|
9889
|
-
});
|
9890
|
-
|
9891
|
-
var VirtualTableRowItem = function VirtualTableRowItem(_ref) {
|
9892
|
-
var isLoading = _ref.isLoading,
|
9893
|
-
style = _ref.style,
|
9894
|
-
parent = _ref.parent,
|
9895
|
-
rowIndex = _ref.rowIndex,
|
9896
|
-
columnIndex = _ref.columnIndex,
|
9897
|
-
renderItem = _ref.renderItem,
|
9898
|
-
loadingElement = _ref.loadingElement,
|
9899
|
-
cellMeasurerCache = _ref.cellMeasurerCache;
|
9900
|
-
return React__default.createElement(CellMeasurer, {
|
9901
|
-
cache: cellMeasurerCache,
|
9902
|
-
columnIndex: columnIndex,
|
9903
|
-
rowIndex: rowIndex,
|
9904
|
-
key: rowIndex + "-" + columnIndex,
|
9905
|
-
parent: parent
|
9906
|
-
}, function (_ref2) {
|
9907
|
-
var measure = _ref2.measure;
|
9908
|
-
return React__default.createElement("div", {
|
9909
|
-
style: style
|
9910
|
-
}, isLoading && !!loadingElement && loadingElement, isLoading && !loadingElement && React__default.createElement(Box, {
|
9526
|
+
height: height,
|
9527
|
+
overflow: "auto"
|
9528
|
+
}, loading && React__default.createElement(Fragment$1, null, loadingElement != null ? loadingElement : React__default.createElement(Box, {
|
9911
9529
|
p: 1,
|
9912
9530
|
className: "d-flex justify-content-center align-items-center w-100"
|
9913
9531
|
}, React__default.createElement(CircularProgress, {
|
9914
9532
|
size: 24,
|
9915
9533
|
sx: {
|
9916
|
-
color:
|
9534
|
+
color: "#5d5d5b"
|
9917
9535
|
}
|
9918
|
-
})), !
|
9919
|
-
|
9920
|
-
}
|
9921
|
-
|
9922
|
-
|
9923
|
-
|
9924
|
-
|
9925
|
-
var _useTranslation = useTranslation(),
|
9926
|
-
t = _useTranslation.t;
|
9927
|
-
if (emptyElement) return emptyElement;
|
9928
|
-
return React__default.createElement(Box, null, React__default.createElement(Typography, {
|
9929
|
-
className: "text-center text-muted"
|
9930
|
-
}, t("no_data")));
|
9931
|
-
};
|
9932
|
-
|
9933
|
-
var useVirtualTableView = function useVirtualTableView(props) {
|
9934
|
-
var itemsCount = props.itemsCount,
|
9935
|
-
loading = props.loading,
|
9936
|
-
hasHeader = props.hasHeader,
|
9937
|
-
onLoadMore = props.onLoadMore;
|
9938
|
-
var handleLoadMore = function handleLoadMore() {
|
9939
|
-
if (loading) return;
|
9940
|
-
onLoadMore === null || onLoadMore === void 0 ? void 0 : onLoadMore();
|
9941
|
-
};
|
9942
|
-
var onScroll = function onScroll(_ref) {
|
9943
|
-
var scrollTop = _ref.scrollTop,
|
9944
|
-
clientHeight = _ref.clientHeight,
|
9945
|
-
scrollHeight = _ref.scrollHeight;
|
9946
|
-
if (scrollTop + clientHeight >= scrollHeight - 100) {
|
9947
|
-
handleLoadMore();
|
9948
|
-
}
|
9949
|
-
};
|
9950
|
-
var rowCount = useMemo(function () {
|
9951
|
-
return itemsCount + (loading ? 1 : itemsCount === 1 && hasHeader ? 1 : 0);
|
9952
|
-
}, [itemsCount, loading, hasHeader]);
|
9953
|
-
return {
|
9954
|
-
rowCount: rowCount,
|
9955
|
-
onScroll: onScroll
|
9956
|
-
};
|
9536
|
+
}))), !loading && !data.length && React__default.createElement(VirtualTableEmpty, {
|
9537
|
+
emptyElement: emptyElement
|
9538
|
+
}), !loading && !!data.length && React__default.createElement(ListView, {
|
9539
|
+
data: data,
|
9540
|
+
render: renderItem
|
9541
|
+
}));
|
9542
|
+
}));
|
9957
9543
|
};
|
9958
9544
|
|
9959
|
-
var _excluded$5 = ["containerProps", "listHeight", "overscanRowCount", "overscanColumnCount", "renderItem", "emptyElement", "loadingElement", "fixedColumnCount", "fixedRowCount", "listWidth", "itemsCount", "cellCache", "columnWidth", "containerRef", "multiGridRef"];
|
9960
9545
|
var VirtualTableView = function VirtualTableView(props) {
|
9961
|
-
var
|
9962
|
-
|
9963
|
-
_props$overscanRowCou = props.overscanRowCount,
|
9964
|
-
overscanRowCount = _props$overscanRowCou === void 0 ? 5 : _props$overscanRowCou,
|
9965
|
-
_props$overscanColumn = props.overscanColumnCount,
|
9966
|
-
overscanColumnCount = _props$overscanColumn === void 0 ? 5 : _props$overscanColumn,
|
9546
|
+
var data = props.data,
|
9547
|
+
containerProps = props.containerProps,
|
9967
9548
|
renderItem = props.renderItem,
|
9968
9549
|
emptyElement = props.emptyElement,
|
9969
|
-
|
9970
|
-
|
9971
|
-
|
9972
|
-
|
9973
|
-
|
9974
|
-
|
9975
|
-
|
9976
|
-
|
9977
|
-
|
9978
|
-
|
9979
|
-
|
9980
|
-
var _useVirtualTableView = useVirtualTableView(props),
|
9981
|
-
rowCount = _useVirtualTableView.rowCount,
|
9982
|
-
onScroll = _useVirtualTableView.onScroll;
|
9983
|
-
var cellRenderer = function cellRenderer(props) {
|
9984
|
-
var rowIndex = props.rowIndex,
|
9985
|
-
columnIndex = props.columnIndex;
|
9986
|
-
var isLoading = rowIndex === itemsCount && columnIndex === 0;
|
9987
|
-
return React__default.createElement(VirtualTableRowItem$1, Object.assign({}, props, {
|
9988
|
-
isLoading: isLoading,
|
9989
|
-
renderItem: renderItem,
|
9990
|
-
loadingElement: loadingElement,
|
9991
|
-
cellMeasurerCache: cache
|
9550
|
+
columnCount = props.columnCount,
|
9551
|
+
loading = props.loading,
|
9552
|
+
loadingElement = props.loadingElement;
|
9553
|
+
var containerRef = useRef(null);
|
9554
|
+
var renderTableRow = function renderTableRow(_, index) {
|
9555
|
+
return React__default.createElement(Stack, {
|
9556
|
+
direction: "row"
|
9557
|
+
}, Array.from({
|
9558
|
+
length: columnCount
|
9559
|
+
}, function (_, colIndex) {
|
9560
|
+
return renderItem(index, colIndex);
|
9992
9561
|
}));
|
9993
9562
|
};
|
9994
|
-
var noRowsRenderer = function noRowsRenderer() {
|
9995
|
-
return React__default.createElement(VirtualTableEmpty, {
|
9996
|
-
emptyElement: emptyElement
|
9997
|
-
});
|
9998
|
-
};
|
9999
|
-
var columnWidthRendered = function columnWidthRendered(params) {
|
10000
|
-
if (typeof columnWidth === "number") return columnWidth;
|
10001
|
-
var cw = cache.columnWidth(params);
|
10002
|
-
if (columnWidth === undefined) return cw;
|
10003
|
-
return columnWidth(params, cache);
|
10004
|
-
};
|
10005
9563
|
return React__default.createElement(Box, Object.assign({
|
10006
9564
|
ref: containerRef
|
10007
|
-
}, containerProps), React__default.createElement(
|
10008
|
-
|
10009
|
-
|
10010
|
-
},
|
10011
|
-
|
10012
|
-
|
10013
|
-
|
10014
|
-
|
10015
|
-
|
10016
|
-
|
10017
|
-
|
10018
|
-
|
10019
|
-
|
10020
|
-
columnWidth: columnWidthRendered,
|
10021
|
-
height: listHeight || height,
|
10022
|
-
rowHeight: cache.rowHeight,
|
10023
|
-
deferredMeasurementCache: cache,
|
10024
|
-
rowCount: rowCount,
|
10025
|
-
width: listWidth || width,
|
10026
|
-
overscanRowCount: overscanRowCount,
|
10027
|
-
overscanColumnCount: overscanColumnCount,
|
10028
|
-
noRowsRenderer: noRowsRenderer,
|
10029
|
-
onScroll: onScroll
|
10030
|
-
}, rest));
|
9565
|
+
}, containerProps), loading && React__default.createElement(Fragment$1, null, loadingElement != null ? loadingElement : React__default.createElement(Box, {
|
9566
|
+
p: 1,
|
9567
|
+
className: "d-flex justify-content-center align-items-center w-100"
|
9568
|
+
}, React__default.createElement(CircularProgress, {
|
9569
|
+
size: 24,
|
9570
|
+
sx: {
|
9571
|
+
color: "#5d5d5b"
|
9572
|
+
}
|
9573
|
+
}))), !loading && !data.length && React__default.createElement(VirtualTableEmpty, {
|
9574
|
+
emptyElement: emptyElement
|
9575
|
+
}), !loading && !!data.length && React__default.createElement(ListView, {
|
9576
|
+
data: data,
|
9577
|
+
render: renderTableRow
|
10031
9578
|
}));
|
10032
9579
|
};
|
10033
9580
|
|
@@ -10039,7 +9586,6 @@ var MathTinyEditor = function MathTinyEditor(_ref) {
|
|
10039
9586
|
onChange = _ref.onChange,
|
10040
9587
|
initValue = _ref.initValue,
|
10041
9588
|
config = _ref.config;
|
10042
|
-
var isFirstChange = useRef(true);
|
10043
9589
|
useEffect(function () {
|
10044
9590
|
if (window.tinymce) {
|
10045
9591
|
window.tinymce = tinymce;
|
@@ -10049,23 +9595,17 @@ var MathTinyEditor = function MathTinyEditor(_ref) {
|
|
10049
9595
|
return htmlString.replace(/\s(mathcolor|mathsize|mathvariant|mathvariant|color|fontsize|style)="[^"]*"/g, "");
|
10050
9596
|
};
|
10051
9597
|
var handleChange = function handleChange(value, _) {
|
10052
|
-
if (isFirstChange.current) {
|
10053
|
-
isFirstChange.current = false;
|
10054
|
-
return;
|
10055
|
-
}
|
10056
9598
|
var textFilter = removeMathAttributes(value);
|
10057
9599
|
onChange(textFilter);
|
10058
9600
|
};
|
10059
9601
|
var options = {
|
10060
|
-
height:
|
10061
|
-
statusbar: false,
|
9602
|
+
height: 130,
|
10062
9603
|
menubar: false,
|
10063
9604
|
external_plugins: {
|
10064
9605
|
tiny_mce_wiris: '/editor/wiris-for-tinymce.js'
|
10065
9606
|
},
|
10066
9607
|
toolbar: "tiny_mce_wiris_formulaEditor tiny_mce_wiris_formulaEditorChemistry",
|
10067
9608
|
branding: false,
|
10068
|
-
resize: false,
|
10069
9609
|
extended_valid_elements: '*[.*]'
|
10070
9610
|
};
|
10071
9611
|
return React__default.createElement(Editor, {
|
@@ -11589,10 +11129,10 @@ var LoginQRCode = function LoginQRCode(props) {
|
|
11589
11129
|
}));
|
11590
11130
|
};
|
11591
11131
|
|
11592
|
-
var _excluded$
|
11132
|
+
var _excluded$5 = ["history"];
|
11593
11133
|
var Login = function Login(_ref) {
|
11594
11134
|
var history = _ref.history,
|
11595
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
11135
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$5);
|
11596
11136
|
var _useLogin = useLogin$1({
|
11597
11137
|
homeAcademyUrl: rest.homeAcademyUrl,
|
11598
11138
|
homeUrl: rest.homeUrl,
|
@@ -12566,11 +12106,11 @@ var DEFAULT_USER_FILTERS = {
|
|
12566
12106
|
|
12567
12107
|
var styles$2 = {"avatar":"_2rJkZ","date-picker":"_1iqE2","time-picker":"_20xtc","teacher-selector-wrapper":"_3L1Oj"};
|
12568
12108
|
|
12569
|
-
var _excluded$
|
12109
|
+
var _excluded$6 = ["teachers", "value"];
|
12570
12110
|
var TeacherSelector = function TeacherSelector(_ref) {
|
12571
12111
|
var teachers = _ref.teachers,
|
12572
12112
|
value = _ref.value,
|
12573
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
12113
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$6);
|
12574
12114
|
var teacherOptions = teachers.map(function (i) {
|
12575
12115
|
return {
|
12576
12116
|
label: i.teacherName + "/" + i.teacherEmail,
|
@@ -13862,7 +13402,7 @@ var useTeacherList = function useTeacherList() {
|
|
13862
13402
|
};
|
13863
13403
|
};
|
13864
13404
|
|
13865
|
-
var _excluded$
|
13405
|
+
var _excluded$7 = ["getStudents"],
|
13866
13406
|
_excluded2 = ["getTeachers"],
|
13867
13407
|
_excluded3 = ["getLessons"];
|
13868
13408
|
var PAGE_TITLE$4 = "classes";
|
@@ -13913,7 +13453,7 @@ var useClassDetail = function useClassDetail(_ref) {
|
|
13913
13453
|
};
|
13914
13454
|
var _useStudentClassList = useStudentClassList(classId),
|
13915
13455
|
getStudents = _useStudentClassList.getStudents,
|
13916
|
-
studentListProps = _objectWithoutPropertiesLoose(_useStudentClassList, _excluded$
|
13456
|
+
studentListProps = _objectWithoutPropertiesLoose(_useStudentClassList, _excluded$7);
|
13917
13457
|
var _useTeacherClassList = useTeacherClassList(classId),
|
13918
13458
|
getTeachers = _useTeacherClassList.getTeachers,
|
13919
13459
|
teacherListProps = _objectWithoutPropertiesLoose(_useTeacherClassList, _excluded2);
|
@@ -14663,12 +14203,12 @@ var LessonList = function LessonList(_ref) {
|
|
14663
14203
|
}));
|
14664
14204
|
};
|
14665
14205
|
|
14666
|
-
var _excluded$
|
14206
|
+
var _excluded$8 = ["children", "value", "index"];
|
14667
14207
|
var CustomTabPanel = function CustomTabPanel(props) {
|
14668
14208
|
var children = props.children,
|
14669
14209
|
value = props.value,
|
14670
14210
|
index = props.index,
|
14671
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
14211
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$8);
|
14672
14212
|
return React__default.createElement("div", Object.assign({
|
14673
14213
|
role: "tabpanel",
|
14674
14214
|
hidden: value !== index,
|
@@ -20038,7 +19578,9 @@ var useNotes = function useNotes(setFilter, filter) {
|
|
20038
19578
|
}
|
20039
19579
|
setLoadingNotes(true);
|
20040
19580
|
var _temp = _catch(function () {
|
20041
|
-
return Promise.resolve(getNotesApi(
|
19581
|
+
return Promise.resolve(getNotesApi(_extends({}, filter, {
|
19582
|
+
currentPage: -1
|
19583
|
+
}))).then(function (res) {
|
20042
19584
|
var data = res.data;
|
20043
19585
|
setTotalPages((data === null || data === void 0 ? void 0 : data.totalPages) || 0);
|
20044
19586
|
var items = (data === null || data === void 0 ? void 0 : data.items) || [];
|
@@ -20104,8 +19646,7 @@ var NoteItem = function NoteItem(_ref) {
|
|
20104
19646
|
_ref$placement = _ref.placement,
|
20105
19647
|
placement = _ref$placement === void 0 ? "bottom-end" : _ref$placement,
|
20106
19648
|
onClose = _ref.onClose,
|
20107
|
-
onOpen = _ref.onOpen
|
20108
|
-
onLoad = _ref.onLoad;
|
19649
|
+
onOpen = _ref.onOpen;
|
20109
19650
|
var _useTranslation = useTranslation(),
|
20110
19651
|
t = _useTranslation.t;
|
20111
19652
|
var handleMoreClick = function handleMoreClick(e) {
|
@@ -20113,9 +19654,6 @@ var NoteItem = function NoteItem(_ref) {
|
|
20113
19654
|
e.stopPropagation();
|
20114
19655
|
onOpen(data);
|
20115
19656
|
};
|
20116
|
-
useEffect(function () {
|
20117
|
-
onLoad === null || onLoad === void 0 ? void 0 : onLoad();
|
20118
|
-
}, []);
|
20119
19657
|
return React__default.createElement(Box, Object.assign({}, NoteItemStyles.root), React__default.createElement(Stack, {
|
20120
19658
|
direction: "row",
|
20121
19659
|
gap: 1,
|
@@ -20163,7 +19701,7 @@ var NotesContainer = function NotesContainer(_ref) {
|
|
20163
19701
|
itemActions = _ref.itemActions,
|
20164
19702
|
noteIdContextMenu = _ref.noteIdContextMenu,
|
20165
19703
|
containerListProps = _ref.containerListProps;
|
20166
|
-
var renderItem = function renderItem(item, _
|
19704
|
+
var renderItem = function renderItem(item, _) {
|
20167
19705
|
var isSelected = noteIdContextMenu === item.id;
|
20168
19706
|
return React__default.createElement(Box, {
|
20169
19707
|
key: item.id,
|
@@ -20174,8 +19712,7 @@ var NotesContainer = function NotesContainer(_ref) {
|
|
20174
19712
|
openTooltip: isSelected,
|
20175
19713
|
actions: itemActions,
|
20176
19714
|
onOpen: onOpenTooltip,
|
20177
|
-
onClose: onCloseTooltip
|
20178
|
-
onLoad: measure
|
19715
|
+
onClose: onCloseTooltip
|
20179
19716
|
}));
|
20180
19717
|
};
|
20181
19718
|
return React__default.createElement(VirtualListView, {
|
@@ -22013,14 +21550,14 @@ var CSV_PREFIX = "data:text/csv;charset=utf-8,";
|
|
22013
21550
|
|
22014
21551
|
var styles$5 = {"action-btn":"_1jXbz","action-btn--pencil":"_at4xP","icon-rotate-180":"_12gv9","drop-area":"_R4bn5"};
|
22015
21552
|
|
22016
|
-
var _excluded$
|
21553
|
+
var _excluded$9 = ["text", "isRequired", "className"];
|
22017
21554
|
var LabelRequired = function LabelRequired(_ref) {
|
22018
21555
|
var text = _ref.text,
|
22019
21556
|
_ref$isRequired = _ref.isRequired,
|
22020
21557
|
isRequired = _ref$isRequired === void 0 ? true : _ref$isRequired,
|
22021
21558
|
_ref$className = _ref.className,
|
22022
21559
|
className = _ref$className === void 0 ? "" : _ref$className,
|
22023
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
21560
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$9);
|
22024
21561
|
return React__default.createElement(FormLabel, Object.assign({
|
22025
21562
|
className: "fw-medium mb-1 " + className
|
22026
21563
|
}, rest), text, isRequired && React__default.createElement("span", {
|
@@ -22074,7 +21611,7 @@ var deleteUserApi = function deleteUserApi(id) {
|
|
22074
21611
|
return api["delete"](USER_URL + "/delete/" + id);
|
22075
21612
|
};
|
22076
21613
|
|
22077
|
-
var _excluded$
|
21614
|
+
var _excluded$a = ["ref"],
|
22078
21615
|
_excluded2$1 = ["ref"],
|
22079
21616
|
_excluded3$1 = ["ref"],
|
22080
21617
|
_excluded4 = ["ref"],
|
@@ -22104,7 +21641,7 @@ var UserDialog = function UserDialog(_ref) {
|
|
22104
21641
|
t = _useTranslation.t;
|
22105
21642
|
var _register = register("fullName"),
|
22106
21643
|
fullNameRef = _register.ref,
|
22107
|
-
fullNameBio = _objectWithoutPropertiesLoose(_register, _excluded$
|
21644
|
+
fullNameBio = _objectWithoutPropertiesLoose(_register, _excluded$a);
|
22108
21645
|
var _register2 = register("email"),
|
22109
21646
|
emailRef = _register2.ref,
|
22110
21647
|
emailBio = _objectWithoutPropertiesLoose(_register2, _excluded2$1);
|
@@ -22149,11 +21686,24 @@ var UserDialog = function UserDialog(_ref) {
|
|
22149
21686
|
setDefaultPassCodeChanged = _useState8[1];
|
22150
21687
|
var theme = useTheme();
|
22151
21688
|
var gradeOptions = useMemo(function () {
|
22152
|
-
|
21689
|
+
var _watch;
|
21690
|
+
var schoolName = (_watch = watch("schoolName")) === null || _watch === void 0 ? void 0 : _watch.trim();
|
21691
|
+
if (schoolName !== null && schoolName !== void 0 && schoolName.includes(t("middle_school")) || schoolName !== null && schoolName !== void 0 && schoolName.includes("중학교")) return MIDDLE_GRADES.map(function (i) {
|
22153
21692
|
return _extends({}, i, {
|
22154
21693
|
label: typeof i.label === "string" ? t(i.label) : i.label
|
22155
21694
|
});
|
22156
|
-
})
|
21695
|
+
});
|
21696
|
+
if (schoolName !== null && schoolName !== void 0 && schoolName.includes(t("high_school")) || schoolName !== null && schoolName !== void 0 && schoolName.includes("고등학교")) return HIGH_GRADES.map(function (i) {
|
21697
|
+
return _extends({}, i, {
|
21698
|
+
label: t(i.label)
|
21699
|
+
});
|
21700
|
+
});
|
21701
|
+
if (schoolName !== null && schoolName !== void 0 && schoolName.includes(t("elementary_school")) || schoolName !== null && schoolName !== void 0 && schoolName.includes("초등학교")) return ELEMENTARY_GRADES.map(function (i) {
|
21702
|
+
return _extends({}, i, {
|
21703
|
+
label: typeof i.label === "string" ? t(i.label) : i.label
|
21704
|
+
});
|
21705
|
+
});
|
21706
|
+
return [];
|
22157
21707
|
}, [t, watch("schoolName")]);
|
22158
21708
|
var handleChangeRole = function handleChangeRole(role) {
|
22159
21709
|
setRoles([role]);
|
@@ -26082,12 +25632,12 @@ var ArticleDialog = function ArticleDialog(_ref) {
|
|
26082
25632
|
|
26083
25633
|
var styles$7 = {"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"};
|
26084
25634
|
|
26085
|
-
var _excluded$
|
25635
|
+
var _excluded$b = ["isOpen", "onClose", "handleSaveExam"];
|
26086
25636
|
var CreateExamDrawer = function CreateExamDrawer(props) {
|
26087
25637
|
var isOpen = props.isOpen,
|
26088
25638
|
onClose = props.onClose,
|
26089
25639
|
handleSaveExam = props.handleSaveExam,
|
26090
|
-
examDetailViewProps = _objectWithoutPropertiesLoose(props, _excluded$
|
25640
|
+
examDetailViewProps = _objectWithoutPropertiesLoose(props, _excluded$b);
|
26091
25641
|
var _useTranslation = useTranslation(),
|
26092
25642
|
t = _useTranslation.t;
|
26093
25643
|
var theme = useTheme();
|
@@ -26335,11 +25885,9 @@ var TextbookViewDetail = function TextbookViewDetail(props) {
|
|
26335
25885
|
|
26336
25886
|
var PAGE_TITLE$7 = "textbooks";
|
26337
25887
|
var useTextbookList = function useTextbookList(props) {
|
26338
|
-
var _user$roles, _user$roles2;
|
26339
25888
|
var onNavigateCreate = props.onNavigateCreate,
|
26340
25889
|
onNavigateDetail = props.onNavigateDetail,
|
26341
|
-
isSuperAdmin = props.isSuperAdmin
|
26342
|
-
role = props.role;
|
25890
|
+
isSuperAdmin = props.isSuperAdmin;
|
26343
25891
|
var _useList = useList(function (search) {
|
26344
25892
|
return getTextbookListApi(search, isSuperAdmin);
|
26345
25893
|
}, TextbookDefaultQuery),
|
@@ -26354,21 +25902,14 @@ var useTextbookList = function useTextbookList(props) {
|
|
26354
25902
|
calcOrderNumber = _useList.calcOrderNumber,
|
26355
25903
|
handleChangeSelectedItem = _useList.handleChangeSelectedItem,
|
26356
25904
|
getData = _useList.getData;
|
26357
|
-
var user = useSelector(function (state) {
|
26358
|
-
var _state$common;
|
26359
|
-
return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.user;
|
26360
|
-
});
|
26361
|
-
var isTeacherSite = role === Role.Teacher;
|
26362
|
-
var isAdmin = !!user && ((_user$roles = user.roles) === null || _user$roles === void 0 ? void 0 : _user$roles.includes(Role.Admin));
|
26363
|
-
var isTeacher = !!user && ((_user$roles2 = user.roles) === null || _user$roles2 === void 0 ? void 0 : _user$roles2.includes(Role.Teacher)) && !isAdmin;
|
26364
25905
|
var _useTranslation = useTranslation(),
|
26365
25906
|
t = _useTranslation.t;
|
26366
25907
|
var dispatch = useDispatch();
|
26367
25908
|
var handleViewTextbook = function handleViewTextbook(data) {
|
26368
|
-
onNavigateDetail(data, true,
|
25909
|
+
onNavigateDetail(data, true, true);
|
26369
25910
|
};
|
26370
25911
|
var handleUpdateTextbook = function handleUpdateTextbook(data) {
|
26371
|
-
onNavigateDetail(data, false,
|
25912
|
+
onNavigateDetail(data, false, true);
|
26372
25913
|
};
|
26373
25914
|
var handleCreateTextbook = function handleCreateTextbook() {
|
26374
25915
|
onNavigateCreate === null || onNavigateCreate === void 0 ? void 0 : onNavigateCreate();
|
@@ -26404,9 +25945,6 @@ var useTextbookList = function useTextbookList(props) {
|
|
26404
25945
|
document.title = t("study_peak") + " | " + t(PAGE_TITLE$7);
|
26405
25946
|
}, [t]);
|
26406
25947
|
return {
|
26407
|
-
user: user,
|
26408
|
-
isTeacherSite: isTeacherSite,
|
26409
|
-
isTeacher: isTeacher,
|
26410
25948
|
filter: filter,
|
26411
25949
|
textSearchRef: textSearchRef,
|
26412
25950
|
getData: getData,
|
@@ -26645,6 +26183,8 @@ var useTextbookShare = function useTextbookShare(props) {
|
|
26645
26183
|
});
|
26646
26184
|
var isAdmin = infoUser && (infoUser === null || infoUser === void 0 ? void 0 : (_infoUser$roles = infoUser.roles) === null || _infoUser$roles === void 0 ? void 0 : _infoUser$roles.includes(Role.Admin));
|
26647
26185
|
var isAdminSite = role === Role.Admin;
|
26186
|
+
var onAcademy = !!infoUser.academyDomain;
|
26187
|
+
var isSuperAdminUser = infoUser && infoUser.isSuperAdmin;
|
26648
26188
|
useEffect(function () {
|
26649
26189
|
if (!isUpdate) {
|
26650
26190
|
filterTeacherNotShared(currentModel);
|
@@ -26735,6 +26275,12 @@ var useTextbookShare = function useTextbookShare(props) {
|
|
26735
26275
|
});
|
26736
26276
|
setShared(existsTeachers);
|
26737
26277
|
};
|
26278
|
+
var enabledSave = function enabledSave(textbook) {
|
26279
|
+
return onAcademy && (isAdminSite || isSuperAdmin || isSuperAdminUser || !isAdmin && textbook.isShared && textbook.createdBy.id === infoUser.id);
|
26280
|
+
};
|
26281
|
+
var enabledShare = function enabledShare(textbook) {
|
26282
|
+
return textbook.isShared && onAcademy && (isAdminSite || isSuperAdminUser || !isAdmin && textbook.createdBy.id === infoUser.id);
|
26283
|
+
};
|
26738
26284
|
var handleShareTextbook = function handleShareTextbook(teacherIds, textbookId) {
|
26739
26285
|
try {
|
26740
26286
|
var _temp2 = function _temp2() {
|
@@ -26811,117 +26357,19 @@ var useTextbookShare = function useTextbookShare(props) {
|
|
26811
26357
|
isUpdate: isUpdate,
|
26812
26358
|
handleUpdateSharedTextbook: handleUpdateSharedTextbook,
|
26813
26359
|
currentModel: currentModel,
|
26360
|
+
enabledSave: enabledSave,
|
26361
|
+
enabledShare: enabledShare,
|
26814
26362
|
isAdmin: isAdmin,
|
26815
26363
|
isAdminSite: isAdminSite
|
26816
26364
|
};
|
26817
26365
|
};
|
26818
26366
|
|
26819
|
-
var TextbookRow = function TextbookRow(_ref) {
|
26820
|
-
var _infoUser$roles, _infoUser$roles2, _data$createdBy, _data$textbookOwners, _data$createdBy2, _data$createdBy3;
|
26821
|
-
var index = _ref.index,
|
26822
|
-
data = _ref.data,
|
26823
|
-
role = _ref.role,
|
26824
|
-
isSuperAdmin = _ref.isSuperAdmin,
|
26825
|
-
calcOrderNumber = _ref.calcOrderNumber,
|
26826
|
-
onUpdateTextbook = _ref.onUpdateTextbook,
|
26827
|
-
onDeleteTextbook = _ref.onDeleteTextbook,
|
26828
|
-
onViewTextbook = _ref.onViewTextbook,
|
26829
|
-
onShareTextbook = _ref.onShareTextbook,
|
26830
|
-
onUpdateShareTextbook = _ref.onUpdateShareTextbook;
|
26831
|
-
var infoUser = useSelector(function (state) {
|
26832
|
-
var _state$common;
|
26833
|
-
return (state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.user) || {};
|
26834
|
-
});
|
26835
|
-
var isAdmin = infoUser && (infoUser === null || infoUser === void 0 ? void 0 : (_infoUser$roles = infoUser.roles) === null || _infoUser$roles === void 0 ? void 0 : _infoUser$roles.includes(Role.Admin));
|
26836
|
-
var isTeacherSite = role === Role.Teacher;
|
26837
|
-
var isTeacher = !!infoUser && ((_infoUser$roles2 = infoUser.roles) === null || _infoUser$roles2 === void 0 ? void 0 : _infoUser$roles2.includes(Role.Teacher)) && !isAdmin;
|
26838
|
-
var isAdminSite = role === Role.Admin;
|
26839
|
-
var onAcademy = !!infoUser.academyDomain;
|
26840
|
-
var isSuperAdminUser = infoUser && infoUser.isSuperAdmin;
|
26841
|
-
var academy = useSelector(function (state) {
|
26842
|
-
var _state$common2;
|
26843
|
-
return state === null || state === void 0 ? void 0 : (_state$common2 = state.common) === null || _state$common2 === void 0 ? void 0 : _state$common2.academy;
|
26844
|
-
});
|
26845
|
-
var _useTranslation = useTranslation(),
|
26846
|
-
t = _useTranslation.t;
|
26847
|
-
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) {
|
26848
|
-
var _infoUser$email, _infoUser$email$trim;
|
26849
|
-
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);
|
26850
|
-
})));
|
26851
|
-
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);
|
26852
|
-
var isSharable = !data.isPublic && data.isShared && onAcademy && (isAdminSite || isSuperAdminUser || !isAdmin && data.createdBy.id === infoUser.id);
|
26853
|
-
var handleUpdateTextbook = function handleUpdateTextbook() {
|
26854
|
-
onUpdateTextbook(data);
|
26855
|
-
};
|
26856
|
-
var handleDeleteTextbook = function handleDeleteTextbook() {
|
26857
|
-
onDeleteTextbook(data);
|
26858
|
-
};
|
26859
|
-
var handleViewTextbook = function handleViewTextbook() {
|
26860
|
-
onViewTextbook(data);
|
26861
|
-
};
|
26862
|
-
var handleShareTextbook = function handleShareTextbook() {
|
26863
|
-
onShareTextbook(data);
|
26864
|
-
};
|
26865
|
-
var handleUpdateShareTextbook = function handleUpdateShareTextbook() {
|
26866
|
-
onUpdateShareTextbook(data);
|
26867
|
-
};
|
26868
|
-
return React__default.createElement(TableRow, {
|
26869
|
-
key: data.id
|
26870
|
-
}, React__default.createElement(TableCell, null, calcOrderNumber(index)), React__default.createElement(TableCell, null, data.name), React__default.createElement(TableCell, null, data.subject.name), React__default.createElement(TableCell, null, utcToLocalTime(data.createdAt, t("date_format"))), React__default.createElement(TableCell, null, data.totalChapters), isTeacher && isTeacherSite && React__default.createElement(TableCell, null, (infoUser === null || infoUser === void 0 ? void 0 : infoUser.id) === ((_data$createdBy3 = data.createdBy) === null || _data$createdBy3 === void 0 ? void 0 : _data$createdBy3.id) && data.isShared && React__default.createElement(FaCheckCircle, {
|
26871
|
-
color: green[700]
|
26872
|
-
})), React__default.createElement(TableCell, null, !data.isPublic && data.sharedUsers.map(function (email, index) {
|
26873
|
-
return index > 2 ? null : index === 2 ? React__default.createElement("div", null, "(+", data.sharedUsers.length - 2, ")") : React__default.createElement("div", {
|
26874
|
-
key: index
|
26875
|
-
}, email.toLowerCase());
|
26876
|
-
})), React__default.createElement(TableCell, null, React__default.createElement(Stack, {
|
26877
|
-
direction: "row",
|
26878
|
-
spacing: 1,
|
26879
|
-
alignItems: "center"
|
26880
|
-
}, React__default.createElement(IconButton, {
|
26881
|
-
color: "default",
|
26882
|
-
className: (!isEditable ? "bg-secondary" : "bg-warning") + " text-white",
|
26883
|
-
onClick: handleUpdateTextbook,
|
26884
|
-
disabled: !isEditable
|
26885
|
-
}, React__default.createElement(FaPencil, {
|
26886
|
-
size: 12
|
26887
|
-
})), React__default.createElement(IconButton, {
|
26888
|
-
color: "default",
|
26889
|
-
className: "bg-primary text-white",
|
26890
|
-
onClick: handleViewTextbook
|
26891
|
-
}, React__default.createElement(FaEye$1, {
|
26892
|
-
size: 12
|
26893
|
-
})), React__default.createElement(IconButton, {
|
26894
|
-
disabled: !isSharable,
|
26895
|
-
className: (!isSharable ? "bg-secondary" : "bg-info") + " text-white me-1",
|
26896
|
-
onClick: handleShareTextbook
|
26897
|
-
}, React__default.createElement(FaShare, {
|
26898
|
-
size: 12
|
26899
|
-
})), React__default.createElement(IconButton, {
|
26900
|
-
disabled: !isSharable,
|
26901
|
-
className: (!isSharable ? "bg-secondary" : "bg-success") + " text-white me-1",
|
26902
|
-
onClick: handleUpdateShareTextbook
|
26903
|
-
}, React__default.createElement(FaExchangeAlt, {
|
26904
|
-
size: 12
|
26905
|
-
})), React__default.createElement(IconButton, {
|
26906
|
-
color: "default",
|
26907
|
-
className: (!isDeleteAble ? "bg-secondary" : "bg-danger") + " text-white mr-1",
|
26908
|
-
onClick: handleDeleteTextbook,
|
26909
|
-
disabled: !isDeleteAble
|
26910
|
-
}, React__default.createElement(FaTrash, {
|
26911
|
-
size: 12
|
26912
|
-
})))));
|
26913
|
-
};
|
26914
|
-
|
26915
26367
|
var TextbookList = function TextbookList(props) {
|
26916
26368
|
var _props$createable = props.createable,
|
26917
|
-
createable = _props$createable === void 0 ? true : _props$createable
|
26918
|
-
isSuperAdmin = props.isSuperAdmin,
|
26919
|
-
role = props.role;
|
26369
|
+
createable = _props$createable === void 0 ? true : _props$createable;
|
26920
26370
|
var _useTranslation = useTranslation(),
|
26921
26371
|
t = _useTranslation.t;
|
26922
26372
|
var _useTextbookList = useTextbookList(props),
|
26923
|
-
isTeacherSite = _useTextbookList.isTeacherSite,
|
26924
|
-
isTeacher = _useTextbookList.isTeacher,
|
26925
26373
|
filter = _useTextbookList.filter,
|
26926
26374
|
textbooks = _useTextbookList.textbooks,
|
26927
26375
|
paging = _useTextbookList.paging,
|
@@ -26963,14 +26411,9 @@ var TextbookList = function TextbookList(props) {
|
|
26963
26411
|
handleOpenUpdateShareDialog = _useTextbookShare.handleOpenUpdateShareDialog,
|
26964
26412
|
isUpdate = _useTextbookShare.isUpdate,
|
26965
26413
|
handleUpdateSharedTextbook = _useTextbookShare.handleUpdateSharedTextbook,
|
26966
|
-
currentModel = _useTextbookShare.currentModel
|
26967
|
-
|
26968
|
-
|
26969
|
-
if (isTeacher && isTeacherSite) headers.splice(5, 0, {
|
26970
|
-
title: "teacher_personal_textbook"
|
26971
|
-
});
|
26972
|
-
return headers;
|
26973
|
-
}, [isTeacher, isTeacherSite]);
|
26414
|
+
currentModel = _useTextbookShare.currentModel,
|
26415
|
+
enabledSave = _useTextbookShare.enabledSave,
|
26416
|
+
enabledShare = _useTextbookShare.enabledShare;
|
26974
26417
|
return React__default.createElement(LayoutList, {
|
26975
26418
|
title: t(TEXTBOOK_PAGE_TITLE)
|
26976
26419
|
}, React__default.createElement(Grid, {
|
@@ -27005,26 +26448,63 @@ var TextbookList = function TextbookList(props) {
|
|
27005
26448
|
xs: 12,
|
27006
26449
|
className: "mt-3"
|
27007
26450
|
}, React__default.createElement(Table, null, React__default.createElement(TableHeader, {
|
27008
|
-
headerTemplates:
|
26451
|
+
headerTemplates: TEXTBOOK_HEADERS,
|
27009
26452
|
filter: filter,
|
27010
26453
|
onSort: handleSort
|
27011
|
-
}), React__default.createElement(TableBody, null,
|
27012
|
-
|
27013
|
-
|
27014
|
-
|
27015
|
-
|
27016
|
-
|
27017
|
-
|
27018
|
-
|
27019
|
-
|
27020
|
-
|
27021
|
-
|
27022
|
-
|
27023
|
-
|
27024
|
-
|
27025
|
-
|
27026
|
-
|
27027
|
-
|
26454
|
+
}), React__default.createElement(TableBody, null, textbooks.map(function (i, index) {
|
26455
|
+
return React__default.createElement(TableRow, {
|
26456
|
+
key: i.id
|
26457
|
+
}, React__default.createElement(TableCell, null, calcOrderNumber(index)), React__default.createElement(TableCell, null, i.name), React__default.createElement(TableCell, null, i.subject.name), React__default.createElement(TableCell, null, utcToLocalTime(i.createdAt, t("date_format"))), React__default.createElement(TableCell, null, i.totalChapters), React__default.createElement(TableCell, null, i.sharedUsers.map(function (email, index) {
|
26458
|
+
return index > 2 ? null : index === 2 ? React__default.createElement("div", null, "(+", i.sharedUsers.length - 2, ")") : React__default.createElement("div", {
|
26459
|
+
key: index
|
26460
|
+
}, email.toLowerCase());
|
26461
|
+
})), React__default.createElement(TableCell, null, React__default.createElement(Stack, {
|
26462
|
+
direction: "row",
|
26463
|
+
spacing: 1,
|
26464
|
+
alignItems: "center"
|
26465
|
+
}, React__default.createElement(IconButton, {
|
26466
|
+
color: "default",
|
26467
|
+
className: (!enabledSave(i) ? "bg-secondary" : "bg-warning") + " text-white",
|
26468
|
+
onClick: function onClick() {
|
26469
|
+
return handleUpdateTextbook(i);
|
26470
|
+
},
|
26471
|
+
disabled: !enabledSave(i)
|
26472
|
+
}, React__default.createElement(FaPencil, {
|
26473
|
+
size: 12
|
26474
|
+
})), React__default.createElement(IconButton, {
|
26475
|
+
color: "default",
|
26476
|
+
className: "bg-primary text-white",
|
26477
|
+
onClick: function onClick() {
|
26478
|
+
return handleViewTextbook(i);
|
26479
|
+
}
|
26480
|
+
}, React__default.createElement(FaEye$1, {
|
26481
|
+
size: 12
|
26482
|
+
})), React__default.createElement(IconButton, {
|
26483
|
+
disabled: !enabledShare(i),
|
26484
|
+
className: (!enabledShare(i) ? "bg-secondary" : "bg-info") + " text-white me-1",
|
26485
|
+
onClick: function onClick() {
|
26486
|
+
return handleOpenShareDialog(i);
|
26487
|
+
}
|
26488
|
+
}, React__default.createElement(FaShare, {
|
26489
|
+
size: 12
|
26490
|
+
})), React__default.createElement(IconButton, {
|
26491
|
+
disabled: !enabledShare(i),
|
26492
|
+
className: (!enabledShare(i) ? "bg-secondary" : "bg-success") + " text-white me-1",
|
26493
|
+
onClick: function onClick() {
|
26494
|
+
return handleOpenUpdateShareDialog(i);
|
26495
|
+
}
|
26496
|
+
}, React__default.createElement(FaExchangeAlt, {
|
26497
|
+
size: 12
|
26498
|
+
})), React__default.createElement(IconButton, {
|
26499
|
+
color: "default",
|
26500
|
+
className: (!enabledSave(i) ? "bg-secondary" : "bg-danger") + " text-white mr-1",
|
26501
|
+
onClick: function onClick() {
|
26502
|
+
return handleSelectDeleteTextbook(i);
|
26503
|
+
},
|
26504
|
+
disabled: !enabledSave(i)
|
26505
|
+
}, React__default.createElement(FaTrash, {
|
26506
|
+
size: 12
|
26507
|
+
})))));
|
27028
26508
|
}), !textbooks.length && React__default.createElement(EmptyRow, null))), React__default.createElement("div", {
|
27029
26509
|
className: "d-flex justify-content-end mt-3"
|
27030
26510
|
}, !!paging.totalPages && React__default.createElement(Pagination, {
|
@@ -27222,12 +26702,12 @@ var useNotificationDetail = function useNotificationDetail(_ref) {
|
|
27222
26702
|
|
27223
26703
|
var styles$8 = {"avatar":"_8niRT"};
|
27224
26704
|
|
27225
|
-
var _excluded$
|
26705
|
+
var _excluded$c = ["value", "disabled", "optionTypeNotification"];
|
27226
26706
|
var TypeSelector = function TypeSelector(_ref) {
|
27227
26707
|
var value = _ref.value,
|
27228
26708
|
disabled = _ref.disabled,
|
27229
26709
|
optionTypeNotification = _ref.optionTypeNotification,
|
27230
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
26710
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$c);
|
27231
26711
|
return React__default.createElement(CustomAsyncSelect, Object.assign({
|
27232
26712
|
options: optionTypeNotification,
|
27233
26713
|
value: value
|
@@ -27619,11 +27099,11 @@ var useNotificationList = function useNotificationList(_ref) {
|
|
27619
27099
|
};
|
27620
27100
|
};
|
27621
27101
|
|
27622
|
-
var _excluded$
|
27102
|
+
var _excluded$d = ["value", "optionTypeNotification"];
|
27623
27103
|
var SelectFilterType = function SelectFilterType(_ref) {
|
27624
27104
|
var value = _ref.value,
|
27625
27105
|
optionTypeNotification = _ref.optionTypeNotification,
|
27626
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
27106
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$d);
|
27627
27107
|
return React__default.createElement(CustomAsyncSelect, Object.assign({
|
27628
27108
|
options: optionTypeNotification,
|
27629
27109
|
value: value
|
@@ -27677,8 +27157,7 @@ var NotificationList = function NotificationList(_ref) {
|
|
27677
27157
|
startIcon: React__default.createElement(FaPlus, {
|
27678
27158
|
size: 12
|
27679
27159
|
}),
|
27680
|
-
onClick: handleCreateNotification
|
27681
|
-
disabled: !isAdmin && isTeacherAdmin
|
27160
|
+
onClick: handleCreateNotification
|
27682
27161
|
}, t("new_notification"))), React__default.createElement(Grid, {
|
27683
27162
|
container: true
|
27684
27163
|
}, React__default.createElement(Grid, {
|
@@ -27783,6 +27262,7 @@ var NotificationList = function NotificationList(_ref) {
|
|
27783
27262
|
};
|
27784
27263
|
|
27785
27264
|
var TEXTBOOK_URL$1 = BASE_URL + "/api/textbooks";
|
27265
|
+
var SUPER_ADMIN_TEXTBOOK_URL = SUPER_ADMIN_BASE_URL + "/api/textbook";
|
27786
27266
|
var PREPARED_TEXTBOOK_URL = BASE_URL + "/api/textbooks/prepared-textbooks";
|
27787
27267
|
var SUPER_ADMIN_PREPARED_TEXTBOOK_URL = SUPER_ADMIN_BASE_URL + "/api/textbook/prepared-textbooks";
|
27788
27268
|
var FILE_URL = BASE_URL + "/api/file/images";
|
@@ -27804,11 +27284,10 @@ var createTextbookApi$1 = function createTextbookApi(values, isAdmin) {
|
|
27804
27284
|
var updateTextbookApi$1 = function updateTextbookApi(values, id, isAdmin) {
|
27805
27285
|
return api.put((isAdmin ? SUPER_ADMIN_PREPARED_TEXTBOOK_URL : PREPARED_TEXTBOOK_URL) + "/" + id, values);
|
27806
27286
|
};
|
27807
|
-
var
|
27808
|
-
return api.get(TEXTBOOK_URL$1 + "/
|
27287
|
+
var getAcademyByTeacher = function getAcademyByTeacher(email, isAdmin) {
|
27288
|
+
return api.get((isAdmin ? SUPER_ADMIN_TEXTBOOK_URL : TEXTBOOK_URL$1) + "/academy-teacher-owner", {
|
27809
27289
|
params: {
|
27810
|
-
email: email
|
27811
|
-
academyId: academyId
|
27290
|
+
email: email
|
27812
27291
|
}
|
27813
27292
|
});
|
27814
27293
|
};
|
@@ -27817,9 +27296,8 @@ var deleteTextbookApi$1 = function deleteTextbookApi(textbookId, isAdmin) {
|
|
27817
27296
|
};
|
27818
27297
|
|
27819
27298
|
var useTextbookManagement = function useTextbookManagement(_ref) {
|
27820
|
-
var _user$roles
|
27299
|
+
var _user$roles;
|
27821
27300
|
var textbookId = _ref.textbookId,
|
27822
|
-
role = _ref.role,
|
27823
27301
|
onNavigateList = _ref.onNavigateList;
|
27824
27302
|
var _useTranslation = useTranslation(),
|
27825
27303
|
t = _useTranslation.t;
|
@@ -27836,28 +27314,13 @@ var useTextbookManagement = function useTextbookManagement(_ref) {
|
|
27836
27314
|
var _useState4 = useState(false),
|
27837
27315
|
selectedChapter = _useState4[0],
|
27838
27316
|
setSelectedChapter = _useState4[1];
|
27839
|
-
var searchParams = new URLSearchParams(location.search);
|
27840
|
-
var isReadonly = searchParams.get('readonly') === "true";
|
27841
27317
|
var dispatch = useDispatch();
|
27842
27318
|
var user = useSelector(function (state) {
|
27843
27319
|
var _state$common;
|
27844
27320
|
return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.user;
|
27845
27321
|
});
|
27846
|
-
var
|
27847
|
-
var _state$common2;
|
27848
|
-
return state === null || state === void 0 ? void 0 : (_state$common2 = state.common) === null || _state$common2 === void 0 ? void 0 : _state$common2.academy;
|
27849
|
-
});
|
27850
|
-
var isAdmin = user && (user === null || user === void 0 ? void 0 : (_user$roles = user.roles) === null || _user$roles === void 0 ? void 0 : _user$roles.includes(Role.Admin));
|
27851
|
-
var isTeacher = user && (user === null || user === void 0 ? void 0 : (_user$roles2 = user.roles) === null || _user$roles2 === void 0 ? void 0 : _user$roles2.includes(Role.Teacher)) && !isAdmin;
|
27322
|
+
var isAdmin = user === null || user === void 0 ? void 0 : (_user$roles = user.roles) === null || _user$roles === void 0 ? void 0 : _user$roles.includes(Role.Admin);
|
27852
27323
|
var isSuperAdmin = !!user && !user.academyDomain;
|
27853
|
-
var isAdminSite = role === Role.Admin;
|
27854
|
-
var onAcademy = !!(user !== null && user !== void 0 && user.academyDomain);
|
27855
|
-
var isSuperAdminUser = !!user && user.isSuperAdmin;
|
27856
|
-
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) {
|
27857
|
-
var _user$email, _user$email$trim;
|
27858
|
-
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);
|
27859
|
-
}));
|
27860
|
-
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);
|
27861
27324
|
var handleOpenConfirmDeleteChapterDialog = function handleOpenConfirmDeleteChapterDialog(chapter) {
|
27862
27325
|
setSelectedChapter(chapter);
|
27863
27326
|
};
|
@@ -27912,7 +27375,6 @@ var useTextbookManagement = function useTextbookManagement(_ref) {
|
|
27912
27375
|
var _temp3 = function _temp3() {
|
27913
27376
|
dispatch(setLoading(false));
|
27914
27377
|
};
|
27915
|
-
if (isReadonly || !isEditable) return Promise.resolve();
|
27916
27378
|
if (!coverImage && !(values !== null && values !== void 0 && values.coverImage)) {
|
27917
27379
|
toast.error(t("please_select_image_file"));
|
27918
27380
|
return Promise.resolve();
|
@@ -27964,16 +27426,11 @@ var useTextbookManagement = function useTextbookManagement(_ref) {
|
|
27964
27426
|
}, [textbookId]);
|
27965
27427
|
return {
|
27966
27428
|
t: t,
|
27967
|
-
isAdminSite: isAdminSite,
|
27968
|
-
disabledTextbookOwners: disabledTextbookOwners,
|
27969
|
-
isReadonly: isReadonly,
|
27970
|
-
isEditable: isEditable,
|
27971
27429
|
isAdmin: isAdmin,
|
27972
27430
|
theme: theme,
|
27973
27431
|
history: history,
|
27974
27432
|
coverImage: coverImage,
|
27975
27433
|
isSuperAdmin: isSuperAdmin,
|
27976
|
-
isSuperAdminUser: isSuperAdminUser,
|
27977
27434
|
openDialog: openDialog,
|
27978
27435
|
handleSubmit: handleSubmit,
|
27979
27436
|
selectedTextbook: selectedTextbook,
|
@@ -28004,12 +27461,6 @@ var HighSchoolGrade;
|
|
28004
27461
|
HighSchoolGrade[HighSchoolGrade["ProbabilityAndStatistics"] = 6] = "ProbabilityAndStatistics";
|
28005
27462
|
HighSchoolGrade[HighSchoolGrade["Geometry"] = 7] = "Geometry";
|
28006
27463
|
})(HighSchoolGrade || (HighSchoolGrade = {}));
|
28007
|
-
var TextbookEditorType;
|
28008
|
-
(function (TextbookEditorType) {
|
28009
|
-
TextbookEditorType[TextbookEditorType["Default"] = 0] = "Default";
|
28010
|
-
TextbookEditorType[TextbookEditorType["Korea"] = 1] = "Korea";
|
28011
|
-
TextbookEditorType[TextbookEditorType["Math"] = 2] = "Math";
|
28012
|
-
})(TextbookEditorType || (TextbookEditorType = {}));
|
28013
27464
|
|
28014
27465
|
var TextbookSortBy$1;
|
28015
27466
|
(function (TextbookSortBy) {
|
@@ -28039,7 +27490,7 @@ var TextbookState;
|
|
28039
27490
|
TextbookState[TextbookState["Article"] = 3] = "Article";
|
28040
27491
|
})(TextbookState || (TextbookState = {}));
|
28041
27492
|
|
28042
|
-
var SCHOOL_OPTIONS = [{
|
27493
|
+
var SCHOOL_OPTIONS$1 = [{
|
28043
27494
|
label: "all",
|
28044
27495
|
value: SchoolType$1.Default
|
28045
27496
|
}, {
|
@@ -28076,7 +27527,7 @@ var ELEMANTARY_GRADES = Array.from({
|
|
28076
27527
|
value: index
|
28077
27528
|
};
|
28078
27529
|
});
|
28079
|
-
var MIDDLE_GRADES = Array.from({
|
27530
|
+
var MIDDLE_GRADES$1 = Array.from({
|
28080
27531
|
length: 4
|
28081
27532
|
}, function (_, index) {
|
28082
27533
|
return {
|
@@ -28084,7 +27535,7 @@ var MIDDLE_GRADES = Array.from({
|
|
28084
27535
|
value: index
|
28085
27536
|
};
|
28086
27537
|
});
|
28087
|
-
var HIGH_GRADES = [{
|
27538
|
+
var HIGH_GRADES$1 = [{
|
28088
27539
|
label: "all",
|
28089
27540
|
value: HighSchoolGrade.Default
|
28090
27541
|
}, {
|
@@ -28147,13 +27598,8 @@ var preparedTextbookSchema = function preparedTextbookSchema(t) {
|
|
28147
27598
|
publicationDate: string().required(t("publication_date_required")),
|
28148
27599
|
publisher: string().required(t("publisher_required")),
|
28149
27600
|
isbn: string().required(t("isbn_required")),
|
28150
|
-
grade: number().required(t("grade_required")).
|
27601
|
+
grade: number().required(t("grade_required")).positive().integer().typeError(t("must_be_number")).min(1, t("min_is_1")).max(12, t("max_is_12")),
|
28151
27602
|
type: number(),
|
28152
|
-
textbookOwners: array().of(object().shape({
|
28153
|
-
email: string().trim().email(t("invalid_textbook_owner_email_address")).required(t("textbook_owner_email_is_required")),
|
28154
|
-
academyId: number().required(t("textbook_owner_academy_is_required")),
|
28155
|
-
courseId: number().required(t("textbook_owner_course_is_required"))
|
28156
|
-
})),
|
28157
27603
|
chapters: array().of(object().shape({
|
28158
27604
|
pageFrom: number().required(t("page_from_required")).integer().typeError(t("must_be_number")).min(1, t("min_is_1")),
|
28159
27605
|
pageTo: number().required(t("page_to_required")).integer().typeError(t("must_be_number")).test("is-greater", t("page_to_must_be_greater_than_or_equal_to_page_from"), function (value) {
|
@@ -28226,7 +27672,7 @@ var DEFAULT_TEXTBOOK_REQUEST = {
|
|
28226
27672
|
grade: "",
|
28227
27673
|
textbookOwners: [],
|
28228
27674
|
isPrepared: true,
|
28229
|
-
type:
|
27675
|
+
type: 0
|
28230
27676
|
};
|
28231
27677
|
var DEFAULT_CHAPTER = {
|
28232
27678
|
name: "",
|
@@ -28276,169 +27722,136 @@ var CustomTextbookTab = function CustomTextbookTab(props) {
|
|
28276
27722
|
}, children));
|
28277
27723
|
};
|
28278
27724
|
|
28279
|
-
var
|
28280
|
-
|
28281
|
-
|
28282
|
-
|
28283
|
-
|
28284
|
-
|
28285
|
-
|
28286
|
-
|
28287
|
-
|
28288
|
-
|
28289
|
-
|
28290
|
-
|
28291
|
-
}
|
28292
|
-
return values;
|
27725
|
+
var grey = {
|
27726
|
+
0: '#FFFFFF',
|
27727
|
+
50: "#FBFBF9",
|
27728
|
+
100: '#EAEAE5',
|
27729
|
+
200: '#F4F6F8',
|
27730
|
+
300: '#D0D0C8',
|
27731
|
+
400: '#C4CDD5',
|
27732
|
+
500: '#9A9A98',
|
27733
|
+
600: '#637381',
|
27734
|
+
700: '#5D5D5B',
|
27735
|
+
800: '#212B36',
|
27736
|
+
900: '#363634'
|
28293
27737
|
};
|
28294
|
-
var
|
28295
|
-
|
28296
|
-
|
28297
|
-
|
28298
|
-
|
28299
|
-
|
28300
|
-
|
28301
|
-
if (values.hasOwnProperty(key)) {
|
28302
|
-
if (key === "categories" || key === "categoryOptions") {
|
28303
|
-
values[key] = [];
|
28304
|
-
} else if (key === "questionType" || key === "questionTypeId") {
|
28305
|
-
values[key] = null;
|
28306
|
-
} else if (typeof values[key] === "object" && values[key] !== null) {
|
28307
|
-
_resetAllCategoriesAndQuestionTypesBySubject(values[key]);
|
28308
|
-
}
|
28309
|
-
}
|
28310
|
-
}
|
28311
|
-
return values;
|
27738
|
+
var green = {
|
27739
|
+
0: '#FFFFFF',
|
27740
|
+
100: '#F0FFF6',
|
27741
|
+
300: '#89F0B2',
|
27742
|
+
500: '#3DC674',
|
27743
|
+
700: '#349056',
|
27744
|
+
900: '#18442A'
|
28312
27745
|
};
|
28313
|
-
var
|
28314
|
-
|
28315
|
-
|
28316
|
-
|
28317
|
-
|
28318
|
-
|
28319
|
-
subject: selectedTextbook.subject ? {
|
28320
|
-
label: selectedTextbook.subject.name,
|
28321
|
-
value: selectedTextbook.subject.id
|
28322
|
-
} : null,
|
28323
|
-
preparedType: selectedTextbook.preparedType || 0,
|
28324
|
-
grade: selectedTextbook.grade || "1",
|
28325
|
-
publicationDate: (selectedTextbook === null || selectedTextbook === void 0 ? void 0 : selectedTextbook.publicationDate) || "",
|
28326
|
-
publisher: selectedTextbook.publisher || "",
|
28327
|
-
isbn: selectedTextbook.isbn || "",
|
28328
|
-
coverImage: selectedTextbook.coverImage || "",
|
28329
|
-
textbookOwners: selectedTextbook.textbookOwners.map(function (to) {
|
28330
|
-
return _extends({}, to, {
|
28331
|
-
academy: to.academy ? {
|
28332
|
-
label: to.academy.name,
|
28333
|
-
value: to.academy.id
|
28334
|
-
} : null,
|
28335
|
-
course: to.course ? {
|
28336
|
-
label: to.course.name,
|
28337
|
-
value: to.course.id
|
28338
|
-
} : null
|
28339
|
-
});
|
28340
|
-
}),
|
28341
|
-
isPublic: selectedTextbook.isPublic || false,
|
28342
|
-
isShared: selectedTextbook.isShared || false,
|
28343
|
-
isPrepared: true,
|
28344
|
-
type: selectedTextbook.type,
|
28345
|
-
chapters: selectedTextbook.chapters.map(function (c) {
|
28346
|
-
var _c$questionGroups;
|
28347
|
-
return {
|
28348
|
-
name: c.name,
|
28349
|
-
pageFrom: c.pageFrom || 0,
|
28350
|
-
pageTo: c.pageTo || 0,
|
28351
|
-
id: c.id,
|
28352
|
-
questionGroups: ((_c$questionGroups = c.questionGroups) === null || _c$questionGroups === void 0 ? void 0 : _c$questionGroups.map(function (g) {
|
28353
|
-
var _g$questions, _g$questions$find;
|
28354
|
-
return {
|
28355
|
-
id: g.id,
|
28356
|
-
chapterId: c.id,
|
28357
|
-
questions: g.questions.map(function (q) {
|
28358
|
-
var _q$questionType;
|
28359
|
-
return _extends({}, q, {
|
28360
|
-
questionTypeId: q.questionTypeId || q.questionType.id,
|
28361
|
-
questionType: (_q$questionType = q.questionType) !== null && _q$questionType !== void 0 && _q$questionType.id ? {
|
28362
|
-
label: q.questionType.name,
|
28363
|
-
value: q.questionType.id
|
28364
|
-
} : null
|
28365
|
-
});
|
28366
|
-
}),
|
28367
|
-
articles: g.articles.map(function (a) {
|
28368
|
-
return _extends({}, a, {
|
28369
|
-
categoryOptions: a.categories.map(function (cat) {
|
28370
|
-
return {
|
28371
|
-
label: cat.name,
|
28372
|
-
value: cat.id
|
28373
|
-
};
|
28374
|
-
}),
|
28375
|
-
categories: a.categories.filter(function (cat) {
|
28376
|
-
return !!cat.id;
|
28377
|
-
}).map(function (cat) {
|
28378
|
-
return cat.id;
|
28379
|
-
})
|
28380
|
-
});
|
28381
|
-
}),
|
28382
|
-
questionCount: g.questions.length,
|
28383
|
-
answerCount: ((_g$questions = g.questions) === null || _g$questions === void 0 ? void 0 : (_g$questions$find = _g$questions.find(function (q) {
|
28384
|
-
return q.questionAnswerType !== QuestionAnswerType.ShortAnswer;
|
28385
|
-
})) === null || _g$questions$find === void 0 ? void 0 : _g$questions$find.numberOfAnswers) || DEFAULT_ANSWER_COUNT$2
|
28386
|
-
};
|
28387
|
-
})) || [],
|
28388
|
-
subChapters: c.subChapters.map(function (sub) {
|
28389
|
-
var _sub$questionGroups;
|
28390
|
-
return {
|
28391
|
-
name: sub.name,
|
28392
|
-
pageFrom: sub.pageFrom || 0,
|
28393
|
-
pageTo: sub.pageTo || 0,
|
28394
|
-
id: sub.id,
|
28395
|
-
questionGroups: ((_sub$questionGroups = sub.questionGroups) === null || _sub$questionGroups === void 0 ? void 0 : _sub$questionGroups.map(function (g) {
|
28396
|
-
var _g$questions2, _g$questions2$find;
|
28397
|
-
return {
|
28398
|
-
id: g.id,
|
28399
|
-
chapterId: c.id,
|
28400
|
-
questions: g.questions.map(function (q) {
|
28401
|
-
var _q$questionType2;
|
28402
|
-
return _extends({}, q, {
|
28403
|
-
questionTypeId: q.questionTypeId || q.questionType.id,
|
28404
|
-
questionType: (_q$questionType2 = q.questionType) !== null && _q$questionType2 !== void 0 && _q$questionType2.id ? {
|
28405
|
-
label: q.questionType.name,
|
28406
|
-
value: q.questionType.id
|
28407
|
-
} : null
|
28408
|
-
});
|
28409
|
-
}),
|
28410
|
-
articles: g.articles.map(function (a) {
|
28411
|
-
return _extends({}, a, {
|
28412
|
-
categoryOptions: a.categories.map(function (cat) {
|
28413
|
-
return {
|
28414
|
-
label: cat.name,
|
28415
|
-
value: cat.id
|
28416
|
-
};
|
28417
|
-
}),
|
28418
|
-
categories: a.categories.filter(function (cat) {
|
28419
|
-
return !!cat.id;
|
28420
|
-
}).map(function (cat) {
|
28421
|
-
return cat.id;
|
28422
|
-
})
|
28423
|
-
});
|
28424
|
-
}),
|
28425
|
-
questionCount: g.questions.length,
|
28426
|
-
answerCount: ((_g$questions2 = g.questions) === null || _g$questions2 === void 0 ? void 0 : (_g$questions2$find = _g$questions2.find(function (q) {
|
28427
|
-
return q.questionAnswerType !== QuestionAnswerType.ShortAnswer;
|
28428
|
-
})) === null || _g$questions2$find === void 0 ? void 0 : _g$questions2$find.numberOfAnswers) || DEFAULT_ANSWER_COUNT$2
|
28429
|
-
};
|
28430
|
-
})) || [],
|
28431
|
-
subChapters: []
|
28432
|
-
};
|
28433
|
-
})
|
28434
|
-
};
|
28435
|
-
})
|
28436
|
-
};
|
27746
|
+
var main_theme = {
|
27747
|
+
lighter: green[100],
|
27748
|
+
light: green[300],
|
27749
|
+
less_dark: green[500],
|
27750
|
+
dark: green[700],
|
27751
|
+
darker: green[900]
|
28437
27752
|
};
|
28438
|
-
var
|
28439
|
-
|
28440
|
-
|
28441
|
-
|
27753
|
+
var primary = {
|
27754
|
+
lighter: '#D0ECFE',
|
27755
|
+
light: '#73BAFB',
|
27756
|
+
main: '#1877F2',
|
27757
|
+
dark: '#0C44AE',
|
27758
|
+
darker: '#042174',
|
27759
|
+
contrastText: '#FFFFFF'
|
27760
|
+
};
|
27761
|
+
var secondary = {
|
27762
|
+
lighter: '#EFD6FF',
|
27763
|
+
light: '#C684FF',
|
27764
|
+
main: '#8E33FF',
|
27765
|
+
dark: '#5119B7',
|
27766
|
+
darker: '#27097A',
|
27767
|
+
contrastText: '#FFFFFF'
|
27768
|
+
};
|
27769
|
+
var info = {
|
27770
|
+
lighter: '#CAFDF5',
|
27771
|
+
light: '#61F3F3',
|
27772
|
+
main: '#00B8D9',
|
27773
|
+
dark: '#006C9C',
|
27774
|
+
darker: '#003768',
|
27775
|
+
contrastText: '#FFFFFF'
|
27776
|
+
};
|
27777
|
+
var success = {
|
27778
|
+
lighter: '#C8FAD6',
|
27779
|
+
light: '#5BE49B',
|
27780
|
+
main: '#00A76F',
|
27781
|
+
dark: '#007867',
|
27782
|
+
darker: '#004B50',
|
27783
|
+
contrastText: '#FFFFFF'
|
27784
|
+
};
|
27785
|
+
var warning$1 = {
|
27786
|
+
lighter: '#FFF5CC',
|
27787
|
+
light: '#FFD666',
|
27788
|
+
main: '#FFAB00',
|
27789
|
+
dark: '#B76E00',
|
27790
|
+
darker: '#7A4100',
|
27791
|
+
contrastText: grey[800]
|
27792
|
+
};
|
27793
|
+
var error = {
|
27794
|
+
lighter: '#FFE9D5',
|
27795
|
+
light: '#FFAC82',
|
27796
|
+
main: '#FF5630',
|
27797
|
+
dark: '#B71D18',
|
27798
|
+
darker: '#7A0916',
|
27799
|
+
contrastText: '#FFFFFF'
|
27800
|
+
};
|
27801
|
+
var red = {
|
27802
|
+
100: '#FEF8F8',
|
27803
|
+
300: '#FEF8F8',
|
27804
|
+
500: '#F4CACA',
|
27805
|
+
900: '#DB4D4D'
|
27806
|
+
};
|
27807
|
+
var yellow = {
|
27808
|
+
900: '#FEAF06'
|
27809
|
+
};
|
27810
|
+
var green_support = {
|
27811
|
+
100: '#F6FDF7',
|
27812
|
+
500: '#AEEAB3',
|
27813
|
+
900: '#3ACB46'
|
27814
|
+
};
|
27815
|
+
var purple = {
|
27816
|
+
900: '#C3099A'
|
27817
|
+
};
|
27818
|
+
var dark_purple = {
|
27819
|
+
900: '#6B0861'
|
27820
|
+
};
|
27821
|
+
var dark_red = {
|
27822
|
+
900: '#800202'
|
27823
|
+
};
|
27824
|
+
var common = {
|
27825
|
+
black: '#000000',
|
27826
|
+
white: '#FFFFFF'
|
27827
|
+
};
|
27828
|
+
var action$2 = {
|
27829
|
+
hover: alpha(grey[500], 0.08),
|
27830
|
+
selected: alpha(grey[500], 0.16),
|
27831
|
+
disabled: alpha(grey[500], 0.8),
|
27832
|
+
disabledBackground: alpha(grey[500], 0.24),
|
27833
|
+
focus: alpha(grey[500], 0.24),
|
27834
|
+
hoverOpacity: 0.08,
|
27835
|
+
disabledOpacity: 0.48
|
27836
|
+
};
|
27837
|
+
var base = {
|
27838
|
+
primary: primary,
|
27839
|
+
secondary: secondary,
|
27840
|
+
info: info,
|
27841
|
+
main_theme: main_theme,
|
27842
|
+
success: success,
|
27843
|
+
warning: warning$1,
|
27844
|
+
error: error,
|
27845
|
+
grey: grey,
|
27846
|
+
common: common,
|
27847
|
+
red: red,
|
27848
|
+
yellow: yellow,
|
27849
|
+
green_support: green_support,
|
27850
|
+
purple: purple,
|
27851
|
+
dark_purple: dark_purple,
|
27852
|
+
dark_red: dark_red,
|
27853
|
+
divider: alpha(grey[500], 0.2),
|
27854
|
+
action: action$2
|
28442
27855
|
};
|
28443
27856
|
|
28444
27857
|
var ArticleBlock = function ArticleBlock(_ref) {
|
@@ -28448,7 +27861,6 @@ var ArticleBlock = function ArticleBlock(_ref) {
|
|
28448
27861
|
path = _ref.path,
|
28449
27862
|
isLoadingCategories = _ref.isLoadingCategories,
|
28450
27863
|
optionKey = _ref.optionKey,
|
28451
|
-
disabled = _ref.disabled,
|
28452
27864
|
setFieldValue = _ref.setFieldValue,
|
28453
27865
|
onDuplicate = _ref.onDuplicate,
|
28454
27866
|
onDelete = _ref.onDelete,
|
@@ -28550,7 +27962,6 @@ var ArticleBlock = function ArticleBlock(_ref) {
|
|
28550
27962
|
onMenuClose: onCloseCategoryMenu
|
28551
27963
|
},
|
28552
27964
|
onChange: handleChangeCategory,
|
28553
|
-
isDisabled: disabled,
|
28554
27965
|
placeholder: t("select_category")
|
28555
27966
|
});
|
28556
27967
|
}
|
@@ -28588,7 +27999,7 @@ var ArticleBlock = function ArticleBlock(_ref) {
|
|
28588
27999
|
onMenuClose: onCloseCategoryMenu
|
28589
28000
|
},
|
28590
28001
|
onChange: handleChangeSubCategory,
|
28591
|
-
isDisabled:
|
28002
|
+
isDisabled: !data.categories[0],
|
28592
28003
|
placeholder: t("select_category")
|
28593
28004
|
});
|
28594
28005
|
}
|
@@ -28609,9 +28020,7 @@ var ArticleBlock = function ArticleBlock(_ref) {
|
|
28609
28020
|
return React__default.createElement(TextField, Object.assign({
|
28610
28021
|
placeholder: t("title")
|
28611
28022
|
}, field, {
|
28612
|
-
size: "small"
|
28613
|
-
onKeyDown: handleKeyDown,
|
28614
|
-
disabled: disabled
|
28023
|
+
size: "small"
|
28615
28024
|
}));
|
28616
28025
|
}
|
28617
28026
|
}))), React__default.createElement(Grid, {
|
@@ -28631,9 +28040,7 @@ var ArticleBlock = function ArticleBlock(_ref) {
|
|
28631
28040
|
return React__default.createElement(TextField, Object.assign({
|
28632
28041
|
placeholder: t("author")
|
28633
28042
|
}, field, {
|
28634
|
-
size: "small"
|
28635
|
-
onKeyDown: handleKeyDown,
|
28636
|
-
disabled: disabled
|
28043
|
+
size: "small"
|
28637
28044
|
}));
|
28638
28045
|
}
|
28639
28046
|
}))), React__default.createElement(Grid, {
|
@@ -28653,9 +28060,7 @@ var ArticleBlock = function ArticleBlock(_ref) {
|
|
28653
28060
|
return React__default.createElement(TextField, Object.assign({
|
28654
28061
|
placeholder: t("subject")
|
28655
28062
|
}, field, {
|
28656
|
-
size: "small"
|
28657
|
-
onKeyDown: handleKeyDown,
|
28658
|
-
disabled: disabled
|
28063
|
+
size: "small"
|
28659
28064
|
}));
|
28660
28065
|
}
|
28661
28066
|
})))), React__default.createElement(Stack, {
|
@@ -28668,7 +28073,6 @@ var ArticleBlock = function ArticleBlock(_ref) {
|
|
28668
28073
|
}, t("copy_items")), React__default.createElement(Button, {
|
28669
28074
|
variant: "contained",
|
28670
28075
|
color: "success",
|
28671
|
-
disabled: disabled,
|
28672
28076
|
onClick: handleDuplicateArticle,
|
28673
28077
|
sx: {
|
28674
28078
|
whiteSpace: "nowrap"
|
@@ -28684,7 +28088,7 @@ var isEqual = function isEqual(prev, next) {
|
|
28684
28088
|
var nextIsLoadingCategories = isNextMatched ? next.isLoadingCategories : undefined;
|
28685
28089
|
var prevCategories = isPrevMatched ? prev.categories : undefined;
|
28686
28090
|
var nextCategories = isNextMatched ? next.categories : undefined;
|
28687
|
-
return prevOptionKey === nextOptionKey && prevIsLoadingCategories === nextIsLoadingCategories && JSON.stringify(prev.data) === JSON.stringify(next.data) && JSON.stringify(prevCategories) === JSON.stringify(nextCategories) && prev.path === next.path && prev.expandedIndex == next.expandedIndex && prev.
|
28091
|
+
return prevOptionKey === nextOptionKey && prevIsLoadingCategories === nextIsLoadingCategories && JSON.stringify(prev.data) === JSON.stringify(next.data) && JSON.stringify(prevCategories) === JSON.stringify(nextCategories) && prev.path === next.path && prev.expandedIndex == next.expandedIndex && prev.onOpenCategoryMenu == next.onOpenCategoryMenu && prev.onOpenSubCategoryMenu == next.onOpenSubCategoryMenu;
|
28688
28092
|
};
|
28689
28093
|
var ArticleBlock$1 = memo(ArticleBlock, isEqual);
|
28690
28094
|
|
@@ -28697,7 +28101,7 @@ var labelStyle = {
|
|
28697
28101
|
whiteSpace: "nowrap"
|
28698
28102
|
};
|
28699
28103
|
|
28700
|
-
var _excluded$
|
28104
|
+
var _excluded$e = ["onChange"];
|
28701
28105
|
var BpIcon$1 = styled("span")(function (_ref) {
|
28702
28106
|
var theme = _ref.theme;
|
28703
28107
|
return {
|
@@ -28730,7 +28134,7 @@ var BpCheckedIcon$1 = styled(BpIcon$1)({
|
|
28730
28134
|
var QuestionBlock = function QuestionBlock(_ref2) {
|
28731
28135
|
var answerCount = _ref2.answerCount,
|
28732
28136
|
isMath = _ref2.isMath,
|
28733
|
-
|
28137
|
+
isDisabled = _ref2.isDisabled,
|
28734
28138
|
path = _ref2.path,
|
28735
28139
|
data = _ref2.data,
|
28736
28140
|
questionTitleStyle = _ref2.questionTitleStyle,
|
@@ -28775,8 +28179,7 @@ var QuestionBlock = function QuestionBlock(_ref2) {
|
|
28775
28179
|
var field = _ref3.field;
|
28776
28180
|
return React__default.createElement(TextField, Object.assign({}, field, {
|
28777
28181
|
size: "small",
|
28778
|
-
placeholder: t("textual_answer")
|
28779
|
-
onKeyDown: handleKeyDown
|
28182
|
+
placeholder: t("textual_answer")
|
28780
28183
|
}));
|
28781
28184
|
}
|
28782
28185
|
}));
|
@@ -28795,7 +28198,7 @@ var QuestionBlock = function QuestionBlock(_ref2) {
|
|
28795
28198
|
className: styles$9["question-label"] + " w-fit",
|
28796
28199
|
labelPlacement: "top",
|
28797
28200
|
value: i,
|
28798
|
-
disabled:
|
28201
|
+
disabled: isDisabled,
|
28799
28202
|
control: React__default.createElement(Checkbox, {
|
28800
28203
|
checked: data.correctAnswers.includes(i),
|
28801
28204
|
onChange: function onChange(e) {
|
@@ -28831,7 +28234,7 @@ var QuestionBlock = function QuestionBlock(_ref2) {
|
|
28831
28234
|
onChange: function onChange(e) {
|
28832
28235
|
return setFieldValue(path + ".correctAnswers", [+e.target.value]);
|
28833
28236
|
},
|
28834
|
-
disabled:
|
28237
|
+
disabled: isDisabled,
|
28835
28238
|
control: React__default.createElement(Radio, {
|
28836
28239
|
size: "small",
|
28837
28240
|
checked: +i === data.correctAnswers[0],
|
@@ -28867,7 +28270,7 @@ var QuestionBlock = function QuestionBlock(_ref2) {
|
|
28867
28270
|
};
|
28868
28271
|
});
|
28869
28272
|
var theme = useTheme();
|
28870
|
-
var isTabletUp = useMediaQuery(theme.breakpoints.up(
|
28273
|
+
var isTabletUp = useMediaQuery(theme.breakpoints.up('lg'));
|
28871
28274
|
return React__default.createElement(Stack, {
|
28872
28275
|
direction: "row",
|
28873
28276
|
alignItems: "center",
|
@@ -28881,10 +28284,8 @@ var QuestionBlock = function QuestionBlock(_ref2) {
|
|
28881
28284
|
}, React__default.createElement(Box, null, React__default.createElement(Box, {
|
28882
28285
|
className: styles$9["question-title"] + " me-2 text-nowrap",
|
28883
28286
|
sx: questionTitleStyle
|
28884
|
-
},
|
28287
|
+
}, t("problem_number_question", {
|
28885
28288
|
number: data.questionOrder + 1
|
28886
|
-
}) : t("text_detail_n", {
|
28887
|
-
n: data.questionOrder + 1
|
28888
28289
|
}))), React__default.createElement(Box, {
|
28889
28290
|
flexGrow: 1
|
28890
28291
|
}, renderAnswer())), React__default.createElement(Stack, {
|
@@ -28904,7 +28305,7 @@ var QuestionBlock = function QuestionBlock(_ref2) {
|
|
28904
28305
|
render: function render(_ref4) {
|
28905
28306
|
var field = _ref4.field;
|
28906
28307
|
return React__default.createElement(ScoreSelector, Object.assign({}, field, {
|
28907
|
-
isDisabled:
|
28308
|
+
isDisabled: isDisabled,
|
28908
28309
|
onChange: function onChange(value) {
|
28909
28310
|
setFieldValue(path + ".score", (value === null || value === void 0 ? void 0 : value.value) || 0);
|
28910
28311
|
}
|
@@ -28923,9 +28324,9 @@ var QuestionBlock = function QuestionBlock(_ref2) {
|
|
28923
28324
|
name: path + ".questionTypeId",
|
28924
28325
|
render: function render(_ref5) {
|
28925
28326
|
var _ref5$field = _ref5.field,
|
28926
|
-
field = _objectWithoutPropertiesLoose(_ref5$field, _excluded$
|
28327
|
+
field = _objectWithoutPropertiesLoose(_ref5$field, _excluded$e);
|
28927
28328
|
return React__default.createElement(CustomSelectOption, Object.assign({}, field, {
|
28928
|
-
isDisabled:
|
28329
|
+
isDisabled: isDisabled,
|
28929
28330
|
value: data.questionType,
|
28930
28331
|
options: questionTypes,
|
28931
28332
|
isLoading: optionKey === path + ".questionTypeId" ? isLoadingQuestionTypes : false,
|
@@ -28950,7 +28351,7 @@ var QuestionBlock = function QuestionBlock(_ref2) {
|
|
28950
28351
|
var field = _ref6.field;
|
28951
28352
|
return React__default.createElement(CustomSelect, Object.assign({}, field, {
|
28952
28353
|
value: data.questionAnswerType,
|
28953
|
-
isDisabled:
|
28354
|
+
isDisabled: isDisabled,
|
28954
28355
|
options: answerTypeOptions,
|
28955
28356
|
onChange: handleChangeQuestionAnswerType
|
28956
28357
|
}));
|
@@ -28966,11 +28367,11 @@ var isEqual$1 = function isEqual(prev, next) {
|
|
28966
28367
|
var nextIsLoadingQuestionTypes = isNextMatched ? next.isLoadingQuestionTypes : undefined;
|
28967
28368
|
var prevQuestionTypes = isPrevMatched ? prev.questionTypes : undefined;
|
28968
28369
|
var nextQuestionTypes = isNextMatched ? next.questionTypes : undefined;
|
28969
|
-
return prevOptionKey === nextOptionKey && prevIsLoadingQuestionTypes === nextIsLoadingQuestionTypes && JSON.stringify(prev.data) === JSON.stringify(next.data) && JSON.stringify(prevQuestionTypes) === JSON.stringify(nextQuestionTypes) && prev.path === next.path && prev.isMath == next.isMath && prev.answerCount == next.answerCount && prev.
|
28370
|
+
return prevOptionKey === nextOptionKey && prevIsLoadingQuestionTypes === nextIsLoadingQuestionTypes && JSON.stringify(prev.data) === JSON.stringify(next.data) && JSON.stringify(prevQuestionTypes) === JSON.stringify(nextQuestionTypes) && prev.path === next.path && prev.isMath == next.isMath && prev.answerCount == next.answerCount && prev.isDisabled == next.isDisabled && JSON.stringify(prev.questionTitleStyle) === JSON.stringify(next.questionTitleStyle) && prev.onOpenQuestionTypeMenu == next.onOpenQuestionTypeMenu;
|
28970
28371
|
};
|
28971
28372
|
var QuestionBlock$1 = memo(QuestionBlock, isEqual$1);
|
28972
28373
|
|
28973
|
-
var _excluded$
|
28374
|
+
var _excluded$f = ["data", "path", "isMath", "open", "isLoadingCategories", "isLoadingQuestionTypes", "optionKey", "categories", "questionTypes", "onDelete", "onOpenSubCategoryMenu", "onOpenCategoryMenu", "onCloseCategoryMenu", "onCloseQuestionTypeMenu", "onOpenQuestionTypeMenu"];
|
28974
28375
|
var _ = _$5;
|
28975
28376
|
var QuestionGroupBlockBody = function QuestionGroupBlockBody(_ref) {
|
28976
28377
|
var _data$articles$3, _data$articles$3$cate, _data$articles$4, _data$articles$4$cate;
|
@@ -28983,16 +28384,14 @@ var QuestionGroupBlockBody = function QuestionGroupBlockBody(_ref) {
|
|
28983
28384
|
optionKey = _ref.optionKey,
|
28984
28385
|
categories = _ref.categories,
|
28985
28386
|
questionTypes = _ref.questionTypes,
|
28986
|
-
disabled = _ref.disabled,
|
28987
28387
|
onDelete = _ref.onDelete,
|
28988
28388
|
onOpenSubCategoryMenu = _ref.onOpenSubCategoryMenu,
|
28989
28389
|
onOpenCategoryMenu = _ref.onOpenCategoryMenu,
|
28990
28390
|
onCloseCategoryMenu = _ref.onCloseCategoryMenu,
|
28991
28391
|
onCloseQuestionTypeMenu = _ref.onCloseQuestionTypeMenu,
|
28992
28392
|
onOpenQuestionTypeMenu = _ref.onOpenQuestionTypeMenu,
|
28993
|
-
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$
|
28393
|
+
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$f);
|
28994
28394
|
var errors = formikProps.errors;
|
28995
|
-
var theme = useTheme();
|
28996
28395
|
var articles = data.articles,
|
28997
28396
|
questions = data.questions;
|
28998
28397
|
var blockErrors = _.get(errors, path);
|
@@ -29013,7 +28412,7 @@ var QuestionGroupBlockBody = function QuestionGroupBlockBody(_ref) {
|
|
29013
28412
|
gap: 2
|
29014
28413
|
}, !isMath && React__default.createElement(Stack, {
|
29015
28414
|
sx: {
|
29016
|
-
border: "
|
28415
|
+
border: "1px solid " + (blockErrors ? open ? error.main : error.light : open ? main_theme.less_dark : main_theme.light),
|
29017
28416
|
borderRadius: 2
|
29018
28417
|
},
|
29019
28418
|
gap: 1,
|
@@ -29027,7 +28426,6 @@ var QuestionGroupBlockBody = function QuestionGroupBlockBody(_ref) {
|
|
29027
28426
|
expandedIndex: index,
|
29028
28427
|
data: article,
|
29029
28428
|
path: path + ".articles[" + index + "]",
|
29030
|
-
disabled: disabled,
|
29031
28429
|
onDuplicate: handleDuplicateArticle,
|
29032
28430
|
onDelete: onDelete,
|
29033
28431
|
optionKey: optionKey,
|
@@ -29043,7 +28441,6 @@ var QuestionGroupBlockBody = function QuestionGroupBlockBody(_ref) {
|
|
29043
28441
|
width: "fit-content"
|
29044
28442
|
},
|
29045
28443
|
variant: "contained",
|
29046
|
-
disabled: disabled,
|
29047
28444
|
startIcon: React__default.createElement(IoIosAdd, null),
|
29048
28445
|
onClick: function onClick() {
|
29049
28446
|
arrayHelpers.push(DEFAULT_ARTICLE);
|
@@ -29063,7 +28460,6 @@ var QuestionGroupBlockBody = function QuestionGroupBlockBody(_ref) {
|
|
29063
28460
|
questionTypes: questionTypes,
|
29064
28461
|
isLoadingQuestionTypes: isLoadingQuestionTypes,
|
29065
28462
|
optionKey: optionKey,
|
29066
|
-
disabled: disabled,
|
29067
28463
|
onOpenQuestionTypeMenu: handleOpenQuestionTypeMenu,
|
29068
28464
|
onCloseQuestionTypeMenu: onCloseQuestionTypeMenu
|
29069
28465
|
}, formikProps));
|
@@ -29093,11 +28489,11 @@ var isEqual$2 = function isEqual(prev, next) {
|
|
29093
28489
|
var nextOnOpenSubCategoryMenu = next.onOpenSubCategoryMenu;
|
29094
28490
|
var prevOnOpenQuestionTypeMenu = prev.onOpenQuestionTypeMenu;
|
29095
28491
|
var nextOnOpenQuestionTypeMenu = next.onOpenQuestionTypeMenu;
|
29096
|
-
return prevOptionKey === nextOptionKey && prevIsLoadingCategories === nextIsLoadingCategories && JSON.stringify(prevCategories) === JSON.stringify(nextCategories) && prevIsLoadingQuestionTypes === nextIsLoadingQuestionTypes && JSON.stringify(prevQuestionTypes) === JSON.stringify(nextQuestionTypes) && prev.path === next.path && prev.isMath === next.isMath && prev.open === next.open &&
|
28492
|
+
return prevOptionKey === nextOptionKey && prevIsLoadingCategories === nextIsLoadingCategories && JSON.stringify(prevCategories) === JSON.stringify(nextCategories) && prevIsLoadingQuestionTypes === nextIsLoadingQuestionTypes && JSON.stringify(prevQuestionTypes) === JSON.stringify(nextQuestionTypes) && prev.path === next.path && prev.isMath === next.isMath && prev.open === next.open && JSON.stringify(prev.data) === JSON.stringify(next.data) && JSON.stringify(prevBlockErrors) === JSON.stringify(nextBlockErrors) && prevOnOpenCategoryMenu === nextOnOpenCategoryMenu && prevOnOpenSubCategoryMenu === nextOnOpenSubCategoryMenu && prevOnOpenQuestionTypeMenu === nextOnOpenQuestionTypeMenu;
|
29097
28493
|
};
|
29098
28494
|
var QuestionGroupBlockBody$1 = memo(QuestionGroupBlockBody, isEqual$2);
|
29099
28495
|
|
29100
|
-
var _excluded$
|
28496
|
+
var _excluded$g = ["expandedIndex", "open", "paths", "path", "isMath", "data", "categories", "isLoadingCategories", "isLoadingQuestionTypes", "questionTypes", "optionKey", "isDisabled", "onToggle", "onQuestionCountChange", "onDelete", "onOpenSubCategoryMenu", "onOpenCategoryMenu", "onCloseCategoryMenu", "onCopiedPrevQuestionGroup", "onCloseQuestionTypeMenu", "onOpenQuestionTypeMenu"];
|
29101
28497
|
var _$1 = _$5;
|
29102
28498
|
var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
|
29103
28499
|
var _data$articles$2, _data$articles$2$cate, _data$articles$2$cate2, _data$articles$3, _data$articles$3$cate, _data$articles$3$cate2;
|
@@ -29112,7 +28508,7 @@ var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
|
|
29112
28508
|
isLoadingQuestionTypes = _ref.isLoadingQuestionTypes,
|
29113
28509
|
questionTypes = _ref.questionTypes,
|
29114
28510
|
optionKey = _ref.optionKey,
|
29115
|
-
|
28511
|
+
isDisabled = _ref.isDisabled,
|
29116
28512
|
onToggle = _ref.onToggle,
|
29117
28513
|
onQuestionCountChange = _ref.onQuestionCountChange,
|
29118
28514
|
onDelete = _ref.onDelete,
|
@@ -29122,13 +28518,13 @@ var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
|
|
29122
28518
|
onCopiedPrevQuestionGroup = _ref.onCopiedPrevQuestionGroup,
|
29123
28519
|
onCloseQuestionTypeMenu = _ref.onCloseQuestionTypeMenu,
|
29124
28520
|
onOpenQuestionTypeMenu = _ref.onOpenQuestionTypeMenu,
|
29125
|
-
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$
|
28521
|
+
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$g);
|
29126
28522
|
var errors = formikProps.errors,
|
29127
28523
|
setFieldValue = formikProps.setFieldValue;
|
29128
28524
|
var _useTranslation = useTranslation(),
|
29129
28525
|
t = _useTranslation.t;
|
29130
28526
|
var key = paths.join(".");
|
29131
|
-
var title = t(
|
28527
|
+
var title = t("group_n", {
|
29132
28528
|
n: expandedIndex + 1
|
29133
28529
|
});
|
29134
28530
|
var handleToggle = function handleToggle() {
|
@@ -29210,7 +28606,7 @@ var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
|
|
29210
28606
|
expanded: open,
|
29211
28607
|
onChange: handleToggle,
|
29212
28608
|
sx: {
|
29213
|
-
border: "
|
28609
|
+
border: "1px solid " + (blockErrors ? open ? error.main : error.light : open ? main_theme.less_dark : main_theme.light)
|
29214
28610
|
}
|
29215
28611
|
}, React__default.createElement(AccordionSummary, {
|
29216
28612
|
expandIcon: React__default.createElement(MdExpandMore, {
|
@@ -29239,7 +28635,6 @@ var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
|
|
29239
28635
|
}, React__default.createElement(FaTrashCan, {
|
29240
28636
|
size: 12
|
29241
28637
|
})), React__default.createElement(Typography, {
|
29242
|
-
fontSize: "18px",
|
29243
28638
|
fontWeight: 700,
|
29244
28639
|
whiteSpace: "nowrap"
|
29245
28640
|
}, title, !open && ":")), React__default.createElement(Box, {
|
@@ -29271,8 +28666,7 @@ var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
|
|
29271
28666
|
render: function render(_ref2) {
|
29272
28667
|
var field = _ref2.field;
|
29273
28668
|
return React__default.createElement(QuestionCountSelector, Object.assign({}, field, {
|
29274
|
-
onChange: handleChangeQuestionCount
|
29275
|
-
isDisabled: disabled
|
28669
|
+
onChange: handleChangeQuestionCount
|
29276
28670
|
}));
|
29277
28671
|
}
|
29278
28672
|
}))), isMath && React__default.createElement(Grid, {
|
@@ -29310,7 +28704,6 @@ var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
|
|
29310
28704
|
onMenuClose: onCloseCategoryMenu
|
29311
28705
|
},
|
29312
28706
|
onChange: handleChangeCategory,
|
29313
|
-
isDisabled: disabled,
|
29314
28707
|
placeholder: t("select_category")
|
29315
28708
|
});
|
29316
28709
|
}
|
@@ -29351,7 +28744,7 @@ var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
|
|
29351
28744
|
onMenuClose: onCloseCategoryMenu
|
29352
28745
|
},
|
29353
28746
|
onChange: handleChangeSubCategory,
|
29354
|
-
isDisabled:
|
28747
|
+
isDisabled: isDisabled || !((_data$articles$4 = data.articles[0]) !== null && _data$articles$4 !== void 0 && (_data$articles$4$cate = _data$articles$4.categories) !== null && _data$articles$4$cate !== void 0 && _data$articles$4$cate[0]),
|
29355
28748
|
placeholder: t("select_category")
|
29356
28749
|
});
|
29357
28750
|
}
|
@@ -29370,8 +28763,7 @@ var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
|
|
29370
28763
|
render: function render(_ref5) {
|
29371
28764
|
var field = _ref5.field;
|
29372
28765
|
return React__default.createElement(AnswerCountSelector, Object.assign({}, field, {
|
29373
|
-
onChange: handleChangeAnswerCount
|
29374
|
-
isDisabled: disabled
|
28766
|
+
onChange: handleChangeAnswerCount
|
29375
28767
|
}));
|
29376
28768
|
}
|
29377
28769
|
})))), isMath && React__default.createElement(Box, {
|
@@ -29384,7 +28776,6 @@ var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
|
|
29384
28776
|
}, React__default.createElement(Button, {
|
29385
28777
|
variant: "contained",
|
29386
28778
|
color: "success",
|
29387
|
-
disabled: disabled,
|
29388
28779
|
onClick: handleCopyCategories,
|
29389
28780
|
sx: {
|
29390
28781
|
whiteSpace: "nowrap"
|
@@ -29410,7 +28801,6 @@ var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
|
|
29410
28801
|
isLoadingCategories: isLoadingCategories,
|
29411
28802
|
isLoadingQuestionTypes: isLoadingQuestionTypes,
|
29412
28803
|
optionKey: optionKey,
|
29413
|
-
disabled: disabled,
|
29414
28804
|
onDelete: onDelete,
|
29415
28805
|
onOpenSubCategoryMenu: onOpenSubCategoryMenu,
|
29416
28806
|
onOpenCategoryMenu: onOpenCategoryMenu,
|
@@ -29420,7 +28810,7 @@ var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
|
|
29420
28810
|
}, formikProps)))));
|
29421
28811
|
};
|
29422
28812
|
|
29423
|
-
var _excluded$
|
28813
|
+
var _excluded$h = ["path", "paths", "isMath", "isLoadingCategories", "isLoadingQuestionTypes", "optionKey", "questionGroups", "subChapters", "categories", "questionTypes", "onDelete", "onOpenSubCategoryMenu", "onOpenCategoryMenu", "onCloseCategoryMenu", "onCopiedPrevQuestionGroup", "onCloseQuestionTypeMenu", "onOpenQuestionTypeMenu"];
|
29424
28814
|
var ChapterBlockBody = function ChapterBlockBody(_ref) {
|
29425
28815
|
var path = _ref.path,
|
29426
28816
|
paths = _ref.paths,
|
@@ -29432,7 +28822,6 @@ var ChapterBlockBody = function ChapterBlockBody(_ref) {
|
|
29432
28822
|
subChapters = _ref.subChapters,
|
29433
28823
|
categories = _ref.categories,
|
29434
28824
|
questionTypes = _ref.questionTypes,
|
29435
|
-
disabled = _ref.disabled,
|
29436
28825
|
onDelete = _ref.onDelete,
|
29437
28826
|
onOpenSubCategoryMenu = _ref.onOpenSubCategoryMenu,
|
29438
28827
|
onOpenCategoryMenu = _ref.onOpenCategoryMenu,
|
@@ -29440,7 +28829,7 @@ var ChapterBlockBody = function ChapterBlockBody(_ref) {
|
|
29440
28829
|
onCopiedPrevQuestionGroup = _ref.onCopiedPrevQuestionGroup,
|
29441
28830
|
onCloseQuestionTypeMenu = _ref.onCloseQuestionTypeMenu,
|
29442
28831
|
onOpenQuestionTypeMenu = _ref.onOpenQuestionTypeMenu,
|
29443
|
-
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$
|
28832
|
+
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$h);
|
29444
28833
|
var _useTranslation = useTranslation(),
|
29445
28834
|
t = _useTranslation.t;
|
29446
28835
|
var setFieldValue = formikProps.setFieldValue;
|
@@ -29544,7 +28933,6 @@ var ChapterBlockBody = function ChapterBlockBody(_ref) {
|
|
29544
28933
|
categories: categories,
|
29545
28934
|
isLoadingQuestionTypes: isLoadingQuestionTypes,
|
29546
28935
|
questionTypes: questionTypes,
|
29547
|
-
disabled: disabled,
|
29548
28936
|
onToggle: handleToggle,
|
29549
28937
|
onDelete: onDelete,
|
29550
28938
|
onOpenCategoryMenu: onOpenCategoryMenu,
|
@@ -29559,7 +28947,6 @@ var ChapterBlockBody = function ChapterBlockBody(_ref) {
|
|
29559
28947
|
},
|
29560
28948
|
variant: "contained",
|
29561
28949
|
startIcon: React__default.createElement(IoIosAdd, null),
|
29562
|
-
disabled: disabled,
|
29563
28950
|
onClick: function onClick() {
|
29564
28951
|
{
|
29565
28952
|
var length = subChapters.length;
|
@@ -29590,7 +28977,6 @@ var ChapterBlockBody = function ChapterBlockBody(_ref) {
|
|
29590
28977
|
optionKey: optionKey,
|
29591
28978
|
isLoadingCategories: isLoadingCategories,
|
29592
28979
|
categories: categories,
|
29593
|
-
disabled: disabled,
|
29594
28980
|
onOpenCategoryMenu: onOpenCategoryMenu,
|
29595
28981
|
onOpenSubCategoryMenu: onOpenSubCategoryMenu,
|
29596
28982
|
onCloseCategoryMenu: onCloseCategoryMenu,
|
@@ -29606,7 +28992,6 @@ var ChapterBlockBody = function ChapterBlockBody(_ref) {
|
|
29606
28992
|
},
|
29607
28993
|
variant: "contained",
|
29608
28994
|
startIcon: React__default.createElement(IoIosAdd, null),
|
29609
|
-
disabled: disabled,
|
29610
28995
|
onClick: function onClick() {
|
29611
28996
|
var length = questionGroups.length;
|
29612
28997
|
var addedGroup = handleGetNewQuestionGroup();
|
@@ -29618,7 +29003,7 @@ var ChapterBlockBody = function ChapterBlockBody(_ref) {
|
|
29618
29003
|
}));
|
29619
29004
|
};
|
29620
29005
|
|
29621
|
-
var _excluded$
|
29006
|
+
var _excluded$i = ["data", "expandedIndex", "open", "path", "paths", "isMath", "isLoadingCategories", "isLoadingQuestionTypes", "categories", "questionTypes", "optionKey", "onToggle", "onDelete", "onCopiedPrevQuestionGroup", "onCloseCategoryMenu", "onOpenCategoryMenu", "onOpenSubCategoryMenu", "onOpenQuestionTypeMenu", "onCloseQuestionTypeMenu"];
|
29622
29007
|
var _$2 = _$5;
|
29623
29008
|
var ChapterBlock = function ChapterBlock(_ref) {
|
29624
29009
|
var data = _ref.data,
|
@@ -29632,7 +29017,6 @@ var ChapterBlock = function ChapterBlock(_ref) {
|
|
29632
29017
|
categories = _ref.categories,
|
29633
29018
|
questionTypes = _ref.questionTypes,
|
29634
29019
|
optionKey = _ref.optionKey,
|
29635
|
-
disabled = _ref.disabled,
|
29636
29020
|
onToggle = _ref.onToggle,
|
29637
29021
|
onDelete = _ref.onDelete,
|
29638
29022
|
onCopiedPrevQuestionGroup = _ref.onCopiedPrevQuestionGroup,
|
@@ -29641,13 +29025,12 @@ var ChapterBlock = function ChapterBlock(_ref) {
|
|
29641
29025
|
onOpenSubCategoryMenu = _ref.onOpenSubCategoryMenu,
|
29642
29026
|
onOpenQuestionTypeMenu = _ref.onOpenQuestionTypeMenu,
|
29643
29027
|
onCloseQuestionTypeMenu = _ref.onCloseQuestionTypeMenu,
|
29644
|
-
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$
|
29028
|
+
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$i);
|
29645
29029
|
var errors = formikProps.errors;
|
29646
29030
|
var _useTranslation = useTranslation(),
|
29647
29031
|
t = _useTranslation.t;
|
29648
|
-
var theme = useTheme();
|
29649
29032
|
var key = paths.join(".");
|
29650
|
-
var title = t(
|
29033
|
+
var title = t("chapter_number", {
|
29651
29034
|
number: paths.join(".")
|
29652
29035
|
});
|
29653
29036
|
var handleToggle = function handleToggle() {
|
@@ -29667,7 +29050,7 @@ var ChapterBlock = function ChapterBlock(_ref) {
|
|
29667
29050
|
expanded: open,
|
29668
29051
|
onChange: handleToggle,
|
29669
29052
|
sx: {
|
29670
|
-
border: "
|
29053
|
+
border: "1px solid " + (blockErrors ? open ? error.main : error.light : open ? main_theme.less_dark : main_theme.light)
|
29671
29054
|
}
|
29672
29055
|
}, React__default.createElement(AccordionSummary, {
|
29673
29056
|
expandIcon: React__default.createElement(MdExpandMore, {
|
@@ -29690,12 +29073,10 @@ var ChapterBlock = function ChapterBlock(_ref) {
|
|
29690
29073
|
color: "default",
|
29691
29074
|
size: "small",
|
29692
29075
|
className: "bg-danger text-white",
|
29693
|
-
disabled: disabled,
|
29694
29076
|
onClick: handleClickDeleteChapter
|
29695
29077
|
}, React__default.createElement(FaTrashCan, {
|
29696
29078
|
size: 12
|
29697
29079
|
})), React__default.createElement(Typography, {
|
29698
|
-
fontSize: (paths === null || paths === void 0 ? void 0 : paths.length) > 1 ? "24px" : "36px",
|
29699
29080
|
fontWeight: 700,
|
29700
29081
|
whiteSpace: "nowrap"
|
29701
29082
|
}, title)), React__default.createElement(Box, {
|
@@ -29717,9 +29098,7 @@ var ChapterBlock = function ChapterBlock(_ref) {
|
|
29717
29098
|
return React__default.createElement(TextField, Object.assign({
|
29718
29099
|
placeholder: t("name")
|
29719
29100
|
}, field, {
|
29720
|
-
size: "small"
|
29721
|
-
onKeyDown: handleKeyDown,
|
29722
|
-
disabled: disabled
|
29101
|
+
size: "small"
|
29723
29102
|
}));
|
29724
29103
|
}
|
29725
29104
|
}), !!pageNameError && React__default.createElement(Typography, {
|
@@ -29740,9 +29119,7 @@ var ChapterBlock = function ChapterBlock(_ref) {
|
|
29740
29119
|
placeholder: t("page_from"),
|
29741
29120
|
type: "number"
|
29742
29121
|
}, field, {
|
29743
|
-
size: "small"
|
29744
|
-
onKeyDown: handleKeyDown,
|
29745
|
-
disabled: disabled
|
29122
|
+
size: "small"
|
29746
29123
|
}));
|
29747
29124
|
}
|
29748
29125
|
}), !!pageFromError && React__default.createElement(Typography, {
|
@@ -29763,9 +29140,7 @@ var ChapterBlock = function ChapterBlock(_ref) {
|
|
29763
29140
|
placeholder: t("page_to"),
|
29764
29141
|
type: "number"
|
29765
29142
|
}, field, {
|
29766
|
-
size: "small"
|
29767
|
-
onKeyDown: handleKeyDown,
|
29768
|
-
disabled: disabled
|
29143
|
+
size: "small"
|
29769
29144
|
}));
|
29770
29145
|
}
|
29771
29146
|
}), !!pageToError && React__default.createElement(Typography, {
|
@@ -29784,7 +29159,6 @@ var ChapterBlock = function ChapterBlock(_ref) {
|
|
29784
29159
|
isLoadingQuestionTypes: isLoadingQuestionTypes,
|
29785
29160
|
isLoadingCategories: isLoadingCategories,
|
29786
29161
|
optionKey: optionKey,
|
29787
|
-
disabled: disabled,
|
29788
29162
|
onDelete: onDelete,
|
29789
29163
|
onCopiedPrevQuestionGroup: onCopiedPrevQuestionGroup,
|
29790
29164
|
onOpenSubCategoryMenu: onOpenSubCategoryMenu,
|
@@ -29832,7 +29206,7 @@ var QuestionTypeFilter = function QuestionTypeFilter(_ref) {
|
|
29832
29206
|
}));
|
29833
29207
|
if (inputRef.current) inputRef.current.value = "";
|
29834
29208
|
};
|
29835
|
-
var schoolOptions = SCHOOL_OPTIONS.map(function (i) {
|
29209
|
+
var schoolOptions = SCHOOL_OPTIONS$1.map(function (i) {
|
29836
29210
|
return _extends({}, i, {
|
29837
29211
|
label: t(i.label)
|
29838
29212
|
});
|
@@ -29840,13 +29214,13 @@ var QuestionTypeFilter = function QuestionTypeFilter(_ref) {
|
|
29840
29214
|
var gradeOptions = useMemo(function () {
|
29841
29215
|
switch (filter === null || filter === void 0 ? void 0 : filter.schoolType) {
|
29842
29216
|
case SchoolType$1.Middle:
|
29843
|
-
return MIDDLE_GRADES.map(function (i) {
|
29217
|
+
return MIDDLE_GRADES$1.map(function (i) {
|
29844
29218
|
return _extends({}, i, {
|
29845
29219
|
label: typeof i.label === "string" ? t(i.label) : i.label
|
29846
29220
|
});
|
29847
29221
|
});
|
29848
29222
|
case SchoolType$1.High:
|
29849
|
-
return HIGH_GRADES.map(function (i) {
|
29223
|
+
return HIGH_GRADES$1.map(function (i) {
|
29850
29224
|
return _extends({}, i, {
|
29851
29225
|
label: t(i.label)
|
29852
29226
|
});
|
@@ -29916,8 +29290,7 @@ var QuestionTypeFilter = function QuestionTypeFilter(_ref) {
|
|
29916
29290
|
}, React__default.createElement(FormLabel, null, t("search")), React__default.createElement(TextField, {
|
29917
29291
|
placeholder: t("question_type_search_keyword"),
|
29918
29292
|
size: "small",
|
29919
|
-
inputRef: inputRef
|
29920
|
-
onKeyDown: handleKeyDown
|
29293
|
+
inputRef: inputRef
|
29921
29294
|
})), React__default.createElement(FormGroup, {
|
29922
29295
|
sx: {
|
29923
29296
|
display: "flex",
|
@@ -30156,10 +29529,9 @@ var useTextbookOptions = function useTextbookOptions(subjectId, isMath, filter,
|
|
30156
29529
|
|
30157
29530
|
var _$3 = _$5;
|
30158
29531
|
var TextbookContentsTab = function TextbookContentsTab(props) {
|
30159
|
-
var
|
30160
|
-
values = props.values,
|
29532
|
+
var values = props.values,
|
30161
29533
|
setFieldValue = props.setFieldValue;
|
30162
|
-
var isMath = values.type ===
|
29534
|
+
var isMath = values.type === 2;
|
30163
29535
|
var _useTranslation = useTranslation(),
|
30164
29536
|
t = _useTranslation.t;
|
30165
29537
|
var _useState = useState(""),
|
@@ -30270,7 +29642,7 @@ var TextbookContentsTab = function TextbookContentsTab(props) {
|
|
30270
29642
|
return React__default.createElement(Stack, {
|
30271
29643
|
direction: "column",
|
30272
29644
|
gap: 3
|
30273
|
-
}, isMath &&
|
29645
|
+
}, isMath && React__default.createElement(Box, null, React__default.createElement(QuestionTypeFilter, {
|
30274
29646
|
filter: filter,
|
30275
29647
|
setFilter: setFilter,
|
30276
29648
|
inputRef: inputRef,
|
@@ -30291,7 +29663,6 @@ var TextbookContentsTab = function TextbookContentsTab(props) {
|
|
30291
29663
|
categories: categories,
|
30292
29664
|
isLoadingQuestionTypes: isLoadingQuestionTypes,
|
30293
29665
|
questionTypes: questionTypes,
|
30294
|
-
disabled: disabled,
|
30295
29666
|
onToggle: handleToggleBlock,
|
30296
29667
|
onDelete: handleOpenConfirmDelete,
|
30297
29668
|
onCopiedPrevQuestionGroup: handleCopiedPrevQuestionGroup,
|
@@ -30307,7 +29678,6 @@ var TextbookContentsTab = function TextbookContentsTab(props) {
|
|
30307
29678
|
width: "fit-content"
|
30308
29679
|
},
|
30309
29680
|
variant: "contained",
|
30310
|
-
disabled: disabled,
|
30311
29681
|
startIcon: React__default.createElement(IoIosAdd, null),
|
30312
29682
|
onClick: function onClick() {
|
30313
29683
|
var length = values.chapters.length;
|
@@ -30326,7 +29696,8 @@ var TextbookContentsTab = function TextbookContentsTab(props) {
|
|
30326
29696
|
}));
|
30327
29697
|
};
|
30328
29698
|
|
30329
|
-
var _excluded$
|
29699
|
+
var _excluded$j = ["value"],
|
29700
|
+
_excluded2$2 = ["onChange"];
|
30330
29701
|
var VisuallyHiddenInput = styled("input")({
|
30331
29702
|
clip: "rect(0 0 0 0)",
|
30332
29703
|
clipPath: "inset(50%)",
|
@@ -30337,67 +29708,16 @@ var VisuallyHiddenInput = styled("input")({
|
|
30337
29708
|
whiteSpace: "nowrap",
|
30338
29709
|
width: "100%"
|
30339
29710
|
});
|
30340
|
-
var customSelectStyles = {
|
30341
|
-
control: function control(baseStyles, state) {
|
30342
|
-
return _extends({}, baseStyles, {
|
30343
|
-
fontSize: "16px",
|
30344
|
-
fontWeight: baseStyles.fontWeight,
|
30345
|
-
color: styles.darker,
|
30346
|
-
borderColor: state.isFocused ? styles.dark : baseStyles.borderColor,
|
30347
|
-
boxShadow: state.isFocused ? "0 0 0 1px " + styles.dark + "4D" : baseStyles.boxShadow,
|
30348
|
-
"&:active": {
|
30349
|
-
borderColor: state.isFocused ? styles.dark : baseStyles.borderColor
|
30350
|
-
},
|
30351
|
-
"&:hover": {
|
30352
|
-
borderColor: state.isFocused ? styles.dark : baseStyles.borderColor
|
30353
|
-
},
|
30354
|
-
paddingBlock: '8px'
|
30355
|
-
});
|
30356
|
-
},
|
30357
|
-
singleValue: function singleValue(baseStyles) {
|
30358
|
-
return _extends({}, baseStyles, {
|
30359
|
-
fontSize: "16px",
|
30360
|
-
fontWeight: baseStyles.fontWeight,
|
30361
|
-
color: styles.darker
|
30362
|
-
});
|
30363
|
-
}
|
30364
|
-
};
|
30365
29711
|
var TextbookInfoTab = function TextbookInfoTab(_ref) {
|
30366
|
-
var
|
30367
|
-
var isCreatedByAdmin = _ref.isCreatedByAdmin,
|
30368
|
-
setFieldValue = _ref.setFieldValue,
|
29712
|
+
var setFieldValue = _ref.setFieldValue,
|
30369
29713
|
values = _ref.values,
|
30370
29714
|
errors = _ref.errors,
|
30371
29715
|
coverImage = _ref.coverImage,
|
30372
|
-
|
29716
|
+
isAdmin = _ref.isAdmin,
|
30373
29717
|
textbookId = _ref.textbookId,
|
30374
|
-
disabled = _ref.disabled,
|
30375
29718
|
handleUploadImage = _ref.handleUploadImage;
|
30376
29719
|
var _useTranslation = useTranslation(),
|
30377
29720
|
t = _useTranslation.t;
|
30378
|
-
var user = useSelector(function (state) {
|
30379
|
-
var _state$common;
|
30380
|
-
return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.user;
|
30381
|
-
});
|
30382
|
-
var isTeacher = user && (user === null || user === void 0 ? void 0 : (_user$roles = user.roles) === null || _user$roles === void 0 ? void 0 : _user$roles.includes(Role.Teacher));
|
30383
|
-
var gradeOptions = GRADE_OPTIONS.map(function (i) {
|
30384
|
-
return {
|
30385
|
-
label: t(i.label),
|
30386
|
-
value: i.value
|
30387
|
-
};
|
30388
|
-
});
|
30389
|
-
var preparedTypeOptions = Object.entries(PreparedType).filter(function (_ref2) {
|
30390
|
-
var key = _ref2[0];
|
30391
|
-
return isNaN(Number(key));
|
30392
|
-
}).map(function (_ref3) {
|
30393
|
-
var key = _ref3[0],
|
30394
|
-
value = _ref3[1];
|
30395
|
-
return {
|
30396
|
-
label: t(key),
|
30397
|
-
value: value
|
30398
|
-
};
|
30399
|
-
});
|
30400
|
-
var hidePublicField = !textbookId && isSuperAdminUser || textbookId && isCreatedByAdmin;
|
30401
29721
|
return React__default.createElement(Grid, {
|
30402
29722
|
padding: 3,
|
30403
29723
|
container: true,
|
@@ -30427,26 +29747,24 @@ var TextbookInfoTab = function TextbookInfoTab(_ref) {
|
|
30427
29747
|
style: {
|
30428
29748
|
padding: 4,
|
30429
29749
|
color: "#fff",
|
30430
|
-
background:
|
29750
|
+
background: styles.less_dark,
|
30431
29751
|
width: "150px",
|
30432
29752
|
borderRadius: "6px",
|
30433
29753
|
alignItems: "center",
|
30434
29754
|
justifyContent: "center",
|
30435
29755
|
position: "relative",
|
30436
29756
|
display: "flex",
|
30437
|
-
cursor:
|
29757
|
+
cursor: "pointer"
|
30438
29758
|
}
|
30439
29759
|
}, t("change_file"), React__default.createElement(VisuallyHiddenInput, {
|
30440
29760
|
id: "coverImage",
|
30441
29761
|
type: "file",
|
30442
29762
|
accept: "image/*",
|
30443
29763
|
onChange: function onChange(event) {
|
30444
|
-
return
|
29764
|
+
return handleUploadImage(event);
|
30445
29765
|
},
|
30446
29766
|
onClick: function onClick(e) {
|
30447
|
-
|
30448
|
-
e.target.value = "";
|
30449
|
-
}
|
29767
|
+
e.target.value = "";
|
30450
29768
|
}
|
30451
29769
|
}))) : React__default.createElement("label", {
|
30452
29770
|
htmlFor: "coverImage",
|
@@ -30459,19 +29777,17 @@ var TextbookInfoTab = function TextbookInfoTab(_ref) {
|
|
30459
29777
|
justifyContent: "center",
|
30460
29778
|
position: "relative",
|
30461
29779
|
display: "flex",
|
30462
|
-
cursor:
|
29780
|
+
cursor: "pointer"
|
30463
29781
|
}
|
30464
29782
|
}, React__default.createElement(IoIosAdd, null), React__default.createElement(VisuallyHiddenInput, {
|
30465
29783
|
id: "coverImage",
|
30466
29784
|
type: "file",
|
30467
29785
|
accept: "image/*",
|
30468
29786
|
onChange: function onChange(event) {
|
30469
|
-
return
|
29787
|
+
return handleUploadImage(event);
|
30470
29788
|
},
|
30471
29789
|
onClick: function onClick(e) {
|
30472
|
-
|
30473
|
-
e.target.value = "";
|
30474
|
-
}
|
29790
|
+
e.target.value = "";
|
30475
29791
|
}
|
30476
29792
|
})))), React__default.createElement(Grid, {
|
30477
29793
|
item: true,
|
@@ -30490,10 +29806,10 @@ var TextbookInfoTab = function TextbookInfoTab(_ref) {
|
|
30490
29806
|
htmlFor: "publicationDate"
|
30491
29807
|
}, t("publication_date")), React__default.createElement(Field, {
|
30492
29808
|
name: "publicationDate",
|
30493
|
-
render: function render(
|
30494
|
-
var
|
30495
|
-
value =
|
30496
|
-
action = _objectWithoutPropertiesLoose(
|
29809
|
+
render: function render(_ref2) {
|
29810
|
+
var _ref2$field = _ref2.field,
|
29811
|
+
value = _ref2$field.value,
|
29812
|
+
action = _objectWithoutPropertiesLoose(_ref2$field, _excluded$j);
|
30497
29813
|
return React__default.createElement(LocalizationProvider$1, {
|
30498
29814
|
dateAdapter: AdapterMoment
|
30499
29815
|
}, React__default.createElement(DatePicker$1, Object.assign({}, action, {
|
@@ -30505,8 +29821,7 @@ var TextbookInfoTab = function TextbookInfoTab(_ref) {
|
|
30505
29821
|
value: moment(value),
|
30506
29822
|
onChange: function onChange(value) {
|
30507
29823
|
return setFieldValue("publicationDate", moment(value).format(DATE_FORMAT));
|
30508
|
-
}
|
30509
|
-
disabled: disabled
|
29824
|
+
}
|
30510
29825
|
})));
|
30511
29826
|
}
|
30512
29827
|
}), !!(errors !== null && errors !== void 0 && errors.publicationDate) && React__default.createElement(Typography, {
|
@@ -30524,12 +29839,9 @@ var TextbookInfoTab = function TextbookInfoTab(_ref) {
|
|
30524
29839
|
htmlFor: "publisher"
|
30525
29840
|
}, t("publisher")), React__default.createElement(Field, {
|
30526
29841
|
name: "publisher",
|
30527
|
-
render: function render(
|
30528
|
-
var field =
|
30529
|
-
return React__default.createElement(TextField, Object.assign({}, field
|
30530
|
-
onKeyDown: handleKeyDown,
|
30531
|
-
disabled: disabled
|
30532
|
-
}));
|
29842
|
+
render: function render(_ref3) {
|
29843
|
+
var field = _ref3.field;
|
29844
|
+
return React__default.createElement(TextField, Object.assign({}, field));
|
30533
29845
|
}
|
30534
29846
|
}), !!(errors !== null && errors !== void 0 && errors.publisher) && React__default.createElement(Typography, {
|
30535
29847
|
fontWeight: 500,
|
@@ -30546,17 +29858,25 @@ var TextbookInfoTab = function TextbookInfoTab(_ref) {
|
|
30546
29858
|
htmlFor: "preparedType"
|
30547
29859
|
}, t("type")), React__default.createElement(Field, {
|
30548
29860
|
name: "preparedType",
|
30549
|
-
render: function render(
|
30550
|
-
var field =
|
30551
|
-
return React__default.createElement(
|
30552
|
-
|
30553
|
-
|
30554
|
-
|
30555
|
-
|
30556
|
-
|
30557
|
-
|
30558
|
-
|
30559
|
-
|
29861
|
+
render: function render(_ref4) {
|
29862
|
+
var field = _ref4.field;
|
29863
|
+
return React__default.createElement(Select$1, Object.assign({
|
29864
|
+
displayEmpty: true
|
29865
|
+
}, field), Object.entries(_extends({}, PreparedType)).filter(function (_ref5) {
|
29866
|
+
var label = _ref5[0];
|
29867
|
+
return !Number(label);
|
29868
|
+
}).map(function (_ref6, index) {
|
29869
|
+
var label = _ref6[0],
|
29870
|
+
value = _ref6[1];
|
29871
|
+
if (Number(label)) return;
|
29872
|
+
if (label === "my_created_questions" || label === "academy_questions") return React__default.createElement(MenuItem, {
|
29873
|
+
key: index,
|
29874
|
+
value: value
|
29875
|
+
}, t(label));
|
29876
|
+
return React__default.createElement(MenuItem, {
|
29877
|
+
key: index,
|
29878
|
+
value: index + 1
|
29879
|
+
}, t(label));
|
30560
29880
|
}));
|
30561
29881
|
}
|
30562
29882
|
}), !!(errors !== null && errors !== void 0 && errors.preparedType) && React__default.createElement(Typography, {
|
@@ -30576,20 +29896,17 @@ var TextbookInfoTab = function TextbookInfoTab(_ref) {
|
|
30576
29896
|
name: "isbn",
|
30577
29897
|
render: function render(_ref7) {
|
30578
29898
|
var field = _ref7.field;
|
30579
|
-
return React__default.createElement(TextField, Object.assign({}, field
|
30580
|
-
onKeyDown: handleKeyDown,
|
30581
|
-
disabled: disabled
|
30582
|
-
}));
|
29899
|
+
return React__default.createElement(TextField, Object.assign({}, field));
|
30583
29900
|
}
|
30584
29901
|
}), !!(errors !== null && errors !== void 0 && errors.isbn) && React__default.createElement(Typography, {
|
30585
29902
|
fontWeight: 500,
|
30586
29903
|
fontSize: "10px",
|
30587
29904
|
lineHeight: "11.93px",
|
30588
29905
|
color: !(errors !== null && errors !== void 0 && errors.isbn) ? "#97A1AF" : "#F34B4B"
|
30589
|
-
}, errors === null || errors === void 0 ? void 0 : errors.isbn))), React__default.createElement(Grid, {
|
29906
|
+
}, errors === null || errors === void 0 ? void 0 : errors.isbn))), !(isAdmin && !textbookId) && React__default.createElement(Grid, {
|
30590
29907
|
item: true,
|
30591
29908
|
xs: 6
|
30592
|
-
},
|
29909
|
+
}, React__default.createElement(Stack, {
|
30593
29910
|
flexDirection: "column",
|
30594
29911
|
gap: 1,
|
30595
29912
|
alignItems: "start"
|
@@ -30601,13 +29918,7 @@ var TextbookInfoTab = function TextbookInfoTab(_ref) {
|
|
30601
29918
|
var field = _ref8.field;
|
30602
29919
|
return React__default.createElement(Checkbox, Object.assign({
|
30603
29920
|
checked: field === null || field === void 0 ? void 0 : field.value
|
30604
|
-
}, field
|
30605
|
-
onChange: function onChange(e, checked) {
|
30606
|
-
field.onChange(e, checked);
|
30607
|
-
if (checked) setFieldValue("textbookOwners", []);
|
30608
|
-
},
|
30609
|
-
disabled: disabled
|
30610
|
-
}));
|
29921
|
+
}, field));
|
30611
29922
|
}
|
30612
29923
|
}), !!(errors !== null && errors !== void 0 && errors.isPublic) && React__default.createElement(Typography, {
|
30613
29924
|
fontWeight: 500,
|
@@ -30625,16 +29936,15 @@ var TextbookInfoTab = function TextbookInfoTab(_ref) {
|
|
30625
29936
|
}, t("grade")), React__default.createElement(Field, {
|
30626
29937
|
name: "grade",
|
30627
29938
|
render: function render(_ref9) {
|
30628
|
-
var field = _ref9.field
|
30629
|
-
|
30630
|
-
|
30631
|
-
|
30632
|
-
|
30633
|
-
|
30634
|
-
|
30635
|
-
}
|
30636
|
-
|
30637
|
-
}));
|
29939
|
+
var _ref9$field = _ref9.field,
|
29940
|
+
_onChange = _ref9$field.onChange,
|
29941
|
+
action = _objectWithoutPropertiesLoose(_ref9$field, _excluded2$2);
|
29942
|
+
return React__default.createElement(TextField, Object.assign({
|
29943
|
+
onChange: function onChange(e) {
|
29944
|
+
e.target.value = e.target.value.replace(/[^\d]/g, "");
|
29945
|
+
_onChange(e);
|
29946
|
+
}
|
29947
|
+
}, action));
|
30638
29948
|
}
|
30639
29949
|
}), !!(errors !== null && errors !== void 0 && errors.grade) && React__default.createElement(Typography, {
|
30640
29950
|
fontWeight: 500,
|
@@ -30650,16 +29960,19 @@ var AcademySelector = function AcademySelector(_ref) {
|
|
30650
29960
|
title = _ref.title,
|
30651
29961
|
options = _ref.options,
|
30652
29962
|
isLoading = _ref.isLoading,
|
29963
|
+
valueById = _ref.valueById,
|
30653
29964
|
isMultiple = _ref.isMultiple,
|
30654
29965
|
_ref$isClearable = _ref.isClearable,
|
30655
29966
|
isClearable = _ref$isClearable === void 0 ? true : _ref$isClearable,
|
30656
|
-
disabled = _ref.disabled
|
30657
|
-
defaultValue = _ref.defaultValue;
|
29967
|
+
disabled = _ref.disabled;
|
30658
29968
|
var _useState = useState(""),
|
30659
29969
|
searchString = _useState[0],
|
30660
29970
|
setSearchString = _useState[1];
|
30661
29971
|
var _useTranslation = useTranslation(),
|
30662
29972
|
t = _useTranslation.t;
|
29973
|
+
var valueOption = valueById !== null && typeof valueById !== "undefined" ? (options === null || options === void 0 ? void 0 : options.find(function (option) {
|
29974
|
+
return option.value == valueById;
|
29975
|
+
})) || null : null;
|
30663
29976
|
return React__default.createElement(FormGroup, null, !!title && React__default.createElement("label", {
|
30664
29977
|
className: "text-muted"
|
30665
29978
|
}, title), React__default.createElement(CustomSelectOption, {
|
@@ -30671,11 +29984,10 @@ var AcademySelector = function AcademySelector(_ref) {
|
|
30671
29984
|
isLoading: isLoading,
|
30672
29985
|
placeholder: t('please_select'),
|
30673
29986
|
isMulti: isMultiple,
|
30674
|
-
value: value,
|
29987
|
+
value: valueOption || value,
|
30675
29988
|
onChange: onChange,
|
30676
29989
|
isDisabled: disabled,
|
30677
|
-
isClearable: isClearable
|
30678
|
-
defaultValue: defaultValue
|
29990
|
+
isClearable: isClearable
|
30679
29991
|
}));
|
30680
29992
|
};
|
30681
29993
|
|
@@ -30689,12 +30001,15 @@ var CourseSelector = function CourseSelector(_ref) {
|
|
30689
30001
|
minimumTextSearchLength = _ref.minimumTextSearchLength,
|
30690
30002
|
placeholder = _ref.placeholder,
|
30691
30003
|
isClearable = _ref.isClearable,
|
30692
|
-
|
30004
|
+
valueById = _ref.valueById;
|
30693
30005
|
var _useState = useState(""),
|
30694
30006
|
searchString = _useState[0],
|
30695
30007
|
setSearchString = _useState[1];
|
30696
30008
|
var _useTranslation = useTranslation(),
|
30697
30009
|
t = _useTranslation.t;
|
30010
|
+
var valueOption = valueById !== null && typeof valueById !== "undefined" ? (options === null || options === void 0 ? void 0 : options.find(function (option) {
|
30011
|
+
return option.value == valueById;
|
30012
|
+
})) || null : null;
|
30698
30013
|
return React__default.createElement(FormGroup, null, !!title && React__default.createElement("label", null, title), React__default.createElement(CustomSelectOption, {
|
30699
30014
|
options: options,
|
30700
30015
|
inputValue: searchString,
|
@@ -30706,95 +30021,98 @@ var CourseSelector = function CourseSelector(_ref) {
|
|
30706
30021
|
number: minimumTextSearchLength
|
30707
30022
|
}) : t("select_class_placeholder")),
|
30708
30023
|
isMulti: isMulti,
|
30709
|
-
value: value,
|
30024
|
+
value: valueOption || value,
|
30710
30025
|
onChange: onChange,
|
30711
|
-
isClearable: isClearable
|
30712
|
-
isDisabled: isDisabled
|
30026
|
+
isClearable: isClearable
|
30713
30027
|
}));
|
30714
30028
|
};
|
30715
30029
|
|
30716
30030
|
var useSelect = function useSelect(_ref) {
|
30717
|
-
var
|
30031
|
+
var academyId = _ref.academyId,
|
30032
|
+
handleChangeEmail = _ref.handleChangeEmail;
|
30718
30033
|
var _useTranslation = useTranslation(),
|
30719
30034
|
t = _useTranslation.t;
|
30720
|
-
var academy = useSelector(function (state) {
|
30721
|
-
var _state$common;
|
30722
|
-
return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.academy;
|
30723
|
-
});
|
30724
|
-
var formattedAcademy = academy ? {
|
30725
|
-
label: academy.name,
|
30726
|
-
value: academy.id
|
30727
|
-
} : null;
|
30728
|
-
var academies = formattedAcademy ? [formattedAcademy] : [];
|
30729
30035
|
var _useState = useState([]),
|
30730
|
-
|
30731
|
-
|
30036
|
+
academies = _useState[0],
|
30037
|
+
setAcademies = _useState[1];
|
30732
30038
|
var _useState2 = useState(false),
|
30733
30039
|
isLoading = _useState2[0],
|
30734
30040
|
setLoading = _useState2[1];
|
30735
|
-
|
30736
|
-
|
30737
|
-
|
30738
|
-
|
30739
|
-
|
30740
|
-
|
30741
|
-
|
30742
|
-
|
30743
|
-
|
30744
|
-
|
30745
|
-
|
30746
|
-
|
30747
|
-
|
30748
|
-
|
30749
|
-
|
30750
|
-
|
30751
|
-
|
30752
|
-
setCourses(formattedCourses);
|
30753
|
-
});
|
30754
|
-
}, function (err) {
|
30755
|
-
toast.error(getErrorMessage(t, err));
|
30041
|
+
var user = useSelector(function (state) {
|
30042
|
+
var _state$common;
|
30043
|
+
return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.user;
|
30044
|
+
});
|
30045
|
+
var isSuperAdmin = !!user && !user.academyDomain;
|
30046
|
+
var loadData = _$5.debounce(function (e) {
|
30047
|
+
try {
|
30048
|
+
var _temp2 = function _temp2() {
|
30049
|
+
setLoading(false);
|
30050
|
+
};
|
30051
|
+
var value = e.target.value;
|
30052
|
+
setLoading(true);
|
30053
|
+
var _temp = _catch(function () {
|
30054
|
+
handleChangeEmail(value);
|
30055
|
+
return Promise.resolve(getAcademyByTeacher(value, isSuperAdmin)).then(function (_ref2) {
|
30056
|
+
var data = _ref2.data;
|
30057
|
+
setAcademies(data.data);
|
30756
30058
|
});
|
30757
|
-
|
30758
|
-
|
30759
|
-
|
30760
|
-
|
30761
|
-
}
|
30762
|
-
|
30763
|
-
|
30764
|
-
|
30765
|
-
|
30766
|
-
|
30059
|
+
}, function (err) {
|
30060
|
+
toast.error(getErrorMessage(t, err));
|
30061
|
+
});
|
30062
|
+
return Promise.resolve(_temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp));
|
30063
|
+
} catch (e) {
|
30064
|
+
return Promise.reject(e);
|
30065
|
+
}
|
30066
|
+
}, 1000);
|
30067
|
+
var academyOptions = useMemo(function () {
|
30068
|
+
if (!(academies !== null && academies !== void 0 && academies.length)) return [];
|
30069
|
+
return academies === null || academies === void 0 ? void 0 : academies.map(function (academy) {
|
30070
|
+
return {
|
30071
|
+
label: academy.name,
|
30072
|
+
value: academy.id
|
30073
|
+
};
|
30074
|
+
});
|
30075
|
+
}, [JSON.stringify(academies)]);
|
30076
|
+
var courseOptions = useMemo(function () {
|
30077
|
+
var _academy$courses;
|
30078
|
+
if (!academyId) return [];
|
30079
|
+
var academy = academies === null || academies === void 0 ? void 0 : academies.find(function (academy) {
|
30080
|
+
return academy.id === academyId;
|
30081
|
+
});
|
30082
|
+
return academy === null || academy === void 0 ? void 0 : (_academy$courses = academy.courses) === null || _academy$courses === void 0 ? void 0 : _academy$courses.map(function (course) {
|
30083
|
+
return {
|
30084
|
+
label: course.name,
|
30085
|
+
value: course.id
|
30086
|
+
};
|
30087
|
+
});
|
30088
|
+
}, [JSON.stringify(academies), academyId]);
|
30767
30089
|
return {
|
30768
30090
|
t: t,
|
30091
|
+
loadData: loadData,
|
30769
30092
|
isLoading: isLoading,
|
30770
|
-
|
30771
|
-
|
30093
|
+
academyOptions: academyOptions,
|
30094
|
+
courseOptions: courseOptions
|
30772
30095
|
};
|
30773
30096
|
};
|
30774
30097
|
|
30775
30098
|
var OwnerSelector = function OwnerSelector(_ref) {
|
30776
|
-
var _values$textbookOwner, _errors$textbookOwner, _errors$textbookOwner2, _values$
|
30099
|
+
var _values$textbookOwner, _errors$textbookOwner, _errors$textbookOwner2, _values$textbookOwner2, _errors$textbookOwner3, _errors$textbookOwner4;
|
30777
30100
|
var values = _ref.values,
|
30778
30101
|
errors = _ref.errors,
|
30779
30102
|
index = _ref.index,
|
30780
|
-
|
30781
|
-
onChangeFieldValue = _ref.onChangeFieldValue
|
30782
|
-
|
30103
|
+
academyId = _ref.academyId,
|
30104
|
+
onChangeFieldValue = _ref.onChangeFieldValue;
|
30105
|
+
var handleChangeEmail = function handleChangeEmail(value) {
|
30106
|
+
onChangeFieldValue("textbookOwners[" + index + "].email", value);
|
30107
|
+
};
|
30783
30108
|
var _useSelect = useSelect({
|
30784
|
-
|
30109
|
+
academyId: academyId,
|
30110
|
+
handleChangeEmail: handleChangeEmail
|
30785
30111
|
}),
|
30786
30112
|
t = _useSelect.t,
|
30787
30113
|
isLoading = _useSelect.isLoading,
|
30788
|
-
|
30789
|
-
|
30790
|
-
var handleChangeAcademy = function handleChangeAcademy(val) {
|
30791
|
-
onChangeFieldValue("textbookOwners[" + index + "].academyId", val === null || val === void 0 ? void 0 : val.value);
|
30792
|
-
onChangeFieldValue("textbookOwners[" + index + "].academy", val);
|
30793
|
-
};
|
30794
|
-
var handleChangeCourse = function handleChangeCourse(val) {
|
30795
|
-
onChangeFieldValue("textbookOwners[" + index + "].courseId", val === null || val === void 0 ? void 0 : val.value);
|
30796
|
-
onChangeFieldValue("textbookOwners[" + index + "].course", val);
|
30797
|
-
};
|
30114
|
+
academyOptions = _useSelect.academyOptions,
|
30115
|
+
courseOptions = _useSelect.courseOptions;
|
30798
30116
|
return React__default.createElement(React__default.Fragment, null, (values === null || values === void 0 ? void 0 : (_values$textbookOwner = values.textbookOwners) === null || _values$textbookOwner === void 0 ? void 0 : _values$textbookOwner[index].email) && React__default.createElement(Stack, {
|
30799
30117
|
flexDirection: "column",
|
30800
30118
|
gap: 1,
|
@@ -30804,16 +30122,14 @@ var OwnerSelector = function OwnerSelector(_ref) {
|
|
30804
30122
|
}, t("academy")), React__default.createElement(Field, {
|
30805
30123
|
name: "textbookOwners[" + index + "].academyId",
|
30806
30124
|
render: function render(_ref2) {
|
30807
|
-
var _values$textbookOwner2;
|
30808
30125
|
var field = _ref2.field;
|
30809
30126
|
return React__default.createElement(AcademySelector, Object.assign({}, field, {
|
30810
|
-
options:
|
30811
|
-
disabled: true,
|
30812
|
-
value: (_values$textbookOwner2 = values.textbookOwners[index]) === null || _values$textbookOwner2 === void 0 ? void 0 : _values$textbookOwner2.academy,
|
30127
|
+
options: academyOptions,
|
30813
30128
|
isLoading: isLoading,
|
30814
30129
|
valueById: field === null || field === void 0 ? void 0 : field.value,
|
30815
|
-
onChange:
|
30816
|
-
|
30130
|
+
onChange: function onChange(val) {
|
30131
|
+
return onChangeFieldValue("textbookOwners[" + index + "].academyId", val === null || val === void 0 ? void 0 : val.value);
|
30132
|
+
}
|
30817
30133
|
}));
|
30818
30134
|
}
|
30819
30135
|
}), !!(errors !== null && errors !== void 0 && (_errors$textbookOwner = errors.textbookOwners) !== null && _errors$textbookOwner !== void 0 && (_errors$textbookOwner2 = _errors$textbookOwner[index]) !== null && _errors$textbookOwner2 !== void 0 && _errors$textbookOwner2.academyId) && React__default.createElement(Typography, {
|
@@ -30821,7 +30137,7 @@ var OwnerSelector = function OwnerSelector(_ref) {
|
|
30821
30137
|
fontSize: "10px",
|
30822
30138
|
lineHeight: "11.93px",
|
30823
30139
|
color: !(errors !== null && errors !== void 0 && errors.textbookOwners[index].academyId) ? "#97A1AF" : "#F34B4B"
|
30824
|
-
}, errors === null || errors === void 0 ? void 0 : errors.textbookOwners[index].academyId)), (values === null || values === void 0 ? void 0 : (_values$
|
30140
|
+
}, errors === null || errors === void 0 ? void 0 : errors.textbookOwners[index].academyId)), (values === null || values === void 0 ? void 0 : (_values$textbookOwner2 = values.textbookOwners) === null || _values$textbookOwner2 === void 0 ? void 0 : _values$textbookOwner2[index].email) && React__default.createElement(Stack, {
|
30825
30141
|
flexDirection: "column",
|
30826
30142
|
gap: 1,
|
30827
30143
|
width: 1
|
@@ -30830,14 +30146,14 @@ var OwnerSelector = function OwnerSelector(_ref) {
|
|
30830
30146
|
}, t("class")), React__default.createElement(Field, {
|
30831
30147
|
name: "textbookOwners[" + index + "].courseId",
|
30832
30148
|
render: function render(_ref3) {
|
30833
|
-
var _values$textbookOwner4;
|
30834
30149
|
var field = _ref3.field;
|
30835
30150
|
return React__default.createElement(CourseSelector, Object.assign({}, field, {
|
30836
|
-
options:
|
30151
|
+
options: courseOptions,
|
30837
30152
|
isLoading: isLoading,
|
30838
|
-
|
30839
|
-
onChange:
|
30840
|
-
|
30153
|
+
valueById: field === null || field === void 0 ? void 0 : field.value,
|
30154
|
+
onChange: function onChange(val) {
|
30155
|
+
return onChangeFieldValue("textbookOwners[" + index + "].courseId", val === null || val === void 0 ? void 0 : val.value);
|
30156
|
+
}
|
30841
30157
|
}));
|
30842
30158
|
}
|
30843
30159
|
}), !!(errors !== null && errors !== void 0 && (_errors$textbookOwner3 = errors.textbookOwners) !== null && _errors$textbookOwner3 !== void 0 && (_errors$textbookOwner4 = _errors$textbookOwner3[index]) !== null && _errors$textbookOwner4 !== void 0 && _errors$textbookOwner4.courseId) && React__default.createElement(Typography, {
|
@@ -30852,16 +30168,10 @@ var _$4 = _$5;
|
|
30852
30168
|
var TextbookOwnersTab = function TextbookOwnersTab(_ref) {
|
30853
30169
|
var errors = _ref.errors,
|
30854
30170
|
values = _ref.values,
|
30855
|
-
disabled = _ref.disabled,
|
30856
30171
|
setFieldValue = _ref.setFieldValue;
|
30857
30172
|
var textbookOwners = values.textbookOwners;
|
30858
|
-
var academy = useSelector(function (state) {
|
30859
|
-
var _state$common;
|
30860
|
-
return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.academy;
|
30861
|
-
});
|
30862
30173
|
var _useTranslation = useTranslation(),
|
30863
30174
|
t = _useTranslation.t;
|
30864
|
-
var hasErrors = errors.textbookOwners;
|
30865
30175
|
return React__default.createElement(Box, {
|
30866
30176
|
className: "bg-white mt-2",
|
30867
30177
|
sx: {
|
@@ -30874,15 +30184,15 @@ var TextbookOwnersTab = function TextbookOwnersTab(_ref) {
|
|
30874
30184
|
return React__default.createElement(Grid, {
|
30875
30185
|
container: true,
|
30876
30186
|
spacing: "16px"
|
30877
|
-
}, textbookOwners === null || textbookOwners === void 0 ? void 0 : textbookOwners.map(function (
|
30878
|
-
var
|
30187
|
+
}, textbookOwners === null || textbookOwners === void 0 ? void 0 : textbookOwners.map(function (_val, index) {
|
30188
|
+
var _values$textbookOwner, _values$textbookOwner2, _values$textbookOwner3;
|
30879
30189
|
return React__default.createElement(Grid, {
|
30880
30190
|
item: true,
|
30881
30191
|
xs: 6,
|
30882
|
-
lg:
|
30192
|
+
lg: 2
|
30883
30193
|
}, React__default.createElement(Stack, {
|
30884
30194
|
sx: {
|
30885
|
-
border: "1px solid " +
|
30195
|
+
border: "1px solid " + styles.gray_300,
|
30886
30196
|
borderRadius: "6px",
|
30887
30197
|
width: "100%",
|
30888
30198
|
height: "350px",
|
@@ -30900,7 +30210,6 @@ var TextbookOwnersTab = function TextbookOwnersTab(_ref) {
|
|
30900
30210
|
top: 8,
|
30901
30211
|
color: styles.gray_500
|
30902
30212
|
},
|
30903
|
-
disabled: disabled || !!val.academyId && val.academyId !== (academy === null || academy === void 0 ? void 0 : academy.id),
|
30904
30213
|
onClick: function onClick() {
|
30905
30214
|
arrayHelpers.remove(index);
|
30906
30215
|
}
|
@@ -30916,28 +30225,24 @@ var TextbookOwnersTab = function TextbookOwnersTab(_ref) {
|
|
30916
30225
|
var field = _ref2.field;
|
30917
30226
|
return React__default.createElement(TextField, Object.assign({
|
30918
30227
|
fullWidth: true
|
30919
|
-
}, field
|
30920
|
-
onKeyDown: handleKeyDown,
|
30921
|
-
disabled: disabled || !!val.academyId && val.academyId !== (academy === null || academy === void 0 ? void 0 : academy.id)
|
30922
|
-
}));
|
30228
|
+
}, field));
|
30923
30229
|
}
|
30924
30230
|
}), _$4.get(errors, "textbookOwners[" + index + "].email") && React__default.createElement(Typography, {
|
30925
30231
|
fontWeight: 500,
|
30926
30232
|
fontSize: "10px",
|
30927
30233
|
lineHeight: "11.93px",
|
30928
|
-
color: "#F34B4B"
|
30234
|
+
color: _$4.get(errors, "textbookOwners[" + index + "].email") ? "#97A1AF" : "#F34B4B"
|
30929
30235
|
}, _$4.get(errors, "textbookOwners[" + index + "].email"))), !!(values !== null && values !== void 0 && (_values$textbookOwner = values.textbookOwners) !== null && _values$textbookOwner !== void 0 && _values$textbookOwner[index].email) && React__default.createElement(OwnerSelector, {
|
30930
30236
|
values: values,
|
30931
30237
|
errors: errors,
|
30932
30238
|
index: index,
|
30933
|
-
email: values === null || values === void 0 ? void 0 : (_values$textbookOwner2 = values.textbookOwners) === null || _values$textbookOwner2 === void 0 ? void 0 : _values$textbookOwner2[index].email,
|
30934
30239
|
onChangeFieldValue: setFieldValue,
|
30935
|
-
|
30240
|
+
academyId: values === null || values === void 0 ? void 0 : (_values$textbookOwner2 = values.textbookOwners) === null || _values$textbookOwner2 === void 0 ? void 0 : (_values$textbookOwner3 = _values$textbookOwner2[index]) === null || _values$textbookOwner3 === void 0 ? void 0 : _values$textbookOwner3.academyId
|
30936
30241
|
})));
|
30937
|
-
}),
|
30242
|
+
}), React__default.createElement(Grid, {
|
30938
30243
|
item: true,
|
30939
30244
|
xs: 6,
|
30940
|
-
lg:
|
30245
|
+
lg: 2
|
30941
30246
|
}, React__default.createElement("div", {
|
30942
30247
|
style: {
|
30943
30248
|
display: "flex",
|
@@ -30951,14 +30256,7 @@ var TextbookOwnersTab = function TextbookOwnersTab(_ref) {
|
|
30951
30256
|
background: styles.gray_50
|
30952
30257
|
},
|
30953
30258
|
onClick: function onClick() {
|
30954
|
-
|
30955
|
-
arrayHelpers.push(_extends({}, DefaultTextbookOwner, {
|
30956
|
-
academy: academy ? {
|
30957
|
-
label: academy.name,
|
30958
|
-
value: academy.id
|
30959
|
-
} : null,
|
30960
|
-
academyId: (_academy$id = academy === null || academy === void 0 ? void 0 : academy.id) != null ? _academy$id : null
|
30961
|
-
}));
|
30259
|
+
return arrayHelpers.push(DefaultTextbookOwner);
|
30962
30260
|
}
|
30963
30261
|
}, React__default.createElement(Stack, null, React__default.createElement(IoMdAdd, {
|
30964
30262
|
size: 24
|
@@ -30967,20 +30265,160 @@ var TextbookOwnersTab = function TextbookOwnersTab(_ref) {
|
|
30967
30265
|
}));
|
30968
30266
|
};
|
30969
30267
|
|
30970
|
-
var
|
30268
|
+
var _reduceToMathArticles = function reduceToMathArticles(textbook, isMath) {
|
30269
|
+
var values = isMath !== undefined ? _$5.cloneDeep(textbook) : textbook;
|
30270
|
+
if (isMath !== undefined) values.type = isMath;
|
30271
|
+
for (var key in values) {
|
30272
|
+
if (values.hasOwnProperty(key)) {
|
30273
|
+
if (key === "articles") {
|
30274
|
+
var _values$key;
|
30275
|
+
values[key] = (_values$key = values[key]) !== null && _values$key !== void 0 && _values$key.length ? [values[key][0]] : [DEFAULT_ARTICLE];
|
30276
|
+
} else if (typeof values[key] === "object" && values[key] !== null) {
|
30277
|
+
_reduceToMathArticles(values[key]);
|
30278
|
+
}
|
30279
|
+
}
|
30280
|
+
}
|
30281
|
+
return values;
|
30282
|
+
};
|
30283
|
+
var _resetAllCategoriesAndQuestionTypesBySubject = function resetAllCategoriesAndQuestionTypesBySubject(textbook, subject) {
|
30284
|
+
var values = subject ? _$5.cloneDeep(textbook) : textbook;
|
30285
|
+
if (subject) {
|
30286
|
+
values.subjectId = subject === null || subject === void 0 ? void 0 : subject.value;
|
30287
|
+
values.subject = subject;
|
30288
|
+
}
|
30289
|
+
for (var key in values) {
|
30290
|
+
if (values.hasOwnProperty(key)) {
|
30291
|
+
if (key === "categories" || key === "categoryOptions") {
|
30292
|
+
values[key] = [];
|
30293
|
+
} else if (key === "questionType" || key === "questionTypeId") {
|
30294
|
+
values[key] = null;
|
30295
|
+
} else if (typeof values[key] === "object" && values[key] !== null) {
|
30296
|
+
_resetAllCategoriesAndQuestionTypesBySubject(values[key]);
|
30297
|
+
}
|
30298
|
+
}
|
30299
|
+
}
|
30300
|
+
return values;
|
30301
|
+
};
|
30302
|
+
var convertResponseToRequest = function convertResponseToRequest(selectedTextbook) {
|
30303
|
+
var _selectedTextbook$sub;
|
30304
|
+
if (!selectedTextbook) return DEFAULT_TEXTBOOK_REQUEST;
|
30305
|
+
return {
|
30306
|
+
name: selectedTextbook.name || "",
|
30307
|
+
subjectId: ((_selectedTextbook$sub = selectedTextbook.subject) === null || _selectedTextbook$sub === void 0 ? void 0 : _selectedTextbook$sub.id) || 0,
|
30308
|
+
subject: selectedTextbook.subject ? {
|
30309
|
+
label: selectedTextbook.subject.name,
|
30310
|
+
value: selectedTextbook.subject.id
|
30311
|
+
} : null,
|
30312
|
+
preparedType: selectedTextbook.preparedType || 0,
|
30313
|
+
grade: selectedTextbook.grade || "1",
|
30314
|
+
publicationDate: (selectedTextbook === null || selectedTextbook === void 0 ? void 0 : selectedTextbook.publicationDate) || "",
|
30315
|
+
publisher: selectedTextbook.publisher || "",
|
30316
|
+
isbn: selectedTextbook.isbn || "",
|
30317
|
+
coverImage: selectedTextbook.coverImage || "",
|
30318
|
+
textbookOwners: selectedTextbook.textbookOwners,
|
30319
|
+
isPublic: selectedTextbook.isPublic || false,
|
30320
|
+
isShared: selectedTextbook.isShared || false,
|
30321
|
+
isPrepared: true,
|
30322
|
+
type: selectedTextbook.type,
|
30323
|
+
chapters: selectedTextbook.chapters.map(function (c) {
|
30324
|
+
var _c$questionGroups;
|
30325
|
+
return {
|
30326
|
+
name: c.name,
|
30327
|
+
pageFrom: c.pageFrom || 0,
|
30328
|
+
pageTo: c.pageTo || 0,
|
30329
|
+
id: c.id,
|
30330
|
+
questionGroups: ((_c$questionGroups = c.questionGroups) === null || _c$questionGroups === void 0 ? void 0 : _c$questionGroups.map(function (g) {
|
30331
|
+
var _g$questions$;
|
30332
|
+
return {
|
30333
|
+
id: g.id,
|
30334
|
+
chapterId: c.id,
|
30335
|
+
questions: g.questions.map(function (q) {
|
30336
|
+
var _q$questionType;
|
30337
|
+
return _extends({}, q, {
|
30338
|
+
questionTypeId: q.questionTypeId || q.questionType.id,
|
30339
|
+
questionType: (_q$questionType = q.questionType) !== null && _q$questionType !== void 0 && _q$questionType.id ? {
|
30340
|
+
label: q.questionType.name,
|
30341
|
+
value: q.questionType.id
|
30342
|
+
} : null
|
30343
|
+
});
|
30344
|
+
}),
|
30345
|
+
articles: g.articles.map(function (a) {
|
30346
|
+
return _extends({}, a, {
|
30347
|
+
categoryOptions: a.categories.map(function (cat) {
|
30348
|
+
return {
|
30349
|
+
label: cat.name,
|
30350
|
+
value: cat.id
|
30351
|
+
};
|
30352
|
+
}),
|
30353
|
+
categories: a.categories.filter(function (cat) {
|
30354
|
+
return !!cat.id;
|
30355
|
+
}).map(function (cat) {
|
30356
|
+
return cat.id;
|
30357
|
+
})
|
30358
|
+
});
|
30359
|
+
}),
|
30360
|
+
questionCount: g.questions.length,
|
30361
|
+
answerCount: ((_g$questions$ = g.questions[0]) === null || _g$questions$ === void 0 ? void 0 : _g$questions$.numberOfAnswers) || 5
|
30362
|
+
};
|
30363
|
+
})) || [],
|
30364
|
+
subChapters: c.subChapters.map(function (sub) {
|
30365
|
+
var _sub$questionGroups;
|
30366
|
+
return {
|
30367
|
+
name: sub.name,
|
30368
|
+
pageFrom: sub.pageFrom || 0,
|
30369
|
+
pageTo: sub.pageTo || 0,
|
30370
|
+
id: sub.id,
|
30371
|
+
questionGroups: ((_sub$questionGroups = sub.questionGroups) === null || _sub$questionGroups === void 0 ? void 0 : _sub$questionGroups.map(function (g) {
|
30372
|
+
var _g$questions$2;
|
30373
|
+
return {
|
30374
|
+
id: g.id,
|
30375
|
+
chapterId: c.id,
|
30376
|
+
questions: g.questions.map(function (q) {
|
30377
|
+
var _q$questionType2;
|
30378
|
+
return _extends({}, q, {
|
30379
|
+
questionTypeId: q.questionTypeId || q.questionType.id,
|
30380
|
+
questionType: (_q$questionType2 = q.questionType) !== null && _q$questionType2 !== void 0 && _q$questionType2.id ? {
|
30381
|
+
label: q.questionType.name,
|
30382
|
+
value: q.questionType.id
|
30383
|
+
} : null
|
30384
|
+
});
|
30385
|
+
}),
|
30386
|
+
articles: g.articles.map(function (a) {
|
30387
|
+
return _extends({}, a, {
|
30388
|
+
categoryOptions: a.categories.map(function (cat) {
|
30389
|
+
return {
|
30390
|
+
label: cat.name,
|
30391
|
+
value: cat.id
|
30392
|
+
};
|
30393
|
+
}),
|
30394
|
+
categories: a.categories.filter(function (cat) {
|
30395
|
+
return !!cat.id;
|
30396
|
+
}).map(function (cat) {
|
30397
|
+
return cat.id;
|
30398
|
+
})
|
30399
|
+
});
|
30400
|
+
}),
|
30401
|
+
questionCount: g.questions.length,
|
30402
|
+
answerCount: ((_g$questions$2 = g.questions[0]) === null || _g$questions$2 === void 0 ? void 0 : _g$questions$2.numberOfAnswers) || 5
|
30403
|
+
};
|
30404
|
+
})) || [],
|
30405
|
+
subChapters: []
|
30406
|
+
};
|
30407
|
+
})
|
30408
|
+
};
|
30409
|
+
})
|
30410
|
+
};
|
30411
|
+
};
|
30412
|
+
|
30413
|
+
var _excluded$k = ["isAdmin", "textbookId", "selected", "coverImage", "onChangeTab", "onUploadImage"];
|
30971
30414
|
var PreparedTextbookForm = function PreparedTextbookForm(_ref) {
|
30972
|
-
var
|
30973
|
-
isSuperAdminUser = _ref.isSuperAdminUser,
|
30974
|
-
isSuperAdmin = _ref.isSuperAdmin,
|
30975
|
-
isAdmin = _ref.isAdmin,
|
30415
|
+
var isAdmin = _ref.isAdmin,
|
30976
30416
|
textbookId = _ref.textbookId,
|
30977
30417
|
selected = _ref.selected,
|
30978
30418
|
coverImage = _ref.coverImage,
|
30979
|
-
disabled = _ref.disabled,
|
30980
|
-
ownersDisabled = _ref.ownersDisabled,
|
30981
30419
|
onChangeTab = _ref.onChangeTab,
|
30982
30420
|
onUploadImage = _ref.onUploadImage,
|
30983
|
-
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$
|
30421
|
+
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$k);
|
30984
30422
|
var values = formikProps.values,
|
30985
30423
|
errors = formikProps.errors,
|
30986
30424
|
dirty = formikProps.dirty,
|
@@ -30998,7 +30436,7 @@ var PreparedTextbookForm = function PreparedTextbookForm(_ref) {
|
|
30998
30436
|
};
|
30999
30437
|
}, [dirty, t$1]);
|
31000
30438
|
var handleChangeTextbookType = function handleChangeTextbookType() {
|
31001
|
-
var isMath = values.type ===
|
30439
|
+
var isMath = values.type === 2 ? 1 : 2;
|
31002
30440
|
var newValues = _reduceToMathArticles(values, isMath);
|
31003
30441
|
setValues(newValues);
|
31004
30442
|
};
|
@@ -31035,9 +30473,7 @@ var PreparedTextbookForm = function PreparedTextbookForm(_ref) {
|
|
31035
30473
|
return React__default.createElement(TextField, Object.assign({
|
31036
30474
|
placeholder: t$1("title")
|
31037
30475
|
}, field, {
|
31038
|
-
size: "small"
|
31039
|
-
disabled: disabled,
|
31040
|
-
onKeyDown: handleKeyDown
|
30476
|
+
size: "small"
|
31041
30477
|
}));
|
31042
30478
|
}
|
31043
30479
|
}), !!(errors !== null && errors !== void 0 && errors.name) && React__default.createElement(Typography, {
|
@@ -31057,7 +30493,7 @@ var PreparedTextbookForm = function PreparedTextbookForm(_ref) {
|
|
31057
30493
|
var field = _ref3.field;
|
31058
30494
|
return React__default.createElement(SubjectSelector, Object.assign({}, field, {
|
31059
30495
|
value: values.subject,
|
31060
|
-
isDisabled: !!textbookId
|
30496
|
+
isDisabled: !!textbookId,
|
31061
30497
|
onChange: handleChangeSubject
|
31062
30498
|
}));
|
31063
30499
|
}
|
@@ -31079,7 +30515,7 @@ var PreparedTextbookForm = function PreparedTextbookForm(_ref) {
|
|
31079
30515
|
var field = _ref4.field;
|
31080
30516
|
return React__default.createElement(Switch, Object.assign({}, field, {
|
31081
30517
|
color: "success",
|
31082
|
-
disabled: !!textbookId
|
30518
|
+
disabled: !!textbookId,
|
31083
30519
|
checked: values.type === 2,
|
31084
30520
|
onChange: handleChangeTextbookType
|
31085
30521
|
}));
|
@@ -31090,7 +30526,6 @@ var PreparedTextbookForm = function PreparedTextbookForm(_ref) {
|
|
31090
30526
|
width: "fit-content"
|
31091
30527
|
},
|
31092
30528
|
variant: "contained",
|
31093
|
-
disabled: disabled,
|
31094
30529
|
onClick: function onClick() {
|
31095
30530
|
if (!_$5.isEmpty(errors)) {
|
31096
30531
|
toast.error(t$1("please_fill_in_the_blank_fields"));
|
@@ -31133,7 +30568,7 @@ var PreparedTextbookForm = function PreparedTextbookForm(_ref) {
|
|
31133
30568
|
sx: {
|
31134
30569
|
color: contentsErrors && submitCount ? error.main + "!important" : "gray"
|
31135
30570
|
}
|
31136
|
-
}, a11yProps(1))), !(values !== null && values !== void 0 && values.isPublic) && (!
|
30571
|
+
}, a11yProps(1))), !(values !== null && values !== void 0 && values.isPublic) && (!isAdmin || textbookId) && (!textbookId || (values === null || values === void 0 ? void 0 : values.isShared)) && React__default.createElement(Tab, Object.assign({
|
31137
30572
|
label: t$1("textbook.owners"),
|
31138
30573
|
sx: {
|
31139
30574
|
color: textbookOwnersErrors && submitCount ? error.main + "!important" : "gray"
|
@@ -31145,20 +30580,14 @@ var PreparedTextbookForm = function PreparedTextbookForm(_ref) {
|
|
31145
30580
|
coverImage: coverImage,
|
31146
30581
|
handleUploadImage: onUploadImage,
|
31147
30582
|
textbookId: textbookId,
|
31148
|
-
|
31149
|
-
isCreatedByAdmin: isCreatedByAdmin,
|
31150
|
-
isSuperAdminUser: isSuperAdminUser
|
30583
|
+
isAdmin: isAdmin
|
31151
30584
|
}))), React__default.createElement(CustomTextbookTab, {
|
31152
30585
|
value: selected,
|
31153
30586
|
index: 1
|
31154
|
-
}, React__default.createElement(TextbookContentsTab, Object.assign({}, formikProps, {
|
31155
|
-
disabled: disabled
|
31156
|
-
}))), React__default.createElement(CustomTextbookTab, {
|
30587
|
+
}, React__default.createElement(TextbookContentsTab, Object.assign({}, formikProps))), React__default.createElement(CustomTextbookTab, {
|
31157
30588
|
value: selected,
|
31158
30589
|
index: 2
|
31159
|
-
}, React__default.createElement(TextbookOwnersTab, Object.assign({}, formikProps
|
31160
|
-
disabled: ownersDisabled
|
31161
|
-
}))))));
|
30590
|
+
}, React__default.createElement(TextbookOwnersTab, Object.assign({}, formikProps))))));
|
31162
30591
|
};
|
31163
30592
|
var a11yProps = function a11yProps(index) {
|
31164
30593
|
return {
|
@@ -31168,8 +30597,7 @@ var a11yProps = function a11yProps(index) {
|
|
31168
30597
|
};
|
31169
30598
|
|
31170
30599
|
var PreparedTextbookView = function PreparedTextbookView(_ref) {
|
31171
|
-
var
|
31172
|
-
notFoundView = _ref.notFoundView,
|
30600
|
+
var notFoundView = _ref.notFoundView,
|
31173
30601
|
onBackToList = _ref.onBackToList,
|
31174
30602
|
textbookId = _ref.textbookId;
|
31175
30603
|
var _useState = useState(0),
|
@@ -31180,15 +30608,9 @@ var PreparedTextbookView = function PreparedTextbookView(_ref) {
|
|
31180
30608
|
};
|
31181
30609
|
var _useTextbookManagemen = useTextbookManagement({
|
31182
30610
|
onNavigateList: onBackToList,
|
31183
|
-
textbookId: textbookId
|
31184
|
-
role: role
|
30611
|
+
textbookId: textbookId
|
31185
30612
|
}),
|
31186
30613
|
t = _useTextbookManagemen.t,
|
31187
|
-
disabledTextbookOwners = _useTextbookManagemen.disabledTextbookOwners,
|
31188
|
-
isReadonly = _useTextbookManagemen.isReadonly,
|
31189
|
-
isEditable = _useTextbookManagemen.isEditable,
|
31190
|
-
isSuperAdmin = _useTextbookManagemen.isSuperAdmin,
|
31191
|
-
isSuperAdminUser = _useTextbookManagemen.isSuperAdminUser,
|
31192
30614
|
isAdmin = _useTextbookManagemen.isAdmin,
|
31193
30615
|
coverImage = _useTextbookManagemen.coverImage,
|
31194
30616
|
selectedTextbook = _useTextbookManagemen.selectedTextbook,
|
@@ -31197,7 +30619,6 @@ var PreparedTextbookView = function PreparedTextbookView(_ref) {
|
|
31197
30619
|
var textbookRequest = useMemo(function () {
|
31198
30620
|
return convertResponseToRequest(selectedTextbook);
|
31199
30621
|
}, [JSON.stringify(selectedTextbook)]);
|
31200
|
-
var isCreatedByAdmin = selectedTextbook === null || selectedTextbook === void 0 ? void 0 : selectedTextbook.isCreatedByAdmin;
|
31201
30622
|
if (textbookId && selectedTextbook && !selectedTextbook.isPrepared) return notFoundView;
|
31202
30623
|
return React__default.createElement(Box, null, React__default.createElement(Formik, {
|
31203
30624
|
initialValues: textbookRequest,
|
@@ -31208,17 +30629,12 @@ var PreparedTextbookView = function PreparedTextbookView(_ref) {
|
|
31208
30629
|
onSubmit: handleSubmit
|
31209
30630
|
}, function (props) {
|
31210
30631
|
return React__default.createElement(PreparedTextbookForm, Object.assign({
|
31211
|
-
isCreatedByAdmin: isCreatedByAdmin,
|
31212
|
-
isSuperAdminUser: isSuperAdminUser,
|
31213
30632
|
isAdmin: isAdmin,
|
31214
|
-
isSuperAdmin: isSuperAdmin,
|
31215
30633
|
selected: selected,
|
31216
30634
|
textbookId: textbookId,
|
31217
30635
|
onChangeTab: handleChangeTab,
|
31218
30636
|
onUploadImage: handleUploadImage,
|
31219
|
-
coverImage: coverImage
|
31220
|
-
disabled: isReadonly || !isEditable,
|
31221
|
-
ownersDisabled: isReadonly || disabledTextbookOwners
|
30637
|
+
coverImage: coverImage
|
31222
30638
|
}, props));
|
31223
30639
|
}));
|
31224
30640
|
};
|
@@ -32451,7 +31867,7 @@ var ChapterProblemSolvingResultsDialog = function ChapterProblemSolvingResultsDi
|
|
32451
31867
|
}, t("cancel"))))));
|
32452
31868
|
};
|
32453
31869
|
|
32454
|
-
var _excluded$
|
31870
|
+
var _excluded$l = ["onChange"];
|
32455
31871
|
var StartPageDialog = function StartPageDialog(_ref) {
|
32456
31872
|
var t = _ref.t,
|
32457
31873
|
onClose = _ref.onClose,
|
@@ -32512,7 +31928,7 @@ var StartPageDialog = function StartPageDialog(_ref) {
|
|
32512
31928
|
}, t("page_to_start_with")), React__default.createElement(Field, {
|
32513
31929
|
name: "startPage",
|
32514
31930
|
render: function render(_ref3) {
|
32515
|
-
var field = _objectWithoutPropertiesLoose(_ref3, _excluded$
|
31931
|
+
var field = _objectWithoutPropertiesLoose(_ref3, _excluded$l);
|
32516
31932
|
return React__default.createElement(CustomSelectOption, Object.assign({
|
32517
31933
|
menuPosition: "fixed",
|
32518
31934
|
onChange: function onChange(option) {
|
@@ -34038,7 +33454,7 @@ var PreparedItem = function PreparedItem(_ref) {
|
|
34038
33454
|
}))));
|
34039
33455
|
};
|
34040
33456
|
|
34041
|
-
var MenuItemCustom = styled(MenuItem)(function () {
|
33457
|
+
var MenuItemCustom = styled(MenuItem$1)(function () {
|
34042
33458
|
return {
|
34043
33459
|
'&.Mui-selected': {
|
34044
33460
|
backgroundColor: styles.light
|
@@ -34413,7 +33829,7 @@ var TheLanguageDropdown = function TheLanguageDropdown() {
|
|
34413
33829
|
}
|
34414
33830
|
}
|
34415
33831
|
}, LANGUAGES.map(function (option) {
|
34416
|
-
return React__default.createElement(MenuItem, {
|
33832
|
+
return React__default.createElement(MenuItem$1, {
|
34417
33833
|
key: option.code,
|
34418
33834
|
selected: option.code === (currentLanguage === null || currentLanguage === void 0 ? void 0 : currentLanguage.code),
|
34419
33835
|
onClick: function onClick() {
|
@@ -35077,5 +34493,5 @@ var LayoutContext = function LayoutContext(_ref) {
|
|
35077
34493
|
});else return React__default.createElement(Fragment$1, null, children);
|
35078
34494
|
};
|
35079
34495
|
|
35080
|
-
export { ACADEMY_DOMAIN, ACCESS_TOKEN, AcademyHeaders, AcademyList, AcceptNoAcademy, ActionButtons, AnswerCountSelector, ArticleCategorySelector, ArticleDialog, ArticleGroupView, BASE_URL,
|
34496
|
+
export { ACADEMY_DOMAIN, ACCESS_TOKEN, AcademyHeaders, AcademyList, AcceptNoAcademy, ActionButtons, AnswerCountSelector, ArticleCategorySelector, ArticleDialog, ArticleGroupView, BASE_URL, _ChapterBox as ChapterBox, ChatContainer, types as ChatTypes, ClassDetail, ClassList, ClassNoteDialog, ClassSelector, CommonDialog, ConfirmDeleteDialog, ConfirmDialog, CustomAsyncSelect, CustomCreatable, CustomPagination, CustomSelect, CustomSelectOption, DATE_MIN_VALUE, DATE_TIME_MIN_VALUE, DEFAULT_NOTE_FILTER, DEFAULT_PAGING_RESPONSE, DefaultErrorMessage, ELEMENTARY_GRADES, EXAM_CHANNEL, EXAM_STUDENT_CHANNEL, ExamDetailView, ExamEvent, ExamNoteDialog, ExamResultV2, ExamStatus, GOOGLE_CLIENT_ID, GOOGLE_RECAPTCHA_ID, GOOGLE_RECAPTCHA_KEY, GOOGLE_RECAPTCHA_SECRET, HIGH_GRADES, Header, InputText, LANGUAGE, LEARNING_SPACE, Language, LanguageHeaders, LayoutContext, ListView, Loading, LoadingComponent, Login, LoginQRCode, LoginWithEmail, SignIn as LoginWithPassword, MIDDLE_GRADES, MathJaxContainer, MathTinyEditor, NewNoteButton, NoAcademyHeaders, NotFound, NotesContainer, NotificationDetail, NotificationList, OrderBy, OrderType, PRE_REDIRECT_URL, PUSHER_CONFIG, PassCodeCheck, PassCodeDialog, PreparedItem, PreparedTextbookList, PreparedTextbookView, PreparedType, PrintContainerClassName, PrintContentClassName, PrintExamResultView, PrintExamView2, PrintHeaderClassName, PrintTitleClassName, QRCodeConfirmation, QuestionAnswerType, QuestionCountSelector, REDIRECT_URL, RELEASE_DATE, RecentUserAction, RecentUserActionNames, RecentUserActionSortBy, ReleaseAlert, Role, SCHOOL_OPTIONS, SUPER_ADMIN_BASE_URL, SchoolType, ScoreSelector, SearchInput, ShareToTeacherDialog, StudentSelector, SubjectSelector, TextbookActionButtons, TextbookViewDetail as TextbookDetail, TextbookDrawer, TextbookList, TheAcademyDropdown, TheLanguageDropdown, TinyEditor, UserList, UserSortColumn, VirtualListView, VirtualTableView, api, apiUpload, canAccess as canAccessRoute, checkSuperUrl, convertHHMMSStoSeconds, createRecentUserActionListApi, diffFromNow, ellipsisText, encodeParams, formatDataMyAnswer, formatDateTime, formatRole, formatTextbookDataMyAnswer, formatTime, formatTimeSecond, getAcademyDomain, getAccessToken, getErrorMessage, getLanguage, getLearningSpace, getLocalDayOfWeek, getOrdinalSuffix, getRecentUserActionListApi, getRedirectUrl, getRemainTime, getRole, getUtcDayOfWeek, i18n, isLocalHost, minutesToTimeSpan, pushTo, reset, setAcademies, setAcademy, setAlert, setConcurrentConnectionPusher, setLanguage, setLoading, setReFetchUserAcademies, setReadyRegisterPusher, setUser, store, timAgo, timeSpanToLocalMoment, toISOString, toLocalTime, totalSolveTimeCategories, totalTextbookSolveTimeCategories, useAutoAcademyDomain, useChatContainer, useCountDownTimer, useGoogleSignOut, useLanguage, useList, useLoadMore, useLogin, useNotes, usePusherConversation, useSwitchAcademy, useVirtualizeList, utcToLocalTime };
|
35081
34497
|
//# sourceMappingURL=index.modern.js.map
|