mario-core 2.9.113-beta → 2.9.115-beta
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/components/Modals/NotificationLogoutModal.d.ts +3 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +76 -11
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +76 -12
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
- package/dist/containers/Login/constant/type.d.ts +0 -5
- package/dist/containers/Login/views/ModelSelectRole.d.ts +0 -4
- package/dist/utils/amplitude.d.ts +0 -1
package/dist/index.modern.js
CHANGED
|
@@ -11,6 +11,7 @@ import { useDispatch, useSelector } from 'react-redux';
|
|
|
11
11
|
import { createAction, createReducer, configureStore } from '@reduxjs/toolkit';
|
|
12
12
|
import axios from 'axios';
|
|
13
13
|
import amplitude from 'amplitude-js';
|
|
14
|
+
import moment from 'moment';
|
|
14
15
|
import { useGoogleReCaptcha, GoogleReCaptcha, GoogleReCaptchaProvider } from 'react-google-recaptcha-v3';
|
|
15
16
|
import GoogleLogin from 'react-google-login';
|
|
16
17
|
import Select from 'react-select';
|
|
@@ -31,7 +32,6 @@ import Creatable from 'react-select/creatable';
|
|
|
31
32
|
import ReactNotification$1 from 'react-notifications-component';
|
|
32
33
|
import 'react-notifications-component/dist/theme.css';
|
|
33
34
|
import { AiOutlineEye } from 'react-icons/ai';
|
|
34
|
-
import moment from 'moment';
|
|
35
35
|
|
|
36
36
|
var dashboard = "Dashboard";
|
|
37
37
|
var user = "User";
|
|
@@ -2717,6 +2717,7 @@ var apiUpload = axios.create({
|
|
|
2717
2717
|
|
|
2718
2718
|
if (token) {
|
|
2719
2719
|
config.headers.Authorization = "Bearer " + token;
|
|
2720
|
+
localStorage.setItem("LAST_TIME_REQUETST", moment().utc().format("YYYY-MM-DD HH:mm:ss"));
|
|
2720
2721
|
}
|
|
2721
2722
|
|
|
2722
2723
|
return config;
|
|
@@ -4386,6 +4387,7 @@ var Loading = function Loading() {
|
|
|
4386
4387
|
var isLoading = useSelector(function (state) {
|
|
4387
4388
|
return state.common.isLoading;
|
|
4388
4389
|
});
|
|
4390
|
+
localStorage.setItem("LAST_TIME_REQUETST", moment().utc().format("YYYY-MM-DD HH:mm:ss"));
|
|
4389
4391
|
return isLoading ? React.createElement("div", {
|
|
4390
4392
|
style: loadingStyle
|
|
4391
4393
|
}, React.createElement("div", {
|
|
@@ -7560,6 +7562,78 @@ var CommonHeader = function CommonHeader(_ref) {
|
|
|
7560
7562
|
}, header))));
|
|
7561
7563
|
};
|
|
7562
7564
|
|
|
7565
|
+
var utcToLocalTime = (function (time, FORMAT) {
|
|
7566
|
+
if (time === DATE_MIN_VALUE) return "";
|
|
7567
|
+
|
|
7568
|
+
try {
|
|
7569
|
+
return moment.utc(time).local().format(FORMAT || "yyyy-MM-DD");
|
|
7570
|
+
} catch (_unused) {
|
|
7571
|
+
return "";
|
|
7572
|
+
}
|
|
7573
|
+
});
|
|
7574
|
+
|
|
7575
|
+
var NotificationLogoutModal = function NotificationLogoutModal() {
|
|
7576
|
+
var _useState = useState(false),
|
|
7577
|
+
isOpen = _useState[0],
|
|
7578
|
+
setIsOpen = _useState[1];
|
|
7579
|
+
|
|
7580
|
+
var _useState2 = useState({
|
|
7581
|
+
minutes: 0,
|
|
7582
|
+
timeLogout: ""
|
|
7583
|
+
}),
|
|
7584
|
+
objTime = _useState2[0],
|
|
7585
|
+
setObjTime = _useState2[1];
|
|
7586
|
+
|
|
7587
|
+
var checkOpenModalLogout = function checkOpenModalLogout() {
|
|
7588
|
+
var lastTimeOut = localStorage.getItem("LAST_TIME_REQUETST");
|
|
7589
|
+
var timeMoment = moment(lastTimeOut, "YYYY-MM-DD HH:mm");
|
|
7590
|
+
var currentTime = moment(moment().utc().format("YYYY-MM-DD HH:mm"));
|
|
7591
|
+
var minutes = currentTime.diff(timeMoment, "minutes");
|
|
7592
|
+
var timeLogout = utcToLocalTime(currentTime.add(16 - minutes, 'minutes').format("YYYY-MM-DD HH:mm"), "HH:mm");
|
|
7593
|
+
|
|
7594
|
+
if (minutes == 13) {
|
|
7595
|
+
var dataTime = {
|
|
7596
|
+
minutes: minutes,
|
|
7597
|
+
timeLogout: timeLogout
|
|
7598
|
+
};
|
|
7599
|
+
setObjTime(dataTime);
|
|
7600
|
+
onToggle();
|
|
7601
|
+
}
|
|
7602
|
+
};
|
|
7603
|
+
|
|
7604
|
+
useEffect(function () {
|
|
7605
|
+
var getAccessToken = localStorage.getItem(ACCESS_TOKEN);
|
|
7606
|
+
|
|
7607
|
+
if (getAccessToken) {
|
|
7608
|
+
var interval = setInterval(function () {
|
|
7609
|
+
checkOpenModalLogout();
|
|
7610
|
+
}, 60 * 1000);
|
|
7611
|
+
return function () {
|
|
7612
|
+
return clearInterval(interval);
|
|
7613
|
+
};
|
|
7614
|
+
}
|
|
7615
|
+
|
|
7616
|
+
return;
|
|
7617
|
+
}, [location.href]);
|
|
7618
|
+
|
|
7619
|
+
var onToggle = function onToggle() {
|
|
7620
|
+
setIsOpen(!isOpen);
|
|
7621
|
+
};
|
|
7622
|
+
|
|
7623
|
+
return React.createElement(Modal, {
|
|
7624
|
+
isOpen: isOpen,
|
|
7625
|
+
toggle: onToggle,
|
|
7626
|
+
size: "xs"
|
|
7627
|
+
}, React.createElement(ModalHeader, {
|
|
7628
|
+
toggle: onToggle
|
|
7629
|
+
}, "Notification Logout"), React.createElement(ModalBody, null, "Are you still here? You have had no action for " + (objTime === null || objTime === void 0 ? void 0 : objTime.minutes) + " mins. \n Your account could be log out after " + (15 - (objTime === null || objTime === void 0 ? void 0 : objTime.minutes)) + " mins at " + (objTime === null || objTime === void 0 ? void 0 : objTime.timeLogout) + " if you don't action."), React.createElement(ModalFooter, {
|
|
7630
|
+
className: "text-right"
|
|
7631
|
+
}, React.createElement(Button, {
|
|
7632
|
+
color: "primary",
|
|
7633
|
+
onClick: onToggle
|
|
7634
|
+
}, "Confirm")));
|
|
7635
|
+
};
|
|
7636
|
+
|
|
7563
7637
|
var EditButtonIcon = function EditButtonIcon(_ref) {
|
|
7564
7638
|
var onClick = _ref.onClick;
|
|
7565
7639
|
return React.createElement("div", {
|
|
@@ -7985,16 +8059,6 @@ var NotificationStatusSelector = function NotificationStatusSelector(_ref) {
|
|
|
7985
8059
|
|
|
7986
8060
|
var NotificationStatusSelector$1 = memo(NotificationStatusSelector);
|
|
7987
8061
|
|
|
7988
|
-
var utcToLocalTime = (function (time, FORMAT) {
|
|
7989
|
-
if (time === DATE_MIN_VALUE) return "";
|
|
7990
|
-
|
|
7991
|
-
try {
|
|
7992
|
-
return moment.utc(time).local().format(FORMAT || "yyyy-MM-DD");
|
|
7993
|
-
} catch (_unused) {
|
|
7994
|
-
return "";
|
|
7995
|
-
}
|
|
7996
|
-
});
|
|
7997
|
-
|
|
7998
8062
|
var defaultFilters = {
|
|
7999
8063
|
currentPage: 1,
|
|
8000
8064
|
pageSize: 30,
|
|
@@ -10898,5 +10962,5 @@ var UserList = function UserList() {
|
|
|
10898
10962
|
|
|
10899
10963
|
var amplitudeClient$1 = amplitude.getInstance();
|
|
10900
10964
|
|
|
10901
|
-
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, 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, Images, LICENSE_AGGRID, LinkEditButton, Loading, Login, MediaList, NOTIFICATION_ALERT_KEY, NOTIFICATION_CHANNEL, NotFound, NotificationList, NotificationModal, QUESTION_TYPES, QUESTION_TYPES_OPTIONS, QuestionCategorySelector, QuestionTypeSelector, QuitPrompt, ReactNotification, RequiredLabel$1 as RequiredLabel, SchoolList, ScrollToTop, SearchBox$1 as SearchBox, SearchBoxContainer, SkillList, StarRatingSelector, SuggestionCategorySelector, TAB_COLORS, TINY_MCE_API_KEY, TheContent$1 as TheContent, TheLayout, ToggleButton, UploadFileButton, UserDetail, UserList, addTab, amplitudeClient$1 as amplitudeClient, answerQuestion, answerQuestionDataPlayer, api, apiUpload, canAccess as canAccessRoute, changeNote, changeTags, clearTab, closeTab, debounce, editTab, editorConfig, firstCheckToken, generateRandomString, getFileUrl, getInfo, getTextFromHTML, i18n, initAmplitude, isInViewport, isLocalhost, reset, setAlert, setAssessmentList, setAssignmentList, setAssistantList, setBadgeList, setBandScoreList, setCertificateList, setClassList, setConferenceRubricList, setConversationOneToOne, setCurrentStudentId, setCurrentStudentName, setCurrentStudentUserId, setCustomAlertList, setDataPlayer, setEditItemQuesion, setEnableIEP, setEnableSurvey, setFeedbackList, setFilterWidget, setGoalExampleList, setImproveMyClass, setLanguage, setLearningSupportCategoryList, setLoading, setMailCategory, setModal, setMoveItemQuestion, setMyStudent, setQuestionByCategory, setQuestionCateList, setQuestionList, setReflectionList, setReflectionResultList, setResetQuestionList, setSchoolBlankDayList, setSelectQuestion, setSemesterList, setSessionPlayer, setSessionTemplateGeneralClassList, setSessionTemplateList, setStartTime, setStrategyList, setStudentIdSelectedByTeacher, setStudentList, setSubjectList, setSuggestionList, setTurnOffPassWhenChangeMode, setTutorialScreenList, setUser, setUserList, showFontSize, showMenuBar, store, systemCertificateUpload, systemStudentBadge, uploadFile, useFilters, useGalleryList, utcToLocalTime };
|
|
10965
|
+
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, 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, Images, 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, SchoolList, ScrollToTop, SearchBox$1 as SearchBox, SearchBoxContainer, SkillList, StarRatingSelector, SuggestionCategorySelector, TAB_COLORS, TINY_MCE_API_KEY, TheContent$1 as TheContent, TheLayout, ToggleButton, UploadFileButton, UserDetail, UserList, addTab, amplitudeClient$1 as amplitudeClient, answerQuestion, answerQuestionDataPlayer, api, apiUpload, canAccess as canAccessRoute, changeNote, changeTags, clearTab, closeTab, debounce, editTab, editorConfig, firstCheckToken, generateRandomString, getFileUrl, getInfo, getTextFromHTML, i18n, initAmplitude, isInViewport, isLocalhost, reset, setAlert, setAssessmentList, setAssignmentList, setAssistantList, setBadgeList, setBandScoreList, setCertificateList, setClassList, setConferenceRubricList, setConversationOneToOne, setCurrentStudentId, setCurrentStudentName, setCurrentStudentUserId, setCustomAlertList, setDataPlayer, setEditItemQuesion, setEnableIEP, setEnableSurvey, setFeedbackList, setFilterWidget, setGoalExampleList, setImproveMyClass, setLanguage, setLearningSupportCategoryList, setLoading, setMailCategory, setModal, setMoveItemQuestion, setMyStudent, setQuestionByCategory, setQuestionCateList, setQuestionList, setReflectionList, setReflectionResultList, setResetQuestionList, setSchoolBlankDayList, setSelectQuestion, setSemesterList, setSessionPlayer, setSessionTemplateGeneralClassList, setSessionTemplateList, setStartTime, setStrategyList, setStudentIdSelectedByTeacher, setStudentList, setSubjectList, setSuggestionList, setTurnOffPassWhenChangeMode, setTutorialScreenList, setUser, setUserList, showFontSize, showMenuBar, store, systemCertificateUpload, systemStudentBadge, uploadFile, useFilters, useGalleryList, utcToLocalTime };
|
|
10902
10966
|
//# sourceMappingURL=index.modern.js.map
|