mario-teacher-student-client 3.0.1-admin → 3.0.2-admin

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.
@@ -47959,151 +47959,6 @@ var ChangePassword = function ChangePassword() {
47959
47959
  });
47960
47960
  };
47961
47961
 
47962
- var useStageDebug = function useStageDebug(userId, year, month) {
47963
- var dispatch = useDispatch();
47964
- var history = useHistory();
47965
-
47966
- var _useState = useState(),
47967
- dataEvent = _useState[0],
47968
- setDataEvent = _useState[1];
47969
-
47970
- var getDataEvent = useCallback(function () {
47971
- try {
47972
- var _temp2 = _catch(function () {
47973
- return Promise.resolve(getEventCalendar(userId, year, month)).then(function (res) {
47974
- setDataEvent(res.data);
47975
- });
47976
- }, function (err) {
47977
- var _err$response, _err$response$data;
47978
-
47979
- dispatch(setAlert({
47980
- type: "danger",
47981
- 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
47982
- }));
47983
- });
47984
-
47985
- return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
47986
- } catch (e) {
47987
- return Promise.reject(e);
47988
- }
47989
- }, []);
47990
-
47991
- var initPage = function initPage() {
47992
- try {
47993
- var _temp5 = function _temp5() {
47994
- return Promise.resolve(getDataEvent()).then(function () {});
47995
- };
47996
-
47997
- var _temp6 = function () {
47998
- if (!!userId) return Promise.resolve(checkAuthentication()).then(function () {});
47999
- }();
48000
-
48001
- return Promise.resolve(_temp6 && _temp6.then ? _temp6.then(_temp5) : _temp5(_temp6));
48002
- } catch (e) {
48003
- return Promise.reject(e);
48004
- }
48005
- };
48006
-
48007
- var checkAuthentication = function checkAuthentication() {
48008
- try {
48009
- var _temp8 = _catch(function () {
48010
- return Promise.resolve(firstCheckToken()).then(function (tokenStatus) {
48011
- tokenStatus ? loadInfo() : resetAuth();
48012
- });
48013
- }, function () {
48014
- resetAuth();
48015
- });
48016
-
48017
- return Promise.resolve(_temp8 && _temp8.then ? _temp8.then(function () {}) : void 0);
48018
- } catch (e) {
48019
- return Promise.reject(e);
48020
- }
48021
- };
48022
-
48023
- var loadInfo = function loadInfo() {
48024
- try {
48025
- var _temp12 = _catch(function () {
48026
- return Promise.resolve(getInfo()).then(function (info) {
48027
- var _info$data;
48028
-
48029
- function _temp10() {
48030
- dispatch(setUser(userData));
48031
- }
48032
-
48033
- if (!info) {
48034
- resetAuth();
48035
- }
48036
-
48037
- var roles = (_info$data = info.data) === null || _info$data === void 0 ? void 0 : _info$data.roles;
48038
- var userData = info.data;
48039
- var isTeacher = roles.includes("Teacher");
48040
- var isStudent = roles.includes("Student");
48041
-
48042
- var _temp9 = function () {
48043
- if (isTeacher || isStudent) {
48044
- return Promise.resolve(getStudentSimpleProfile()).then(function (profileRes) {
48045
- var _profileRes$data7;
48046
-
48047
- if (isStudent) {
48048
- var _profileRes$data, _profileRes$data2, _profileRes$data3, _profileRes$data4, _profileRes$data5;
48049
-
48050
- userData.studentId = (_profileRes$data = profileRes.data) === null || _profileRes$data === void 0 ? void 0 : _profileRes$data.id;
48051
- userData.mainTeacherId = (_profileRes$data2 = profileRes.data) === null || _profileRes$data2 === void 0 ? void 0 : _profileRes$data2.mainTeacherId;
48052
- userData.mainTeacherName = (_profileRes$data3 = profileRes.data) === null || _profileRes$data3 === void 0 ? void 0 : _profileRes$data3.mainTeacherName;
48053
- userData.mainTeacherUserId = (_profileRes$data4 = profileRes.data) === null || _profileRes$data4 === void 0 ? void 0 : _profileRes$data4.mainTeacherUserId;
48054
- userData.mainTeacherProfileImageFileName = (_profileRes$data5 = profileRes.data) === null || _profileRes$data5 === void 0 ? void 0 : _profileRes$data5.mainTeacherProfileImageFileName;
48055
- } else {
48056
- var _profileRes$data6;
48057
-
48058
- userData.teacherId = (_profileRes$data6 = profileRes.data) === null || _profileRes$data6 === void 0 ? void 0 : _profileRes$data6.id;
48059
- }
48060
-
48061
- userData.name = (_profileRes$data7 = profileRes.data) === null || _profileRes$data7 === void 0 ? void 0 : _profileRes$data7.name;
48062
- });
48063
- }
48064
- }();
48065
-
48066
- return _temp9 && _temp9.then ? _temp9.then(_temp10) : _temp10(_temp9);
48067
- });
48068
- }, function () {
48069
- resetAuth();
48070
- });
48071
-
48072
- return Promise.resolve(_temp12 && _temp12.then ? _temp12.then(function () {}) : void 0);
48073
- } catch (e) {
48074
- return Promise.reject(e);
48075
- }
48076
- };
48077
-
48078
- var resetAuth = function resetAuth() {
48079
- localStorage.removeItem(ACCESS_TOKEN);
48080
- history.push("/");
48081
- };
48082
-
48083
- useEffect(function () {
48084
- initPage();
48085
- }, []);
48086
- return {
48087
- dataEvent: dataEvent
48088
- };
48089
- };
48090
-
48091
- var StageDebugPage = function StageDebugPage() {
48092
- var currentYear = parseInt(moment().format("YYYY"));
48093
- var currentMonth = parseInt(moment().format("MM"));
48094
- var user = useSelector(function (state) {
48095
- return state.common.user;
48096
- });
48097
-
48098
- var _useStageDebug = useStageDebug(user, currentYear, currentMonth),
48099
- dataEvent = _useStageDebug.dataEvent;
48100
-
48101
- return React__default.createElement(CurrentFullCalendar, {
48102
- eventList: dataEvent === null || dataEvent === void 0 ? void 0 : dataEvent.calendarEvents,
48103
- isTeacher: true
48104
- });
48105
- };
48106
-
48107
47962
  var LearningPlan$1 = function LearningPlan() {
48108
47963
  var _useState = useState(''),
48109
47964
  value = _useState[0],
@@ -71681,5 +71536,5 @@ var SurveyOverview = function SurveyOverview() {
71681
71536
  }));
71682
71537
  };
71683
71538
 
71684
- export { AboutMyLearningList, AccomondationList, ActionPoint, ActivityCircleLearning, AddClassReflection, AddClassSchedule, AddNote, BookSession, BookSessionConferences, ChangePassword, ConductIndex, ConferenceRubric, CreateStudent, CreateSurvey, DetailStrengthsAndChallenges, EditNote, EduTeacherViewDetail, ExternalReflection, ExternalSurvey, FriendCircleLearning, GoalDetail, GoalList, HomePage, LearningPlan$1 as LearningPlan, LearningStrategies, LearningStrategiesSave, ListActivityLearning, ListFriendCircle, ListPersonalinterrest, ListStudent, ListSurveys, MainLayout, MyClassReflection, MyClassSchedule, MyConferences, MyOneToOne, MyProfile, MyStudent, NewGoal, NewLearningPlan, Note, ParentPage, PersonalLearningGoal, PlpPage, PreviewSurvey, PrivacyPolicy, ResultConferenceRubric, ResultReflection, SessionDetail, SessionResultComponent, SettingPage, StageDebugPage, StartReflection, StudentDetail, StudentReflection, SurveyDetail, SurveyIndex, SurveyOverview, SurveyResult, SurveyStudentList, TeacherClassReflection, TeachingStrategiesAdd, ThankYouCard, ThankYouError, ThingTeachersCanHelpList as ThinkTeacherCanHelpList, TrainingLink, UiCompletedOneToOne, UpdateStudentProfile, ViewItemNote };
71539
+ export { AboutMyLearningList, AccomondationList, ActionPoint, ActivityCircleLearning, AddClassReflection, AddClassSchedule, AddNote, BookSession, BookSessionConferences, ChangePassword, ConductIndex, ConferenceRubric, CreateStudent, CreateSurvey, DetailStrengthsAndChallenges, EditNote, EduTeacherViewDetail, ExternalReflection, ExternalSurvey, FriendCircleLearning, GoalDetail, GoalList, HomePage, LearningPlan$1 as LearningPlan, LearningStrategies, LearningStrategiesSave, ListActivityLearning, ListFriendCircle, ListPersonalinterrest, ListStudent, ListSurveys, MainLayout, MyClassReflection, MyClassSchedule, MyConferences, MyOneToOne, MyProfile, MyStudent, NewGoal, NewLearningPlan, Note, ParentPage, PersonalLearningGoal, PlpPage, PreviewSurvey, PrivacyPolicy, ResultConferenceRubric, ResultReflection, SessionDetail, SessionResultComponent, SettingPage, StartReflection, StudentDetail, StudentReflection, SurveyDetail, SurveyIndex, SurveyOverview, SurveyResult, SurveyStudentList, TeacherClassReflection, TeachingStrategiesAdd, ThankYouCard, ThankYouError, ThingTeachersCanHelpList as ThinkTeacherCanHelpList, TrainingLink, UiCompletedOneToOne, UpdateStudentProfile, ViewItemNote };
71685
71540
  //# sourceMappingURL=index.modern.js.map