touchstudy-core 0.1.120 → 0.1.121
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/README.md +46 -46
- package/dist/StudyTouch_Character_v1_Question~jLFvuYmI.png +0 -0
- package/dist/components/CkEditor/CkEditor.d.ts +11 -2
- package/dist/components/MathJax/MathJaxContainer.d.ts +6 -0
- package/dist/components/MathJax/index.d.ts +2 -0
- package/dist/components/Selectors/InActiveAcademySelector.d.ts +16 -0
- package/dist/components/index.d.ts +2 -1
- package/dist/containers/Academies/hooks/usePassCodeDialog.d.ts +10 -0
- package/dist/containers/ExamResult/components/MyAnswer/components/CreateNewQuestion.d.ts +3 -2
- package/dist/containers/ExamResult/configs/types.d.ts +3 -0
- package/dist/containers/PreparedTextbook/apiClients/academyService.d.ts +1 -0
- package/dist/containers/PreparedTextbook/configs/constants.d.ts +3 -1
- package/dist/index.css +12 -9
- package/dist/index.d.ts +3 -1
- package/dist/index.js +2104 -1993
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +2100 -2000
- package/dist/index.modern.js.map +1 -1
- package/dist/tests/performances/do-exam-session-list-student.d.ts +19 -0
- package/dist/tests/performances/do-exam-session-request-answer-one-time.d.ts +19 -0
- package/dist/tests/performances/do-exam-session-skip-answer.d.ts +19 -0
- package/dist/tests/performances/do-exam-session2.d.ts +19 -0
- package/dist/utils/enums/examStatus.d.ts +4 -0
- package/dist/utils/enums/index.d.ts +2 -2
- package/dist/utils/types/examResults.d.ts +2 -0
- package/dist/utils/types/exams.d.ts +3 -0
- package/package.json +102 -101
- package/dist/components/List/List.d.ts +0 -7
- package/dist/containers/ExamResult/components/Dialog/CreateNewQuestion2.d.ts +0 -9
- package/dist/containers/ExamResult/components/Notes/components/ActionItem.d.ts +0 -7
- package/dist/containers/ExamResult/components/Notes/components/ActionsTooltip.d.ts +0 -14
- package/dist/containers/ExamResult/components/Notes/components/ContentTooltip.d.ts +0 -14
- package/dist/containers/ExamResult/components/Notes/components/NewNoteButton.d.ts +0 -6
- package/dist/containers/ExamResult/components/Notes/components/NoteItem.d.ts +0 -9
- package/dist/containers/ExamResult/components/Notes/components/NoteList.d.ts +0 -12
- package/dist/containers/ExamResult/components/Notes/configs/constants.d.ts +0 -2
- package/dist/containers/ExamResult/components/Notes/configs/interfaces.d.ts +0 -4
- package/dist/containers/ExamResult/components/Notes/hooks/useNotes.d.ts +0 -8
- package/dist/containers/ExamResult/components/Notes/styles/styles.d.ts +0 -67
- package/dist/containers/ExamResult/components/StudentNotes/components/ActionItem.d.ts +0 -7
- package/dist/containers/ExamResult/components/StudentNotes/components/ActionsTooltip.d.ts +0 -14
- package/dist/containers/ExamResult/components/StudentNotes/components/NewNoteButton.d.ts +0 -6
- package/dist/containers/ExamResult/components/StudentNotes/components/NoteItem.d.ts +0 -9
- package/dist/containers/ExamResult/components/StudentNotes/configs/constants.d.ts +0 -2
- package/dist/containers/ExamResult/components/StudentNotes/configs/interfaces.d.ts +0 -7
- package/dist/containers/ExamResult/components/StudentNotes/hooks/useStudentNotes.d.ts +0 -12
- package/dist/containers/ExamResult/components/StudentNotes/index.d.ts +0 -4
- package/dist/containers/ExamResult/components/StudentNotes/styles/styles.d.ts +0 -67
- package/dist/containers/ExamResult/hooks/useExamNoteDialog.d.ts +0 -18
- package/dist/containers/Login/views/LoginQRCode.d.ts +0 -10
- package/dist/containers/Notes/components/ActionItem.d.ts +0 -7
- package/dist/containers/Notes/components/ActionsTooltip.d.ts +0 -16
- package/dist/containers/Notes/components/NoteDialog.d.ts +0 -4
- package/dist/containers/Textbooks/components/TextbookShareDialog.d.ts +0 -26
package/dist/index.modern.js
CHANGED
@@ -4,27 +4,29 @@ import { createAction, createReducer, configureStore } from '@reduxjs/toolkit';
|
|
4
4
|
import i18n, { t as t$1 } from 'i18next';
|
5
5
|
import { initReactI18next, useTranslation } from 'react-i18next';
|
6
6
|
export { I18nextProvider, useTranslation } from 'react-i18next';
|
7
|
-
import
|
8
|
-
|
9
|
-
export { default as moment } from 'moment';
|
10
|
-
import _ from 'lodash';
|
11
|
-
import { useSelector, useDispatch } from 'react-redux';
|
12
|
-
import React__default, { useEffect, useState, useRef, useCallback, useMemo, Fragment as Fragment$1, createElement } from 'react';
|
13
|
-
import GoogleLogin, { useGoogleLogout } from '@leecheuk/react-google-login';
|
14
|
-
import 'moment/locale/ko.js';
|
15
|
-
import 'moment/locale/en-au.js';
|
7
|
+
import { MathJaxContext, MathJax } from 'better-react-mathjax';
|
8
|
+
export { MathJax, MathJaxContext } from 'better-react-mathjax';
|
16
9
|
import { TimePicker, LocalizationProvider as LocalizationProvider$1, DatePicker as DatePicker$1 } from '@mui/x-date-pickers';
|
17
10
|
export { DateCalendar, DatePicker, DayCalendarSkeleton, LocalizationProvider, PickersDay, TimePicker } from '@mui/x-date-pickers';
|
18
11
|
import { AdapterMoment } from '@mui/x-date-pickers/AdapterMoment';
|
19
12
|
export { AdapterMoment } from '@mui/x-date-pickers/AdapterMoment';
|
20
13
|
import { DemoContainer } from '@mui/x-date-pickers/internals/demo';
|
21
14
|
export { DemoContainer } from '@mui/x-date-pickers/internals/demo';
|
15
|
+
import React__default, { useState, useEffect, Fragment as Fragment$1, useRef, useCallback, useMemo, createElement } from 'react';
|
22
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, Divider, MenuList } from '@mui/material';
|
17
|
+
import { useDispatch, useSelector } from 'react-redux';
|
18
|
+
import moment from 'moment';
|
19
|
+
export { default as moment } from 'moment';
|
20
|
+
import 'moment/locale/ko.js';
|
21
|
+
import 'moment/locale/en-au.js';
|
22
|
+
import _ from 'lodash';
|
23
23
|
import { FaSave, FaCaretDown, FaTimes, FaTrash, FaSortUp, FaSortDown, FaPlus, FaPlusCircle, FaUpload, FaEye as FaEye$1, FaPencilAlt, FaShare, FaExchangeAlt, FaBookOpen } from 'react-icons/fa';
|
24
24
|
import { IoMdArrowBack, IoIosAdd, IoMdAdd, IoIosAlert, IoIosArrowDown, IoIosSearch, IoIosArrowUp } from 'react-icons/io';
|
25
25
|
import { IoClose, IoSearch, IoCloseOutline, IoChevronUp, IoChevronDown, IoChatbubbleEllipsesSharp, IoPrint, IoChevronBackOutline, IoWarning, IoCheckmarkCircle, IoChevronUpOutline, IoChevronDownOutline, IoReceiptSharp, IoBook, IoCalendarClear, IoPerson, IoInformationCircle, IoTrash, IoAddCircle, IoCloseCircle, IoLogOut } from 'react-icons/io5';
|
26
26
|
import Select, { components } from 'react-select';
|
27
27
|
import CreatableSelect from 'react-select/creatable';
|
28
|
+
import axios from 'axios';
|
29
|
+
import GoogleLogin, { useGoogleLogout } from '@leecheuk/react-google-login';
|
28
30
|
import { Formik, Form, Field, FieldArray } from 'formik';
|
29
31
|
import { CKEditor } from 'ckeditor4-react';
|
30
32
|
import { AutoSizer } from 'react-virtualized';
|
@@ -1372,6 +1374,12 @@ var today_schedule = "오늘 스케줄";
|
|
1372
1374
|
var schedule_achieved = "달성한 스케줄";
|
1373
1375
|
var i_dont_have_my_phone_number_yet = "휴대폰 번호가 없어요";
|
1374
1376
|
var duplicate_passcode_for_siblings_please_contact_admin_for_assistance = "형제자매의 중복된 비밀번호. 도움이 필요하면 관리자에게 문의하세요";
|
1377
|
+
var textual_answer = "문자 답변";
|
1378
|
+
var question_answer_type = "질문 답변 유형";
|
1379
|
+
var choiceoption = "선택 옵션";
|
1380
|
+
var textual = "텍스트";
|
1381
|
+
var import_student_exam_short_answer_results = "학생 시험 짧은 답변 결과 가져오기";
|
1382
|
+
var file = "파일";
|
1375
1383
|
var lang_ko = {
|
1376
1384
|
problem_solving: problem_solving,
|
1377
1385
|
my_story: my_story,
|
@@ -2386,7 +2394,13 @@ var lang_ko = {
|
|
2386
2394
|
today_schedule: today_schedule,
|
2387
2395
|
schedule_achieved: schedule_achieved,
|
2388
2396
|
i_dont_have_my_phone_number_yet: i_dont_have_my_phone_number_yet,
|
2389
|
-
duplicate_passcode_for_siblings_please_contact_admin_for_assistance: duplicate_passcode_for_siblings_please_contact_admin_for_assistance
|
2397
|
+
duplicate_passcode_for_siblings_please_contact_admin_for_assistance: duplicate_passcode_for_siblings_please_contact_admin_for_assistance,
|
2398
|
+
textual_answer: textual_answer,
|
2399
|
+
question_answer_type: question_answer_type,
|
2400
|
+
choiceoption: choiceoption,
|
2401
|
+
textual: textual,
|
2402
|
+
import_student_exam_short_answer_results: import_student_exam_short_answer_results,
|
2403
|
+
file: file
|
2390
2404
|
};
|
2391
2405
|
|
2392
2406
|
var problem_solving$1 = "Problem Solving";
|
@@ -3420,6 +3434,12 @@ var today_schedule$1 = "Today's schedule";
|
|
3420
3434
|
var schedule_achieved$1 = "Schedule achieved";
|
3421
3435
|
var i_dont_have_my_phone_number_yet$1 = "I don't have my phone number yet";
|
3422
3436
|
var duplicate_passcode_for_siblings_please_contact_admin_for_assistance$1 = "Duplicate passcode for siblings. Please contact admin for assistance";
|
3437
|
+
var textual_answer$1 = "Textual answer";
|
3438
|
+
var question_answer_type$1 = "Question Answer Type";
|
3439
|
+
var choiceoption$1 = "Choice Option";
|
3440
|
+
var textual$1 = "Textual";
|
3441
|
+
var import_student_exam_short_answer_results$1 = "Import Student Exam Short Answer Results";
|
3442
|
+
var file$1 = "File";
|
3423
3443
|
var lang_en = {
|
3424
3444
|
problem_solving: problem_solving$1,
|
3425
3445
|
my_story: my_story$1,
|
@@ -4436,7 +4456,13 @@ var lang_en = {
|
|
4436
4456
|
today_schedule: today_schedule$1,
|
4437
4457
|
schedule_achieved: schedule_achieved$1,
|
4438
4458
|
i_dont_have_my_phone_number_yet: i_dont_have_my_phone_number_yet$1,
|
4439
|
-
duplicate_passcode_for_siblings_please_contact_admin_for_assistance: duplicate_passcode_for_siblings_please_contact_admin_for_assistance$1
|
4459
|
+
duplicate_passcode_for_siblings_please_contact_admin_for_assistance: duplicate_passcode_for_siblings_please_contact_admin_for_assistance$1,
|
4460
|
+
textual_answer: textual_answer$1,
|
4461
|
+
question_answer_type: question_answer_type$1,
|
4462
|
+
choiceoption: choiceoption$1,
|
4463
|
+
textual: textual$1,
|
4464
|
+
import_student_exam_short_answer_results: import_student_exam_short_answer_results$1,
|
4465
|
+
file: file$1
|
4440
4466
|
};
|
4441
4467
|
|
4442
4468
|
i18n.use(initReactI18next).init({
|
@@ -4455,6 +4481,104 @@ i18n.use(initReactI18next).init({
|
|
4455
4481
|
}
|
4456
4482
|
});
|
4457
4483
|
|
4484
|
+
function _extends() {
|
4485
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
4486
|
+
for (var i = 1; i < arguments.length; i++) {
|
4487
|
+
var source = arguments[i];
|
4488
|
+
for (var key in source) {
|
4489
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
4490
|
+
target[key] = source[key];
|
4491
|
+
}
|
4492
|
+
}
|
4493
|
+
}
|
4494
|
+
return target;
|
4495
|
+
};
|
4496
|
+
return _extends.apply(this, arguments);
|
4497
|
+
}
|
4498
|
+
function _objectDestructuringEmpty(obj) {
|
4499
|
+
if (obj == null) throw new TypeError("Cannot destructure " + obj);
|
4500
|
+
}
|
4501
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
4502
|
+
if (source == null) return {};
|
4503
|
+
var target = {};
|
4504
|
+
var sourceKeys = Object.keys(source);
|
4505
|
+
var key, i;
|
4506
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
4507
|
+
key = sourceKeys[i];
|
4508
|
+
if (excluded.indexOf(key) >= 0) continue;
|
4509
|
+
target[key] = source[key];
|
4510
|
+
}
|
4511
|
+
return target;
|
4512
|
+
}
|
4513
|
+
function _taggedTemplateLiteralLoose(strings, raw) {
|
4514
|
+
if (!raw) {
|
4515
|
+
raw = strings.slice(0);
|
4516
|
+
}
|
4517
|
+
strings.raw = raw;
|
4518
|
+
return strings;
|
4519
|
+
}
|
4520
|
+
|
4521
|
+
var LANGUAGES = [{
|
4522
|
+
code: "ko",
|
4523
|
+
fullName: "Korean",
|
4524
|
+
shortName: "Korean",
|
4525
|
+
nativeName: "Korean",
|
4526
|
+
name: "Korean",
|
4527
|
+
image: "/images/korea.png",
|
4528
|
+
momentLangCode: "ko"
|
4529
|
+
}, {
|
4530
|
+
code: "en",
|
4531
|
+
fullName: "English",
|
4532
|
+
shortName: "English",
|
4533
|
+
nativeName: "English",
|
4534
|
+
name: "English",
|
4535
|
+
image: "/images/usa.png",
|
4536
|
+
momentLangCode: "en-au"
|
4537
|
+
}];
|
4538
|
+
var DEFAULT_LANGUAGE = LANGUAGES[0];
|
4539
|
+
var LOGIN_URL = "/login";
|
4540
|
+
|
4541
|
+
var pushTo = function pushTo(history, data, isReplace) {
|
4542
|
+
if (isReplace === void 0) {
|
4543
|
+
isReplace = false;
|
4544
|
+
}
|
4545
|
+
if (history.push && !isReplace || history.replace && isReplace) {
|
4546
|
+
!isReplace && history.push(data);
|
4547
|
+
isReplace && history.replace(data);
|
4548
|
+
} else history(data, {
|
4549
|
+
replace: isReplace
|
4550
|
+
});
|
4551
|
+
};
|
4552
|
+
|
4553
|
+
var canAccess = function canAccess(userRoles, componentRoles) {
|
4554
|
+
if (!Array.isArray(userRoles)) {
|
4555
|
+
return false;
|
4556
|
+
}
|
4557
|
+
if (Array.isArray(componentRoles)) {
|
4558
|
+
var intersects = userRoles.filter(function (i) {
|
4559
|
+
return componentRoles.includes(i);
|
4560
|
+
});
|
4561
|
+
return intersects.length > 0;
|
4562
|
+
}
|
4563
|
+
return true;
|
4564
|
+
};
|
4565
|
+
|
4566
|
+
var checkSuperUrl = function checkSuperUrl(superUrls, pathname) {
|
4567
|
+
return superUrls.some(function (i) {
|
4568
|
+
if (i.includes(":")) {
|
4569
|
+
var urls = i.split("/");
|
4570
|
+
var names = pathname.split("/");
|
4571
|
+
if (urls.length != names.length) return false;
|
4572
|
+
var isMatches = true;
|
4573
|
+
urls.forEach(function (u, index) {
|
4574
|
+
if (u != names[index] && !u.startsWith(":")) isMatches = false;
|
4575
|
+
});
|
4576
|
+
return isMatches;
|
4577
|
+
}
|
4578
|
+
return pathname.startsWith(i);
|
4579
|
+
});
|
4580
|
+
};
|
4581
|
+
|
4458
4582
|
var GOOGLE_RECAPTCHA_KEY = process.env.REACT_APP_GOOGLE_RECAPTCHA_KEY || "";
|
4459
4583
|
var GOOGLE_CLIENT_ID = process.env.REACT_APP_GOOGLE_CLIENT_ID || "";
|
4460
4584
|
var GOOGLE_RECAPTCHA_ID = process.env.REACT_APP_GOOGLE_RECAPTCHA_ID || "";
|
@@ -4526,86 +4650,6 @@ var DEFAULT_PAGING_RESPONSE = {
|
|
4526
4650
|
totalPages: 0
|
4527
4651
|
};
|
4528
4652
|
|
4529
|
-
var PreparedType;
|
4530
|
-
(function (PreparedType) {
|
4531
|
-
PreparedType[PreparedType["csat_past_questions"] = 1] = "csat_past_questions";
|
4532
|
-
PreparedType[PreparedType["official_mock_exam"] = 2] = "official_mock_exam";
|
4533
|
-
PreparedType[PreparedType["private_mock_exam"] = 3] = "private_mock_exam";
|
4534
|
-
})(PreparedType || (PreparedType = {}));
|
4535
|
-
|
4536
|
-
var ExamEvent;
|
4537
|
-
(function (ExamEvent) {
|
4538
|
-
ExamEvent["StartExam"] = "start-exam";
|
4539
|
-
ExamEvent["TerminateExam"] = "terminate-exam";
|
4540
|
-
ExamEvent["AddExtraDuration"] = "add-extra-duration-exam";
|
4541
|
-
ExamEvent["TeacherKickOutStudent"] = "teacher-kick-out-student";
|
4542
|
-
})(ExamEvent || (ExamEvent = {}));
|
4543
|
-
|
4544
|
-
var ExamStatus;
|
4545
|
-
(function (ExamStatus) {
|
4546
|
-
ExamStatus[ExamStatus["Default"] = 0] = "Default";
|
4547
|
-
ExamStatus[ExamStatus["Pending"] = 1] = "Pending";
|
4548
|
-
ExamStatus[ExamStatus["InProgress"] = 2] = "InProgress";
|
4549
|
-
ExamStatus[ExamStatus["Completed"] = 3] = "Completed";
|
4550
|
-
})(ExamStatus || (ExamStatus = {}));
|
4551
|
-
|
4552
|
-
var OrderType;
|
4553
|
-
(function (OrderType) {
|
4554
|
-
OrderType["ASC"] = "ASC";
|
4555
|
-
OrderType["DESC"] = "DESC";
|
4556
|
-
})(OrderType || (OrderType = {}));
|
4557
|
-
|
4558
|
-
var RecentUserAction;
|
4559
|
-
(function (RecentUserAction) {
|
4560
|
-
RecentUserAction["ViewedUser"] = "ViewedUser";
|
4561
|
-
RecentUserAction["ViewedQNA"] = "ViewedQNA";
|
4562
|
-
RecentUserAction["ViewedExamResult"] = "ViewedExamResult";
|
4563
|
-
RecentUserAction["PrintedExamResult"] = "PrintedExamResult";
|
4564
|
-
RecentUserAction["ViewedAttendance"] = "ViewedAttendance";
|
4565
|
-
})(RecentUserAction || (RecentUserAction = {}));
|
4566
|
-
|
4567
|
-
var UserSortColumn;
|
4568
|
-
(function (UserSortColumn) {
|
4569
|
-
UserSortColumn["CreatedAt"] = "CreatedAt";
|
4570
|
-
UserSortColumn["FullName"] = "FullName";
|
4571
|
-
UserSortColumn["PhoneNumber"] = "PhoneNumber";
|
4572
|
-
UserSortColumn["Email"] = "Email";
|
4573
|
-
UserSortColumn["SchoolName"] = "SchoolName";
|
4574
|
-
UserSortColumn["Major"] = "Major";
|
4575
|
-
UserSortColumn["ParentName"] = "ParentName";
|
4576
|
-
UserSortColumn["ParentPhoneNumber"] = "ParentPhoneNumber";
|
4577
|
-
UserSortColumn["Grade"] = "Grade";
|
4578
|
-
})(UserSortColumn || (UserSortColumn = {}));
|
4579
|
-
|
4580
|
-
var canAccess = function canAccess(userRoles, componentRoles) {
|
4581
|
-
if (!Array.isArray(userRoles)) {
|
4582
|
-
return false;
|
4583
|
-
}
|
4584
|
-
if (Array.isArray(componentRoles)) {
|
4585
|
-
var intersects = userRoles.filter(function (i) {
|
4586
|
-
return componentRoles.includes(i);
|
4587
|
-
});
|
4588
|
-
return intersects.length > 0;
|
4589
|
-
}
|
4590
|
-
return true;
|
4591
|
-
};
|
4592
|
-
|
4593
|
-
var checkSuperUrl = function checkSuperUrl(superUrls, pathname) {
|
4594
|
-
return superUrls.some(function (i) {
|
4595
|
-
if (i.includes(":")) {
|
4596
|
-
var urls = i.split("/");
|
4597
|
-
var names = pathname.split("/");
|
4598
|
-
if (urls.length != names.length) return false;
|
4599
|
-
var isMatches = true;
|
4600
|
-
urls.forEach(function (u, index) {
|
4601
|
-
if (u != names[index] && !u.startsWith(":")) isMatches = false;
|
4602
|
-
});
|
4603
|
-
return isMatches;
|
4604
|
-
}
|
4605
|
-
return pathname.startsWith(i);
|
4606
|
-
});
|
4607
|
-
};
|
4608
|
-
|
4609
4653
|
var diffFromNow = (function (time, unitOfTime, targetTime) {
|
4610
4654
|
if (time === DATE_MIN_VALUE || targetTime === DATE_MIN_VALUE) return 0;
|
4611
4655
|
try {
|
@@ -4701,18 +4745,6 @@ var minutesToTimeSpan = (function (time) {
|
|
4701
4745
|
return h.toString().padStart(2, "0") + ":" + m.toString().padStart(2, "0") + ":00";
|
4702
4746
|
});
|
4703
4747
|
|
4704
|
-
var pushTo = function pushTo(history, data, isReplace) {
|
4705
|
-
if (isReplace === void 0) {
|
4706
|
-
isReplace = false;
|
4707
|
-
}
|
4708
|
-
if (history.push && !isReplace || history.replace && isReplace) {
|
4709
|
-
!isReplace && history.push(data);
|
4710
|
-
isReplace && history.replace(data);
|
4711
|
-
} else history(data, {
|
4712
|
-
replace: isReplace
|
4713
|
-
});
|
4714
|
-
};
|
4715
|
-
|
4716
4748
|
var timAgo = function timAgo(date, t) {
|
4717
4749
|
if (date === DATE_MIN_VALUE || date === DATE_TIME_MIN_VALUE) return '';
|
4718
4750
|
var time = moment.utc(date).local();
|
@@ -4785,42 +4817,6 @@ var getRemainTime = function getRemainTime(startTime, duration) {
|
|
4785
4817
|
return durationInNumber - timePass;
|
4786
4818
|
};
|
4787
4819
|
|
4788
|
-
function _extends() {
|
4789
|
-
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
4790
|
-
for (var i = 1; i < arguments.length; i++) {
|
4791
|
-
var source = arguments[i];
|
4792
|
-
for (var key in source) {
|
4793
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
4794
|
-
target[key] = source[key];
|
4795
|
-
}
|
4796
|
-
}
|
4797
|
-
}
|
4798
|
-
return target;
|
4799
|
-
};
|
4800
|
-
return _extends.apply(this, arguments);
|
4801
|
-
}
|
4802
|
-
function _objectDestructuringEmpty(obj) {
|
4803
|
-
if (obj == null) throw new TypeError("Cannot destructure " + obj);
|
4804
|
-
}
|
4805
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
4806
|
-
if (source == null) return {};
|
4807
|
-
var target = {};
|
4808
|
-
for (var key in source) {
|
4809
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
4810
|
-
if (excluded.indexOf(key) >= 0) continue;
|
4811
|
-
target[key] = source[key];
|
4812
|
-
}
|
4813
|
-
}
|
4814
|
-
return target;
|
4815
|
-
}
|
4816
|
-
function _taggedTemplateLiteralLoose(strings, raw) {
|
4817
|
-
if (!raw) {
|
4818
|
-
raw = strings.slice(0);
|
4819
|
-
}
|
4820
|
-
strings.raw = raw;
|
4821
|
-
return strings;
|
4822
|
-
}
|
4823
|
-
|
4824
4820
|
var formatDateTime = function formatDateTime(inputDate) {
|
4825
4821
|
var date = new Date(inputDate);
|
4826
4822
|
var monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
|
@@ -4963,257 +4959,6 @@ var getRole = function getRole(roles) {
|
|
4963
4959
|
return null;
|
4964
4960
|
};
|
4965
4961
|
|
4966
|
-
var LANGUAGES = [{
|
4967
|
-
code: "ko",
|
4968
|
-
fullName: "Korean",
|
4969
|
-
shortName: "Korean",
|
4970
|
-
nativeName: "Korean",
|
4971
|
-
name: "Korean",
|
4972
|
-
image: "/images/korea.png",
|
4973
|
-
momentLangCode: "ko"
|
4974
|
-
}, {
|
4975
|
-
code: "en",
|
4976
|
-
fullName: "English",
|
4977
|
-
shortName: "English",
|
4978
|
-
nativeName: "English",
|
4979
|
-
name: "English",
|
4980
|
-
image: "/images/usa.png",
|
4981
|
-
momentLangCode: "en-au"
|
4982
|
-
}];
|
4983
|
-
var DEFAULT_LANGUAGE = LANGUAGES[0];
|
4984
|
-
var LOGIN_URL = "/login";
|
4985
|
-
|
4986
|
-
var useAutoAcademyDomain = function useAutoAcademyDomain(_, history, superUrls, homeUrl, homeAcademyUrl, isAuthPage) {
|
4987
|
-
if (isAuthPage === void 0) {
|
4988
|
-
isAuthPage = true;
|
4989
|
-
}
|
4990
|
-
var user = useSelector(function (state) {
|
4991
|
-
var _state$common;
|
4992
|
-
return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.user;
|
4993
|
-
});
|
4994
|
-
var _ref = user || {},
|
4995
|
-
email = _ref.email,
|
4996
|
-
academyDomain = _ref.academyDomain,
|
4997
|
-
isLearningSpace = _ref.isLearningSpace;
|
4998
|
-
var pathname = window.location.pathname;
|
4999
|
-
var changeAcademySearchParams = function changeAcademySearchParams() {
|
5000
|
-
var isLoginPage = LOGIN_URL === pathname;
|
5001
|
-
var search = window.location.search;
|
5002
|
-
var searchParams = new URLSearchParams(search);
|
5003
|
-
var paramAcademyDomain = searchParams.get("domain");
|
5004
|
-
var domain = getAcademyDomain();
|
5005
|
-
if (!!email !== isAuthPage) return;
|
5006
|
-
var isSuperUrl = checkSuperUrl(superUrls, pathname);
|
5007
|
-
if (!academyDomain && !isLearningSpace) {
|
5008
|
-
if (!isSuperUrl) {
|
5009
|
-
if (isLoginPage) searchParams["delete"]("domain");else if (!paramAcademyDomain && domain) searchParams.set("domain", domain);
|
5010
|
-
pushTo(history, {
|
5011
|
-
pathname: homeUrl,
|
5012
|
-
search: searchParams.toString()
|
5013
|
-
});
|
5014
|
-
return;
|
5015
|
-
}
|
5016
|
-
if (paramAcademyDomain) {
|
5017
|
-
searchParams["delete"]("domain");
|
5018
|
-
pushTo(history, _extends({}, window.location, {
|
5019
|
-
search: searchParams.toString()
|
5020
|
-
}), true);
|
5021
|
-
return;
|
5022
|
-
}
|
5023
|
-
} else {
|
5024
|
-
if (isSuperUrl) {
|
5025
|
-
searchParams["delete"]("domain");
|
5026
|
-
pushTo(history, {
|
5027
|
-
pathname: homeAcademyUrl,
|
5028
|
-
search: searchParams.toString()
|
5029
|
-
});
|
5030
|
-
return;
|
5031
|
-
}
|
5032
|
-
if (!paramAcademyDomain || academyDomain.trim().toLocaleLowerCase() !== (paramAcademyDomain === null || paramAcademyDomain === void 0 ? void 0 : paramAcademyDomain.trim().toLocaleLowerCase())) {
|
5033
|
-
if (isLoginPage || isLearningSpace) searchParams["delete"]("domain");else searchParams.set("domain", academyDomain);
|
5034
|
-
pushTo(history, _extends({}, window.location, {
|
5035
|
-
search: searchParams.toString()
|
5036
|
-
}), true);
|
5037
|
-
return;
|
5038
|
-
}
|
5039
|
-
}
|
5040
|
-
};
|
5041
|
-
useEffect(function () {
|
5042
|
-
changeAcademySearchParams();
|
5043
|
-
}, [pathname, window.location.search, isAuthPage, email, academyDomain]);
|
5044
|
-
};
|
5045
|
-
|
5046
|
-
// A type of promise-like that resolves synchronously and supports only one observer
|
5047
|
-
|
5048
|
-
const _iteratorSymbol = /*#__PURE__*/ typeof Symbol !== "undefined" ? (Symbol.iterator || (Symbol.iterator = Symbol("Symbol.iterator"))) : "@@iterator";
|
5049
|
-
|
5050
|
-
const _asyncIteratorSymbol = /*#__PURE__*/ typeof Symbol !== "undefined" ? (Symbol.asyncIterator || (Symbol.asyncIterator = Symbol("Symbol.asyncIterator"))) : "@@asyncIterator";
|
5051
|
-
|
5052
|
-
// Asynchronously call a function and send errors to recovery continuation
|
5053
|
-
function _catch(body, recover) {
|
5054
|
-
try {
|
5055
|
-
var result = body();
|
5056
|
-
} catch(e) {
|
5057
|
-
return recover(e);
|
5058
|
-
}
|
5059
|
-
if (result && result.then) {
|
5060
|
-
return result.then(void 0, recover);
|
5061
|
-
}
|
5062
|
-
return result;
|
5063
|
-
}
|
5064
|
-
|
5065
|
-
// Asynchronously await a promise and pass the result to a finally continuation
|
5066
|
-
function _finallyRethrows(body, finalizer) {
|
5067
|
-
try {
|
5068
|
-
var result = body();
|
5069
|
-
} catch (e) {
|
5070
|
-
return finalizer(true, e);
|
5071
|
-
}
|
5072
|
-
if (result && result.then) {
|
5073
|
-
return result.then(finalizer.bind(null, false), finalizer.bind(null, true));
|
5074
|
-
}
|
5075
|
-
return finalizer(false, result);
|
5076
|
-
}
|
5077
|
-
|
5078
|
-
// Asynchronously await a promise and invoke a finally continuation that always overrides the result
|
5079
|
-
function _finally(body, finalizer) {
|
5080
|
-
try {
|
5081
|
-
var result = body();
|
5082
|
-
} catch (e) {
|
5083
|
-
return finalizer();
|
5084
|
-
}
|
5085
|
-
if (result && result.then) {
|
5086
|
-
return result.then(finalizer, finalizer);
|
5087
|
-
}
|
5088
|
-
return finalizer();
|
5089
|
-
}
|
5090
|
-
|
5091
|
-
var EXAM_SESSION_URL = BASE_URL + "/api/examSession";
|
5092
|
-
var getCheckStatusExam = function getCheckStatusExam(examCode) {
|
5093
|
-
return api.get(EXAM_SESSION_URL + "/" + examCode + "/status");
|
5094
|
-
};
|
5095
|
-
|
5096
|
-
var ONE_SECOND_IN_MILLISECONDS = 1000;
|
5097
|
-
var useCountDownTimer = function useCountDownTimer(props) {
|
5098
|
-
var startTime = props.startTime,
|
5099
|
-
status = props.status,
|
5100
|
-
code = props.code,
|
5101
|
-
duration = props.duration,
|
5102
|
-
onFinish = props.onFinish;
|
5103
|
-
var dispatch = useDispatch();
|
5104
|
-
var _useState = useState(),
|
5105
|
-
remainTime = _useState[0],
|
5106
|
-
setRemainTime = _useState[1];
|
5107
|
-
var checkStatusRef = useRef(null);
|
5108
|
-
var requestRef = useRef(null);
|
5109
|
-
var checkLiveExamStatus = useCallback(function () {
|
5110
|
-
try {
|
5111
|
-
!!checkStatusRef.current && clearTimeout(checkStatusRef.current);
|
5112
|
-
if (!code || status === ExamStatus.Completed) {
|
5113
|
-
return Promise.resolve();
|
5114
|
-
}
|
5115
|
-
var isOk = false;
|
5116
|
-
var _temp = _finallyRethrows(function () {
|
5117
|
-
return _catch(function () {
|
5118
|
-
dispatch(setLoading(true));
|
5119
|
-
return Promise.resolve(getCheckStatusExam(code)).then(function (res) {
|
5120
|
-
if (res.data.data.status === ExamStatus.Completed) {
|
5121
|
-
isOk = true;
|
5122
|
-
clearTimeout(checkStatusRef.current);
|
5123
|
-
dispatch(setLoading(false));
|
5124
|
-
onFinish();
|
5125
|
-
} else {
|
5126
|
-
checkStatusRef.current = setTimeout(checkLiveExamStatus, ONE_SECOND_IN_MILLISECONDS);
|
5127
|
-
}
|
5128
|
-
});
|
5129
|
-
}, function (error) {
|
5130
|
-
console.log({
|
5131
|
-
error: error
|
5132
|
-
});
|
5133
|
-
});
|
5134
|
-
}, function (_wasThrown, _result) {
|
5135
|
-
if (!isOk) checkStatusRef.current = setTimeout(checkLiveExamStatus, ONE_SECOND_IN_MILLISECONDS);
|
5136
|
-
if (_wasThrown) throw _result;
|
5137
|
-
return _result;
|
5138
|
-
});
|
5139
|
-
return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
|
5140
|
-
} catch (e) {
|
5141
|
-
return Promise.reject(e);
|
5142
|
-
}
|
5143
|
-
}, [code, status, onFinish]);
|
5144
|
-
useEffect(function () {
|
5145
|
-
if (status !== ExamStatus.InProgress) return;
|
5146
|
-
var animate = function animate() {
|
5147
|
-
if (!startTime || !duration) return;
|
5148
|
-
if (typeof remainTime === "number" && remainTime <= 0) {
|
5149
|
-
return;
|
5150
|
-
}
|
5151
|
-
var remain = getRemainTime(startTime, duration);
|
5152
|
-
if (typeof remain !== "number") {
|
5153
|
-
setRemainTime(undefined);
|
5154
|
-
return;
|
5155
|
-
}
|
5156
|
-
setRemainTime(remain || 0);
|
5157
|
-
requestRef.current = requestAnimationFrame(animate);
|
5158
|
-
};
|
5159
|
-
requestRef.current = requestAnimationFrame(animate);
|
5160
|
-
return function () {
|
5161
|
-
!!requestRef.current && cancelAnimationFrame(requestRef.current);
|
5162
|
-
setRemainTime(undefined);
|
5163
|
-
};
|
5164
|
-
}, [startTime, duration]);
|
5165
|
-
useEffect(function () {
|
5166
|
-
if (typeof remainTime === "number" && remainTime <= 0) checkLiveExamStatus();
|
5167
|
-
}, [remainTime, checkLiveExamStatus]);
|
5168
|
-
return remainTime;
|
5169
|
-
};
|
5170
|
-
|
5171
|
-
var useGoogleSignOut = function useGoogleSignOut(props) {
|
5172
|
-
var dispatch = useDispatch();
|
5173
|
-
var onLogoutSuccess = props.onLogoutSuccess,
|
5174
|
-
onFailure = props.onFailure;
|
5175
|
-
var handleLogoutSuccess = function handleLogoutSuccess() {
|
5176
|
-
onLogoutSuccess === null || onLogoutSuccess === void 0 ? void 0 : onLogoutSuccess();
|
5177
|
-
};
|
5178
|
-
var handleLogoutFailure = function handleLogoutFailure() {
|
5179
|
-
onFailure === null || onFailure === void 0 ? void 0 : onFailure();
|
5180
|
-
};
|
5181
|
-
var _useGoogleLogout = useGoogleLogout({
|
5182
|
-
clientId: GOOGLE_CLIENT_ID,
|
5183
|
-
onLogoutSuccess: handleLogoutSuccess,
|
5184
|
-
onFailure: handleLogoutFailure
|
5185
|
-
}),
|
5186
|
-
signOut = _useGoogleLogout.signOut,
|
5187
|
-
loaded = _useGoogleLogout.loaded;
|
5188
|
-
var handleSignOut = function handleSignOut(isRemoveDomainStorage) {
|
5189
|
-
if (isRemoveDomainStorage === void 0) {
|
5190
|
-
isRemoveDomainStorage = false;
|
5191
|
-
}
|
5192
|
-
localStorage.removeItem("USER_INFORMATION");
|
5193
|
-
localStorage.removeItem(ACCESS_TOKEN);
|
5194
|
-
if (isRemoveDomainStorage) {
|
5195
|
-
localStorage.removeItem(ACADEMY_DOMAIN);
|
5196
|
-
localStorage.removeItem(LEARNING_SPACE);
|
5197
|
-
}
|
5198
|
-
try {
|
5199
|
-
var _window$gapi, _window$gapi$auth, _auth2$signOut;
|
5200
|
-
signOut();
|
5201
|
-
var auth2 = (_window$gapi = window.gapi) === null || _window$gapi === void 0 ? void 0 : (_window$gapi$auth = _window$gapi.auth2) === null || _window$gapi$auth === void 0 ? void 0 : _window$gapi$auth.getAuthInstance();
|
5202
|
-
auth2 === null || auth2 === void 0 ? void 0 : (_auth2$signOut = auth2.signOut) === null || _auth2$signOut === void 0 ? void 0 : _auth2$signOut.call(auth2);
|
5203
|
-
} catch (error) {
|
5204
|
-
console.log({
|
5205
|
-
error: error
|
5206
|
-
});
|
5207
|
-
}
|
5208
|
-
dispatch(reset());
|
5209
|
-
window.location.href = "/login";
|
5210
|
-
};
|
5211
|
-
return {
|
5212
|
-
handleSignOut: handleSignOut,
|
5213
|
-
loaded: loaded
|
5214
|
-
};
|
5215
|
-
};
|
5216
|
-
|
5217
4962
|
var useLanguage = function useLanguage(history) {
|
5218
4963
|
var dispatch = useDispatch();
|
5219
4964
|
var _useTranslation = useTranslation(),
|
@@ -5281,1679 +5026,1984 @@ var useLanguage = function useLanguage(history) {
|
|
5281
5026
|
};
|
5282
5027
|
};
|
5283
5028
|
|
5284
|
-
var
|
5285
|
-
|
5286
|
-
|
5287
|
-
|
5288
|
-
|
5289
|
-
|
5290
|
-
|
5291
|
-
|
5292
|
-
|
5293
|
-
|
5294
|
-
|
5295
|
-
|
5296
|
-
|
5297
|
-
|
5298
|
-
|
5299
|
-
|
5300
|
-
|
5301
|
-
|
5302
|
-
|
5303
|
-
|
5304
|
-
|
5305
|
-
|
5306
|
-
|
5307
|
-
|
5308
|
-
|
5309
|
-
|
5310
|
-
|
5311
|
-
|
5312
|
-
|
5313
|
-
|
5314
|
-
|
5315
|
-
|
5316
|
-
|
5317
|
-
|
5318
|
-
|
5319
|
-
|
5320
|
-
|
5321
|
-
|
5322
|
-
|
5323
|
-
|
5324
|
-
|
5325
|
-
|
5326
|
-
|
5327
|
-
|
5328
|
-
|
5329
|
-
|
5330
|
-
|
5331
|
-
|
5029
|
+
var PrintState;
|
5030
|
+
(function (PrintState) {
|
5031
|
+
PrintState[PrintState["Idling"] = 0] = "Idling";
|
5032
|
+
PrintState[PrintState["Stopped"] = 1] = "Stopped";
|
5033
|
+
PrintState[PrintState["Printing"] = 2] = "Printing";
|
5034
|
+
PrintState[PrintState["Paused"] = 3] = "Paused";
|
5035
|
+
})(PrintState || (PrintState = {}));
|
5036
|
+
|
5037
|
+
var TabList = [{
|
5038
|
+
label: "comprehensive_analysis",
|
5039
|
+
value: 0
|
5040
|
+
}, {
|
5041
|
+
label: "solution_order",
|
5042
|
+
value: 1
|
5043
|
+
}, {
|
5044
|
+
label: "compare_solution",
|
5045
|
+
value: 2
|
5046
|
+
}, {
|
5047
|
+
label: "problem_analysis",
|
5048
|
+
value: 3
|
5049
|
+
}];
|
5050
|
+
|
5051
|
+
var TOTAL = 3;
|
5052
|
+
var PrintExamView2 = function PrintExamView2(_ref) {
|
5053
|
+
var history = _ref.history,
|
5054
|
+
role = _ref.role,
|
5055
|
+
dataExamSession = _ref.dataExamSession;
|
5056
|
+
var _useTranslation = useTranslation(),
|
5057
|
+
t = _useTranslation.t;
|
5058
|
+
var isTeacher = Role.Teacher === role;
|
5059
|
+
var dataProps = isTeacher ? dataExamSession.map(function (i) {
|
5060
|
+
return {
|
5061
|
+
studentId: i === null || i === void 0 ? void 0 : i.studentId,
|
5062
|
+
examSessionId: i === null || i === void 0 ? void 0 : i.examSessionId
|
5063
|
+
};
|
5064
|
+
}) : dataExamSession.map(function (i) {
|
5065
|
+
return {
|
5066
|
+
code: i === null || i === void 0 ? void 0 : i.code
|
5067
|
+
};
|
5068
|
+
});
|
5069
|
+
useLanguage(history);
|
5070
|
+
var _useState = useState(dataProps),
|
5071
|
+
data = _useState[0],
|
5072
|
+
setData = _useState[1];
|
5073
|
+
var _useState2 = useState([]),
|
5074
|
+
completed = _useState2[0],
|
5075
|
+
setCompleted = _useState2[1];
|
5076
|
+
var _useState3 = useState([]),
|
5077
|
+
inprogress = _useState3[0],
|
5078
|
+
setInProgress = _useState3[1];
|
5079
|
+
var _useState4 = useState(PrintState.Idling),
|
5080
|
+
state = _useState4[0],
|
5081
|
+
setState = _useState4[1];
|
5082
|
+
var _useState5 = useState([]),
|
5083
|
+
errorLinks = _useState5[0],
|
5084
|
+
setErrorLinks = _useState5[1];
|
5085
|
+
var _useState6 = useState([]),
|
5086
|
+
status = _useState6[0],
|
5087
|
+
setStatus = _useState6[1];
|
5088
|
+
var theme = useTheme();
|
5089
|
+
var handleChangeStatus = function handleChangeStatus(event) {
|
5090
|
+
if (event.target.checked) {
|
5091
|
+
setStatus(function (prev) {
|
5092
|
+
var _event$target;
|
5093
|
+
return [].concat(prev, [(_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.value]);
|
5094
|
+
});
|
5095
|
+
} else setStatus(function (prev) {
|
5096
|
+
return prev === null || prev === void 0 ? void 0 : prev.filter(function (i) {
|
5097
|
+
var _event$target2;
|
5098
|
+
return i !== ((_event$target2 = event.target) === null || _event$target2 === void 0 ? void 0 : _event$target2.value);
|
5332
5099
|
});
|
5333
|
-
return Promise.resolve(_temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp));
|
5334
|
-
} catch (e) {
|
5335
|
-
return Promise.reject(e);
|
5336
|
-
}
|
5337
|
-
};
|
5338
|
-
var handleSort = function handleSort(sortColumnName) {
|
5339
|
-
var sortColumnDirection = OrderType.ASC;
|
5340
|
-
console.log({
|
5341
|
-
sortColumnName: typeof sortColumnName,
|
5342
|
-
filter: typeof filter.sortColumnName
|
5343
5100
|
});
|
5344
|
-
if (filter.sortColumnName == sortColumnName && filter.sortColumnDirection === OrderType.ASC) sortColumnDirection = OrderType.DESC;
|
5345
|
-
setFilter(_extends({}, filter, {
|
5346
|
-
sortColumnName: sortColumnName,
|
5347
|
-
sortColumnDirection: sortColumnDirection,
|
5348
|
-
currentPage: 1
|
5349
|
-
}));
|
5350
|
-
};
|
5351
|
-
var handleChangeSearchText = function handleChangeSearchText(e) {
|
5352
|
-
if (!textSearchRef.current) return;
|
5353
|
-
textSearchRef.current.value = e.target.value.trim();
|
5354
|
-
debounceSearch();
|
5355
|
-
};
|
5356
|
-
var handleChangePage = function handleChangePage(_, page) {
|
5357
|
-
setFilter(_extends({}, filter, {
|
5358
|
-
currentPage: page
|
5359
|
-
}));
|
5360
|
-
};
|
5361
|
-
var calcOrderNumber = function calcOrderNumber(index) {
|
5362
|
-
var _paging$page, _paging$limit;
|
5363
|
-
return (((_paging$page = paging.page) != null ? _paging$page : 0) - 1) * ((_paging$limit = paging.limit) != null ? _paging$limit : 0) + index + 1;
|
5364
5101
|
};
|
5365
|
-
var
|
5366
|
-
|
5367
|
-
|
5368
|
-
|
5369
|
-
|
5370
|
-
|
5371
|
-
}, 500);
|
5372
|
-
useEffect(function () {
|
5373
|
-
getData(isFirstLoadRef.current);
|
5374
|
-
}, [JSON.stringify(filter)]);
|
5375
|
-
return {
|
5376
|
-
filter: filter,
|
5377
|
-
textSearchRef: textSearchRef,
|
5378
|
-
paging: paging,
|
5379
|
-
data: data,
|
5380
|
-
selectedItem: selectedItem,
|
5381
|
-
handleSort: handleSort,
|
5382
|
-
handleChangeSearchText: handleChangeSearchText,
|
5383
|
-
handleChangePage: handleChangePage,
|
5384
|
-
calcOrderNumber: calcOrderNumber,
|
5385
|
-
handleChangeSelectedItem: handleChangeSelectedItem,
|
5386
|
-
getData: getData
|
5102
|
+
var handleProgressPrint = function handleProgressPrint() {
|
5103
|
+
setData(dataProps);
|
5104
|
+
setCompleted([]);
|
5105
|
+
setInProgress([]);
|
5106
|
+
setErrorLinks([]);
|
5107
|
+
setState(PrintState.Printing);
|
5387
5108
|
};
|
5388
|
-
|
5389
|
-
|
5390
|
-
|
5391
|
-
var
|
5392
|
-
|
5393
|
-
|
5394
|
-
|
5395
|
-
var
|
5396
|
-
var
|
5397
|
-
|
5398
|
-
|
5109
|
+
console.log({
|
5110
|
+
status: status
|
5111
|
+
});
|
5112
|
+
var print = function print(_ref2) {
|
5113
|
+
var examSessionId = _ref2.examSessionId,
|
5114
|
+
studentId = _ref2.studentId,
|
5115
|
+
code = _ref2.code;
|
5116
|
+
var width = 200;
|
5117
|
+
var height = 200;
|
5118
|
+
var left = window.screenX + window.outerWidth / 2 - width / 2;
|
5119
|
+
var top = window.screenY + window.outerHeight / 2 - height / 2;
|
5120
|
+
var url = isTeacher ? window.location.origin + "/teacher/exam-results/" + examSessionId + "/students/" + studentId + "/print?status=" + status.join(",") : window.location.origin + "/student/exam-results/" + code + "/print";
|
5121
|
+
var windowName = isTeacher ? "popup-" + examSessionId + "-" + studentId : "popup-" + code;
|
5122
|
+
var windowSpecs = "left=" + left + ",top=" + top + ",width=" + width + ",height=" + height + ",location=yes,resizable=yes,scrollbars=yes,status=yes";
|
5123
|
+
var childWindow = window.open(url, windowName, windowSpecs);
|
5124
|
+
if (childWindow == null) {
|
5125
|
+
setErrorLinks(function (prev) {
|
5126
|
+
return [].concat(prev, [{
|
5127
|
+
code: code,
|
5128
|
+
examSessionId: "" + examSessionId,
|
5129
|
+
studentId: "" + studentId,
|
5130
|
+
message: isTeacher ? "/teacher/exam-results/" + examSessionId + "/students/" + studentId + "/print" : "/student/exam-results/" + code + "/print"
|
5131
|
+
}]);
|
5132
|
+
});
|
5133
|
+
if (!isTeacher) {
|
5134
|
+
setData(function (es) {
|
5135
|
+
return [].concat(es.filter(function (i) {
|
5136
|
+
return i.code !== code;
|
5137
|
+
}));
|
5138
|
+
});
|
5139
|
+
} else {
|
5140
|
+
setData(function (es) {
|
5141
|
+
return [].concat(es.filter(function (i) {
|
5142
|
+
return i.examSessionId !== examSessionId || i.studentId !== studentId;
|
5143
|
+
}));
|
5144
|
+
});
|
5399
5145
|
}
|
5400
|
-
|
5401
|
-
threshold: 1
|
5402
|
-
});
|
5403
|
-
if (observerTarget.current) {
|
5404
|
-
observer.observe(observerTarget.current);
|
5146
|
+
return;
|
5405
5147
|
}
|
5406
|
-
|
5407
|
-
|
5408
|
-
|
5148
|
+
if (!isTeacher) {
|
5149
|
+
setInProgress(function (es) {
|
5150
|
+
return [].concat(es.filter(function (i) {
|
5151
|
+
return i.code !== code;
|
5152
|
+
}), [{
|
5153
|
+
code: code
|
5154
|
+
}]);
|
5155
|
+
});
|
5156
|
+
setData(function (es) {
|
5157
|
+
return [].concat(es.filter(function (i) {
|
5158
|
+
return i.code !== code;
|
5159
|
+
}));
|
5160
|
+
});
|
5161
|
+
} else {
|
5162
|
+
setInProgress(function (es) {
|
5163
|
+
return [].concat(es.filter(function (i) {
|
5164
|
+
return i.examSessionId !== examSessionId || i.studentId !== studentId;
|
5165
|
+
}), [{
|
5166
|
+
examSessionId: examSessionId,
|
5167
|
+
studentId: studentId
|
5168
|
+
}]);
|
5169
|
+
});
|
5170
|
+
setData(function (es) {
|
5171
|
+
return [].concat(es.filter(function (i) {
|
5172
|
+
return i.examSessionId !== examSessionId || i.studentId !== studentId;
|
5173
|
+
}));
|
5174
|
+
});
|
5175
|
+
}
|
5176
|
+
window.addEventListener("message", function (event) {
|
5177
|
+
var isCheck = isTeacher ? event.data.examSessionId !== "" + examSessionId || event.data.studentId !== "" + studentId : event.data.code !== "" + code;
|
5178
|
+
if (event.origin !== window.location.origin || isCheck) {
|
5179
|
+
return;
|
5409
5180
|
}
|
5410
|
-
|
5411
|
-
|
5412
|
-
|
5413
|
-
|
5414
|
-
|
5415
|
-
}
|
5416
|
-
|
5417
|
-
|
5418
|
-
|
5419
|
-
|
5420
|
-
|
5421
|
-
|
5422
|
-
|
5423
|
-
|
5424
|
-
|
5425
|
-
|
5426
|
-
|
5427
|
-
|
5428
|
-
|
5429
|
-
|
5430
|
-
|
5431
|
-
|
5432
|
-
|
5433
|
-
|
5434
|
-
|
5435
|
-
|
5436
|
-
};
|
5437
|
-
|
5438
|
-
|
5181
|
+
if (event.data.succeed) {
|
5182
|
+
if (!isTeacher) {
|
5183
|
+
setCompleted(function (es) {
|
5184
|
+
return [].concat(es.filter(function (i) {
|
5185
|
+
return i.code !== code;
|
5186
|
+
}), [{
|
5187
|
+
code: code
|
5188
|
+
}]);
|
5189
|
+
});
|
5190
|
+
setInProgress(function (es) {
|
5191
|
+
return [].concat(es.filter(function (i) {
|
5192
|
+
return i.code !== code;
|
5193
|
+
}));
|
5194
|
+
});
|
5195
|
+
} else {
|
5196
|
+
setCompleted(function (es) {
|
5197
|
+
return [].concat(es.filter(function (i) {
|
5198
|
+
return i.examSessionId !== examSessionId || i.studentId !== studentId;
|
5199
|
+
}), [{
|
5200
|
+
examSessionId: examSessionId,
|
5201
|
+
studentId: studentId
|
5202
|
+
}]);
|
5203
|
+
});
|
5204
|
+
setInProgress(function (es) {
|
5205
|
+
return [].concat(es.filter(function (i) {
|
5206
|
+
return i.examSessionId !== examSessionId || i.studentId !== studentId;
|
5207
|
+
}));
|
5208
|
+
});
|
5209
|
+
}
|
5210
|
+
} else {
|
5211
|
+
setErrorLinks(function (prev) {
|
5212
|
+
var _event$data, _event$data2;
|
5213
|
+
return [].concat(prev, [{
|
5214
|
+
code: (_event$data = event.data) === null || _event$data === void 0 ? void 0 : _event$data.code,
|
5215
|
+
examSessionId: (_event$data2 = event.data) === null || _event$data2 === void 0 ? void 0 : _event$data2.examSessionId,
|
5216
|
+
studentId: "" + studentId,
|
5217
|
+
message: isTeacher ? "/teacher/exam-results/" + event.data.examSessionId + "/students/" + event.data.studentId + "/print" : "/student/exam-results/" + event.data.code + "/print"
|
5218
|
+
}]);
|
5219
|
+
});
|
5220
|
+
}
|
5221
|
+
childWindow === null || childWindow === void 0 ? void 0 : childWindow.close();
|
5222
|
+
});
|
5223
|
+
};
|
5224
|
+
useEffect(function () {
|
5225
|
+
if (inprogress.length < TOTAL && data.length > 0 && state === PrintState.Printing) {
|
5226
|
+
var item = data[0];
|
5227
|
+
print({
|
5228
|
+
examSessionId: item === null || item === void 0 ? void 0 : item.examSessionId,
|
5229
|
+
studentId: item === null || item === void 0 ? void 0 : item.studentId,
|
5230
|
+
code: item === null || item === void 0 ? void 0 : item.code
|
5231
|
+
});
|
5232
|
+
}
|
5233
|
+
}, [inprogress.length, completed.length, data.length, state, data]);
|
5234
|
+
return React__default.createElement(Container, null, state === PrintState.Idling ? React__default.createElement(Typography, null, t("total_number_of_selected_results") + ": ", " ", React__default.createElement("span", {
|
5235
|
+
className: "fw-bold"
|
5236
|
+
}, t("number_results", {
|
5237
|
+
number: ("" + data.length).padStart(2, "0")
|
5238
|
+
}))) : React__default.createElement(Fragment$1, null, React__default.createElement(Typography, null, t("completed") + ": ", React__default.createElement("span", {
|
5239
|
+
className: "fw-bold"
|
5240
|
+
}, t("number_results", {
|
5241
|
+
number: ("" + completed.length).padStart(2, "0")
|
5242
|
+
}))), React__default.createElement(Typography, null, t("in_progress") + ": ", React__default.createElement("span", {
|
5243
|
+
className: "fw-bold"
|
5244
|
+
}, t("number_results", {
|
5245
|
+
number: ("" + inprogress.length).padStart(2, "0")
|
5246
|
+
}))), React__default.createElement(Typography, null, t("remaining") + ": ", React__default.createElement("span", {
|
5247
|
+
className: "fw-bold"
|
5248
|
+
}, t("number_results", {
|
5249
|
+
number: ("" + data.length).padStart(2, "0")
|
5250
|
+
})))), !!errorLinks.length && React__default.createElement(Stack, {
|
5251
|
+
className: "mt-2"
|
5252
|
+
}, React__default.createElement(Typography, {
|
5253
|
+
fontWeight: 700
|
5254
|
+
}, t("download_failed"), ":"), Array.from(new Set(errorLinks)).map(function (i) {
|
5255
|
+
var _info$createdBy;
|
5256
|
+
var info = isTeacher ? dataExamSession.find(function (exam) {
|
5257
|
+
return "" + (exam === null || exam === void 0 ? void 0 : exam.examSessionId) === "" + (i === null || i === void 0 ? void 0 : i.examSessionId) && "" + (exam === null || exam === void 0 ? void 0 : exam.studentId) === "" + (i === null || i === void 0 ? void 0 : i.studentId);
|
5258
|
+
}) : dataExamSession.find(function (exam) {
|
5259
|
+
return (exam === null || exam === void 0 ? void 0 : exam.code) === (i === null || i === void 0 ? void 0 : i.code);
|
5260
|
+
});
|
5261
|
+
return React__default.createElement(Stack, {
|
5262
|
+
borderBottom: 1,
|
5263
|
+
borderColor: theme.palette.grey[500]
|
5264
|
+
}, React__default.createElement("a", {
|
5265
|
+
href: i.message,
|
5266
|
+
target: "_blank",
|
5267
|
+
rel: "noopener noreferrer"
|
5268
|
+
}, (info === null || info === void 0 ? void 0 : info.studentName) || (info === null || info === void 0 ? void 0 : (_info$createdBy = info.createdBy) === null || _info$createdBy === void 0 ? void 0 : _info$createdBy.fullName)), (info === null || info === void 0 ? void 0 : info.title) && React__default.createElement(Typography, null, t("exam") + ": " + (info === null || info === void 0 ? void 0 : info.title)), (info === null || info === void 0 ? void 0 : info.startTime) && React__default.createElement(Typography, null, t("start_time") + ": " + utcToLocalTime(info === null || info === void 0 ? void 0 : info.startTime, t("date_time_format"))));
|
5269
|
+
})), React__default.createElement(Stack, {
|
5270
|
+
direction: "column",
|
5271
|
+
className: "mt-3"
|
5272
|
+
}, React__default.createElement(Stack, null, React__default.createElement(Typography, {
|
5273
|
+
className: "fw-bold"
|
5274
|
+
}, React__default.createElement("span", {
|
5275
|
+
className: "text-danger me-1"
|
5276
|
+
}, "*"), t("your_browser_must"), ":"), React__default.createElement(List, {
|
5277
|
+
className: "ps-3 pt-0"
|
5278
|
+
}, React__default.createElement(ListItem, {
|
5279
|
+
disablePadding: true
|
5280
|
+
}, t("allowed_to_send_pop_ups_and_use_redirects")), React__default.createElement(ListItem, {
|
5281
|
+
disablePadding: true
|
5282
|
+
}, t("disable_ask_where_to_save_each_file_before_downloading")))), isTeacher && React__default.createElement(Stack, null, React__default.createElement(Typography, {
|
5283
|
+
fontWeight: 700
|
5284
|
+
}, t("choose_to_print"), ":"), React__default.createElement(FormGroup, {
|
5285
|
+
sx: {
|
5286
|
+
display: "flex",
|
5287
|
+
flexDirection: "row",
|
5288
|
+
gap: 1,
|
5289
|
+
flexWrap: "wrap"
|
5290
|
+
}
|
5291
|
+
}, TabList.map(function (_ref3) {
|
5292
|
+
var label = _ref3.label,
|
5293
|
+
value = _ref3.value;
|
5294
|
+
return React__default.createElement(FormControlLabel, {
|
5295
|
+
control: React__default.createElement(Checkbox, {
|
5296
|
+
onChange: handleChangeStatus,
|
5297
|
+
value: value,
|
5298
|
+
checked: status.some(function (i) {
|
5299
|
+
return i === value.toString();
|
5300
|
+
})
|
5301
|
+
}),
|
5302
|
+
label: t(label)
|
5303
|
+
});
|
5304
|
+
}))), React__default.createElement(Button, {
|
5305
|
+
className: "mt-3",
|
5306
|
+
variant: "contained",
|
5307
|
+
onClick: handleProgressPrint
|
5308
|
+
}, t("print_pdf"))));
|
5439
5309
|
};
|
5440
|
-
|
5441
|
-
|
5442
|
-
|
5443
|
-
|
5444
|
-
|
5445
|
-
|
5446
|
-
|
5447
|
-
});
|
5310
|
+
|
5311
|
+
var styles = {"lighter":"#F0FFF6","light":"#89F0B2","less_dark":"#3DC674","dark":"#349056","darker":"#18442A","gray_50":"#FBFBF9","gray_100":"#EAEAE5","gray_300":"#D0D0C8","gray_500":"#9A9A98","gray_700":"#5D5D5B","gray_900":"#363634","red_900":"#DB4D4D","green_support_900":"#3ACB46","yellow_900":"#FEAF06","purple_900":"#C3099A","btn-login-google":"_2HqmH","math-jax":"_3Pfdk","block-login":"_wWIyO","box-login":"_38Lo1","btn-primary":"_rd4Uy","dropdown-menu":"_1krbH","header-avatar":"_RQaHE","dropdown-menu-flag":"_XK8oS","dropdown-content":"_3ys4W","dropdown-change":"_ToOW_","item-address":"_3sQlR","item-logout":"_3bqSM","title-address":"_1jgSI","img-avatar":"_35Ttz","item-contact":"_1wc7o","content-text":"_3S4f2","dropdown-content-language":"_3ajui","dropdown-item-language":"_3Y_y4","dropdown-item-language-active":"_CzNMi","dropdown-academy":"_3CMVp","image-academy":"_2ibYC","academy-btn":"_1JMRU","switch-icon":"_N4FNf","dropdown-content-academy":"_31Dr0","dropdown-academy-item":"_3bjcz","noGutters":"_31ZQk","custom-col-2":"_3yXyK","custom-col-3":"_1RsJQ","custom-col-5":"_L42CP","custom-col-10":"_2u6eL","custom-row":"_8x7OP","custom-col":"_1JmTh","custom-col-4":"_3HO1e","custom-col-8":"_Oy31M","custom-col-12":"_3aUKo","custom-container":"_39LRs","form-label":"__Ut-u","form-control":"_2k4dX","btn-outline-primary":"_2PWdX","sort-icons":"_mQvLF","active":"_3oAH-","form-select":"_3W3aw","truncate":"_3NJzN","headers":"_3xnI5","logo-container":"_3YG70","tabBox":"_1CQPn","routerBox":"_3hx2T","tabText":"_3UyhW","router-link-active":"_1TGKA","router-link":"_1AqMh","userImg":"_2RI6G","disabled-link":"_3aVHg","line-clamp":"_3fpky"};
|
5312
|
+
|
5313
|
+
var config = {
|
5314
|
+
loader: {
|
5315
|
+
load: ["input/tex", "output/svg"]
|
5316
|
+
}
|
5448
5317
|
};
|
5449
|
-
var
|
5450
|
-
|
5318
|
+
var MathJaxContainer = function MathJaxContainer(_ref) {
|
5319
|
+
var content = _ref.content;
|
5320
|
+
return React__default.createElement(MathJaxContext, {
|
5321
|
+
config: config,
|
5322
|
+
asyncLoad: true
|
5323
|
+
}, React__default.createElement(MathJax, {
|
5324
|
+
id: "" + styles["math-jax"],
|
5325
|
+
dangerouslySetInnerHTML: {
|
5326
|
+
__html: content
|
5327
|
+
}
|
5328
|
+
}));
|
5451
5329
|
};
|
5452
5330
|
|
5453
|
-
var
|
5454
|
-
if (redirectAfterLogin === void 0) {
|
5455
|
-
redirectAfterLogin = true;
|
5456
|
-
}
|
5457
|
-
var dispatch = useDispatch();
|
5331
|
+
var ReleaseAlert = function ReleaseAlert() {
|
5458
5332
|
var _useTranslation = useTranslation(),
|
5459
5333
|
t = _useTranslation.t;
|
5460
|
-
var
|
5461
|
-
|
5462
|
-
var
|
5463
|
-
|
5464
|
-
|
5465
|
-
|
5466
|
-
|
5467
|
-
|
5468
|
-
|
5469
|
-
|
5470
|
-
|
5471
|
-
|
5472
|
-
|
5473
|
-
isLearningSpace = false;
|
5474
|
-
localStorage.removeItem(LEARNING_SPACE);
|
5334
|
+
var releaseDate = RELEASE_DATE;
|
5335
|
+
var isInValidDate = !releaseDate || releaseDate === DATE_MIN_VALUE || releaseDate === DATE_TIME_MIN_VALUE;
|
5336
|
+
var isLoginPage = window.location.pathname === LOGIN_URL;
|
5337
|
+
if (isInValidDate || !moment.utc(releaseDate).isValid()) return null;else {
|
5338
|
+
var version = moment(releaseDate).format("HH.mm.YYYY.MM.DD");
|
5339
|
+
return React__default.createElement(Box, {
|
5340
|
+
sx: {
|
5341
|
+
position: "fixed",
|
5342
|
+
right: 10,
|
5343
|
+
bottom: isLoginPage ? undefined : 5,
|
5344
|
+
top: isLoginPage ? 10 : undefined,
|
5345
|
+
userSelect: "none",
|
5346
|
+
zIndex: 1
|
5475
5347
|
}
|
5476
|
-
|
5477
|
-
|
5478
|
-
|
5479
|
-
|
5480
|
-
|
5481
|
-
|
5482
|
-
|
5483
|
-
|
5484
|
-
|
5485
|
-
var result = loginResponse.data;
|
5486
|
-
var _temp = function () {
|
5487
|
-
if (loginResponse.status === 204 && academyDomain) {
|
5488
|
-
localStorage.removeItem(ACADEMY_DOMAIN);
|
5489
|
-
localStorage.removeItem(LEARNING_SPACE);
|
5490
|
-
return Promise.resolve(apiLoginGoogleSuperAdmin(data)).then(function (_apiLoginGoogleSuperA) {
|
5491
|
-
loginResponse = _apiLoginGoogleSuperA;
|
5492
|
-
result = loginResponse.data;
|
5493
|
-
});
|
5494
|
-
}
|
5495
|
-
}();
|
5496
|
-
return _temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp);
|
5497
|
-
});
|
5498
|
-
}, function (error) {
|
5499
|
-
!!academyDomain && localStorage.removeItem(ACADEMY_DOMAIN);
|
5500
|
-
localStorage.removeItem(LEARNING_SPACE);
|
5501
|
-
reject(error);
|
5502
|
-
});
|
5503
|
-
return Promise.resolve(_temp3 && _temp3.then ? _temp3.then(function () {}) : void 0);
|
5504
|
-
} catch (e) {
|
5505
|
-
return Promise.reject(e);
|
5506
|
-
}
|
5507
|
-
});
|
5508
|
-
}, isStudent, isLogout)).then(function () {});
|
5509
|
-
} catch (e) {
|
5510
|
-
return Promise.reject(e);
|
5511
|
-
}
|
5512
|
-
};
|
5513
|
-
var handleLoginAccessToken = function handleLoginAccessToken(data, isLearningSpace, domain, isLogout, superAdminRedirectPath) {
|
5514
|
-
if (isLogout === void 0) {
|
5515
|
-
isLogout = true;
|
5516
|
-
}
|
5517
|
-
try {
|
5518
|
-
var isStudent = data.role === Role.Student;
|
5519
|
-
return Promise.resolve(handleLogin(function () {
|
5520
|
-
return new Promise(function (resolve, reject) {
|
5521
|
-
try {
|
5522
|
-
var _temp4 = _catch(function () {
|
5523
|
-
return Promise.resolve(!isLearningSpace && !domain ? apiLoginSuperAdminWithAccessToken(data) : apiLoginWithAccessToken(data, isLearningSpace, domain)).then(function (loginResponse) {
|
5524
|
-
var result = loginResponse.data;
|
5525
|
-
resolve(result);
|
5526
|
-
});
|
5527
|
-
}, function (error) {
|
5528
|
-
reject(error);
|
5529
|
-
});
|
5530
|
-
return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(function () {}) : void 0);
|
5531
|
-
} catch (e) {
|
5532
|
-
return Promise.reject(e);
|
5533
|
-
}
|
5534
|
-
});
|
5535
|
-
}, isStudent, isLogout, superAdminRedirectPath)).then(function () {});
|
5536
|
-
} catch (e) {
|
5537
|
-
return Promise.reject(e);
|
5538
|
-
}
|
5539
|
-
};
|
5540
|
-
var handleLogin = function handleLogin(apiLogin, isStudent, isLogout, superAdminRedirectPath) {
|
5541
|
-
if (isLogout === void 0) {
|
5542
|
-
isLogout = true;
|
5543
|
-
}
|
5544
|
-
try {
|
5545
|
-
var _temp6 = function _temp6(_result) {
|
5546
|
-
if (_exit) return _result;
|
5547
|
-
dispatch(setLoading(false));
|
5548
|
-
};
|
5549
|
-
var _exit = false;
|
5550
|
-
dispatch(setLoading(true));
|
5551
|
-
var _temp5 = _catch(function () {
|
5552
|
-
return Promise.resolve(apiLogin()).then(function (loginResponse) {
|
5553
|
-
var isFirstLogin = loginResponse.isFirstLogin,
|
5554
|
-
token = loginResponse.token,
|
5555
|
-
user = loginResponse.user,
|
5556
|
-
isSuperAdmin = loginResponse.isSuperAdmin;
|
5557
|
-
var isAcademy = !!(user !== null && user !== void 0 && user.academyDomain) || !!(user !== null && user !== void 0 && user.isLearningSpace);
|
5558
|
-
var needToRegister = isStudent && isFirstLogin && isAcademy;
|
5559
|
-
var redirectUrl = getRedirectUrl();
|
5560
|
-
if (isStudent && !registerUrl) throw new Error("an_unexpected_error_has_occurred");
|
5561
|
-
if (!redirectUrl) redirectUrl = needToRegister ? registerUrl : isAcademy ? homeAcademyUrl : homeUrl;
|
5562
|
-
if (superAdminRedirectPath) {
|
5563
|
-
redirectUrl = superAdminRedirectPath;
|
5564
|
-
}
|
5565
|
-
if (!redirectAfterLogin) redirectUrl = undefined;
|
5566
|
-
redirectLoginUser(_extends({}, user, {
|
5567
|
-
isNotEnoughStatements: isFirstLogin,
|
5568
|
-
isSuperAdmin: isSuperAdmin
|
5569
|
-
}), token, redirectUrl);
|
5570
|
-
});
|
5571
|
-
}, function (error) {
|
5572
|
-
alert(getErrorMessage(t, error));
|
5573
|
-
isLogout && handleSignOut();
|
5574
|
-
});
|
5575
|
-
return Promise.resolve(_temp5 && _temp5.then ? _temp5.then(_temp6) : _temp6(_temp5));
|
5576
|
-
} catch (e) {
|
5577
|
-
return Promise.reject(e);
|
5578
|
-
}
|
5579
|
-
};
|
5580
|
-
var redirectLoginUser = function redirectLoginUser(data, token, redirectUrl) {
|
5581
|
-
localStorage.setItem(ACCESS_TOKEN, token);
|
5582
|
-
!data.academyDomain && localStorage.removeItem(ACADEMY_DOMAIN);
|
5583
|
-
!!data.academyDomain && localStorage.setItem(ACADEMY_DOMAIN, data.academyDomain);
|
5584
|
-
if (data.roles.includes(Role.Student)) data.isLearningSpace ? localStorage.setItem(LEARNING_SPACE, "true") : localStorage.removeItem(LEARNING_SPACE);
|
5585
|
-
dispatch(setUser(_extends({}, data)));
|
5586
|
-
if (redirectUrl) {
|
5587
|
-
pushTo(history, redirectUrl);
|
5588
|
-
localStorage.removeItem(REDIRECT_URL);
|
5589
|
-
}
|
5590
|
-
};
|
5591
|
-
return {
|
5592
|
-
handleLoginGoogle: handleLoginGoogle,
|
5593
|
-
handleLoginAccessToken: handleLoginAccessToken,
|
5594
|
-
redirectLoginUser: redirectLoginUser
|
5595
|
-
};
|
5348
|
+
}, React__default.createElement(Typography, {
|
5349
|
+
color: "success",
|
5350
|
+
sx: {
|
5351
|
+
fontSize: 10,
|
5352
|
+
color: "#3DC674",
|
5353
|
+
opacity: 0.8
|
5354
|
+
}
|
5355
|
+
}, t("version"), ": ", React__default.createElement("span", null, version)));
|
5356
|
+
}
|
5596
5357
|
};
|
5597
5358
|
|
5598
|
-
var
|
5599
|
-
var
|
5600
|
-
|
5601
|
-
|
5602
|
-
|
5603
|
-
|
5604
|
-
|
5605
|
-
|
5359
|
+
var ActionButtons = function ActionButtons(_ref) {
|
5360
|
+
var _ref$className = _ref.className,
|
5361
|
+
className = _ref$className === void 0 ? "" : _ref$className,
|
5362
|
+
backText = _ref.backText,
|
5363
|
+
saveText = _ref.saveText,
|
5364
|
+
altSaveText = _ref.altSaveText,
|
5365
|
+
saveDisabled = _ref.saveDisabled,
|
5366
|
+
saveIcon = _ref.saveIcon,
|
5367
|
+
_ref$hideSave = _ref.hideSave,
|
5368
|
+
hideSave = _ref$hideSave === void 0 ? false : _ref$hideSave,
|
5369
|
+
onBack = _ref.onBack,
|
5370
|
+
onSave = _ref.onSave,
|
5371
|
+
onAltSave = _ref.onAltSave,
|
5372
|
+
isReadonly = _ref.isReadonly;
|
5373
|
+
return React__default.createElement(Stack, {
|
5374
|
+
direction: "row",
|
5375
|
+
spacing: 1,
|
5376
|
+
className: "" + className
|
5377
|
+
}, React__default.createElement(Button, {
|
5378
|
+
variant: "contained",
|
5379
|
+
className: "bg-secondary",
|
5380
|
+
startIcon: React__default.createElement(IoMdArrowBack, {
|
5381
|
+
size: 16
|
5382
|
+
}),
|
5383
|
+
onClick: onBack
|
5384
|
+
}, backText), !hideSave && React__default.createElement(Button, {
|
5385
|
+
variant: "contained",
|
5386
|
+
color: "success",
|
5387
|
+
startIcon: saveIcon != null ? saveIcon : React__default.createElement(FaSave, {
|
5388
|
+
size: 16
|
5389
|
+
}),
|
5390
|
+
onClick: onSave,
|
5391
|
+
disabled: saveDisabled || isReadonly
|
5392
|
+
}, saveText), !!altSaveText && onAltSave && React__default.createElement(Button, {
|
5393
|
+
variant: "contained",
|
5394
|
+
color: "primary",
|
5395
|
+
startIcon: React__default.createElement(FaSave, {
|
5396
|
+
size: 16
|
5397
|
+
}),
|
5398
|
+
onClick: onAltSave,
|
5399
|
+
disabled: saveDisabled
|
5400
|
+
}, altSaveText));
|
5606
5401
|
};
|
5607
|
-
|
5608
|
-
|
5609
|
-
|
5610
|
-
|
5611
|
-
|
5612
|
-
|
5613
|
-
|
5614
|
-
|
5402
|
+
|
5403
|
+
var TITLE = "not_found";
|
5404
|
+
var NotFound = function NotFound(_ref) {
|
5405
|
+
var history = _ref.history;
|
5406
|
+
var _useTranslation = useTranslation(),
|
5407
|
+
t = _useTranslation.t;
|
5408
|
+
history && useLanguage(history);
|
5409
|
+
useEffect(function () {
|
5410
|
+
document.title = t("study_peak") + " | " + t(TITLE);
|
5411
|
+
}, [t]);
|
5412
|
+
return React__default.createElement("div", {
|
5413
|
+
className: "not-found d-flex justify-content-center"
|
5414
|
+
}, React__default.createElement("div", {
|
5415
|
+
className: "clearfix pt-5"
|
5416
|
+
}, React__default.createElement("h1", {
|
5417
|
+
className: "float-left display-3 fw-bold mr-4 text-center"
|
5418
|
+
}, "404"), React__default.createElement("div", {
|
5419
|
+
className: "float-left"
|
5420
|
+
}, React__default.createElement("h4", {
|
5421
|
+
className: "pt-3"
|
5422
|
+
}, t('oops')), React__default.createElement("p", {
|
5423
|
+
className: "text-muted mb-2"
|
5424
|
+
}, t('the_page_you_are_looking_for_was_not_found')), React__default.createElement("div", null))));
|
5615
5425
|
};
|
5616
|
-
|
5617
|
-
|
5618
|
-
|
5619
|
-
|
5426
|
+
|
5427
|
+
var CommonDialog = function CommonDialog(_ref) {
|
5428
|
+
var open = _ref.open,
|
5429
|
+
children = _ref.children,
|
5430
|
+
title = _ref.title,
|
5431
|
+
_ref$size = _ref.size,
|
5432
|
+
size = _ref$size === void 0 ? "xs" : _ref$size,
|
5433
|
+
_ref$isShowHeader = _ref.isShowHeader,
|
5434
|
+
isShowHeader = _ref$isShowHeader === void 0 ? true : _ref$isShowHeader,
|
5435
|
+
titleClassName = _ref.titleClassName,
|
5436
|
+
minWidth = _ref.minWidth,
|
5437
|
+
onClose = _ref.onClose;
|
5438
|
+
return React__default.createElement(Dialog, {
|
5439
|
+
open: open,
|
5440
|
+
onClose: onClose,
|
5441
|
+
maxWidth: size,
|
5442
|
+
fullWidth: true,
|
5443
|
+
scroll: "body",
|
5444
|
+
sx: {
|
5445
|
+
zIndex: 1102
|
5446
|
+
},
|
5447
|
+
PaperProps: {
|
5448
|
+
sx: {
|
5449
|
+
overflowY: "unset",
|
5450
|
+
minWidth: minWidth
|
5451
|
+
}
|
5620
5452
|
}
|
5621
|
-
}
|
5453
|
+
}, isShowHeader ? React__default.createElement(Fragment$1, null, React__default.createElement(DialogTitle, {
|
5454
|
+
className: "border border-start-0 border-end-0 border-top-0 border-1 " + titleClassName,
|
5455
|
+
sx: {
|
5456
|
+
fontSize: "16px!important"
|
5457
|
+
}
|
5458
|
+
}, title), React__default.createElement(IconButton, {
|
5459
|
+
"aria-label": "close",
|
5460
|
+
onClick: onClose,
|
5461
|
+
sx: {
|
5462
|
+
position: "absolute",
|
5463
|
+
right: 8,
|
5464
|
+
top: 8,
|
5465
|
+
color: function color(theme) {
|
5466
|
+
return theme.palette.grey[500];
|
5467
|
+
}
|
5468
|
+
}
|
5469
|
+
}, React__default.createElement(IoClose, null))) : React__default.createElement(Box, {
|
5470
|
+
className: "p-3"
|
5471
|
+
}, React__default.createElement(Typography, {
|
5472
|
+
className: "fs-5 text-center fw-bold"
|
5473
|
+
}, title)), children);
|
5622
5474
|
};
|
5623
|
-
|
5624
|
-
|
5475
|
+
|
5476
|
+
var confirmDialogTextStyle = {
|
5477
|
+
color: "#363634",
|
5478
|
+
fontSize: 16,
|
5479
|
+
fontWeight: 700
|
5625
5480
|
};
|
5626
|
-
var
|
5627
|
-
|
5628
|
-
|
5629
|
-
|
5630
|
-
return api.post(ACADEMY_URL + "/" + academyId + "/switch-academy/" + role, undefined, {
|
5631
|
-
params: {
|
5632
|
-
isLearningSpace: isLearningSpace
|
5633
|
-
}
|
5634
|
-
});
|
5481
|
+
var confirmDialogButtonStyle = {
|
5482
|
+
width: "120px",
|
5483
|
+
fontSize: 14,
|
5484
|
+
fontWeight: 700
|
5635
5485
|
};
|
5636
|
-
var
|
5637
|
-
|
5486
|
+
var ConfirmDeleteDialogDefaultProps = {
|
5487
|
+
titleStyle: confirmDialogTextStyle,
|
5488
|
+
contentStyle: {
|
5489
|
+
paddingTop: "36px",
|
5490
|
+
padding: "36px",
|
5491
|
+
width: 363
|
5492
|
+
},
|
5493
|
+
contentTextStyle: _extends({}, confirmDialogTextStyle, {
|
5494
|
+
textAlign: "center"
|
5495
|
+
}),
|
5496
|
+
actionStyle: {
|
5497
|
+
justifyContent: "space-between",
|
5498
|
+
padding: "12px"
|
5499
|
+
},
|
5500
|
+
okButtonStyle: confirmDialogButtonStyle,
|
5501
|
+
cancelButtonStyle: _extends({}, confirmDialogButtonStyle, {
|
5502
|
+
color: "#3dc674"
|
5503
|
+
}),
|
5504
|
+
cancelButtonVariant: "text",
|
5505
|
+
isDelete: true
|
5638
5506
|
};
|
5639
5507
|
|
5640
|
-
var
|
5641
|
-
var
|
5642
|
-
|
5643
|
-
|
5644
|
-
|
5645
|
-
|
5646
|
-
|
5647
|
-
|
5648
|
-
|
5649
|
-
|
5650
|
-
|
5651
|
-
|
5652
|
-
|
5653
|
-
|
5654
|
-
|
5655
|
-
|
5656
|
-
|
5657
|
-
|
5658
|
-
|
5659
|
-
|
5660
|
-
|
5661
|
-
|
5662
|
-
|
5663
|
-
var
|
5664
|
-
|
5665
|
-
|
5666
|
-
});
|
5667
|
-
var isReFetchUserAcademies = useSelector(function (state) {
|
5668
|
-
var _state$common2;
|
5669
|
-
return state === null || state === void 0 ? void 0 : (_state$common2 = state.common) === null || _state$common2 === void 0 ? void 0 : _state$common2.isReFetchUserAcademies;
|
5670
|
-
});
|
5508
|
+
var ConfirmDialog = function ConfirmDialog(_ref) {
|
5509
|
+
var open = _ref.open,
|
5510
|
+
text = _ref.text,
|
5511
|
+
cancelText = _ref.cancelText,
|
5512
|
+
okText = _ref.okText,
|
5513
|
+
isDelete = _ref.isDelete,
|
5514
|
+
title = _ref.title,
|
5515
|
+
confirmText = _ref.confirmText,
|
5516
|
+
titleStyle = _ref.titleStyle,
|
5517
|
+
titleClassName = _ref.titleClassName,
|
5518
|
+
contentStyle = _ref.contentStyle,
|
5519
|
+
cancelButtonStyle = _ref.cancelButtonStyle,
|
5520
|
+
contentTextStyle = _ref.contentTextStyle,
|
5521
|
+
okButtonStyle = _ref.okButtonStyle,
|
5522
|
+
actionStyle = _ref.actionStyle,
|
5523
|
+
_ref$okButtonVariant = _ref.okButtonVariant,
|
5524
|
+
okButtonVariant = _ref$okButtonVariant === void 0 ? "contained" : _ref$okButtonVariant,
|
5525
|
+
_ref$cancelButtonVari = _ref.cancelButtonVariant,
|
5526
|
+
cancelButtonVariant = _ref$cancelButtonVari === void 0 ? "contained" : _ref$cancelButtonVari,
|
5527
|
+
_ref$zIndex = _ref.zIndex,
|
5528
|
+
zIndex = _ref$zIndex === void 0 ? 1102 : _ref$zIndex,
|
5529
|
+
toggle = _ref.toggle,
|
5530
|
+
onConfirm = _ref.onConfirm;
|
5531
|
+
var _useState = useState(),
|
5532
|
+
confirmTextValue = _useState[0],
|
5533
|
+
setConfirmTextValue = _useState[1];
|
5671
5534
|
var _useTranslation = useTranslation(),
|
5672
5535
|
t = _useTranslation.t;
|
5673
|
-
var
|
5674
|
-
|
5675
|
-
isLoading = true;
|
5676
|
-
}
|
5677
|
-
try {
|
5678
|
-
var _temp3 = function _temp3() {
|
5679
|
-
isLoading && dispatch(setLoading(false));
|
5680
|
-
};
|
5681
|
-
if (!user) return Promise.resolve();
|
5682
|
-
var isSuperAdminUser = user && !user.academyDomain && !(user !== null && user !== void 0 && user.isLearningSpace);
|
5683
|
-
var isSuperAdminRole = user.roles.includes(Role.Admin);
|
5684
|
-
isLoading && dispatch(setLoading(true));
|
5685
|
-
var _temp2 = _catch(function () {
|
5686
|
-
return Promise.resolve(isSuperAdminUser ? getAcademyList(role) : getUserAcademies(role, user === null || user === void 0 ? void 0 : user.isLearningSpace)).then(function (res) {
|
5687
|
-
var items = res.data.items || [];
|
5688
|
-
if (isReFetchUserAcademies) dispatch(setReFetchUserAcademies(false));
|
5689
|
-
dispatch(setAcademies(items));
|
5690
|
-
var _temp = function () {
|
5691
|
-
if (!isSuperAdminRole && isSuperAdminUser && role == Role.Admin && items.length > 0) {
|
5692
|
-
return Promise.resolve(handleSwitchAcademy(false, items[0], false)).then(function () {});
|
5693
|
-
}
|
5694
|
-
}();
|
5695
|
-
if (_temp && _temp.then) return _temp.then(function () {});
|
5696
|
-
});
|
5697
|
-
}, function (error) {
|
5698
|
-
toast.error(getErrorMessage(t, error));
|
5699
|
-
});
|
5700
|
-
return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(_temp3) : _temp3(_temp2));
|
5701
|
-
} catch (e) {
|
5702
|
-
return Promise.reject(e);
|
5703
|
-
}
|
5536
|
+
var handleConfirm = function handleConfirm() {
|
5537
|
+
onConfirm();
|
5704
5538
|
};
|
5705
|
-
var
|
5706
|
-
|
5707
|
-
|
5539
|
+
var handleChangeConfirmText = function handleChangeConfirmText(e) {
|
5540
|
+
setConfirmTextValue(e.target.value);
|
5541
|
+
};
|
5542
|
+
var handlePaste = function handlePaste(_) {};
|
5543
|
+
useEffect(function () {
|
5544
|
+
!open && setConfirmTextValue(undefined);
|
5545
|
+
}, [open]);
|
5546
|
+
var isValid = !!confirmText && !!confirmTextValue && confirmTextValue.trim() === confirmText.trim();
|
5547
|
+
var isDisableDelete = !!confirmText && (confirmTextValue === null || confirmTextValue === void 0 ? void 0 : confirmTextValue.trim()) !== confirmText.trim();
|
5548
|
+
return React__default.createElement(Dialog, {
|
5549
|
+
open: open,
|
5550
|
+
onClose: toggle,
|
5551
|
+
sx: {
|
5552
|
+
zIndex: zIndex
|
5708
5553
|
}
|
5709
|
-
|
5710
|
-
|
5711
|
-
|
5712
|
-
|
5713
|
-
|
5714
|
-
|
5715
|
-
|
5716
|
-
|
5717
|
-
|
5718
|
-
|
5719
|
-
|
5720
|
-
|
5721
|
-
|
5722
|
-
|
5723
|
-
|
5724
|
-
|
5725
|
-
|
5726
|
-
|
5727
|
-
|
5728
|
-
|
5729
|
-
|
5730
|
-
|
5731
|
-
|
5732
|
-
|
5733
|
-
|
5554
|
+
}, React__default.createElement(Fragment$1, null, React__default.createElement(DialogTitle, {
|
5555
|
+
className: "border border-start-0 border-end-0 border-top-0 border-1 " + titleClassName,
|
5556
|
+
sx: _extends({
|
5557
|
+
fontSize: 16
|
5558
|
+
}, titleStyle)
|
5559
|
+
}, title || t('confirmation')), React__default.createElement(IconButton, {
|
5560
|
+
"aria-label": "close",
|
5561
|
+
onClick: toggle,
|
5562
|
+
sx: {
|
5563
|
+
position: "absolute",
|
5564
|
+
right: 8,
|
5565
|
+
top: 8,
|
5566
|
+
color: function color(theme) {
|
5567
|
+
return theme.palette.grey[500];
|
5568
|
+
}
|
5569
|
+
}
|
5570
|
+
}, React__default.createElement(IoClose, null))), React__default.createElement(DialogContent, {
|
5571
|
+
sx: _extends({
|
5572
|
+
pt: 0.5
|
5573
|
+
}, contentStyle)
|
5574
|
+
}, React__default.createElement(Typography, {
|
5575
|
+
className: "mb-1",
|
5576
|
+
sx: _extends({
|
5577
|
+
fontWeight: 700
|
5578
|
+
}, contentTextStyle)
|
5579
|
+
}, text), !!confirmText && React__default.createElement("div", {
|
5580
|
+
className: "w-100"
|
5581
|
+
}, React__default.createElement("p", {
|
5582
|
+
className: "mb-3"
|
5583
|
+
}, t("enter_text_to_confirm_delete", {
|
5584
|
+
text: confirmText
|
5585
|
+
})), React__default.createElement(TextField, {
|
5586
|
+
className: "w-100",
|
5587
|
+
sx: {
|
5588
|
+
"& input": {
|
5589
|
+
py: 1
|
5590
|
+
}
|
5591
|
+
},
|
5592
|
+
value: confirmTextValue,
|
5593
|
+
onChange: handleChangeConfirmText,
|
5594
|
+
placeholder: t('please_enter'),
|
5595
|
+
onPaste: handlePaste,
|
5596
|
+
error: !isValid && confirmTextValue !== undefined,
|
5597
|
+
color: isValid ? "success" : confirmTextValue !== undefined ? "error" : undefined
|
5598
|
+
}))), React__default.createElement(DialogActions, {
|
5599
|
+
className: "border border-start-0 border-end-0 border-bottom-0 border-1 " + titleClassName,
|
5600
|
+
sx: _extends({
|
5601
|
+
paddingTop: 1
|
5602
|
+
}, actionStyle)
|
5603
|
+
}, React__default.createElement(Button, {
|
5604
|
+
variant: cancelButtonVariant,
|
5605
|
+
color: cancelButtonVariant !== "contained" ? "primary" : "secondary",
|
5606
|
+
className: "px-3 " + (cancelButtonVariant !== "contained" ? "primary" : "bg-secondary"),
|
5607
|
+
onClick: toggle,
|
5608
|
+
sx: cancelButtonStyle
|
5609
|
+
}, cancelText || t("no")), React__default.createElement(Button, {
|
5610
|
+
variant: okButtonVariant,
|
5611
|
+
color: isDelete ? "error" : "primary",
|
5612
|
+
className: "px-3",
|
5613
|
+
disabled: isDisableDelete,
|
5614
|
+
onClick: handleConfirm,
|
5615
|
+
sx: _extends({}, okButtonStyle, isDelete && {
|
5616
|
+
backgroundColor: "#db4d4d",
|
5617
|
+
color: "#FFFFFF",
|
5618
|
+
"&:hover": {
|
5619
|
+
backgroundColor: "#C41414"
|
5620
|
+
}
|
5621
|
+
})
|
5622
|
+
}, okText || t('yes'))));
|
5623
|
+
};
|
5624
|
+
|
5625
|
+
var ConfirmDeleteDialog = function ConfirmDeleteDialog(props) {
|
5626
|
+
return React__default.createElement(ConfirmDialog, Object.assign({}, ConfirmDeleteDialogDefaultProps, props));
|
5627
|
+
};
|
5628
|
+
|
5629
|
+
var _templateObject;
|
5630
|
+
var BorderedTextField = styled(TextField)(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n & .MuiOutlinedInput-root {\n &.Mui-focused fieldset {\n border-width: 1px;\n border-color: ", ";\n }\n }\n & .MuiOutlinedInput-root:hover {\n fieldset {\n border-width: 1px;\n border-color: ", ";\n }\n }\n"])), styles.dark, styles.less_dark);
|
5631
|
+
var InputText = function InputText(props) {
|
5632
|
+
return React__default.createElement(BorderedTextField, Object.assign({
|
5633
|
+
sx: {
|
5634
|
+
"& input": {
|
5635
|
+
py: "7.5px",
|
5636
|
+
px: "12px"
|
5637
|
+
},
|
5638
|
+
"& > div": {
|
5639
|
+
borderColor: "#97A1AF",
|
5640
|
+
borderRadius: "4px"
|
5641
|
+
}
|
5734
5642
|
}
|
5643
|
+
}, props));
|
5644
|
+
};
|
5645
|
+
|
5646
|
+
var PassCodeDialog = function PassCodeDialog(_ref) {
|
5647
|
+
var open = _ref.open,
|
5648
|
+
onClose = _ref.onClose,
|
5649
|
+
onSubmit = _ref.onSubmit,
|
5650
|
+
academyDomain = _ref.academyDomain;
|
5651
|
+
var _useTranslation = useTranslation(),
|
5652
|
+
t = _useTranslation.t;
|
5653
|
+
var _useState = useState(""),
|
5654
|
+
passCode = _useState[0],
|
5655
|
+
setPassCode = _useState[1];
|
5656
|
+
var handleClose = function handleClose(event, reason) {
|
5657
|
+
onClose(event, reason);
|
5735
5658
|
};
|
5736
|
-
var
|
5659
|
+
var handleSubmit = function handleSubmit() {
|
5737
5660
|
try {
|
5738
|
-
var
|
5739
|
-
|
5740
|
-
|
5661
|
+
var data = {
|
5662
|
+
code: passCode,
|
5663
|
+
academyDomain: academyDomain
|
5741
5664
|
};
|
5742
|
-
|
5743
|
-
var _temp6 = _catch(function () {
|
5744
|
-
return Promise.resolve(switchAcademy(0, role)).then(function (res) {
|
5745
|
-
var data = res.data;
|
5746
|
-
var requestBody = {
|
5747
|
-
accessToken: data.accessToken,
|
5748
|
-
email: user.email,
|
5749
|
-
role: role
|
5750
|
-
};
|
5751
|
-
return Promise.resolve(handleLoginAccessToken(requestBody, undefined, undefined, false)).then(function () {});
|
5752
|
-
});
|
5753
|
-
}, function (error) {
|
5754
|
-
toast.error(getErrorMessage(t, error));
|
5755
|
-
});
|
5756
|
-
return Promise.resolve(_temp6 && _temp6.then ? _temp6.then(_temp7) : _temp7(_temp6));
|
5665
|
+
return Promise.resolve(onSubmit(data, handleClose)).then(function () {});
|
5757
5666
|
} catch (e) {
|
5758
5667
|
return Promise.reject(e);
|
5759
5668
|
}
|
5760
5669
|
};
|
5761
|
-
|
5762
|
-
|
5763
|
-
}, [canFetchAcademies, user === null || user === void 0 ? void 0 : user.academyDomain, user === null || user === void 0 ? void 0 : user.email, user === null || user === void 0 ? void 0 : (_user$roles = user.roles) === null || _user$roles === void 0 ? void 0 : _user$roles.join(",")]);
|
5764
|
-
useEffect(function () {
|
5765
|
-
canFetchAcademies && isReFetchUserAcademies && getAcademies(false);
|
5766
|
-
}, [canFetchAcademies, isReFetchUserAcademies]);
|
5767
|
-
var selectedAcademy = useMemo(function () {
|
5768
|
-
return academyList.find(function (i) {
|
5769
|
-
var _user$academyDomain;
|
5770
|
-
return i.domain.trim().toLowerCase() === (user === null || user === void 0 ? void 0 : (_user$academyDomain = user.academyDomain) === null || _user$academyDomain === void 0 ? void 0 : _user$academyDomain.trim().toLowerCase());
|
5771
|
-
});
|
5772
|
-
}, [user === null || user === void 0 ? void 0 : user.academyDomain, JSON.stringify(academyList)]);
|
5773
|
-
return {
|
5774
|
-
selectedAcademy: selectedAcademy,
|
5775
|
-
dropdownOpen: dropdownOpen,
|
5776
|
-
academyList: academyList,
|
5777
|
-
toggleDropdown: toggleDropdown,
|
5778
|
-
handleSwitchAcademy: handleSwitchAcademy,
|
5779
|
-
handleLogOutAcademy: handleLogOutAcademy
|
5670
|
+
var handleChangePassCode = function handleChangePassCode(e) {
|
5671
|
+
setPassCode(e.target.value);
|
5780
5672
|
};
|
5673
|
+
var theme = useTheme();
|
5674
|
+
return React__default.createElement(CommonDialog, {
|
5675
|
+
open: open,
|
5676
|
+
onClose: handleClose,
|
5677
|
+
size: "xs",
|
5678
|
+
title: t("join_an_academy")
|
5679
|
+
}, React__default.createElement(DialogContent, {
|
5680
|
+
sx: {
|
5681
|
+
overflowY: "unset"
|
5682
|
+
}
|
5683
|
+
}, React__default.createElement(Stack, {
|
5684
|
+
direction: "column",
|
5685
|
+
spacing: 2,
|
5686
|
+
zIndex: 1,
|
5687
|
+
position: "relative"
|
5688
|
+
}, React__default.createElement(FormGroup, null, React__default.createElement(FormLabel, {
|
5689
|
+
className: "fw-medium mb-1"
|
5690
|
+
}, t("pass_code"), React__default.createElement("span", {
|
5691
|
+
className: "text-danger"
|
5692
|
+
}, "*")), React__default.createElement(InputText, {
|
5693
|
+
id: "pass-code",
|
5694
|
+
placeholder: t("enter_pass_code"),
|
5695
|
+
value: passCode,
|
5696
|
+
onChange: handleChangePassCode
|
5697
|
+
})))), React__default.createElement(DialogActions, {
|
5698
|
+
className: ""
|
5699
|
+
}, React__default.createElement(Button, {
|
5700
|
+
variant: "contained",
|
5701
|
+
sx: {
|
5702
|
+
bgcolor: theme.palette.grey[700]
|
5703
|
+
},
|
5704
|
+
onClick: handleClose
|
5705
|
+
}, t("cancel")), React__default.createElement(Button, {
|
5706
|
+
variant: "contained",
|
5707
|
+
onClick: handleSubmit,
|
5708
|
+
disabled: !passCode.trim().length
|
5709
|
+
}, t("confirmation"))));
|
5781
5710
|
};
|
5782
5711
|
|
5783
|
-
var
|
5784
|
-
|
5785
|
-
|
5786
|
-
|
5787
|
-
|
5788
|
-
|
5789
|
-
|
5790
|
-
|
5791
|
-
|
5792
|
-
|
5793
|
-
|
5794
|
-
|
5795
|
-
|
5796
|
-
|
5797
|
-
|
5798
|
-
|
5799
|
-
|
5800
|
-
|
5801
|
-
|
5802
|
-
|
5803
|
-
|
5804
|
-
|
5805
|
-
|
5806
|
-
|
5807
|
-
|
5808
|
-
|
5809
|
-
|
5810
|
-
|
5811
|
-
|
5812
|
-
|
5813
|
-
|
5814
|
-
|
5815
|
-
|
5816
|
-
|
5817
|
-
|
5818
|
-
|
5819
|
-
|
5820
|
-
|
5821
|
-
|
5822
|
-
|
5823
|
-
|
5824
|
-
|
5825
|
-
|
5826
|
-
|
5827
|
-
|
5828
|
-
|
5829
|
-
|
5830
|
-
|
5831
|
-
|
5832
|
-
|
5833
|
-
|
5834
|
-
|
5835
|
-
|
5836
|
-
|
5837
|
-
|
5838
|
-
},
|
5839
|
-
|
5840
|
-
|
5841
|
-
|
5842
|
-
|
5843
|
-
|
5844
|
-
|
5845
|
-
|
5846
|
-
|
5847
|
-
|
5848
|
-
|
5849
|
-
handleChangeStartIndex: handleChangeStartIndex,
|
5850
|
-
handleChangeEndIndex: handleChangeEndIndex
|
5712
|
+
var loadingStyle = {
|
5713
|
+
minWidth: "100vw",
|
5714
|
+
minHeight: "100vh",
|
5715
|
+
position: "fixed",
|
5716
|
+
top: 0,
|
5717
|
+
left: 0,
|
5718
|
+
zIndex: 999999999,
|
5719
|
+
backgroundColor: "rgba(0, 0, 0, 0.4)",
|
5720
|
+
display: "flex",
|
5721
|
+
justifyContent: "center",
|
5722
|
+
alignItems: "center"
|
5723
|
+
};
|
5724
|
+
var Loading = function Loading() {
|
5725
|
+
var isLoading = useSelector(function (state) {
|
5726
|
+
return state.common.isLoading;
|
5727
|
+
});
|
5728
|
+
return isLoading ? React__default.createElement("div", {
|
5729
|
+
style: loadingStyle
|
5730
|
+
}, React__default.createElement("div", {
|
5731
|
+
className: "spinner-border text-secondary",
|
5732
|
+
role: "status"
|
5733
|
+
}, React__default.createElement("span", {
|
5734
|
+
className: "sr-only"
|
5735
|
+
}))) : null;
|
5736
|
+
};
|
5737
|
+
|
5738
|
+
var loadingStyle$1 = {
|
5739
|
+
minWidth: "100vw",
|
5740
|
+
minHeight: "100vh",
|
5741
|
+
position: "fixed",
|
5742
|
+
top: 0,
|
5743
|
+
left: 0,
|
5744
|
+
zIndex: 999999999,
|
5745
|
+
backgroundColor: "rgba(0, 0, 0, 0.4)",
|
5746
|
+
display: "flex",
|
5747
|
+
justifyContent: "center",
|
5748
|
+
alignItems: "center"
|
5749
|
+
};
|
5750
|
+
var LoadingComponent = function LoadingComponent(_ref) {
|
5751
|
+
var isLoading = _ref.isLoading,
|
5752
|
+
children = _ref.children,
|
5753
|
+
_ref$spinClassName = _ref.spinClassName,
|
5754
|
+
spinClassName = _ref$spinClassName === void 0 ? "text-secondary" : _ref$spinClassName,
|
5755
|
+
_ref$className = _ref.className,
|
5756
|
+
className = _ref$className === void 0 ? "" : _ref$className;
|
5757
|
+
return isLoading ? React__default.createElement("div", {
|
5758
|
+
style: loadingStyle$1
|
5759
|
+
}, React__default.createElement(Stack, {
|
5760
|
+
direction: "column",
|
5761
|
+
justifyContent: "center",
|
5762
|
+
alignItems: "center",
|
5763
|
+
className: className
|
5764
|
+
}, React__default.createElement("div", {
|
5765
|
+
className: "spinner-border " + spinClassName,
|
5766
|
+
role: "status"
|
5767
|
+
}, React__default.createElement("span", {
|
5768
|
+
className: "sr-only"
|
5769
|
+
})), React__default.createElement("div", null, children))) : null;
|
5770
|
+
};
|
5771
|
+
|
5772
|
+
var CustomPagination = function CustomPagination(_ref) {
|
5773
|
+
var currentPage = _ref.currentPage,
|
5774
|
+
totalPage = _ref.totalPage,
|
5775
|
+
onChangePage = _ref.onChangePage;
|
5776
|
+
var handleChangePage = function handleChangePage(_, page) {
|
5777
|
+
onChangePage(page);
|
5851
5778
|
};
|
5779
|
+
return React__default.createElement(Pagination, {
|
5780
|
+
className: "w-fit",
|
5781
|
+
count: totalPage,
|
5782
|
+
page: currentPage,
|
5783
|
+
onChange: handleChangePage
|
5784
|
+
});
|
5852
5785
|
};
|
5853
5786
|
|
5854
|
-
var
|
5855
|
-
(
|
5856
|
-
|
5857
|
-
|
5858
|
-
|
5859
|
-
|
5860
|
-
|
5861
|
-
|
5862
|
-
|
5787
|
+
var DropdownIndicator = function DropdownIndicator(props) {
|
5788
|
+
return React__default.createElement(components.DropdownIndicator, Object.assign({}, props), React__default.createElement(FaCaretDown, {
|
5789
|
+
size: 20,
|
5790
|
+
color: styles.darker
|
5791
|
+
}));
|
5792
|
+
};
|
5793
|
+
var CustomOption = function CustomOption(props) {
|
5794
|
+
return React__default.createElement(components.Option, Object.assign({}, props), React__default.createElement("div", {
|
5795
|
+
style: {
|
5796
|
+
fontSize: "14px",
|
5797
|
+
fontWeight: 500
|
5798
|
+
}
|
5799
|
+
}, props.data.label));
|
5800
|
+
};
|
5863
5801
|
|
5864
|
-
var
|
5865
|
-
|
5866
|
-
|
5867
|
-
|
5868
|
-
|
5802
|
+
var customStyles = {
|
5803
|
+
control: function control(baseStyles, state) {
|
5804
|
+
return _extends({}, baseStyles, {
|
5805
|
+
fontSize: "14px",
|
5806
|
+
fontWeight: 700,
|
5807
|
+
color: styles.darker,
|
5808
|
+
borderColor: state.isFocused || state.hasValue ? styles.dark : styles.less_dark,
|
5809
|
+
boxShadow: state.isFocused ? "0 0 0 1px " + styles.dark + "4D" : baseStyles.boxShadow,
|
5810
|
+
"&:active": {
|
5811
|
+
borderColor: state.isFocused || state.hasValue ? styles.dark : styles.less_dark
|
5812
|
+
},
|
5813
|
+
"&:hover": {
|
5814
|
+
borderColor: state.isFocused || state.hasValue ? styles.dark : styles.less_dark
|
5815
|
+
}
|
5816
|
+
});
|
5869
5817
|
},
|
5870
|
-
|
5871
|
-
return
|
5872
|
-
|
5873
|
-
|
5874
|
-
|
5875
|
-
|
5876
|
-
|
5877
|
-
|
5878
|
-
|
5818
|
+
input: function input(baseStyles, _) {
|
5819
|
+
return _extends({}, baseStyles, {
|
5820
|
+
fontSize: "14px",
|
5821
|
+
fontWeight: 700,
|
5822
|
+
color: styles.darker
|
5823
|
+
});
|
5824
|
+
},
|
5825
|
+
singleValue: function singleValue(baseStyles) {
|
5826
|
+
return _extends({}, baseStyles, {
|
5827
|
+
fontSize: "14px",
|
5828
|
+
fontWeight: 700,
|
5829
|
+
color: styles.darker
|
5830
|
+
});
|
5831
|
+
},
|
5832
|
+
option: function option(baseStyles, state) {
|
5833
|
+
return _extends({}, baseStyles, {
|
5834
|
+
backgroundColor: state.isSelected ? styles.dark : state.isFocused ? styles.light : 'white',
|
5835
|
+
"&:active": {
|
5836
|
+
backgroundColor: state.isSelected ? styles.dark : state.isFocused ? styles.less_dark : baseStyles.backgroundColor
|
5837
|
+
}
|
5838
|
+
});
|
5879
5839
|
}
|
5880
|
-
}
|
5881
|
-
|
5882
|
-
|
5883
|
-
|
5884
|
-
|
5885
|
-
|
5886
|
-
|
5887
|
-
|
5888
|
-
|
5889
|
-
|
5890
|
-
|
5891
|
-
|
5892
|
-
|
5893
|
-
|
5894
|
-
|
5895
|
-
|
5896
|
-
|
5897
|
-
if (language) config.headers[LanguageHeaders] = "" + language;
|
5898
|
-
return config;
|
5899
|
-
}, function (error) {
|
5900
|
-
return Promise.reject(error);
|
5840
|
+
};
|
5841
|
+
|
5842
|
+
var _excluded = ["isDefault", "defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
|
5843
|
+
var CustomAsyncSelect = function CustomAsyncSelect(_ref) {
|
5844
|
+
var isDefault = _ref.isDefault,
|
5845
|
+
options = _ref.options,
|
5846
|
+
isDisabled = _ref.isDisabled,
|
5847
|
+
scrollBottom = _ref.scrollBottom,
|
5848
|
+
value = _ref.value,
|
5849
|
+
isMulti = _ref.isMulti,
|
5850
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
5851
|
+
var initialValues = Array.isArray(value) ? options.filter(function (i) {
|
5852
|
+
return value.includes(i.value);
|
5853
|
+
}) : isMulti ? options.filter(function (i) {
|
5854
|
+
return i.value == value;
|
5855
|
+
}) : options.find(function (i) {
|
5856
|
+
return i.value == value;
|
5901
5857
|
});
|
5902
|
-
|
5903
|
-
|
5904
|
-
return
|
5905
|
-
|
5906
|
-
|
5907
|
-
|
5908
|
-
|
5909
|
-
|
5910
|
-
|
5911
|
-
|
5912
|
-
|
5913
|
-
|
5914
|
-
|
5915
|
-
|
5916
|
-
|
5917
|
-
|
5918
|
-
|
5919
|
-
|
5920
|
-
|
5921
|
-
|
5922
|
-
|
5923
|
-
|
5924
|
-
|
5925
|
-
|
5926
|
-
|
5927
|
-
|
5928
|
-
|
5858
|
+
var _useTranslation = useTranslation(),
|
5859
|
+
t = _useTranslation.t;
|
5860
|
+
return React__default.createElement(Select, Object.assign({
|
5861
|
+
isDisabled: isDisabled,
|
5862
|
+
options: options,
|
5863
|
+
value: !isDefault ? initialValues : undefined,
|
5864
|
+
defaultValue: isDefault ? initialValues : undefined,
|
5865
|
+
menuPlacement: scrollBottom ? "top" : "auto",
|
5866
|
+
isMulti: isMulti,
|
5867
|
+
components: {
|
5868
|
+
IndicatorSeparator: function IndicatorSeparator() {
|
5869
|
+
return null;
|
5870
|
+
},
|
5871
|
+
DropdownIndicator: DropdownIndicator,
|
5872
|
+
Option: CustomOption
|
5873
|
+
},
|
5874
|
+
styles: customStyles,
|
5875
|
+
placeholder: t("select_placeholder")
|
5876
|
+
}, rest));
|
5877
|
+
};
|
5878
|
+
|
5879
|
+
var _excluded$1 = ["defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
|
5880
|
+
var CustomCreatable = function CustomCreatable(_ref) {
|
5881
|
+
var options = _ref.options,
|
5882
|
+
isDisabled = _ref.isDisabled,
|
5883
|
+
scrollBottom = _ref.scrollBottom,
|
5884
|
+
value = _ref.value,
|
5885
|
+
isMulti = _ref.isMulti,
|
5886
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
5887
|
+
var initialValues = Array.isArray(value) ? options.filter(function (i) {
|
5888
|
+
return value.includes(i.value);
|
5889
|
+
}) : isMulti ? options.filter(function (i) {
|
5890
|
+
return i.value == value;
|
5891
|
+
}) : options.find(function (i) {
|
5892
|
+
return i.value == value;
|
5929
5893
|
});
|
5930
|
-
|
5894
|
+
var _useTranslation = useTranslation(),
|
5895
|
+
t = _useTranslation.t;
|
5896
|
+
return React__default.createElement(CreatableSelect, Object.assign({
|
5897
|
+
isClearable: true,
|
5898
|
+
isDisabled: isDisabled,
|
5899
|
+
options: options,
|
5900
|
+
value: initialValues,
|
5901
|
+
menuPlacement: scrollBottom ? "top" : "auto",
|
5902
|
+
isMulti: isMulti,
|
5903
|
+
components: {
|
5904
|
+
IndicatorSeparator: function IndicatorSeparator() {
|
5905
|
+
return null;
|
5906
|
+
},
|
5907
|
+
DropdownIndicator: DropdownIndicator,
|
5908
|
+
Option: CustomOption
|
5909
|
+
},
|
5910
|
+
styles: customStyles,
|
5911
|
+
placeholder: t("select_placeholder")
|
5912
|
+
}, rest));
|
5913
|
+
};
|
5931
5914
|
|
5932
|
-
var
|
5933
|
-
|
5934
|
-
|
5935
|
-
|
5936
|
-
|
5937
|
-
|
5938
|
-
|
5915
|
+
var _excluded$2 = ["isDefault", "defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
|
5916
|
+
var CustomSelect = function CustomSelect(_ref) {
|
5917
|
+
var isDefault = _ref.isDefault,
|
5918
|
+
options = _ref.options,
|
5919
|
+
isDisabled = _ref.isDisabled,
|
5920
|
+
scrollBottom = _ref.scrollBottom,
|
5921
|
+
value = _ref.value,
|
5922
|
+
isMulti = _ref.isMulti,
|
5923
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
5924
|
+
var _useTranslation = useTranslation(),
|
5925
|
+
t = _useTranslation.t;
|
5926
|
+
var initialValues = Array.isArray(value) ? options.filter(function (i) {
|
5927
|
+
return value.includes(i.value);
|
5928
|
+
}) : isMulti ? options === null || options === void 0 ? void 0 : options.filter(function (i) {
|
5929
|
+
return i.value == value;
|
5930
|
+
}) : options === null || options === void 0 ? void 0 : options.find(function (i) {
|
5931
|
+
return i.value == value;
|
5932
|
+
});
|
5933
|
+
return React__default.createElement(Select, Object.assign({
|
5934
|
+
isDisabled: isDisabled,
|
5935
|
+
options: options,
|
5936
|
+
value: !isDefault ? initialValues != null ? initialValues : null : undefined,
|
5937
|
+
defaultValue: isDefault ? initialValues : undefined,
|
5938
|
+
menuPlacement: scrollBottom ? "top" : "auto",
|
5939
|
+
isMulti: isMulti,
|
5940
|
+
components: {
|
5941
|
+
IndicatorSeparator: function IndicatorSeparator() {
|
5942
|
+
return null;
|
5943
|
+
},
|
5944
|
+
DropdownIndicator: DropdownIndicator,
|
5945
|
+
Option: CustomOption
|
5946
|
+
},
|
5947
|
+
styles: customStyles,
|
5948
|
+
placeholder: t("select_placeholder")
|
5949
|
+
}, rest));
|
5950
|
+
};
|
5939
5951
|
|
5940
|
-
var
|
5941
|
-
|
5942
|
-
|
5943
|
-
|
5944
|
-
|
5945
|
-
|
5946
|
-
|
5947
|
-
|
5948
|
-
|
5949
|
-
|
5950
|
-
|
5951
|
-
|
5952
|
-
|
5952
|
+
var _excluded$3 = ["defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti", "valueById", "isTextbook"];
|
5953
|
+
var CustomSelectOption = function CustomSelectOption(_ref) {
|
5954
|
+
var defaultValue = _ref.defaultValue,
|
5955
|
+
options = _ref.options,
|
5956
|
+
isDisabled = _ref.isDisabled,
|
5957
|
+
scrollBottom = _ref.scrollBottom,
|
5958
|
+
value = _ref.value,
|
5959
|
+
isMulti = _ref.isMulti,
|
5960
|
+
valueById = _ref.valueById,
|
5961
|
+
isTextbook = _ref.isTextbook,
|
5962
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$3);
|
5963
|
+
var _useTranslation = useTranslation(),
|
5964
|
+
t = _useTranslation.t;
|
5965
|
+
var initialValues = defaultValue !== null && typeof defaultValue !== "undefined" ? (options === null || options === void 0 ? void 0 : options.find(function (option) {
|
5966
|
+
return option.value === defaultValue;
|
5967
|
+
})) || null : null;
|
5968
|
+
var optionValue = valueById !== null && typeof valueById !== "undefined" ? (options === null || options === void 0 ? void 0 : options.find(function (option) {
|
5969
|
+
return option.value == valueById;
|
5970
|
+
})) || {
|
5971
|
+
label: valueById,
|
5972
|
+
value: valueById
|
5973
|
+
} : null;
|
5974
|
+
return isTextbook ? React__default.createElement(CreatableSelect, Object.assign({
|
5975
|
+
isDisabled: isDisabled,
|
5976
|
+
options: options,
|
5977
|
+
value: optionValue || value,
|
5978
|
+
defaultValue: initialValues,
|
5979
|
+
menuPlacement: scrollBottom ? "top" : "auto",
|
5980
|
+
isMulti: isMulti,
|
5981
|
+
components: {
|
5982
|
+
IndicatorSeparator: function IndicatorSeparator() {
|
5983
|
+
return null;
|
5984
|
+
},
|
5985
|
+
DropdownIndicator: DropdownIndicator,
|
5986
|
+
Option: CustomOption
|
5987
|
+
},
|
5988
|
+
styles: customStyles,
|
5989
|
+
placeholder: t("select_placeholder")
|
5990
|
+
}, rest)) : React__default.createElement(Select, Object.assign({
|
5991
|
+
isDisabled: isDisabled,
|
5992
|
+
options: options,
|
5993
|
+
value: optionValue || value,
|
5994
|
+
defaultValue: initialValues,
|
5995
|
+
menuPlacement: scrollBottom ? "top" : "auto",
|
5996
|
+
isMulti: isMulti,
|
5997
|
+
components: {
|
5998
|
+
IndicatorSeparator: function IndicatorSeparator() {
|
5999
|
+
return null;
|
6000
|
+
},
|
6001
|
+
DropdownIndicator: DropdownIndicator,
|
6002
|
+
Option: CustomOption
|
6003
|
+
},
|
6004
|
+
styles: customStyles,
|
6005
|
+
placeholder: t("select_placeholder")
|
6006
|
+
}, rest));
|
6007
|
+
};
|
5953
6008
|
|
5954
|
-
var
|
5955
|
-
|
5956
|
-
|
5957
|
-
|
5958
|
-
|
6009
|
+
var SCORE_OPTIONS = Array.from({
|
6010
|
+
length: 10
|
6011
|
+
}, function (_, i) {
|
6012
|
+
return i + 1;
|
6013
|
+
});
|
6014
|
+
var QUESTION_OPTIONS = Array.from({
|
6015
|
+
length: 10
|
6016
|
+
}, function (_, i) {
|
6017
|
+
return i + 1;
|
6018
|
+
});
|
6019
|
+
var ANSWER_OPTIONS = Array.from({
|
6020
|
+
length: 9
|
6021
|
+
}, function (_, i) {
|
6022
|
+
return i + 2;
|
6023
|
+
});
|
6024
|
+
var DEFAULT_SCORE = 2;
|
6025
|
+
|
6026
|
+
var AnswerCountSelector = function AnswerCountSelector(_ref) {
|
6027
|
+
var id = _ref.id,
|
6028
|
+
value = _ref.value,
|
6029
|
+
onChange = _ref.onChange,
|
6030
|
+
isDisabled = _ref.isDisabled;
|
5959
6031
|
var _useTranslation = useTranslation(),
|
5960
6032
|
t = _useTranslation.t;
|
5961
|
-
var
|
5962
|
-
var dataProps = isTeacher ? dataExamSession.map(function (i) {
|
5963
|
-
return {
|
5964
|
-
studentId: i === null || i === void 0 ? void 0 : i.studentId,
|
5965
|
-
examSessionId: i === null || i === void 0 ? void 0 : i.examSessionId
|
5966
|
-
};
|
5967
|
-
}) : dataExamSession.map(function (i) {
|
6033
|
+
var answerOptions = ANSWER_OPTIONS.map(function (i) {
|
5968
6034
|
return {
|
5969
|
-
|
6035
|
+
label: t("number_question", {
|
6036
|
+
number: i
|
6037
|
+
}),
|
6038
|
+
value: i
|
5970
6039
|
};
|
5971
6040
|
});
|
5972
|
-
|
5973
|
-
|
5974
|
-
|
5975
|
-
|
5976
|
-
|
5977
|
-
|
5978
|
-
setCompleted = _useState2[1];
|
5979
|
-
var _useState3 = useState([]),
|
5980
|
-
inprogress = _useState3[0],
|
5981
|
-
setInProgress = _useState3[1];
|
5982
|
-
var _useState4 = useState(PrintState.Idling),
|
5983
|
-
state = _useState4[0],
|
5984
|
-
setState = _useState4[1];
|
5985
|
-
var _useState5 = useState([]),
|
5986
|
-
errorLinks = _useState5[0],
|
5987
|
-
setErrorLinks = _useState5[1];
|
5988
|
-
var _useState6 = useState([]),
|
5989
|
-
status = _useState6[0],
|
5990
|
-
setStatus = _useState6[1];
|
5991
|
-
var theme = useTheme();
|
5992
|
-
var handleChangeStatus = function handleChangeStatus(event) {
|
5993
|
-
if (event.target.checked) {
|
5994
|
-
setStatus(function (prev) {
|
5995
|
-
var _event$target;
|
5996
|
-
return [].concat(prev, [(_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.value]);
|
5997
|
-
});
|
5998
|
-
} else setStatus(function (prev) {
|
5999
|
-
return prev === null || prev === void 0 ? void 0 : prev.filter(function (i) {
|
6000
|
-
var _event$target2;
|
6001
|
-
return i !== ((_event$target2 = event.target) === null || _event$target2 === void 0 ? void 0 : _event$target2.value);
|
6002
|
-
});
|
6003
|
-
});
|
6004
|
-
};
|
6005
|
-
var handleProgressPrint = function handleProgressPrint() {
|
6006
|
-
setData(dataProps);
|
6007
|
-
setCompleted([]);
|
6008
|
-
setInProgress([]);
|
6009
|
-
setErrorLinks([]);
|
6010
|
-
setState(PrintState.Printing);
|
6011
|
-
};
|
6012
|
-
console.log({
|
6013
|
-
status: status
|
6041
|
+
return React__default.createElement(CustomSelect, {
|
6042
|
+
inputId: id,
|
6043
|
+
value: value,
|
6044
|
+
options: answerOptions,
|
6045
|
+
onChange: onChange,
|
6046
|
+
isDisabled: isDisabled
|
6014
6047
|
});
|
6015
|
-
var print = function print(_ref2) {
|
6016
|
-
var examSessionId = _ref2.examSessionId,
|
6017
|
-
studentId = _ref2.studentId,
|
6018
|
-
code = _ref2.code;
|
6019
|
-
var width = 200;
|
6020
|
-
var height = 200;
|
6021
|
-
var left = window.screenX + window.outerWidth / 2 - width / 2;
|
6022
|
-
var top = window.screenY + window.outerHeight / 2 - height / 2;
|
6023
|
-
var url = isTeacher ? window.location.origin + "/teacher/exam-results/" + examSessionId + "/students/" + studentId + "/print?status=" + status.join(",") : window.location.origin + "/student/exam-results/" + code + "/print";
|
6024
|
-
var windowName = isTeacher ? "popup-" + examSessionId + "-" + studentId : "popup-" + code;
|
6025
|
-
var windowSpecs = "left=" + left + ",top=" + top + ",width=" + width + ",height=" + height + ",location=yes,resizable=yes,scrollbars=yes,status=yes";
|
6026
|
-
var childWindow = window.open(url, windowName, windowSpecs);
|
6027
|
-
if (childWindow == null) {
|
6028
|
-
setErrorLinks(function (prev) {
|
6029
|
-
return [].concat(prev, [{
|
6030
|
-
code: code,
|
6031
|
-
examSessionId: "" + examSessionId,
|
6032
|
-
studentId: "" + studentId,
|
6033
|
-
message: isTeacher ? "/teacher/exam-results/" + examSessionId + "/students/" + studentId + "/print" : "/student/exam-results/" + code + "/print"
|
6034
|
-
}]);
|
6035
|
-
});
|
6036
|
-
if (!isTeacher) {
|
6037
|
-
setData(function (es) {
|
6038
|
-
return [].concat(es.filter(function (i) {
|
6039
|
-
return i.code !== code;
|
6040
|
-
}));
|
6041
|
-
});
|
6042
|
-
} else {
|
6043
|
-
setData(function (es) {
|
6044
|
-
return [].concat(es.filter(function (i) {
|
6045
|
-
return i.examSessionId !== examSessionId || i.studentId !== studentId;
|
6046
|
-
}));
|
6047
|
-
});
|
6048
|
-
}
|
6049
|
-
return;
|
6050
|
-
}
|
6051
|
-
if (!isTeacher) {
|
6052
|
-
setInProgress(function (es) {
|
6053
|
-
return [].concat(es.filter(function (i) {
|
6054
|
-
return i.code !== code;
|
6055
|
-
}), [{
|
6056
|
-
code: code
|
6057
|
-
}]);
|
6058
|
-
});
|
6059
|
-
setData(function (es) {
|
6060
|
-
return [].concat(es.filter(function (i) {
|
6061
|
-
return i.code !== code;
|
6062
|
-
}));
|
6063
|
-
});
|
6064
|
-
} else {
|
6065
|
-
setInProgress(function (es) {
|
6066
|
-
return [].concat(es.filter(function (i) {
|
6067
|
-
return i.examSessionId !== examSessionId || i.studentId !== studentId;
|
6068
|
-
}), [{
|
6069
|
-
examSessionId: examSessionId,
|
6070
|
-
studentId: studentId
|
6071
|
-
}]);
|
6072
|
-
});
|
6073
|
-
setData(function (es) {
|
6074
|
-
return [].concat(es.filter(function (i) {
|
6075
|
-
return i.examSessionId !== examSessionId || i.studentId !== studentId;
|
6076
|
-
}));
|
6077
|
-
});
|
6078
|
-
}
|
6079
|
-
window.addEventListener("message", function (event) {
|
6080
|
-
var isCheck = isTeacher ? event.data.examSessionId !== "" + examSessionId || event.data.studentId !== "" + studentId : event.data.code !== "" + code;
|
6081
|
-
if (event.origin !== window.location.origin || isCheck) {
|
6082
|
-
return;
|
6083
|
-
}
|
6084
|
-
if (event.data.succeed) {
|
6085
|
-
if (!isTeacher) {
|
6086
|
-
setCompleted(function (es) {
|
6087
|
-
return [].concat(es.filter(function (i) {
|
6088
|
-
return i.code !== code;
|
6089
|
-
}), [{
|
6090
|
-
code: code
|
6091
|
-
}]);
|
6092
|
-
});
|
6093
|
-
setInProgress(function (es) {
|
6094
|
-
return [].concat(es.filter(function (i) {
|
6095
|
-
return i.code !== code;
|
6096
|
-
}));
|
6097
|
-
});
|
6098
|
-
} else {
|
6099
|
-
setCompleted(function (es) {
|
6100
|
-
return [].concat(es.filter(function (i) {
|
6101
|
-
return i.examSessionId !== examSessionId || i.studentId !== studentId;
|
6102
|
-
}), [{
|
6103
|
-
examSessionId: examSessionId,
|
6104
|
-
studentId: studentId
|
6105
|
-
}]);
|
6106
|
-
});
|
6107
|
-
setInProgress(function (es) {
|
6108
|
-
return [].concat(es.filter(function (i) {
|
6109
|
-
return i.examSessionId !== examSessionId || i.studentId !== studentId;
|
6110
|
-
}));
|
6111
|
-
});
|
6112
|
-
}
|
6113
|
-
} else {
|
6114
|
-
setErrorLinks(function (prev) {
|
6115
|
-
var _event$data, _event$data2;
|
6116
|
-
return [].concat(prev, [{
|
6117
|
-
code: (_event$data = event.data) === null || _event$data === void 0 ? void 0 : _event$data.code,
|
6118
|
-
examSessionId: (_event$data2 = event.data) === null || _event$data2 === void 0 ? void 0 : _event$data2.examSessionId,
|
6119
|
-
studentId: "" + studentId,
|
6120
|
-
message: isTeacher ? "/teacher/exam-results/" + event.data.examSessionId + "/students/" + event.data.studentId + "/print" : "/student/exam-results/" + event.data.code + "/print"
|
6121
|
-
}]);
|
6122
|
-
});
|
6123
|
-
}
|
6124
|
-
childWindow === null || childWindow === void 0 ? void 0 : childWindow.close();
|
6125
|
-
});
|
6126
|
-
};
|
6127
|
-
useEffect(function () {
|
6128
|
-
if (inprogress.length < TOTAL && data.length > 0 && state === PrintState.Printing) {
|
6129
|
-
var item = data[0];
|
6130
|
-
print({
|
6131
|
-
examSessionId: item === null || item === void 0 ? void 0 : item.examSessionId,
|
6132
|
-
studentId: item === null || item === void 0 ? void 0 : item.studentId,
|
6133
|
-
code: item === null || item === void 0 ? void 0 : item.code
|
6134
|
-
});
|
6135
|
-
}
|
6136
|
-
}, [inprogress.length, completed.length, data.length, state, data]);
|
6137
|
-
return React__default.createElement(Container, null, state === PrintState.Idling ? React__default.createElement(Typography, null, t("total_number_of_selected_results") + ": ", " ", React__default.createElement("span", {
|
6138
|
-
className: "fw-bold"
|
6139
|
-
}, t("number_results", {
|
6140
|
-
number: ("" + data.length).padStart(2, "0")
|
6141
|
-
}))) : React__default.createElement(Fragment$1, null, React__default.createElement(Typography, null, t("completed") + ": ", React__default.createElement("span", {
|
6142
|
-
className: "fw-bold"
|
6143
|
-
}, t("number_results", {
|
6144
|
-
number: ("" + completed.length).padStart(2, "0")
|
6145
|
-
}))), React__default.createElement(Typography, null, t("in_progress") + ": ", React__default.createElement("span", {
|
6146
|
-
className: "fw-bold"
|
6147
|
-
}, t("number_results", {
|
6148
|
-
number: ("" + inprogress.length).padStart(2, "0")
|
6149
|
-
}))), React__default.createElement(Typography, null, t("remaining") + ": ", React__default.createElement("span", {
|
6150
|
-
className: "fw-bold"
|
6151
|
-
}, t("number_results", {
|
6152
|
-
number: ("" + data.length).padStart(2, "0")
|
6153
|
-
})))), !!errorLinks.length && React__default.createElement(Stack, {
|
6154
|
-
className: "mt-2"
|
6155
|
-
}, React__default.createElement(Typography, {
|
6156
|
-
fontWeight: 700
|
6157
|
-
}, t("download_failed"), ":"), Array.from(new Set(errorLinks)).map(function (i) {
|
6158
|
-
var _info$createdBy;
|
6159
|
-
var info = isTeacher ? dataExamSession.find(function (exam) {
|
6160
|
-
return "" + (exam === null || exam === void 0 ? void 0 : exam.examSessionId) === "" + (i === null || i === void 0 ? void 0 : i.examSessionId) && "" + (exam === null || exam === void 0 ? void 0 : exam.studentId) === "" + (i === null || i === void 0 ? void 0 : i.studentId);
|
6161
|
-
}) : dataExamSession.find(function (exam) {
|
6162
|
-
return (exam === null || exam === void 0 ? void 0 : exam.code) === (i === null || i === void 0 ? void 0 : i.code);
|
6163
|
-
});
|
6164
|
-
return React__default.createElement(Stack, {
|
6165
|
-
borderBottom: 1,
|
6166
|
-
borderColor: theme.palette.grey[500]
|
6167
|
-
}, React__default.createElement("a", {
|
6168
|
-
href: i.message,
|
6169
|
-
target: "_blank",
|
6170
|
-
rel: "noopener noreferrer"
|
6171
|
-
}, (info === null || info === void 0 ? void 0 : info.studentName) || (info === null || info === void 0 ? void 0 : (_info$createdBy = info.createdBy) === null || _info$createdBy === void 0 ? void 0 : _info$createdBy.fullName)), (info === null || info === void 0 ? void 0 : info.title) && React__default.createElement(Typography, null, t("exam") + ": " + (info === null || info === void 0 ? void 0 : info.title)), (info === null || info === void 0 ? void 0 : info.startTime) && React__default.createElement(Typography, null, t("start_time") + ": " + utcToLocalTime(info === null || info === void 0 ? void 0 : info.startTime, t("date_time_format"))));
|
6172
|
-
})), React__default.createElement(Stack, {
|
6173
|
-
direction: "column",
|
6174
|
-
className: "mt-3"
|
6175
|
-
}, React__default.createElement(Stack, null, React__default.createElement(Typography, {
|
6176
|
-
className: "fw-bold"
|
6177
|
-
}, React__default.createElement("span", {
|
6178
|
-
className: "text-danger me-1"
|
6179
|
-
}, "*"), t("your_browser_must"), ":"), React__default.createElement(List, {
|
6180
|
-
className: "ps-3 pt-0"
|
6181
|
-
}, React__default.createElement(ListItem, {
|
6182
|
-
disablePadding: true
|
6183
|
-
}, t("allowed_to_send_pop_ups_and_use_redirects")), React__default.createElement(ListItem, {
|
6184
|
-
disablePadding: true
|
6185
|
-
}, t("disable_ask_where_to_save_each_file_before_downloading")))), isTeacher && React__default.createElement(Stack, null, React__default.createElement(Typography, {
|
6186
|
-
fontWeight: 700
|
6187
|
-
}, t("choose_to_print"), ":"), React__default.createElement(FormGroup, {
|
6188
|
-
sx: {
|
6189
|
-
display: "flex",
|
6190
|
-
flexDirection: "row",
|
6191
|
-
gap: 1,
|
6192
|
-
flexWrap: "wrap"
|
6193
|
-
}
|
6194
|
-
}, TabList.map(function (_ref3) {
|
6195
|
-
var label = _ref3.label,
|
6196
|
-
value = _ref3.value;
|
6197
|
-
return React__default.createElement(FormControlLabel, {
|
6198
|
-
control: React__default.createElement(Checkbox, {
|
6199
|
-
onChange: handleChangeStatus,
|
6200
|
-
value: value,
|
6201
|
-
checked: status.some(function (i) {
|
6202
|
-
return i === value.toString();
|
6203
|
-
})
|
6204
|
-
}),
|
6205
|
-
label: t(label)
|
6206
|
-
});
|
6207
|
-
}))), React__default.createElement(Button, {
|
6208
|
-
className: "mt-3",
|
6209
|
-
variant: "contained",
|
6210
|
-
onClick: handleProgressPrint
|
6211
|
-
}, t("print_pdf"))));
|
6212
6048
|
};
|
6213
6049
|
|
6214
|
-
var
|
6215
|
-
|
6216
|
-
|
6217
|
-
|
6218
|
-
|
6219
|
-
|
6220
|
-
|
6221
|
-
|
6222
|
-
|
6223
|
-
|
6224
|
-
|
6225
|
-
|
6226
|
-
|
6227
|
-
|
6228
|
-
|
6229
|
-
|
6050
|
+
var _excluded$4 = ["id", "value", "onChange", "isDisabled", "options", "isMulti", "placeholder"];
|
6051
|
+
var ArticleCategorySelector = function ArticleCategorySelector(_ref) {
|
6052
|
+
var id = _ref.id,
|
6053
|
+
value = _ref.value,
|
6054
|
+
onChange = _ref.onChange,
|
6055
|
+
isDisabled = _ref.isDisabled,
|
6056
|
+
options = _ref.options,
|
6057
|
+
isMulti = _ref.isMulti,
|
6058
|
+
placeholder = _ref.placeholder,
|
6059
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$4);
|
6060
|
+
var _useTranslation = useTranslation(),
|
6061
|
+
t = _useTranslation.t;
|
6062
|
+
return React__default.createElement(CustomSelect, Object.assign({
|
6063
|
+
isMulti: isMulti,
|
6064
|
+
inputId: id,
|
6065
|
+
value: value,
|
6066
|
+
options: options,
|
6067
|
+
onChange: onChange,
|
6068
|
+
isDisabled: isDisabled,
|
6069
|
+
placeholder: placeholder || t("select_category")
|
6070
|
+
}, rest));
|
6071
|
+
};
|
6072
|
+
|
6073
|
+
// A type of promise-like that resolves synchronously and supports only one observer
|
6074
|
+
|
6075
|
+
const _iteratorSymbol = /*#__PURE__*/ typeof Symbol !== "undefined" ? (Symbol.iterator || (Symbol.iterator = Symbol("Symbol.iterator"))) : "@@iterator";
|
6076
|
+
|
6077
|
+
const _asyncIteratorSymbol = /*#__PURE__*/ typeof Symbol !== "undefined" ? (Symbol.asyncIterator || (Symbol.asyncIterator = Symbol("Symbol.asyncIterator"))) : "@@asyncIterator";
|
6078
|
+
|
6079
|
+
// Asynchronously call a function and send errors to recovery continuation
|
6080
|
+
function _catch(body, recover) {
|
6081
|
+
try {
|
6082
|
+
var result = body();
|
6083
|
+
} catch(e) {
|
6084
|
+
return recover(e);
|
6085
|
+
}
|
6086
|
+
if (result && result.then) {
|
6087
|
+
return result.then(void 0, recover);
|
6088
|
+
}
|
6089
|
+
return result;
|
6090
|
+
}
|
6091
|
+
|
6092
|
+
// Asynchronously await a promise and pass the result to a finally continuation
|
6093
|
+
function _finallyRethrows(body, finalizer) {
|
6094
|
+
try {
|
6095
|
+
var result = body();
|
6096
|
+
} catch (e) {
|
6097
|
+
return finalizer(true, e);
|
6098
|
+
}
|
6099
|
+
if (result && result.then) {
|
6100
|
+
return result.then(finalizer.bind(null, false), finalizer.bind(null, true));
|
6101
|
+
}
|
6102
|
+
return finalizer(false, result);
|
6103
|
+
}
|
6104
|
+
|
6105
|
+
// Asynchronously await a promise and invoke a finally continuation that always overrides the result
|
6106
|
+
function _finally(body, finalizer) {
|
6107
|
+
try {
|
6108
|
+
var result = body();
|
6109
|
+
} catch (e) {
|
6110
|
+
return finalizer();
|
6111
|
+
}
|
6112
|
+
if (result && result.then) {
|
6113
|
+
return result.then(finalizer, finalizer);
|
6114
|
+
}
|
6115
|
+
return finalizer();
|
6116
|
+
}
|
6117
|
+
|
6118
|
+
var PreparedType;
|
6119
|
+
(function (PreparedType) {
|
6120
|
+
PreparedType[PreparedType["csat_past_questions"] = 1] = "csat_past_questions";
|
6121
|
+
PreparedType[PreparedType["official_mock_exam"] = 2] = "official_mock_exam";
|
6122
|
+
PreparedType[PreparedType["private_mock_exam"] = 3] = "private_mock_exam";
|
6123
|
+
})(PreparedType || (PreparedType = {}));
|
6124
|
+
|
6125
|
+
var ExamEvent;
|
6126
|
+
(function (ExamEvent) {
|
6127
|
+
ExamEvent["StartExam"] = "start-exam";
|
6128
|
+
ExamEvent["TerminateExam"] = "terminate-exam";
|
6129
|
+
ExamEvent["AddExtraDuration"] = "add-extra-duration-exam";
|
6130
|
+
ExamEvent["TeacherKickOutStudent"] = "teacher-kick-out-student";
|
6131
|
+
})(ExamEvent || (ExamEvent = {}));
|
6132
|
+
|
6133
|
+
var ExamStatus;
|
6134
|
+
(function (ExamStatus) {
|
6135
|
+
ExamStatus[ExamStatus["Default"] = 0] = "Default";
|
6136
|
+
ExamStatus[ExamStatus["Pending"] = 1] = "Pending";
|
6137
|
+
ExamStatus[ExamStatus["InProgress"] = 2] = "InProgress";
|
6138
|
+
ExamStatus[ExamStatus["Completed"] = 3] = "Completed";
|
6139
|
+
})(ExamStatus || (ExamStatus = {}));
|
6140
|
+
var QuestionAnswerType;
|
6141
|
+
(function (QuestionAnswerType) {
|
6142
|
+
QuestionAnswerType[QuestionAnswerType["ChoiceOption"] = 0] = "ChoiceOption";
|
6143
|
+
QuestionAnswerType[QuestionAnswerType["Textual"] = 1] = "Textual";
|
6144
|
+
})(QuestionAnswerType || (QuestionAnswerType = {}));
|
6145
|
+
|
6146
|
+
var OrderType;
|
6147
|
+
(function (OrderType) {
|
6148
|
+
OrderType["ASC"] = "ASC";
|
6149
|
+
OrderType["DESC"] = "DESC";
|
6150
|
+
})(OrderType || (OrderType = {}));
|
6151
|
+
|
6152
|
+
var RecentUserAction;
|
6153
|
+
(function (RecentUserAction) {
|
6154
|
+
RecentUserAction["ViewedUser"] = "ViewedUser";
|
6155
|
+
RecentUserAction["ViewedQNA"] = "ViewedQNA";
|
6156
|
+
RecentUserAction["ViewedExamResult"] = "ViewedExamResult";
|
6157
|
+
RecentUserAction["PrintedExamResult"] = "PrintedExamResult";
|
6158
|
+
RecentUserAction["ViewedAttendance"] = "ViewedAttendance";
|
6159
|
+
})(RecentUserAction || (RecentUserAction = {}));
|
6160
|
+
|
6161
|
+
var UserSortColumn;
|
6162
|
+
(function (UserSortColumn) {
|
6163
|
+
UserSortColumn["CreatedAt"] = "CreatedAt";
|
6164
|
+
UserSortColumn["FullName"] = "FullName";
|
6165
|
+
UserSortColumn["PhoneNumber"] = "PhoneNumber";
|
6166
|
+
UserSortColumn["Email"] = "Email";
|
6167
|
+
UserSortColumn["SchoolName"] = "SchoolName";
|
6168
|
+
UserSortColumn["Major"] = "Major";
|
6169
|
+
UserSortColumn["ParentName"] = "ParentName";
|
6170
|
+
UserSortColumn["ParentPhoneNumber"] = "ParentPhoneNumber";
|
6171
|
+
UserSortColumn["Grade"] = "Grade";
|
6172
|
+
})(UserSortColumn || (UserSortColumn = {}));
|
6173
|
+
|
6174
|
+
var useAutoAcademyDomain = function useAutoAcademyDomain(_, history, superUrls, homeUrl, homeAcademyUrl, isAuthPage) {
|
6175
|
+
if (isAuthPage === void 0) {
|
6176
|
+
isAuthPage = true;
|
6177
|
+
}
|
6178
|
+
var user = useSelector(function (state) {
|
6179
|
+
var _state$common;
|
6180
|
+
return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.user;
|
6181
|
+
});
|
6182
|
+
var _ref = user || {},
|
6183
|
+
email = _ref.email,
|
6184
|
+
academyDomain = _ref.academyDomain,
|
6185
|
+
isLearningSpace = _ref.isLearningSpace;
|
6186
|
+
var pathname = window.location.pathname;
|
6187
|
+
var changeAcademySearchParams = function changeAcademySearchParams() {
|
6188
|
+
var isLoginPage = LOGIN_URL === pathname;
|
6189
|
+
var search = window.location.search;
|
6190
|
+
var searchParams = new URLSearchParams(search);
|
6191
|
+
var paramAcademyDomain = searchParams.get("domain");
|
6192
|
+
var domain = getAcademyDomain();
|
6193
|
+
if (!!email !== isAuthPage) return;
|
6194
|
+
var isSuperUrl = checkSuperUrl(superUrls, pathname);
|
6195
|
+
if (!academyDomain && !isLearningSpace) {
|
6196
|
+
if (!isSuperUrl) {
|
6197
|
+
if (isLoginPage) searchParams["delete"]("domain");else if (!paramAcademyDomain && domain) searchParams.set("domain", domain);
|
6198
|
+
pushTo(history, {
|
6199
|
+
pathname: homeUrl,
|
6200
|
+
search: searchParams.toString()
|
6201
|
+
});
|
6202
|
+
return;
|
6230
6203
|
}
|
6231
|
-
|
6232
|
-
|
6233
|
-
|
6234
|
-
|
6235
|
-
|
6236
|
-
|
6204
|
+
if (paramAcademyDomain) {
|
6205
|
+
searchParams["delete"]("domain");
|
6206
|
+
pushTo(history, _extends({}, window.location, {
|
6207
|
+
search: searchParams.toString()
|
6208
|
+
}), true);
|
6209
|
+
return;
|
6237
6210
|
}
|
6238
|
-
}
|
6239
|
-
|
6211
|
+
} else {
|
6212
|
+
if (isSuperUrl) {
|
6213
|
+
searchParams["delete"]("domain");
|
6214
|
+
pushTo(history, {
|
6215
|
+
pathname: homeAcademyUrl,
|
6216
|
+
search: searchParams.toString()
|
6217
|
+
});
|
6218
|
+
return;
|
6219
|
+
}
|
6220
|
+
if (!paramAcademyDomain || academyDomain.trim().toLocaleLowerCase() !== (paramAcademyDomain === null || paramAcademyDomain === void 0 ? void 0 : paramAcademyDomain.trim().toLocaleLowerCase())) {
|
6221
|
+
if (isLoginPage || isLearningSpace) searchParams["delete"]("domain");else searchParams.set("domain", academyDomain);
|
6222
|
+
pushTo(history, _extends({}, window.location, {
|
6223
|
+
search: searchParams.toString()
|
6224
|
+
}), true);
|
6225
|
+
return;
|
6226
|
+
}
|
6227
|
+
}
|
6228
|
+
};
|
6229
|
+
useEffect(function () {
|
6230
|
+
changeAcademySearchParams();
|
6231
|
+
}, [pathname, window.location.search, isAuthPage, email, academyDomain]);
|
6240
6232
|
};
|
6241
6233
|
|
6242
|
-
var
|
6243
|
-
|
6244
|
-
|
6245
|
-
backText = _ref.backText,
|
6246
|
-
saveText = _ref.saveText,
|
6247
|
-
altSaveText = _ref.altSaveText,
|
6248
|
-
saveDisabled = _ref.saveDisabled,
|
6249
|
-
saveIcon = _ref.saveIcon,
|
6250
|
-
_ref$hideSave = _ref.hideSave,
|
6251
|
-
hideSave = _ref$hideSave === void 0 ? false : _ref$hideSave,
|
6252
|
-
onBack = _ref.onBack,
|
6253
|
-
onSave = _ref.onSave,
|
6254
|
-
onAltSave = _ref.onAltSave,
|
6255
|
-
isReadonly = _ref.isReadonly;
|
6256
|
-
return React__default.createElement(Stack, {
|
6257
|
-
direction: "row",
|
6258
|
-
spacing: 1,
|
6259
|
-
className: "" + className
|
6260
|
-
}, React__default.createElement(Button, {
|
6261
|
-
variant: "contained",
|
6262
|
-
className: "bg-secondary",
|
6263
|
-
startIcon: React__default.createElement(IoMdArrowBack, {
|
6264
|
-
size: 16
|
6265
|
-
}),
|
6266
|
-
onClick: onBack
|
6267
|
-
}, backText), !hideSave && React__default.createElement(Button, {
|
6268
|
-
variant: "contained",
|
6269
|
-
color: "success",
|
6270
|
-
startIcon: saveIcon != null ? saveIcon : React__default.createElement(FaSave, {
|
6271
|
-
size: 16
|
6272
|
-
}),
|
6273
|
-
onClick: onSave,
|
6274
|
-
disabled: saveDisabled || isReadonly
|
6275
|
-
}, saveText), !!altSaveText && onAltSave && React__default.createElement(Button, {
|
6276
|
-
variant: "contained",
|
6277
|
-
color: "primary",
|
6278
|
-
startIcon: React__default.createElement(FaSave, {
|
6279
|
-
size: 16
|
6280
|
-
}),
|
6281
|
-
onClick: onAltSave,
|
6282
|
-
disabled: saveDisabled
|
6283
|
-
}, altSaveText));
|
6234
|
+
var EXAM_SESSION_URL = BASE_URL + "/api/examSession";
|
6235
|
+
var getCheckStatusExam = function getCheckStatusExam(examCode) {
|
6236
|
+
return api.get(EXAM_SESSION_URL + "/" + examCode + "/status");
|
6284
6237
|
};
|
6285
6238
|
|
6286
|
-
var
|
6287
|
-
var
|
6288
|
-
var
|
6289
|
-
|
6290
|
-
|
6291
|
-
|
6239
|
+
var ONE_SECOND_IN_MILLISECONDS = 1000;
|
6240
|
+
var useCountDownTimer = function useCountDownTimer(props) {
|
6241
|
+
var startTime = props.startTime,
|
6242
|
+
status = props.status,
|
6243
|
+
code = props.code,
|
6244
|
+
duration = props.duration,
|
6245
|
+
onFinish = props.onFinish;
|
6246
|
+
var dispatch = useDispatch();
|
6247
|
+
var _useState = useState(),
|
6248
|
+
remainTime = _useState[0],
|
6249
|
+
setRemainTime = _useState[1];
|
6250
|
+
var checkStatusRef = useRef(null);
|
6251
|
+
var requestRef = useRef(null);
|
6252
|
+
var checkLiveExamStatus = useCallback(function () {
|
6253
|
+
try {
|
6254
|
+
!!checkStatusRef.current && clearTimeout(checkStatusRef.current);
|
6255
|
+
if (!code || status === ExamStatus.Completed) {
|
6256
|
+
return Promise.resolve();
|
6257
|
+
}
|
6258
|
+
var isOk = false;
|
6259
|
+
var _temp = _finallyRethrows(function () {
|
6260
|
+
return _catch(function () {
|
6261
|
+
dispatch(setLoading(true));
|
6262
|
+
return Promise.resolve(getCheckStatusExam(code)).then(function (res) {
|
6263
|
+
if (res.data.data.status === ExamStatus.Completed) {
|
6264
|
+
isOk = true;
|
6265
|
+
clearTimeout(checkStatusRef.current);
|
6266
|
+
dispatch(setLoading(false));
|
6267
|
+
onFinish();
|
6268
|
+
} else {
|
6269
|
+
checkStatusRef.current = setTimeout(checkLiveExamStatus, ONE_SECOND_IN_MILLISECONDS);
|
6270
|
+
}
|
6271
|
+
});
|
6272
|
+
}, function (error) {
|
6273
|
+
console.log({
|
6274
|
+
error: error
|
6275
|
+
});
|
6276
|
+
});
|
6277
|
+
}, function (_wasThrown, _result) {
|
6278
|
+
if (!isOk) checkStatusRef.current = setTimeout(checkLiveExamStatus, ONE_SECOND_IN_MILLISECONDS);
|
6279
|
+
if (_wasThrown) throw _result;
|
6280
|
+
return _result;
|
6281
|
+
});
|
6282
|
+
return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
|
6283
|
+
} catch (e) {
|
6284
|
+
return Promise.reject(e);
|
6285
|
+
}
|
6286
|
+
}, [code, status, onFinish]);
|
6292
6287
|
useEffect(function () {
|
6293
|
-
|
6294
|
-
|
6295
|
-
|
6296
|
-
|
6297
|
-
|
6298
|
-
|
6299
|
-
|
6300
|
-
|
6301
|
-
|
6302
|
-
|
6303
|
-
|
6304
|
-
|
6305
|
-
|
6306
|
-
|
6307
|
-
|
6288
|
+
if (status !== ExamStatus.InProgress) return;
|
6289
|
+
var animate = function animate() {
|
6290
|
+
if (!startTime || !duration) return;
|
6291
|
+
if (typeof remainTime === "number" && remainTime <= 0) {
|
6292
|
+
return;
|
6293
|
+
}
|
6294
|
+
var remain = getRemainTime(startTime, duration);
|
6295
|
+
if (typeof remain !== "number") {
|
6296
|
+
setRemainTime(undefined);
|
6297
|
+
return;
|
6298
|
+
}
|
6299
|
+
setRemainTime(remain || 0);
|
6300
|
+
requestRef.current = requestAnimationFrame(animate);
|
6301
|
+
};
|
6302
|
+
requestRef.current = requestAnimationFrame(animate);
|
6303
|
+
return function () {
|
6304
|
+
!!requestRef.current && cancelAnimationFrame(requestRef.current);
|
6305
|
+
setRemainTime(undefined);
|
6306
|
+
};
|
6307
|
+
}, [startTime, duration]);
|
6308
|
+
useEffect(function () {
|
6309
|
+
if (typeof remainTime === "number" && remainTime <= 0) checkLiveExamStatus();
|
6310
|
+
}, [remainTime, checkLiveExamStatus]);
|
6311
|
+
return remainTime;
|
6308
6312
|
};
|
6309
6313
|
|
6310
|
-
var
|
6311
|
-
var
|
6312
|
-
|
6313
|
-
|
6314
|
-
|
6315
|
-
|
6316
|
-
|
6317
|
-
|
6318
|
-
|
6319
|
-
|
6320
|
-
|
6321
|
-
|
6322
|
-
|
6323
|
-
|
6324
|
-
|
6325
|
-
|
6326
|
-
|
6327
|
-
|
6328
|
-
|
6329
|
-
|
6330
|
-
PaperProps: {
|
6331
|
-
sx: {
|
6332
|
-
overflowY: "unset",
|
6333
|
-
minWidth: minWidth
|
6334
|
-
}
|
6314
|
+
var useGoogleSignOut = function useGoogleSignOut(props) {
|
6315
|
+
var dispatch = useDispatch();
|
6316
|
+
var onLogoutSuccess = props.onLogoutSuccess,
|
6317
|
+
onFailure = props.onFailure;
|
6318
|
+
var handleLogoutSuccess = function handleLogoutSuccess() {
|
6319
|
+
onLogoutSuccess === null || onLogoutSuccess === void 0 ? void 0 : onLogoutSuccess();
|
6320
|
+
};
|
6321
|
+
var handleLogoutFailure = function handleLogoutFailure() {
|
6322
|
+
onFailure === null || onFailure === void 0 ? void 0 : onFailure();
|
6323
|
+
};
|
6324
|
+
var _useGoogleLogout = useGoogleLogout({
|
6325
|
+
clientId: GOOGLE_CLIENT_ID,
|
6326
|
+
onLogoutSuccess: handleLogoutSuccess,
|
6327
|
+
onFailure: handleLogoutFailure
|
6328
|
+
}),
|
6329
|
+
signOut = _useGoogleLogout.signOut,
|
6330
|
+
loaded = _useGoogleLogout.loaded;
|
6331
|
+
var handleSignOut = function handleSignOut(isRemoveDomainStorage) {
|
6332
|
+
if (isRemoveDomainStorage === void 0) {
|
6333
|
+
isRemoveDomainStorage = false;
|
6335
6334
|
}
|
6336
|
-
|
6337
|
-
|
6338
|
-
|
6339
|
-
|
6335
|
+
localStorage.removeItem("USER_INFORMATION");
|
6336
|
+
localStorage.removeItem(ACCESS_TOKEN);
|
6337
|
+
if (isRemoveDomainStorage) {
|
6338
|
+
localStorage.removeItem(ACADEMY_DOMAIN);
|
6339
|
+
localStorage.removeItem(LEARNING_SPACE);
|
6340
6340
|
}
|
6341
|
-
|
6342
|
-
|
6343
|
-
|
6344
|
-
|
6345
|
-
|
6346
|
-
|
6347
|
-
|
6348
|
-
|
6349
|
-
|
6350
|
-
}
|
6341
|
+
try {
|
6342
|
+
var _window$gapi, _window$gapi$auth, _auth2$signOut;
|
6343
|
+
signOut();
|
6344
|
+
var auth2 = (_window$gapi = window.gapi) === null || _window$gapi === void 0 ? void 0 : (_window$gapi$auth = _window$gapi.auth2) === null || _window$gapi$auth === void 0 ? void 0 : _window$gapi$auth.getAuthInstance();
|
6345
|
+
auth2 === null || auth2 === void 0 ? void 0 : (_auth2$signOut = auth2.signOut) === null || _auth2$signOut === void 0 ? void 0 : _auth2$signOut.call(auth2);
|
6346
|
+
} catch (error) {
|
6347
|
+
console.log({
|
6348
|
+
error: error
|
6349
|
+
});
|
6351
6350
|
}
|
6352
|
-
|
6353
|
-
|
6354
|
-
}
|
6355
|
-
|
6356
|
-
|
6357
|
-
|
6358
|
-
|
6359
|
-
var confirmDialogTextStyle = {
|
6360
|
-
color: "#363634",
|
6361
|
-
fontSize: 16,
|
6362
|
-
fontWeight: 700
|
6363
|
-
};
|
6364
|
-
var confirmDialogButtonStyle = {
|
6365
|
-
width: "120px",
|
6366
|
-
fontSize: 14,
|
6367
|
-
fontWeight: 700
|
6368
|
-
};
|
6369
|
-
var ConfirmDeleteDialogDefaultProps = {
|
6370
|
-
titleStyle: confirmDialogTextStyle,
|
6371
|
-
contentStyle: {
|
6372
|
-
paddingTop: "36px",
|
6373
|
-
padding: "36px",
|
6374
|
-
width: 363
|
6375
|
-
},
|
6376
|
-
contentTextStyle: _extends({}, confirmDialogTextStyle, {
|
6377
|
-
textAlign: "center"
|
6378
|
-
}),
|
6379
|
-
actionStyle: {
|
6380
|
-
justifyContent: "space-between",
|
6381
|
-
padding: "12px"
|
6382
|
-
},
|
6383
|
-
okButtonStyle: confirmDialogButtonStyle,
|
6384
|
-
cancelButtonStyle: _extends({}, confirmDialogButtonStyle, {
|
6385
|
-
color: "#3dc674"
|
6386
|
-
}),
|
6387
|
-
cancelButtonVariant: "text",
|
6388
|
-
isDelete: true
|
6351
|
+
dispatch(reset());
|
6352
|
+
window.location.href = "/login";
|
6353
|
+
};
|
6354
|
+
return {
|
6355
|
+
handleSignOut: handleSignOut,
|
6356
|
+
loaded: loaded
|
6357
|
+
};
|
6389
6358
|
};
|
6390
6359
|
|
6391
|
-
var
|
6392
|
-
var
|
6393
|
-
|
6394
|
-
|
6395
|
-
|
6396
|
-
|
6397
|
-
|
6398
|
-
|
6399
|
-
|
6400
|
-
|
6401
|
-
|
6402
|
-
|
6403
|
-
|
6404
|
-
|
6405
|
-
|
6406
|
-
|
6407
|
-
okButtonVariant = _ref$okButtonVariant === void 0 ? "contained" : _ref$okButtonVariant,
|
6408
|
-
_ref$cancelButtonVari = _ref.cancelButtonVariant,
|
6409
|
-
cancelButtonVariant = _ref$cancelButtonVari === void 0 ? "contained" : _ref$cancelButtonVari,
|
6410
|
-
_ref$zIndex = _ref.zIndex,
|
6411
|
-
zIndex = _ref$zIndex === void 0 ? 1102 : _ref$zIndex,
|
6412
|
-
toggle = _ref.toggle,
|
6413
|
-
onConfirm = _ref.onConfirm;
|
6414
|
-
var _useState = useState(),
|
6415
|
-
confirmTextValue = _useState[0],
|
6416
|
-
setConfirmTextValue = _useState[1];
|
6360
|
+
var useList = function useList(fetchData, defaultQuery) {
|
6361
|
+
var dispatch = useDispatch();
|
6362
|
+
var _useState = useState(defaultQuery),
|
6363
|
+
filter = _useState[0],
|
6364
|
+
setFilter = _useState[1];
|
6365
|
+
var _useState2 = useState(DEFAULT_PAGING_RESPONSE),
|
6366
|
+
paging = _useState2[0],
|
6367
|
+
setPaging = _useState2[1];
|
6368
|
+
var _useState3 = useState([]),
|
6369
|
+
data = _useState3[0],
|
6370
|
+
setData = _useState3[1];
|
6371
|
+
var _useState4 = useState(),
|
6372
|
+
selectedItem = _useState4[0],
|
6373
|
+
setSelectedItem = _useState4[1];
|
6374
|
+
var textSearchRef = useRef(null);
|
6375
|
+
var isFirstLoadRef = useRef(true);
|
6417
6376
|
var _useTranslation = useTranslation(),
|
6418
6377
|
t = _useTranslation.t;
|
6419
|
-
var
|
6420
|
-
|
6378
|
+
var handleChangeSelectedItem = function handleChangeSelectedItem(item) {
|
6379
|
+
setSelectedItem(item);
|
6421
6380
|
};
|
6422
|
-
var
|
6423
|
-
|
6381
|
+
var getData = function getData(isLoading) {
|
6382
|
+
if (isLoading === void 0) {
|
6383
|
+
isLoading = false;
|
6384
|
+
}
|
6385
|
+
try {
|
6386
|
+
var _temp2 = function _temp2() {
|
6387
|
+
isLoading && dispatch(setLoading(false));
|
6388
|
+
};
|
6389
|
+
if (!fetchData) return Promise.resolve();
|
6390
|
+
if (isFirstLoadRef.current) isFirstLoadRef.current = false;
|
6391
|
+
isLoading && dispatch(setLoading(true));
|
6392
|
+
var _temp = _catch(function () {
|
6393
|
+
return Promise.resolve(fetchData(filter)).then(function (res) {
|
6394
|
+
var _res$data$items = res.data.items,
|
6395
|
+
items = _res$data$items === void 0 ? [] : _res$data$items;
|
6396
|
+
setPaging({
|
6397
|
+
limit: res.data.limit || 0,
|
6398
|
+
page: res.data.page || 0,
|
6399
|
+
totalItems: res.data.totalItems || 0,
|
6400
|
+
totalPages: res.data.totalPages || 0
|
6401
|
+
});
|
6402
|
+
setData(items);
|
6403
|
+
});
|
6404
|
+
}, function (error) {
|
6405
|
+
setPaging(DEFAULT_PAGING_RESPONSE);
|
6406
|
+
setData([]);
|
6407
|
+
toast.error(getErrorMessage(t, error));
|
6408
|
+
});
|
6409
|
+
return Promise.resolve(_temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp));
|
6410
|
+
} catch (e) {
|
6411
|
+
return Promise.reject(e);
|
6412
|
+
}
|
6424
6413
|
};
|
6425
|
-
var
|
6414
|
+
var handleSort = function handleSort(sortColumnName) {
|
6415
|
+
var sortColumnDirection = OrderType.ASC;
|
6416
|
+
console.log({
|
6417
|
+
sortColumnName: typeof sortColumnName,
|
6418
|
+
filter: typeof filter.sortColumnName
|
6419
|
+
});
|
6420
|
+
if (filter.sortColumnName == sortColumnName && filter.sortColumnDirection === OrderType.ASC) sortColumnDirection = OrderType.DESC;
|
6421
|
+
setFilter(_extends({}, filter, {
|
6422
|
+
sortColumnName: sortColumnName,
|
6423
|
+
sortColumnDirection: sortColumnDirection,
|
6424
|
+
currentPage: 1
|
6425
|
+
}));
|
6426
|
+
};
|
6427
|
+
var handleChangeSearchText = function handleChangeSearchText(e) {
|
6428
|
+
if (!textSearchRef.current) return;
|
6429
|
+
textSearchRef.current.value = e.target.value.trim();
|
6430
|
+
debounceSearch();
|
6431
|
+
};
|
6432
|
+
var handleChangePage = function handleChangePage(_, page) {
|
6433
|
+
setFilter(_extends({}, filter, {
|
6434
|
+
currentPage: page
|
6435
|
+
}));
|
6436
|
+
};
|
6437
|
+
var calcOrderNumber = function calcOrderNumber(index) {
|
6438
|
+
var _paging$page, _paging$limit;
|
6439
|
+
return (((_paging$page = paging.page) != null ? _paging$page : 0) - 1) * ((_paging$limit = paging.limit) != null ? _paging$limit : 0) + index + 1;
|
6440
|
+
};
|
6441
|
+
var debounceSearch = _.debounce(function () {
|
6442
|
+
var _textSearchRef$curren;
|
6443
|
+
setFilter(_extends({}, filter, {
|
6444
|
+
currentPage: 1,
|
6445
|
+
textSearch: (_textSearchRef$curren = textSearchRef.current) === null || _textSearchRef$curren === void 0 ? void 0 : _textSearchRef$curren.value
|
6446
|
+
}));
|
6447
|
+
}, 500);
|
6448
|
+
useEffect(function () {
|
6449
|
+
getData(isFirstLoadRef.current);
|
6450
|
+
}, [JSON.stringify(filter)]);
|
6451
|
+
return {
|
6452
|
+
filter: filter,
|
6453
|
+
textSearchRef: textSearchRef,
|
6454
|
+
paging: paging,
|
6455
|
+
data: data,
|
6456
|
+
selectedItem: selectedItem,
|
6457
|
+
handleSort: handleSort,
|
6458
|
+
handleChangeSearchText: handleChangeSearchText,
|
6459
|
+
handleChangePage: handleChangePage,
|
6460
|
+
calcOrderNumber: calcOrderNumber,
|
6461
|
+
handleChangeSelectedItem: handleChangeSelectedItem,
|
6462
|
+
getData: getData
|
6463
|
+
};
|
6464
|
+
};
|
6465
|
+
|
6466
|
+
var useLoadMore = function useLoadMore(props) {
|
6467
|
+
var onLoadMore = props.onLoadMore,
|
6468
|
+
loading = props.loading;
|
6469
|
+
var observerTarget = useRef(null);
|
6426
6470
|
useEffect(function () {
|
6427
|
-
|
6428
|
-
|
6429
|
-
|
6430
|
-
|
6431
|
-
return React__default.createElement(Dialog, {
|
6432
|
-
open: open,
|
6433
|
-
onClose: toggle,
|
6434
|
-
sx: {
|
6435
|
-
zIndex: zIndex
|
6436
|
-
}
|
6437
|
-
}, React__default.createElement(Fragment$1, null, React__default.createElement(DialogTitle, {
|
6438
|
-
className: "border border-start-0 border-end-0 border-top-0 border-1 " + titleClassName,
|
6439
|
-
sx: _extends({
|
6440
|
-
fontSize: 16
|
6441
|
-
}, titleStyle)
|
6442
|
-
}, title || t('confirmation')), React__default.createElement(IconButton, {
|
6443
|
-
"aria-label": "close",
|
6444
|
-
onClick: toggle,
|
6445
|
-
sx: {
|
6446
|
-
position: "absolute",
|
6447
|
-
right: 8,
|
6448
|
-
top: 8,
|
6449
|
-
color: function color(theme) {
|
6450
|
-
return theme.palette.grey[500];
|
6471
|
+
var currentTarget = observerTarget.current;
|
6472
|
+
var observer = new IntersectionObserver(function (entries) {
|
6473
|
+
if (entries[0].isIntersecting && !loading) {
|
6474
|
+
onLoadMore();
|
6451
6475
|
}
|
6476
|
+
}, {
|
6477
|
+
threshold: 1
|
6478
|
+
});
|
6479
|
+
if (observerTarget.current) {
|
6480
|
+
observer.observe(observerTarget.current);
|
6452
6481
|
}
|
6453
|
-
|
6454
|
-
|
6455
|
-
|
6456
|
-
}, contentStyle)
|
6457
|
-
}, React__default.createElement(Typography, {
|
6458
|
-
className: "mb-1",
|
6459
|
-
sx: _extends({
|
6460
|
-
fontWeight: 700
|
6461
|
-
}, contentTextStyle)
|
6462
|
-
}, text), !!confirmText && React__default.createElement("div", {
|
6463
|
-
className: "w-100"
|
6464
|
-
}, React__default.createElement("p", {
|
6465
|
-
className: "mb-3"
|
6466
|
-
}, t("enter_text_to_confirm_delete", {
|
6467
|
-
text: confirmText
|
6468
|
-
})), React__default.createElement(TextField, {
|
6469
|
-
className: "w-100",
|
6470
|
-
sx: {
|
6471
|
-
"& input": {
|
6472
|
-
py: 1
|
6473
|
-
}
|
6474
|
-
},
|
6475
|
-
value: confirmTextValue,
|
6476
|
-
onChange: handleChangeConfirmText,
|
6477
|
-
placeholder: t('please_enter'),
|
6478
|
-
onPaste: handlePaste,
|
6479
|
-
error: !isValid && confirmTextValue !== undefined,
|
6480
|
-
color: isValid ? "success" : confirmTextValue !== undefined ? "error" : undefined
|
6481
|
-
}))), React__default.createElement(DialogActions, {
|
6482
|
-
className: "border border-start-0 border-end-0 border-bottom-0 border-1 " + titleClassName,
|
6483
|
-
sx: _extends({
|
6484
|
-
paddingTop: 1
|
6485
|
-
}, actionStyle)
|
6486
|
-
}, React__default.createElement(Button, {
|
6487
|
-
variant: cancelButtonVariant,
|
6488
|
-
color: cancelButtonVariant !== "contained" ? "primary" : "secondary",
|
6489
|
-
className: "px-3 " + (cancelButtonVariant !== "contained" ? "primary" : "bg-secondary"),
|
6490
|
-
onClick: toggle,
|
6491
|
-
sx: cancelButtonStyle
|
6492
|
-
}, cancelText || t("no")), React__default.createElement(Button, {
|
6493
|
-
variant: okButtonVariant,
|
6494
|
-
color: isDelete ? "error" : "primary",
|
6495
|
-
className: "px-3",
|
6496
|
-
disabled: isDisableDelete,
|
6497
|
-
onClick: handleConfirm,
|
6498
|
-
sx: _extends({}, okButtonStyle, isDelete && {
|
6499
|
-
backgroundColor: "#db4d4d",
|
6500
|
-
color: "#FFFFFF",
|
6501
|
-
"&:hover": {
|
6502
|
-
backgroundColor: "#C41414"
|
6482
|
+
return function () {
|
6483
|
+
if (currentTarget) {
|
6484
|
+
observer.unobserve(currentTarget);
|
6503
6485
|
}
|
6504
|
-
}
|
6505
|
-
},
|
6486
|
+
};
|
6487
|
+
}, [observerTarget, loading, onLoadMore]);
|
6488
|
+
return {
|
6489
|
+
observerTarget: observerTarget
|
6490
|
+
};
|
6506
6491
|
};
|
6507
6492
|
|
6508
|
-
var
|
6509
|
-
|
6493
|
+
var AUTH_URL = BASE_URL + "/api/auth";
|
6494
|
+
var AUTH_SUPER_ADMIN_URL = SUPER_ADMIN_BASE_URL + "/api/auth";
|
6495
|
+
var getInfo = function getInfo(role, isLearningSpace) {
|
6496
|
+
var _headers;
|
6497
|
+
return api.get(AUTH_URL + "/info", {
|
6498
|
+
params: {
|
6499
|
+
role: role
|
6500
|
+
},
|
6501
|
+
headers: (_headers = {}, _headers[NoAcademyHeaders] = isLearningSpace, _headers)
|
6502
|
+
});
|
6510
6503
|
};
|
6511
|
-
|
6512
|
-
|
6513
|
-
|
6514
|
-
var
|
6515
|
-
var
|
6516
|
-
|
6517
|
-
|
6518
|
-
|
6519
|
-
|
6520
|
-
|
6521
|
-
|
6522
|
-
|
6523
|
-
|
6524
|
-
|
6525
|
-
|
6526
|
-
|
6527
|
-
|
6528
|
-
|
6504
|
+
var getSuperAdminInfoFromWeb = function getSuperAdminInfoFromWeb() {
|
6505
|
+
return api.get(AUTH_SUPER_ADMIN_URL + "/info");
|
6506
|
+
};
|
6507
|
+
var apiLoginGoogle = function apiLoginGoogle(body, isLearningSpace) {
|
6508
|
+
var _headers2;
|
6509
|
+
return api.post(AUTH_URL + "/login", body, {
|
6510
|
+
headers: (_headers2 = {}, _headers2[NoAcademyHeaders] = isLearningSpace, _headers2)
|
6511
|
+
});
|
6512
|
+
};
|
6513
|
+
var apiLoginGoogleSuperAdmin = function apiLoginGoogleSuperAdmin(body) {
|
6514
|
+
return api.post(AUTH_SUPER_ADMIN_URL + "/login", body);
|
6515
|
+
};
|
6516
|
+
var apiLoginWithAccessToken = function apiLoginWithAccessToken(body, isLearningSpace, domain) {
|
6517
|
+
var _headers3;
|
6518
|
+
return api.post(AUTH_URL + "/login/access-token", body, {
|
6519
|
+
params: {
|
6520
|
+
isLearningSpace: isLearningSpace
|
6521
|
+
},
|
6522
|
+
headers: (_headers3 = {}, _headers3[AcademyHeaders] = domain, _headers3[NoAcademyHeaders] = isLearningSpace, _headers3)
|
6523
|
+
});
|
6524
|
+
};
|
6525
|
+
var apiLoginSuperAdminWithAccessToken = function apiLoginSuperAdminWithAccessToken(body) {
|
6526
|
+
return api.post(AUTH_SUPER_ADMIN_URL + "/login/access-token", body);
|
6529
6527
|
};
|
6530
6528
|
|
6531
|
-
var
|
6532
|
-
|
6533
|
-
|
6534
|
-
|
6535
|
-
|
6529
|
+
var useLogin = function useLogin(history, homeAcademyUrl, homeUrl, registerUrl, redirectAfterLogin) {
|
6530
|
+
if (redirectAfterLogin === void 0) {
|
6531
|
+
redirectAfterLogin = true;
|
6532
|
+
}
|
6533
|
+
var dispatch = useDispatch();
|
6536
6534
|
var _useTranslation = useTranslation(),
|
6537
6535
|
t = _useTranslation.t;
|
6538
|
-
var
|
6539
|
-
|
6540
|
-
|
6541
|
-
var
|
6542
|
-
|
6536
|
+
var _useGoogleSignOut = useGoogleSignOut({}),
|
6537
|
+
handleSignOut = _useGoogleSignOut.handleSignOut;
|
6538
|
+
var searchParams = new URLSearchParams(window.location.search);
|
6539
|
+
var paramDomain = searchParams.get('domain');
|
6540
|
+
var handleLoginGoogle = function handleLoginGoogle(data, isLogout) {
|
6541
|
+
if (isLogout === void 0) {
|
6542
|
+
isLogout = true;
|
6543
|
+
}
|
6544
|
+
try {
|
6545
|
+
var isStudent = data.role === Role.Student;
|
6546
|
+
var academyDomain = paramDomain || getAcademyDomain();
|
6547
|
+
var isLearningSpace = getLearningSpace() || isStudent && !academyDomain;
|
6548
|
+
if (!isStudent && isLearningSpace) {
|
6549
|
+
isLearningSpace = false;
|
6550
|
+
localStorage.removeItem(LEARNING_SPACE);
|
6551
|
+
}
|
6552
|
+
var isAcademy = !!academyDomain || isLearningSpace;
|
6553
|
+
return Promise.resolve(handleLogin(function () {
|
6554
|
+
return new Promise(function (resolve, reject) {
|
6555
|
+
try {
|
6556
|
+
var _temp3 = _catch(function () {
|
6557
|
+
return Promise.resolve(isAcademy ? apiLoginGoogle(data, isLearningSpace) : apiLoginGoogleSuperAdmin(data)).then(function (loginResponse) {
|
6558
|
+
function _temp2() {
|
6559
|
+
resolve(result);
|
6560
|
+
}
|
6561
|
+
var result = loginResponse.data;
|
6562
|
+
var _temp = function () {
|
6563
|
+
if (loginResponse.status === 204 && academyDomain) {
|
6564
|
+
localStorage.removeItem(ACADEMY_DOMAIN);
|
6565
|
+
localStorage.removeItem(LEARNING_SPACE);
|
6566
|
+
return Promise.resolve(apiLoginGoogleSuperAdmin(data)).then(function (_apiLoginGoogleSuperA) {
|
6567
|
+
loginResponse = _apiLoginGoogleSuperA;
|
6568
|
+
result = loginResponse.data;
|
6569
|
+
});
|
6570
|
+
}
|
6571
|
+
}();
|
6572
|
+
return _temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp);
|
6573
|
+
});
|
6574
|
+
}, function (error) {
|
6575
|
+
!!academyDomain && localStorage.removeItem(ACADEMY_DOMAIN);
|
6576
|
+
localStorage.removeItem(LEARNING_SPACE);
|
6577
|
+
reject(error);
|
6578
|
+
});
|
6579
|
+
return Promise.resolve(_temp3 && _temp3.then ? _temp3.then(function () {}) : void 0);
|
6580
|
+
} catch (e) {
|
6581
|
+
return Promise.reject(e);
|
6582
|
+
}
|
6583
|
+
});
|
6584
|
+
}, isStudent, isLogout)).then(function () {});
|
6585
|
+
} catch (e) {
|
6586
|
+
return Promise.reject(e);
|
6587
|
+
}
|
6543
6588
|
};
|
6544
|
-
var
|
6589
|
+
var handleLoginAccessToken = function handleLoginAccessToken(data, isLearningSpace, domain, isLogout, superAdminRedirectPath) {
|
6590
|
+
if (isLogout === void 0) {
|
6591
|
+
isLogout = true;
|
6592
|
+
}
|
6545
6593
|
try {
|
6546
|
-
var
|
6547
|
-
|
6548
|
-
|
6594
|
+
var isStudent = data.role === Role.Student;
|
6595
|
+
return Promise.resolve(handleLogin(function () {
|
6596
|
+
return new Promise(function (resolve, reject) {
|
6597
|
+
try {
|
6598
|
+
var _temp4 = _catch(function () {
|
6599
|
+
return Promise.resolve(!isLearningSpace && !domain ? apiLoginSuperAdminWithAccessToken(data) : apiLoginWithAccessToken(data, isLearningSpace, domain)).then(function (loginResponse) {
|
6600
|
+
var result = loginResponse.data;
|
6601
|
+
resolve(result);
|
6602
|
+
});
|
6603
|
+
}, function (error) {
|
6604
|
+
reject(error);
|
6605
|
+
});
|
6606
|
+
return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(function () {}) : void 0);
|
6607
|
+
} catch (e) {
|
6608
|
+
return Promise.reject(e);
|
6609
|
+
}
|
6610
|
+
});
|
6611
|
+
}, isStudent, isLogout, superAdminRedirectPath)).then(function () {});
|
6612
|
+
} catch (e) {
|
6613
|
+
return Promise.reject(e);
|
6614
|
+
}
|
6615
|
+
};
|
6616
|
+
var handleLogin = function handleLogin(apiLogin, isStudent, isLogout, superAdminRedirectPath) {
|
6617
|
+
if (isLogout === void 0) {
|
6618
|
+
isLogout = true;
|
6619
|
+
}
|
6620
|
+
try {
|
6621
|
+
var _temp6 = function _temp6(_result) {
|
6622
|
+
if (_exit) return _result;
|
6623
|
+
dispatch(setLoading(false));
|
6549
6624
|
};
|
6550
|
-
|
6625
|
+
var _exit = false;
|
6626
|
+
dispatch(setLoading(true));
|
6627
|
+
var _temp5 = _catch(function () {
|
6628
|
+
return Promise.resolve(apiLogin()).then(function (loginResponse) {
|
6629
|
+
var isFirstLogin = loginResponse.isFirstLogin,
|
6630
|
+
token = loginResponse.token,
|
6631
|
+
user = loginResponse.user,
|
6632
|
+
isSuperAdmin = loginResponse.isSuperAdmin;
|
6633
|
+
var isAcademy = !!(user !== null && user !== void 0 && user.academyDomain) || !!(user !== null && user !== void 0 && user.isLearningSpace);
|
6634
|
+
var needToRegister = isStudent && isFirstLogin && isAcademy;
|
6635
|
+
var redirectUrl = getRedirectUrl();
|
6636
|
+
if (isStudent && !registerUrl) throw new Error("an_unexpected_error_has_occurred");
|
6637
|
+
if (!redirectUrl) redirectUrl = needToRegister ? registerUrl : isAcademy ? homeAcademyUrl : homeUrl;
|
6638
|
+
if (superAdminRedirectPath) {
|
6639
|
+
redirectUrl = superAdminRedirectPath;
|
6640
|
+
}
|
6641
|
+
if (!redirectAfterLogin) redirectUrl = undefined;
|
6642
|
+
redirectLoginUser(_extends({}, user, {
|
6643
|
+
isNotEnoughStatements: isFirstLogin,
|
6644
|
+
isSuperAdmin: isSuperAdmin
|
6645
|
+
}), token, redirectUrl);
|
6646
|
+
});
|
6647
|
+
}, function (error) {
|
6648
|
+
alert(getErrorMessage(t, error));
|
6649
|
+
isLogout && handleSignOut();
|
6650
|
+
});
|
6651
|
+
return Promise.resolve(_temp5 && _temp5.then ? _temp5.then(_temp6) : _temp6(_temp5));
|
6551
6652
|
} catch (e) {
|
6552
6653
|
return Promise.reject(e);
|
6553
6654
|
}
|
6554
6655
|
};
|
6555
|
-
var
|
6556
|
-
|
6557
|
-
|
6558
|
-
|
6559
|
-
|
6560
|
-
|
6561
|
-
|
6562
|
-
|
6563
|
-
|
6564
|
-
}, React__default.createElement(DialogContent, {
|
6565
|
-
sx: {
|
6566
|
-
overflowY: "unset"
|
6656
|
+
var redirectLoginUser = function redirectLoginUser(data, token, redirectUrl) {
|
6657
|
+
localStorage.setItem(ACCESS_TOKEN, token);
|
6658
|
+
!data.academyDomain && localStorage.removeItem(ACADEMY_DOMAIN);
|
6659
|
+
!!data.academyDomain && localStorage.setItem(ACADEMY_DOMAIN, data.academyDomain);
|
6660
|
+
if (data.roles.includes(Role.Student)) data.isLearningSpace ? localStorage.setItem(LEARNING_SPACE, "true") : localStorage.removeItem(LEARNING_SPACE);
|
6661
|
+
dispatch(setUser(_extends({}, data)));
|
6662
|
+
if (redirectUrl) {
|
6663
|
+
pushTo(history, redirectUrl);
|
6664
|
+
localStorage.removeItem(REDIRECT_URL);
|
6567
6665
|
}
|
6568
|
-
}
|
6569
|
-
|
6570
|
-
|
6571
|
-
|
6572
|
-
|
6573
|
-
}
|
6574
|
-
className: "fw-medium mb-1"
|
6575
|
-
}, t("pass_code"), React__default.createElement("span", {
|
6576
|
-
className: "text-danger"
|
6577
|
-
}, "*")), React__default.createElement(InputText, {
|
6578
|
-
id: "pass-code",
|
6579
|
-
placeholder: t("enter_pass_code"),
|
6580
|
-
value: passCode,
|
6581
|
-
onChange: handleChangePassCode
|
6582
|
-
})))), React__default.createElement(DialogActions, {
|
6583
|
-
className: ""
|
6584
|
-
}, React__default.createElement(Button, {
|
6585
|
-
variant: "contained",
|
6586
|
-
sx: {
|
6587
|
-
bgcolor: theme.palette.grey[700]
|
6588
|
-
},
|
6589
|
-
onClick: handleClose
|
6590
|
-
}, t("cancel")), React__default.createElement(Button, {
|
6591
|
-
variant: "contained",
|
6592
|
-
onClick: handleSubmit,
|
6593
|
-
disabled: !passCode.trim().length
|
6594
|
-
}, t("confirmation"))));
|
6666
|
+
};
|
6667
|
+
return {
|
6668
|
+
handleLoginGoogle: handleLoginGoogle,
|
6669
|
+
handleLoginAccessToken: handleLoginAccessToken,
|
6670
|
+
redirectLoginUser: redirectLoginUser
|
6671
|
+
};
|
6595
6672
|
};
|
6596
6673
|
|
6597
|
-
var
|
6598
|
-
|
6599
|
-
|
6600
|
-
|
6601
|
-
|
6602
|
-
|
6603
|
-
|
6604
|
-
backgroundColor: "rgba(0, 0, 0, 0.4)",
|
6605
|
-
display: "flex",
|
6606
|
-
justifyContent: "center",
|
6607
|
-
alignItems: "center"
|
6608
|
-
};
|
6609
|
-
var Loading = function Loading() {
|
6610
|
-
var isLoading = useSelector(function (state) {
|
6611
|
-
return state.common.isLoading;
|
6674
|
+
var ACADEMY_URL = BASE_URL + "/api/academy";
|
6675
|
+
var SUPER_ADMIN_ACADEMY_URL = SUPER_ADMIN_BASE_URL + "/api/academies";
|
6676
|
+
var getAcademyList = function getAcademyList(role) {
|
6677
|
+
return api.get(SUPER_ADMIN_ACADEMY_URL + "/active", {
|
6678
|
+
params: {
|
6679
|
+
role: role
|
6680
|
+
}
|
6612
6681
|
});
|
6613
|
-
return isLoading ? React__default.createElement("div", {
|
6614
|
-
style: loadingStyle
|
6615
|
-
}, React__default.createElement("div", {
|
6616
|
-
className: "spinner-border text-secondary",
|
6617
|
-
role: "status"
|
6618
|
-
}, React__default.createElement("span", {
|
6619
|
-
className: "sr-only"
|
6620
|
-
}))) : null;
|
6621
|
-
};
|
6622
|
-
|
6623
|
-
var loadingStyle$1 = {
|
6624
|
-
minWidth: "100vw",
|
6625
|
-
minHeight: "100vh",
|
6626
|
-
position: "fixed",
|
6627
|
-
top: 0,
|
6628
|
-
left: 0,
|
6629
|
-
zIndex: 999999999,
|
6630
|
-
backgroundColor: "rgba(0, 0, 0, 0.4)",
|
6631
|
-
display: "flex",
|
6632
|
-
justifyContent: "center",
|
6633
|
-
alignItems: "center"
|
6634
|
-
};
|
6635
|
-
var LoadingComponent = function LoadingComponent(_ref) {
|
6636
|
-
var isLoading = _ref.isLoading,
|
6637
|
-
children = _ref.children,
|
6638
|
-
_ref$spinClassName = _ref.spinClassName,
|
6639
|
-
spinClassName = _ref$spinClassName === void 0 ? "text-secondary" : _ref$spinClassName,
|
6640
|
-
_ref$className = _ref.className,
|
6641
|
-
className = _ref$className === void 0 ? "" : _ref$className;
|
6642
|
-
return isLoading ? React__default.createElement("div", {
|
6643
|
-
style: loadingStyle$1
|
6644
|
-
}, React__default.createElement(Stack, {
|
6645
|
-
direction: "column",
|
6646
|
-
justifyContent: "center",
|
6647
|
-
alignItems: "center",
|
6648
|
-
className: className
|
6649
|
-
}, React__default.createElement("div", {
|
6650
|
-
className: "spinner-border " + spinClassName,
|
6651
|
-
role: "status"
|
6652
|
-
}, React__default.createElement("span", {
|
6653
|
-
className: "sr-only"
|
6654
|
-
})), React__default.createElement("div", null, children))) : null;
|
6655
6682
|
};
|
6656
|
-
|
6657
|
-
var
|
6658
|
-
|
6659
|
-
|
6660
|
-
|
6661
|
-
|
6662
|
-
|
6663
|
-
};
|
6664
|
-
return React__default.createElement(Pagination, {
|
6665
|
-
className: "w-fit",
|
6666
|
-
count: totalPage,
|
6667
|
-
page: currentPage,
|
6668
|
-
onChange: handleChangePage
|
6683
|
+
var getUserAcademies = function getUserAcademies(role, isLearningSpace) {
|
6684
|
+
var _headers;
|
6685
|
+
return api.get("" + ACADEMY_URL, {
|
6686
|
+
params: {
|
6687
|
+
role: role
|
6688
|
+
},
|
6689
|
+
headers: (_headers = {}, _headers[NoAcademyHeaders] = isLearningSpace, _headers)
|
6669
6690
|
});
|
6670
6691
|
};
|
6671
|
-
|
6672
|
-
|
6673
|
-
|
6674
|
-
|
6675
|
-
color: styles.darker
|
6676
|
-
}));
|
6677
|
-
};
|
6678
|
-
var CustomOption = function CustomOption(props) {
|
6679
|
-
return React__default.createElement(components.Option, Object.assign({}, props), React__default.createElement("div", {
|
6680
|
-
style: {
|
6681
|
-
fontSize: "14px",
|
6682
|
-
fontWeight: 500
|
6692
|
+
var getAcademyByDomainApi = function getAcademyByDomainApi(domain, role) {
|
6693
|
+
return api.get(SUPER_ADMIN_ACADEMY_URL + "/domain/" + domain, {
|
6694
|
+
params: {
|
6695
|
+
role: role
|
6683
6696
|
}
|
6684
|
-
}, props.data.label));
|
6685
|
-
};
|
6686
|
-
|
6687
|
-
var customStyles = {
|
6688
|
-
control: function control(baseStyles, state) {
|
6689
|
-
return _extends({}, baseStyles, {
|
6690
|
-
fontSize: "14px",
|
6691
|
-
fontWeight: 700,
|
6692
|
-
color: styles.darker,
|
6693
|
-
borderColor: state.isFocused || state.hasValue ? styles.dark : styles.less_dark,
|
6694
|
-
boxShadow: state.isFocused ? "0 0 0 1px " + styles.dark + "4D" : baseStyles.boxShadow,
|
6695
|
-
"&:active": {
|
6696
|
-
borderColor: state.isFocused || state.hasValue ? styles.dark : styles.less_dark
|
6697
|
-
},
|
6698
|
-
"&:hover": {
|
6699
|
-
borderColor: state.isFocused || state.hasValue ? styles.dark : styles.less_dark
|
6700
|
-
}
|
6701
|
-
});
|
6702
|
-
},
|
6703
|
-
input: function input(baseStyles, _) {
|
6704
|
-
return _extends({}, baseStyles, {
|
6705
|
-
fontSize: "14px",
|
6706
|
-
fontWeight: 700,
|
6707
|
-
color: styles.darker
|
6708
|
-
});
|
6709
|
-
},
|
6710
|
-
singleValue: function singleValue(baseStyles) {
|
6711
|
-
return _extends({}, baseStyles, {
|
6712
|
-
fontSize: "14px",
|
6713
|
-
fontWeight: 700,
|
6714
|
-
color: styles.darker
|
6715
|
-
});
|
6716
|
-
},
|
6717
|
-
option: function option(baseStyles, state) {
|
6718
|
-
return _extends({}, baseStyles, {
|
6719
|
-
backgroundColor: state.isSelected ? styles.dark : state.isFocused ? styles.light : 'white',
|
6720
|
-
"&:active": {
|
6721
|
-
backgroundColor: state.isSelected ? styles.dark : state.isFocused ? styles.less_dark : baseStyles.backgroundColor
|
6722
|
-
}
|
6723
|
-
});
|
6724
|
-
}
|
6725
|
-
};
|
6726
|
-
|
6727
|
-
var _excluded = ["isDefault", "defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
|
6728
|
-
var CustomAsyncSelect = function CustomAsyncSelect(_ref) {
|
6729
|
-
var isDefault = _ref.isDefault,
|
6730
|
-
options = _ref.options,
|
6731
|
-
isDisabled = _ref.isDisabled,
|
6732
|
-
scrollBottom = _ref.scrollBottom,
|
6733
|
-
value = _ref.value,
|
6734
|
-
isMulti = _ref.isMulti,
|
6735
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
6736
|
-
var initialValues = Array.isArray(value) ? options.filter(function (i) {
|
6737
|
-
return value.includes(i.value);
|
6738
|
-
}) : isMulti ? options.filter(function (i) {
|
6739
|
-
return i.value == value;
|
6740
|
-
}) : options.find(function (i) {
|
6741
|
-
return i.value == value;
|
6742
6697
|
});
|
6743
|
-
|
6744
|
-
|
6745
|
-
return
|
6746
|
-
|
6747
|
-
|
6748
|
-
|
6749
|
-
|
6750
|
-
|
6751
|
-
|
6752
|
-
|
6753
|
-
|
6754
|
-
|
6755
|
-
|
6756
|
-
|
6757
|
-
|
6758
|
-
|
6759
|
-
styles: customStyles,
|
6760
|
-
placeholder: t("select_placeholder")
|
6761
|
-
}, rest));
|
6698
|
+
};
|
6699
|
+
var getAcademyDetail = function getAcademyDetail() {
|
6700
|
+
return api.get(ACADEMY_URL + "/detail");
|
6701
|
+
};
|
6702
|
+
var switchAcademy = function switchAcademy(academyId, role, isLearningSpace) {
|
6703
|
+
if (isLearningSpace === void 0) {
|
6704
|
+
isLearningSpace = false;
|
6705
|
+
}
|
6706
|
+
return api.post(ACADEMY_URL + "/" + academyId + "/switch-academy/" + role, undefined, {
|
6707
|
+
params: {
|
6708
|
+
isLearningSpace: isLearningSpace
|
6709
|
+
}
|
6710
|
+
});
|
6711
|
+
};
|
6712
|
+
var switchSuperAdminAcademy = function switchSuperAdminAcademy(academyId, role) {
|
6713
|
+
return api.post(SUPER_ADMIN_ACADEMY_URL + "/" + academyId + "/switch-academy/" + role);
|
6762
6714
|
};
|
6763
6715
|
|
6764
|
-
var
|
6765
|
-
var
|
6766
|
-
|
6767
|
-
|
6768
|
-
|
6769
|
-
|
6770
|
-
|
6771
|
-
|
6772
|
-
var
|
6773
|
-
|
6774
|
-
|
6775
|
-
|
6776
|
-
|
6777
|
-
return
|
6716
|
+
var useSwitchAcademy = function useSwitchAcademy(role, history, homeAcademyUrl, homeUrl, registerUrl, canFetchAcademies) {
|
6717
|
+
var _user$roles;
|
6718
|
+
if (role === void 0) {
|
6719
|
+
role = Role.Student;
|
6720
|
+
}
|
6721
|
+
if (canFetchAcademies === void 0) {
|
6722
|
+
canFetchAcademies = false;
|
6723
|
+
}
|
6724
|
+
var dispatch = useDispatch();
|
6725
|
+
var _useLogin = useLogin(history, homeAcademyUrl, homeUrl, registerUrl),
|
6726
|
+
handleLoginAccessToken = _useLogin.handleLoginAccessToken;
|
6727
|
+
var academyList = useSelector(function (state) {
|
6728
|
+
var _state$academies;
|
6729
|
+
return state === null || state === void 0 ? void 0 : (_state$academies = state.academies) === null || _state$academies === void 0 ? void 0 : _state$academies.items;
|
6730
|
+
}) || [];
|
6731
|
+
var _useState = useState(false),
|
6732
|
+
dropdownOpen = _useState[0],
|
6733
|
+
setDropdownOpen = _useState[1];
|
6734
|
+
var toggleDropdown = function toggleDropdown() {
|
6735
|
+
return setDropdownOpen(function (prevState) {
|
6736
|
+
return !prevState;
|
6737
|
+
});
|
6738
|
+
};
|
6739
|
+
var user = useSelector(function (state) {
|
6740
|
+
var _state$common;
|
6741
|
+
return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.user;
|
6742
|
+
});
|
6743
|
+
var isReFetchUserAcademies = useSelector(function (state) {
|
6744
|
+
var _state$common2;
|
6745
|
+
return state === null || state === void 0 ? void 0 : (_state$common2 = state.common) === null || _state$common2 === void 0 ? void 0 : _state$common2.isReFetchUserAcademies;
|
6778
6746
|
});
|
6779
6747
|
var _useTranslation = useTranslation(),
|
6780
6748
|
t = _useTranslation.t;
|
6781
|
-
|
6782
|
-
|
6783
|
-
|
6784
|
-
|
6785
|
-
|
6786
|
-
|
6787
|
-
|
6788
|
-
|
6789
|
-
|
6790
|
-
|
6791
|
-
|
6792
|
-
|
6793
|
-
|
6794
|
-
|
6795
|
-
|
6796
|
-
|
6797
|
-
|
6749
|
+
var getAcademies = function getAcademies(isLoading) {
|
6750
|
+
if (isLoading === void 0) {
|
6751
|
+
isLoading = true;
|
6752
|
+
}
|
6753
|
+
try {
|
6754
|
+
var _temp3 = function _temp3() {
|
6755
|
+
isLoading && dispatch(setLoading(false));
|
6756
|
+
};
|
6757
|
+
if (!user) return Promise.resolve();
|
6758
|
+
var isSuperAdminUser = user && !user.academyDomain && !(user !== null && user !== void 0 && user.isLearningSpace);
|
6759
|
+
var isSuperAdminRole = user.roles.includes(Role.Admin);
|
6760
|
+
isLoading && dispatch(setLoading(true));
|
6761
|
+
var _temp2 = _catch(function () {
|
6762
|
+
return Promise.resolve(isSuperAdminUser ? getAcademyList(role) : getUserAcademies(role, user === null || user === void 0 ? void 0 : user.isLearningSpace)).then(function (res) {
|
6763
|
+
var items = res.data.items || [];
|
6764
|
+
if (isReFetchUserAcademies) dispatch(setReFetchUserAcademies(false));
|
6765
|
+
dispatch(setAcademies(items));
|
6766
|
+
var _temp = function () {
|
6767
|
+
if (!isSuperAdminRole && isSuperAdminUser && role == Role.Admin && items.length > 0) {
|
6768
|
+
return Promise.resolve(handleSwitchAcademy(false, items[0], false)).then(function () {});
|
6769
|
+
}
|
6770
|
+
}();
|
6771
|
+
if (_temp && _temp.then) return _temp.then(function () {});
|
6772
|
+
});
|
6773
|
+
}, function (error) {
|
6774
|
+
toast.error(getErrorMessage(t, error));
|
6775
|
+
});
|
6776
|
+
return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(_temp3) : _temp3(_temp2));
|
6777
|
+
} catch (e) {
|
6778
|
+
return Promise.reject(e);
|
6779
|
+
}
|
6780
|
+
};
|
6781
|
+
var handleSwitchAcademy = function handleSwitchAcademy(isLearningSpace, selectedAcademy, isLoading, superAdminRedirectPath) {
|
6782
|
+
if (isLoading === void 0) {
|
6783
|
+
isLoading = true;
|
6784
|
+
}
|
6785
|
+
try {
|
6786
|
+
var _temp5 = function _temp5() {
|
6787
|
+
isLoading && dispatch(setLoading(false));
|
6788
|
+
setDropdownOpen(false);
|
6789
|
+
};
|
6790
|
+
isLoading && dispatch(setLoading(true));
|
6791
|
+
var academyId = selectedAcademy ? selectedAcademy.id : 0;
|
6792
|
+
var academyDomain = selectedAcademy ? selectedAcademy.domain : undefined;
|
6793
|
+
var isSuperAdminUser = user && !user.academyDomain && !(user !== null && user !== void 0 && user.isLearningSpace);
|
6794
|
+
var _temp4 = _catch(function () {
|
6795
|
+
return Promise.resolve(isSuperAdminUser ? switchSuperAdminAcademy(academyId, role) : switchAcademy(academyId, role, isLearningSpace)).then(function (res) {
|
6796
|
+
var data = res.data;
|
6797
|
+
var requestBody = {
|
6798
|
+
accessToken: data.accessToken,
|
6799
|
+
email: user.email,
|
6800
|
+
role: role
|
6801
|
+
};
|
6802
|
+
return Promise.resolve(handleLoginAccessToken(requestBody, isLearningSpace, academyDomain, false, superAdminRedirectPath)).then(function () {});
|
6803
|
+
});
|
6804
|
+
}, function (error) {
|
6805
|
+
toast.error(getErrorMessage(t, error));
|
6806
|
+
});
|
6807
|
+
return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(_temp5) : _temp5(_temp4));
|
6808
|
+
} catch (e) {
|
6809
|
+
return Promise.reject(e);
|
6810
|
+
}
|
6811
|
+
};
|
6812
|
+
var handleLogOutAcademy = function handleLogOutAcademy(callback) {
|
6813
|
+
try {
|
6814
|
+
var _temp7 = function _temp7() {
|
6815
|
+
dispatch(setLoading(false));
|
6816
|
+
callback();
|
6817
|
+
};
|
6818
|
+
dispatch(setLoading(true));
|
6819
|
+
var _temp6 = _catch(function () {
|
6820
|
+
return Promise.resolve(switchAcademy(0, role)).then(function (res) {
|
6821
|
+
var data = res.data;
|
6822
|
+
var requestBody = {
|
6823
|
+
accessToken: data.accessToken,
|
6824
|
+
email: user.email,
|
6825
|
+
role: role
|
6826
|
+
};
|
6827
|
+
return Promise.resolve(handleLoginAccessToken(requestBody, undefined, undefined, false)).then(function () {});
|
6828
|
+
});
|
6829
|
+
}, function (error) {
|
6830
|
+
toast.error(getErrorMessage(t, error));
|
6831
|
+
});
|
6832
|
+
return Promise.resolve(_temp6 && _temp6.then ? _temp6.then(_temp7) : _temp7(_temp6));
|
6833
|
+
} catch (e) {
|
6834
|
+
return Promise.reject(e);
|
6835
|
+
}
|
6836
|
+
};
|
6837
|
+
useEffect(function () {
|
6838
|
+
canFetchAcademies && getAcademies();
|
6839
|
+
}, [canFetchAcademies, user === null || user === void 0 ? void 0 : user.academyDomain, user === null || user === void 0 ? void 0 : user.email, user === null || user === void 0 ? void 0 : (_user$roles = user.roles) === null || _user$roles === void 0 ? void 0 : _user$roles.join(",")]);
|
6840
|
+
useEffect(function () {
|
6841
|
+
canFetchAcademies && isReFetchUserAcademies && getAcademies(false);
|
6842
|
+
}, [canFetchAcademies, isReFetchUserAcademies]);
|
6843
|
+
var selectedAcademy = useMemo(function () {
|
6844
|
+
return academyList.find(function (i) {
|
6845
|
+
var _user$academyDomain;
|
6846
|
+
return i.domain.trim().toLowerCase() === (user === null || user === void 0 ? void 0 : (_user$academyDomain = user.academyDomain) === null || _user$academyDomain === void 0 ? void 0 : _user$academyDomain.trim().toLowerCase());
|
6847
|
+
});
|
6848
|
+
}, [user === null || user === void 0 ? void 0 : user.academyDomain, JSON.stringify(academyList)]);
|
6849
|
+
return {
|
6850
|
+
selectedAcademy: selectedAcademy,
|
6851
|
+
dropdownOpen: dropdownOpen,
|
6852
|
+
academyList: academyList,
|
6853
|
+
toggleDropdown: toggleDropdown,
|
6854
|
+
handleSwitchAcademy: handleSwitchAcademy,
|
6855
|
+
handleLogOutAcademy: handleLogOutAcademy
|
6856
|
+
};
|
6798
6857
|
};
|
6799
6858
|
|
6800
|
-
var
|
6801
|
-
|
6802
|
-
|
6803
|
-
|
6804
|
-
|
6805
|
-
|
6806
|
-
|
6807
|
-
|
6808
|
-
|
6809
|
-
|
6810
|
-
|
6811
|
-
var
|
6812
|
-
|
6813
|
-
|
6814
|
-
|
6815
|
-
|
6816
|
-
|
6817
|
-
|
6818
|
-
|
6819
|
-
|
6820
|
-
|
6821
|
-
|
6822
|
-
|
6823
|
-
|
6824
|
-
|
6825
|
-
|
6826
|
-
|
6827
|
-
|
6828
|
-
|
6829
|
-
|
6830
|
-
|
6831
|
-
|
6832
|
-
|
6833
|
-
|
6834
|
-
|
6859
|
+
var useVirtualizeList = function useVirtualizeList(totalItems, rowHeight, offsetRow, minRows) {
|
6860
|
+
if (offsetRow === void 0) {
|
6861
|
+
offsetRow = 1;
|
6862
|
+
}
|
6863
|
+
var _useState = useState(-1),
|
6864
|
+
startIndex = _useState[0],
|
6865
|
+
setStartIndex = _useState[1];
|
6866
|
+
var _useState2 = useState(-1),
|
6867
|
+
endIndex = _useState2[0],
|
6868
|
+
setEndIndex = _useState2[1];
|
6869
|
+
var containerRef = useRef(null);
|
6870
|
+
var handleScroll = useCallback(function () {
|
6871
|
+
if (containerRef.current) {
|
6872
|
+
var _containerRef$current = containerRef.current,
|
6873
|
+
scrollTop = _containerRef$current.scrollTop,
|
6874
|
+
clientHeight = _containerRef$current.clientHeight;
|
6875
|
+
var itemsPerPage = Math.ceil(clientHeight / rowHeight);
|
6876
|
+
var newStartIndex = Math.max(Math.floor(scrollTop / rowHeight) - offsetRow, 0);
|
6877
|
+
var newEndIndex = Math.min(newStartIndex + itemsPerPage + offsetRow, totalItems - 1);
|
6878
|
+
if (minRows) {
|
6879
|
+
if (totalItems <= minRows) {
|
6880
|
+
newStartIndex = -1;
|
6881
|
+
newEndIndex = -1;
|
6882
|
+
} else {
|
6883
|
+
var total = newEndIndex - newStartIndex;
|
6884
|
+
var diff = minRows - total;
|
6885
|
+
if (diff > 0) {
|
6886
|
+
var valS = diff / 2;
|
6887
|
+
var valE = diff - valS;
|
6888
|
+
if (newStartIndex < valS) {
|
6889
|
+
valE += valS - newStartIndex;
|
6890
|
+
newStartIndex = 0;
|
6891
|
+
}
|
6892
|
+
if (newEndIndex + valE > totalItems - 1) {
|
6893
|
+
valS += newEndIndex + valE - totalItems + 1;
|
6894
|
+
}
|
6895
|
+
newStartIndex = Math.max(newStartIndex - valS, 0);
|
6896
|
+
newEndIndex = Math.min(newEndIndex + valE, totalItems - 1);
|
6897
|
+
}
|
6898
|
+
}
|
6899
|
+
}
|
6900
|
+
setStartIndex(newStartIndex);
|
6901
|
+
setEndIndex(newEndIndex);
|
6902
|
+
}
|
6903
|
+
}, [totalItems, rowHeight, offsetRow]);
|
6904
|
+
useEffect(function () {
|
6905
|
+
var container = containerRef.current;
|
6906
|
+
if (container) {
|
6907
|
+
container.addEventListener("scroll", handleScroll);
|
6908
|
+
}
|
6909
|
+
return function () {
|
6910
|
+
if (container) {
|
6911
|
+
container.removeEventListener("scroll", handleScroll);
|
6912
|
+
}
|
6913
|
+
};
|
6914
|
+
}, [handleScroll]);
|
6915
|
+
var handleChangeStartIndex = function handleChangeStartIndex(index) {
|
6916
|
+
setStartIndex(index);
|
6917
|
+
};
|
6918
|
+
var handleChangeEndIndex = function handleChangeEndIndex(index) {
|
6919
|
+
setEndIndex(index);
|
6920
|
+
};
|
6921
|
+
return {
|
6922
|
+
startIndex: startIndex,
|
6923
|
+
endIndex: endIndex,
|
6924
|
+
containerRef: containerRef,
|
6925
|
+
handleChangeStartIndex: handleChangeStartIndex,
|
6926
|
+
handleChangeEndIndex: handleChangeEndIndex
|
6927
|
+
};
|
6835
6928
|
};
|
6836
6929
|
|
6837
|
-
var
|
6838
|
-
|
6839
|
-
|
6840
|
-
|
6841
|
-
|
6842
|
-
|
6843
|
-
|
6844
|
-
|
6845
|
-
|
6846
|
-
isTextbook = _ref.isTextbook,
|
6847
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$3);
|
6848
|
-
var _useTranslation = useTranslation(),
|
6849
|
-
t = _useTranslation.t;
|
6850
|
-
var initialValues = defaultValue !== null && typeof defaultValue !== "undefined" ? (options === null || options === void 0 ? void 0 : options.find(function (option) {
|
6851
|
-
return option.value === defaultValue;
|
6852
|
-
})) || null : null;
|
6853
|
-
var optionValue = valueById !== null && typeof valueById !== "undefined" ? (options === null || options === void 0 ? void 0 : options.find(function (option) {
|
6854
|
-
return option.value == valueById;
|
6855
|
-
})) || {
|
6856
|
-
label: valueById,
|
6857
|
-
value: valueById
|
6858
|
-
} : null;
|
6859
|
-
return isTextbook ? React__default.createElement(CreatableSelect, Object.assign({
|
6860
|
-
isDisabled: isDisabled,
|
6861
|
-
options: options,
|
6862
|
-
value: optionValue || value,
|
6863
|
-
defaultValue: initialValues,
|
6864
|
-
menuPlacement: scrollBottom ? "top" : "auto",
|
6865
|
-
isMulti: isMulti,
|
6866
|
-
components: {
|
6867
|
-
IndicatorSeparator: function IndicatorSeparator() {
|
6868
|
-
return null;
|
6869
|
-
},
|
6870
|
-
DropdownIndicator: DropdownIndicator,
|
6871
|
-
Option: CustomOption
|
6872
|
-
},
|
6873
|
-
styles: customStyles,
|
6874
|
-
placeholder: t("select_placeholder")
|
6875
|
-
}, rest)) : React__default.createElement(Select, Object.assign({
|
6876
|
-
isDisabled: isDisabled,
|
6877
|
-
options: options,
|
6878
|
-
value: optionValue || value,
|
6879
|
-
defaultValue: initialValues,
|
6880
|
-
menuPlacement: scrollBottom ? "top" : "auto",
|
6881
|
-
isMulti: isMulti,
|
6882
|
-
components: {
|
6883
|
-
IndicatorSeparator: function IndicatorSeparator() {
|
6884
|
-
return null;
|
6885
|
-
},
|
6886
|
-
DropdownIndicator: DropdownIndicator,
|
6887
|
-
Option: CustomOption
|
6888
|
-
},
|
6889
|
-
styles: customStyles,
|
6890
|
-
placeholder: t("select_placeholder")
|
6891
|
-
}, rest));
|
6892
|
-
};
|
6930
|
+
var RecentUserActionSortBy;
|
6931
|
+
(function (RecentUserActionSortBy) {
|
6932
|
+
RecentUserActionSortBy["CreatedAt"] = "CreatedAt";
|
6933
|
+
})(RecentUserActionSortBy || (RecentUserActionSortBy = {}));
|
6934
|
+
var OrderBy;
|
6935
|
+
(function (OrderBy) {
|
6936
|
+
OrderBy["ASC"] = "ASC";
|
6937
|
+
OrderBy["DESC"] = "DESC";
|
6938
|
+
})(OrderBy || (OrderBy = {}));
|
6893
6939
|
|
6894
|
-
var
|
6895
|
-
|
6896
|
-
|
6897
|
-
|
6898
|
-
|
6899
|
-
|
6900
|
-
|
6901
|
-
|
6902
|
-
|
6940
|
+
var api = axios.create({
|
6941
|
+
baseURL: BASE_URL,
|
6942
|
+
timeout: 0,
|
6943
|
+
headers: {
|
6944
|
+
"Content-Type": "application/json"
|
6945
|
+
},
|
6946
|
+
paramsSerializer: function paramsSerializer(params) {
|
6947
|
+
return encodeParams(params);
|
6948
|
+
}
|
6903
6949
|
});
|
6904
|
-
var
|
6905
|
-
|
6906
|
-
|
6907
|
-
|
6950
|
+
var apiUpload = axios.create({
|
6951
|
+
baseURL: BASE_URL,
|
6952
|
+
timeout: 60000,
|
6953
|
+
headers: {
|
6954
|
+
"Content-Type": "multipart/form-data"
|
6955
|
+
}
|
6908
6956
|
});
|
6909
|
-
|
6910
|
-
|
6911
|
-
var
|
6912
|
-
|
6913
|
-
|
6914
|
-
|
6915
|
-
|
6916
|
-
|
6917
|
-
|
6918
|
-
|
6919
|
-
|
6920
|
-
|
6921
|
-
|
6922
|
-
|
6923
|
-
|
6924
|
-
|
6957
|
+
[api, apiUpload].forEach(function (i) {
|
6958
|
+
return i.interceptors.request.use(function (config) {
|
6959
|
+
var token = getAccessToken();
|
6960
|
+
var searchParams = new URLSearchParams(window.location.search);
|
6961
|
+
var paramLang = searchParams.get('lang');
|
6962
|
+
var academyDomainStorage = getAcademyDomain();
|
6963
|
+
var isLearningSpace = getLearningSpace();
|
6964
|
+
var langStorage = getLanguage();
|
6965
|
+
var academyDomain = academyDomainStorage;
|
6966
|
+
var language = paramLang || langStorage;
|
6967
|
+
if (token) {
|
6968
|
+
config.headers.Authorization = "Bearer " + token;
|
6969
|
+
localStorage.setItem("LAST_TIME_REQUEST", moment().utc().format("YYYY-MM-DD HH:mm:ss"));
|
6970
|
+
}
|
6971
|
+
if (academyDomain && !isLearningSpace && config.headers[AcademyHeaders] == undefined) config.headers[AcademyHeaders] = "" + academyDomain;
|
6972
|
+
if (isLearningSpace && config.headers[NoAcademyHeaders] == undefined) config.headers[NoAcademyHeaders] = "" + isLearningSpace;
|
6973
|
+
if (language) config.headers[LanguageHeaders] = "" + language;
|
6974
|
+
return config;
|
6975
|
+
}, function (error) {
|
6976
|
+
return Promise.reject(error);
|
6925
6977
|
});
|
6926
|
-
|
6927
|
-
|
6928
|
-
|
6929
|
-
|
6930
|
-
|
6931
|
-
|
6978
|
+
});
|
6979
|
+
[api, apiUpload].forEach(function (i) {
|
6980
|
+
return i.interceptors.response.use(function (response) {
|
6981
|
+
return response;
|
6982
|
+
}, function (error) {
|
6983
|
+
var _error$response, _error$response2, _error$response3;
|
6984
|
+
console.log({
|
6985
|
+
error: error
|
6986
|
+
});
|
6987
|
+
if (((_error$response = error.response) === null || _error$response === void 0 ? void 0 : _error$response.status) === 401) {
|
6988
|
+
var _window$location = window.location,
|
6989
|
+
pathname = _window$location.pathname,
|
6990
|
+
search = _window$location.search;
|
6991
|
+
var preRedirectUrl = localStorage.getItem(PRE_REDIRECT_URL);
|
6992
|
+
var newRedirectUrl = "" + pathname + search;
|
6993
|
+
if (!pathname.startsWith("/login")) {
|
6994
|
+
if (preRedirectUrl !== newRedirectUrl) {
|
6995
|
+
localStorage.setItem(REDIRECT_URL, newRedirectUrl);
|
6996
|
+
localStorage.setItem(PRE_REDIRECT_URL, newRedirectUrl);
|
6997
|
+
}
|
6998
|
+
}
|
6999
|
+
}
|
7000
|
+
if (((_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : _error$response2.status) === 401 || ((_error$response3 = error.response) === null || _error$response3 === void 0 ? void 0 : _error$response3.status) == 403) {
|
7001
|
+
localStorage.removeItem(ACCESS_TOKEN);
|
7002
|
+
window.location.href = "/login";
|
7003
|
+
}
|
7004
|
+
return Promise.reject(error);
|
6932
7005
|
});
|
6933
|
-
};
|
6934
|
-
|
6935
|
-
var _excluded$4 = ["id", "value", "onChange", "isDisabled", "options", "isMulti", "placeholder"];
|
6936
|
-
var ArticleCategorySelector = function ArticleCategorySelector(_ref) {
|
6937
|
-
var id = _ref.id,
|
6938
|
-
value = _ref.value,
|
6939
|
-
onChange = _ref.onChange,
|
6940
|
-
isDisabled = _ref.isDisabled,
|
6941
|
-
options = _ref.options,
|
6942
|
-
isMulti = _ref.isMulti,
|
6943
|
-
placeholder = _ref.placeholder,
|
6944
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$4);
|
6945
|
-
var _useTranslation = useTranslation(),
|
6946
|
-
t = _useTranslation.t;
|
6947
|
-
return React__default.createElement(CustomSelect, Object.assign({
|
6948
|
-
isMulti: isMulti,
|
6949
|
-
inputId: id,
|
6950
|
-
value: value,
|
6951
|
-
options: options,
|
6952
|
-
onChange: onChange,
|
6953
|
-
isDisabled: isDisabled,
|
6954
|
-
placeholder: placeholder || t("select_category")
|
6955
|
-
}, rest));
|
6956
|
-
};
|
7006
|
+
});
|
6957
7007
|
|
6958
7008
|
var COURSE_URL = BASE_URL + "/api/course";
|
6959
7009
|
var getClassesApi = function getClassesApi(textSearch) {
|
@@ -9173,7 +9223,7 @@ var usePusherConversation = function usePusherConversation(onNewMessageConversat
|
|
9173
9223
|
return {};
|
9174
9224
|
};
|
9175
9225
|
|
9176
|
-
var config = {
|
9226
|
+
var config$1 = {
|
9177
9227
|
height: 300,
|
9178
9228
|
allowedContent: true,
|
9179
9229
|
toolbar: ["/", {
|
@@ -9205,13 +9255,16 @@ var config = {
|
|
9205
9255
|
filebrowserUploadUrl: BASE_URL + "/api/file/support-files?"
|
9206
9256
|
};
|
9207
9257
|
|
9258
|
+
var _excluded$6 = ["ref", "value", "option", "onBlur", "onFocus", "onChange", "onAfterInsertHtml", "onInsertElement", "onInsertHtml", "onInsertText", "onDataReady", "onSelectionChange", "disabled"];
|
9208
9259
|
var CkEditor = function CkEditor(_ref) {
|
9209
9260
|
var ref = _ref.ref,
|
9210
9261
|
value = _ref.value,
|
9211
|
-
onChange = _ref.onChange,
|
9212
9262
|
option = _ref.option,
|
9263
|
+
onChange = _ref.onChange,
|
9264
|
+
onDataReady = _ref.onDataReady,
|
9213
9265
|
_ref$disabled = _ref.disabled,
|
9214
|
-
disabled = _ref$disabled === void 0 ? false : _ref$disabled
|
9266
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
9267
|
+
action = _objectWithoutPropertiesLoose(_ref, _excluded$6);
|
9215
9268
|
var _React$useState = React__default.useState(null),
|
9216
9269
|
editor = _React$useState[0],
|
9217
9270
|
setEditor = _React$useState[1];
|
@@ -9223,19 +9276,20 @@ var CkEditor = function CkEditor(_ref) {
|
|
9223
9276
|
editor.setData(value);
|
9224
9277
|
}
|
9225
9278
|
}, [value, editor]);
|
9226
|
-
return React__default.createElement(CKEditor, {
|
9279
|
+
return React__default.createElement(CKEditor, Object.assign({
|
9227
9280
|
ref: ref,
|
9228
9281
|
initData: value,
|
9229
9282
|
readOnly: disabled,
|
9230
|
-
onChange: onChange,
|
9231
9283
|
onInstanceReady: handleInstanceReady,
|
9232
|
-
config: !!option ? option : config,
|
9284
|
+
config: !!option ? option : config$1,
|
9285
|
+
onDataReady: onDataReady,
|
9286
|
+
onChange: onChange,
|
9233
9287
|
onBeforeLoad: function onBeforeLoad(CKEDITOR) {
|
9234
9288
|
CKEDITOR.disableAutoInline = true;
|
9235
9289
|
CKEDITOR.config.height = 300;
|
9236
9290
|
CKEDITOR.config.enterMode = CKEDITOR.ENTER_BR;
|
9237
9291
|
}
|
9238
|
-
});
|
9292
|
+
}, action));
|
9239
9293
|
};
|
9240
9294
|
|
9241
9295
|
var ListView = function ListView(_ref) {
|
@@ -10804,10 +10858,10 @@ var LoginQRCode = function LoginQRCode(props) {
|
|
10804
10858
|
}));
|
10805
10859
|
};
|
10806
10860
|
|
10807
|
-
var _excluded$
|
10861
|
+
var _excluded$7 = ["history"];
|
10808
10862
|
var Login = function Login(_ref) {
|
10809
10863
|
var history = _ref.history,
|
10810
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
10864
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$7);
|
10811
10865
|
var _useLogin = useLogin$1({
|
10812
10866
|
homeAcademyUrl: rest.homeAcademyUrl,
|
10813
10867
|
homeUrl: rest.homeUrl,
|
@@ -11761,11 +11815,11 @@ var DEFAULT_USER_FILTERS = {
|
|
11761
11815
|
|
11762
11816
|
var styles$2 = {"avatar":"_2rJkZ","date-picker":"_1iqE2","time-picker":"_20xtc","teacher-selector-wrapper":"_3L1Oj"};
|
11763
11817
|
|
11764
|
-
var _excluded$
|
11818
|
+
var _excluded$8 = ["teachers", "value"];
|
11765
11819
|
var TeacherSelector = function TeacherSelector(_ref) {
|
11766
11820
|
var teachers = _ref.teachers,
|
11767
11821
|
value = _ref.value,
|
11768
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
11822
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$8);
|
11769
11823
|
var teacherOptions = teachers.map(function (i) {
|
11770
11824
|
return {
|
11771
11825
|
label: i.teacherName + "/" + i.teacherEmail,
|
@@ -13056,7 +13110,7 @@ var useTeacherList = function useTeacherList() {
|
|
13056
13110
|
};
|
13057
13111
|
};
|
13058
13112
|
|
13059
|
-
var _excluded$
|
13113
|
+
var _excluded$9 = ["getStudents"],
|
13060
13114
|
_excluded2 = ["getTeachers"],
|
13061
13115
|
_excluded3 = ["getLessons"];
|
13062
13116
|
var PAGE_TITLE$4 = "classes";
|
@@ -13107,7 +13161,7 @@ var useClassDetail = function useClassDetail(_ref) {
|
|
13107
13161
|
};
|
13108
13162
|
var _useStudentClassList = useStudentClassList(classId),
|
13109
13163
|
getStudents = _useStudentClassList.getStudents,
|
13110
|
-
studentListProps = _objectWithoutPropertiesLoose(_useStudentClassList, _excluded$
|
13164
|
+
studentListProps = _objectWithoutPropertiesLoose(_useStudentClassList, _excluded$9);
|
13111
13165
|
var _useTeacherClassList = useTeacherClassList(classId),
|
13112
13166
|
getTeachers = _useTeacherClassList.getTeachers,
|
13113
13167
|
teacherListProps = _objectWithoutPropertiesLoose(_useTeacherClassList, _excluded2);
|
@@ -13857,12 +13911,12 @@ var LessonList = function LessonList(_ref) {
|
|
13857
13911
|
}));
|
13858
13912
|
};
|
13859
13913
|
|
13860
|
-
var _excluded$
|
13914
|
+
var _excluded$a = ["children", "value", "index"];
|
13861
13915
|
var CustomTabPanel = function CustomTabPanel(props) {
|
13862
13916
|
var children = props.children,
|
13863
13917
|
value = props.value,
|
13864
13918
|
index = props.index,
|
13865
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
13919
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$a);
|
13866
13920
|
return React__default.createElement("div", Object.assign({
|
13867
13921
|
role: "tabpanel",
|
13868
13922
|
hidden: value !== index,
|
@@ -15968,23 +16022,29 @@ var CompareGrass = function CompareGrass(_ref2) {
|
|
15968
16022
|
textAlign: "center",
|
15969
16023
|
color: "#202B37"
|
15970
16024
|
}
|
15971
|
-
},
|
16025
|
+
}, (item === null || item === void 0 ? void 0 : item.questionAnswerType) === QuestionAnswerType.Textual ? React__default.createElement(MathJaxContainer, {
|
16026
|
+
content: item === null || item === void 0 ? void 0 : item.correctAnswers
|
16027
|
+
}) : t("number_question", {
|
15972
16028
|
number: item.correctAnswers
|
15973
16029
|
})), React__default.createElement("td", {
|
15974
16030
|
className: styles$3["tdcolumn3"],
|
15975
16031
|
style: {
|
15976
16032
|
color: item.isCorrect ? styles$3.green_support_900 : styles$3.red_900
|
15977
16033
|
}
|
15978
|
-
}, item.
|
16034
|
+
}, (item === null || item === void 0 ? void 0 : item.questionAnswerType) === QuestionAnswerType.Textual ? React__default.createElement(MathJaxContainer, {
|
16035
|
+
content: item === null || item === void 0 ? void 0 : item.selectedAnswers
|
16036
|
+
}) : t("number_question", {
|
15979
16037
|
number: item.selectedAnswers
|
15980
|
-
})
|
16038
|
+
})), React__default.createElement("td", {
|
15981
16039
|
style: {
|
15982
16040
|
textAlign: "center",
|
15983
16041
|
color: "#414E62"
|
15984
16042
|
}
|
15985
|
-
}, item.
|
16043
|
+
}, (item === null || item === void 0 ? void 0 : item.questionAnswerType) === QuestionAnswerType.Textual ? React__default.createElement(MathJaxContainer, {
|
16044
|
+
content: item === null || item === void 0 ? void 0 : item.mostSelectedAnswers
|
16045
|
+
}) : t("number_question", {
|
15986
16046
|
number: item.mostSelectedAnswers
|
15987
|
-
})
|
16047
|
+
})), React__default.createElement("td", {
|
15988
16048
|
className: "" + printStyles["avoid-break-inside"]
|
15989
16049
|
}, React__default.createElement("div", {
|
15990
16050
|
className: styles$3["classification"] + " " + printStyles["avoid-break-inside"]
|
@@ -16371,16 +16431,20 @@ var Vulnerable = function Vulnerable(_ref) {
|
|
16371
16431
|
fontSize: "13px",
|
16372
16432
|
fontWeight: 500
|
16373
16433
|
}
|
16374
|
-
}, item.
|
16434
|
+
}, (item === null || item === void 0 ? void 0 : item.questionAnswerType) === QuestionAnswerType.Textual ? React__default.createElement(MathJaxContainer, {
|
16435
|
+
content: item === null || item === void 0 ? void 0 : item.selectedAnswers
|
16436
|
+
}) : t("number_question", {
|
16375
16437
|
number: item.selectedAnswers
|
16376
|
-
})
|
16438
|
+
})), React__default.createElement("td", {
|
16377
16439
|
style: {
|
16378
16440
|
textAlign: "center",
|
16379
16441
|
color: styles$3.gray_700
|
16380
16442
|
}
|
16381
|
-
}, item.
|
16443
|
+
}, (item === null || item === void 0 ? void 0 : item.questionAnswerType) === QuestionAnswerType.Textual ? React__default.createElement(MathJaxContainer, {
|
16444
|
+
content: item === null || item === void 0 ? void 0 : item.correctAnswers
|
16445
|
+
}) : t("number_question", {
|
16382
16446
|
number: item.correctAnswers
|
16383
|
-
})
|
16447
|
+
})), React__default.createElement("td", {
|
16384
16448
|
style: {
|
16385
16449
|
textAlign: "center",
|
16386
16450
|
color: styles$3.gray_700
|
@@ -18214,16 +18278,20 @@ var TextbookVulnerable = function TextbookVulnerable(_ref) {
|
|
18214
18278
|
fontSize: "13px",
|
18215
18279
|
fontWeight: 500
|
18216
18280
|
}
|
18217
|
-
}, item.
|
18281
|
+
}, (item === null || item === void 0 ? void 0 : item.questionAnswerType) === QuestionAnswerType.Textual ? React__default.createElement(MathJaxContainer, {
|
18282
|
+
content: item === null || item === void 0 ? void 0 : item.selectedAnswers
|
18283
|
+
}) : t("number_question", {
|
18218
18284
|
number: item.selectedAnswers
|
18219
|
-
})
|
18285
|
+
})), React__default.createElement("td", {
|
18220
18286
|
style: {
|
18221
18287
|
textAlign: "center",
|
18222
18288
|
color: styles$3.gray_700
|
18223
18289
|
}
|
18224
|
-
}, item.
|
18290
|
+
}, (item === null || item === void 0 ? void 0 : item.questionAnswerType) === QuestionAnswerType.Textual ? React__default.createElement(MathJaxContainer, {
|
18291
|
+
content: item === null || item === void 0 ? void 0 : item.correctAnswers
|
18292
|
+
}) : t("number_question", {
|
18225
18293
|
number: item.correctAnswers
|
18226
|
-
})
|
18294
|
+
})), React__default.createElement("td", {
|
18227
18295
|
style: {
|
18228
18296
|
textAlign: "center",
|
18229
18297
|
color: styles$3.gray_700
|
@@ -18261,7 +18329,13 @@ var TextbookVulnerable = function TextbookVulnerable(_ref) {
|
|
18261
18329
|
className: styles$3["span2"]
|
18262
18330
|
}, t("my_wrong_answer"))), React__default.createElement("div", null, React__default.createElement("span", {
|
18263
18331
|
className: styles$3["overallCorrectRate"]
|
18264
|
-
}, question.overallCorrectRate.toFixed(2), "%"), React__default.createElement("span", {
|
18332
|
+
}, question.overallCorrectRate.toFixed(2), "%"), (question === null || question === void 0 ? void 0 : question.questionAnswerType) === QuestionAnswerType.Textual ? React__default.createElement("span", {
|
18333
|
+
className: styles$3["answer"]
|
18334
|
+
}, React__default.createElement(MathJaxContainer, {
|
18335
|
+
content: question === null || question === void 0 ? void 0 : question.selectedAnswers
|
18336
|
+
}), " ", React__default.createElement(MathJaxContainer, {
|
18337
|
+
content: question === null || question === void 0 ? void 0 : question.correctAnswers
|
18338
|
+
})) : React__default.createElement("span", {
|
18265
18339
|
className: styles$3["answer"]
|
18266
18340
|
}, t("number_question", {
|
18267
18341
|
number: question.selectedAnswers
|
@@ -20048,16 +20122,24 @@ var usePrintExamResult = function usePrintExamResult(isDataFetching, fileName, t
|
|
20048
20122
|
setPrintState(PrintState$1.Printing);
|
20049
20123
|
setTimeout(function () {
|
20050
20124
|
try {
|
20051
|
-
var
|
20125
|
+
var _temp4 = function _temp4() {
|
20052
20126
|
setPrintState(PrintState$1.Printed);
|
20053
20127
|
};
|
20054
|
-
var
|
20128
|
+
var _temp3 = _catch(function () {
|
20129
|
+
function _temp2() {
|
20130
|
+
html2pdf().from(element).set(options).save();
|
20131
|
+
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
|
20132
|
+
}
|
20055
20133
|
var element = contentRef.current;
|
20056
20134
|
var options = {
|
20057
20135
|
margin: 5,
|
20058
20136
|
filename: name + ".pdf",
|
20137
|
+
image: {
|
20138
|
+
type: "jpeg",
|
20139
|
+
quality: 1
|
20140
|
+
},
|
20059
20141
|
html2canvas: {
|
20060
|
-
scale:
|
20142
|
+
scale: 4
|
20061
20143
|
},
|
20062
20144
|
jsPDF: {
|
20063
20145
|
format: 'a4',
|
@@ -20067,14 +20149,18 @@ var usePrintExamResult = function usePrintExamResult(isDataFetching, fileName, t
|
|
20067
20149
|
mode: ['css', 'legacy']
|
20068
20150
|
}
|
20069
20151
|
};
|
20070
|
-
|
20071
|
-
|
20072
|
-
|
20152
|
+
var _temp = function (_window) {
|
20153
|
+
if ((_window = window) !== null && _window !== void 0 && _window.MathJax) {
|
20154
|
+
var _window2, _window2$MathJax, _window2$MathJax$type;
|
20155
|
+
return Promise.resolve((_window2 = window) === null || _window2 === void 0 ? void 0 : (_window2$MathJax = _window2.MathJax) === null || _window2$MathJax === void 0 ? void 0 : (_window2$MathJax$type = _window2$MathJax.typesetPromise) === null || _window2$MathJax$type === void 0 ? void 0 : _window2$MathJax$type.call(_window2$MathJax)).then(function () {});
|
20156
|
+
}
|
20157
|
+
}();
|
20158
|
+
return _temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp);
|
20073
20159
|
}, function (error) {
|
20074
20160
|
!window.opener && toast.error(getErrorMessage(t, error));
|
20075
20161
|
onError === null || onError === void 0 ? void 0 : onError(error === null || error === void 0 ? void 0 : error.message);
|
20076
20162
|
});
|
20077
|
-
return Promise.resolve(
|
20163
|
+
return Promise.resolve(_temp3 && _temp3.then ? _temp3.then(_temp4) : _temp4(_temp3));
|
20078
20164
|
} catch (e) {
|
20079
20165
|
return Promise.reject(e);
|
20080
20166
|
}
|
@@ -21092,14 +21178,14 @@ var CSV_PREFIX = "data:text/csv;charset=utf-8,";
|
|
21092
21178
|
|
21093
21179
|
var styles$5 = {"action-btn":"_1jXbz","action-btn--pencil":"_at4xP","icon-rotate-180":"_12gv9","drop-area":"_R4bn5"};
|
21094
21180
|
|
21095
|
-
var _excluded$
|
21181
|
+
var _excluded$b = ["text", "isRequired", "className"];
|
21096
21182
|
var LabelRequired = function LabelRequired(_ref) {
|
21097
21183
|
var text = _ref.text,
|
21098
21184
|
_ref$isRequired = _ref.isRequired,
|
21099
21185
|
isRequired = _ref$isRequired === void 0 ? true : _ref$isRequired,
|
21100
21186
|
_ref$className = _ref.className,
|
21101
21187
|
className = _ref$className === void 0 ? "" : _ref$className,
|
21102
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
21188
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$b);
|
21103
21189
|
return React__default.createElement(FormLabel, Object.assign({
|
21104
21190
|
className: "fw-medium mb-1 " + className
|
21105
21191
|
}, rest), text, isRequired && React__default.createElement("span", {
|
@@ -21153,7 +21239,7 @@ var deleteUserApi = function deleteUserApi(id) {
|
|
21153
21239
|
return api["delete"](USER_URL + "/delete/" + id);
|
21154
21240
|
};
|
21155
21241
|
|
21156
|
-
var _excluded$
|
21242
|
+
var _excluded$c = ["ref"],
|
21157
21243
|
_excluded2$1 = ["ref"],
|
21158
21244
|
_excluded3$1 = ["ref"],
|
21159
21245
|
_excluded4 = ["ref"],
|
@@ -21183,7 +21269,7 @@ var UserDialog = function UserDialog(_ref) {
|
|
21183
21269
|
t = _useTranslation.t;
|
21184
21270
|
var _register = register("fullName"),
|
21185
21271
|
fullNameRef = _register.ref,
|
21186
|
-
fullNameBio = _objectWithoutPropertiesLoose(_register, _excluded$
|
21272
|
+
fullNameBio = _objectWithoutPropertiesLoose(_register, _excluded$c);
|
21187
21273
|
var _register2 = register("email"),
|
21188
21274
|
emailRef = _register2.ref,
|
21189
21275
|
emailBio = _objectWithoutPropertiesLoose(_register2, _excluded2$1);
|
@@ -24969,12 +25055,12 @@ var ArticleDialog = function ArticleDialog(_ref) {
|
|
24969
25055
|
|
24970
25056
|
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"};
|
24971
25057
|
|
24972
|
-
var _excluded$
|
25058
|
+
var _excluded$d = ["isOpen", "onClose", "handleSaveExam"];
|
24973
25059
|
var CreateExamDrawer = function CreateExamDrawer(props) {
|
24974
25060
|
var isOpen = props.isOpen,
|
24975
25061
|
onClose = props.onClose,
|
24976
25062
|
handleSaveExam = props.handleSaveExam,
|
24977
|
-
examDetailViewProps = _objectWithoutPropertiesLoose(props, _excluded$
|
25063
|
+
examDetailViewProps = _objectWithoutPropertiesLoose(props, _excluded$d);
|
24978
25064
|
var _useTranslation = useTranslation(),
|
24979
25065
|
t = _useTranslation.t;
|
24980
25066
|
var theme = useTheme();
|
@@ -26042,12 +26128,12 @@ var useNotificationDetail = function useNotificationDetail(_ref) {
|
|
26042
26128
|
|
26043
26129
|
var styles$8 = {"avatar":"_8niRT"};
|
26044
26130
|
|
26045
|
-
var _excluded$
|
26131
|
+
var _excluded$e = ["value", "disabled", "optionTypeNotification"];
|
26046
26132
|
var TypeSelector = function TypeSelector(_ref) {
|
26047
26133
|
var value = _ref.value,
|
26048
26134
|
disabled = _ref.disabled,
|
26049
26135
|
optionTypeNotification = _ref.optionTypeNotification,
|
26050
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
26136
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$e);
|
26051
26137
|
return React__default.createElement(CustomAsyncSelect, Object.assign({
|
26052
26138
|
options: optionTypeNotification,
|
26053
26139
|
value: value
|
@@ -26439,11 +26525,11 @@ var useNotificationList = function useNotificationList(_ref) {
|
|
26439
26525
|
};
|
26440
26526
|
};
|
26441
26527
|
|
26442
|
-
var _excluded$
|
26528
|
+
var _excluded$f = ["value", "optionTypeNotification"];
|
26443
26529
|
var SelectFilterType = function SelectFilterType(_ref) {
|
26444
26530
|
var value = _ref.value,
|
26445
26531
|
optionTypeNotification = _ref.optionTypeNotification,
|
26446
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
26532
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$f);
|
26447
26533
|
return React__default.createElement(CustomAsyncSelect, Object.assign({
|
26448
26534
|
options: optionTypeNotification,
|
26449
26535
|
value: value
|
@@ -26665,7 +26751,9 @@ var DefaultQuestion = {
|
|
26665
26751
|
title: "",
|
26666
26752
|
author: "",
|
26667
26753
|
subjectId: null,
|
26668
|
-
preparedType: null
|
26754
|
+
preparedType: null,
|
26755
|
+
questionAnswerType: QuestionAnswerType.ChoiceOption,
|
26756
|
+
textualAnswer: ""
|
26669
26757
|
};
|
26670
26758
|
var DefaultArticle = {
|
26671
26759
|
answerCount: 5,
|
@@ -28018,7 +28106,7 @@ var useTextbookManagement = function useTextbookManagement(_ref) {
|
|
28018
28106
|
};
|
28019
28107
|
};
|
28020
28108
|
|
28021
|
-
var _excluded$
|
28109
|
+
var _excluded$g = ["value"],
|
28022
28110
|
_excluded2$2 = ["onChange"],
|
28023
28111
|
_excluded3$2 = ["onChange"];
|
28024
28112
|
var VisuallyHiddenInput = styled("input")({
|
@@ -28283,7 +28371,7 @@ var PreparedTextbook = function PreparedTextbook(_ref) {
|
|
28283
28371
|
render: function render(_ref4) {
|
28284
28372
|
var _ref4$field = _ref4.field,
|
28285
28373
|
value = _ref4$field.value,
|
28286
|
-
action = _objectWithoutPropertiesLoose(_ref4$field, _excluded$
|
28374
|
+
action = _objectWithoutPropertiesLoose(_ref4$field, _excluded$g);
|
28287
28375
|
return React__default.createElement(LocalizationProvider$1, {
|
28288
28376
|
dateAdapter: AdapterMoment
|
28289
28377
|
}, React__default.createElement(DatePicker$1, Object.assign({}, action, {
|
@@ -28494,10 +28582,22 @@ var PreparedTextbook = function PreparedTextbook(_ref) {
|
|
28494
28582
|
fontSize: "16px"
|
28495
28583
|
}, t("chapter_number", {
|
28496
28584
|
number: chapterIndex + 1
|
28497
|
-
})), React__default.createElement(
|
28585
|
+
})), React__default.createElement(Stack, {
|
28586
|
+
flexDirection: "row",
|
28587
|
+
gap: "8px"
|
28588
|
+
}, React__default.createElement(Typography, {
|
28498
28589
|
fontWeight: 700,
|
28499
28590
|
fontSize: "16px"
|
28500
|
-
}, chapter.pageFrom + " - " + chapter.pageTo)
|
28591
|
+
}, chapter.pageFrom + " - " + chapter.pageTo), React__default.createElement(IconButton, {
|
28592
|
+
onClick: function onClick(e) {
|
28593
|
+
e.stopPropagation();
|
28594
|
+
arrayHelpers.remove(chapterIndex);
|
28595
|
+
},
|
28596
|
+
color: "default",
|
28597
|
+
className: " bg-danger text-white"
|
28598
|
+
}, React__default.createElement(FaTrashCan, {
|
28599
|
+
size: 12
|
28600
|
+
})))));
|
28501
28601
|
}));
|
28502
28602
|
}
|
28503
28603
|
}), textbookState.position === TextbookState.Chapter && React__default.createElement(Chapter, {
|
@@ -29768,7 +29868,7 @@ var ChapterProblemSolvingResultsDialog = function ChapterProblemSolvingResultsDi
|
|
29768
29868
|
}, t("cancel"))))));
|
29769
29869
|
};
|
29770
29870
|
|
29771
|
-
var _excluded$
|
29871
|
+
var _excluded$h = ["onChange"];
|
29772
29872
|
var StartPageDialog = function StartPageDialog(_ref) {
|
29773
29873
|
var t = _ref.t,
|
29774
29874
|
onClose = _ref.onClose,
|
@@ -29829,7 +29929,7 @@ var StartPageDialog = function StartPageDialog(_ref) {
|
|
29829
29929
|
}, t("page_to_start_with")), React__default.createElement(Field, {
|
29830
29930
|
name: "startPage",
|
29831
29931
|
render: function render(_ref3) {
|
29832
|
-
var field = _objectWithoutPropertiesLoose(_ref3, _excluded$
|
29932
|
+
var field = _objectWithoutPropertiesLoose(_ref3, _excluded$h);
|
29833
29933
|
return React__default.createElement(CustomSelectOption, Object.assign({
|
29834
29934
|
menuPosition: "fixed",
|
29835
29935
|
onChange: function onChange(option) {
|
@@ -32354,5 +32454,5 @@ var LayoutContext = function LayoutContext(_ref) {
|
|
32354
32454
|
});else return React__default.createElement(Fragment$1, null, children);
|
32355
32455
|
};
|
32356
32456
|
|
32357
|
-
export { ACADEMY_DOMAIN, ACCESS_TOKEN, AcademyHeaders, AcademyList, AcceptNoAcademy, ActionButtons, AnswerCountSelector, ArticleCategorySelector, ArticleDialog, ArticleGroupView, BASE_URL, ChapterBox, ChatContainer, types as ChatTypes, CkEditor, 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, EXAM_CHANNEL, EXAM_STUDENT_CHANNEL, ExamDetailView, ExamEvent, ExamNoteDialog, ExamResultV2, ExamStatus, GOOGLE_CLIENT_ID, GOOGLE_RECAPTCHA_ID, GOOGLE_RECAPTCHA_KEY, GOOGLE_RECAPTCHA_SECRET, Header, InputText, LANGUAGE, LEARNING_SPACE, Language, LanguageHeaders, LayoutContext, ListView, Loading, LoadingComponent, Login, LoginQRCode, LoginWithEmail, SignIn as LoginWithPassword, NewNoteButton, NoAcademyHeaders, NotFound, NotesContainer, NotificationDetail, NotificationList, OrderBy, OrderType, PRE_REDIRECT_URL, PUSHER_CONFIG, PassCodeCheck, PassCodeDialog, PreparedItem, PreparedTextbook, PreparedTextbookList, PreparedType, PrintContainerClassName, PrintContentClassName, PrintExamResultView, PrintExamView2, PrintHeaderClassName, PrintTitleClassName, QRCodeConfirmation, QuestionCountSelector, REDIRECT_URL, RELEASE_DATE, RecentUserAction, RecentUserActionNames, RecentUserActionSortBy, ReleaseAlert, Role, SUPER_ADMIN_BASE_URL, ScoreSelector, SearchInput, ShareToTeacherDialog, StudentSelector, SubjectSelector, TextbookActionButtons, TextbookViewDetail as TextbookDetail, TextbookDrawer, TextbookList, TheAcademyDropdown, TheLanguageDropdown, 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 };
|
32457
|
+
export { ACADEMY_DOMAIN, ACCESS_TOKEN, AcademyHeaders, AcademyList, AcceptNoAcademy, ActionButtons, AnswerCountSelector, ArticleCategorySelector, ArticleDialog, ArticleGroupView, BASE_URL, ChapterBox, ChatContainer, types as ChatTypes, CkEditor, 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, EXAM_CHANNEL, EXAM_STUDENT_CHANNEL, ExamDetailView, ExamEvent, ExamNoteDialog, ExamResultV2, ExamStatus, GOOGLE_CLIENT_ID, GOOGLE_RECAPTCHA_ID, GOOGLE_RECAPTCHA_KEY, GOOGLE_RECAPTCHA_SECRET, Header, InputText, LANGUAGE, LEARNING_SPACE, Language, LanguageHeaders, LayoutContext, ListView, Loading, LoadingComponent, Login, LoginQRCode, LoginWithEmail, SignIn as LoginWithPassword, MathJaxContainer, NewNoteButton, NoAcademyHeaders, NotFound, NotesContainer, NotificationDetail, NotificationList, OrderBy, OrderType, PRE_REDIRECT_URL, PUSHER_CONFIG, PassCodeCheck, PassCodeDialog, PreparedItem, PreparedTextbook, PreparedTextbookList, PreparedType, PrintContainerClassName, PrintContentClassName, PrintExamResultView, PrintExamView2, PrintHeaderClassName, PrintTitleClassName, QRCodeConfirmation, QuestionAnswerType, QuestionCountSelector, REDIRECT_URL, RELEASE_DATE, RecentUserAction, RecentUserActionNames, RecentUserActionSortBy, ReleaseAlert, Role, SUPER_ADMIN_BASE_URL, ScoreSelector, SearchInput, ShareToTeacherDialog, StudentSelector, SubjectSelector, TextbookActionButtons, TextbookViewDetail as TextbookDetail, TextbookDrawer, TextbookList, TheAcademyDropdown, TheLanguageDropdown, 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 };
|
32358
32458
|
//# sourceMappingURL=index.modern.js.map
|