mario-core 2.9.29-beta → 2.9.32-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.
@@ -7,6 +7,7 @@ import { object, string, boolean, number, array } from 'yup';
7
7
  import { useDispatch, useSelector } from 'react-redux';
8
8
  import { createAction, createReducer, configureStore } from '@reduxjs/toolkit';
9
9
  import axios from 'axios';
10
+ import amplitude from 'amplitude-js';
10
11
  import { useGoogleReCaptcha, GoogleReCaptcha, GoogleReCaptchaProvider } from 'react-google-recaptcha-v3';
11
12
  import GoogleLogin from 'react-google-login';
12
13
  import Select from 'react-select';
@@ -26,7 +27,6 @@ import ReactNotification$1 from 'react-notifications-component';
26
27
  import 'react-notifications-component/dist/theme.css';
27
28
  import { AiOutlineEye } from 'react-icons/ai';
28
29
  import moment from 'moment';
29
- import amplitude from 'amplitude-js';
30
30
 
31
31
  // A type of promise-like that resolves synchronously and supports only one observer
32
32
 
@@ -105,6 +105,7 @@ var PasswordInput = function PasswordInput(_ref) {
105
105
 
106
106
  var TINY_MCE_API_KEY = "adpshj9swgsscf83gw4gs2f74nx0vicpd5ydka20iqjd7l8r";
107
107
  var GOOGLE_RECAPTCHA_KEY = "6LfNtLUaAAAAAL24lbBV11jS-gBtt1mhtxb4NXs0";
108
+ var INIT_AMPLITUDE_KEY = "860fa99c52ae79d98e904b4c862ddaac";
108
109
  var ACCESS_TOKEN = "ACCESS_TOKEN";
109
110
  var DEFAULT_PAGE_SIZE_VALUES = [{
110
111
  label: "10",
@@ -413,7 +414,8 @@ var useLogin = function useLogin() {
413
414
  lastName = _res$data.lastName,
414
415
  roles = _res$data.roles,
415
416
  email = _res$data.email,
416
- profileImageFileName = _res$data.profileImageFileName;
417
+ profileImageFileName = _res$data.profileImageFileName,
418
+ isLoginFirst = _res$data.isLoginFirst;
417
419
  localStorage.setItem(ACCESS_TOKEN, token);
418
420
  dispatch(setUser({
419
421
  id: id,
@@ -424,6 +426,22 @@ var useLogin = function useLogin() {
424
426
  profileImageFileName: profileImageFileName
425
427
  }));
426
428
 
429
+ if (data !== null && data !== void 0 && data.email && !roles.includes("Admin")) {
430
+ amplitude.getInstance().init(INIT_AMPLITUDE_KEY, data.email, {
431
+ includeReferrer: true,
432
+ includeUtm: true
433
+ });
434
+ amplitude.getInstance().logEvent("general: session start", {
435
+ user_id: data.email
436
+ });
437
+
438
+ if (isLoginFirst) {
439
+ amplitude.getInstance().logEvent("general: first login", {
440
+ user_id: data.email
441
+ });
442
+ }
443
+ }
444
+
427
445
  if (isDistrict) {
428
446
  history.push(HOMEPAGE_DISTRICT);
429
447
  } else if (roles.includes("Admin")) {
@@ -8073,5 +8091,5 @@ var generateRandomString = (function () {
8073
8091
 
8074
8092
  var amplitudeClient = amplitude.getInstance();
8075
8093
 
8076
- export { ACCESS_TOKEN, ANSWER_EDITOR_HEIGHT, AcademicClassSelector, AddButton, BASE_URL, CHAT_CHANNEL, 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, Images, LICENSE_AGGRID, LinkEditButton, Loading, Login, MediaList, 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, answerQuestion, answerQuestionDataPlayer, api, apiUpload, canAccess as canAccessRoute, changeNote, changeTags, clearTab, closeTab, debounce, editTab, editorConfig, firstCheckToken, generateRandomString, getFileUrl, getInfo, getTextFromHTML, initAmplitude, isInViewport, reset, setAlert, setAssessmentList, setAssignmentList, setAssistantList, setBadgeList, setBandScoreList, setCertificateList, setClassList, setConferenceRubricList, setConversationOneToOne, setCurrentStudentId, setCurrentStudentName, setCurrentStudentUserId, setCustomAlertList, setDataPlayer, setEditItemQuesion, setEnableIEP, setFeedbackList, setFilterWidget, setGoalExampleList, setImproveMyClass, 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 };
8094
+ export { ACCESS_TOKEN, ANSWER_EDITOR_HEIGHT, AcademicClassSelector, AddButton, BASE_URL, CHAT_CHANNEL, 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, Images, LICENSE_AGGRID, LinkEditButton, Loading, Login, MediaList, 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, answerQuestion, answerQuestionDataPlayer, api, apiUpload, canAccess as canAccessRoute, changeNote, changeTags, clearTab, closeTab, debounce, editTab, editorConfig, firstCheckToken, generateRandomString, getFileUrl, getInfo, getTextFromHTML, initAmplitude, isInViewport, reset, setAlert, setAssessmentList, setAssignmentList, setAssistantList, setBadgeList, setBandScoreList, setCertificateList, setClassList, setConferenceRubricList, setConversationOneToOne, setCurrentStudentId, setCurrentStudentName, setCurrentStudentUserId, setCustomAlertList, setDataPlayer, setEditItemQuesion, setEnableIEP, setFeedbackList, setFilterWidget, setGoalExampleList, setImproveMyClass, 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 };
8077
8095
  //# sourceMappingURL=index.modern.js.map