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.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ import ScrollToTop from "./components/Scroll/ScrollToTop";
|
|
|
16
16
|
import NotificationModal from "./components/Modals/NotificationModal";
|
|
17
17
|
import CommonHeader from "./components/Headers/CommonHeader";
|
|
18
18
|
import CommonModal from "./components/Modals/CommonModal";
|
|
19
|
+
import NotificationLogoutModal from "./components/Modals/NotificationLogoutModal";
|
|
19
20
|
import AddButton from "./components/Buttons/AddButton";
|
|
20
21
|
import DeleteButtonIcon from "./components/Buttons/DeleteButtonIcon";
|
|
21
22
|
import EditButtonIcon from "./components/Buttons/EditButtonIcon";
|
|
@@ -108,4 +109,4 @@ import { setEnableIEP, setEnableSurvey, setConversationOneToOne, setLanguage } f
|
|
|
108
109
|
import useFilters from "./hooks/useFilters";
|
|
109
110
|
import amplitude from "amplitude-js";
|
|
110
111
|
declare const amplitudeClient: amplitude.AmplitudeClient;
|
|
111
|
-
export { Login, Dashboard, TheLayout, TheContent, NotFound, EmailTemplateList, EmailTemplateDetail, FaqList, SkillList, UserList, UserDetail, Loading, NotificationModal, CommonHeader, CommonModal, AddButton, DeleteButtonIcon, EditButtonIcon, LinkEditButton, ToggleButton, EmptyDataAlert, CreatableSelector, CustomPagination, SearchBox, FileInput, QuitPrompt, QuestionTypeSelector, QuestionCategorySelector, SuggestionCategorySelector, CategorySelector, ErrorHandler, DetailActionButtons, RequiredLabel, StarRatingSelector, ReactNotification, NotificationList, CustomSelector, UploadFileButton, SearchBoxContainer, CustomTab, CommonAlert, GalleryList, MediaList, useGalleryList, AcademicClassSelector, SchoolList, store, showMenuBar, showFontSize, setLoading, setModal, setAlert, setClassList, setConferenceRubricList, setSuggestionList, setStrategyList, setSubjectList, setLearningSupportCategoryList, setQuestionList, setUserList, setStudentList, setBadgeList, setGoalExampleList, setSemesterList, setFeedbackList, setAssessmentList, setQuestionByCategory, setSelectQuestion, setMoveItemQuestion, setReflectionList, setReflectionResultList, setEditItemQuesion, setResetQuestionList, setMailCategory, setUser, setAssignmentList, setAssistantList, setSessionTemplateList, setTutorialScreenList, setSessionTemplateGeneralClassList, setCustomAlertList, setCertificateList, closeTab, addTab, editTab, clearTab, changeNote, changeTags, answerQuestion, setSessionPlayer, setStartTime, setTurnOffPassWhenChangeMode, reset, setImproveMyClass, setSchoolBlankDayList, setEnableIEP, setEnableSurvey, setConversationOneToOne, setLanguage, i18n, useTranslation, I18nextProvider, api, apiUpload, uploadFile, systemStudentBadge, systemCertificateUpload, BASE_URL, DEFAULT_FILTER, LICENSE_AGGRID, TINY_MCE_API_KEY, QUESTION_TYPES, QUESTION_TYPES_OPTIONS, ANSWER_EDITOR_HEIGHT, CHAT_CHANNEL, NOTIFICATION_CHANNEL, DATE_RESULT, DATE_FORMAT, FULL_DATE_RESULT, ACCESS_TOKEN, NOTIFICATION_ALERT_KEY, GOOGLE_RECAPTCHA_KEY, EMOTIONS, TAB_COLORS, Filter, Conversation, Message, ConversationMember, NavbarTab, editorConfig, generateRandomString, isInViewport, debounce, firstCheckToken, canAccessRoute, getFileUrl, getTextFromHTML, utcToLocalTime, getInfo, Images, setQuestionCateList, setMyStudent, setDataPlayer, answerQuestionDataPlayer, setCurrentStudentUserId, setCurrentStudentId, setCurrentStudentName, setFilterWidget, setBandScoreList, setStudentIdSelectedByTeacher, useFilters, ScrollToTop, initAmplitude, amplitudeClient, INIT_AMPLITUDE_KEY_STAGE, INIT_AMPLITUDE_KEY_PROD, isLocalhost };
|
|
112
|
+
export { Login, Dashboard, TheLayout, TheContent, NotFound, EmailTemplateList, EmailTemplateDetail, FaqList, SkillList, UserList, UserDetail, Loading, NotificationModal, CommonHeader, CommonModal, NotificationLogoutModal, AddButton, DeleteButtonIcon, EditButtonIcon, LinkEditButton, ToggleButton, EmptyDataAlert, CreatableSelector, CustomPagination, SearchBox, FileInput, QuitPrompt, QuestionTypeSelector, QuestionCategorySelector, SuggestionCategorySelector, CategorySelector, ErrorHandler, DetailActionButtons, RequiredLabel, StarRatingSelector, ReactNotification, NotificationList, CustomSelector, UploadFileButton, SearchBoxContainer, CustomTab, CommonAlert, GalleryList, MediaList, useGalleryList, AcademicClassSelector, SchoolList, store, showMenuBar, showFontSize, setLoading, setModal, setAlert, setClassList, setConferenceRubricList, setSuggestionList, setStrategyList, setSubjectList, setLearningSupportCategoryList, setQuestionList, setUserList, setStudentList, setBadgeList, setGoalExampleList, setSemesterList, setFeedbackList, setAssessmentList, setQuestionByCategory, setSelectQuestion, setMoveItemQuestion, setReflectionList, setReflectionResultList, setEditItemQuesion, setResetQuestionList, setMailCategory, setUser, setAssignmentList, setAssistantList, setSessionTemplateList, setTutorialScreenList, setSessionTemplateGeneralClassList, setCustomAlertList, setCertificateList, closeTab, addTab, editTab, clearTab, changeNote, changeTags, answerQuestion, setSessionPlayer, setStartTime, setTurnOffPassWhenChangeMode, reset, setImproveMyClass, setSchoolBlankDayList, setEnableIEP, setEnableSurvey, setConversationOneToOne, setLanguage, i18n, useTranslation, I18nextProvider, api, apiUpload, uploadFile, systemStudentBadge, systemCertificateUpload, BASE_URL, DEFAULT_FILTER, LICENSE_AGGRID, TINY_MCE_API_KEY, QUESTION_TYPES, QUESTION_TYPES_OPTIONS, ANSWER_EDITOR_HEIGHT, CHAT_CHANNEL, NOTIFICATION_CHANNEL, DATE_RESULT, DATE_FORMAT, FULL_DATE_RESULT, ACCESS_TOKEN, NOTIFICATION_ALERT_KEY, GOOGLE_RECAPTCHA_KEY, EMOTIONS, TAB_COLORS, Filter, Conversation, Message, ConversationMember, NavbarTab, editorConfig, generateRandomString, isInViewport, debounce, firstCheckToken, canAccessRoute, getFileUrl, getTextFromHTML, utcToLocalTime, getInfo, Images, setQuestionCateList, setMyStudent, setDataPlayer, answerQuestionDataPlayer, setCurrentStudentUserId, setCurrentStudentId, setCurrentStudentName, setFilterWidget, setBandScoreList, setStudentIdSelectedByTeacher, useFilters, ScrollToTop, initAmplitude, amplitudeClient, INIT_AMPLITUDE_KEY_STAGE, INIT_AMPLITUDE_KEY_PROD, isLocalhost };
|
package/dist/index.js
CHANGED
|
@@ -13,6 +13,7 @@ var reactRedux = require('react-redux');
|
|
|
13
13
|
var toolkit = require('@reduxjs/toolkit');
|
|
14
14
|
var axios = _interopDefault(require('axios'));
|
|
15
15
|
var amplitude = _interopDefault(require('amplitude-js'));
|
|
16
|
+
var moment = _interopDefault(require('moment'));
|
|
16
17
|
var reactGoogleRecaptchaV3 = require('react-google-recaptcha-v3');
|
|
17
18
|
var GoogleLogin = _interopDefault(require('react-google-login'));
|
|
18
19
|
var Select = _interopDefault(require('react-select'));
|
|
@@ -33,7 +34,6 @@ var Creatable = _interopDefault(require('react-select/creatable'));
|
|
|
33
34
|
var ReactNotification$1 = _interopDefault(require('react-notifications-component'));
|
|
34
35
|
require('react-notifications-component/dist/theme.css');
|
|
35
36
|
var ai = require('react-icons/ai');
|
|
36
|
-
var moment = _interopDefault(require('moment'));
|
|
37
37
|
|
|
38
38
|
var dashboard = "Dashboard";
|
|
39
39
|
var user = "User";
|
|
@@ -2719,6 +2719,7 @@ var apiUpload = axios.create({
|
|
|
2719
2719
|
|
|
2720
2720
|
if (token) {
|
|
2721
2721
|
config.headers.Authorization = "Bearer " + token;
|
|
2722
|
+
localStorage.setItem("LAST_TIME_REQUETST", moment().utc().format("YYYY-MM-DD HH:mm:ss"));
|
|
2722
2723
|
}
|
|
2723
2724
|
|
|
2724
2725
|
return config;
|
|
@@ -4388,6 +4389,7 @@ var Loading = function Loading() {
|
|
|
4388
4389
|
var isLoading = reactRedux.useSelector(function (state) {
|
|
4389
4390
|
return state.common.isLoading;
|
|
4390
4391
|
});
|
|
4392
|
+
localStorage.setItem("LAST_TIME_REQUETST", moment().utc().format("YYYY-MM-DD HH:mm:ss"));
|
|
4391
4393
|
return isLoading ? React__default.createElement("div", {
|
|
4392
4394
|
style: loadingStyle
|
|
4393
4395
|
}, React__default.createElement("div", {
|
|
@@ -7562,6 +7564,78 @@ var CommonHeader = function CommonHeader(_ref) {
|
|
|
7562
7564
|
}, header))));
|
|
7563
7565
|
};
|
|
7564
7566
|
|
|
7567
|
+
var utcToLocalTime = (function (time, FORMAT) {
|
|
7568
|
+
if (time === DATE_MIN_VALUE) return "";
|
|
7569
|
+
|
|
7570
|
+
try {
|
|
7571
|
+
return moment.utc(time).local().format(FORMAT || "yyyy-MM-DD");
|
|
7572
|
+
} catch (_unused) {
|
|
7573
|
+
return "";
|
|
7574
|
+
}
|
|
7575
|
+
});
|
|
7576
|
+
|
|
7577
|
+
var NotificationLogoutModal = function NotificationLogoutModal() {
|
|
7578
|
+
var _useState = React.useState(false),
|
|
7579
|
+
isOpen = _useState[0],
|
|
7580
|
+
setIsOpen = _useState[1];
|
|
7581
|
+
|
|
7582
|
+
var _useState2 = React.useState({
|
|
7583
|
+
minutes: 0,
|
|
7584
|
+
timeLogout: ""
|
|
7585
|
+
}),
|
|
7586
|
+
objTime = _useState2[0],
|
|
7587
|
+
setObjTime = _useState2[1];
|
|
7588
|
+
|
|
7589
|
+
var checkOpenModalLogout = function checkOpenModalLogout() {
|
|
7590
|
+
var lastTimeOut = localStorage.getItem("LAST_TIME_REQUETST");
|
|
7591
|
+
var timeMoment = moment(lastTimeOut, "YYYY-MM-DD HH:mm");
|
|
7592
|
+
var currentTime = moment(moment().utc().format("YYYY-MM-DD HH:mm"));
|
|
7593
|
+
var minutes = currentTime.diff(timeMoment, "minutes");
|
|
7594
|
+
var timeLogout = utcToLocalTime(currentTime.add(16 - minutes, 'minutes').format("YYYY-MM-DD HH:mm"), "HH:mm");
|
|
7595
|
+
|
|
7596
|
+
if (minutes == 13) {
|
|
7597
|
+
var dataTime = {
|
|
7598
|
+
minutes: minutes,
|
|
7599
|
+
timeLogout: timeLogout
|
|
7600
|
+
};
|
|
7601
|
+
setObjTime(dataTime);
|
|
7602
|
+
onToggle();
|
|
7603
|
+
}
|
|
7604
|
+
};
|
|
7605
|
+
|
|
7606
|
+
React.useEffect(function () {
|
|
7607
|
+
var getAccessToken = localStorage.getItem(ACCESS_TOKEN);
|
|
7608
|
+
|
|
7609
|
+
if (getAccessToken) {
|
|
7610
|
+
var interval = setInterval(function () {
|
|
7611
|
+
checkOpenModalLogout();
|
|
7612
|
+
}, 60 * 1000);
|
|
7613
|
+
return function () {
|
|
7614
|
+
return clearInterval(interval);
|
|
7615
|
+
};
|
|
7616
|
+
}
|
|
7617
|
+
|
|
7618
|
+
return;
|
|
7619
|
+
}, [location.href]);
|
|
7620
|
+
|
|
7621
|
+
var onToggle = function onToggle() {
|
|
7622
|
+
setIsOpen(!isOpen);
|
|
7623
|
+
};
|
|
7624
|
+
|
|
7625
|
+
return React__default.createElement(reactstrap.Modal, {
|
|
7626
|
+
isOpen: isOpen,
|
|
7627
|
+
toggle: onToggle,
|
|
7628
|
+
size: "xs"
|
|
7629
|
+
}, React__default.createElement(reactstrap.ModalHeader, {
|
|
7630
|
+
toggle: onToggle
|
|
7631
|
+
}, "Notification Logout"), React__default.createElement(reactstrap.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__default.createElement(reactstrap.ModalFooter, {
|
|
7632
|
+
className: "text-right"
|
|
7633
|
+
}, React__default.createElement(reactstrap.Button, {
|
|
7634
|
+
color: "primary",
|
|
7635
|
+
onClick: onToggle
|
|
7636
|
+
}, "Confirm")));
|
|
7637
|
+
};
|
|
7638
|
+
|
|
7565
7639
|
var EditButtonIcon = function EditButtonIcon(_ref) {
|
|
7566
7640
|
var onClick = _ref.onClick;
|
|
7567
7641
|
return React__default.createElement("div", {
|
|
@@ -7987,16 +8061,6 @@ var NotificationStatusSelector = function NotificationStatusSelector(_ref) {
|
|
|
7987
8061
|
|
|
7988
8062
|
var NotificationStatusSelector$1 = React.memo(NotificationStatusSelector);
|
|
7989
8063
|
|
|
7990
|
-
var utcToLocalTime = (function (time, FORMAT) {
|
|
7991
|
-
if (time === DATE_MIN_VALUE) return "";
|
|
7992
|
-
|
|
7993
|
-
try {
|
|
7994
|
-
return moment.utc(time).local().format(FORMAT || "yyyy-MM-DD");
|
|
7995
|
-
} catch (_unused) {
|
|
7996
|
-
return "";
|
|
7997
|
-
}
|
|
7998
|
-
});
|
|
7999
|
-
|
|
8000
8064
|
var defaultFilters = {
|
|
8001
8065
|
currentPage: 1,
|
|
8002
8066
|
pageSize: 30,
|
|
@@ -10955,6 +11019,7 @@ exports.NOTIFICATION_ALERT_KEY = NOTIFICATION_ALERT_KEY;
|
|
|
10955
11019
|
exports.NOTIFICATION_CHANNEL = NOTIFICATION_CHANNEL;
|
|
10956
11020
|
exports.NotFound = NotFound;
|
|
10957
11021
|
exports.NotificationList = NotificationList;
|
|
11022
|
+
exports.NotificationLogoutModal = NotificationLogoutModal;
|
|
10958
11023
|
exports.NotificationModal = NotificationModal;
|
|
10959
11024
|
exports.QUESTION_TYPES = QUESTION_TYPES;
|
|
10960
11025
|
exports.QUESTION_TYPES_OPTIONS = QUESTION_TYPES_OPTIONS;
|