mario-core 2.8.4 → 2.9.2

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.
@@ -11,5 +11,7 @@ declare const useNotificationList: () => {
11
11
  changeFilters: (objectValue: any) => void;
12
12
  updateNotification: (id: any, isRead: any) => void;
13
13
  viewNotification: (notification: any) => void;
14
+ updateAll: () => Promise<void>;
15
+ toggleUpdateAllStatus: boolean;
14
16
  };
15
17
  export default useNotificationList;
package/dist/index.d.ts CHANGED
@@ -57,7 +57,7 @@ import getFileUrl from "./utils/getFileUrl";
57
57
  import getTextFromHTML from "./utils/getTextFromHTML";
58
58
  import utcToLocalTime from "./utils/utcToLocalTime";
59
59
  import { uploadFile, systemStudentBadge, systemCertificateUpload } from "./services/fileServices";
60
- import { setLoading, setModal, setAlert, setUser, reset, setCurrentStudentId, setCurrentStudentUserId, setCurrentStudentName, setTurnOffPassWhenChangeMode, showMenuBar } from "./redux/commons/action";
60
+ import { setLoading, setModal, setAlert, setUser, reset, setCurrentStudentId, setCurrentStudentUserId, setCurrentStudentName, setTurnOffPassWhenChangeMode, showMenuBar, showFontSize } from "./redux/commons/action";
61
61
  import { setClassList } from "./redux/classes/action";
62
62
  import { setConferenceRubricList } from "./redux/conferenceRubrics/action";
63
63
  import { setSuggestionList } from "./redux/suggestionBanks/action";
@@ -100,4 +100,4 @@ import { setFilterWidget } from "./redux/widget/action";
100
100
  import { setBandScoreList } from "./redux/bandScores/action";
101
101
  import { setStudentIdSelectedByTeacher } from "./redux/navMobile/action";
102
102
  import useFilters from "./hooks/useFilters";
103
- 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, ErrorHandler, DetailActionButtons, RequiredLabel, StarRatingSelector, ReactNotification, NotificationList, CustomSelector, UploadFileButton, SearchBoxContainer, CustomTab, CommonAlert, GalleryList, MediaList, useGalleryList, AcademicClassSelector, SchoolList, store, showMenuBar, 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, 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, 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 };
103
+ 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, 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, 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, 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 };
package/dist/index.js CHANGED
@@ -230,6 +230,7 @@ var setSidebar = toolkit.createAction("common/setSidebar");
230
230
  var setAlert = toolkit.createAction("common/setAlert");
231
231
  var reset = toolkit.createAction("common/reset");
232
232
  var showMenuBar = toolkit.createAction("common/showMenuBar");
233
+ var showFontSize = toolkit.createAction("common/showFontSize");
233
234
  var setCurrentStudentId = toolkit.createAction("common/setCurrentStudentId");
234
235
  var setCurrentStudentUserId = toolkit.createAction("common/setCurrentStudentUserId");
235
236
  var setCurrentStudentName = toolkit.createAction("common/setCurrentStudentName");
@@ -322,8 +323,8 @@ var defaultInfo = {
322
323
  captcha: "",
323
324
  rememberMe: false
324
325
  };
325
- var HOMEPAGE_TEACHER = "/my-one-to-one/up-coming";
326
- var HOMEPAGE_STUDENT = "/my-one-to-one/up-coming";
326
+ var HOMEPAGE_TEACHER = "/home";
327
+ var HOMEPAGE_STUDENT = "/home";
327
328
  var HOMEPAGE_ADMIN = "/admin/dashboard";
328
329
  var HOMEPAGE_PARENT = "/parent";
329
330
  var HOMEPAGE_DISTRICT = "/admin/schools";
@@ -527,7 +528,7 @@ var BlockLogin = function BlockLogin(_ref) {
527
528
  to: "/forgot-password",
528
529
  className: "" + styles["link-to-login"]
529
530
  }, "Forgot password?"), React__default.createElement("a", {
530
- href: "https://marioframework.com/privacy-policy/",
531
+ href: "/marioforme.com/privacy-policy/",
531
532
  target: "blank",
532
533
  className: "" + styles["link-to-login"]
533
534
  }, "Privacy Policy"))))), React__default.createElement(reactstrap.Col, {
@@ -768,7 +769,7 @@ var BlockForgetPassword = function BlockForgetPassword() {
768
769
  to: "/login",
769
770
  className: "" + styles["link-to-login"]
770
771
  }, "Return to login"), React__default.createElement("a", {
771
- href: "https://marioframework.com/privacy-policy/",
772
+ href: "/marioforme.com/privacy-policy",
772
773
  target: "blank",
773
774
  className: "" + styles["link-to-login"]
774
775
  }, "Privacy Policy"))))), React__default.createElement(reactstrap.Col, {
@@ -880,7 +881,7 @@ var BlockResetPassword = function BlockResetPassword() {
880
881
  to: "/login",
881
882
  className: "" + styles["link-to-login"]
882
883
  }, "Return to login"), React__default.createElement("a", {
883
- href: "https://marioframework.com/privacy-policy/",
884
+ href: "/marioforme.com/privacy-policy/",
884
885
  target: "blank",
885
886
  className: "" + styles["link-to-login"]
886
887
  }, "Privacy Policy"))))), React__default.createElement(reactstrap.Col, {
@@ -1103,7 +1104,7 @@ var Dashboard = function Dashboard() {
1103
1104
  className: styles["nav-home"] + " d-flex w-100"
1104
1105
  }, React__default.createElement("a", {
1105
1106
  className: styles["learn-more"] + " align-self-lg-center",
1106
- href: "https://marioframework.com/privacy-policy/",
1107
+ href: "/marioforme.com/privacy-policy",
1107
1108
  target: "blank"
1108
1109
  }, "Privacy Policy"), React__default.createElement(reactRouterDom.Link, {
1109
1110
  className: styles["contact"] + " align-self-lg-center",
@@ -1190,6 +1191,9 @@ var getUnReadNotifications = function getUnReadNotifications() {
1190
1191
  var updateStatusNotification = function updateStatusNotification(id) {
1191
1192
  return api.put(NOTIFICATION_URL + "/" + id);
1192
1193
  };
1194
+ var updateAllStatus = function updateAllStatus() {
1195
+ return api.put(NOTIFICATION_URL + "/updateAllStatus");
1196
+ };
1193
1197
 
1194
1198
  var useUnReadNotification = function useUnReadNotification() {
1195
1199
  var dispatch = reactRedux.useDispatch();
@@ -4387,6 +4391,10 @@ var useUserDetail = function useUserDetail(id) {
4387
4391
  });
4388
4392
  }
4389
4393
 
4394
+ if (!id) {
4395
+ alert("Password of " + result.data.email + " is " + ("\"" + result.data.password + "\""));
4396
+ }
4397
+
4390
4398
  dispatch(setAlert({
4391
4399
  type: "success",
4392
4400
  message: (!!id ? "Update" : "Create") + " user successfully"
@@ -5245,6 +5253,10 @@ var useNotificationList = function useNotificationList() {
5245
5253
  filters = _useState[0],
5246
5254
  setFilters = _useState[1];
5247
5255
 
5256
+ var _useState2 = React.useState(false),
5257
+ toggleUpdateAllStatus = _useState2[0],
5258
+ setToggleUpdateAllStatus = _useState2[1];
5259
+
5248
5260
  var changeFilters = function changeFilters(objectValue) {
5249
5261
  return setFilters(_extends({}, filters, objectValue));
5250
5262
  };
@@ -5345,6 +5357,40 @@ var useNotificationList = function useNotificationList() {
5345
5357
  }));
5346
5358
  }
5347
5359
  }, [notificationList, unReadNotification]);
5360
+ var updateAll = React.useCallback(function () {
5361
+ try {
5362
+ try {
5363
+ if (notificationList.length === 0) throw new Error("There are no unread messages");
5364
+ dispatch(setModal({
5365
+ isOpen: true,
5366
+ type: "warning",
5367
+ message: "Do you want to mark all notification ?",
5368
+ onConfirm: function () {
5369
+ try {
5370
+ setToggleUpdateAllStatus(true);
5371
+ return Promise.resolve(updateAllStatus()).then(function () {
5372
+ getData();
5373
+ setToggleUpdateAllStatus(false);
5374
+ });
5375
+ } catch (e) {
5376
+ return Promise.reject(e);
5377
+ }
5378
+ }
5379
+ }));
5380
+ } catch (err) {
5381
+ var _err$response3, _err$response3$data;
5382
+
5383
+ dispatch(setAlert({
5384
+ type: "danger",
5385
+ message: ((_err$response3 = err.response) === null || _err$response3 === void 0 ? void 0 : (_err$response3$data = _err$response3.data) === null || _err$response3$data === void 0 ? void 0 : _err$response3$data.title) || err.message
5386
+ }));
5387
+ }
5388
+
5389
+ return Promise.resolve();
5390
+ } catch (e) {
5391
+ return Promise.reject(e);
5392
+ }
5393
+ }, [notificationList]);
5348
5394
  return {
5349
5395
  notificationList: notificationList,
5350
5396
  totalItems: totalItems,
@@ -5352,7 +5398,9 @@ var useNotificationList = function useNotificationList() {
5352
5398
  filters: filters,
5353
5399
  changeFilters: changeFilters,
5354
5400
  updateNotification: updateNotification,
5355
- viewNotification: viewNotification
5401
+ viewNotification: viewNotification,
5402
+ updateAll: updateAll,
5403
+ toggleUpdateAllStatus: toggleUpdateAllStatus
5356
5404
  };
5357
5405
  };
5358
5406
 
@@ -5366,7 +5414,9 @@ var NotificationList = function NotificationList() {
5366
5414
  filters = _useNotificationList.filters,
5367
5415
  changeFilters = _useNotificationList.changeFilters,
5368
5416
  updateNotification = _useNotificationList.updateNotification,
5369
- viewNotification = _useNotificationList.viewNotification;
5417
+ viewNotification = _useNotificationList.viewNotification,
5418
+ updateAll = _useNotificationList.updateAll,
5419
+ toggleUpdateAllStatus = _useNotificationList.toggleUpdateAllStatus;
5370
5420
 
5371
5421
  return React__default.createElement("div", {
5372
5422
  className: "animated fadeIn",
@@ -5400,8 +5450,18 @@ var NotificationList = function NotificationList() {
5400
5450
  className: "my-2 d-flex justify-content-center"
5401
5451
  }, React__default.createElement(reactstrap.Col, {
5402
5452
  md: 12,
5403
- className: "d-flex justify-content-end"
5404
- }, "Total of notifications: ", totalItems)), React__default.createElement(reactstrap.Row, {
5453
+ className: "d-flex justify-content-end align-items-center"
5454
+ }, filters.isRead === false && React__default.createElement("div", {
5455
+ className: "d-flex align-items-center justify-content-end mx-2"
5456
+ }, "Mark all as read", React__default.createElement(reactstrap.CustomInput, {
5457
+ checked: toggleUpdateAllStatus,
5458
+ className: "mx-2",
5459
+ type: "checkbox",
5460
+ id: "status-checkbox",
5461
+ onChange: function onChange() {
5462
+ return updateAll();
5463
+ }
5464
+ })), "Total of notifications: ", totalItems)), React__default.createElement(reactstrap.Row, {
5405
5465
  className: "mb-2"
5406
5466
  }, React__default.createElement(reactstrap.Col, {
5407
5467
  md: 12
@@ -6652,7 +6712,8 @@ var initialState = {
6652
6712
  currentStudentUserId: localStorage.getItem("currentStudentUserId") || "",
6653
6713
  currentStudentName: localStorage.getItem("currentStudentName") || "",
6654
6714
  turnOffPassWhenChangeMode: false,
6655
- menuBar: true
6715
+ menuBar: true,
6716
+ defaultFontSize: 16
6656
6717
  };
6657
6718
  var commonReducer = toolkit.createReducer(initialState, function (builder) {
6658
6719
  builder.addCase(setLoading, function (state, action) {
@@ -6680,6 +6741,8 @@ var commonReducer = toolkit.createReducer(initialState, function (builder) {
6680
6741
  state.turnOffPassWhenChangeMode = action.payload;
6681
6742
  }).addCase(showMenuBar, function (state, action) {
6682
6743
  state.menuBar = action.payload;
6744
+ }).addCase(showFontSize, function (state, action) {
6745
+ state.defaultFontSize = action.payload;
6683
6746
  });
6684
6747
  });
6685
6748
 
@@ -7718,6 +7781,7 @@ exports.setTurnOffPassWhenChangeMode = setTurnOffPassWhenChangeMode;
7718
7781
  exports.setTutorialScreenList = setTutorialScreenList;
7719
7782
  exports.setUser = setUser;
7720
7783
  exports.setUserList = setUserList;
7784
+ exports.showFontSize = showFontSize;
7721
7785
  exports.showMenuBar = showMenuBar;
7722
7786
  exports.store = store;
7723
7787
  exports.systemCertificateUpload = systemCertificateUpload;