mario-core 2.9.412-feedback → 2.9.414-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/index.js +493 -483
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +496 -486
- package/dist/index.modern.js.map +1 -1
- package/package.json +105 -105
- package/dist/containers/Login/views/block/BlockAssignTeacherByCode.d.ts +0 -8
- package/dist/services/weeklyQuestService.d.ts +0 -1
- package/dist/types/WeeklyQuest.d.ts +0 -37
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, Suspense, memo, Fragment, forwardRef, useImperativeHandle
|
|
6
|
-
import { Input, Form, FormGroup, Row, Col, Navbar, NavbarBrand, Collapse, Nav, NavItem, NavLink, Dropdown, DropdownToggle, DropdownMenu, DropdownItem, Button, Alert, Pagination, PaginationItem, PaginationLink, Table, Label,
|
|
5
|
+
import React, { useCallback, useState, useEffect, useRef, useMemo, Suspense, memo, Fragment, forwardRef, useImperativeHandle } from 'react';
|
|
6
|
+
import { Input, Form, FormGroup, Row, Col, Navbar, NavbarBrand, Collapse, Nav, NavItem, NavLink, Dropdown, DropdownToggle, DropdownMenu, DropdownItem, Modal, Button, Alert, Pagination, PaginationItem, PaginationLink, Table, Label, 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,
|
|
20
|
+
import { CSidebar, CSidebarBrand, CSidebarNav, CCreateElement, CSidebarNavDivider, CSidebarNavDropdown, CSidebarNavItem, CSidebarNavTitle, CSidebarFooter, CHeader, CToggler, CHeaderBrand, CHeaderNav, CContainer } 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';
|
|
@@ -2034,7 +2034,6 @@ 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?";
|
|
2038
2037
|
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?";
|
|
2039
2038
|
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?";
|
|
2040
2039
|
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?";
|
|
@@ -2108,7 +2107,7 @@ var add_1_1_conversation_notes = "Add 1-1 Conversation notes";
|
|
|
2108
2107
|
var save_data = "Save data";
|
|
2109
2108
|
var please_select_date_1_1_conversation = "Please select date 1-1 conversation!";
|
|
2110
2109
|
var please_write_something_to_this_1_1_conversation = "Please write something to this 1-1 conversation!";
|
|
2111
|
-
var data_1_1_conversation_cannot_exceed_300_characters = "Data 1-1 conversation cannot exceed
|
|
2110
|
+
var data_1_1_conversation_cannot_exceed_300_characters = "Data 1-1 conversation cannot exceed 1000 characters!";
|
|
2112
2111
|
var no_need_for_it = "No need for it";
|
|
2113
2112
|
var conversation_saved = "Conversation saved!";
|
|
2114
2113
|
var what_did_you_and_the_student_choose_as_an_action_step_would_you_like_to_add_it_as_a_goal = "What did you and the student choose as an action step?<br/>Would you like to add it as a Goal?";
|
|
@@ -2125,7 +2124,7 @@ var yes_view_student_goals = "Yes, view student goals";
|
|
|
2125
2124
|
var please_set_time_1_1_conversation = "Please set time 1-1 conversation";
|
|
2126
2125
|
var type_your_answer_here = "Type your answer here...";
|
|
2127
2126
|
var delete_bulk = "Delete Bulk";
|
|
2128
|
-
var number_of_students_with_at_least_one_very_low_metric = "
|
|
2127
|
+
var number_of_students_with_at_least_one_very_low_metric = "Students with concerning metrics";
|
|
2129
2128
|
var this_flags_if_the_student_is_not_ready_to_learn_or_has_at_least_one_success_or_readiness_to_learn_metrics_under_40 = "This flags if the student is not ready to learn or has at least one success, or readiness to learn metrics under 40%";
|
|
2130
2129
|
var of_students_have_concerned_metrics = "of students have concerned metrics";
|
|
2131
2130
|
var have_metrics_40 = "have metrics <40%";
|
|
@@ -2187,6 +2186,8 @@ var location$1 = "Location";
|
|
|
2187
2186
|
var edit_my_profile = "Edit My Profile";
|
|
2188
2187
|
var save_new_password = "Save new password";
|
|
2189
2188
|
var teacher_code = "Teacher code";
|
|
2189
|
+
var number_of_conversations = "Number of conversations";
|
|
2190
|
+
var number_of_expected_conversations_based_on_the_goal = "Number of expected conversations based on the goal";
|
|
2190
2191
|
var lang_us = {
|
|
2191
2192
|
dashboard: dashboard,
|
|
2192
2193
|
user: user,
|
|
@@ -4225,7 +4226,6 @@ var lang_us = {
|
|
|
4225
4226
|
leave: leave,
|
|
4226
4227
|
go_to_the_survey_dashboard: go_to_the_survey_dashboard,
|
|
4227
4228
|
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,
|
|
4229
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?",
|
|
4230
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,
|
|
4231
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,
|
|
@@ -4390,7 +4390,9 @@ var lang_us = {
|
|
|
4390
4390
|
location: location$1,
|
|
4391
4391
|
edit_my_profile: edit_my_profile,
|
|
4392
4392
|
save_new_password: save_new_password,
|
|
4393
|
-
teacher_code: teacher_code
|
|
4393
|
+
teacher_code: teacher_code,
|
|
4394
|
+
number_of_conversations: number_of_conversations,
|
|
4395
|
+
number_of_expected_conversations_based_on_the_goal: number_of_expected_conversations_based_on_the_goal
|
|
4394
4396
|
};
|
|
4395
4397
|
|
|
4396
4398
|
var dashboard$1 = "Dashboard";
|
|
@@ -6391,7 +6393,6 @@ var your_survey_was_sent_to_x_students_and_y_staff_members_you_can_keep_track_of
|
|
|
6391
6393
|
var leave$1 = "leave";
|
|
6392
6394
|
var go_to_the_survey_dashboard$1 = "Go to the Survey Dashboard";
|
|
6393
6395
|
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?";
|
|
6395
6396
|
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?";
|
|
6396
6397
|
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?";
|
|
6397
6398
|
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?";
|
|
@@ -6465,7 +6466,7 @@ var add_1_1_conversation_notes$1 = "Add 1-1 Conversation notes";
|
|
|
6465
6466
|
var save_data$1 = "Save data";
|
|
6466
6467
|
var please_select_date_1_1_conversation$1 = "Please select date 1-1 conversation!";
|
|
6467
6468
|
var please_write_something_to_this_1_1_conversation$1 = "Please write something to this 1-1 conversation!";
|
|
6468
|
-
var data_1_1_conversation_cannot_exceed_300_characters$1 = "Data 1-1 conversation cannot exceed
|
|
6469
|
+
var data_1_1_conversation_cannot_exceed_300_characters$1 = "Data 1-1 conversation cannot exceed 1000 characters!";
|
|
6469
6470
|
var no_need_for_it$1 = "No need for it";
|
|
6470
6471
|
var conversation_saved$1 = "Conversation saved!";
|
|
6471
6472
|
var what_did_you_and_the_student_choose_as_an_action_step_would_you_like_to_add_it_as_a_goal$1 = "What did you and the student choose as an action step?<br/>Would you like to add it as a Goal?";
|
|
@@ -6482,7 +6483,7 @@ var yes_view_student_goals$1 = "Yes, view student goals";
|
|
|
6482
6483
|
var please_set_time_1_1_conversation$1 = "Please set time 1-1 conversation";
|
|
6483
6484
|
var type_your_answer_here$1 = "Type your answer here...";
|
|
6484
6485
|
var delete_bulk$1 = "Delete Bulk";
|
|
6485
|
-
var number_of_students_with_at_least_one_very_low_metric$1 = "
|
|
6486
|
+
var number_of_students_with_at_least_one_very_low_metric$1 = "Students with concerning metrics";
|
|
6486
6487
|
var this_flags_if_the_student_is_not_ready_to_learn_or_has_at_least_one_success_or_readiness_to_learn_metrics_under_40$1 = "This flags if the student is not ready to learn or has at least one success, or readiness to learn metrics under 40%";
|
|
6487
6488
|
var of_students_have_concerned_metrics$1 = "of students have concerned metrics";
|
|
6488
6489
|
var have_metrics_40$1 = "have metrics <40%";
|
|
@@ -6542,6 +6543,8 @@ var location$2 = "Location";
|
|
|
6542
6543
|
var edit_my_profile$1 = "Edit My Profile";
|
|
6543
6544
|
var save_new_password$1 = "Save new password";
|
|
6544
6545
|
var teacher_code$1 = "Teacher code";
|
|
6546
|
+
var number_of_conversations$1 = "Number of conversations";
|
|
6547
|
+
var number_of_expected_conversations_based_on_the_goal$1 = "Number of expected conversations based on the goal";
|
|
6545
6548
|
var lang_uk = {
|
|
6546
6549
|
dashboard: dashboard$1,
|
|
6547
6550
|
user: user$1,
|
|
@@ -8580,7 +8583,6 @@ var lang_uk = {
|
|
|
8580
8583
|
leave: leave$1,
|
|
8581
8584
|
go_to_the_survey_dashboard: go_to_the_survey_dashboard$1,
|
|
8582
8585
|
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,
|
|
8584
8586
|
"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?",
|
|
8585
8587
|
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,
|
|
8586
8588
|
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,
|
|
@@ -8743,7 +8745,9 @@ var lang_uk = {
|
|
|
8743
8745
|
location: location$2,
|
|
8744
8746
|
edit_my_profile: edit_my_profile$1,
|
|
8745
8747
|
save_new_password: save_new_password$1,
|
|
8746
|
-
teacher_code: teacher_code$1
|
|
8748
|
+
teacher_code: teacher_code$1,
|
|
8749
|
+
number_of_conversations: number_of_conversations$1,
|
|
8750
|
+
number_of_expected_conversations_based_on_the_goal: number_of_expected_conversations_based_on_the_goal$1
|
|
8747
8751
|
};
|
|
8748
8752
|
|
|
8749
8753
|
var dashboard$2 = "لوحة المعلومات";
|
|
@@ -10776,7 +10780,6 @@ var your_survey_was_sent_to_x_students_and_y_staff_members_you_can_keep_track_of
|
|
|
10776
10780
|
var leave$2 = "يترك";
|
|
10777
10781
|
var go_to_the_survey_dashboard$2 = "انتقل إلى لوحة معلومات الاستطلاع";
|
|
10778
10782
|
var my_dashboard$2 = "لوحة التحكم الخاصة بي";
|
|
10779
|
-
var nice_choice_what_area_of_category_would_you_like_to_work_on$2 = "اختيار جميل! ما هو مجال {{category}} الذي ترغب في العمل عليه؟";
|
|
10780
10783
|
var nice_choice_what_area_of_academics_would_you_like_to_work_on$2 = "اختيار جميل! ما هو المجال الأكاديمي الذي ترغب بالعمل فيه؟";
|
|
10781
10784
|
var nice_choice_what_area_of_organization_would_you_like_to_work_on$2 = "اختيار جميل! في أي مجال من مجالات المنظمة تود العمل؟";
|
|
10782
10785
|
var nice_choice_what_area_of_focus_would_you_like_to_work_on$2 = "اختيار جميل! ما هو مجال التركيز الذي ترغب في العمل عليه؟";
|
|
@@ -10847,7 +10850,7 @@ var add_1_1_conversation_notes$2 = "Add 1-1 Conversation notes";
|
|
|
10847
10850
|
var save_data$2 = "Save data";
|
|
10848
10851
|
var please_select_date_1_1_conversation$2 = "Please select date 1-1 conversation!";
|
|
10849
10852
|
var please_write_something_to_this_1_1_conversation$2 = "Please write something to this 1-1 conversation!";
|
|
10850
|
-
var data_1_1_conversation_cannot_exceed_300_characters$2 = "Data 1-1 conversation cannot exceed
|
|
10853
|
+
var data_1_1_conversation_cannot_exceed_300_characters$2 = "Data 1-1 conversation cannot exceed 1000 characters!";
|
|
10851
10854
|
var no_need_for_it$2 = "No need for it";
|
|
10852
10855
|
var conversation_saved$2 = "Conversation saved!";
|
|
10853
10856
|
var what_did_you_and_the_student_choose_as_an_action_step_would_you_like_to_add_it_as_a_goal$2 = "What did you and the student choose as an action step?<br/>Would you like to add it as a Goal?";
|
|
@@ -10865,7 +10868,7 @@ var please_set_time_1_1_conversation$2 = "Please set time 1-1 conversation";
|
|
|
10865
10868
|
var type_your_answer_here$2 = "Type your answer here...";
|
|
10866
10869
|
var not_ready_to_learn$2 = "Not ready to learn";
|
|
10867
10870
|
var delete_bulk$2 = "Delete Bulk";
|
|
10868
|
-
var number_of_students_with_at_least_one_very_low_metric$2 = "
|
|
10871
|
+
var number_of_students_with_at_least_one_very_low_metric$2 = "Students with concerning metrics";
|
|
10869
10872
|
var this_flags_if_the_student_is_not_ready_to_learn_or_has_at_least_one_success_or_readiness_to_learn_metrics_under_40$2 = "This flags if the student is not ready to learn or has at least one success, or readiness to learn metrics under 40%";
|
|
10870
10873
|
var of_students_have_concerned_metrics$2 = "of students have concerned metrics";
|
|
10871
10874
|
var have_metrics_40$2 = "have metrics <40%";
|
|
@@ -10925,6 +10928,8 @@ var location$3 = "Location";
|
|
|
10925
10928
|
var edit_my_profile$2 = "Edit My Profile";
|
|
10926
10929
|
var save_new_password$2 = "Save new password";
|
|
10927
10930
|
var teacher_code$2 = "Teacher code";
|
|
10931
|
+
var number_of_conversations$2 = "Number of conversations";
|
|
10932
|
+
var number_of_expected_conversations_based_on_the_goal$2 = "Number of expected conversations based on the goal";
|
|
10928
10933
|
var lang_ar = {
|
|
10929
10934
|
dashboard: dashboard$2,
|
|
10930
10935
|
user: user$2,
|
|
@@ -12997,7 +13002,6 @@ var lang_ar = {
|
|
|
12997
13002
|
leave: leave$2,
|
|
12998
13003
|
go_to_the_survey_dashboard: go_to_the_survey_dashboard$2,
|
|
12999
13004
|
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,
|
|
13001
13005
|
"nice_choice_what_area_of_well-being_would_you_like_to_work_on": "اختيار جميل! ما هو مجال الصحة والرفاهية الذي ترغب في العمل فيه؟",
|
|
13002
13006
|
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,
|
|
13003
13007
|
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,
|
|
@@ -13158,7 +13162,9 @@ var lang_ar = {
|
|
|
13158
13162
|
location: location$3,
|
|
13159
13163
|
edit_my_profile: edit_my_profile$2,
|
|
13160
13164
|
save_new_password: save_new_password$2,
|
|
13161
|
-
teacher_code: teacher_code$2
|
|
13165
|
+
teacher_code: teacher_code$2,
|
|
13166
|
+
number_of_conversations: number_of_conversations$2,
|
|
13167
|
+
number_of_expected_conversations_based_on_the_goal: number_of_expected_conversations_based_on_the_goal$2
|
|
13162
13168
|
};
|
|
13163
13169
|
|
|
13164
13170
|
var dashboard$3 = "Cuadro de mandos";
|
|
@@ -15191,7 +15197,6 @@ var your_survey_was_sent_to_x_students_and_y_staff_members_you_can_keep_track_of
|
|
|
15191
15197
|
var leave$3 = "dejar";
|
|
15192
15198
|
var go_to_the_survey_dashboard$3 = "Ir al panel de encuestas";
|
|
15193
15199
|
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?";
|
|
15195
15200
|
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?";
|
|
15196
15201
|
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?";
|
|
15197
15202
|
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?";
|
|
@@ -15263,7 +15268,7 @@ var add_1_1_conversation_notes$3 = "Add 1-1 Conversation notes";
|
|
|
15263
15268
|
var save_data$3 = "Save data";
|
|
15264
15269
|
var please_select_date_1_1_conversation$3 = "Please select date 1-1 conversation!";
|
|
15265
15270
|
var please_write_something_to_this_1_1_conversation$3 = "Please write something to this 1-1 conversation!";
|
|
15266
|
-
var data_1_1_conversation_cannot_exceed_300_characters$3 = "Data 1-1 conversation cannot exceed
|
|
15271
|
+
var data_1_1_conversation_cannot_exceed_300_characters$3 = "Data 1-1 conversation cannot exceed 1000 characters!";
|
|
15267
15272
|
var no_need_for_it$3 = "No need for it";
|
|
15268
15273
|
var conversation_saved$3 = "Conversation saved!";
|
|
15269
15274
|
var what_did_you_and_the_student_choose_as_an_action_step_would_you_like_to_add_it_as_a_goal$3 = "What did you and the student choose as an action step?<br/>Would you like to add it as a Goal?";
|
|
@@ -15280,7 +15285,7 @@ var yes_view_student_goals$3 = "Yes, view student goals";
|
|
|
15280
15285
|
var please_set_time_1_1_conversation$3 = "Please set time 1-1 conversation";
|
|
15281
15286
|
var type_your_answer_here$3 = "Type your answer here...";
|
|
15282
15287
|
var delete_bulk$3 = "Delete Bulk";
|
|
15283
|
-
var number_of_students_with_at_least_one_very_low_metric$3 = "
|
|
15288
|
+
var number_of_students_with_at_least_one_very_low_metric$3 = "Students with concerning metrics";
|
|
15284
15289
|
var this_flags_if_the_student_is_not_ready_to_learn_or_has_at_least_one_success_or_readiness_to_learn_metrics_under_40$3 = "This flags if the student is not ready to learn or has at least one success, or readiness to learn metrics under 40%";
|
|
15285
15290
|
var of_students_have_concerned_metrics$3 = "of students have concerned metrics";
|
|
15286
15291
|
var have_metrics_40$3 = "have metrics <40%";
|
|
@@ -15340,6 +15345,8 @@ var location$4 = "Location";
|
|
|
15340
15345
|
var edit_my_profile$3 = "Edit My Profile";
|
|
15341
15346
|
var save_new_password$3 = "Save new password";
|
|
15342
15347
|
var teacher_code$3 = "Teacher code";
|
|
15348
|
+
var number_of_conversations$3 = "Number of conversations";
|
|
15349
|
+
var number_of_expected_conversations_based_on_the_goal$3 = "Number of expected conversations based on the goal";
|
|
15343
15350
|
var lang_es = {
|
|
15344
15351
|
dashboard: dashboard$3,
|
|
15345
15352
|
user: user$3,
|
|
@@ -17412,7 +17419,6 @@ var lang_es = {
|
|
|
17412
17419
|
leave: leave$3,
|
|
17413
17420
|
go_to_the_survey_dashboard: go_to_the_survey_dashboard$3,
|
|
17414
17421
|
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,
|
|
17416
17422
|
"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?",
|
|
17417
17423
|
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,
|
|
17418
17424
|
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,
|
|
@@ -17573,7 +17579,9 @@ var lang_es = {
|
|
|
17573
17579
|
location: location$4,
|
|
17574
17580
|
edit_my_profile: edit_my_profile$3,
|
|
17575
17581
|
save_new_password: save_new_password$3,
|
|
17576
|
-
teacher_code: teacher_code$3
|
|
17582
|
+
teacher_code: teacher_code$3,
|
|
17583
|
+
number_of_conversations: number_of_conversations$3,
|
|
17584
|
+
number_of_expected_conversations_based_on_the_goal: number_of_expected_conversations_based_on_the_goal$3
|
|
17577
17585
|
};
|
|
17578
17586
|
|
|
17579
17587
|
var dashboard$4 = "仪表板";
|
|
@@ -19606,7 +19614,6 @@ var your_survey_was_sent_to_x_students_and_y_staff_members_you_can_keep_track_of
|
|
|
19606
19614
|
var leave$4 = "离开";
|
|
19607
19615
|
var go_to_the_survey_dashboard$4 = "前往调查仪表板";
|
|
19608
19616
|
var my_dashboard$4 = "我的仪表板";
|
|
19609
|
-
var nice_choice_what_area_of_category_would_you_like_to_work_on$4 = "不错的选择!您想在哪个{{category}}领域开展工作?";
|
|
19610
19617
|
var nice_choice_what_area_of_academics_would_you_like_to_work_on$4 = "尼克·奇克!我看到如果你有学者和你的儿子塔希尔,你有论文吗?";
|
|
19611
19618
|
var nice_choice_what_area_of_organization_would_you_like_to_work_on$4 = "尼克·奇克!让我看看,如果您正在安排,并且您有一个儿子,您有文件吗?";
|
|
19612
19619
|
var nice_choice_what_area_of_focus_would_you_like_to_work_on$4 = "不错的选择!您希望在哪个重点领域开展工作?";
|
|
@@ -19678,7 +19685,7 @@ var add_1_1_conversation_notes$4 = "Add 1-1 Conversation notes";
|
|
|
19678
19685
|
var save_data$4 = "Save data";
|
|
19679
19686
|
var please_select_date_1_1_conversation$4 = "Please select date 1-1 conversation!";
|
|
19680
19687
|
var please_write_something_to_this_1_1_conversation$4 = "Please write something to this 1-1 conversation!";
|
|
19681
|
-
var data_1_1_conversation_cannot_exceed_300_characters$4 = "Data 1-1 conversation cannot exceed
|
|
19688
|
+
var data_1_1_conversation_cannot_exceed_300_characters$4 = "Data 1-1 conversation cannot exceed 1000 characters!";
|
|
19682
19689
|
var no_need_for_it$4 = "No need for it";
|
|
19683
19690
|
var conversation_saved$4 = "Conversation saved!";
|
|
19684
19691
|
var what_did_you_and_the_student_choose_as_an_action_step_would_you_like_to_add_it_as_a_goal$4 = "What did you and the student choose as an action step?<br/>Would you like to add it as a Goal?";
|
|
@@ -19695,7 +19702,7 @@ var yes_view_student_goals$4 = "Yes, view student goals";
|
|
|
19695
19702
|
var please_set_time_1_1_conversation$4 = "Please set time 1-1 conversation";
|
|
19696
19703
|
var type_your_answer_here$4 = "Type your answer here...";
|
|
19697
19704
|
var delete_bulk$4 = "Delete Bulk";
|
|
19698
|
-
var number_of_students_with_at_least_one_very_low_metric$4 = "
|
|
19705
|
+
var number_of_students_with_at_least_one_very_low_metric$4 = "Students with concerning metrics";
|
|
19699
19706
|
var this_flags_if_the_student_is_not_ready_to_learn_or_has_at_least_one_success_or_readiness_to_learn_metrics_under_40$4 = "This flags if the student is not ready to learn or has at least one success, or readiness to learn metrics under 40%";
|
|
19700
19707
|
var of_students_have_concerned_metrics$4 = "of students have concerned metrics";
|
|
19701
19708
|
var have_metrics_40$4 = "have metrics <40%";
|
|
@@ -19755,6 +19762,8 @@ var location$5 = "Location";
|
|
|
19755
19762
|
var edit_my_profile$4 = "Edit My Profile";
|
|
19756
19763
|
var save_new_password$4 = "Save new password";
|
|
19757
19764
|
var teacher_code$4 = "Teacher code";
|
|
19765
|
+
var number_of_conversations$4 = "Number of conversations";
|
|
19766
|
+
var number_of_expected_conversations_based_on_the_goal$4 = "Number of expected conversations based on the goal";
|
|
19758
19767
|
var lang_zh = {
|
|
19759
19768
|
dashboard: dashboard$4,
|
|
19760
19769
|
user: user$4,
|
|
@@ -21827,7 +21836,6 @@ var lang_zh = {
|
|
|
21827
21836
|
leave: leave$4,
|
|
21828
21837
|
go_to_the_survey_dashboard: go_to_the_survey_dashboard$4,
|
|
21829
21838
|
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,
|
|
21831
21839
|
"nice_choice_what_area_of_well-being_would_you_like_to_work_on": "不错的选择!您想在哪个幸福健康领域开展工作?",
|
|
21832
21840
|
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,
|
|
21833
21841
|
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,
|
|
@@ -21988,7 +21996,9 @@ var lang_zh = {
|
|
|
21988
21996
|
location: location$5,
|
|
21989
21997
|
edit_my_profile: edit_my_profile$4,
|
|
21990
21998
|
save_new_password: save_new_password$4,
|
|
21991
|
-
teacher_code: teacher_code$4
|
|
21999
|
+
teacher_code: teacher_code$4,
|
|
22000
|
+
number_of_conversations: number_of_conversations$4,
|
|
22001
|
+
number_of_expected_conversations_based_on_the_goal: number_of_expected_conversations_based_on_the_goal$4
|
|
21992
22002
|
};
|
|
21993
22003
|
|
|
21994
22004
|
var TINY_MCE_API_KEY = "htqausuofrnali3nh9ivmlpq6v415o0tv2qikpg39bqf4pnk";
|
|
@@ -41859,6 +41869,212 @@ var TheHeaderDropdown = function TheHeaderDropdown(_ref) {
|
|
|
41859
41869
|
})), t("log_out")))));
|
|
41860
41870
|
};
|
|
41861
41871
|
|
|
41872
|
+
var apiGetLanguage = function apiGetLanguage() {
|
|
41873
|
+
return api.get(BASE_URL + "/api/language");
|
|
41874
|
+
};
|
|
41875
|
+
|
|
41876
|
+
var apiUpdateLanguage = function apiUpdateLanguage(lang) {
|
|
41877
|
+
return api.put(BASE_URL + "/api/language?lang=" + lang);
|
|
41878
|
+
};
|
|
41879
|
+
|
|
41880
|
+
var LANGUAGE_SYSTEM = "LANGUAGE_SYSTEM";
|
|
41881
|
+
|
|
41882
|
+
var useLanguages = function useLanguages() {
|
|
41883
|
+
var dispatch = useDispatch();
|
|
41884
|
+
|
|
41885
|
+
var _useTranslation = useTranslation(),
|
|
41886
|
+
i18n = _useTranslation.i18n;
|
|
41887
|
+
|
|
41888
|
+
var language = useSelector(function (state) {
|
|
41889
|
+
return state.common.language;
|
|
41890
|
+
});
|
|
41891
|
+
var defaultLanguage = getCookieValue(LANGUAGE_SYSTEM) != null ? getCookieValue(LANGUAGE_SYSTEM) : DEFAULT_LANGUAGE_CODE;
|
|
41892
|
+
|
|
41893
|
+
var _useState = useState([]),
|
|
41894
|
+
languageList = _useState[0],
|
|
41895
|
+
setLanguageList = _useState[1];
|
|
41896
|
+
|
|
41897
|
+
var _useState2 = useState(false),
|
|
41898
|
+
dropdownOpen = _useState2[0],
|
|
41899
|
+
setDropdownOpen = _useState2[1];
|
|
41900
|
+
|
|
41901
|
+
var _useState3 = useState(defaultLanguage),
|
|
41902
|
+
currentLang = _useState3[0],
|
|
41903
|
+
setCurrentLang = _useState3[1];
|
|
41904
|
+
|
|
41905
|
+
var toggle = function toggle() {
|
|
41906
|
+
return setDropdownOpen(function (prevState) {
|
|
41907
|
+
return !prevState;
|
|
41908
|
+
});
|
|
41909
|
+
};
|
|
41910
|
+
|
|
41911
|
+
var changeLanguageApp = function changeLanguageApp(lang) {
|
|
41912
|
+
try {
|
|
41913
|
+
var _temp3 = function _temp3() {
|
|
41914
|
+
dispatch(setLoading(false));
|
|
41915
|
+
};
|
|
41916
|
+
|
|
41917
|
+
dispatch(setLoading(true));
|
|
41918
|
+
|
|
41919
|
+
var _temp4 = _catch(function () {
|
|
41920
|
+
return Promise.resolve(apiUpdateLanguage(lang)).then(function () {
|
|
41921
|
+
i18n.changeLanguage(lang);
|
|
41922
|
+
setCurrentLang(lang);
|
|
41923
|
+
dispatch(setLanguage(lang));
|
|
41924
|
+
});
|
|
41925
|
+
}, function (err) {
|
|
41926
|
+
var _err$response, _err$response$data;
|
|
41927
|
+
|
|
41928
|
+
dispatch(setAlert({
|
|
41929
|
+
type: "danger",
|
|
41930
|
+
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
|
|
41931
|
+
}));
|
|
41932
|
+
});
|
|
41933
|
+
|
|
41934
|
+
return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(_temp3) : _temp3(_temp4));
|
|
41935
|
+
} catch (e) {
|
|
41936
|
+
return Promise.reject(e);
|
|
41937
|
+
}
|
|
41938
|
+
};
|
|
41939
|
+
|
|
41940
|
+
var getListLanguage = function getListLanguage() {
|
|
41941
|
+
try {
|
|
41942
|
+
var _temp6 = _catch(function () {
|
|
41943
|
+
return Promise.resolve(apiGetLanguage()).then(function (res) {
|
|
41944
|
+
setLanguageList(res.data);
|
|
41945
|
+
});
|
|
41946
|
+
}, function (err) {
|
|
41947
|
+
var _err$response2, _err$response2$data;
|
|
41948
|
+
|
|
41949
|
+
dispatch(setAlert({
|
|
41950
|
+
type: "danger",
|
|
41951
|
+
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
|
|
41952
|
+
}));
|
|
41953
|
+
});
|
|
41954
|
+
|
|
41955
|
+
return Promise.resolve(_temp6 && _temp6.then ? _temp6.then(function () {}) : void 0);
|
|
41956
|
+
} catch (e) {
|
|
41957
|
+
return Promise.reject(e);
|
|
41958
|
+
}
|
|
41959
|
+
};
|
|
41960
|
+
|
|
41961
|
+
useEffect(function () {
|
|
41962
|
+
defaultLanguage != language && changeLanguageApp(defaultLanguage);
|
|
41963
|
+
getListLanguage();
|
|
41964
|
+
}, []);
|
|
41965
|
+
return {
|
|
41966
|
+
languageList: languageList,
|
|
41967
|
+
toggle: toggle,
|
|
41968
|
+
dropdownOpen: dropdownOpen,
|
|
41969
|
+
currentLang: currentLang,
|
|
41970
|
+
changeLanguageApp: changeLanguageApp,
|
|
41971
|
+
setCurrentLang: setCurrentLang
|
|
41972
|
+
};
|
|
41973
|
+
};
|
|
41974
|
+
|
|
41975
|
+
var TheLanguageDropdown = function TheLanguageDropdown() {
|
|
41976
|
+
var _useLanguages = useLanguages(),
|
|
41977
|
+
languageList = _useLanguages.languageList,
|
|
41978
|
+
toggle = _useLanguages.toggle,
|
|
41979
|
+
dropdownOpen = _useLanguages.dropdownOpen,
|
|
41980
|
+
currentLang = _useLanguages.currentLang,
|
|
41981
|
+
changeLanguageApp = _useLanguages.changeLanguageApp;
|
|
41982
|
+
|
|
41983
|
+
var currentLanguage = useMemo(function () {
|
|
41984
|
+
var current = languageList.find(function (i) {
|
|
41985
|
+
return i.code === currentLang;
|
|
41986
|
+
});
|
|
41987
|
+
if (!current) return null;
|
|
41988
|
+
return React.createElement(React.Fragment, null, React.createElement("img", {
|
|
41989
|
+
className: "mr-2 " + styles['dropdown-menu-flag'],
|
|
41990
|
+
src: "" + getStaticFileUrl(current.image)
|
|
41991
|
+
}), " ", current.name);
|
|
41992
|
+
}, [currentLang, languageList]);
|
|
41993
|
+
return React.createElement(Dropdown, {
|
|
41994
|
+
isOpen: dropdownOpen,
|
|
41995
|
+
toggle: toggle,
|
|
41996
|
+
className: "" + styles["dropdown-menu"]
|
|
41997
|
+
}, React.createElement(DropdownToggle, {
|
|
41998
|
+
className: styles["header-avatar"] + " d-flex align-items-center"
|
|
41999
|
+
}, React.createElement("span", {
|
|
42000
|
+
style: {
|
|
42001
|
+
color: "#000",
|
|
42002
|
+
textTransform: "capitalize",
|
|
42003
|
+
display: 'flex',
|
|
42004
|
+
alignItems: 'center'
|
|
42005
|
+
}
|
|
42006
|
+
}, currentLanguage, React.createElement(BsChevronDown, {
|
|
42007
|
+
className: "ml-2",
|
|
42008
|
+
style: {
|
|
42009
|
+
fontSize: '10px'
|
|
42010
|
+
}
|
|
42011
|
+
}))), React.createElement(DropdownMenu, {
|
|
42012
|
+
className: styles["dropdown-content-language"]
|
|
42013
|
+
}, !!languageList && languageList.length > 0 && languageList.map(function (lang, index) {
|
|
42014
|
+
return React.createElement(DropdownItem, {
|
|
42015
|
+
key: lang.code,
|
|
42016
|
+
className: styles["dropdown-change"] + " px-0 py-0 " + (index === languageList.length - 1 ? "pb-2" : "pt-2"),
|
|
42017
|
+
onClick: function onClick() {
|
|
42018
|
+
return changeLanguageApp(lang.code);
|
|
42019
|
+
}
|
|
42020
|
+
}, React.createElement("div", {
|
|
42021
|
+
className: styles["dropdown-item-language"] + " " + styles["item-logout"] + " " + (currentLang == lang.code ? styles['dropdown-item-language-active'] : "") + " d-flex align-items-center w-100"
|
|
42022
|
+
}, React.createElement("span", {
|
|
42023
|
+
className: "mr-2 d-flex hover-opacity"
|
|
42024
|
+
}, React.createElement("img", {
|
|
42025
|
+
style: {
|
|
42026
|
+
width: "30px",
|
|
42027
|
+
height: "25px",
|
|
42028
|
+
borderRadius: "5px"
|
|
42029
|
+
},
|
|
42030
|
+
src: getStaticFileUrl(lang.image)
|
|
42031
|
+
})), lang.name));
|
|
42032
|
+
})));
|
|
42033
|
+
};
|
|
42034
|
+
|
|
42035
|
+
var TheHeader = function TheHeader(_ref) {
|
|
42036
|
+
var onToggleModel = _ref.onToggleModel;
|
|
42037
|
+
var dispatch = useDispatch();
|
|
42038
|
+
var sidebarShow = useSelector(function (state) {
|
|
42039
|
+
return state.common.sidebarShow;
|
|
42040
|
+
});
|
|
42041
|
+
|
|
42042
|
+
var _useTranslation = useTranslation(),
|
|
42043
|
+
t = _useTranslation.t;
|
|
42044
|
+
|
|
42045
|
+
var toggleSidebarMobile = function toggleSidebarMobile() {
|
|
42046
|
+
var val = [false, "responsive"].includes(sidebarShow) ? true : "responsive";
|
|
42047
|
+
dispatch(setSidebar(val));
|
|
42048
|
+
};
|
|
42049
|
+
|
|
42050
|
+
var isDistrict = window.location.host.includes("-district");
|
|
42051
|
+
return React.createElement(CHeader, {
|
|
42052
|
+
withSubheader: true,
|
|
42053
|
+
className: "d-flex align-items-center justify-content-end"
|
|
42054
|
+
}, React.createElement(CToggler, {
|
|
42055
|
+
inHeader: true,
|
|
42056
|
+
className: "ml-md-3 d-lg-none",
|
|
42057
|
+
onClick: toggleSidebarMobile
|
|
42058
|
+
}), React.createElement(CHeaderBrand, {
|
|
42059
|
+
className: "mx-auto flex-grow-1 d-lg-none",
|
|
42060
|
+
to: "/"
|
|
42061
|
+
}, React.createElement("img", {
|
|
42062
|
+
src: getStaticFileUrl(Images.LOGO_HEADER),
|
|
42063
|
+
className: styles["header-logo"]
|
|
42064
|
+
})), React.createElement(CHeaderNav, {
|
|
42065
|
+
className: "pr-3"
|
|
42066
|
+
}, React.createElement(TheLanguageDropdown, null), React.createElement("a", {
|
|
42067
|
+
className: "mr-3",
|
|
42068
|
+
style: {
|
|
42069
|
+
color: '#000'
|
|
42070
|
+
},
|
|
42071
|
+
href: '/privacy-policy',
|
|
42072
|
+
target: "blank"
|
|
42073
|
+
}, t("privacy_policy")), !isDistrict && React.createElement(NotificationButton, null), React.createElement(TheHeaderDropdown, {
|
|
42074
|
+
onToggleModel: onToggleModel
|
|
42075
|
+
})));
|
|
42076
|
+
};
|
|
42077
|
+
|
|
41862
42078
|
var TITLE$3 = "Not found";
|
|
41863
42079
|
|
|
41864
42080
|
var NotFound = function NotFound() {
|
|
@@ -41916,6 +42132,258 @@ var TheContent = function TheContent(_ref) {
|
|
|
41916
42132
|
|
|
41917
42133
|
var TheContent$1 = React.memo(TheContent);
|
|
41918
42134
|
|
|
42135
|
+
var loadingStyle = {
|
|
42136
|
+
minWidth: "100vw",
|
|
42137
|
+
minHeight: "100vh",
|
|
42138
|
+
position: "fixed",
|
|
42139
|
+
top: 0,
|
|
42140
|
+
left: 0,
|
|
42141
|
+
zIndex: 999999999,
|
|
42142
|
+
backgroundColor: "rgba(0, 0, 0, 0.4)",
|
|
42143
|
+
display: "flex",
|
|
42144
|
+
justifyContent: "center",
|
|
42145
|
+
alignItems: "center"
|
|
42146
|
+
};
|
|
42147
|
+
|
|
42148
|
+
var Loading = function Loading() {
|
|
42149
|
+
var isLoading = useSelector(function (state) {
|
|
42150
|
+
return state.common.isLoading;
|
|
42151
|
+
});
|
|
42152
|
+
localStorage.setItem("LAST_TIME_REQUETST", moment().utc().format("YYYY-MM-DD HH:mm:ss"));
|
|
42153
|
+
return isLoading ? React.createElement("div", {
|
|
42154
|
+
style: loadingStyle
|
|
42155
|
+
}, React.createElement("div", {
|
|
42156
|
+
className: "spinner-border text-secondary",
|
|
42157
|
+
role: "status"
|
|
42158
|
+
}, React.createElement("span", {
|
|
42159
|
+
className: "sr-only"
|
|
42160
|
+
}, "Loading..."))) : null;
|
|
42161
|
+
};
|
|
42162
|
+
|
|
42163
|
+
var firstCheckToken = function firstCheckToken() {
|
|
42164
|
+
return Promise.resolve(_catch(function () {
|
|
42165
|
+
var token = getAccessToken();
|
|
42166
|
+
return token ? Promise.resolve(checkToken(token)).then(function (tokenStatus) {
|
|
42167
|
+
return tokenStatus.data ? true : false;
|
|
42168
|
+
}) : false;
|
|
42169
|
+
}, function () {
|
|
42170
|
+
return false;
|
|
42171
|
+
}));
|
|
42172
|
+
};
|
|
42173
|
+
|
|
42174
|
+
var canAccess = function canAccess(userRoles, componentRoles) {
|
|
42175
|
+
if (!Array.isArray(userRoles)) {
|
|
42176
|
+
return false;
|
|
42177
|
+
}
|
|
42178
|
+
|
|
42179
|
+
if (Array.isArray(componentRoles)) {
|
|
42180
|
+
var intersects = userRoles.filter(function (i) {
|
|
42181
|
+
return componentRoles.includes(i);
|
|
42182
|
+
});
|
|
42183
|
+
return intersects.length > 0;
|
|
42184
|
+
}
|
|
42185
|
+
|
|
42186
|
+
return true;
|
|
42187
|
+
};
|
|
42188
|
+
|
|
42189
|
+
var ModelSelectRole = function ModelSelectRole(_ref) {
|
|
42190
|
+
var _handleUserRole;
|
|
42191
|
+
|
|
42192
|
+
var open = _ref.open,
|
|
42193
|
+
onToggleModel = _ref.onToggleModel;
|
|
42194
|
+
var dispatch = useDispatch();
|
|
42195
|
+
|
|
42196
|
+
var _useTranslation = useTranslation(),
|
|
42197
|
+
t = _useTranslation.t;
|
|
42198
|
+
|
|
42199
|
+
var history = useHistory();
|
|
42200
|
+
var pathname = window.location.pathname;
|
|
42201
|
+
var user = useSelector(function (state) {
|
|
42202
|
+
return state.common.user;
|
|
42203
|
+
});
|
|
42204
|
+
var roles = user === null || user === void 0 ? void 0 : user.roles;
|
|
42205
|
+
|
|
42206
|
+
var handleSelectUserRoles = function handleSelectUserRoles(roles) {
|
|
42207
|
+
dispatch(setLoading(true));
|
|
42208
|
+
var roleSelect = roles.includes("Teacher/Assistant") ? ["Teacher", "Assistant"] : roles;
|
|
42209
|
+
dispatch(setUser(_extends({}, user, {
|
|
42210
|
+
roles: roleSelect
|
|
42211
|
+
})));
|
|
42212
|
+
localStorage.setItem("ROLES", roleSelect.toString());
|
|
42213
|
+
onToggleModel();
|
|
42214
|
+
|
|
42215
|
+
if (roles.includes("Parent")) {
|
|
42216
|
+
history.push("/parent");
|
|
42217
|
+
} else if (roles.includes("Admin")) {
|
|
42218
|
+
history.push("/admin/home");
|
|
42219
|
+
} else {
|
|
42220
|
+
pathname !== "/home" ? history.push("/home") : window.location.reload();
|
|
42221
|
+
}
|
|
42222
|
+
};
|
|
42223
|
+
|
|
42224
|
+
return React.createElement(Modal, {
|
|
42225
|
+
isOpen: open,
|
|
42226
|
+
toggle: function toggle() {
|
|
42227
|
+
return onToggleModel();
|
|
42228
|
+
},
|
|
42229
|
+
className: "" + styles["model-switch-roles"],
|
|
42230
|
+
centered: true
|
|
42231
|
+
}, React.createElement("p", {
|
|
42232
|
+
className: "" + styles["title"]
|
|
42233
|
+
}, 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) {
|
|
42234
|
+
return React.createElement("p", {
|
|
42235
|
+
key: r,
|
|
42236
|
+
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" : ""],
|
|
42237
|
+
onClick: function onClick() {
|
|
42238
|
+
return handleSelectUserRoles([r]);
|
|
42239
|
+
}
|
|
42240
|
+
}, r == "SecondaryTeacher" ? "Support Teacher" : r);
|
|
42241
|
+
})));
|
|
42242
|
+
};
|
|
42243
|
+
|
|
42244
|
+
var TheLayout = function TheLayout(_ref) {
|
|
42245
|
+
var routes = _ref.routes,
|
|
42246
|
+
navigation = _ref.navigation;
|
|
42247
|
+
var history = useHistory();
|
|
42248
|
+
var dispatch = useDispatch();
|
|
42249
|
+
var user = useSelector(function (state) {
|
|
42250
|
+
return state.common.user;
|
|
42251
|
+
});
|
|
42252
|
+
var language = useSelector(function (state) {
|
|
42253
|
+
return state.common.language;
|
|
42254
|
+
});
|
|
42255
|
+
|
|
42256
|
+
var _useState = useState(false),
|
|
42257
|
+
openModelSelectRole = _useState[0],
|
|
42258
|
+
setOpenModelSelectRole = _useState[1];
|
|
42259
|
+
|
|
42260
|
+
var _useTranslation = useTranslation(),
|
|
42261
|
+
t = _useTranslation.t;
|
|
42262
|
+
|
|
42263
|
+
var location = useLocation();
|
|
42264
|
+
var isNotification = location.pathname.includes("notifications");
|
|
42265
|
+
var isDistrict = window.location.host.includes("-district");
|
|
42266
|
+
|
|
42267
|
+
var handleToggleModel = function handleToggleModel() {
|
|
42268
|
+
setOpenModelSelectRole(!openModelSelectRole);
|
|
42269
|
+
};
|
|
42270
|
+
|
|
42271
|
+
var authRoutes = useMemo(function () {
|
|
42272
|
+
return routes.filter(function (route) {
|
|
42273
|
+
return canAccess(user === null || user === void 0 ? void 0 : user.roles, route.roles);
|
|
42274
|
+
}).filter(function (route) {
|
|
42275
|
+
return !!route.isDistrict === isDistrict;
|
|
42276
|
+
});
|
|
42277
|
+
}, [user, language]);
|
|
42278
|
+
var authNavigations = useMemo(function () {
|
|
42279
|
+
return navigation.map(function (item) {
|
|
42280
|
+
var _item$_children, _item$_children2;
|
|
42281
|
+
|
|
42282
|
+
return _extends({}, item, {
|
|
42283
|
+
name: t(item.name),
|
|
42284
|
+
_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) {
|
|
42285
|
+
return _extends({}, x, {
|
|
42286
|
+
name: t(x.name)
|
|
42287
|
+
});
|
|
42288
|
+
}) : undefined
|
|
42289
|
+
});
|
|
42290
|
+
}).filter(function (nav) {
|
|
42291
|
+
return canAccess(user === null || user === void 0 ? void 0 : user.roles, nav.roles);
|
|
42292
|
+
}).filter(function (nav) {
|
|
42293
|
+
return !!nav.isDistrict === isDistrict;
|
|
42294
|
+
});
|
|
42295
|
+
}, [user, language]);
|
|
42296
|
+
|
|
42297
|
+
var getInformationSetting = function getInformationSetting() {
|
|
42298
|
+
try {
|
|
42299
|
+
var _temp2 = _catch(function () {
|
|
42300
|
+
return Promise.resolve(getSchoolSettings()).then(function (res) {
|
|
42301
|
+
dispatch(setSandboxMode(res.data.isSandboxMode));
|
|
42302
|
+
});
|
|
42303
|
+
}, function (err) {
|
|
42304
|
+
console.error(err);
|
|
42305
|
+
});
|
|
42306
|
+
|
|
42307
|
+
return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
|
|
42308
|
+
} catch (e) {
|
|
42309
|
+
return Promise.reject(e);
|
|
42310
|
+
}
|
|
42311
|
+
};
|
|
42312
|
+
|
|
42313
|
+
useEffect(function () {
|
|
42314
|
+
checkAuthentication();
|
|
42315
|
+
}, []);
|
|
42316
|
+
useEffect(function () {
|
|
42317
|
+
getInformationSetting();
|
|
42318
|
+
}, [location.pathname]);
|
|
42319
|
+
|
|
42320
|
+
var checkAuthentication = function checkAuthentication() {
|
|
42321
|
+
try {
|
|
42322
|
+
var _temp4 = _catch(function () {
|
|
42323
|
+
return Promise.resolve(firstCheckToken()).then(function (tokenStatus) {
|
|
42324
|
+
tokenStatus ? loadInfo() : resetAuth();
|
|
42325
|
+
});
|
|
42326
|
+
}, function () {
|
|
42327
|
+
resetAuth();
|
|
42328
|
+
});
|
|
42329
|
+
|
|
42330
|
+
return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(function () {}) : void 0);
|
|
42331
|
+
} catch (e) {
|
|
42332
|
+
return Promise.reject(e);
|
|
42333
|
+
}
|
|
42334
|
+
};
|
|
42335
|
+
|
|
42336
|
+
var loadInfo = function loadInfo() {
|
|
42337
|
+
try {
|
|
42338
|
+
var _temp6 = _catch(function () {
|
|
42339
|
+
return Promise.resolve(getInfo()).then(function (info) {
|
|
42340
|
+
var _info$data, _info$data$roles;
|
|
42341
|
+
|
|
42342
|
+
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"))) {
|
|
42343
|
+
resetAuth();
|
|
42344
|
+
}
|
|
42345
|
+
|
|
42346
|
+
dispatch(setUser(info.data));
|
|
42347
|
+
});
|
|
42348
|
+
}, function () {
|
|
42349
|
+
resetAuth();
|
|
42350
|
+
});
|
|
42351
|
+
|
|
42352
|
+
return Promise.resolve(_temp6 && _temp6.then ? _temp6.then(function () {}) : void 0);
|
|
42353
|
+
} catch (e) {
|
|
42354
|
+
return Promise.reject(e);
|
|
42355
|
+
}
|
|
42356
|
+
};
|
|
42357
|
+
|
|
42358
|
+
var resetAuth = function resetAuth() {
|
|
42359
|
+
localStorage.removeItem(ACCESS_TOKEN);
|
|
42360
|
+
sessionStorage.removeItem(ACCESS_TOKEN);
|
|
42361
|
+
localStorage.removeItem("ROLES");
|
|
42362
|
+
history.push("/");
|
|
42363
|
+
};
|
|
42364
|
+
|
|
42365
|
+
if (!user) {
|
|
42366
|
+
return React.createElement(Loading, null);
|
|
42367
|
+
}
|
|
42368
|
+
|
|
42369
|
+
return React.createElement("div", {
|
|
42370
|
+
className: "c-app c-default-layout"
|
|
42371
|
+
}, !isNotification && React.createElement(TheSidebar, {
|
|
42372
|
+
navigation: authNavigations
|
|
42373
|
+
}), React.createElement("div", {
|
|
42374
|
+
className: "c-wrapper"
|
|
42375
|
+
}, !isNotification && React.createElement(TheHeader, {
|
|
42376
|
+
onToggleModel: handleToggleModel
|
|
42377
|
+
}), React.createElement("div", {
|
|
42378
|
+
className: "c-body bg-white"
|
|
42379
|
+
}, React.createElement(TheContent$1, {
|
|
42380
|
+
routes: authRoutes
|
|
42381
|
+
}))), React.createElement(ModelSelectRole, {
|
|
42382
|
+
open: openModelSelectRole,
|
|
42383
|
+
onToggleModel: handleToggleModel
|
|
42384
|
+
}));
|
|
42385
|
+
};
|
|
42386
|
+
|
|
41919
42387
|
var buttonTextStyle = {
|
|
41920
42388
|
fontWeight: 500
|
|
41921
42389
|
};
|
|
@@ -51262,34 +51730,6 @@ var UserDetail = function UserDetail() {
|
|
|
51262
51730
|
});
|
|
51263
51731
|
};
|
|
51264
51732
|
|
|
51265
|
-
var loadingStyle = {
|
|
51266
|
-
minWidth: "100vw",
|
|
51267
|
-
minHeight: "100vh",
|
|
51268
|
-
position: "fixed",
|
|
51269
|
-
top: 0,
|
|
51270
|
-
left: 0,
|
|
51271
|
-
zIndex: 999999999,
|
|
51272
|
-
backgroundColor: "rgba(0, 0, 0, 0.4)",
|
|
51273
|
-
display: "flex",
|
|
51274
|
-
justifyContent: "center",
|
|
51275
|
-
alignItems: "center"
|
|
51276
|
-
};
|
|
51277
|
-
|
|
51278
|
-
var Loading = function Loading() {
|
|
51279
|
-
var isLoading = useSelector(function (state) {
|
|
51280
|
-
return state.common.isLoading;
|
|
51281
|
-
});
|
|
51282
|
-
localStorage.setItem("LAST_TIME_REQUETST", moment().utc().format("YYYY-MM-DD HH:mm:ss"));
|
|
51283
|
-
return isLoading ? React.createElement("div", {
|
|
51284
|
-
style: loadingStyle
|
|
51285
|
-
}, React.createElement("div", {
|
|
51286
|
-
className: "spinner-border text-secondary",
|
|
51287
|
-
role: "status"
|
|
51288
|
-
}, React.createElement("span", {
|
|
51289
|
-
className: "sr-only"
|
|
51290
|
-
}, "Loading..."))) : null;
|
|
51291
|
-
};
|
|
51292
|
-
|
|
51293
51733
|
var ScrollToTop = function ScrollToTop() {
|
|
51294
51734
|
var _useLocation = useLocation(),
|
|
51295
51735
|
pathname = _useLocation.pathname;
|
|
@@ -54313,32 +54753,6 @@ var store = configureStore({
|
|
|
54313
54753
|
}
|
|
54314
54754
|
});
|
|
54315
54755
|
|
|
54316
|
-
var firstCheckToken = function firstCheckToken() {
|
|
54317
|
-
return Promise.resolve(_catch(function () {
|
|
54318
|
-
var token = getAccessToken();
|
|
54319
|
-
return token ? Promise.resolve(checkToken(token)).then(function (tokenStatus) {
|
|
54320
|
-
return tokenStatus.data ? true : false;
|
|
54321
|
-
}) : false;
|
|
54322
|
-
}, function () {
|
|
54323
|
-
return false;
|
|
54324
|
-
}));
|
|
54325
|
-
};
|
|
54326
|
-
|
|
54327
|
-
var canAccess = function canAccess(userRoles, componentRoles) {
|
|
54328
|
-
if (!Array.isArray(userRoles)) {
|
|
54329
|
-
return false;
|
|
54330
|
-
}
|
|
54331
|
-
|
|
54332
|
-
if (Array.isArray(componentRoles)) {
|
|
54333
|
-
var intersects = userRoles.filter(function (i) {
|
|
54334
|
-
return componentRoles.includes(i);
|
|
54335
|
-
});
|
|
54336
|
-
return intersects.length > 0;
|
|
54337
|
-
}
|
|
54338
|
-
|
|
54339
|
-
return true;
|
|
54340
|
-
};
|
|
54341
|
-
|
|
54342
54756
|
var isInViewport = function isInViewport(el) {
|
|
54343
54757
|
var rect = el === null || el === void 0 ? void 0 : el.getBoundingClientRect();
|
|
54344
54758
|
return rect.top >= 0 && rect.left >= 0 && rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && rect.right <= (window.innerWidth || document.documentElement.clientWidth);
|
|
@@ -54372,410 +54786,6 @@ var generateRandomString = (function () {
|
|
|
54372
54786
|
return (Math.random() + 1).toString(36).substring(7);
|
|
54373
54787
|
});
|
|
54374
54788
|
|
|
54375
|
-
var apiGetLanguage = function apiGetLanguage() {
|
|
54376
|
-
return api.get(BASE_URL + "/api/language");
|
|
54377
|
-
};
|
|
54378
|
-
|
|
54379
|
-
var apiUpdateLanguage = function apiUpdateLanguage(lang) {
|
|
54380
|
-
return api.put(BASE_URL + "/api/language?lang=" + lang);
|
|
54381
|
-
};
|
|
54382
|
-
|
|
54383
|
-
var LANGUAGE_SYSTEM = "LANGUAGE_SYSTEM";
|
|
54384
|
-
|
|
54385
|
-
var useLanguages = function useLanguages() {
|
|
54386
|
-
var dispatch = useDispatch();
|
|
54387
|
-
|
|
54388
|
-
var _useTranslation = useTranslation(),
|
|
54389
|
-
i18n = _useTranslation.i18n;
|
|
54390
|
-
|
|
54391
|
-
var language = useSelector(function (state) {
|
|
54392
|
-
return state.common.language;
|
|
54393
|
-
});
|
|
54394
|
-
var defaultLanguage = getCookieValue(LANGUAGE_SYSTEM) != null ? getCookieValue(LANGUAGE_SYSTEM) : DEFAULT_LANGUAGE_CODE;
|
|
54395
|
-
|
|
54396
|
-
var _useState = useState([]),
|
|
54397
|
-
languageList = _useState[0],
|
|
54398
|
-
setLanguageList = _useState[1];
|
|
54399
|
-
|
|
54400
|
-
var _useState2 = useState(false),
|
|
54401
|
-
dropdownOpen = _useState2[0],
|
|
54402
|
-
setDropdownOpen = _useState2[1];
|
|
54403
|
-
|
|
54404
|
-
var _useState3 = useState(defaultLanguage),
|
|
54405
|
-
currentLang = _useState3[0],
|
|
54406
|
-
setCurrentLang = _useState3[1];
|
|
54407
|
-
|
|
54408
|
-
var toggle = function toggle() {
|
|
54409
|
-
return setDropdownOpen(function (prevState) {
|
|
54410
|
-
return !prevState;
|
|
54411
|
-
});
|
|
54412
|
-
};
|
|
54413
|
-
|
|
54414
|
-
var changeLanguageApp = function changeLanguageApp(lang) {
|
|
54415
|
-
try {
|
|
54416
|
-
var _temp3 = function _temp3() {
|
|
54417
|
-
dispatch(setLoading(false));
|
|
54418
|
-
};
|
|
54419
|
-
|
|
54420
|
-
dispatch(setLoading(true));
|
|
54421
|
-
|
|
54422
|
-
var _temp4 = _catch(function () {
|
|
54423
|
-
return Promise.resolve(apiUpdateLanguage(lang)).then(function () {
|
|
54424
|
-
i18n.changeLanguage(lang);
|
|
54425
|
-
setCurrentLang(lang);
|
|
54426
|
-
dispatch(setLanguage(lang));
|
|
54427
|
-
});
|
|
54428
|
-
}, function (err) {
|
|
54429
|
-
var _err$response, _err$response$data;
|
|
54430
|
-
|
|
54431
|
-
dispatch(setAlert({
|
|
54432
|
-
type: "danger",
|
|
54433
|
-
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
|
|
54434
|
-
}));
|
|
54435
|
-
});
|
|
54436
|
-
|
|
54437
|
-
return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(_temp3) : _temp3(_temp4));
|
|
54438
|
-
} catch (e) {
|
|
54439
|
-
return Promise.reject(e);
|
|
54440
|
-
}
|
|
54441
|
-
};
|
|
54442
|
-
|
|
54443
|
-
var getListLanguage = function getListLanguage() {
|
|
54444
|
-
try {
|
|
54445
|
-
var _temp6 = _catch(function () {
|
|
54446
|
-
return Promise.resolve(apiGetLanguage()).then(function (res) {
|
|
54447
|
-
setLanguageList(res.data);
|
|
54448
|
-
});
|
|
54449
|
-
}, function (err) {
|
|
54450
|
-
var _err$response2, _err$response2$data;
|
|
54451
|
-
|
|
54452
|
-
dispatch(setAlert({
|
|
54453
|
-
type: "danger",
|
|
54454
|
-
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
|
|
54455
|
-
}));
|
|
54456
|
-
});
|
|
54457
|
-
|
|
54458
|
-
return Promise.resolve(_temp6 && _temp6.then ? _temp6.then(function () {}) : void 0);
|
|
54459
|
-
} catch (e) {
|
|
54460
|
-
return Promise.reject(e);
|
|
54461
|
-
}
|
|
54462
|
-
};
|
|
54463
|
-
|
|
54464
|
-
useEffect(function () {
|
|
54465
|
-
defaultLanguage != language && changeLanguageApp(defaultLanguage);
|
|
54466
|
-
getListLanguage();
|
|
54467
|
-
}, []);
|
|
54468
|
-
return {
|
|
54469
|
-
languageList: languageList,
|
|
54470
|
-
toggle: toggle,
|
|
54471
|
-
dropdownOpen: dropdownOpen,
|
|
54472
|
-
currentLang: currentLang,
|
|
54473
|
-
changeLanguageApp: changeLanguageApp,
|
|
54474
|
-
setCurrentLang: setCurrentLang
|
|
54475
|
-
};
|
|
54476
|
-
};
|
|
54477
|
-
|
|
54478
|
-
var TheLanguageDropdown = function TheLanguageDropdown() {
|
|
54479
|
-
var _useLanguages = useLanguages(),
|
|
54480
|
-
languageList = _useLanguages.languageList,
|
|
54481
|
-
toggle = _useLanguages.toggle,
|
|
54482
|
-
dropdownOpen = _useLanguages.dropdownOpen,
|
|
54483
|
-
currentLang = _useLanguages.currentLang,
|
|
54484
|
-
changeLanguageApp = _useLanguages.changeLanguageApp;
|
|
54485
|
-
|
|
54486
|
-
var currentLanguage = useMemo(function () {
|
|
54487
|
-
var current = languageList.find(function (i) {
|
|
54488
|
-
return i.code === currentLang;
|
|
54489
|
-
});
|
|
54490
|
-
if (!current) return null;
|
|
54491
|
-
return React.createElement(React.Fragment, null, React.createElement("img", {
|
|
54492
|
-
className: "mr-2 " + styles['dropdown-menu-flag'],
|
|
54493
|
-
src: "" + getStaticFileUrl(current.image)
|
|
54494
|
-
}), " ", current.name);
|
|
54495
|
-
}, [currentLang, languageList]);
|
|
54496
|
-
return React.createElement(Dropdown, {
|
|
54497
|
-
isOpen: dropdownOpen,
|
|
54498
|
-
toggle: toggle,
|
|
54499
|
-
className: "" + styles["dropdown-menu"]
|
|
54500
|
-
}, React.createElement(DropdownToggle, {
|
|
54501
|
-
className: styles["header-avatar"] + " d-flex align-items-center"
|
|
54502
|
-
}, React.createElement("span", {
|
|
54503
|
-
style: {
|
|
54504
|
-
color: "#000",
|
|
54505
|
-
textTransform: "capitalize",
|
|
54506
|
-
display: 'flex',
|
|
54507
|
-
alignItems: 'center'
|
|
54508
|
-
}
|
|
54509
|
-
}, currentLanguage, React.createElement(BsChevronDown, {
|
|
54510
|
-
className: "ml-2",
|
|
54511
|
-
style: {
|
|
54512
|
-
fontSize: '10px'
|
|
54513
|
-
}
|
|
54514
|
-
}))), React.createElement(DropdownMenu, {
|
|
54515
|
-
className: styles["dropdown-content-language"]
|
|
54516
|
-
}, !!languageList && languageList.length > 0 && languageList.map(function (lang, index) {
|
|
54517
|
-
return React.createElement(DropdownItem, {
|
|
54518
|
-
key: lang.code,
|
|
54519
|
-
className: styles["dropdown-change"] + " px-0 py-0 " + (index === languageList.length - 1 ? "pb-2" : "pt-2"),
|
|
54520
|
-
onClick: function onClick() {
|
|
54521
|
-
return changeLanguageApp(lang.code);
|
|
54522
|
-
}
|
|
54523
|
-
}, React.createElement("div", {
|
|
54524
|
-
className: styles["dropdown-item-language"] + " " + styles["item-logout"] + " " + (currentLang == lang.code ? styles['dropdown-item-language-active'] : "") + " d-flex align-items-center w-100"
|
|
54525
|
-
}, React.createElement("span", {
|
|
54526
|
-
className: "mr-2 d-flex hover-opacity"
|
|
54527
|
-
}, React.createElement("img", {
|
|
54528
|
-
style: {
|
|
54529
|
-
width: "30px",
|
|
54530
|
-
height: "25px",
|
|
54531
|
-
borderRadius: "5px"
|
|
54532
|
-
},
|
|
54533
|
-
src: getStaticFileUrl(lang.image)
|
|
54534
|
-
})), lang.name));
|
|
54535
|
-
})));
|
|
54536
|
-
};
|
|
54537
|
-
|
|
54538
|
-
var TheHeader = function TheHeader(_ref) {
|
|
54539
|
-
var onToggleModel = _ref.onToggleModel;
|
|
54540
|
-
var dispatch = useDispatch();
|
|
54541
|
-
var sidebarShow = useSelector(function (state) {
|
|
54542
|
-
return state.common.sidebarShow;
|
|
54543
|
-
});
|
|
54544
|
-
|
|
54545
|
-
var _useTranslation = useTranslation(),
|
|
54546
|
-
t = _useTranslation.t;
|
|
54547
|
-
|
|
54548
|
-
var toggleSidebarMobile = function toggleSidebarMobile() {
|
|
54549
|
-
var val = [false, "responsive"].includes(sidebarShow) ? true : "responsive";
|
|
54550
|
-
dispatch(setSidebar(val));
|
|
54551
|
-
};
|
|
54552
|
-
|
|
54553
|
-
var isDistrict = window.location.host.includes("-district");
|
|
54554
|
-
return React.createElement(CHeader, {
|
|
54555
|
-
withSubheader: true,
|
|
54556
|
-
className: "d-flex align-items-center justify-content-end"
|
|
54557
|
-
}, React.createElement(CToggler, {
|
|
54558
|
-
inHeader: true,
|
|
54559
|
-
className: "ml-md-3 d-lg-none",
|
|
54560
|
-
onClick: toggleSidebarMobile
|
|
54561
|
-
}), React.createElement(CHeaderBrand, {
|
|
54562
|
-
className: "mx-auto flex-grow-1 d-lg-none",
|
|
54563
|
-
to: "/"
|
|
54564
|
-
}, React.createElement("img", {
|
|
54565
|
-
src: getStaticFileUrl(Images.LOGO_HEADER),
|
|
54566
|
-
className: styles["header-logo"]
|
|
54567
|
-
})), React.createElement(CHeaderNav, {
|
|
54568
|
-
className: "pr-3"
|
|
54569
|
-
}, React.createElement(TheLanguageDropdown, null), React.createElement("a", {
|
|
54570
|
-
className: "mr-3",
|
|
54571
|
-
style: {
|
|
54572
|
-
color: '#000'
|
|
54573
|
-
},
|
|
54574
|
-
href: '/privacy-policy',
|
|
54575
|
-
target: "blank"
|
|
54576
|
-
}, t("privacy_policy")), !isDistrict && React.createElement(NotificationButton, null), React.createElement(TheHeaderDropdown, {
|
|
54577
|
-
onToggleModel: onToggleModel
|
|
54578
|
-
})));
|
|
54579
|
-
};
|
|
54580
|
-
|
|
54581
|
-
var ModelSelectRole = function ModelSelectRole(_ref) {
|
|
54582
|
-
var _handleUserRole;
|
|
54583
|
-
|
|
54584
|
-
var open = _ref.open,
|
|
54585
|
-
onToggleModel = _ref.onToggleModel;
|
|
54586
|
-
var dispatch = useDispatch();
|
|
54587
|
-
|
|
54588
|
-
var _useTranslation = useTranslation(),
|
|
54589
|
-
t = _useTranslation.t;
|
|
54590
|
-
|
|
54591
|
-
var history = useHistory();
|
|
54592
|
-
var pathname = window.location.pathname;
|
|
54593
|
-
var user = useSelector(function (state) {
|
|
54594
|
-
return state.common.user;
|
|
54595
|
-
});
|
|
54596
|
-
var roles = user === null || user === void 0 ? void 0 : user.roles;
|
|
54597
|
-
|
|
54598
|
-
var handleSelectUserRoles = function handleSelectUserRoles(roles) {
|
|
54599
|
-
dispatch(setLoading(true));
|
|
54600
|
-
var roleSelect = roles.includes("Teacher/Assistant") ? ["Teacher", "Assistant"] : roles;
|
|
54601
|
-
dispatch(setUser(_extends({}, user, {
|
|
54602
|
-
roles: roleSelect
|
|
54603
|
-
})));
|
|
54604
|
-
localStorage.setItem("ROLES", roleSelect.toString());
|
|
54605
|
-
onToggleModel();
|
|
54606
|
-
|
|
54607
|
-
if (roles.includes("Parent")) {
|
|
54608
|
-
history.push("/parent");
|
|
54609
|
-
} else if (roles.includes("Admin")) {
|
|
54610
|
-
history.push("/admin/home");
|
|
54611
|
-
} else {
|
|
54612
|
-
pathname !== "/home" ? history.push("/home") : window.location.reload();
|
|
54613
|
-
}
|
|
54614
|
-
};
|
|
54615
|
-
|
|
54616
|
-
return React.createElement(Modal, {
|
|
54617
|
-
isOpen: open,
|
|
54618
|
-
toggle: function toggle() {
|
|
54619
|
-
return onToggleModel();
|
|
54620
|
-
},
|
|
54621
|
-
className: "" + styles["model-switch-roles"],
|
|
54622
|
-
centered: true
|
|
54623
|
-
}, React.createElement("p", {
|
|
54624
|
-
className: "" + styles["title"]
|
|
54625
|
-
}, 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) {
|
|
54626
|
-
return React.createElement("p", {
|
|
54627
|
-
key: r,
|
|
54628
|
-
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" : ""],
|
|
54629
|
-
onClick: function onClick() {
|
|
54630
|
-
return handleSelectUserRoles([r]);
|
|
54631
|
-
}
|
|
54632
|
-
}, r == "SecondaryTeacher" ? "Support Teacher" : r);
|
|
54633
|
-
})));
|
|
54634
|
-
};
|
|
54635
|
-
|
|
54636
|
-
var TheLayout = function TheLayout(_ref) {
|
|
54637
|
-
var routes = _ref.routes,
|
|
54638
|
-
navigation = _ref.navigation;
|
|
54639
|
-
var history = useHistory();
|
|
54640
|
-
var dispatch = useDispatch();
|
|
54641
|
-
var user = useSelector(function (state) {
|
|
54642
|
-
return state.common.user;
|
|
54643
|
-
});
|
|
54644
|
-
var language = useSelector(function (state) {
|
|
54645
|
-
return state.common.language;
|
|
54646
|
-
});
|
|
54647
|
-
|
|
54648
|
-
var _useState = useState(false),
|
|
54649
|
-
openModelSelectRole = _useState[0],
|
|
54650
|
-
setOpenModelSelectRole = _useState[1];
|
|
54651
|
-
|
|
54652
|
-
var _useTranslation = useTranslation(),
|
|
54653
|
-
t = _useTranslation.t;
|
|
54654
|
-
|
|
54655
|
-
var location = useLocation();
|
|
54656
|
-
var isNotification = location.pathname.includes("notifications");
|
|
54657
|
-
var isDistrict = window.location.host.includes("-district");
|
|
54658
|
-
|
|
54659
|
-
var handleToggleModel = function handleToggleModel() {
|
|
54660
|
-
setOpenModelSelectRole(!openModelSelectRole);
|
|
54661
|
-
};
|
|
54662
|
-
|
|
54663
|
-
var authRoutes = useMemo(function () {
|
|
54664
|
-
return routes.filter(function (route) {
|
|
54665
|
-
return canAccess(user === null || user === void 0 ? void 0 : user.roles, route.roles);
|
|
54666
|
-
}).filter(function (route) {
|
|
54667
|
-
return !!route.isDistrict === isDistrict;
|
|
54668
|
-
});
|
|
54669
|
-
}, [user, language]);
|
|
54670
|
-
var authNavigations = useMemo(function () {
|
|
54671
|
-
return navigation.map(function (item) {
|
|
54672
|
-
var _item$_children, _item$_children2;
|
|
54673
|
-
|
|
54674
|
-
return _extends({}, item, {
|
|
54675
|
-
name: t(item.name),
|
|
54676
|
-
_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) {
|
|
54677
|
-
return _extends({}, x, {
|
|
54678
|
-
name: t(x.name)
|
|
54679
|
-
});
|
|
54680
|
-
}) : undefined
|
|
54681
|
-
});
|
|
54682
|
-
}).filter(function (nav) {
|
|
54683
|
-
return canAccess(user === null || user === void 0 ? void 0 : user.roles, nav.roles);
|
|
54684
|
-
}).filter(function (nav) {
|
|
54685
|
-
return !!nav.isDistrict === isDistrict;
|
|
54686
|
-
});
|
|
54687
|
-
}, [user, language]);
|
|
54688
|
-
|
|
54689
|
-
var getInformationSetting = function getInformationSetting() {
|
|
54690
|
-
try {
|
|
54691
|
-
var _temp2 = _catch(function () {
|
|
54692
|
-
return Promise.resolve(getSchoolSettings()).then(function (res) {
|
|
54693
|
-
dispatch(setSandboxMode(res.data.isSandboxMode));
|
|
54694
|
-
});
|
|
54695
|
-
}, function (err) {
|
|
54696
|
-
console.error(err);
|
|
54697
|
-
});
|
|
54698
|
-
|
|
54699
|
-
return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
|
|
54700
|
-
} catch (e) {
|
|
54701
|
-
return Promise.reject(e);
|
|
54702
|
-
}
|
|
54703
|
-
};
|
|
54704
|
-
|
|
54705
|
-
useEffect(function () {
|
|
54706
|
-
checkAuthentication();
|
|
54707
|
-
}, []);
|
|
54708
|
-
useEffect(function () {
|
|
54709
|
-
getInformationSetting();
|
|
54710
|
-
}, [location.pathname]);
|
|
54711
|
-
|
|
54712
|
-
var checkAuthentication = function checkAuthentication() {
|
|
54713
|
-
try {
|
|
54714
|
-
var _temp4 = _catch(function () {
|
|
54715
|
-
return Promise.resolve(firstCheckToken()).then(function (tokenStatus) {
|
|
54716
|
-
tokenStatus ? loadInfo() : resetAuth();
|
|
54717
|
-
});
|
|
54718
|
-
}, function () {
|
|
54719
|
-
resetAuth();
|
|
54720
|
-
});
|
|
54721
|
-
|
|
54722
|
-
return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(function () {}) : void 0);
|
|
54723
|
-
} catch (e) {
|
|
54724
|
-
return Promise.reject(e);
|
|
54725
|
-
}
|
|
54726
|
-
};
|
|
54727
|
-
|
|
54728
|
-
var loadInfo = function loadInfo() {
|
|
54729
|
-
try {
|
|
54730
|
-
var _temp6 = _catch(function () {
|
|
54731
|
-
return Promise.resolve(getInfo()).then(function (info) {
|
|
54732
|
-
var _info$data, _info$data$roles;
|
|
54733
|
-
|
|
54734
|
-
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"))) {
|
|
54735
|
-
resetAuth();
|
|
54736
|
-
}
|
|
54737
|
-
|
|
54738
|
-
dispatch(setUser(info.data));
|
|
54739
|
-
});
|
|
54740
|
-
}, function () {
|
|
54741
|
-
resetAuth();
|
|
54742
|
-
});
|
|
54743
|
-
|
|
54744
|
-
return Promise.resolve(_temp6 && _temp6.then ? _temp6.then(function () {}) : void 0);
|
|
54745
|
-
} catch (e) {
|
|
54746
|
-
return Promise.reject(e);
|
|
54747
|
-
}
|
|
54748
|
-
};
|
|
54749
|
-
|
|
54750
|
-
var resetAuth = function resetAuth() {
|
|
54751
|
-
localStorage.removeItem(ACCESS_TOKEN);
|
|
54752
|
-
sessionStorage.removeItem(ACCESS_TOKEN);
|
|
54753
|
-
localStorage.removeItem("ROLES");
|
|
54754
|
-
history.push("/");
|
|
54755
|
-
};
|
|
54756
|
-
|
|
54757
|
-
if (!user) {
|
|
54758
|
-
return React.createElement(Loading, null);
|
|
54759
|
-
}
|
|
54760
|
-
|
|
54761
|
-
return React.createElement("div", {
|
|
54762
|
-
className: "c-app c-default-layout"
|
|
54763
|
-
}, !isNotification && React.createElement(TheSidebar, {
|
|
54764
|
-
navigation: authNavigations
|
|
54765
|
-
}), React.createElement("div", {
|
|
54766
|
-
className: "c-wrapper"
|
|
54767
|
-
}, !isNotification && React.createElement(TheHeader, {
|
|
54768
|
-
onToggleModel: handleToggleModel
|
|
54769
|
-
}), React.createElement("div", {
|
|
54770
|
-
className: "c-body bg-white"
|
|
54771
|
-
}, React.createElement(TheContent$1, {
|
|
54772
|
-
routes: authRoutes
|
|
54773
|
-
}))), React.createElement(ModelSelectRole, {
|
|
54774
|
-
open: openModelSelectRole,
|
|
54775
|
-
onToggleModel: handleToggleModel
|
|
54776
|
-
}));
|
|
54777
|
-
};
|
|
54778
|
-
|
|
54779
54789
|
var amplitudeClient = amplitude;
|
|
54780
54790
|
|
|
54781
54791
|
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 };
|