mario-core 2.9.419-feedback → 2.9.421-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 +519 -489
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +522 -492
- 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';
|
|
@@ -65,8 +65,8 @@ var gender = "Gender";
|
|
|
65
65
|
var grade = "Grade";
|
|
66
66
|
var grades = "Grades";
|
|
67
67
|
var current_grade = "Current Grade";
|
|
68
|
-
var student_name = "Student
|
|
69
|
-
var teacher_name = "Teacher
|
|
68
|
+
var student_name = "Student Name";
|
|
69
|
+
var teacher_name = "Teacher Name";
|
|
70
70
|
var start_date = "Start Date";
|
|
71
71
|
var end_date = "End Date";
|
|
72
72
|
var tooltip_content_readiness_to_learn_chart = "The represenation of individual student responses to their own feelings of Energy, Focus, Happiness, Safety, and Stress at the time administered. Note that scores are set on a 1-100 scale with the exception of Stress which optimum stress is set at '0' to get a sense of High Stress vs Low Stress.";
|
|
@@ -123,8 +123,8 @@ var default_question_for_students_or_teachers = "Default question for students o
|
|
|
123
123
|
var is_default_question_general_class = "Is default question general class";
|
|
124
124
|
var default_question_general_for_students_or_teachers = "Default question general for students or teachers";
|
|
125
125
|
var before_session = "Before session";
|
|
126
|
-
var edit_custom_alert = "Edit
|
|
127
|
-
var create_custom_alert = "Create
|
|
126
|
+
var edit_custom_alert = "Edit Custom Alert";
|
|
127
|
+
var create_custom_alert = "Create Custom Alert";
|
|
128
128
|
var total_of_custom_alert = "Total Custom Alerts";
|
|
129
129
|
var number_of_sessions = "Number of sessions";
|
|
130
130
|
var number_of_students = "Number of students";
|
|
@@ -714,9 +714,9 @@ var students_missing_a_weekly_check_in = "Students missing a weekly check in";
|
|
|
714
714
|
var student_stress_by_zone = "Student Stress by Zone";
|
|
715
715
|
var student_distribution = "Student Distribution";
|
|
716
716
|
var surveys_flags = "Survey's flags";
|
|
717
|
-
var yellow_flags = "Yellow
|
|
718
|
-
var green_flags = "Green
|
|
719
|
-
var red_flags = "Red
|
|
717
|
+
var yellow_flags = "Yellow Flags";
|
|
718
|
+
var green_flags = "Green Flags";
|
|
719
|
+
var red_flags = "Red Flags";
|
|
720
720
|
var show_by = "Show by";
|
|
721
721
|
var survey_overview = "Survey Overview";
|
|
722
722
|
var share_note = "Share Note";
|
|
@@ -756,7 +756,7 @@ var you_can_only_select_number_kpis_at_a_time = "You can only select {{number}}
|
|
|
756
756
|
var you_can_only_select_number_kpis_at_a_time_To_select_a_new_one_please_switch_off_one_of_the_previous_ones = "You can only select {{number}} KPIs at a time. To select a new one, please switch off one of the previous ones.";
|
|
757
757
|
var last_check__in = "Last Check in";
|
|
758
758
|
var how_many_times_a_strategy_has_been_chosen = "How many times a strategy has been chosen";
|
|
759
|
-
var these_metrics_come_from_students_check_ins_filter_above_to_change_the_data_set = "These metrics come from
|
|
759
|
+
var these_metrics_come_from_students_check_ins_filter_above_to_change_the_data_set = "These metrics come from student check-ins. Filter above to change the data set";
|
|
760
760
|
var not_yet_started = "Not yet started";
|
|
761
761
|
var in_progress = "In progress";
|
|
762
762
|
var export_check_ins_to_csv = "Export Check Ins to CSV";
|
|
@@ -772,7 +772,7 @@ var image_is_a_required = "Image is a required";
|
|
|
772
772
|
var old_iep = "Old IEP";
|
|
773
773
|
var create_next_years_iep = "Create Next Year's IEP";
|
|
774
774
|
var write_something_optional = "Write something (Optional)";
|
|
775
|
-
var the_effectiveness_of_learning_strategies_by_students_feedback = "The
|
|
775
|
+
var the_effectiveness_of_learning_strategies_by_students_feedback = "The effectiveness of learning strategies as rated by students";
|
|
776
776
|
var perceived_usefulness = "Perceived Usefulness";
|
|
777
777
|
var performance$1 = "Performance";
|
|
778
778
|
var not_enough_challenge_leading_to_boredom_and_lack_of_interest = "Not enough challenge, leading to boredom and lack of interest.";
|
|
@@ -786,7 +786,7 @@ var select_or_input_class_type = "Select or input class type";
|
|
|
786
786
|
var send_request = "Send Request";
|
|
787
787
|
var start_reflection = "Start Reflection";
|
|
788
788
|
var customize_reflection = "Customize Reflection";
|
|
789
|
-
var include_section_you_want_to_appear = "Include
|
|
789
|
+
var include_section_you_want_to_appear = "Include sections you want to appear";
|
|
790
790
|
var time_of_day = "Time of Day";
|
|
791
791
|
var iep_template = "IEP Template";
|
|
792
792
|
var one_roster = "OneRoster";
|
|
@@ -938,9 +938,9 @@ var completed_classwork = "Completed classwork";
|
|
|
938
938
|
var asked_for_help_when_needed = "Asked for help when needed";
|
|
939
939
|
var clear = "Clear ";
|
|
940
940
|
var missing_reflections = "Missing Reflections";
|
|
941
|
-
var total_students_missing_late_assignments = "Total
|
|
941
|
+
var total_students_missing_late_assignments = "Total Students Missing/Late Assignments";
|
|
942
942
|
var subject_class = "Subject class";
|
|
943
|
-
var chart_type = "Chart
|
|
943
|
+
var chart_type = "Chart Type";
|
|
944
944
|
var request_from = "Request from";
|
|
945
945
|
var are_you_sure_you_want_to_delete_this_item = "Are you sure you want to delete this item?";
|
|
946
946
|
var yes_delete = "Yes, delete";
|
|
@@ -2190,6 +2190,9 @@ var teacher_code = "Teacher code";
|
|
|
2190
2190
|
var number_of_conversations = "Number of conversations";
|
|
2191
2191
|
var number_of_expected_conversations_based_on_the_goal = "Number of expected conversations based on the goal";
|
|
2192
2192
|
var check_in = "Check-in";
|
|
2193
|
+
var search_for_a_student = "Search for a student";
|
|
2194
|
+
var survey_resulting_in_scheduled_sessions = "Survey resulting in scheduled sessions";
|
|
2195
|
+
var current_class_grade = "Current Class Grade";
|
|
2193
2196
|
var lang_us = {
|
|
2194
2197
|
dashboard: dashboard,
|
|
2195
2198
|
user: user,
|
|
@@ -4114,7 +4117,7 @@ var lang_us = {
|
|
|
4114
4117
|
financial_planning: financial_planning,
|
|
4115
4118
|
"you_haven't_added_any_plans_yet": "You haven't added any plans yet",
|
|
4116
4119
|
add_new_plan: add_new_plan,
|
|
4117
|
-
"students_shaded_red_have_an_incomplete_check-_in": "Students shaded red have an incomplete check-
|
|
4120
|
+
"students_shaded_red_have_an_incomplete_check-_in": "Students shaded red have an incomplete check-in",
|
|
4118
4121
|
rows_per_page: rows_per_page,
|
|
4119
4122
|
anonymous_link: anonymous_link,
|
|
4120
4123
|
select_ratings_of_questions: select_ratings_of_questions,
|
|
@@ -4396,7 +4399,10 @@ var lang_us = {
|
|
|
4396
4399
|
teacher_code: teacher_code,
|
|
4397
4400
|
number_of_conversations: number_of_conversations,
|
|
4398
4401
|
number_of_expected_conversations_based_on_the_goal: number_of_expected_conversations_based_on_the_goal,
|
|
4399
|
-
check_in: check_in
|
|
4402
|
+
check_in: check_in,
|
|
4403
|
+
search_for_a_student: search_for_a_student,
|
|
4404
|
+
survey_resulting_in_scheduled_sessions: survey_resulting_in_scheduled_sessions,
|
|
4405
|
+
current_class_grade: current_class_grade
|
|
4400
4406
|
};
|
|
4401
4407
|
|
|
4402
4408
|
var dashboard$1 = "Dashboard";
|
|
@@ -4426,8 +4432,8 @@ var gender$1 = "Gender";
|
|
|
4426
4432
|
var grade$1 = "Grade";
|
|
4427
4433
|
var grades$1 = "Grades";
|
|
4428
4434
|
var current_grade$1 = "Current Grade";
|
|
4429
|
-
var student_name$1 = "Student
|
|
4430
|
-
var teacher_name$1 = "Teacher
|
|
4435
|
+
var student_name$1 = "Student Name";
|
|
4436
|
+
var teacher_name$1 = "Teacher Name";
|
|
4431
4437
|
var start_date$1 = "Start Date";
|
|
4432
4438
|
var end_date$1 = "End Date";
|
|
4433
4439
|
var tooltip_content_readiness_to_learn_chart$1 = "The represenation of individual student responses to their own feelings of Energy, Focus, Happiness, Safety, and Stress at the time administered. Note that scores are set on a 1-100 scale with the exception of Stress which optimum stress is set at '0' to get a sense of High Stress vs Low Stress.";
|
|
@@ -4486,8 +4492,8 @@ var default_question_for_students_or_teachers$1 = "Default question for students
|
|
|
4486
4492
|
var is_default_question_general_class$1 = "Is default question general class";
|
|
4487
4493
|
var default_question_general_for_students_or_teachers$1 = "Default question general for students or teachers";
|
|
4488
4494
|
var before_session$1 = "Before session";
|
|
4489
|
-
var edit_custom_alert$1 = "Edit
|
|
4490
|
-
var create_custom_alert$1 = "Create
|
|
4495
|
+
var edit_custom_alert$1 = "Edit Custom Alert";
|
|
4496
|
+
var create_custom_alert$1 = "Create Custom Alert";
|
|
4491
4497
|
var total_of_custom_alert$1 = "Total Custom Alerts";
|
|
4492
4498
|
var number_of_sessions$1 = "Number of sessions";
|
|
4493
4499
|
var number_of_students$1 = "Number of students";
|
|
@@ -5078,9 +5084,9 @@ var students_missing_a_weekly_check_in$1 = "Students missing a weekly check in";
|
|
|
5078
5084
|
var student_stress_by_zone$1 = "Student Stress by Zone";
|
|
5079
5085
|
var student_distribution$1 = "Student Distribution";
|
|
5080
5086
|
var surveys_flags$1 = "Survey's flags";
|
|
5081
|
-
var yellow_flags$1 = "Yellow
|
|
5082
|
-
var green_flags$1 = "Green
|
|
5083
|
-
var red_flags$1 = "Red
|
|
5087
|
+
var yellow_flags$1 = "Yellow Flags";
|
|
5088
|
+
var green_flags$1 = "Green Flags";
|
|
5089
|
+
var red_flags$1 = "Red Flags";
|
|
5084
5090
|
var show_by$1 = "Show by";
|
|
5085
5091
|
var survey_overview$1 = "Survey Overview";
|
|
5086
5092
|
var share_note$1 = "Share Note";
|
|
@@ -5120,7 +5126,7 @@ var you_can_only_select_number_kpis_at_a_time$1 = "You can only select {{number}
|
|
|
5120
5126
|
var you_can_only_select_number_kpis_at_a_time_To_select_a_new_one_please_switch_off_one_of_the_previous_ones$1 = "You can only select {{number}} KPIs at a time. To select a new one, please switch off one of the previous ones.";
|
|
5121
5127
|
var last_check__in$1 = "Last Check in";
|
|
5122
5128
|
var how_many_times_a_strategy_has_been_chosen$1 = "How many times a strategy has been chosen";
|
|
5123
|
-
var these_metrics_come_from_students_check_ins_filter_above_to_change_the_data_set$1 = "These metrics come from
|
|
5129
|
+
var these_metrics_come_from_students_check_ins_filter_above_to_change_the_data_set$1 = "These metrics come from student check-ins. Filter above to change the data set";
|
|
5124
5130
|
var not_yet_started$1 = "Not yet started";
|
|
5125
5131
|
var in_progress$1 = "In progress";
|
|
5126
5132
|
var export_check_ins_to_csv$1 = "Export Check Ins to CSV";
|
|
@@ -5136,7 +5142,7 @@ var image_is_a_required$1 = "Image is a required";
|
|
|
5136
5142
|
var old_iep$1 = "Old IEP";
|
|
5137
5143
|
var create_next_years_iep$1 = "Create Next Year's IEP";
|
|
5138
5144
|
var write_something_optional$1 = "Write something (Optional)";
|
|
5139
|
-
var the_effectiveness_of_learning_strategies_by_students_feedback$1 = "The
|
|
5145
|
+
var the_effectiveness_of_learning_strategies_by_students_feedback$1 = "The effectiveness of learning strategies as rated by students";
|
|
5140
5146
|
var perceived_usefulness$1 = "Perceived Usefulness";
|
|
5141
5147
|
var performance$2 = "Performance";
|
|
5142
5148
|
var not_enough_challenge_leading_to_boredom_and_lack_of_interest$1 = "Not enough challenge, leading to boredom and lack of interest.";
|
|
@@ -5150,7 +5156,7 @@ var select_or_input_class_type$1 = "Select or input class type";
|
|
|
5150
5156
|
var send_request$1 = "Send Request";
|
|
5151
5157
|
var start_reflection$1 = "Start Reflection";
|
|
5152
5158
|
var customize_reflection$1 = "Customize Reflection";
|
|
5153
|
-
var include_section_you_want_to_appear$1 = "Include
|
|
5159
|
+
var include_section_you_want_to_appear$1 = "Include sections you want to appear";
|
|
5154
5160
|
var time_of_day$1 = "Time of Day";
|
|
5155
5161
|
var iep_template$1 = "IEP Template";
|
|
5156
5162
|
var one_roster$1 = "OneRoster";
|
|
@@ -5302,9 +5308,9 @@ var completed_classwork$1 = "Completed classwork";
|
|
|
5302
5308
|
var asked_for_help_when_needed$1 = "Asked for help when needed";
|
|
5303
5309
|
var clear$1 = "Clear ";
|
|
5304
5310
|
var missing_reflections$1 = "Missing Reflections";
|
|
5305
|
-
var total_students_missing_late_assignments$1 = "Total
|
|
5311
|
+
var total_students_missing_late_assignments$1 = "Total Students Missing/Late Assignments";
|
|
5306
5312
|
var subject_class$1 = "Subject class";
|
|
5307
|
-
var chart_type$1 = "Chart
|
|
5313
|
+
var chart_type$1 = "Chart Type";
|
|
5308
5314
|
var request_from$1 = "Request from";
|
|
5309
5315
|
var are_you_sure_you_want_to_delete_this_item$1 = "Are you sure you want to delete this item?";
|
|
5310
5316
|
var yes_delete$1 = "Yes, delete";
|
|
@@ -6550,6 +6556,9 @@ var save_new_password$1 = "Save new password";
|
|
|
6550
6556
|
var teacher_code$1 = "Teacher code";
|
|
6551
6557
|
var number_of_conversations$1 = "Number of conversations";
|
|
6552
6558
|
var number_of_expected_conversations_based_on_the_goal$1 = "Number of expected conversations based on the goal";
|
|
6559
|
+
var search_for_a_student$1 = "Search for a student";
|
|
6560
|
+
var survey_resulting_in_scheduled_sessions$1 = "Survey resulting in scheduled sessions";
|
|
6561
|
+
var current_class_grade$1 = "Current Class Grade";
|
|
6553
6562
|
var lang_uk = {
|
|
6554
6563
|
dashboard: dashboard$1,
|
|
6555
6564
|
user: user$1,
|
|
@@ -8474,7 +8483,7 @@ var lang_uk = {
|
|
|
8474
8483
|
financial_planning: financial_planning$1,
|
|
8475
8484
|
"you_haven't_added_any_plans_yet": "You haven't added any plans yet",
|
|
8476
8485
|
add_new_plan: add_new_plan$1,
|
|
8477
|
-
"students_shaded_red_have_an_incomplete_check-_in": "Students shaded red have an incomplete check-
|
|
8486
|
+
"students_shaded_red_have_an_incomplete_check-_in": "Students shaded red have an incomplete check-in",
|
|
8478
8487
|
rows_per_page: rows_per_page$1,
|
|
8479
8488
|
anonymous_link: anonymous_link$1,
|
|
8480
8489
|
select_ratings_of_questions: select_ratings_of_questions$1,
|
|
@@ -8753,7 +8762,10 @@ var lang_uk = {
|
|
|
8753
8762
|
save_new_password: save_new_password$1,
|
|
8754
8763
|
teacher_code: teacher_code$1,
|
|
8755
8764
|
number_of_conversations: number_of_conversations$1,
|
|
8756
|
-
number_of_expected_conversations_based_on_the_goal: number_of_expected_conversations_based_on_the_goal$1
|
|
8765
|
+
number_of_expected_conversations_based_on_the_goal: number_of_expected_conversations_based_on_the_goal$1,
|
|
8766
|
+
search_for_a_student: search_for_a_student$1,
|
|
8767
|
+
survey_resulting_in_scheduled_sessions: survey_resulting_in_scheduled_sessions$1,
|
|
8768
|
+
current_class_grade: current_class_grade$1
|
|
8757
8769
|
};
|
|
8758
8770
|
|
|
8759
8771
|
var dashboard$2 = "لوحة المعلومات";
|
|
@@ -10937,6 +10949,9 @@ var save_new_password$2 = "Save new password";
|
|
|
10937
10949
|
var teacher_code$2 = "Teacher code";
|
|
10938
10950
|
var number_of_conversations$2 = "Number of conversations";
|
|
10939
10951
|
var number_of_expected_conversations_based_on_the_goal$2 = "Number of expected conversations based on the goal";
|
|
10952
|
+
var search_for_a_student$2 = "Search for a student";
|
|
10953
|
+
var survey_resulting_in_scheduled_sessions$2 = "Survey resulting in scheduled sessions";
|
|
10954
|
+
var current_class_grade$2 = "Current Class Grade";
|
|
10940
10955
|
var lang_ar = {
|
|
10941
10956
|
dashboard: dashboard$2,
|
|
10942
10957
|
user: user$2,
|
|
@@ -13172,7 +13187,10 @@ var lang_ar = {
|
|
|
13172
13187
|
save_new_password: save_new_password$2,
|
|
13173
13188
|
teacher_code: teacher_code$2,
|
|
13174
13189
|
number_of_conversations: number_of_conversations$2,
|
|
13175
|
-
number_of_expected_conversations_based_on_the_goal: number_of_expected_conversations_based_on_the_goal$2
|
|
13190
|
+
number_of_expected_conversations_based_on_the_goal: number_of_expected_conversations_based_on_the_goal$2,
|
|
13191
|
+
search_for_a_student: search_for_a_student$2,
|
|
13192
|
+
survey_resulting_in_scheduled_sessions: survey_resulting_in_scheduled_sessions$2,
|
|
13193
|
+
current_class_grade: current_class_grade$2
|
|
13176
13194
|
};
|
|
13177
13195
|
|
|
13178
13196
|
var dashboard$3 = "Cuadro de mandos";
|
|
@@ -15356,6 +15374,9 @@ var save_new_password$3 = "Save new password";
|
|
|
15356
15374
|
var teacher_code$3 = "Teacher code";
|
|
15357
15375
|
var number_of_conversations$3 = "Number of conversations";
|
|
15358
15376
|
var number_of_expected_conversations_based_on_the_goal$3 = "Number of expected conversations based on the goal";
|
|
15377
|
+
var search_for_a_student$3 = "Search for a student";
|
|
15378
|
+
var survey_resulting_in_scheduled_sessions$3 = "Survey resulting in scheduled sessions";
|
|
15379
|
+
var current_class_grade$3 = "Current Class Grade";
|
|
15359
15380
|
var lang_es = {
|
|
15360
15381
|
dashboard: dashboard$3,
|
|
15361
15382
|
user: user$3,
|
|
@@ -17591,7 +17612,10 @@ var lang_es = {
|
|
|
17591
17612
|
save_new_password: save_new_password$3,
|
|
17592
17613
|
teacher_code: teacher_code$3,
|
|
17593
17614
|
number_of_conversations: number_of_conversations$3,
|
|
17594
|
-
number_of_expected_conversations_based_on_the_goal: number_of_expected_conversations_based_on_the_goal$3
|
|
17615
|
+
number_of_expected_conversations_based_on_the_goal: number_of_expected_conversations_based_on_the_goal$3,
|
|
17616
|
+
search_for_a_student: search_for_a_student$3,
|
|
17617
|
+
survey_resulting_in_scheduled_sessions: survey_resulting_in_scheduled_sessions$3,
|
|
17618
|
+
current_class_grade: current_class_grade$3
|
|
17595
17619
|
};
|
|
17596
17620
|
|
|
17597
17621
|
var dashboard$4 = "仪表板";
|
|
@@ -19775,6 +19799,9 @@ var save_new_password$4 = "Save new password";
|
|
|
19775
19799
|
var teacher_code$4 = "Teacher code";
|
|
19776
19800
|
var number_of_conversations$4 = "Number of conversations";
|
|
19777
19801
|
var number_of_expected_conversations_based_on_the_goal$4 = "Number of expected conversations based on the goal";
|
|
19802
|
+
var search_for_a_student$4 = "Search for a student";
|
|
19803
|
+
var survey_resulting_in_scheduled_sessions$4 = "Survey resulting in scheduled sessions";
|
|
19804
|
+
var current_class_grade$4 = "Current Class Grade";
|
|
19778
19805
|
var lang_zh = {
|
|
19779
19806
|
dashboard: dashboard$4,
|
|
19780
19807
|
user: user$4,
|
|
@@ -22010,7 +22037,10 @@ var lang_zh = {
|
|
|
22010
22037
|
save_new_password: save_new_password$4,
|
|
22011
22038
|
teacher_code: teacher_code$4,
|
|
22012
22039
|
number_of_conversations: number_of_conversations$4,
|
|
22013
|
-
number_of_expected_conversations_based_on_the_goal: number_of_expected_conversations_based_on_the_goal$4
|
|
22040
|
+
number_of_expected_conversations_based_on_the_goal: number_of_expected_conversations_based_on_the_goal$4,
|
|
22041
|
+
search_for_a_student: search_for_a_student$4,
|
|
22042
|
+
survey_resulting_in_scheduled_sessions: survey_resulting_in_scheduled_sessions$4,
|
|
22043
|
+
current_class_grade: current_class_grade$4
|
|
22014
22044
|
};
|
|
22015
22045
|
|
|
22016
22046
|
var TINY_MCE_API_KEY = "htqausuofrnali3nh9ivmlpq6v415o0tv2qikpg39bqf4pnk";
|
|
@@ -41893,212 +41923,6 @@ var TheHeaderDropdown = function TheHeaderDropdown(_ref) {
|
|
|
41893
41923
|
})), t("log_out")))));
|
|
41894
41924
|
};
|
|
41895
41925
|
|
|
41896
|
-
var apiGetLanguage = function apiGetLanguage() {
|
|
41897
|
-
return api.get(BASE_URL + "/api/language");
|
|
41898
|
-
};
|
|
41899
|
-
|
|
41900
|
-
var apiUpdateLanguage = function apiUpdateLanguage(lang) {
|
|
41901
|
-
return api.put(BASE_URL + "/api/language?lang=" + lang);
|
|
41902
|
-
};
|
|
41903
|
-
|
|
41904
|
-
var LANGUAGE_SYSTEM = "LANGUAGE_SYSTEM";
|
|
41905
|
-
|
|
41906
|
-
var useLanguages = function useLanguages() {
|
|
41907
|
-
var dispatch = useDispatch();
|
|
41908
|
-
|
|
41909
|
-
var _useTranslation = useTranslation(),
|
|
41910
|
-
i18n = _useTranslation.i18n;
|
|
41911
|
-
|
|
41912
|
-
var language = useSelector(function (state) {
|
|
41913
|
-
return state.common.language;
|
|
41914
|
-
});
|
|
41915
|
-
var defaultLanguage = getCookieValue(LANGUAGE_SYSTEM) != null ? getCookieValue(LANGUAGE_SYSTEM) : DEFAULT_LANGUAGE_CODE;
|
|
41916
|
-
|
|
41917
|
-
var _useState = useState([]),
|
|
41918
|
-
languageList = _useState[0],
|
|
41919
|
-
setLanguageList = _useState[1];
|
|
41920
|
-
|
|
41921
|
-
var _useState2 = useState(false),
|
|
41922
|
-
dropdownOpen = _useState2[0],
|
|
41923
|
-
setDropdownOpen = _useState2[1];
|
|
41924
|
-
|
|
41925
|
-
var _useState3 = useState(defaultLanguage),
|
|
41926
|
-
currentLang = _useState3[0],
|
|
41927
|
-
setCurrentLang = _useState3[1];
|
|
41928
|
-
|
|
41929
|
-
var toggle = function toggle() {
|
|
41930
|
-
return setDropdownOpen(function (prevState) {
|
|
41931
|
-
return !prevState;
|
|
41932
|
-
});
|
|
41933
|
-
};
|
|
41934
|
-
|
|
41935
|
-
var changeLanguageApp = function changeLanguageApp(lang) {
|
|
41936
|
-
try {
|
|
41937
|
-
var _temp3 = function _temp3() {
|
|
41938
|
-
dispatch(setLoading(false));
|
|
41939
|
-
};
|
|
41940
|
-
|
|
41941
|
-
dispatch(setLoading(true));
|
|
41942
|
-
|
|
41943
|
-
var _temp4 = _catch(function () {
|
|
41944
|
-
return Promise.resolve(apiUpdateLanguage(lang)).then(function () {
|
|
41945
|
-
i18n.changeLanguage(lang);
|
|
41946
|
-
setCurrentLang(lang);
|
|
41947
|
-
dispatch(setLanguage(lang));
|
|
41948
|
-
});
|
|
41949
|
-
}, function (err) {
|
|
41950
|
-
var _err$response, _err$response$data;
|
|
41951
|
-
|
|
41952
|
-
dispatch(setAlert({
|
|
41953
|
-
type: "danger",
|
|
41954
|
-
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
|
|
41955
|
-
}));
|
|
41956
|
-
});
|
|
41957
|
-
|
|
41958
|
-
return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(_temp3) : _temp3(_temp4));
|
|
41959
|
-
} catch (e) {
|
|
41960
|
-
return Promise.reject(e);
|
|
41961
|
-
}
|
|
41962
|
-
};
|
|
41963
|
-
|
|
41964
|
-
var getListLanguage = function getListLanguage() {
|
|
41965
|
-
try {
|
|
41966
|
-
var _temp6 = _catch(function () {
|
|
41967
|
-
return Promise.resolve(apiGetLanguage()).then(function (res) {
|
|
41968
|
-
setLanguageList(res.data);
|
|
41969
|
-
});
|
|
41970
|
-
}, function (err) {
|
|
41971
|
-
var _err$response2, _err$response2$data;
|
|
41972
|
-
|
|
41973
|
-
dispatch(setAlert({
|
|
41974
|
-
type: "danger",
|
|
41975
|
-
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
|
|
41976
|
-
}));
|
|
41977
|
-
});
|
|
41978
|
-
|
|
41979
|
-
return Promise.resolve(_temp6 && _temp6.then ? _temp6.then(function () {}) : void 0);
|
|
41980
|
-
} catch (e) {
|
|
41981
|
-
return Promise.reject(e);
|
|
41982
|
-
}
|
|
41983
|
-
};
|
|
41984
|
-
|
|
41985
|
-
useEffect(function () {
|
|
41986
|
-
defaultLanguage != language && changeLanguageApp(defaultLanguage);
|
|
41987
|
-
getListLanguage();
|
|
41988
|
-
}, []);
|
|
41989
|
-
return {
|
|
41990
|
-
languageList: languageList,
|
|
41991
|
-
toggle: toggle,
|
|
41992
|
-
dropdownOpen: dropdownOpen,
|
|
41993
|
-
currentLang: currentLang,
|
|
41994
|
-
changeLanguageApp: changeLanguageApp,
|
|
41995
|
-
setCurrentLang: setCurrentLang
|
|
41996
|
-
};
|
|
41997
|
-
};
|
|
41998
|
-
|
|
41999
|
-
var TheLanguageDropdown = function TheLanguageDropdown() {
|
|
42000
|
-
var _useLanguages = useLanguages(),
|
|
42001
|
-
languageList = _useLanguages.languageList,
|
|
42002
|
-
toggle = _useLanguages.toggle,
|
|
42003
|
-
dropdownOpen = _useLanguages.dropdownOpen,
|
|
42004
|
-
currentLang = _useLanguages.currentLang,
|
|
42005
|
-
changeLanguageApp = _useLanguages.changeLanguageApp;
|
|
42006
|
-
|
|
42007
|
-
var currentLanguage = useMemo(function () {
|
|
42008
|
-
var current = languageList.find(function (i) {
|
|
42009
|
-
return i.code === currentLang;
|
|
42010
|
-
});
|
|
42011
|
-
if (!current) return null;
|
|
42012
|
-
return React.createElement(React.Fragment, null, React.createElement("img", {
|
|
42013
|
-
className: "mr-2 " + styles['dropdown-menu-flag'],
|
|
42014
|
-
src: "" + getStaticFileUrl(current.image)
|
|
42015
|
-
}), " ", current.name);
|
|
42016
|
-
}, [currentLang, languageList]);
|
|
42017
|
-
return React.createElement(Dropdown, {
|
|
42018
|
-
isOpen: dropdownOpen,
|
|
42019
|
-
toggle: toggle,
|
|
42020
|
-
className: "" + styles["dropdown-menu"]
|
|
42021
|
-
}, React.createElement(DropdownToggle, {
|
|
42022
|
-
className: styles["header-avatar"] + " d-flex align-items-center"
|
|
42023
|
-
}, React.createElement("span", {
|
|
42024
|
-
style: {
|
|
42025
|
-
color: "#000",
|
|
42026
|
-
textTransform: "capitalize",
|
|
42027
|
-
display: 'flex',
|
|
42028
|
-
alignItems: 'center'
|
|
42029
|
-
}
|
|
42030
|
-
}, currentLanguage, React.createElement(BsChevronDown, {
|
|
42031
|
-
className: "ml-2",
|
|
42032
|
-
style: {
|
|
42033
|
-
fontSize: '10px'
|
|
42034
|
-
}
|
|
42035
|
-
}))), React.createElement(DropdownMenu, {
|
|
42036
|
-
className: styles["dropdown-content-language"]
|
|
42037
|
-
}, !!languageList && languageList.length > 0 && languageList.map(function (lang, index) {
|
|
42038
|
-
return React.createElement(DropdownItem, {
|
|
42039
|
-
key: lang.code,
|
|
42040
|
-
className: styles["dropdown-change"] + " px-0 py-0 " + (index === languageList.length - 1 ? "pb-2" : "pt-2"),
|
|
42041
|
-
onClick: function onClick() {
|
|
42042
|
-
return changeLanguageApp(lang.code);
|
|
42043
|
-
}
|
|
42044
|
-
}, React.createElement("div", {
|
|
42045
|
-
className: styles["dropdown-item-language"] + " " + styles["item-logout"] + " " + (currentLang == lang.code ? styles['dropdown-item-language-active'] : "") + " d-flex align-items-center w-100"
|
|
42046
|
-
}, React.createElement("span", {
|
|
42047
|
-
className: "mr-2 d-flex hover-opacity"
|
|
42048
|
-
}, React.createElement("img", {
|
|
42049
|
-
style: {
|
|
42050
|
-
width: "30px",
|
|
42051
|
-
height: "25px",
|
|
42052
|
-
borderRadius: "5px"
|
|
42053
|
-
},
|
|
42054
|
-
src: getStaticFileUrl(lang.image)
|
|
42055
|
-
})), lang.name));
|
|
42056
|
-
})));
|
|
42057
|
-
};
|
|
42058
|
-
|
|
42059
|
-
var TheHeader = function TheHeader(_ref) {
|
|
42060
|
-
var onToggleModel = _ref.onToggleModel;
|
|
42061
|
-
var dispatch = useDispatch();
|
|
42062
|
-
var sidebarShow = useSelector(function (state) {
|
|
42063
|
-
return state.common.sidebarShow;
|
|
42064
|
-
});
|
|
42065
|
-
|
|
42066
|
-
var _useTranslation = useTranslation(),
|
|
42067
|
-
t = _useTranslation.t;
|
|
42068
|
-
|
|
42069
|
-
var toggleSidebarMobile = function toggleSidebarMobile() {
|
|
42070
|
-
var val = [false, "responsive"].includes(sidebarShow) ? true : "responsive";
|
|
42071
|
-
dispatch(setSidebar(val));
|
|
42072
|
-
};
|
|
42073
|
-
|
|
42074
|
-
var isDistrict = window.location.host.includes("-district");
|
|
42075
|
-
return React.createElement(CHeader, {
|
|
42076
|
-
withSubheader: true,
|
|
42077
|
-
className: "d-flex align-items-center justify-content-end"
|
|
42078
|
-
}, React.createElement(CToggler, {
|
|
42079
|
-
inHeader: true,
|
|
42080
|
-
className: "ml-md-3 d-lg-none",
|
|
42081
|
-
onClick: toggleSidebarMobile
|
|
42082
|
-
}), React.createElement(CHeaderBrand, {
|
|
42083
|
-
className: "mx-auto flex-grow-1 d-lg-none",
|
|
42084
|
-
to: "/"
|
|
42085
|
-
}, React.createElement("img", {
|
|
42086
|
-
src: getStaticFileUrl(Images.LOGO_HEADER),
|
|
42087
|
-
className: styles["header-logo"]
|
|
42088
|
-
})), React.createElement(CHeaderNav, {
|
|
42089
|
-
className: "pr-3"
|
|
42090
|
-
}, React.createElement(TheLanguageDropdown, null), React.createElement("a", {
|
|
42091
|
-
className: "mr-3",
|
|
42092
|
-
style: {
|
|
42093
|
-
color: '#000'
|
|
42094
|
-
},
|
|
42095
|
-
href: '/privacy-policy',
|
|
42096
|
-
target: "blank"
|
|
42097
|
-
}, t("privacy_policy")), !isDistrict && React.createElement(NotificationButton, null), React.createElement(TheHeaderDropdown, {
|
|
42098
|
-
onToggleModel: onToggleModel
|
|
42099
|
-
})));
|
|
42100
|
-
};
|
|
42101
|
-
|
|
42102
41926
|
var TITLE$3 = "Not found";
|
|
42103
41927
|
|
|
42104
41928
|
var NotFound = function NotFound() {
|
|
@@ -42156,258 +41980,6 @@ var TheContent = function TheContent(_ref) {
|
|
|
42156
41980
|
|
|
42157
41981
|
var TheContent$1 = React.memo(TheContent);
|
|
42158
41982
|
|
|
42159
|
-
var loadingStyle = {
|
|
42160
|
-
minWidth: "100vw",
|
|
42161
|
-
minHeight: "100vh",
|
|
42162
|
-
position: "fixed",
|
|
42163
|
-
top: 0,
|
|
42164
|
-
left: 0,
|
|
42165
|
-
zIndex: 999999999,
|
|
42166
|
-
backgroundColor: "rgba(0, 0, 0, 0.4)",
|
|
42167
|
-
display: "flex",
|
|
42168
|
-
justifyContent: "center",
|
|
42169
|
-
alignItems: "center"
|
|
42170
|
-
};
|
|
42171
|
-
|
|
42172
|
-
var Loading = function Loading() {
|
|
42173
|
-
var isLoading = useSelector(function (state) {
|
|
42174
|
-
return state.common.isLoading;
|
|
42175
|
-
});
|
|
42176
|
-
localStorage.setItem("LAST_TIME_REQUETST", moment().utc().format("YYYY-MM-DD HH:mm:ss"));
|
|
42177
|
-
return isLoading ? React.createElement("div", {
|
|
42178
|
-
style: loadingStyle
|
|
42179
|
-
}, React.createElement("div", {
|
|
42180
|
-
className: "spinner-border text-secondary",
|
|
42181
|
-
role: "status"
|
|
42182
|
-
}, React.createElement("span", {
|
|
42183
|
-
className: "sr-only"
|
|
42184
|
-
}, "Loading..."))) : null;
|
|
42185
|
-
};
|
|
42186
|
-
|
|
42187
|
-
var firstCheckToken = function firstCheckToken() {
|
|
42188
|
-
return Promise.resolve(_catch(function () {
|
|
42189
|
-
var token = getAccessToken();
|
|
42190
|
-
return token ? Promise.resolve(checkToken(token)).then(function (tokenStatus) {
|
|
42191
|
-
return tokenStatus.data ? true : false;
|
|
42192
|
-
}) : false;
|
|
42193
|
-
}, function () {
|
|
42194
|
-
return false;
|
|
42195
|
-
}));
|
|
42196
|
-
};
|
|
42197
|
-
|
|
42198
|
-
var canAccess = function canAccess(userRoles, componentRoles) {
|
|
42199
|
-
if (!Array.isArray(userRoles)) {
|
|
42200
|
-
return false;
|
|
42201
|
-
}
|
|
42202
|
-
|
|
42203
|
-
if (Array.isArray(componentRoles)) {
|
|
42204
|
-
var intersects = userRoles.filter(function (i) {
|
|
42205
|
-
return componentRoles.includes(i);
|
|
42206
|
-
});
|
|
42207
|
-
return intersects.length > 0;
|
|
42208
|
-
}
|
|
42209
|
-
|
|
42210
|
-
return true;
|
|
42211
|
-
};
|
|
42212
|
-
|
|
42213
|
-
var ModelSelectRole = function ModelSelectRole(_ref) {
|
|
42214
|
-
var _handleUserRole;
|
|
42215
|
-
|
|
42216
|
-
var open = _ref.open,
|
|
42217
|
-
onToggleModel = _ref.onToggleModel;
|
|
42218
|
-
var dispatch = useDispatch();
|
|
42219
|
-
|
|
42220
|
-
var _useTranslation = useTranslation(),
|
|
42221
|
-
t = _useTranslation.t;
|
|
42222
|
-
|
|
42223
|
-
var history = useHistory();
|
|
42224
|
-
var pathname = window.location.pathname;
|
|
42225
|
-
var user = useSelector(function (state) {
|
|
42226
|
-
return state.common.user;
|
|
42227
|
-
});
|
|
42228
|
-
var roles = user === null || user === void 0 ? void 0 : user.roles;
|
|
42229
|
-
|
|
42230
|
-
var handleSelectUserRoles = function handleSelectUserRoles(roles) {
|
|
42231
|
-
dispatch(setLoading(true));
|
|
42232
|
-
var roleSelect = roles.includes("Teacher/Assistant") ? ["Teacher", "Assistant"] : roles;
|
|
42233
|
-
dispatch(setUser(_extends({}, user, {
|
|
42234
|
-
roles: roleSelect
|
|
42235
|
-
})));
|
|
42236
|
-
localStorage.setItem("ROLES", roleSelect.toString());
|
|
42237
|
-
onToggleModel();
|
|
42238
|
-
|
|
42239
|
-
if (roles.includes("Parent")) {
|
|
42240
|
-
history.push("/parent");
|
|
42241
|
-
} else if (roles.includes("Admin")) {
|
|
42242
|
-
history.push("/admin/home");
|
|
42243
|
-
} else {
|
|
42244
|
-
pathname !== "/home" ? history.push("/home") : window.location.reload();
|
|
42245
|
-
}
|
|
42246
|
-
};
|
|
42247
|
-
|
|
42248
|
-
return React.createElement(Modal, {
|
|
42249
|
-
isOpen: open,
|
|
42250
|
-
toggle: function toggle() {
|
|
42251
|
-
return onToggleModel();
|
|
42252
|
-
},
|
|
42253
|
-
className: "" + styles["model-switch-roles"],
|
|
42254
|
-
centered: true
|
|
42255
|
-
}, React.createElement("p", {
|
|
42256
|
-
className: "" + styles["title"]
|
|
42257
|
-
}, 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) {
|
|
42258
|
-
return React.createElement("p", {
|
|
42259
|
-
key: r,
|
|
42260
|
-
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" : ""],
|
|
42261
|
-
onClick: function onClick() {
|
|
42262
|
-
return handleSelectUserRoles([r]);
|
|
42263
|
-
}
|
|
42264
|
-
}, r == "SecondaryTeacher" ? "Support Teacher" : r);
|
|
42265
|
-
})));
|
|
42266
|
-
};
|
|
42267
|
-
|
|
42268
|
-
var TheLayout = function TheLayout(_ref) {
|
|
42269
|
-
var routes = _ref.routes,
|
|
42270
|
-
navigation = _ref.navigation;
|
|
42271
|
-
var history = useHistory();
|
|
42272
|
-
var dispatch = useDispatch();
|
|
42273
|
-
var user = useSelector(function (state) {
|
|
42274
|
-
return state.common.user;
|
|
42275
|
-
});
|
|
42276
|
-
var language = useSelector(function (state) {
|
|
42277
|
-
return state.common.language;
|
|
42278
|
-
});
|
|
42279
|
-
|
|
42280
|
-
var _useState = useState(false),
|
|
42281
|
-
openModelSelectRole = _useState[0],
|
|
42282
|
-
setOpenModelSelectRole = _useState[1];
|
|
42283
|
-
|
|
42284
|
-
var _useTranslation = useTranslation(),
|
|
42285
|
-
t = _useTranslation.t;
|
|
42286
|
-
|
|
42287
|
-
var location = useLocation();
|
|
42288
|
-
var isNotification = location.pathname.includes("notifications");
|
|
42289
|
-
var isDistrict = window.location.host.includes("-district");
|
|
42290
|
-
|
|
42291
|
-
var handleToggleModel = function handleToggleModel() {
|
|
42292
|
-
setOpenModelSelectRole(!openModelSelectRole);
|
|
42293
|
-
};
|
|
42294
|
-
|
|
42295
|
-
var authRoutes = useMemo(function () {
|
|
42296
|
-
return routes.filter(function (route) {
|
|
42297
|
-
return canAccess(user === null || user === void 0 ? void 0 : user.roles, route.roles);
|
|
42298
|
-
}).filter(function (route) {
|
|
42299
|
-
return !!route.isDistrict === isDistrict;
|
|
42300
|
-
});
|
|
42301
|
-
}, [user, language]);
|
|
42302
|
-
var authNavigations = useMemo(function () {
|
|
42303
|
-
return navigation.map(function (item) {
|
|
42304
|
-
var _item$_children, _item$_children2;
|
|
42305
|
-
|
|
42306
|
-
return _extends({}, item, {
|
|
42307
|
-
name: t(item.name),
|
|
42308
|
-
_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) {
|
|
42309
|
-
return _extends({}, x, {
|
|
42310
|
-
name: t(x.name)
|
|
42311
|
-
});
|
|
42312
|
-
}) : undefined
|
|
42313
|
-
});
|
|
42314
|
-
}).filter(function (nav) {
|
|
42315
|
-
return canAccess(user === null || user === void 0 ? void 0 : user.roles, nav.roles);
|
|
42316
|
-
}).filter(function (nav) {
|
|
42317
|
-
return !!nav.isDistrict === isDistrict;
|
|
42318
|
-
});
|
|
42319
|
-
}, [user, language]);
|
|
42320
|
-
|
|
42321
|
-
var getInformationSetting = function getInformationSetting() {
|
|
42322
|
-
try {
|
|
42323
|
-
var _temp2 = _catch(function () {
|
|
42324
|
-
return Promise.resolve(getSchoolSettings()).then(function (res) {
|
|
42325
|
-
dispatch(setSandboxMode(res.data.isSandboxMode));
|
|
42326
|
-
});
|
|
42327
|
-
}, function (err) {
|
|
42328
|
-
console.error(err);
|
|
42329
|
-
});
|
|
42330
|
-
|
|
42331
|
-
return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
|
|
42332
|
-
} catch (e) {
|
|
42333
|
-
return Promise.reject(e);
|
|
42334
|
-
}
|
|
42335
|
-
};
|
|
42336
|
-
|
|
42337
|
-
useEffect(function () {
|
|
42338
|
-
checkAuthentication();
|
|
42339
|
-
}, []);
|
|
42340
|
-
useEffect(function () {
|
|
42341
|
-
getInformationSetting();
|
|
42342
|
-
}, [location.pathname]);
|
|
42343
|
-
|
|
42344
|
-
var checkAuthentication = function checkAuthentication() {
|
|
42345
|
-
try {
|
|
42346
|
-
var _temp4 = _catch(function () {
|
|
42347
|
-
return Promise.resolve(firstCheckToken()).then(function (tokenStatus) {
|
|
42348
|
-
tokenStatus ? loadInfo() : resetAuth();
|
|
42349
|
-
});
|
|
42350
|
-
}, function () {
|
|
42351
|
-
resetAuth();
|
|
42352
|
-
});
|
|
42353
|
-
|
|
42354
|
-
return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(function () {}) : void 0);
|
|
42355
|
-
} catch (e) {
|
|
42356
|
-
return Promise.reject(e);
|
|
42357
|
-
}
|
|
42358
|
-
};
|
|
42359
|
-
|
|
42360
|
-
var loadInfo = function loadInfo() {
|
|
42361
|
-
try {
|
|
42362
|
-
var _temp6 = _catch(function () {
|
|
42363
|
-
return Promise.resolve(getInfo()).then(function (info) {
|
|
42364
|
-
var _info$data, _info$data$roles;
|
|
42365
|
-
|
|
42366
|
-
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"))) {
|
|
42367
|
-
resetAuth();
|
|
42368
|
-
}
|
|
42369
|
-
|
|
42370
|
-
dispatch(setUser(info.data));
|
|
42371
|
-
});
|
|
42372
|
-
}, function () {
|
|
42373
|
-
resetAuth();
|
|
42374
|
-
});
|
|
42375
|
-
|
|
42376
|
-
return Promise.resolve(_temp6 && _temp6.then ? _temp6.then(function () {}) : void 0);
|
|
42377
|
-
} catch (e) {
|
|
42378
|
-
return Promise.reject(e);
|
|
42379
|
-
}
|
|
42380
|
-
};
|
|
42381
|
-
|
|
42382
|
-
var resetAuth = function resetAuth() {
|
|
42383
|
-
localStorage.removeItem(ACCESS_TOKEN);
|
|
42384
|
-
sessionStorage.removeItem(ACCESS_TOKEN);
|
|
42385
|
-
localStorage.removeItem("ROLES");
|
|
42386
|
-
history.push("/");
|
|
42387
|
-
};
|
|
42388
|
-
|
|
42389
|
-
if (!user) {
|
|
42390
|
-
return React.createElement(Loading, null);
|
|
42391
|
-
}
|
|
42392
|
-
|
|
42393
|
-
return React.createElement("div", {
|
|
42394
|
-
className: "c-app c-default-layout"
|
|
42395
|
-
}, !isNotification && React.createElement(TheSidebar, {
|
|
42396
|
-
navigation: authNavigations
|
|
42397
|
-
}), React.createElement("div", {
|
|
42398
|
-
className: "c-wrapper"
|
|
42399
|
-
}, !isNotification && React.createElement(TheHeader, {
|
|
42400
|
-
onToggleModel: handleToggleModel
|
|
42401
|
-
}), React.createElement("div", {
|
|
42402
|
-
className: "c-body bg-white"
|
|
42403
|
-
}, React.createElement(TheContent$1, {
|
|
42404
|
-
routes: authRoutes
|
|
42405
|
-
}))), React.createElement(ModelSelectRole, {
|
|
42406
|
-
open: openModelSelectRole,
|
|
42407
|
-
onToggleModel: handleToggleModel
|
|
42408
|
-
}));
|
|
42409
|
-
};
|
|
42410
|
-
|
|
42411
41983
|
var buttonTextStyle = {
|
|
42412
41984
|
fontWeight: 500
|
|
42413
41985
|
};
|
|
@@ -51788,6 +51360,34 @@ var UserDetail = function UserDetail() {
|
|
|
51788
51360
|
});
|
|
51789
51361
|
};
|
|
51790
51362
|
|
|
51363
|
+
var loadingStyle = {
|
|
51364
|
+
minWidth: "100vw",
|
|
51365
|
+
minHeight: "100vh",
|
|
51366
|
+
position: "fixed",
|
|
51367
|
+
top: 0,
|
|
51368
|
+
left: 0,
|
|
51369
|
+
zIndex: 999999999,
|
|
51370
|
+
backgroundColor: "rgba(0, 0, 0, 0.4)",
|
|
51371
|
+
display: "flex",
|
|
51372
|
+
justifyContent: "center",
|
|
51373
|
+
alignItems: "center"
|
|
51374
|
+
};
|
|
51375
|
+
|
|
51376
|
+
var Loading = function Loading() {
|
|
51377
|
+
var isLoading = useSelector(function (state) {
|
|
51378
|
+
return state.common.isLoading;
|
|
51379
|
+
});
|
|
51380
|
+
localStorage.setItem("LAST_TIME_REQUETST", moment().utc().format("YYYY-MM-DD HH:mm:ss"));
|
|
51381
|
+
return isLoading ? React.createElement("div", {
|
|
51382
|
+
style: loadingStyle
|
|
51383
|
+
}, React.createElement("div", {
|
|
51384
|
+
className: "spinner-border text-secondary",
|
|
51385
|
+
role: "status"
|
|
51386
|
+
}, React.createElement("span", {
|
|
51387
|
+
className: "sr-only"
|
|
51388
|
+
}, "Loading..."))) : null;
|
|
51389
|
+
};
|
|
51390
|
+
|
|
51791
51391
|
var ScrollToTop = function ScrollToTop() {
|
|
51792
51392
|
var _useLocation = useLocation(),
|
|
51793
51393
|
pathname = _useLocation.pathname;
|
|
@@ -54811,6 +54411,32 @@ var store = configureStore({
|
|
|
54811
54411
|
}
|
|
54812
54412
|
});
|
|
54813
54413
|
|
|
54414
|
+
var firstCheckToken = function firstCheckToken() {
|
|
54415
|
+
return Promise.resolve(_catch(function () {
|
|
54416
|
+
var token = getAccessToken();
|
|
54417
|
+
return token ? Promise.resolve(checkToken(token)).then(function (tokenStatus) {
|
|
54418
|
+
return tokenStatus.data ? true : false;
|
|
54419
|
+
}) : false;
|
|
54420
|
+
}, function () {
|
|
54421
|
+
return false;
|
|
54422
|
+
}));
|
|
54423
|
+
};
|
|
54424
|
+
|
|
54425
|
+
var canAccess = function canAccess(userRoles, componentRoles) {
|
|
54426
|
+
if (!Array.isArray(userRoles)) {
|
|
54427
|
+
return false;
|
|
54428
|
+
}
|
|
54429
|
+
|
|
54430
|
+
if (Array.isArray(componentRoles)) {
|
|
54431
|
+
var intersects = userRoles.filter(function (i) {
|
|
54432
|
+
return componentRoles.includes(i);
|
|
54433
|
+
});
|
|
54434
|
+
return intersects.length > 0;
|
|
54435
|
+
}
|
|
54436
|
+
|
|
54437
|
+
return true;
|
|
54438
|
+
};
|
|
54439
|
+
|
|
54814
54440
|
var isInViewport = function isInViewport(el) {
|
|
54815
54441
|
var rect = el === null || el === void 0 ? void 0 : el.getBoundingClientRect();
|
|
54816
54442
|
return rect.top >= 0 && rect.left >= 0 && rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && rect.right <= (window.innerWidth || document.documentElement.clientWidth);
|
|
@@ -54844,6 +54470,410 @@ var generateRandomString = (function () {
|
|
|
54844
54470
|
return (Math.random() + 1).toString(36).substring(7);
|
|
54845
54471
|
});
|
|
54846
54472
|
|
|
54473
|
+
var apiGetLanguage = function apiGetLanguage() {
|
|
54474
|
+
return api.get(BASE_URL + "/api/language");
|
|
54475
|
+
};
|
|
54476
|
+
|
|
54477
|
+
var apiUpdateLanguage = function apiUpdateLanguage(lang) {
|
|
54478
|
+
return api.put(BASE_URL + "/api/language?lang=" + lang);
|
|
54479
|
+
};
|
|
54480
|
+
|
|
54481
|
+
var LANGUAGE_SYSTEM = "LANGUAGE_SYSTEM";
|
|
54482
|
+
|
|
54483
|
+
var useLanguages = function useLanguages() {
|
|
54484
|
+
var dispatch = useDispatch();
|
|
54485
|
+
|
|
54486
|
+
var _useTranslation = useTranslation(),
|
|
54487
|
+
i18n = _useTranslation.i18n;
|
|
54488
|
+
|
|
54489
|
+
var language = useSelector(function (state) {
|
|
54490
|
+
return state.common.language;
|
|
54491
|
+
});
|
|
54492
|
+
var defaultLanguage = getCookieValue(LANGUAGE_SYSTEM) != null ? getCookieValue(LANGUAGE_SYSTEM) : DEFAULT_LANGUAGE_CODE;
|
|
54493
|
+
|
|
54494
|
+
var _useState = useState([]),
|
|
54495
|
+
languageList = _useState[0],
|
|
54496
|
+
setLanguageList = _useState[1];
|
|
54497
|
+
|
|
54498
|
+
var _useState2 = useState(false),
|
|
54499
|
+
dropdownOpen = _useState2[0],
|
|
54500
|
+
setDropdownOpen = _useState2[1];
|
|
54501
|
+
|
|
54502
|
+
var _useState3 = useState(defaultLanguage),
|
|
54503
|
+
currentLang = _useState3[0],
|
|
54504
|
+
setCurrentLang = _useState3[1];
|
|
54505
|
+
|
|
54506
|
+
var toggle = function toggle() {
|
|
54507
|
+
return setDropdownOpen(function (prevState) {
|
|
54508
|
+
return !prevState;
|
|
54509
|
+
});
|
|
54510
|
+
};
|
|
54511
|
+
|
|
54512
|
+
var changeLanguageApp = function changeLanguageApp(lang) {
|
|
54513
|
+
try {
|
|
54514
|
+
var _temp3 = function _temp3() {
|
|
54515
|
+
dispatch(setLoading(false));
|
|
54516
|
+
};
|
|
54517
|
+
|
|
54518
|
+
dispatch(setLoading(true));
|
|
54519
|
+
|
|
54520
|
+
var _temp4 = _catch(function () {
|
|
54521
|
+
return Promise.resolve(apiUpdateLanguage(lang)).then(function () {
|
|
54522
|
+
i18n.changeLanguage(lang);
|
|
54523
|
+
setCurrentLang(lang);
|
|
54524
|
+
dispatch(setLanguage(lang));
|
|
54525
|
+
});
|
|
54526
|
+
}, function (err) {
|
|
54527
|
+
var _err$response, _err$response$data;
|
|
54528
|
+
|
|
54529
|
+
dispatch(setAlert({
|
|
54530
|
+
type: "danger",
|
|
54531
|
+
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
|
|
54532
|
+
}));
|
|
54533
|
+
});
|
|
54534
|
+
|
|
54535
|
+
return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(_temp3) : _temp3(_temp4));
|
|
54536
|
+
} catch (e) {
|
|
54537
|
+
return Promise.reject(e);
|
|
54538
|
+
}
|
|
54539
|
+
};
|
|
54540
|
+
|
|
54541
|
+
var getListLanguage = function getListLanguage() {
|
|
54542
|
+
try {
|
|
54543
|
+
var _temp6 = _catch(function () {
|
|
54544
|
+
return Promise.resolve(apiGetLanguage()).then(function (res) {
|
|
54545
|
+
setLanguageList(res.data);
|
|
54546
|
+
});
|
|
54547
|
+
}, function (err) {
|
|
54548
|
+
var _err$response2, _err$response2$data;
|
|
54549
|
+
|
|
54550
|
+
dispatch(setAlert({
|
|
54551
|
+
type: "danger",
|
|
54552
|
+
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
|
|
54553
|
+
}));
|
|
54554
|
+
});
|
|
54555
|
+
|
|
54556
|
+
return Promise.resolve(_temp6 && _temp6.then ? _temp6.then(function () {}) : void 0);
|
|
54557
|
+
} catch (e) {
|
|
54558
|
+
return Promise.reject(e);
|
|
54559
|
+
}
|
|
54560
|
+
};
|
|
54561
|
+
|
|
54562
|
+
useEffect(function () {
|
|
54563
|
+
defaultLanguage != language && changeLanguageApp(defaultLanguage);
|
|
54564
|
+
getListLanguage();
|
|
54565
|
+
}, []);
|
|
54566
|
+
return {
|
|
54567
|
+
languageList: languageList,
|
|
54568
|
+
toggle: toggle,
|
|
54569
|
+
dropdownOpen: dropdownOpen,
|
|
54570
|
+
currentLang: currentLang,
|
|
54571
|
+
changeLanguageApp: changeLanguageApp,
|
|
54572
|
+
setCurrentLang: setCurrentLang
|
|
54573
|
+
};
|
|
54574
|
+
};
|
|
54575
|
+
|
|
54576
|
+
var TheLanguageDropdown = function TheLanguageDropdown() {
|
|
54577
|
+
var _useLanguages = useLanguages(),
|
|
54578
|
+
languageList = _useLanguages.languageList,
|
|
54579
|
+
toggle = _useLanguages.toggle,
|
|
54580
|
+
dropdownOpen = _useLanguages.dropdownOpen,
|
|
54581
|
+
currentLang = _useLanguages.currentLang,
|
|
54582
|
+
changeLanguageApp = _useLanguages.changeLanguageApp;
|
|
54583
|
+
|
|
54584
|
+
var currentLanguage = useMemo(function () {
|
|
54585
|
+
var current = languageList.find(function (i) {
|
|
54586
|
+
return i.code === currentLang;
|
|
54587
|
+
});
|
|
54588
|
+
if (!current) return null;
|
|
54589
|
+
return React.createElement(React.Fragment, null, React.createElement("img", {
|
|
54590
|
+
className: "mr-2 " + styles['dropdown-menu-flag'],
|
|
54591
|
+
src: "" + getStaticFileUrl(current.image)
|
|
54592
|
+
}), " ", current.name);
|
|
54593
|
+
}, [currentLang, languageList]);
|
|
54594
|
+
return React.createElement(Dropdown, {
|
|
54595
|
+
isOpen: dropdownOpen,
|
|
54596
|
+
toggle: toggle,
|
|
54597
|
+
className: "" + styles["dropdown-menu"]
|
|
54598
|
+
}, React.createElement(DropdownToggle, {
|
|
54599
|
+
className: styles["header-avatar"] + " d-flex align-items-center"
|
|
54600
|
+
}, React.createElement("span", {
|
|
54601
|
+
style: {
|
|
54602
|
+
color: "#000",
|
|
54603
|
+
textTransform: "capitalize",
|
|
54604
|
+
display: 'flex',
|
|
54605
|
+
alignItems: 'center'
|
|
54606
|
+
}
|
|
54607
|
+
}, currentLanguage, React.createElement(BsChevronDown, {
|
|
54608
|
+
className: "ml-2",
|
|
54609
|
+
style: {
|
|
54610
|
+
fontSize: '10px'
|
|
54611
|
+
}
|
|
54612
|
+
}))), React.createElement(DropdownMenu, {
|
|
54613
|
+
className: styles["dropdown-content-language"]
|
|
54614
|
+
}, !!languageList && languageList.length > 0 && languageList.map(function (lang, index) {
|
|
54615
|
+
return React.createElement(DropdownItem, {
|
|
54616
|
+
key: lang.code,
|
|
54617
|
+
className: styles["dropdown-change"] + " px-0 py-0 " + (index === languageList.length - 1 ? "pb-2" : "pt-2"),
|
|
54618
|
+
onClick: function onClick() {
|
|
54619
|
+
return changeLanguageApp(lang.code);
|
|
54620
|
+
}
|
|
54621
|
+
}, React.createElement("div", {
|
|
54622
|
+
className: styles["dropdown-item-language"] + " " + styles["item-logout"] + " " + (currentLang == lang.code ? styles['dropdown-item-language-active'] : "") + " d-flex align-items-center w-100"
|
|
54623
|
+
}, React.createElement("span", {
|
|
54624
|
+
className: "mr-2 d-flex hover-opacity"
|
|
54625
|
+
}, React.createElement("img", {
|
|
54626
|
+
style: {
|
|
54627
|
+
width: "30px",
|
|
54628
|
+
height: "25px",
|
|
54629
|
+
borderRadius: "5px"
|
|
54630
|
+
},
|
|
54631
|
+
src: getStaticFileUrl(lang.image)
|
|
54632
|
+
})), lang.name));
|
|
54633
|
+
})));
|
|
54634
|
+
};
|
|
54635
|
+
|
|
54636
|
+
var TheHeader = function TheHeader(_ref) {
|
|
54637
|
+
var onToggleModel = _ref.onToggleModel;
|
|
54638
|
+
var dispatch = useDispatch();
|
|
54639
|
+
var sidebarShow = useSelector(function (state) {
|
|
54640
|
+
return state.common.sidebarShow;
|
|
54641
|
+
});
|
|
54642
|
+
|
|
54643
|
+
var _useTranslation = useTranslation(),
|
|
54644
|
+
t = _useTranslation.t;
|
|
54645
|
+
|
|
54646
|
+
var toggleSidebarMobile = function toggleSidebarMobile() {
|
|
54647
|
+
var val = [false, "responsive"].includes(sidebarShow) ? true : "responsive";
|
|
54648
|
+
dispatch(setSidebar(val));
|
|
54649
|
+
};
|
|
54650
|
+
|
|
54651
|
+
var isDistrict = window.location.host.includes("-district");
|
|
54652
|
+
return React.createElement(CHeader, {
|
|
54653
|
+
withSubheader: true,
|
|
54654
|
+
className: "d-flex align-items-center justify-content-end"
|
|
54655
|
+
}, React.createElement(CToggler, {
|
|
54656
|
+
inHeader: true,
|
|
54657
|
+
className: "ml-md-3 d-lg-none",
|
|
54658
|
+
onClick: toggleSidebarMobile
|
|
54659
|
+
}), React.createElement(CHeaderBrand, {
|
|
54660
|
+
className: "mx-auto flex-grow-1 d-lg-none",
|
|
54661
|
+
to: "/"
|
|
54662
|
+
}, React.createElement("img", {
|
|
54663
|
+
src: getStaticFileUrl(Images.LOGO_HEADER),
|
|
54664
|
+
className: styles["header-logo"]
|
|
54665
|
+
})), React.createElement(CHeaderNav, {
|
|
54666
|
+
className: "pr-3"
|
|
54667
|
+
}, React.createElement(TheLanguageDropdown, null), React.createElement("a", {
|
|
54668
|
+
className: "mr-3",
|
|
54669
|
+
style: {
|
|
54670
|
+
color: '#000'
|
|
54671
|
+
},
|
|
54672
|
+
href: '/privacy-policy',
|
|
54673
|
+
target: "blank"
|
|
54674
|
+
}, t("privacy_policy")), !isDistrict && React.createElement(NotificationButton, null), React.createElement(TheHeaderDropdown, {
|
|
54675
|
+
onToggleModel: onToggleModel
|
|
54676
|
+
})));
|
|
54677
|
+
};
|
|
54678
|
+
|
|
54679
|
+
var ModelSelectRole = function ModelSelectRole(_ref) {
|
|
54680
|
+
var _handleUserRole;
|
|
54681
|
+
|
|
54682
|
+
var open = _ref.open,
|
|
54683
|
+
onToggleModel = _ref.onToggleModel;
|
|
54684
|
+
var dispatch = useDispatch();
|
|
54685
|
+
|
|
54686
|
+
var _useTranslation = useTranslation(),
|
|
54687
|
+
t = _useTranslation.t;
|
|
54688
|
+
|
|
54689
|
+
var history = useHistory();
|
|
54690
|
+
var pathname = window.location.pathname;
|
|
54691
|
+
var user = useSelector(function (state) {
|
|
54692
|
+
return state.common.user;
|
|
54693
|
+
});
|
|
54694
|
+
var roles = user === null || user === void 0 ? void 0 : user.roles;
|
|
54695
|
+
|
|
54696
|
+
var handleSelectUserRoles = function handleSelectUserRoles(roles) {
|
|
54697
|
+
dispatch(setLoading(true));
|
|
54698
|
+
var roleSelect = roles.includes("Teacher/Assistant") ? ["Teacher", "Assistant"] : roles;
|
|
54699
|
+
dispatch(setUser(_extends({}, user, {
|
|
54700
|
+
roles: roleSelect
|
|
54701
|
+
})));
|
|
54702
|
+
localStorage.setItem("ROLES", roleSelect.toString());
|
|
54703
|
+
onToggleModel();
|
|
54704
|
+
|
|
54705
|
+
if (roles.includes("Parent")) {
|
|
54706
|
+
history.push("/parent");
|
|
54707
|
+
} else if (roles.includes("Admin")) {
|
|
54708
|
+
history.push("/admin/home");
|
|
54709
|
+
} else {
|
|
54710
|
+
pathname !== "/home" ? history.push("/home") : window.location.reload();
|
|
54711
|
+
}
|
|
54712
|
+
};
|
|
54713
|
+
|
|
54714
|
+
return React.createElement(Modal, {
|
|
54715
|
+
isOpen: open,
|
|
54716
|
+
toggle: function toggle() {
|
|
54717
|
+
return onToggleModel();
|
|
54718
|
+
},
|
|
54719
|
+
className: "" + styles["model-switch-roles"],
|
|
54720
|
+
centered: true
|
|
54721
|
+
}, React.createElement("p", {
|
|
54722
|
+
className: "" + styles["title"]
|
|
54723
|
+
}, 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) {
|
|
54724
|
+
return React.createElement("p", {
|
|
54725
|
+
key: r,
|
|
54726
|
+
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" : ""],
|
|
54727
|
+
onClick: function onClick() {
|
|
54728
|
+
return handleSelectUserRoles([r]);
|
|
54729
|
+
}
|
|
54730
|
+
}, r == "SecondaryTeacher" ? "Support Teacher" : r);
|
|
54731
|
+
})));
|
|
54732
|
+
};
|
|
54733
|
+
|
|
54734
|
+
var TheLayout = function TheLayout(_ref) {
|
|
54735
|
+
var routes = _ref.routes,
|
|
54736
|
+
navigation = _ref.navigation;
|
|
54737
|
+
var history = useHistory();
|
|
54738
|
+
var dispatch = useDispatch();
|
|
54739
|
+
var user = useSelector(function (state) {
|
|
54740
|
+
return state.common.user;
|
|
54741
|
+
});
|
|
54742
|
+
var language = useSelector(function (state) {
|
|
54743
|
+
return state.common.language;
|
|
54744
|
+
});
|
|
54745
|
+
|
|
54746
|
+
var _useState = useState(false),
|
|
54747
|
+
openModelSelectRole = _useState[0],
|
|
54748
|
+
setOpenModelSelectRole = _useState[1];
|
|
54749
|
+
|
|
54750
|
+
var _useTranslation = useTranslation(),
|
|
54751
|
+
t = _useTranslation.t;
|
|
54752
|
+
|
|
54753
|
+
var location = useLocation();
|
|
54754
|
+
var isNotification = location.pathname.includes("notifications");
|
|
54755
|
+
var isDistrict = window.location.host.includes("-district");
|
|
54756
|
+
|
|
54757
|
+
var handleToggleModel = function handleToggleModel() {
|
|
54758
|
+
setOpenModelSelectRole(!openModelSelectRole);
|
|
54759
|
+
};
|
|
54760
|
+
|
|
54761
|
+
var authRoutes = useMemo(function () {
|
|
54762
|
+
return routes.filter(function (route) {
|
|
54763
|
+
return canAccess(user === null || user === void 0 ? void 0 : user.roles, route.roles);
|
|
54764
|
+
}).filter(function (route) {
|
|
54765
|
+
return !!route.isDistrict === isDistrict;
|
|
54766
|
+
});
|
|
54767
|
+
}, [user, language]);
|
|
54768
|
+
var authNavigations = useMemo(function () {
|
|
54769
|
+
return navigation.map(function (item) {
|
|
54770
|
+
var _item$_children, _item$_children2;
|
|
54771
|
+
|
|
54772
|
+
return _extends({}, item, {
|
|
54773
|
+
name: t(item.name),
|
|
54774
|
+
_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) {
|
|
54775
|
+
return _extends({}, x, {
|
|
54776
|
+
name: t(x.name)
|
|
54777
|
+
});
|
|
54778
|
+
}) : undefined
|
|
54779
|
+
});
|
|
54780
|
+
}).filter(function (nav) {
|
|
54781
|
+
return canAccess(user === null || user === void 0 ? void 0 : user.roles, nav.roles);
|
|
54782
|
+
}).filter(function (nav) {
|
|
54783
|
+
return !!nav.isDistrict === isDistrict;
|
|
54784
|
+
});
|
|
54785
|
+
}, [user, language]);
|
|
54786
|
+
|
|
54787
|
+
var getInformationSetting = function getInformationSetting() {
|
|
54788
|
+
try {
|
|
54789
|
+
var _temp2 = _catch(function () {
|
|
54790
|
+
return Promise.resolve(getSchoolSettings()).then(function (res) {
|
|
54791
|
+
dispatch(setSandboxMode(res.data.isSandboxMode));
|
|
54792
|
+
});
|
|
54793
|
+
}, function (err) {
|
|
54794
|
+
console.error(err);
|
|
54795
|
+
});
|
|
54796
|
+
|
|
54797
|
+
return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
|
|
54798
|
+
} catch (e) {
|
|
54799
|
+
return Promise.reject(e);
|
|
54800
|
+
}
|
|
54801
|
+
};
|
|
54802
|
+
|
|
54803
|
+
useEffect(function () {
|
|
54804
|
+
checkAuthentication();
|
|
54805
|
+
}, []);
|
|
54806
|
+
useEffect(function () {
|
|
54807
|
+
getInformationSetting();
|
|
54808
|
+
}, [location.pathname]);
|
|
54809
|
+
|
|
54810
|
+
var checkAuthentication = function checkAuthentication() {
|
|
54811
|
+
try {
|
|
54812
|
+
var _temp4 = _catch(function () {
|
|
54813
|
+
return Promise.resolve(firstCheckToken()).then(function (tokenStatus) {
|
|
54814
|
+
tokenStatus ? loadInfo() : resetAuth();
|
|
54815
|
+
});
|
|
54816
|
+
}, function () {
|
|
54817
|
+
resetAuth();
|
|
54818
|
+
});
|
|
54819
|
+
|
|
54820
|
+
return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(function () {}) : void 0);
|
|
54821
|
+
} catch (e) {
|
|
54822
|
+
return Promise.reject(e);
|
|
54823
|
+
}
|
|
54824
|
+
};
|
|
54825
|
+
|
|
54826
|
+
var loadInfo = function loadInfo() {
|
|
54827
|
+
try {
|
|
54828
|
+
var _temp6 = _catch(function () {
|
|
54829
|
+
return Promise.resolve(getInfo()).then(function (info) {
|
|
54830
|
+
var _info$data, _info$data$roles;
|
|
54831
|
+
|
|
54832
|
+
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"))) {
|
|
54833
|
+
resetAuth();
|
|
54834
|
+
}
|
|
54835
|
+
|
|
54836
|
+
dispatch(setUser(info.data));
|
|
54837
|
+
});
|
|
54838
|
+
}, function () {
|
|
54839
|
+
resetAuth();
|
|
54840
|
+
});
|
|
54841
|
+
|
|
54842
|
+
return Promise.resolve(_temp6 && _temp6.then ? _temp6.then(function () {}) : void 0);
|
|
54843
|
+
} catch (e) {
|
|
54844
|
+
return Promise.reject(e);
|
|
54845
|
+
}
|
|
54846
|
+
};
|
|
54847
|
+
|
|
54848
|
+
var resetAuth = function resetAuth() {
|
|
54849
|
+
localStorage.removeItem(ACCESS_TOKEN);
|
|
54850
|
+
sessionStorage.removeItem(ACCESS_TOKEN);
|
|
54851
|
+
localStorage.removeItem("ROLES");
|
|
54852
|
+
history.push("/");
|
|
54853
|
+
};
|
|
54854
|
+
|
|
54855
|
+
if (!user) {
|
|
54856
|
+
return React.createElement(Loading, null);
|
|
54857
|
+
}
|
|
54858
|
+
|
|
54859
|
+
return React.createElement("div", {
|
|
54860
|
+
className: "c-app c-default-layout"
|
|
54861
|
+
}, !isNotification && React.createElement(TheSidebar, {
|
|
54862
|
+
navigation: authNavigations
|
|
54863
|
+
}), React.createElement("div", {
|
|
54864
|
+
className: "c-wrapper"
|
|
54865
|
+
}, !isNotification && React.createElement(TheHeader, {
|
|
54866
|
+
onToggleModel: handleToggleModel
|
|
54867
|
+
}), React.createElement("div", {
|
|
54868
|
+
className: "c-body bg-white"
|
|
54869
|
+
}, React.createElement(TheContent$1, {
|
|
54870
|
+
routes: authRoutes
|
|
54871
|
+
}))), React.createElement(ModelSelectRole, {
|
|
54872
|
+
open: openModelSelectRole,
|
|
54873
|
+
onToggleModel: handleToggleModel
|
|
54874
|
+
}));
|
|
54875
|
+
};
|
|
54876
|
+
|
|
54847
54877
|
var amplitudeClient = amplitude;
|
|
54848
54878
|
|
|
54849
54879
|
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 };
|