mario-core 2.9.409-feedback → 2.9.411-feedback
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/containers/Login/views/block/BlockAssignTeacherByCode.d.ts +8 -0
- package/dist/index.js +518 -468
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +521 -471
- package/dist/index.modern.js.map +1 -1
- package/package.json +105 -105
package/dist/index.modern.js
CHANGED
|
@@ -2,8 +2,8 @@ import 'bootstrap/dist/css/bootstrap.min.css';
|
|
|
2
2
|
import i18n from 'i18next';
|
|
3
3
|
import { initReactI18next, useTranslation } from 'react-i18next';
|
|
4
4
|
export { I18nextProvider, useTranslation } from 'react-i18next';
|
|
5
|
-
import React, { useCallback, useState, useEffect, useRef,
|
|
6
|
-
import { Input, Form, FormGroup, Row, Col, Navbar, NavbarBrand, Collapse, Nav, NavItem, NavLink, Dropdown, DropdownToggle, DropdownMenu, DropdownItem,
|
|
5
|
+
import React, { useCallback, useState, useEffect, useRef, Suspense, memo, Fragment, forwardRef, useImperativeHandle, useMemo } from 'react';
|
|
6
|
+
import { Input, Form, FormGroup, Row, Col, Navbar, NavbarBrand, Collapse, Nav, NavItem, NavLink, Dropdown, DropdownToggle, DropdownMenu, DropdownItem, Button, Alert, Pagination, PaginationItem, PaginationLink, Table, Label, Modal, ModalHeader, ModalBody, ModalFooter, Popover, PopoverBody, TabContent, TabPane, Card, CardBody, CardText, Tooltip, CustomInput, CardImg, CardTitle, CardHeader } from 'reactstrap';
|
|
7
7
|
import { Link, useLocation, useHistory, Switch, Route, Prompt, useParams } from 'react-router-dom';
|
|
8
8
|
import { useDispatch, useSelector } from 'react-redux';
|
|
9
9
|
import { Formik } from 'formik';
|
|
@@ -17,7 +17,7 @@ import { track, setSessionId, init, Identify, identify } from '@amplitude/analyt
|
|
|
17
17
|
import moment from 'moment';
|
|
18
18
|
import { LogLevel, PublicClientApplication } from '@azure/msal-browser';
|
|
19
19
|
import { GiHamburgerMenu } from 'react-icons/gi';
|
|
20
|
-
import { CSidebar, CSidebarBrand, CSidebarNav, CCreateElement, CSidebarNavDivider, CSidebarNavDropdown, CSidebarNavItem, CSidebarNavTitle, CSidebarFooter, CHeader, CToggler, CHeaderBrand, CHeaderNav
|
|
20
|
+
import { CSidebar, CSidebarBrand, CSidebarNav, CCreateElement, CSidebarNavDivider, CSidebarNavDropdown, CSidebarNavItem, CSidebarNavTitle, CSidebarFooter, CContainer, CHeader, CToggler, CHeaderBrand, CHeaderNav } from '@coreui/react';
|
|
21
21
|
import { CgMenuRight } from 'react-icons/cg';
|
|
22
22
|
import { RiLogoutBoxRLine } from 'react-icons/ri';
|
|
23
23
|
import Pusher from 'pusher-js/with-encryption';
|
|
@@ -844,7 +844,7 @@ var email_notifications = "Email Notifications";
|
|
|
844
844
|
var turn_on_all_emails = "Turn on all emails";
|
|
845
845
|
var a_student_responds_to_a_1_1_readiness_to_learn_with_no = "A student responds to a 1-1 Readiness to Learn with “NO”";
|
|
846
846
|
var a_student_reported_a_low_safety_score_on_a_check_in = "A student reported a low safety score on a check-in";
|
|
847
|
-
var continue_as = "Continue as
|
|
847
|
+
var continue_as = "Continue as";
|
|
848
848
|
var admin = "Admin";
|
|
849
849
|
var counselor = "Counselor";
|
|
850
850
|
var support_teacher = "SupportTeacher";
|
|
@@ -2034,6 +2034,7 @@ var your_survey_was_sent_to_x_students_and_y_staff_members_you_can_keep_track_of
|
|
|
2034
2034
|
var leave = "leave";
|
|
2035
2035
|
var go_to_the_survey_dashboard = "Go to the Survey Dashboard";
|
|
2036
2036
|
var my_dashboard = "My Dashboard";
|
|
2037
|
+
var nice_choice_what_area_of_category_would_you_like_to_work_on = "Nice choice! What area of {{category}} would you like to work on?";
|
|
2037
2038
|
var nice_choice_what_area_of_academics_would_you_like_to_work_on = "Nice choice! What area of Academics would you like to work on?";
|
|
2038
2039
|
var nice_choice_what_area_of_organization_would_you_like_to_work_on = "Nice choice! What area of Organization would you like to work on?";
|
|
2039
2040
|
var nice_choice_what_area_of_focus_would_you_like_to_work_on = "Nice choice! What area of Focus would you like to work on?";
|
|
@@ -2182,6 +2183,10 @@ var type_the_main_focus_of_this_session = "Type the main focus of this session";
|
|
|
2182
2183
|
var please_add_title_note = "Please add note title";
|
|
2183
2184
|
var notes_and_logs = "Notes and Logs";
|
|
2184
2185
|
var school_monthly_usage = "School Monthly Usage";
|
|
2186
|
+
var location$1 = "Location";
|
|
2187
|
+
var edit_my_profile = "Edit My Profile";
|
|
2188
|
+
var save_new_password = "Save new password";
|
|
2189
|
+
var teacher_code = "Teacher code";
|
|
2185
2190
|
var lang_us = {
|
|
2186
2191
|
dashboard: dashboard,
|
|
2187
2192
|
user: user,
|
|
@@ -4220,6 +4225,7 @@ var lang_us = {
|
|
|
4220
4225
|
leave: leave,
|
|
4221
4226
|
go_to_the_survey_dashboard: go_to_the_survey_dashboard,
|
|
4222
4227
|
my_dashboard: my_dashboard,
|
|
4228
|
+
nice_choice_what_area_of_category_would_you_like_to_work_on: nice_choice_what_area_of_category_would_you_like_to_work_on,
|
|
4223
4229
|
"nice_choice_what_area_of_well-being_would_you_like_to_work_on": "Nice choice! What area of Well-being would you like to work on?",
|
|
4224
4230
|
nice_choice_what_area_of_academics_would_you_like_to_work_on: nice_choice_what_area_of_academics_would_you_like_to_work_on,
|
|
4225
4231
|
nice_choice_what_area_of_organization_would_you_like_to_work_on: nice_choice_what_area_of_organization_would_you_like_to_work_on,
|
|
@@ -4380,7 +4386,11 @@ var lang_us = {
|
|
|
4380
4386
|
type_the_main_focus_of_this_session: type_the_main_focus_of_this_session,
|
|
4381
4387
|
please_add_title_note: please_add_title_note,
|
|
4382
4388
|
notes_and_logs: notes_and_logs,
|
|
4383
|
-
school_monthly_usage: school_monthly_usage
|
|
4389
|
+
school_monthly_usage: school_monthly_usage,
|
|
4390
|
+
location: location$1,
|
|
4391
|
+
edit_my_profile: edit_my_profile,
|
|
4392
|
+
save_new_password: save_new_password,
|
|
4393
|
+
teacher_code: teacher_code
|
|
4384
4394
|
};
|
|
4385
4395
|
|
|
4386
4396
|
var dashboard$1 = "Dashboard";
|
|
@@ -5192,7 +5202,7 @@ var email_notifications$1 = "Email Notifications";
|
|
|
5192
5202
|
var turn_on_all_emails$1 = "Turn on all emails";
|
|
5193
5203
|
var a_student_responds_to_a_1_1_readiness_to_learn_with_no$1 = "A student responds to a 1-1 Readiness to Learn with “NO”";
|
|
5194
5204
|
var a_student_reported_a_low_safety_score_on_a_check_in$1 = "A student reported a low safety score on a check-in";
|
|
5195
|
-
var continue_as$1 = "Continue as
|
|
5205
|
+
var continue_as$1 = "Continue as";
|
|
5196
5206
|
var admin$1 = "Admin";
|
|
5197
5207
|
var counselor$1 = "Counselor";
|
|
5198
5208
|
var support_teacher$1 = "SupportTeacher";
|
|
@@ -6381,6 +6391,7 @@ var your_survey_was_sent_to_x_students_and_y_staff_members_you_can_keep_track_of
|
|
|
6381
6391
|
var leave$1 = "leave";
|
|
6382
6392
|
var go_to_the_survey_dashboard$1 = "Go to the Survey Dashboard";
|
|
6383
6393
|
var my_dashboard$1 = "My Dashboard";
|
|
6394
|
+
var nice_choice_what_area_of_category_would_you_like_to_work_on$1 = "Nice choice! What area of {{category}} would you like to work on?";
|
|
6384
6395
|
var nice_choice_what_area_of_academics_would_you_like_to_work_on$1 = "Nice choice! What area of Academics would you like to work on?";
|
|
6385
6396
|
var nice_choice_what_area_of_organization_would_you_like_to_work_on$1 = "Nice choice! What area of Organization would you like to work on?";
|
|
6386
6397
|
var nice_choice_what_area_of_focus_would_you_like_to_work_on$1 = "Nice choice! What area of Focus would you like to work on?";
|
|
@@ -6527,6 +6538,10 @@ var type_the_main_focus_of_this_session$1 = "Type the main focus of this session
|
|
|
6527
6538
|
var please_add_title_note$1 = "Please add note title";
|
|
6528
6539
|
var notes_and_logs$1 = "Notes and Logs";
|
|
6529
6540
|
var school_monthly_usage$1 = "School Monthly Usage";
|
|
6541
|
+
var location$2 = "Location";
|
|
6542
|
+
var edit_my_profile$1 = "Edit My Profile";
|
|
6543
|
+
var save_new_password$1 = "Save new password";
|
|
6544
|
+
var teacher_code$1 = "Teacher code";
|
|
6530
6545
|
var lang_uk = {
|
|
6531
6546
|
dashboard: dashboard$1,
|
|
6532
6547
|
user: user$1,
|
|
@@ -8565,6 +8580,7 @@ var lang_uk = {
|
|
|
8565
8580
|
leave: leave$1,
|
|
8566
8581
|
go_to_the_survey_dashboard: go_to_the_survey_dashboard$1,
|
|
8567
8582
|
my_dashboard: my_dashboard$1,
|
|
8583
|
+
nice_choice_what_area_of_category_would_you_like_to_work_on: nice_choice_what_area_of_category_would_you_like_to_work_on$1,
|
|
8568
8584
|
"nice_choice_what_area_of_well-being_would_you_like_to_work_on": "Nice choice! What area of Well-being would you like to work on?",
|
|
8569
8585
|
nice_choice_what_area_of_academics_would_you_like_to_work_on: nice_choice_what_area_of_academics_would_you_like_to_work_on$1,
|
|
8570
8586
|
nice_choice_what_area_of_organization_would_you_like_to_work_on: nice_choice_what_area_of_organization_would_you_like_to_work_on$1,
|
|
@@ -8723,7 +8739,11 @@ var lang_uk = {
|
|
|
8723
8739
|
type_the_main_focus_of_this_session: type_the_main_focus_of_this_session$1,
|
|
8724
8740
|
please_add_title_note: please_add_title_note$1,
|
|
8725
8741
|
notes_and_logs: notes_and_logs$1,
|
|
8726
|
-
school_monthly_usage: school_monthly_usage$1
|
|
8742
|
+
school_monthly_usage: school_monthly_usage$1,
|
|
8743
|
+
location: location$2,
|
|
8744
|
+
edit_my_profile: edit_my_profile$1,
|
|
8745
|
+
save_new_password: save_new_password$1,
|
|
8746
|
+
teacher_code: teacher_code$1
|
|
8727
8747
|
};
|
|
8728
8748
|
|
|
8729
8749
|
var dashboard$2 = "لوحة المعلومات";
|
|
@@ -9532,7 +9552,7 @@ var email_notifications$2 = "إشعارات البريد الإلكتروني";
|
|
|
9532
9552
|
var turn_on_all_emails$2 = "تشغيل جميع عناوين البريد الإلكتروني";
|
|
9533
9553
|
var a_student_responds_to_a_1_1_readiness_to_learn_with_no$2 = "استجابة طالب للاستعداد للتعلم في المحادثة الفردية بـ \"لا\"";
|
|
9534
9554
|
var a_student_reported_a_low_safety_score_on_a_check_in$2 = "إبلاغ طالب عن انخفاض درجة السلامة عند تسجيل حضوره";
|
|
9535
|
-
var continue_as$2 = "الاستمرار
|
|
9555
|
+
var continue_as$2 = "الاستمرار كـ";
|
|
9536
9556
|
var admin$2 = "المدير";
|
|
9537
9557
|
var counselor$2 = "المستشار";
|
|
9538
9558
|
var support_teacher$2 = "معلِّم الدعم";
|
|
@@ -10756,6 +10776,7 @@ var your_survey_was_sent_to_x_students_and_y_staff_members_you_can_keep_track_of
|
|
|
10756
10776
|
var leave$2 = "يترك";
|
|
10757
10777
|
var go_to_the_survey_dashboard$2 = "انتقل إلى لوحة معلومات الاستطلاع";
|
|
10758
10778
|
var my_dashboard$2 = "لوحة التحكم الخاصة بي";
|
|
10779
|
+
var nice_choice_what_area_of_category_would_you_like_to_work_on$2 = "اختيار جميل! ما هو مجال {{category}} الذي ترغب في العمل عليه؟";
|
|
10759
10780
|
var nice_choice_what_area_of_academics_would_you_like_to_work_on$2 = "اختيار جميل! ما هو المجال الأكاديمي الذي ترغب بالعمل فيه؟";
|
|
10760
10781
|
var nice_choice_what_area_of_organization_would_you_like_to_work_on$2 = "اختيار جميل! في أي مجال من مجالات المنظمة تود العمل؟";
|
|
10761
10782
|
var nice_choice_what_area_of_focus_would_you_like_to_work_on$2 = "اختيار جميل! ما هو مجال التركيز الذي ترغب في العمل عليه؟";
|
|
@@ -10900,6 +10921,10 @@ var type_the_main_focus_of_this_session$2 = "Type the main focus of this session
|
|
|
10900
10921
|
var please_add_title_note$2 = "Please add note title";
|
|
10901
10922
|
var notes_and_logs$2 = "Notes and Logs";
|
|
10902
10923
|
var school_monthly_usage$2 = "School Monthly Usage";
|
|
10924
|
+
var location$3 = "Location";
|
|
10925
|
+
var edit_my_profile$2 = "Edit My Profile";
|
|
10926
|
+
var save_new_password$2 = "Save new password";
|
|
10927
|
+
var teacher_code$2 = "Teacher code";
|
|
10903
10928
|
var lang_ar = {
|
|
10904
10929
|
dashboard: dashboard$2,
|
|
10905
10930
|
user: user$2,
|
|
@@ -12972,6 +12997,7 @@ var lang_ar = {
|
|
|
12972
12997
|
leave: leave$2,
|
|
12973
12998
|
go_to_the_survey_dashboard: go_to_the_survey_dashboard$2,
|
|
12974
12999
|
my_dashboard: my_dashboard$2,
|
|
13000
|
+
nice_choice_what_area_of_category_would_you_like_to_work_on: nice_choice_what_area_of_category_would_you_like_to_work_on$2,
|
|
12975
13001
|
"nice_choice_what_area_of_well-being_would_you_like_to_work_on": "اختيار جميل! ما هو مجال الصحة والرفاهية الذي ترغب في العمل فيه؟",
|
|
12976
13002
|
nice_choice_what_area_of_academics_would_you_like_to_work_on: nice_choice_what_area_of_academics_would_you_like_to_work_on$2,
|
|
12977
13003
|
nice_choice_what_area_of_organization_would_you_like_to_work_on: nice_choice_what_area_of_organization_would_you_like_to_work_on$2,
|
|
@@ -13128,7 +13154,11 @@ var lang_ar = {
|
|
|
13128
13154
|
type_the_main_focus_of_this_session: type_the_main_focus_of_this_session$2,
|
|
13129
13155
|
please_add_title_note: please_add_title_note$2,
|
|
13130
13156
|
notes_and_logs: notes_and_logs$2,
|
|
13131
|
-
school_monthly_usage: school_monthly_usage$2
|
|
13157
|
+
school_monthly_usage: school_monthly_usage$2,
|
|
13158
|
+
location: location$3,
|
|
13159
|
+
edit_my_profile: edit_my_profile$2,
|
|
13160
|
+
save_new_password: save_new_password$2,
|
|
13161
|
+
teacher_code: teacher_code$2
|
|
13132
13162
|
};
|
|
13133
13163
|
|
|
13134
13164
|
var dashboard$3 = "Cuadro de mandos";
|
|
@@ -13937,7 +13967,7 @@ var email_notifications$3 = "Notificaciones por correo electrónico";
|
|
|
13937
13967
|
var turn_on_all_emails$3 = "Active todos los correos electrónicos";
|
|
13938
13968
|
var a_student_responds_to_a_1_1_readiness_to_learn_with_no$3 = "Un estudiante responde a un 1-1 Preparación para aprender con un No";
|
|
13939
13969
|
var a_student_reported_a_low_safety_score_on_a_check_in$3 = "Un estudiante informó de una puntuación de seguridad baja en un registro";
|
|
13940
|
-
var continue_as$3 = "Continuar como
|
|
13970
|
+
var continue_as$3 = "Continuar como";
|
|
13941
13971
|
var admin$3 = "Administrador";
|
|
13942
13972
|
var counselor$3 = "Consejero";
|
|
13943
13973
|
var support_teacher$3 = "Profesor de apoyo";
|
|
@@ -15161,6 +15191,7 @@ var your_survey_was_sent_to_x_students_and_y_staff_members_you_can_keep_track_of
|
|
|
15161
15191
|
var leave$3 = "dejar";
|
|
15162
15192
|
var go_to_the_survey_dashboard$3 = "Ir al panel de encuestas";
|
|
15163
15193
|
var my_dashboard$3 = "Mi panel de control";
|
|
15194
|
+
var nice_choice_what_area_of_category_would_you_like_to_work_on$3 = "¡Buena elección! ¿En qué área de {{category}} te gustaría trabajar?";
|
|
15164
15195
|
var nice_choice_what_area_of_academics_would_you_like_to_work_on$3 = "¡Chica Nick! Y veo si tienes estudios académicos y un hijo tuyo, Taher, ¿tienes algún trabajo?";
|
|
15165
15196
|
var nice_choice_what_area_of_organization_would_you_like_to_work_on$3 = "¡Chica Nick! Y a ver si ya estás arreglando y tienes un hijo, tienes un papel?";
|
|
15166
15197
|
var nice_choice_what_area_of_focus_would_you_like_to_work_on$3 = "¡Chica Nick! Y a ver si Fox y su hijo son como tú, Taher, ¿qué pasa?";
|
|
@@ -15305,6 +15336,10 @@ var type_the_main_focus_of_this_session$3 = "Type the main focus of this session
|
|
|
15305
15336
|
var please_add_title_note$3 = "Please add note title";
|
|
15306
15337
|
var notes_and_logs$3 = "Notes and Logs";
|
|
15307
15338
|
var school_monthly_usage$3 = "School Monthly Usage";
|
|
15339
|
+
var location$4 = "Location";
|
|
15340
|
+
var edit_my_profile$3 = "Edit My Profile";
|
|
15341
|
+
var save_new_password$3 = "Save new password";
|
|
15342
|
+
var teacher_code$3 = "Teacher code";
|
|
15308
15343
|
var lang_es = {
|
|
15309
15344
|
dashboard: dashboard$3,
|
|
15310
15345
|
user: user$3,
|
|
@@ -17377,6 +17412,7 @@ var lang_es = {
|
|
|
17377
17412
|
leave: leave$3,
|
|
17378
17413
|
go_to_the_survey_dashboard: go_to_the_survey_dashboard$3,
|
|
17379
17414
|
my_dashboard: my_dashboard$3,
|
|
17415
|
+
nice_choice_what_area_of_category_would_you_like_to_work_on: nice_choice_what_area_of_category_would_you_like_to_work_on$3,
|
|
17380
17416
|
"nice_choice_what_area_of_well-being_would_you_like_to_work_on": "¡Buena elección! ¿En qué área del bienestar te gustaría trabajar?",
|
|
17381
17417
|
nice_choice_what_area_of_academics_would_you_like_to_work_on: nice_choice_what_area_of_academics_would_you_like_to_work_on$3,
|
|
17382
17418
|
nice_choice_what_area_of_organization_would_you_like_to_work_on: nice_choice_what_area_of_organization_would_you_like_to_work_on$3,
|
|
@@ -17533,7 +17569,11 @@ var lang_es = {
|
|
|
17533
17569
|
type_the_main_focus_of_this_session: type_the_main_focus_of_this_session$3,
|
|
17534
17570
|
please_add_title_note: please_add_title_note$3,
|
|
17535
17571
|
notes_and_logs: notes_and_logs$3,
|
|
17536
|
-
school_monthly_usage: school_monthly_usage$3
|
|
17572
|
+
school_monthly_usage: school_monthly_usage$3,
|
|
17573
|
+
location: location$4,
|
|
17574
|
+
edit_my_profile: edit_my_profile$3,
|
|
17575
|
+
save_new_password: save_new_password$3,
|
|
17576
|
+
teacher_code: teacher_code$3
|
|
17537
17577
|
};
|
|
17538
17578
|
|
|
17539
17579
|
var dashboard$4 = "仪表板";
|
|
@@ -18342,7 +18382,7 @@ var email_notifications$4 = "电子邮件通知";
|
|
|
18342
18382
|
var turn_on_all_emails$4 = "打开所有电子邮件";
|
|
18343
18383
|
var a_student_responds_to_a_1_1_readiness_to_learn_with_no$4 = "学生对 1-1 学习准备度的回复为“否”";
|
|
18344
18384
|
var a_student_reported_a_low_safety_score_on_a_check_in$4 = "学生在签到时报告安全分数低";
|
|
18345
|
-
var continue_as$4 = "
|
|
18385
|
+
var continue_as$4 = "继续担任";
|
|
18346
18386
|
var admin$4 = "管理员";
|
|
18347
18387
|
var counselor$4 = "辅导员";
|
|
18348
18388
|
var support_teacher$4 = "支持老师";
|
|
@@ -19566,6 +19606,7 @@ var your_survey_was_sent_to_x_students_and_y_staff_members_you_can_keep_track_of
|
|
|
19566
19606
|
var leave$4 = "离开";
|
|
19567
19607
|
var go_to_the_survey_dashboard$4 = "前往调查仪表板";
|
|
19568
19608
|
var my_dashboard$4 = "我的仪表板";
|
|
19609
|
+
var nice_choice_what_area_of_category_would_you_like_to_work_on$4 = "不错的选择!您想在哪个{{category}}领域开展工作?";
|
|
19569
19610
|
var nice_choice_what_area_of_academics_would_you_like_to_work_on$4 = "尼克·奇克!我看到如果你有学者和你的儿子塔希尔,你有论文吗?";
|
|
19570
19611
|
var nice_choice_what_area_of_organization_would_you_like_to_work_on$4 = "尼克·奇克!让我看看,如果您正在安排,并且您有一个儿子,您有文件吗?";
|
|
19571
19612
|
var nice_choice_what_area_of_focus_would_you_like_to_work_on$4 = "不错的选择!您希望在哪个重点领域开展工作?";
|
|
@@ -19710,6 +19751,10 @@ var type_the_main_focus_of_this_session$4 = "Type the main focus of this session
|
|
|
19710
19751
|
var please_add_title_note$4 = "Please add note title";
|
|
19711
19752
|
var notes_and_logs$4 = "Notes and Logs";
|
|
19712
19753
|
var school_monthly_usage$4 = "School Monthly Usage";
|
|
19754
|
+
var location$5 = "Location";
|
|
19755
|
+
var edit_my_profile$4 = "Edit My Profile";
|
|
19756
|
+
var save_new_password$4 = "Save new password";
|
|
19757
|
+
var teacher_code$4 = "Teacher code";
|
|
19713
19758
|
var lang_zh = {
|
|
19714
19759
|
dashboard: dashboard$4,
|
|
19715
19760
|
user: user$4,
|
|
@@ -21782,6 +21827,7 @@ var lang_zh = {
|
|
|
21782
21827
|
leave: leave$4,
|
|
21783
21828
|
go_to_the_survey_dashboard: go_to_the_survey_dashboard$4,
|
|
21784
21829
|
my_dashboard: my_dashboard$4,
|
|
21830
|
+
nice_choice_what_area_of_category_would_you_like_to_work_on: nice_choice_what_area_of_category_would_you_like_to_work_on$4,
|
|
21785
21831
|
"nice_choice_what_area_of_well-being_would_you_like_to_work_on": "不错的选择!您想在哪个幸福健康领域开展工作?",
|
|
21786
21832
|
nice_choice_what_area_of_academics_would_you_like_to_work_on: nice_choice_what_area_of_academics_would_you_like_to_work_on$4,
|
|
21787
21833
|
nice_choice_what_area_of_organization_would_you_like_to_work_on: nice_choice_what_area_of_organization_would_you_like_to_work_on$4,
|
|
@@ -21938,7 +21984,11 @@ var lang_zh = {
|
|
|
21938
21984
|
type_the_main_focus_of_this_session: type_the_main_focus_of_this_session$4,
|
|
21939
21985
|
please_add_title_note: please_add_title_note$4,
|
|
21940
21986
|
notes_and_logs: notes_and_logs$4,
|
|
21941
|
-
school_monthly_usage: school_monthly_usage$4
|
|
21987
|
+
school_monthly_usage: school_monthly_usage$4,
|
|
21988
|
+
location: location$5,
|
|
21989
|
+
edit_my_profile: edit_my_profile$4,
|
|
21990
|
+
save_new_password: save_new_password$4,
|
|
21991
|
+
teacher_code: teacher_code$4
|
|
21942
21992
|
};
|
|
21943
21993
|
|
|
21944
21994
|
var TINY_MCE_API_KEY = "htqausuofrnali3nh9ivmlpq6v415o0tv2qikpg39bqf4pnk";
|
|
@@ -41806,212 +41856,6 @@ var TheHeaderDropdown = function TheHeaderDropdown(_ref) {
|
|
|
41806
41856
|
})), t("log_out")))));
|
|
41807
41857
|
};
|
|
41808
41858
|
|
|
41809
|
-
var apiGetLanguage = function apiGetLanguage() {
|
|
41810
|
-
return api.get(BASE_URL + "/api/language");
|
|
41811
|
-
};
|
|
41812
|
-
|
|
41813
|
-
var apiUpdateLanguage = function apiUpdateLanguage(lang) {
|
|
41814
|
-
return api.put(BASE_URL + "/api/language?lang=" + lang);
|
|
41815
|
-
};
|
|
41816
|
-
|
|
41817
|
-
var LANGUAGE_SYSTEM = "LANGUAGE_SYSTEM";
|
|
41818
|
-
|
|
41819
|
-
var useLanguages = function useLanguages() {
|
|
41820
|
-
var dispatch = useDispatch();
|
|
41821
|
-
|
|
41822
|
-
var _useTranslation = useTranslation(),
|
|
41823
|
-
i18n = _useTranslation.i18n;
|
|
41824
|
-
|
|
41825
|
-
var language = useSelector(function (state) {
|
|
41826
|
-
return state.common.language;
|
|
41827
|
-
});
|
|
41828
|
-
var defaultLanguage = getCookieValue(LANGUAGE_SYSTEM) != null ? getCookieValue(LANGUAGE_SYSTEM) : DEFAULT_LANGUAGE_CODE;
|
|
41829
|
-
|
|
41830
|
-
var _useState = useState([]),
|
|
41831
|
-
languageList = _useState[0],
|
|
41832
|
-
setLanguageList = _useState[1];
|
|
41833
|
-
|
|
41834
|
-
var _useState2 = useState(false),
|
|
41835
|
-
dropdownOpen = _useState2[0],
|
|
41836
|
-
setDropdownOpen = _useState2[1];
|
|
41837
|
-
|
|
41838
|
-
var _useState3 = useState(defaultLanguage),
|
|
41839
|
-
currentLang = _useState3[0],
|
|
41840
|
-
setCurrentLang = _useState3[1];
|
|
41841
|
-
|
|
41842
|
-
var toggle = function toggle() {
|
|
41843
|
-
return setDropdownOpen(function (prevState) {
|
|
41844
|
-
return !prevState;
|
|
41845
|
-
});
|
|
41846
|
-
};
|
|
41847
|
-
|
|
41848
|
-
var changeLanguageApp = function changeLanguageApp(lang) {
|
|
41849
|
-
try {
|
|
41850
|
-
var _temp3 = function _temp3() {
|
|
41851
|
-
dispatch(setLoading(false));
|
|
41852
|
-
};
|
|
41853
|
-
|
|
41854
|
-
dispatch(setLoading(true));
|
|
41855
|
-
|
|
41856
|
-
var _temp4 = _catch(function () {
|
|
41857
|
-
return Promise.resolve(apiUpdateLanguage(lang)).then(function () {
|
|
41858
|
-
i18n.changeLanguage(lang);
|
|
41859
|
-
setCurrentLang(lang);
|
|
41860
|
-
dispatch(setLanguage(lang));
|
|
41861
|
-
});
|
|
41862
|
-
}, function (err) {
|
|
41863
|
-
var _err$response, _err$response$data;
|
|
41864
|
-
|
|
41865
|
-
dispatch(setAlert({
|
|
41866
|
-
type: "danger",
|
|
41867
|
-
message: ((_err$response = err.response) === null || _err$response === void 0 ? void 0 : (_err$response$data = _err$response.data) === null || _err$response$data === void 0 ? void 0 : _err$response$data.title) || err.message
|
|
41868
|
-
}));
|
|
41869
|
-
});
|
|
41870
|
-
|
|
41871
|
-
return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(_temp3) : _temp3(_temp4));
|
|
41872
|
-
} catch (e) {
|
|
41873
|
-
return Promise.reject(e);
|
|
41874
|
-
}
|
|
41875
|
-
};
|
|
41876
|
-
|
|
41877
|
-
var getListLanguage = function getListLanguage() {
|
|
41878
|
-
try {
|
|
41879
|
-
var _temp6 = _catch(function () {
|
|
41880
|
-
return Promise.resolve(apiGetLanguage()).then(function (res) {
|
|
41881
|
-
setLanguageList(res.data);
|
|
41882
|
-
});
|
|
41883
|
-
}, function (err) {
|
|
41884
|
-
var _err$response2, _err$response2$data;
|
|
41885
|
-
|
|
41886
|
-
dispatch(setAlert({
|
|
41887
|
-
type: "danger",
|
|
41888
|
-
message: ((_err$response2 = err.response) === null || _err$response2 === void 0 ? void 0 : (_err$response2$data = _err$response2.data) === null || _err$response2$data === void 0 ? void 0 : _err$response2$data.title) || err.message
|
|
41889
|
-
}));
|
|
41890
|
-
});
|
|
41891
|
-
|
|
41892
|
-
return Promise.resolve(_temp6 && _temp6.then ? _temp6.then(function () {}) : void 0);
|
|
41893
|
-
} catch (e) {
|
|
41894
|
-
return Promise.reject(e);
|
|
41895
|
-
}
|
|
41896
|
-
};
|
|
41897
|
-
|
|
41898
|
-
useEffect(function () {
|
|
41899
|
-
defaultLanguage != language && changeLanguageApp(defaultLanguage);
|
|
41900
|
-
getListLanguage();
|
|
41901
|
-
}, []);
|
|
41902
|
-
return {
|
|
41903
|
-
languageList: languageList,
|
|
41904
|
-
toggle: toggle,
|
|
41905
|
-
dropdownOpen: dropdownOpen,
|
|
41906
|
-
currentLang: currentLang,
|
|
41907
|
-
changeLanguageApp: changeLanguageApp,
|
|
41908
|
-
setCurrentLang: setCurrentLang
|
|
41909
|
-
};
|
|
41910
|
-
};
|
|
41911
|
-
|
|
41912
|
-
var TheLanguageDropdown = function TheLanguageDropdown() {
|
|
41913
|
-
var _useLanguages = useLanguages(),
|
|
41914
|
-
languageList = _useLanguages.languageList,
|
|
41915
|
-
toggle = _useLanguages.toggle,
|
|
41916
|
-
dropdownOpen = _useLanguages.dropdownOpen,
|
|
41917
|
-
currentLang = _useLanguages.currentLang,
|
|
41918
|
-
changeLanguageApp = _useLanguages.changeLanguageApp;
|
|
41919
|
-
|
|
41920
|
-
var currentLanguage = useMemo(function () {
|
|
41921
|
-
var current = languageList.find(function (i) {
|
|
41922
|
-
return i.code === currentLang;
|
|
41923
|
-
});
|
|
41924
|
-
if (!current) return null;
|
|
41925
|
-
return React.createElement(React.Fragment, null, React.createElement("img", {
|
|
41926
|
-
className: "mr-2 " + styles['dropdown-menu-flag'],
|
|
41927
|
-
src: "" + getStaticFileUrl(current.image)
|
|
41928
|
-
}), " ", current.name);
|
|
41929
|
-
}, [currentLang, languageList]);
|
|
41930
|
-
return React.createElement(Dropdown, {
|
|
41931
|
-
isOpen: dropdownOpen,
|
|
41932
|
-
toggle: toggle,
|
|
41933
|
-
className: "" + styles["dropdown-menu"]
|
|
41934
|
-
}, React.createElement(DropdownToggle, {
|
|
41935
|
-
className: styles["header-avatar"] + " d-flex align-items-center"
|
|
41936
|
-
}, React.createElement("span", {
|
|
41937
|
-
style: {
|
|
41938
|
-
color: "#000",
|
|
41939
|
-
textTransform: "capitalize",
|
|
41940
|
-
display: 'flex',
|
|
41941
|
-
alignItems: 'center'
|
|
41942
|
-
}
|
|
41943
|
-
}, currentLanguage, React.createElement(BsChevronDown, {
|
|
41944
|
-
className: "ml-2",
|
|
41945
|
-
style: {
|
|
41946
|
-
fontSize: '10px'
|
|
41947
|
-
}
|
|
41948
|
-
}))), React.createElement(DropdownMenu, {
|
|
41949
|
-
className: styles["dropdown-content-language"]
|
|
41950
|
-
}, !!languageList && languageList.length > 0 && languageList.map(function (lang, index) {
|
|
41951
|
-
return React.createElement(DropdownItem, {
|
|
41952
|
-
key: lang.code,
|
|
41953
|
-
className: styles["dropdown-change"] + " px-0 py-0 " + (index === languageList.length - 1 ? "pb-2" : "pt-2"),
|
|
41954
|
-
onClick: function onClick() {
|
|
41955
|
-
return changeLanguageApp(lang.code);
|
|
41956
|
-
}
|
|
41957
|
-
}, React.createElement("div", {
|
|
41958
|
-
className: styles["dropdown-item-language"] + " " + styles["item-logout"] + " " + (currentLang == lang.code ? styles['dropdown-item-language-active'] : "") + " d-flex align-items-center w-100"
|
|
41959
|
-
}, React.createElement("span", {
|
|
41960
|
-
className: "mr-2 d-flex hover-opacity"
|
|
41961
|
-
}, React.createElement("img", {
|
|
41962
|
-
style: {
|
|
41963
|
-
width: "30px",
|
|
41964
|
-
height: "25px",
|
|
41965
|
-
borderRadius: "5px"
|
|
41966
|
-
},
|
|
41967
|
-
src: getStaticFileUrl(lang.image)
|
|
41968
|
-
})), lang.name));
|
|
41969
|
-
})));
|
|
41970
|
-
};
|
|
41971
|
-
|
|
41972
|
-
var TheHeader = function TheHeader(_ref) {
|
|
41973
|
-
var onToggleModel = _ref.onToggleModel;
|
|
41974
|
-
var dispatch = useDispatch();
|
|
41975
|
-
var sidebarShow = useSelector(function (state) {
|
|
41976
|
-
return state.common.sidebarShow;
|
|
41977
|
-
});
|
|
41978
|
-
|
|
41979
|
-
var _useTranslation = useTranslation(),
|
|
41980
|
-
t = _useTranslation.t;
|
|
41981
|
-
|
|
41982
|
-
var toggleSidebarMobile = function toggleSidebarMobile() {
|
|
41983
|
-
var val = [false, "responsive"].includes(sidebarShow) ? true : "responsive";
|
|
41984
|
-
dispatch(setSidebar(val));
|
|
41985
|
-
};
|
|
41986
|
-
|
|
41987
|
-
var isDistrict = window.location.host.includes("-district");
|
|
41988
|
-
return React.createElement(CHeader, {
|
|
41989
|
-
withSubheader: true,
|
|
41990
|
-
className: "d-flex align-items-center justify-content-end"
|
|
41991
|
-
}, React.createElement(CToggler, {
|
|
41992
|
-
inHeader: true,
|
|
41993
|
-
className: "ml-md-3 d-lg-none",
|
|
41994
|
-
onClick: toggleSidebarMobile
|
|
41995
|
-
}), React.createElement(CHeaderBrand, {
|
|
41996
|
-
className: "mx-auto flex-grow-1 d-lg-none",
|
|
41997
|
-
to: "/"
|
|
41998
|
-
}, React.createElement("img", {
|
|
41999
|
-
src: getStaticFileUrl(Images.LOGO_HEADER),
|
|
42000
|
-
className: styles["header-logo"]
|
|
42001
|
-
})), React.createElement(CHeaderNav, {
|
|
42002
|
-
className: "pr-3"
|
|
42003
|
-
}, React.createElement(TheLanguageDropdown, null), React.createElement("a", {
|
|
42004
|
-
className: "mr-3",
|
|
42005
|
-
style: {
|
|
42006
|
-
color: '#000'
|
|
42007
|
-
},
|
|
42008
|
-
href: '/privacy-policy',
|
|
42009
|
-
target: "blank"
|
|
42010
|
-
}, t("privacy_policy")), !isDistrict && React.createElement(NotificationButton, null), React.createElement(TheHeaderDropdown, {
|
|
42011
|
-
onToggleModel: onToggleModel
|
|
42012
|
-
})));
|
|
42013
|
-
};
|
|
42014
|
-
|
|
42015
41859
|
var TITLE$3 = "Not found";
|
|
42016
41860
|
|
|
42017
41861
|
var NotFound = function NotFound() {
|
|
@@ -42069,258 +41913,6 @@ var TheContent = function TheContent(_ref) {
|
|
|
42069
41913
|
|
|
42070
41914
|
var TheContent$1 = React.memo(TheContent);
|
|
42071
41915
|
|
|
42072
|
-
var loadingStyle = {
|
|
42073
|
-
minWidth: "100vw",
|
|
42074
|
-
minHeight: "100vh",
|
|
42075
|
-
position: "fixed",
|
|
42076
|
-
top: 0,
|
|
42077
|
-
left: 0,
|
|
42078
|
-
zIndex: 999999999,
|
|
42079
|
-
backgroundColor: "rgba(0, 0, 0, 0.4)",
|
|
42080
|
-
display: "flex",
|
|
42081
|
-
justifyContent: "center",
|
|
42082
|
-
alignItems: "center"
|
|
42083
|
-
};
|
|
42084
|
-
|
|
42085
|
-
var Loading = function Loading() {
|
|
42086
|
-
var isLoading = useSelector(function (state) {
|
|
42087
|
-
return state.common.isLoading;
|
|
42088
|
-
});
|
|
42089
|
-
localStorage.setItem("LAST_TIME_REQUETST", moment().utc().format("YYYY-MM-DD HH:mm:ss"));
|
|
42090
|
-
return isLoading ? React.createElement("div", {
|
|
42091
|
-
style: loadingStyle
|
|
42092
|
-
}, React.createElement("div", {
|
|
42093
|
-
className: "spinner-border text-secondary",
|
|
42094
|
-
role: "status"
|
|
42095
|
-
}, React.createElement("span", {
|
|
42096
|
-
className: "sr-only"
|
|
42097
|
-
}, "Loading..."))) : null;
|
|
42098
|
-
};
|
|
42099
|
-
|
|
42100
|
-
var firstCheckToken = function firstCheckToken() {
|
|
42101
|
-
return Promise.resolve(_catch(function () {
|
|
42102
|
-
var token = getAccessToken();
|
|
42103
|
-
return token ? Promise.resolve(checkToken(token)).then(function (tokenStatus) {
|
|
42104
|
-
return tokenStatus.data ? true : false;
|
|
42105
|
-
}) : false;
|
|
42106
|
-
}, function () {
|
|
42107
|
-
return false;
|
|
42108
|
-
}));
|
|
42109
|
-
};
|
|
42110
|
-
|
|
42111
|
-
var canAccess = function canAccess(userRoles, componentRoles) {
|
|
42112
|
-
if (!Array.isArray(userRoles)) {
|
|
42113
|
-
return false;
|
|
42114
|
-
}
|
|
42115
|
-
|
|
42116
|
-
if (Array.isArray(componentRoles)) {
|
|
42117
|
-
var intersects = userRoles.filter(function (i) {
|
|
42118
|
-
return componentRoles.includes(i);
|
|
42119
|
-
});
|
|
42120
|
-
return intersects.length > 0;
|
|
42121
|
-
}
|
|
42122
|
-
|
|
42123
|
-
return true;
|
|
42124
|
-
};
|
|
42125
|
-
|
|
42126
|
-
var ModelSelectRole = function ModelSelectRole(_ref) {
|
|
42127
|
-
var _handleUserRole;
|
|
42128
|
-
|
|
42129
|
-
var open = _ref.open,
|
|
42130
|
-
onToggleModel = _ref.onToggleModel;
|
|
42131
|
-
var dispatch = useDispatch();
|
|
42132
|
-
|
|
42133
|
-
var _useTranslation = useTranslation(),
|
|
42134
|
-
t = _useTranslation.t;
|
|
42135
|
-
|
|
42136
|
-
var history = useHistory();
|
|
42137
|
-
var pathname = window.location.pathname;
|
|
42138
|
-
var user = useSelector(function (state) {
|
|
42139
|
-
return state.common.user;
|
|
42140
|
-
});
|
|
42141
|
-
var roles = user === null || user === void 0 ? void 0 : user.roles;
|
|
42142
|
-
|
|
42143
|
-
var handleSelectUserRoles = function handleSelectUserRoles(roles) {
|
|
42144
|
-
dispatch(setLoading(true));
|
|
42145
|
-
var roleSelect = roles.includes("Teacher/Assistant") ? ["Teacher", "Assistant"] : roles;
|
|
42146
|
-
dispatch(setUser(_extends({}, user, {
|
|
42147
|
-
roles: roleSelect
|
|
42148
|
-
})));
|
|
42149
|
-
localStorage.setItem("ROLES", roleSelect.toString());
|
|
42150
|
-
onToggleModel();
|
|
42151
|
-
|
|
42152
|
-
if (roles.includes("Parent")) {
|
|
42153
|
-
history.push("/parent");
|
|
42154
|
-
} else if (roles.includes("Admin")) {
|
|
42155
|
-
history.push("/admin/home");
|
|
42156
|
-
} else {
|
|
42157
|
-
pathname !== "/home" ? history.push("/home") : window.location.reload();
|
|
42158
|
-
}
|
|
42159
|
-
};
|
|
42160
|
-
|
|
42161
|
-
return React.createElement(Modal, {
|
|
42162
|
-
isOpen: open,
|
|
42163
|
-
toggle: function toggle() {
|
|
42164
|
-
return onToggleModel();
|
|
42165
|
-
},
|
|
42166
|
-
className: "" + styles["model-switch-roles"],
|
|
42167
|
-
centered: true
|
|
42168
|
-
}, React.createElement("p", {
|
|
42169
|
-
className: "" + styles["title"]
|
|
42170
|
-
}, t("continue_as")), React.createElement("div", null, (_handleUserRole = handleUserRole(user === null || user === void 0 ? void 0 : user.roles)) === null || _handleUserRole === void 0 ? void 0 : _handleUserRole.map(function (r) {
|
|
42171
|
-
return React.createElement("p", {
|
|
42172
|
-
key: r,
|
|
42173
|
-
className: styles["item-select-role"] + " " + styles[roles.includes("Teacher") && roles.includes("Assistant") && r === "Teacher/Assistant" && !roles.includes("Admin") || roles.includes("Admin") && r === "Admin" || roles.includes(r) && !roles.includes("Admin") ? "item-role-active" : ""],
|
|
42174
|
-
onClick: function onClick() {
|
|
42175
|
-
return handleSelectUserRoles([r]);
|
|
42176
|
-
}
|
|
42177
|
-
}, r == "SecondaryTeacher" ? "Support Teacher" : r);
|
|
42178
|
-
})));
|
|
42179
|
-
};
|
|
42180
|
-
|
|
42181
|
-
var TheLayout = function TheLayout(_ref) {
|
|
42182
|
-
var routes = _ref.routes,
|
|
42183
|
-
navigation = _ref.navigation;
|
|
42184
|
-
var history = useHistory();
|
|
42185
|
-
var dispatch = useDispatch();
|
|
42186
|
-
var user = useSelector(function (state) {
|
|
42187
|
-
return state.common.user;
|
|
42188
|
-
});
|
|
42189
|
-
var language = useSelector(function (state) {
|
|
42190
|
-
return state.common.language;
|
|
42191
|
-
});
|
|
42192
|
-
|
|
42193
|
-
var _useState = useState(false),
|
|
42194
|
-
openModelSelectRole = _useState[0],
|
|
42195
|
-
setOpenModelSelectRole = _useState[1];
|
|
42196
|
-
|
|
42197
|
-
var _useTranslation = useTranslation(),
|
|
42198
|
-
t = _useTranslation.t;
|
|
42199
|
-
|
|
42200
|
-
var location = useLocation();
|
|
42201
|
-
var isNotification = location.pathname.includes("notifications");
|
|
42202
|
-
var isDistrict = window.location.host.includes("-district");
|
|
42203
|
-
|
|
42204
|
-
var handleToggleModel = function handleToggleModel() {
|
|
42205
|
-
setOpenModelSelectRole(!openModelSelectRole);
|
|
42206
|
-
};
|
|
42207
|
-
|
|
42208
|
-
var authRoutes = useMemo(function () {
|
|
42209
|
-
return routes.filter(function (route) {
|
|
42210
|
-
return canAccess(user === null || user === void 0 ? void 0 : user.roles, route.roles);
|
|
42211
|
-
}).filter(function (route) {
|
|
42212
|
-
return !!route.isDistrict === isDistrict;
|
|
42213
|
-
});
|
|
42214
|
-
}, [user, language]);
|
|
42215
|
-
var authNavigations = useMemo(function () {
|
|
42216
|
-
return navigation.map(function (item) {
|
|
42217
|
-
var _item$_children, _item$_children2;
|
|
42218
|
-
|
|
42219
|
-
return _extends({}, item, {
|
|
42220
|
-
name: t(item.name),
|
|
42221
|
-
_children: item !== null && item !== void 0 && (_item$_children = item._children) !== null && _item$_children !== void 0 && _item$_children.length ? item === null || item === void 0 ? void 0 : (_item$_children2 = item._children) === null || _item$_children2 === void 0 ? void 0 : _item$_children2.map(function (x) {
|
|
42222
|
-
return _extends({}, x, {
|
|
42223
|
-
name: t(x.name)
|
|
42224
|
-
});
|
|
42225
|
-
}) : undefined
|
|
42226
|
-
});
|
|
42227
|
-
}).filter(function (nav) {
|
|
42228
|
-
return canAccess(user === null || user === void 0 ? void 0 : user.roles, nav.roles);
|
|
42229
|
-
}).filter(function (nav) {
|
|
42230
|
-
return !!nav.isDistrict === isDistrict;
|
|
42231
|
-
});
|
|
42232
|
-
}, [user, language]);
|
|
42233
|
-
|
|
42234
|
-
var getInformationSetting = function getInformationSetting() {
|
|
42235
|
-
try {
|
|
42236
|
-
var _temp2 = _catch(function () {
|
|
42237
|
-
return Promise.resolve(getSchoolSettings()).then(function (res) {
|
|
42238
|
-
dispatch(setSandboxMode(res.data.isSandboxMode));
|
|
42239
|
-
});
|
|
42240
|
-
}, function (err) {
|
|
42241
|
-
console.error(err);
|
|
42242
|
-
});
|
|
42243
|
-
|
|
42244
|
-
return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
|
|
42245
|
-
} catch (e) {
|
|
42246
|
-
return Promise.reject(e);
|
|
42247
|
-
}
|
|
42248
|
-
};
|
|
42249
|
-
|
|
42250
|
-
useEffect(function () {
|
|
42251
|
-
checkAuthentication();
|
|
42252
|
-
}, []);
|
|
42253
|
-
useEffect(function () {
|
|
42254
|
-
getInformationSetting();
|
|
42255
|
-
}, [location.pathname]);
|
|
42256
|
-
|
|
42257
|
-
var checkAuthentication = function checkAuthentication() {
|
|
42258
|
-
try {
|
|
42259
|
-
var _temp4 = _catch(function () {
|
|
42260
|
-
return Promise.resolve(firstCheckToken()).then(function (tokenStatus) {
|
|
42261
|
-
tokenStatus ? loadInfo() : resetAuth();
|
|
42262
|
-
});
|
|
42263
|
-
}, function () {
|
|
42264
|
-
resetAuth();
|
|
42265
|
-
});
|
|
42266
|
-
|
|
42267
|
-
return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(function () {}) : void 0);
|
|
42268
|
-
} catch (e) {
|
|
42269
|
-
return Promise.reject(e);
|
|
42270
|
-
}
|
|
42271
|
-
};
|
|
42272
|
-
|
|
42273
|
-
var loadInfo = function loadInfo() {
|
|
42274
|
-
try {
|
|
42275
|
-
var _temp6 = _catch(function () {
|
|
42276
|
-
return Promise.resolve(getInfo()).then(function (info) {
|
|
42277
|
-
var _info$data, _info$data$roles;
|
|
42278
|
-
|
|
42279
|
-
if (!info || !(info !== null && info !== void 0 && (_info$data = info.data) !== null && _info$data !== void 0 && (_info$data$roles = _info$data.roles) !== null && _info$data$roles !== void 0 && _info$data$roles.includes("Admin"))) {
|
|
42280
|
-
resetAuth();
|
|
42281
|
-
}
|
|
42282
|
-
|
|
42283
|
-
dispatch(setUser(info.data));
|
|
42284
|
-
});
|
|
42285
|
-
}, function () {
|
|
42286
|
-
resetAuth();
|
|
42287
|
-
});
|
|
42288
|
-
|
|
42289
|
-
return Promise.resolve(_temp6 && _temp6.then ? _temp6.then(function () {}) : void 0);
|
|
42290
|
-
} catch (e) {
|
|
42291
|
-
return Promise.reject(e);
|
|
42292
|
-
}
|
|
42293
|
-
};
|
|
42294
|
-
|
|
42295
|
-
var resetAuth = function resetAuth() {
|
|
42296
|
-
localStorage.removeItem(ACCESS_TOKEN);
|
|
42297
|
-
sessionStorage.removeItem(ACCESS_TOKEN);
|
|
42298
|
-
localStorage.removeItem("ROLES");
|
|
42299
|
-
history.push("/");
|
|
42300
|
-
};
|
|
42301
|
-
|
|
42302
|
-
if (!user) {
|
|
42303
|
-
return React.createElement(Loading, null);
|
|
42304
|
-
}
|
|
42305
|
-
|
|
42306
|
-
return React.createElement("div", {
|
|
42307
|
-
className: "c-app c-default-layout"
|
|
42308
|
-
}, !isNotification && React.createElement(TheSidebar, {
|
|
42309
|
-
navigation: authNavigations
|
|
42310
|
-
}), React.createElement("div", {
|
|
42311
|
-
className: "c-wrapper"
|
|
42312
|
-
}, !isNotification && React.createElement(TheHeader, {
|
|
42313
|
-
onToggleModel: handleToggleModel
|
|
42314
|
-
}), React.createElement("div", {
|
|
42315
|
-
className: "c-body bg-white"
|
|
42316
|
-
}, React.createElement(TheContent$1, {
|
|
42317
|
-
routes: authRoutes
|
|
42318
|
-
}))), React.createElement(ModelSelectRole, {
|
|
42319
|
-
open: openModelSelectRole,
|
|
42320
|
-
onToggleModel: handleToggleModel
|
|
42321
|
-
}));
|
|
42322
|
-
};
|
|
42323
|
-
|
|
42324
41916
|
var buttonTextStyle = {
|
|
42325
41917
|
fontWeight: 500
|
|
42326
41918
|
};
|
|
@@ -51669,6 +51261,34 @@ var UserDetail = function UserDetail() {
|
|
|
51669
51261
|
});
|
|
51670
51262
|
};
|
|
51671
51263
|
|
|
51264
|
+
var loadingStyle = {
|
|
51265
|
+
minWidth: "100vw",
|
|
51266
|
+
minHeight: "100vh",
|
|
51267
|
+
position: "fixed",
|
|
51268
|
+
top: 0,
|
|
51269
|
+
left: 0,
|
|
51270
|
+
zIndex: 999999999,
|
|
51271
|
+
backgroundColor: "rgba(0, 0, 0, 0.4)",
|
|
51272
|
+
display: "flex",
|
|
51273
|
+
justifyContent: "center",
|
|
51274
|
+
alignItems: "center"
|
|
51275
|
+
};
|
|
51276
|
+
|
|
51277
|
+
var Loading = function Loading() {
|
|
51278
|
+
var isLoading = useSelector(function (state) {
|
|
51279
|
+
return state.common.isLoading;
|
|
51280
|
+
});
|
|
51281
|
+
localStorage.setItem("LAST_TIME_REQUETST", moment().utc().format("YYYY-MM-DD HH:mm:ss"));
|
|
51282
|
+
return isLoading ? React.createElement("div", {
|
|
51283
|
+
style: loadingStyle
|
|
51284
|
+
}, React.createElement("div", {
|
|
51285
|
+
className: "spinner-border text-secondary",
|
|
51286
|
+
role: "status"
|
|
51287
|
+
}, React.createElement("span", {
|
|
51288
|
+
className: "sr-only"
|
|
51289
|
+
}, "Loading..."))) : null;
|
|
51290
|
+
};
|
|
51291
|
+
|
|
51672
51292
|
var ScrollToTop = function ScrollToTop() {
|
|
51673
51293
|
var _useLocation = useLocation(),
|
|
51674
51294
|
pathname = _useLocation.pathname;
|
|
@@ -54692,6 +54312,32 @@ var store = configureStore({
|
|
|
54692
54312
|
}
|
|
54693
54313
|
});
|
|
54694
54314
|
|
|
54315
|
+
var firstCheckToken = function firstCheckToken() {
|
|
54316
|
+
return Promise.resolve(_catch(function () {
|
|
54317
|
+
var token = getAccessToken();
|
|
54318
|
+
return token ? Promise.resolve(checkToken(token)).then(function (tokenStatus) {
|
|
54319
|
+
return tokenStatus.data ? true : false;
|
|
54320
|
+
}) : false;
|
|
54321
|
+
}, function () {
|
|
54322
|
+
return false;
|
|
54323
|
+
}));
|
|
54324
|
+
};
|
|
54325
|
+
|
|
54326
|
+
var canAccess = function canAccess(userRoles, componentRoles) {
|
|
54327
|
+
if (!Array.isArray(userRoles)) {
|
|
54328
|
+
return false;
|
|
54329
|
+
}
|
|
54330
|
+
|
|
54331
|
+
if (Array.isArray(componentRoles)) {
|
|
54332
|
+
var intersects = userRoles.filter(function (i) {
|
|
54333
|
+
return componentRoles.includes(i);
|
|
54334
|
+
});
|
|
54335
|
+
return intersects.length > 0;
|
|
54336
|
+
}
|
|
54337
|
+
|
|
54338
|
+
return true;
|
|
54339
|
+
};
|
|
54340
|
+
|
|
54695
54341
|
var isInViewport = function isInViewport(el) {
|
|
54696
54342
|
var rect = el === null || el === void 0 ? void 0 : el.getBoundingClientRect();
|
|
54697
54343
|
return rect.top >= 0 && rect.left >= 0 && rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && rect.right <= (window.innerWidth || document.documentElement.clientWidth);
|
|
@@ -54725,6 +54371,410 @@ var generateRandomString = (function () {
|
|
|
54725
54371
|
return (Math.random() + 1).toString(36).substring(7);
|
|
54726
54372
|
});
|
|
54727
54373
|
|
|
54374
|
+
var apiGetLanguage = function apiGetLanguage() {
|
|
54375
|
+
return api.get(BASE_URL + "/api/language");
|
|
54376
|
+
};
|
|
54377
|
+
|
|
54378
|
+
var apiUpdateLanguage = function apiUpdateLanguage(lang) {
|
|
54379
|
+
return api.put(BASE_URL + "/api/language?lang=" + lang);
|
|
54380
|
+
};
|
|
54381
|
+
|
|
54382
|
+
var LANGUAGE_SYSTEM = "LANGUAGE_SYSTEM";
|
|
54383
|
+
|
|
54384
|
+
var useLanguages = function useLanguages() {
|
|
54385
|
+
var dispatch = useDispatch();
|
|
54386
|
+
|
|
54387
|
+
var _useTranslation = useTranslation(),
|
|
54388
|
+
i18n = _useTranslation.i18n;
|
|
54389
|
+
|
|
54390
|
+
var language = useSelector(function (state) {
|
|
54391
|
+
return state.common.language;
|
|
54392
|
+
});
|
|
54393
|
+
var defaultLanguage = getCookieValue(LANGUAGE_SYSTEM) != null ? getCookieValue(LANGUAGE_SYSTEM) : DEFAULT_LANGUAGE_CODE;
|
|
54394
|
+
|
|
54395
|
+
var _useState = useState([]),
|
|
54396
|
+
languageList = _useState[0],
|
|
54397
|
+
setLanguageList = _useState[1];
|
|
54398
|
+
|
|
54399
|
+
var _useState2 = useState(false),
|
|
54400
|
+
dropdownOpen = _useState2[0],
|
|
54401
|
+
setDropdownOpen = _useState2[1];
|
|
54402
|
+
|
|
54403
|
+
var _useState3 = useState(defaultLanguage),
|
|
54404
|
+
currentLang = _useState3[0],
|
|
54405
|
+
setCurrentLang = _useState3[1];
|
|
54406
|
+
|
|
54407
|
+
var toggle = function toggle() {
|
|
54408
|
+
return setDropdownOpen(function (prevState) {
|
|
54409
|
+
return !prevState;
|
|
54410
|
+
});
|
|
54411
|
+
};
|
|
54412
|
+
|
|
54413
|
+
var changeLanguageApp = function changeLanguageApp(lang) {
|
|
54414
|
+
try {
|
|
54415
|
+
var _temp3 = function _temp3() {
|
|
54416
|
+
dispatch(setLoading(false));
|
|
54417
|
+
};
|
|
54418
|
+
|
|
54419
|
+
dispatch(setLoading(true));
|
|
54420
|
+
|
|
54421
|
+
var _temp4 = _catch(function () {
|
|
54422
|
+
return Promise.resolve(apiUpdateLanguage(lang)).then(function () {
|
|
54423
|
+
i18n.changeLanguage(lang);
|
|
54424
|
+
setCurrentLang(lang);
|
|
54425
|
+
dispatch(setLanguage(lang));
|
|
54426
|
+
});
|
|
54427
|
+
}, function (err) {
|
|
54428
|
+
var _err$response, _err$response$data;
|
|
54429
|
+
|
|
54430
|
+
dispatch(setAlert({
|
|
54431
|
+
type: "danger",
|
|
54432
|
+
message: ((_err$response = err.response) === null || _err$response === void 0 ? void 0 : (_err$response$data = _err$response.data) === null || _err$response$data === void 0 ? void 0 : _err$response$data.title) || err.message
|
|
54433
|
+
}));
|
|
54434
|
+
});
|
|
54435
|
+
|
|
54436
|
+
return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(_temp3) : _temp3(_temp4));
|
|
54437
|
+
} catch (e) {
|
|
54438
|
+
return Promise.reject(e);
|
|
54439
|
+
}
|
|
54440
|
+
};
|
|
54441
|
+
|
|
54442
|
+
var getListLanguage = function getListLanguage() {
|
|
54443
|
+
try {
|
|
54444
|
+
var _temp6 = _catch(function () {
|
|
54445
|
+
return Promise.resolve(apiGetLanguage()).then(function (res) {
|
|
54446
|
+
setLanguageList(res.data);
|
|
54447
|
+
});
|
|
54448
|
+
}, function (err) {
|
|
54449
|
+
var _err$response2, _err$response2$data;
|
|
54450
|
+
|
|
54451
|
+
dispatch(setAlert({
|
|
54452
|
+
type: "danger",
|
|
54453
|
+
message: ((_err$response2 = err.response) === null || _err$response2 === void 0 ? void 0 : (_err$response2$data = _err$response2.data) === null || _err$response2$data === void 0 ? void 0 : _err$response2$data.title) || err.message
|
|
54454
|
+
}));
|
|
54455
|
+
});
|
|
54456
|
+
|
|
54457
|
+
return Promise.resolve(_temp6 && _temp6.then ? _temp6.then(function () {}) : void 0);
|
|
54458
|
+
} catch (e) {
|
|
54459
|
+
return Promise.reject(e);
|
|
54460
|
+
}
|
|
54461
|
+
};
|
|
54462
|
+
|
|
54463
|
+
useEffect(function () {
|
|
54464
|
+
defaultLanguage != language && changeLanguageApp(defaultLanguage);
|
|
54465
|
+
getListLanguage();
|
|
54466
|
+
}, []);
|
|
54467
|
+
return {
|
|
54468
|
+
languageList: languageList,
|
|
54469
|
+
toggle: toggle,
|
|
54470
|
+
dropdownOpen: dropdownOpen,
|
|
54471
|
+
currentLang: currentLang,
|
|
54472
|
+
changeLanguageApp: changeLanguageApp,
|
|
54473
|
+
setCurrentLang: setCurrentLang
|
|
54474
|
+
};
|
|
54475
|
+
};
|
|
54476
|
+
|
|
54477
|
+
var TheLanguageDropdown = function TheLanguageDropdown() {
|
|
54478
|
+
var _useLanguages = useLanguages(),
|
|
54479
|
+
languageList = _useLanguages.languageList,
|
|
54480
|
+
toggle = _useLanguages.toggle,
|
|
54481
|
+
dropdownOpen = _useLanguages.dropdownOpen,
|
|
54482
|
+
currentLang = _useLanguages.currentLang,
|
|
54483
|
+
changeLanguageApp = _useLanguages.changeLanguageApp;
|
|
54484
|
+
|
|
54485
|
+
var currentLanguage = useMemo(function () {
|
|
54486
|
+
var current = languageList.find(function (i) {
|
|
54487
|
+
return i.code === currentLang;
|
|
54488
|
+
});
|
|
54489
|
+
if (!current) return null;
|
|
54490
|
+
return React.createElement(React.Fragment, null, React.createElement("img", {
|
|
54491
|
+
className: "mr-2 " + styles['dropdown-menu-flag'],
|
|
54492
|
+
src: "" + getStaticFileUrl(current.image)
|
|
54493
|
+
}), " ", current.name);
|
|
54494
|
+
}, [currentLang, languageList]);
|
|
54495
|
+
return React.createElement(Dropdown, {
|
|
54496
|
+
isOpen: dropdownOpen,
|
|
54497
|
+
toggle: toggle,
|
|
54498
|
+
className: "" + styles["dropdown-menu"]
|
|
54499
|
+
}, React.createElement(DropdownToggle, {
|
|
54500
|
+
className: styles["header-avatar"] + " d-flex align-items-center"
|
|
54501
|
+
}, React.createElement("span", {
|
|
54502
|
+
style: {
|
|
54503
|
+
color: "#000",
|
|
54504
|
+
textTransform: "capitalize",
|
|
54505
|
+
display: 'flex',
|
|
54506
|
+
alignItems: 'center'
|
|
54507
|
+
}
|
|
54508
|
+
}, currentLanguage, React.createElement(BsChevronDown, {
|
|
54509
|
+
className: "ml-2",
|
|
54510
|
+
style: {
|
|
54511
|
+
fontSize: '10px'
|
|
54512
|
+
}
|
|
54513
|
+
}))), React.createElement(DropdownMenu, {
|
|
54514
|
+
className: styles["dropdown-content-language"]
|
|
54515
|
+
}, !!languageList && languageList.length > 0 && languageList.map(function (lang, index) {
|
|
54516
|
+
return React.createElement(DropdownItem, {
|
|
54517
|
+
key: lang.code,
|
|
54518
|
+
className: styles["dropdown-change"] + " px-0 py-0 " + (index === languageList.length - 1 ? "pb-2" : "pt-2"),
|
|
54519
|
+
onClick: function onClick() {
|
|
54520
|
+
return changeLanguageApp(lang.code);
|
|
54521
|
+
}
|
|
54522
|
+
}, React.createElement("div", {
|
|
54523
|
+
className: styles["dropdown-item-language"] + " " + styles["item-logout"] + " " + (currentLang == lang.code ? styles['dropdown-item-language-active'] : "") + " d-flex align-items-center w-100"
|
|
54524
|
+
}, React.createElement("span", {
|
|
54525
|
+
className: "mr-2 d-flex hover-opacity"
|
|
54526
|
+
}, React.createElement("img", {
|
|
54527
|
+
style: {
|
|
54528
|
+
width: "30px",
|
|
54529
|
+
height: "25px",
|
|
54530
|
+
borderRadius: "5px"
|
|
54531
|
+
},
|
|
54532
|
+
src: getStaticFileUrl(lang.image)
|
|
54533
|
+
})), lang.name));
|
|
54534
|
+
})));
|
|
54535
|
+
};
|
|
54536
|
+
|
|
54537
|
+
var TheHeader = function TheHeader(_ref) {
|
|
54538
|
+
var onToggleModel = _ref.onToggleModel;
|
|
54539
|
+
var dispatch = useDispatch();
|
|
54540
|
+
var sidebarShow = useSelector(function (state) {
|
|
54541
|
+
return state.common.sidebarShow;
|
|
54542
|
+
});
|
|
54543
|
+
|
|
54544
|
+
var _useTranslation = useTranslation(),
|
|
54545
|
+
t = _useTranslation.t;
|
|
54546
|
+
|
|
54547
|
+
var toggleSidebarMobile = function toggleSidebarMobile() {
|
|
54548
|
+
var val = [false, "responsive"].includes(sidebarShow) ? true : "responsive";
|
|
54549
|
+
dispatch(setSidebar(val));
|
|
54550
|
+
};
|
|
54551
|
+
|
|
54552
|
+
var isDistrict = window.location.host.includes("-district");
|
|
54553
|
+
return React.createElement(CHeader, {
|
|
54554
|
+
withSubheader: true,
|
|
54555
|
+
className: "d-flex align-items-center justify-content-end"
|
|
54556
|
+
}, React.createElement(CToggler, {
|
|
54557
|
+
inHeader: true,
|
|
54558
|
+
className: "ml-md-3 d-lg-none",
|
|
54559
|
+
onClick: toggleSidebarMobile
|
|
54560
|
+
}), React.createElement(CHeaderBrand, {
|
|
54561
|
+
className: "mx-auto flex-grow-1 d-lg-none",
|
|
54562
|
+
to: "/"
|
|
54563
|
+
}, React.createElement("img", {
|
|
54564
|
+
src: getStaticFileUrl(Images.LOGO_HEADER),
|
|
54565
|
+
className: styles["header-logo"]
|
|
54566
|
+
})), React.createElement(CHeaderNav, {
|
|
54567
|
+
className: "pr-3"
|
|
54568
|
+
}, React.createElement(TheLanguageDropdown, null), React.createElement("a", {
|
|
54569
|
+
className: "mr-3",
|
|
54570
|
+
style: {
|
|
54571
|
+
color: '#000'
|
|
54572
|
+
},
|
|
54573
|
+
href: '/privacy-policy',
|
|
54574
|
+
target: "blank"
|
|
54575
|
+
}, t("privacy_policy")), !isDistrict && React.createElement(NotificationButton, null), React.createElement(TheHeaderDropdown, {
|
|
54576
|
+
onToggleModel: onToggleModel
|
|
54577
|
+
})));
|
|
54578
|
+
};
|
|
54579
|
+
|
|
54580
|
+
var ModelSelectRole = function ModelSelectRole(_ref) {
|
|
54581
|
+
var _handleUserRole;
|
|
54582
|
+
|
|
54583
|
+
var open = _ref.open,
|
|
54584
|
+
onToggleModel = _ref.onToggleModel;
|
|
54585
|
+
var dispatch = useDispatch();
|
|
54586
|
+
|
|
54587
|
+
var _useTranslation = useTranslation(),
|
|
54588
|
+
t = _useTranslation.t;
|
|
54589
|
+
|
|
54590
|
+
var history = useHistory();
|
|
54591
|
+
var pathname = window.location.pathname;
|
|
54592
|
+
var user = useSelector(function (state) {
|
|
54593
|
+
return state.common.user;
|
|
54594
|
+
});
|
|
54595
|
+
var roles = user === null || user === void 0 ? void 0 : user.roles;
|
|
54596
|
+
|
|
54597
|
+
var handleSelectUserRoles = function handleSelectUserRoles(roles) {
|
|
54598
|
+
dispatch(setLoading(true));
|
|
54599
|
+
var roleSelect = roles.includes("Teacher/Assistant") ? ["Teacher", "Assistant"] : roles;
|
|
54600
|
+
dispatch(setUser(_extends({}, user, {
|
|
54601
|
+
roles: roleSelect
|
|
54602
|
+
})));
|
|
54603
|
+
localStorage.setItem("ROLES", roleSelect.toString());
|
|
54604
|
+
onToggleModel();
|
|
54605
|
+
|
|
54606
|
+
if (roles.includes("Parent")) {
|
|
54607
|
+
history.push("/parent");
|
|
54608
|
+
} else if (roles.includes("Admin")) {
|
|
54609
|
+
history.push("/admin/home");
|
|
54610
|
+
} else {
|
|
54611
|
+
pathname !== "/home" ? history.push("/home") : window.location.reload();
|
|
54612
|
+
}
|
|
54613
|
+
};
|
|
54614
|
+
|
|
54615
|
+
return React.createElement(Modal, {
|
|
54616
|
+
isOpen: open,
|
|
54617
|
+
toggle: function toggle() {
|
|
54618
|
+
return onToggleModel();
|
|
54619
|
+
},
|
|
54620
|
+
className: "" + styles["model-switch-roles"],
|
|
54621
|
+
centered: true
|
|
54622
|
+
}, React.createElement("p", {
|
|
54623
|
+
className: "" + styles["title"]
|
|
54624
|
+
}, t("continue_as")), React.createElement("div", null, (_handleUserRole = handleUserRole(user === null || user === void 0 ? void 0 : user.roles)) === null || _handleUserRole === void 0 ? void 0 : _handleUserRole.map(function (r) {
|
|
54625
|
+
return React.createElement("p", {
|
|
54626
|
+
key: r,
|
|
54627
|
+
className: styles["item-select-role"] + " " + styles[roles.includes("Teacher") && roles.includes("Assistant") && r === "Teacher/Assistant" && !roles.includes("Admin") || roles.includes("Admin") && r === "Admin" || roles.includes(r) && !roles.includes("Admin") ? "item-role-active" : ""],
|
|
54628
|
+
onClick: function onClick() {
|
|
54629
|
+
return handleSelectUserRoles([r]);
|
|
54630
|
+
}
|
|
54631
|
+
}, r == "SecondaryTeacher" ? "Support Teacher" : r);
|
|
54632
|
+
})));
|
|
54633
|
+
};
|
|
54634
|
+
|
|
54635
|
+
var TheLayout = function TheLayout(_ref) {
|
|
54636
|
+
var routes = _ref.routes,
|
|
54637
|
+
navigation = _ref.navigation;
|
|
54638
|
+
var history = useHistory();
|
|
54639
|
+
var dispatch = useDispatch();
|
|
54640
|
+
var user = useSelector(function (state) {
|
|
54641
|
+
return state.common.user;
|
|
54642
|
+
});
|
|
54643
|
+
var language = useSelector(function (state) {
|
|
54644
|
+
return state.common.language;
|
|
54645
|
+
});
|
|
54646
|
+
|
|
54647
|
+
var _useState = useState(false),
|
|
54648
|
+
openModelSelectRole = _useState[0],
|
|
54649
|
+
setOpenModelSelectRole = _useState[1];
|
|
54650
|
+
|
|
54651
|
+
var _useTranslation = useTranslation(),
|
|
54652
|
+
t = _useTranslation.t;
|
|
54653
|
+
|
|
54654
|
+
var location = useLocation();
|
|
54655
|
+
var isNotification = location.pathname.includes("notifications");
|
|
54656
|
+
var isDistrict = window.location.host.includes("-district");
|
|
54657
|
+
|
|
54658
|
+
var handleToggleModel = function handleToggleModel() {
|
|
54659
|
+
setOpenModelSelectRole(!openModelSelectRole);
|
|
54660
|
+
};
|
|
54661
|
+
|
|
54662
|
+
var authRoutes = useMemo(function () {
|
|
54663
|
+
return routes.filter(function (route) {
|
|
54664
|
+
return canAccess(user === null || user === void 0 ? void 0 : user.roles, route.roles);
|
|
54665
|
+
}).filter(function (route) {
|
|
54666
|
+
return !!route.isDistrict === isDistrict;
|
|
54667
|
+
});
|
|
54668
|
+
}, [user, language]);
|
|
54669
|
+
var authNavigations = useMemo(function () {
|
|
54670
|
+
return navigation.map(function (item) {
|
|
54671
|
+
var _item$_children, _item$_children2;
|
|
54672
|
+
|
|
54673
|
+
return _extends({}, item, {
|
|
54674
|
+
name: t(item.name),
|
|
54675
|
+
_children: item !== null && item !== void 0 && (_item$_children = item._children) !== null && _item$_children !== void 0 && _item$_children.length ? item === null || item === void 0 ? void 0 : (_item$_children2 = item._children) === null || _item$_children2 === void 0 ? void 0 : _item$_children2.map(function (x) {
|
|
54676
|
+
return _extends({}, x, {
|
|
54677
|
+
name: t(x.name)
|
|
54678
|
+
});
|
|
54679
|
+
}) : undefined
|
|
54680
|
+
});
|
|
54681
|
+
}).filter(function (nav) {
|
|
54682
|
+
return canAccess(user === null || user === void 0 ? void 0 : user.roles, nav.roles);
|
|
54683
|
+
}).filter(function (nav) {
|
|
54684
|
+
return !!nav.isDistrict === isDistrict;
|
|
54685
|
+
});
|
|
54686
|
+
}, [user, language]);
|
|
54687
|
+
|
|
54688
|
+
var getInformationSetting = function getInformationSetting() {
|
|
54689
|
+
try {
|
|
54690
|
+
var _temp2 = _catch(function () {
|
|
54691
|
+
return Promise.resolve(getSchoolSettings()).then(function (res) {
|
|
54692
|
+
dispatch(setSandboxMode(res.data.isSandboxMode));
|
|
54693
|
+
});
|
|
54694
|
+
}, function (err) {
|
|
54695
|
+
console.error(err);
|
|
54696
|
+
});
|
|
54697
|
+
|
|
54698
|
+
return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
|
|
54699
|
+
} catch (e) {
|
|
54700
|
+
return Promise.reject(e);
|
|
54701
|
+
}
|
|
54702
|
+
};
|
|
54703
|
+
|
|
54704
|
+
useEffect(function () {
|
|
54705
|
+
checkAuthentication();
|
|
54706
|
+
}, []);
|
|
54707
|
+
useEffect(function () {
|
|
54708
|
+
getInformationSetting();
|
|
54709
|
+
}, [location.pathname]);
|
|
54710
|
+
|
|
54711
|
+
var checkAuthentication = function checkAuthentication() {
|
|
54712
|
+
try {
|
|
54713
|
+
var _temp4 = _catch(function () {
|
|
54714
|
+
return Promise.resolve(firstCheckToken()).then(function (tokenStatus) {
|
|
54715
|
+
tokenStatus ? loadInfo() : resetAuth();
|
|
54716
|
+
});
|
|
54717
|
+
}, function () {
|
|
54718
|
+
resetAuth();
|
|
54719
|
+
});
|
|
54720
|
+
|
|
54721
|
+
return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(function () {}) : void 0);
|
|
54722
|
+
} catch (e) {
|
|
54723
|
+
return Promise.reject(e);
|
|
54724
|
+
}
|
|
54725
|
+
};
|
|
54726
|
+
|
|
54727
|
+
var loadInfo = function loadInfo() {
|
|
54728
|
+
try {
|
|
54729
|
+
var _temp6 = _catch(function () {
|
|
54730
|
+
return Promise.resolve(getInfo()).then(function (info) {
|
|
54731
|
+
var _info$data, _info$data$roles;
|
|
54732
|
+
|
|
54733
|
+
if (!info || !(info !== null && info !== void 0 && (_info$data = info.data) !== null && _info$data !== void 0 && (_info$data$roles = _info$data.roles) !== null && _info$data$roles !== void 0 && _info$data$roles.includes("Admin"))) {
|
|
54734
|
+
resetAuth();
|
|
54735
|
+
}
|
|
54736
|
+
|
|
54737
|
+
dispatch(setUser(info.data));
|
|
54738
|
+
});
|
|
54739
|
+
}, function () {
|
|
54740
|
+
resetAuth();
|
|
54741
|
+
});
|
|
54742
|
+
|
|
54743
|
+
return Promise.resolve(_temp6 && _temp6.then ? _temp6.then(function () {}) : void 0);
|
|
54744
|
+
} catch (e) {
|
|
54745
|
+
return Promise.reject(e);
|
|
54746
|
+
}
|
|
54747
|
+
};
|
|
54748
|
+
|
|
54749
|
+
var resetAuth = function resetAuth() {
|
|
54750
|
+
localStorage.removeItem(ACCESS_TOKEN);
|
|
54751
|
+
sessionStorage.removeItem(ACCESS_TOKEN);
|
|
54752
|
+
localStorage.removeItem("ROLES");
|
|
54753
|
+
history.push("/");
|
|
54754
|
+
};
|
|
54755
|
+
|
|
54756
|
+
if (!user) {
|
|
54757
|
+
return React.createElement(Loading, null);
|
|
54758
|
+
}
|
|
54759
|
+
|
|
54760
|
+
return React.createElement("div", {
|
|
54761
|
+
className: "c-app c-default-layout"
|
|
54762
|
+
}, !isNotification && React.createElement(TheSidebar, {
|
|
54763
|
+
navigation: authNavigations
|
|
54764
|
+
}), React.createElement("div", {
|
|
54765
|
+
className: "c-wrapper"
|
|
54766
|
+
}, !isNotification && React.createElement(TheHeader, {
|
|
54767
|
+
onToggleModel: handleToggleModel
|
|
54768
|
+
}), React.createElement("div", {
|
|
54769
|
+
className: "c-body bg-white"
|
|
54770
|
+
}, React.createElement(TheContent$1, {
|
|
54771
|
+
routes: authRoutes
|
|
54772
|
+
}))), React.createElement(ModelSelectRole, {
|
|
54773
|
+
open: openModelSelectRole,
|
|
54774
|
+
onToggleModel: handleToggleModel
|
|
54775
|
+
}));
|
|
54776
|
+
};
|
|
54777
|
+
|
|
54728
54778
|
var amplitudeClient = amplitude;
|
|
54729
54779
|
|
|
54730
54780
|
export { ACCESS_TOKEN, ANSWER_EDITOR_HEIGHT, AcademicClassSelector, AddButton, BASE_URL, CHAT_CHANNEL, CategorySelector, CommonAlert, CommonHeader, CommonModal$1 as CommonModal, CreatableSelector, CustomPagination, CustomSelector, CustomTabs as CustomTab, DATE_FORMAT, DATE_RESULT, DEFAULT_FILTER, DEFAULT_LANGUAGE_CODE, Dashboard, DeleteButtonIcon, DetailActionButtons, EMOTIONS, EditButtonIcon, EmailTemplateDetail, EmailTemplateList, EmptyDataAlert, ErrorHandler, FULL_DATE_RESULT, FaqList, InputFile as FileInput, GOOGLE_RECAPTCHA_KEY, GalleryList, INIT_AMPLITUDE_KEY_PROD, INIT_AMPLITUDE_KEY_STAGE, IS_USER_SESSION_BROWSER, Images, LANGUAGES, LICENSE_AGGRID, LinkEditButton, Loading, Login, MediaList, NOTIFICATION_ALERT_KEY, NOTIFICATION_CHANNEL, NotFound, NotificationList, NotificationLogoutModal, NotificationModal, QUESTION_TYPES, QUESTION_TYPES_OPTIONS, QuestionCategorySelector, QuestionTypeSelector, QuitPrompt, ReactNotification, RequiredLabel$1 as RequiredLabel, SANDBOX_NOTIFICATION, SUPPORTED_LANGUAGES_CODE, SandboxAlert, SchoolList, ScrollToTop, SearchBox$1 as SearchBox, SearchBoxContainer, SkillList, StarRatingSelector, SuggestionCategorySelector, TAB_COLORS, TINY_MCE_API_KEY, TheContent$1 as TheContent, TheLayout, ToggleButton, UploadFileButton, UserContainer, UserDetail, UserList, addTab, amplitudeClient, answerQuestion, answerQuestionDataPlayer, api, apiUpload, canAccess as canAccessRoute, changeNote, changeTags, clearTab, closeTab, debounce, editTab, editorConfig, firstCheckToken, generateRandomString, getCookieValue, getFileUrl, getInfo, getStaticFileUrl, getTextFromHTML, i18n, initAmplitude, isInViewport, isLocalhost, reset, setAlert, setAssessmentList, setAssignmentList, setAssistantList, setBadgeList, setBandScoreList, setCertificateList, setClassList, setConferenceRubricList, setConversationOneToOne, setCurrentStudentId, setCurrentStudentName, setCurrentStudentUserId, setCustomAlertList, setDataPlayer, setEditItemQuesion, setEnableIEP, setEnableMarioAi, setEnableSurvey, setFeedbackList, setFilterWidget, setGoalExampleList, setImproveMyClass, setLanguage, setLearningSupportCategoryList, setLoading, setMailCategory, setModal, setMoveItemQuestion, setMyStudent, setOpenModelCongratulation, setQuestionByCategory, setQuestionCateList, setQuestionList, setReflectionList, setReflectionResultList, setResetQuestionList, setSandboxMode, setSchoolBlankDayList, setSelectQuestion, setSemesterList, setSessionPlayer, setSessionTemplateGeneralClassList, setSessionTemplateList, setStartTime, setStrategyList, setStudentIdSelectedByTeacher, setStudentList, setSubjectList, setSuggestionList, setTurnOffPassWhenChangeMode, setTutorialScreenList, setUser, setUserList, setWeeklyQuestList, showFontSize, showMenuBar, store, systemCertificateUpload, systemStudentBadge, uploadFile, useFilters, useGalleryList, utcToLocalTime };
|