mario-core 2.8.3 → 2.9.1
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/Login/views/block/blockForgetPass.d.ts +7 -0
- package/dist/containers/Notifications/components/NotificationList.d.ts +7 -0
- package/dist/containers/Notifications/hooks/useNotificationList.d.ts +2 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +88 -27
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +88 -28
- 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
|
@@ -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 = "/
|
|
326
|
-
var HOMEPAGE_STUDENT = "/
|
|
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";
|
|
@@ -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"
|
|
@@ -4606,25 +4614,7 @@ var UserDetail = function UserDetail() {
|
|
|
4606
4614
|
className: "animated fadeIn detail-buttons-padding"
|
|
4607
4615
|
}, React__default.createElement(QuitPrompt, {
|
|
4608
4616
|
when: edited
|
|
4609
|
-
}),
|
|
4610
|
-
className: "pt-2"
|
|
4611
|
-
}, React__default.createElement(reactstrap.Col, {
|
|
4612
|
-
md: 6
|
|
4613
|
-
}, " "), React__default.createElement(reactstrap.Col, {
|
|
4614
|
-
md: 5,
|
|
4615
|
-
className: "text-right"
|
|
4616
|
-
}, React__default.createElement(reactstrap.Button, {
|
|
4617
|
-
color: "primary",
|
|
4618
|
-
onClick: function onClick() {
|
|
4619
|
-
onResetPw(values.email || "");
|
|
4620
|
-
}
|
|
4621
|
-
}, "Send forgot password link"), " ", React__default.createElement(reactstrap.Button, {
|
|
4622
|
-
color: "success",
|
|
4623
|
-
onClick: function onClick() {
|
|
4624
|
-
getFile();
|
|
4625
|
-
},
|
|
4626
|
-
className: "ml-4"
|
|
4627
|
-
}, "Download user data"), " ")), React__default.createElement("h5", {
|
|
4617
|
+
}), React__default.createElement("h5", {
|
|
4628
4618
|
className: "mb-2"
|
|
4629
4619
|
}, header), React__default.createElement(reactstrap.Row, {
|
|
4630
4620
|
className: "pt-2"
|
|
@@ -4752,7 +4742,22 @@ var UserDetail = function UserDetail() {
|
|
|
4752
4742
|
onChange: function onChange() {
|
|
4753
4743
|
return setFieldValue("isActive", false);
|
|
4754
4744
|
}
|
|
4755
|
-
}))))))
|
|
4745
|
+
})))))), !!id && React__default.createElement(reactstrap.Row, null, React__default.createElement(reactstrap.Col, {
|
|
4746
|
+
md: 6
|
|
4747
|
+
}), React__default.createElement(reactstrap.Col, {
|
|
4748
|
+
md: 6
|
|
4749
|
+
}, React__default.createElement(reactstrap.Button, {
|
|
4750
|
+
color: "primary",
|
|
4751
|
+
onClick: function onClick() {
|
|
4752
|
+
onResetPw(values.email || "");
|
|
4753
|
+
}
|
|
4754
|
+
}, "Send forgot password link"), React__default.createElement(reactstrap.Button, {
|
|
4755
|
+
color: "success",
|
|
4756
|
+
onClick: function onClick() {
|
|
4757
|
+
getFile();
|
|
4758
|
+
},
|
|
4759
|
+
className: "ml-4"
|
|
4760
|
+
}, "Download user data")))), React__default.createElement(reactstrap.Col, {
|
|
4756
4761
|
md: 4
|
|
4757
4762
|
}, React__default.createElement(reactstrap.Row, null, React__default.createElement(reactstrap.Col, {
|
|
4758
4763
|
md: 8
|
|
@@ -5248,6 +5253,10 @@ var useNotificationList = function useNotificationList() {
|
|
|
5248
5253
|
filters = _useState[0],
|
|
5249
5254
|
setFilters = _useState[1];
|
|
5250
5255
|
|
|
5256
|
+
var _useState2 = React.useState(false),
|
|
5257
|
+
toggleUpdateAllStatus = _useState2[0],
|
|
5258
|
+
setToggleUpdateAllStatus = _useState2[1];
|
|
5259
|
+
|
|
5251
5260
|
var changeFilters = function changeFilters(objectValue) {
|
|
5252
5261
|
return setFilters(_extends({}, filters, objectValue));
|
|
5253
5262
|
};
|
|
@@ -5348,6 +5357,40 @@ var useNotificationList = function useNotificationList() {
|
|
|
5348
5357
|
}));
|
|
5349
5358
|
}
|
|
5350
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]);
|
|
5351
5394
|
return {
|
|
5352
5395
|
notificationList: notificationList,
|
|
5353
5396
|
totalItems: totalItems,
|
|
@@ -5355,7 +5398,9 @@ var useNotificationList = function useNotificationList() {
|
|
|
5355
5398
|
filters: filters,
|
|
5356
5399
|
changeFilters: changeFilters,
|
|
5357
5400
|
updateNotification: updateNotification,
|
|
5358
|
-
viewNotification: viewNotification
|
|
5401
|
+
viewNotification: viewNotification,
|
|
5402
|
+
updateAll: updateAll,
|
|
5403
|
+
toggleUpdateAllStatus: toggleUpdateAllStatus
|
|
5359
5404
|
};
|
|
5360
5405
|
};
|
|
5361
5406
|
|
|
@@ -5369,7 +5414,9 @@ var NotificationList = function NotificationList() {
|
|
|
5369
5414
|
filters = _useNotificationList.filters,
|
|
5370
5415
|
changeFilters = _useNotificationList.changeFilters,
|
|
5371
5416
|
updateNotification = _useNotificationList.updateNotification,
|
|
5372
|
-
viewNotification = _useNotificationList.viewNotification
|
|
5417
|
+
viewNotification = _useNotificationList.viewNotification,
|
|
5418
|
+
updateAll = _useNotificationList.updateAll,
|
|
5419
|
+
toggleUpdateAllStatus = _useNotificationList.toggleUpdateAllStatus;
|
|
5373
5420
|
|
|
5374
5421
|
return React__default.createElement("div", {
|
|
5375
5422
|
className: "animated fadeIn",
|
|
@@ -5403,8 +5450,18 @@ var NotificationList = function NotificationList() {
|
|
|
5403
5450
|
className: "my-2 d-flex justify-content-center"
|
|
5404
5451
|
}, React__default.createElement(reactstrap.Col, {
|
|
5405
5452
|
md: 12,
|
|
5406
|
-
className: "d-flex justify-content-end"
|
|
5407
|
-
},
|
|
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, {
|
|
5408
5465
|
className: "mb-2"
|
|
5409
5466
|
}, React__default.createElement(reactstrap.Col, {
|
|
5410
5467
|
md: 12
|
|
@@ -6655,7 +6712,8 @@ var initialState = {
|
|
|
6655
6712
|
currentStudentUserId: localStorage.getItem("currentStudentUserId") || "",
|
|
6656
6713
|
currentStudentName: localStorage.getItem("currentStudentName") || "",
|
|
6657
6714
|
turnOffPassWhenChangeMode: false,
|
|
6658
|
-
menuBar: true
|
|
6715
|
+
menuBar: true,
|
|
6716
|
+
defaultFontSize: 16
|
|
6659
6717
|
};
|
|
6660
6718
|
var commonReducer = toolkit.createReducer(initialState, function (builder) {
|
|
6661
6719
|
builder.addCase(setLoading, function (state, action) {
|
|
@@ -6683,6 +6741,8 @@ var commonReducer = toolkit.createReducer(initialState, function (builder) {
|
|
|
6683
6741
|
state.turnOffPassWhenChangeMode = action.payload;
|
|
6684
6742
|
}).addCase(showMenuBar, function (state, action) {
|
|
6685
6743
|
state.menuBar = action.payload;
|
|
6744
|
+
}).addCase(showFontSize, function (state, action) {
|
|
6745
|
+
state.defaultFontSize = action.payload;
|
|
6686
6746
|
});
|
|
6687
6747
|
});
|
|
6688
6748
|
|
|
@@ -7721,6 +7781,7 @@ exports.setTurnOffPassWhenChangeMode = setTurnOffPassWhenChangeMode;
|
|
|
7721
7781
|
exports.setTutorialScreenList = setTutorialScreenList;
|
|
7722
7782
|
exports.setUser = setUser;
|
|
7723
7783
|
exports.setUserList = setUserList;
|
|
7784
|
+
exports.showFontSize = showFontSize;
|
|
7724
7785
|
exports.showMenuBar = showMenuBar;
|
|
7725
7786
|
exports.store = store;
|
|
7726
7787
|
exports.systemCertificateUpload = systemCertificateUpload;
|