mario-core 2.8.4 → 2.9.0

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");
@@ -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();
@@ -5245,6 +5249,10 @@ var useNotificationList = function useNotificationList() {
5245
5249
  filters = _useState[0],
5246
5250
  setFilters = _useState[1];
5247
5251
 
5252
+ var _useState2 = React.useState(false),
5253
+ toggleUpdateAllStatus = _useState2[0],
5254
+ setToggleUpdateAllStatus = _useState2[1];
5255
+
5248
5256
  var changeFilters = function changeFilters(objectValue) {
5249
5257
  return setFilters(_extends({}, filters, objectValue));
5250
5258
  };
@@ -5345,6 +5353,40 @@ var useNotificationList = function useNotificationList() {
5345
5353
  }));
5346
5354
  }
5347
5355
  }, [notificationList, unReadNotification]);
5356
+ var updateAll = React.useCallback(function () {
5357
+ try {
5358
+ try {
5359
+ if (notificationList.length === 0) throw new Error("There are no unread messages");
5360
+ dispatch(setModal({
5361
+ isOpen: true,
5362
+ type: "warning",
5363
+ message: "Do you want to mark all notification ?",
5364
+ onConfirm: function () {
5365
+ try {
5366
+ setToggleUpdateAllStatus(true);
5367
+ return Promise.resolve(updateAllStatus()).then(function () {
5368
+ getData();
5369
+ setToggleUpdateAllStatus(false);
5370
+ });
5371
+ } catch (e) {
5372
+ return Promise.reject(e);
5373
+ }
5374
+ }
5375
+ }));
5376
+ } catch (err) {
5377
+ var _err$response3, _err$response3$data;
5378
+
5379
+ dispatch(setAlert({
5380
+ type: "danger",
5381
+ 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
5382
+ }));
5383
+ }
5384
+
5385
+ return Promise.resolve();
5386
+ } catch (e) {
5387
+ return Promise.reject(e);
5388
+ }
5389
+ }, [notificationList]);
5348
5390
  return {
5349
5391
  notificationList: notificationList,
5350
5392
  totalItems: totalItems,
@@ -5352,7 +5394,9 @@ var useNotificationList = function useNotificationList() {
5352
5394
  filters: filters,
5353
5395
  changeFilters: changeFilters,
5354
5396
  updateNotification: updateNotification,
5355
- viewNotification: viewNotification
5397
+ viewNotification: viewNotification,
5398
+ updateAll: updateAll,
5399
+ toggleUpdateAllStatus: toggleUpdateAllStatus
5356
5400
  };
5357
5401
  };
5358
5402
 
@@ -5366,7 +5410,9 @@ var NotificationList = function NotificationList() {
5366
5410
  filters = _useNotificationList.filters,
5367
5411
  changeFilters = _useNotificationList.changeFilters,
5368
5412
  updateNotification = _useNotificationList.updateNotification,
5369
- viewNotification = _useNotificationList.viewNotification;
5413
+ viewNotification = _useNotificationList.viewNotification,
5414
+ updateAll = _useNotificationList.updateAll,
5415
+ toggleUpdateAllStatus = _useNotificationList.toggleUpdateAllStatus;
5370
5416
 
5371
5417
  return React__default.createElement("div", {
5372
5418
  className: "animated fadeIn",
@@ -5400,8 +5446,18 @@ var NotificationList = function NotificationList() {
5400
5446
  className: "my-2 d-flex justify-content-center"
5401
5447
  }, React__default.createElement(reactstrap.Col, {
5402
5448
  md: 12,
5403
- className: "d-flex justify-content-end"
5404
- }, "Total of notifications: ", totalItems)), React__default.createElement(reactstrap.Row, {
5449
+ className: "d-flex justify-content-end align-items-center"
5450
+ }, filters.isRead === false && React__default.createElement("div", {
5451
+ className: "d-flex align-items-center justify-content-end mx-2"
5452
+ }, "Mark all as read", React__default.createElement(reactstrap.CustomInput, {
5453
+ checked: toggleUpdateAllStatus,
5454
+ className: "mx-2",
5455
+ type: "checkbox",
5456
+ id: "status-checkbox",
5457
+ onChange: function onChange() {
5458
+ return updateAll();
5459
+ }
5460
+ })), "Total of notifications: ", totalItems)), React__default.createElement(reactstrap.Row, {
5405
5461
  className: "mb-2"
5406
5462
  }, React__default.createElement(reactstrap.Col, {
5407
5463
  md: 12
@@ -6652,7 +6708,8 @@ var initialState = {
6652
6708
  currentStudentUserId: localStorage.getItem("currentStudentUserId") || "",
6653
6709
  currentStudentName: localStorage.getItem("currentStudentName") || "",
6654
6710
  turnOffPassWhenChangeMode: false,
6655
- menuBar: true
6711
+ menuBar: true,
6712
+ defaultFontSize: 16
6656
6713
  };
6657
6714
  var commonReducer = toolkit.createReducer(initialState, function (builder) {
6658
6715
  builder.addCase(setLoading, function (state, action) {
@@ -6680,6 +6737,8 @@ var commonReducer = toolkit.createReducer(initialState, function (builder) {
6680
6737
  state.turnOffPassWhenChangeMode = action.payload;
6681
6738
  }).addCase(showMenuBar, function (state, action) {
6682
6739
  state.menuBar = action.payload;
6740
+ }).addCase(showFontSize, function (state, action) {
6741
+ state.defaultFontSize = action.payload;
6683
6742
  });
6684
6743
  });
6685
6744
 
@@ -7718,6 +7777,7 @@ exports.setTurnOffPassWhenChangeMode = setTurnOffPassWhenChangeMode;
7718
7777
  exports.setTutorialScreenList = setTutorialScreenList;
7719
7778
  exports.setUser = setUser;
7720
7779
  exports.setUserList = setUserList;
7780
+ exports.showFontSize = showFontSize;
7721
7781
  exports.showMenuBar = showMenuBar;
7722
7782
  exports.store = store;
7723
7783
  exports.systemCertificateUpload = systemCertificateUpload;