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.
- package/dist/containers/Notifications/hooks/useNotificationList.d.ts +2 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +65 -5
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +65 -6
- package/dist/index.modern.js.map +1 -1
- package/dist/redux/commons/action.d.ts +1 -0
- package/dist/services/notificationService.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -227,6 +227,7 @@ var setSidebar = createAction("common/setSidebar");
|
|
|
227
227
|
var setAlert = createAction("common/setAlert");
|
|
228
228
|
var reset = createAction("common/reset");
|
|
229
229
|
var showMenuBar = createAction("common/showMenuBar");
|
|
230
|
+
var showFontSize = createAction("common/showFontSize");
|
|
230
231
|
var setCurrentStudentId = createAction("common/setCurrentStudentId");
|
|
231
232
|
var setCurrentStudentUserId = createAction("common/setCurrentStudentUserId");
|
|
232
233
|
var setCurrentStudentName = createAction("common/setCurrentStudentName");
|
|
@@ -1187,6 +1188,9 @@ var getUnReadNotifications = function getUnReadNotifications() {
|
|
|
1187
1188
|
var updateStatusNotification = function updateStatusNotification(id) {
|
|
1188
1189
|
return api.put(NOTIFICATION_URL + "/" + id);
|
|
1189
1190
|
};
|
|
1191
|
+
var updateAllStatus = function updateAllStatus() {
|
|
1192
|
+
return api.put(NOTIFICATION_URL + "/updateAllStatus");
|
|
1193
|
+
};
|
|
1190
1194
|
|
|
1191
1195
|
var useUnReadNotification = function useUnReadNotification() {
|
|
1192
1196
|
var dispatch = useDispatch();
|
|
@@ -5242,6 +5246,10 @@ var useNotificationList = function useNotificationList() {
|
|
|
5242
5246
|
filters = _useState[0],
|
|
5243
5247
|
setFilters = _useState[1];
|
|
5244
5248
|
|
|
5249
|
+
var _useState2 = useState(false),
|
|
5250
|
+
toggleUpdateAllStatus = _useState2[0],
|
|
5251
|
+
setToggleUpdateAllStatus = _useState2[1];
|
|
5252
|
+
|
|
5245
5253
|
var changeFilters = function changeFilters(objectValue) {
|
|
5246
5254
|
return setFilters(_extends({}, filters, objectValue));
|
|
5247
5255
|
};
|
|
@@ -5342,6 +5350,40 @@ var useNotificationList = function useNotificationList() {
|
|
|
5342
5350
|
}));
|
|
5343
5351
|
}
|
|
5344
5352
|
}, [notificationList, unReadNotification]);
|
|
5353
|
+
var updateAll = useCallback(function () {
|
|
5354
|
+
try {
|
|
5355
|
+
try {
|
|
5356
|
+
if (notificationList.length === 0) throw new Error("There are no unread messages");
|
|
5357
|
+
dispatch(setModal({
|
|
5358
|
+
isOpen: true,
|
|
5359
|
+
type: "warning",
|
|
5360
|
+
message: "Do you want to mark all notification ?",
|
|
5361
|
+
onConfirm: function () {
|
|
5362
|
+
try {
|
|
5363
|
+
setToggleUpdateAllStatus(true);
|
|
5364
|
+
return Promise.resolve(updateAllStatus()).then(function () {
|
|
5365
|
+
getData();
|
|
5366
|
+
setToggleUpdateAllStatus(false);
|
|
5367
|
+
});
|
|
5368
|
+
} catch (e) {
|
|
5369
|
+
return Promise.reject(e);
|
|
5370
|
+
}
|
|
5371
|
+
}
|
|
5372
|
+
}));
|
|
5373
|
+
} catch (err) {
|
|
5374
|
+
var _err$response3, _err$response3$data;
|
|
5375
|
+
|
|
5376
|
+
dispatch(setAlert({
|
|
5377
|
+
type: "danger",
|
|
5378
|
+
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
|
|
5379
|
+
}));
|
|
5380
|
+
}
|
|
5381
|
+
|
|
5382
|
+
return Promise.resolve();
|
|
5383
|
+
} catch (e) {
|
|
5384
|
+
return Promise.reject(e);
|
|
5385
|
+
}
|
|
5386
|
+
}, [notificationList]);
|
|
5345
5387
|
return {
|
|
5346
5388
|
notificationList: notificationList,
|
|
5347
5389
|
totalItems: totalItems,
|
|
@@ -5349,7 +5391,9 @@ var useNotificationList = function useNotificationList() {
|
|
|
5349
5391
|
filters: filters,
|
|
5350
5392
|
changeFilters: changeFilters,
|
|
5351
5393
|
updateNotification: updateNotification,
|
|
5352
|
-
viewNotification: viewNotification
|
|
5394
|
+
viewNotification: viewNotification,
|
|
5395
|
+
updateAll: updateAll,
|
|
5396
|
+
toggleUpdateAllStatus: toggleUpdateAllStatus
|
|
5353
5397
|
};
|
|
5354
5398
|
};
|
|
5355
5399
|
|
|
@@ -5363,7 +5407,9 @@ var NotificationList = function NotificationList() {
|
|
|
5363
5407
|
filters = _useNotificationList.filters,
|
|
5364
5408
|
changeFilters = _useNotificationList.changeFilters,
|
|
5365
5409
|
updateNotification = _useNotificationList.updateNotification,
|
|
5366
|
-
viewNotification = _useNotificationList.viewNotification
|
|
5410
|
+
viewNotification = _useNotificationList.viewNotification,
|
|
5411
|
+
updateAll = _useNotificationList.updateAll,
|
|
5412
|
+
toggleUpdateAllStatus = _useNotificationList.toggleUpdateAllStatus;
|
|
5367
5413
|
|
|
5368
5414
|
return React.createElement("div", {
|
|
5369
5415
|
className: "animated fadeIn",
|
|
@@ -5397,8 +5443,18 @@ var NotificationList = function NotificationList() {
|
|
|
5397
5443
|
className: "my-2 d-flex justify-content-center"
|
|
5398
5444
|
}, React.createElement(Col, {
|
|
5399
5445
|
md: 12,
|
|
5400
|
-
className: "d-flex justify-content-end"
|
|
5401
|
-
},
|
|
5446
|
+
className: "d-flex justify-content-end align-items-center"
|
|
5447
|
+
}, filters.isRead === false && React.createElement("div", {
|
|
5448
|
+
className: "d-flex align-items-center justify-content-end mx-2"
|
|
5449
|
+
}, "Mark all as read", React.createElement(CustomInput, {
|
|
5450
|
+
checked: toggleUpdateAllStatus,
|
|
5451
|
+
className: "mx-2",
|
|
5452
|
+
type: "checkbox",
|
|
5453
|
+
id: "status-checkbox",
|
|
5454
|
+
onChange: function onChange() {
|
|
5455
|
+
return updateAll();
|
|
5456
|
+
}
|
|
5457
|
+
})), "Total of notifications: ", totalItems)), React.createElement(Row, {
|
|
5402
5458
|
className: "mb-2"
|
|
5403
5459
|
}, React.createElement(Col, {
|
|
5404
5460
|
md: 12
|
|
@@ -6649,7 +6705,8 @@ var initialState = {
|
|
|
6649
6705
|
currentStudentUserId: localStorage.getItem("currentStudentUserId") || "",
|
|
6650
6706
|
currentStudentName: localStorage.getItem("currentStudentName") || "",
|
|
6651
6707
|
turnOffPassWhenChangeMode: false,
|
|
6652
|
-
menuBar: true
|
|
6708
|
+
menuBar: true,
|
|
6709
|
+
defaultFontSize: 16
|
|
6653
6710
|
};
|
|
6654
6711
|
var commonReducer = createReducer(initialState, function (builder) {
|
|
6655
6712
|
builder.addCase(setLoading, function (state, action) {
|
|
@@ -6677,6 +6734,8 @@ var commonReducer = createReducer(initialState, function (builder) {
|
|
|
6677
6734
|
state.turnOffPassWhenChangeMode = action.payload;
|
|
6678
6735
|
}).addCase(showMenuBar, function (state, action) {
|
|
6679
6736
|
state.menuBar = action.payload;
|
|
6737
|
+
}).addCase(showFontSize, function (state, action) {
|
|
6738
|
+
state.defaultFontSize = action.payload;
|
|
6680
6739
|
});
|
|
6681
6740
|
});
|
|
6682
6741
|
|
|
@@ -7587,5 +7646,5 @@ var generateRandomString = (function () {
|
|
|
7587
7646
|
return (Math.random() + 1).toString(36).substring(7);
|
|
7588
7647
|
});
|
|
7589
7648
|
|
|
7590
|
-
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, SearchBox$1 as SearchBox, SearchBoxContainer, SkillList, StarRatingSelector, SuggestionCategorySelector, TAB_COLORS, TINY_MCE_API_KEY, TheContent$1 as TheContent, TheLayout, ToggleButton, UploadFileButton, UserDetail, UserList, addTab, answerQuestion, answerQuestionDataPlayer, api, apiUpload, canAccess as canAccessRoute, changeNote, changeTags, clearTab, closeTab, debounce, editTab, editorConfig, firstCheckToken, generateRandomString, getFileUrl, getInfo, getTextFromHTML, isInViewport, reset, setAlert, setAssessmentList, setAssignmentList, setAssistantList, setBadgeList, setBandScoreList, setCertificateList, setClassList, setConferenceRubricList, setCurrentStudentId, setCurrentStudentName, setCurrentStudentUserId, setCustomAlertList, setDataPlayer, setEditItemQuesion, 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, showMenuBar, store, systemCertificateUpload, systemStudentBadge, uploadFile, useFilters, useGalleryList, utcToLocalTime };
|
|
7649
|
+
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, SearchBox$1 as SearchBox, SearchBoxContainer, SkillList, StarRatingSelector, SuggestionCategorySelector, TAB_COLORS, TINY_MCE_API_KEY, TheContent$1 as TheContent, TheLayout, ToggleButton, UploadFileButton, UserDetail, UserList, addTab, answerQuestion, answerQuestionDataPlayer, api, apiUpload, canAccess as canAccessRoute, changeNote, changeTags, clearTab, closeTab, debounce, editTab, editorConfig, firstCheckToken, generateRandomString, getFileUrl, getInfo, getTextFromHTML, isInViewport, reset, setAlert, setAssessmentList, setAssignmentList, setAssistantList, setBadgeList, setBandScoreList, setCertificateList, setClassList, setConferenceRubricList, setCurrentStudentId, setCurrentStudentName, setCurrentStudentUserId, setCustomAlertList, setDataPlayer, setEditItemQuesion, 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 };
|
|
7591
7650
|
//# sourceMappingURL=index.modern.js.map
|