mario-core 2.9.108-beta → 2.9.110-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/containers/Login/constant/type.d.ts +5 -0
- package/dist/containers/Login/views/ModelSelectRole.d.ts +4 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +79 -11
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +79 -12
- package/dist/index.modern.js.map +1 -1
- package/dist/utils/amplitude.d.ts +1 -0
- package/package.json +1 -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";
|
|
@@ -2715,6 +2715,7 @@ var apiUpload = axios.create({
|
|
|
2715
2715
|
|
|
2716
2716
|
if (token) {
|
|
2717
2717
|
config.headers.Authorization = "Bearer " + token;
|
|
2718
|
+
localStorage.setItem("LAST_TIME_REQUETST", moment().utc().format("YYYY-MM-DD HH:mm:ss"));
|
|
2718
2719
|
}
|
|
2719
2720
|
|
|
2720
2721
|
return config;
|
|
@@ -4384,6 +4385,7 @@ var Loading = function Loading() {
|
|
|
4384
4385
|
var isLoading = reactRedux.useSelector(function (state) {
|
|
4385
4386
|
return state.common.isLoading;
|
|
4386
4387
|
});
|
|
4388
|
+
localStorage.setItem("LAST_TIME_REQUETST", moment().utc().format("YYYY-MM-DD HH:mm:ss"));
|
|
4387
4389
|
return isLoading ? React__default.createElement("div", {
|
|
4388
4390
|
style: loadingStyle
|
|
4389
4391
|
}, React__default.createElement("div", {
|
|
@@ -7561,6 +7563,81 @@ var CommonHeader = function CommonHeader(_ref) {
|
|
|
7561
7563
|
}, header))));
|
|
7562
7564
|
};
|
|
7563
7565
|
|
|
7566
|
+
var utcToLocalTime = (function (time, FORMAT) {
|
|
7567
|
+
if (time === DATE_MIN_VALUE) return "";
|
|
7568
|
+
|
|
7569
|
+
try {
|
|
7570
|
+
return moment.utc(time).local().format(FORMAT || "yyyy-MM-DD");
|
|
7571
|
+
} catch (_unused) {
|
|
7572
|
+
return "";
|
|
7573
|
+
}
|
|
7574
|
+
});
|
|
7575
|
+
|
|
7576
|
+
var NotificationLogoutModal = function NotificationLogoutModal() {
|
|
7577
|
+
var _useState = React.useState(false),
|
|
7578
|
+
isOpen = _useState[0],
|
|
7579
|
+
setIsOpen = _useState[1];
|
|
7580
|
+
|
|
7581
|
+
var _useState2 = React.useState({
|
|
7582
|
+
minutes: 0,
|
|
7583
|
+
timeLogout: ""
|
|
7584
|
+
}),
|
|
7585
|
+
objTime = _useState2[0],
|
|
7586
|
+
setObjTime = _useState2[1];
|
|
7587
|
+
|
|
7588
|
+
var checkOpenModalLogout = function checkOpenModalLogout() {
|
|
7589
|
+
var lastTimeOut = localStorage.getItem("LAST_TIME_REQUETST");
|
|
7590
|
+
console.log({
|
|
7591
|
+
lastTimeOut: lastTimeOut
|
|
7592
|
+
});
|
|
7593
|
+
var timeMoment = moment(lastTimeOut, "YYYY-MM-DD HH:mm");
|
|
7594
|
+
var currentTime = moment(moment().utc().format("YYYY-MM-DD HH:mm"));
|
|
7595
|
+
var minutes = currentTime.diff(timeMoment, "minutes");
|
|
7596
|
+
var timeLogout = utcToLocalTime(currentTime.add(16 - minutes, 'minutes').format("YYYY-MM-DD HH:mm"), "HH:mm");
|
|
7597
|
+
|
|
7598
|
+
if (minutes == 13) {
|
|
7599
|
+
var dataTime = {
|
|
7600
|
+
minutes: minutes,
|
|
7601
|
+
timeLogout: timeLogout
|
|
7602
|
+
};
|
|
7603
|
+
setObjTime(dataTime);
|
|
7604
|
+
onToggle();
|
|
7605
|
+
}
|
|
7606
|
+
};
|
|
7607
|
+
|
|
7608
|
+
React.useEffect(function () {
|
|
7609
|
+
var getAccessToken = localStorage.getItem(ACCESS_TOKEN);
|
|
7610
|
+
|
|
7611
|
+
if (getAccessToken) {
|
|
7612
|
+
var interval = setInterval(function () {
|
|
7613
|
+
checkOpenModalLogout();
|
|
7614
|
+
}, 60 * 1000);
|
|
7615
|
+
return function () {
|
|
7616
|
+
return clearInterval(interval);
|
|
7617
|
+
};
|
|
7618
|
+
}
|
|
7619
|
+
|
|
7620
|
+
return;
|
|
7621
|
+
}, []);
|
|
7622
|
+
|
|
7623
|
+
var onToggle = function onToggle() {
|
|
7624
|
+
setIsOpen(!isOpen);
|
|
7625
|
+
};
|
|
7626
|
+
|
|
7627
|
+
return React__default.createElement(reactstrap.Modal, {
|
|
7628
|
+
isOpen: isOpen,
|
|
7629
|
+
toggle: onToggle,
|
|
7630
|
+
size: "xs"
|
|
7631
|
+
}, React__default.createElement(reactstrap.ModalHeader, {
|
|
7632
|
+
toggle: onToggle
|
|
7633
|
+
}, "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, {
|
|
7634
|
+
className: "text-right"
|
|
7635
|
+
}, React__default.createElement(reactstrap.Button, {
|
|
7636
|
+
color: "primary",
|
|
7637
|
+
onClick: onToggle
|
|
7638
|
+
}, "Confirm")));
|
|
7639
|
+
};
|
|
7640
|
+
|
|
7564
7641
|
var EditButtonIcon = function EditButtonIcon(_ref) {
|
|
7565
7642
|
var onClick = _ref.onClick;
|
|
7566
7643
|
return React__default.createElement("div", {
|
|
@@ -7986,16 +8063,6 @@ var NotificationStatusSelector = function NotificationStatusSelector(_ref) {
|
|
|
7986
8063
|
|
|
7987
8064
|
var NotificationStatusSelector$1 = React.memo(NotificationStatusSelector);
|
|
7988
8065
|
|
|
7989
|
-
var utcToLocalTime = (function (time, FORMAT) {
|
|
7990
|
-
if (time === DATE_MIN_VALUE) return "";
|
|
7991
|
-
|
|
7992
|
-
try {
|
|
7993
|
-
return moment.utc(time).local().format(FORMAT || "yyyy-MM-DD");
|
|
7994
|
-
} catch (_unused) {
|
|
7995
|
-
return "";
|
|
7996
|
-
}
|
|
7997
|
-
});
|
|
7998
|
-
|
|
7999
8066
|
var defaultFilters = {
|
|
8000
8067
|
currentPage: 1,
|
|
8001
8068
|
pageSize: 30,
|
|
@@ -10949,6 +11016,7 @@ exports.NOTIFICATION_ALERT_KEY = NOTIFICATION_ALERT_KEY;
|
|
|
10949
11016
|
exports.NOTIFICATION_CHANNEL = NOTIFICATION_CHANNEL;
|
|
10950
11017
|
exports.NotFound = NotFound;
|
|
10951
11018
|
exports.NotificationList = NotificationList;
|
|
11019
|
+
exports.NotificationLogoutModal = NotificationLogoutModal;
|
|
10952
11020
|
exports.NotificationModal = NotificationModal;
|
|
10953
11021
|
exports.QUESTION_TYPES = QUESTION_TYPES;
|
|
10954
11022
|
exports.QUESTION_TYPES_OPTIONS = QUESTION_TYPES_OPTIONS;
|