mario-core 2.8.0 → 2.8.3
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/User/hooks/useUserDetail.d.ts +1 -0
- package/dist/index.js +139 -261
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +139 -261
- package/dist/index.modern.js.map +1 -1
- package/dist/services/userService.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -312,9 +312,6 @@ var checkResetToken = function checkResetToken(token) {
|
|
|
312
312
|
var resetPassword = function resetPassword(data) {
|
|
313
313
|
return api.post(ACCOUNT_URL + "/resetpassword", data);
|
|
314
314
|
};
|
|
315
|
-
var logInTwoFactor = function logInTwoFactor(data) {
|
|
316
|
-
return api.post(ACCOUNT_URL + "/logintwostep", data);
|
|
317
|
-
};
|
|
318
315
|
|
|
319
316
|
var defaultInfo = {
|
|
320
317
|
email: "",
|
|
@@ -353,10 +350,7 @@ var useLogin = function useLogin() {
|
|
|
353
350
|
var isDistrict = window.location.host.includes("-district");
|
|
354
351
|
var userLogin = useCallback(function (data) {
|
|
355
352
|
try {
|
|
356
|
-
var
|
|
357
|
-
|
|
358
|
-
var _temp3 = function _temp3(_result) {
|
|
359
|
-
if (_exit2) return _result;
|
|
353
|
+
var _temp3 = function _temp3() {
|
|
360
354
|
dispatch(setLoading(false));
|
|
361
355
|
};
|
|
362
356
|
|
|
@@ -364,23 +358,14 @@ var useLogin = function useLogin() {
|
|
|
364
358
|
|
|
365
359
|
var _temp4 = _catch(function () {
|
|
366
360
|
return Promise.resolve(logIn(data)).then(function (res) {
|
|
367
|
-
var _res$data
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
var _res$data2 = res.data,
|
|
377
|
-
token = _res$data2.token,
|
|
378
|
-
id = _res$data2.id,
|
|
379
|
-
firstName = _res$data2.firstName,
|
|
380
|
-
lastName = _res$data2.lastName,
|
|
381
|
-
roles = _res$data2.roles,
|
|
382
|
-
email = _res$data2.email,
|
|
383
|
-
profileImageFileName = _res$data2.profileImageFileName;
|
|
361
|
+
var _res$data = res.data,
|
|
362
|
+
token = _res$data.token,
|
|
363
|
+
id = _res$data.id,
|
|
364
|
+
firstName = _res$data.firstName,
|
|
365
|
+
lastName = _res$data.lastName,
|
|
366
|
+
roles = _res$data.roles,
|
|
367
|
+
email = _res$data.email,
|
|
368
|
+
profileImageFileName = _res$data.profileImageFileName;
|
|
384
369
|
localStorage.setItem(ACCESS_TOKEN, token);
|
|
385
370
|
dispatch(setUser({
|
|
386
371
|
id: id,
|
|
@@ -850,7 +835,8 @@ var BlockResetPassword = function BlockResetPassword() {
|
|
|
850
835
|
}, "Reset Password"), React.createElement("div", {
|
|
851
836
|
className: "w-100"
|
|
852
837
|
}, validLink ? React.createElement(React.Fragment, null, React.createElement(Label, {
|
|
853
|
-
"for": "emailForgot"
|
|
838
|
+
"for": "emailForgot",
|
|
839
|
+
className: "mb-3"
|
|
854
840
|
}, "New password"), React.createElement(PasswordInput, {
|
|
855
841
|
isShowPassword: isShowNewPassword,
|
|
856
842
|
togglePasswordVisible: function togglePasswordVisible() {
|
|
@@ -862,7 +848,8 @@ var BlockResetPassword = function BlockResetPassword() {
|
|
|
862
848
|
}), touched.password && errors.password && React.createElement(ErrorHandler, {
|
|
863
849
|
text: errors.password
|
|
864
850
|
}), React.createElement(Label, {
|
|
865
|
-
"for": "emailForgot"
|
|
851
|
+
"for": "emailForgot",
|
|
852
|
+
className: "mt-3 mb-3"
|
|
866
853
|
}, "Re-enter new password"), React.createElement(PasswordInput, {
|
|
867
854
|
isShowPassword: isShowReTypePassword,
|
|
868
855
|
togglePasswordVisible: function togglePasswordVisible() {
|
|
@@ -904,6 +891,47 @@ var BlockResetPassword = function BlockResetPassword() {
|
|
|
904
891
|
});
|
|
905
892
|
};
|
|
906
893
|
|
|
894
|
+
var LOGIN_TITLE = "Log in";
|
|
895
|
+
var FORGOT_PASSWORD_TITLE = "Forgot password";
|
|
896
|
+
var RESET_PASSWORD_TITLE = "Reset password";
|
|
897
|
+
|
|
898
|
+
var Login = function Login(props) {
|
|
899
|
+
var isLogin = props.isLogin,
|
|
900
|
+
isForgotPassword = props.isForgotPassword,
|
|
901
|
+
isResetPassword = props.isResetPassword;
|
|
902
|
+
|
|
903
|
+
var _useLogin = useLogin(),
|
|
904
|
+
defaultInfo = _useLogin.defaultInfo,
|
|
905
|
+
userLogin = _useLogin.userLogin;
|
|
906
|
+
|
|
907
|
+
useEffect(function () {
|
|
908
|
+
isLogin && (document.title = LOGIN_TITLE);
|
|
909
|
+
isForgotPassword && (document.title = FORGOT_PASSWORD_TITLE);
|
|
910
|
+
isResetPassword && (document.title = RESET_PASSWORD_TITLE);
|
|
911
|
+
}, [isLogin, isForgotPassword, isResetPassword]);
|
|
912
|
+
return React.createElement("div", {
|
|
913
|
+
className: styles["login"] + " container-fluid font-family-lato"
|
|
914
|
+
}, React.createElement(Row, {
|
|
915
|
+
className: "h-100"
|
|
916
|
+
}, React.createElement(Col, {
|
|
917
|
+
lg: 12,
|
|
918
|
+
md: 12,
|
|
919
|
+
xs: 12,
|
|
920
|
+
className: "d-flex justify-content-center h-100 align-items-center"
|
|
921
|
+
}, React.createElement(GoogleReCaptchaProvider, {
|
|
922
|
+
useRecaptchaNet: true,
|
|
923
|
+
reCaptchaKey: GOOGLE_RECAPTCHA_KEY,
|
|
924
|
+
scriptProps: {
|
|
925
|
+
async: true,
|
|
926
|
+
defer: true,
|
|
927
|
+
appendTo: "body"
|
|
928
|
+
}
|
|
929
|
+
}, isLogin && React.createElement(BlockLogin, {
|
|
930
|
+
userLogin: userLogin,
|
|
931
|
+
defaultInfo: defaultInfo
|
|
932
|
+
}), isForgotPassword && React.createElement(BlockForgetPassword, null)), isResetPassword && React.createElement(BlockResetPassword, null))));
|
|
933
|
+
};
|
|
934
|
+
|
|
907
935
|
function _extends() {
|
|
908
936
|
_extends = Object.assign || function (target) {
|
|
909
937
|
for (var i = 1; i < arguments.length; i++) {
|
|
@@ -983,210 +1011,6 @@ function _createForOfIteratorHelperLoose(o, allowArrayLike) {
|
|
|
983
1011
|
return it.next.bind(it);
|
|
984
1012
|
}
|
|
985
1013
|
|
|
986
|
-
var HOMEPAGE_TEACHER$1 = "/my-one-to-one/up-coming";
|
|
987
|
-
var HOMEPAGE_STUDENT$1 = "/my-one-to-one/up-coming";
|
|
988
|
-
var HOMEPAGE_ADMIN$1 = "/admin/dashboard";
|
|
989
|
-
var HOMEPAGE_PARENT$1 = "/parent";
|
|
990
|
-
var HOMEPAGE_DISTRICT$1 = "/admin/schools";
|
|
991
|
-
var TITLE$2 = "2FA";
|
|
992
|
-
|
|
993
|
-
var useLoginTwoFactor = function useLoginTwoFactor() {
|
|
994
|
-
var dispatch = useDispatch();
|
|
995
|
-
var history = useHistory();
|
|
996
|
-
var isDistrict = window.location.host.includes("-district");
|
|
997
|
-
var userLoginTwoFactor = useCallback(function (data) {
|
|
998
|
-
try {
|
|
999
|
-
var _temp3 = function _temp3() {
|
|
1000
|
-
dispatch(setLoading(false));
|
|
1001
|
-
};
|
|
1002
|
-
|
|
1003
|
-
dispatch(setLoading(true));
|
|
1004
|
-
|
|
1005
|
-
var _temp4 = _catch(function () {
|
|
1006
|
-
return Promise.resolve(logInTwoFactor(data)).then(function (res) {
|
|
1007
|
-
var _res$data = res.data,
|
|
1008
|
-
token = _res$data.token,
|
|
1009
|
-
id = _res$data.id,
|
|
1010
|
-
firstName = _res$data.firstName,
|
|
1011
|
-
lastName = _res$data.lastName,
|
|
1012
|
-
roles = _res$data.roles,
|
|
1013
|
-
email = _res$data.email,
|
|
1014
|
-
profileImageFileName = _res$data.profileImageFileName;
|
|
1015
|
-
localStorage.setItem(ACCESS_TOKEN, token);
|
|
1016
|
-
dispatch(setUser({
|
|
1017
|
-
id: id,
|
|
1018
|
-
firstName: firstName,
|
|
1019
|
-
lastName: lastName,
|
|
1020
|
-
roles: roles,
|
|
1021
|
-
email: email,
|
|
1022
|
-
profileImageFileName: profileImageFileName
|
|
1023
|
-
}));
|
|
1024
|
-
|
|
1025
|
-
if (isDistrict) {
|
|
1026
|
-
history.push(HOMEPAGE_DISTRICT$1);
|
|
1027
|
-
} else if (roles.includes("Admin")) {
|
|
1028
|
-
history.push(HOMEPAGE_ADMIN$1);
|
|
1029
|
-
} else if (roles.includes("Teacher")) {
|
|
1030
|
-
history.push(HOMEPAGE_TEACHER$1);
|
|
1031
|
-
} else if (roles.includes("Student")) {
|
|
1032
|
-
history.push(HOMEPAGE_STUDENT$1);
|
|
1033
|
-
} else if (roles.includes("Parent")) {
|
|
1034
|
-
history.push(HOMEPAGE_PARENT$1);
|
|
1035
|
-
}
|
|
1036
|
-
});
|
|
1037
|
-
}, function (err) {
|
|
1038
|
-
var _err$response, _err$response$data;
|
|
1039
|
-
|
|
1040
|
-
dispatch(setAlert({
|
|
1041
|
-
type: "danger",
|
|
1042
|
-
message: ((_err$response = err.response) === null || _err$response === void 0 ? void 0 : (_err$response$data = _err$response.data) === null || _err$response$data === void 0 ? void 0 : _err$response$data.title) || err.message || "Login failed"
|
|
1043
|
-
}));
|
|
1044
|
-
});
|
|
1045
|
-
|
|
1046
|
-
return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(_temp3) : _temp3(_temp4));
|
|
1047
|
-
} catch (e) {
|
|
1048
|
-
return Promise.reject(e);
|
|
1049
|
-
}
|
|
1050
|
-
}, []);
|
|
1051
|
-
useEffect(function () {
|
|
1052
|
-
document.title = TITLE$2;
|
|
1053
|
-
}, []);
|
|
1054
|
-
return {
|
|
1055
|
-
userLoginTwoFactor: userLoginTwoFactor
|
|
1056
|
-
};
|
|
1057
|
-
};
|
|
1058
|
-
|
|
1059
|
-
var initialValues$2 = {
|
|
1060
|
-
twoFactorCode: "",
|
|
1061
|
-
id: "",
|
|
1062
|
-
rememberMe: false
|
|
1063
|
-
};
|
|
1064
|
-
var schema$1 = object({
|
|
1065
|
-
id: string().required("Bad credential"),
|
|
1066
|
-
twoFactorCode: string().required("Additional Verification is required"),
|
|
1067
|
-
rememberMe: boolean()
|
|
1068
|
-
});
|
|
1069
|
-
|
|
1070
|
-
var BlockTwoFactorLogin = function BlockTwoFactorLogin() {
|
|
1071
|
-
var query = new URLSearchParams(useLocation().search);
|
|
1072
|
-
var id = query.get("id");
|
|
1073
|
-
|
|
1074
|
-
var _useLoginTwoFactor = useLoginTwoFactor(),
|
|
1075
|
-
userLoginTwoFactor = _useLoginTwoFactor.userLoginTwoFactor;
|
|
1076
|
-
|
|
1077
|
-
return React.createElement(Formik, {
|
|
1078
|
-
initialValues: _extends({}, initialValues$2, {
|
|
1079
|
-
id: id
|
|
1080
|
-
}),
|
|
1081
|
-
enableReinitialize: true,
|
|
1082
|
-
validationSchema: schema$1,
|
|
1083
|
-
onSubmit: function onSubmit(values) {
|
|
1084
|
-
userLoginTwoFactor(values);
|
|
1085
|
-
}
|
|
1086
|
-
}, function (formikProps) {
|
|
1087
|
-
var values = formikProps.values,
|
|
1088
|
-
setFieldValue = formikProps.setFieldValue,
|
|
1089
|
-
handleChange = formikProps.handleChange,
|
|
1090
|
-
handleSubmit = formikProps.handleSubmit,
|
|
1091
|
-
touched = formikProps.touched,
|
|
1092
|
-
errors = formikProps.errors;
|
|
1093
|
-
return React.createElement(Row, {
|
|
1094
|
-
className: "" + styles["box-login"]
|
|
1095
|
-
}, React.createElement(Col, {
|
|
1096
|
-
className: "p-0"
|
|
1097
|
-
}, React.createElement("div", {
|
|
1098
|
-
className: "" + styles["block-login"]
|
|
1099
|
-
}, React.createElement("div", {
|
|
1100
|
-
className: "" + styles["block-form"]
|
|
1101
|
-
}, React.createElement("p", {
|
|
1102
|
-
className: "" + styles["title-login"]
|
|
1103
|
-
}, "Additional Verification"), React.createElement("p", {
|
|
1104
|
-
className: "recover-account"
|
|
1105
|
-
}, "Check your email to get Additional Verification. This code will be expired in 5 minutes"), React.createElement("div", null, React.createElement(FormGroup, null, React.createElement(Label, null, "Additional Verification"), React.createElement(Input, {
|
|
1106
|
-
name: "twoFactorCode",
|
|
1107
|
-
value: values.twoFactorCode,
|
|
1108
|
-
onChange: handleChange
|
|
1109
|
-
}), touched.twoFactorCode && errors.twoFactorCode && React.createElement(ErrorHandler, {
|
|
1110
|
-
text: errors.twoFactorCode
|
|
1111
|
-
})), React.createElement(FormGroup, null, React.createElement(Input, {
|
|
1112
|
-
type: "checkbox",
|
|
1113
|
-
className: "" + styles["checkbox-remember"],
|
|
1114
|
-
id: "remember",
|
|
1115
|
-
onChange: function onChange(e) {
|
|
1116
|
-
return setFieldValue("rememberMe", e.target.checked);
|
|
1117
|
-
}
|
|
1118
|
-
}), React.createElement(Label, {
|
|
1119
|
-
"for": "rememberMe",
|
|
1120
|
-
className: "" + styles["remember"]
|
|
1121
|
-
}, "Remember my browser & IP"))), React.createElement(Col, {
|
|
1122
|
-
className: "p-0 mt-5"
|
|
1123
|
-
}, React.createElement("button", {
|
|
1124
|
-
className: styles["btn-login"] + " ",
|
|
1125
|
-
onClick: function onClick() {
|
|
1126
|
-
return handleSubmit();
|
|
1127
|
-
}
|
|
1128
|
-
}, "Confirm")), React.createElement("p", {
|
|
1129
|
-
className: "d-flex justify-content-between"
|
|
1130
|
-
}, React.createElement(Link, {
|
|
1131
|
-
to: "/login",
|
|
1132
|
-
className: "" + styles["link-to-login"]
|
|
1133
|
-
}, "Return to login"), React.createElement("a", {
|
|
1134
|
-
href: "https://marioframework.com/privacy-policy/",
|
|
1135
|
-
target: "blank",
|
|
1136
|
-
className: "" + styles["link-to-login"]
|
|
1137
|
-
}, "Privacy Policy"))))), React.createElement(Col, {
|
|
1138
|
-
lg: 4,
|
|
1139
|
-
md: 4,
|
|
1140
|
-
className: "" + styles["img-box"]
|
|
1141
|
-
}, React.createElement("img", {
|
|
1142
|
-
src: "/images/img-login.jpg",
|
|
1143
|
-
className: "" + styles["img-login"]
|
|
1144
|
-
})));
|
|
1145
|
-
});
|
|
1146
|
-
};
|
|
1147
|
-
|
|
1148
|
-
var LOGIN_TITLE = "Log in";
|
|
1149
|
-
var FORGOT_PASSWORD_TITLE = "Forgot password";
|
|
1150
|
-
var RESET_PASSWORD_TITLE = "Reset password";
|
|
1151
|
-
|
|
1152
|
-
var Login = function Login(props) {
|
|
1153
|
-
var isLogin = props.isLogin,
|
|
1154
|
-
isForgotPassword = props.isForgotPassword,
|
|
1155
|
-
isResetPassword = props.isResetPassword,
|
|
1156
|
-
isLoginTwoFactor = props.isLoginTwoFactor;
|
|
1157
|
-
|
|
1158
|
-
var _useLogin = useLogin(),
|
|
1159
|
-
defaultInfo = _useLogin.defaultInfo,
|
|
1160
|
-
userLogin = _useLogin.userLogin;
|
|
1161
|
-
|
|
1162
|
-
useEffect(function () {
|
|
1163
|
-
isLogin && (document.title = LOGIN_TITLE);
|
|
1164
|
-
isForgotPassword && (document.title = FORGOT_PASSWORD_TITLE);
|
|
1165
|
-
isResetPassword && (document.title = RESET_PASSWORD_TITLE);
|
|
1166
|
-
}, [isLogin, isForgotPassword, isResetPassword]);
|
|
1167
|
-
return React.createElement("div", {
|
|
1168
|
-
className: styles["login"] + " container-fluid font-family-lato"
|
|
1169
|
-
}, React.createElement(Row, {
|
|
1170
|
-
className: "h-100"
|
|
1171
|
-
}, React.createElement(Col, {
|
|
1172
|
-
lg: 12,
|
|
1173
|
-
md: 12,
|
|
1174
|
-
xs: 12,
|
|
1175
|
-
className: "d-flex justify-content-center h-100 align-items-center"
|
|
1176
|
-
}, React.createElement(GoogleReCaptchaProvider, {
|
|
1177
|
-
useRecaptchaNet: true,
|
|
1178
|
-
reCaptchaKey: GOOGLE_RECAPTCHA_KEY,
|
|
1179
|
-
scriptProps: {
|
|
1180
|
-
async: true,
|
|
1181
|
-
defer: true,
|
|
1182
|
-
appendTo: "body"
|
|
1183
|
-
}
|
|
1184
|
-
}, isLogin && React.createElement(BlockLogin, {
|
|
1185
|
-
userLogin: userLogin,
|
|
1186
|
-
defaultInfo: defaultInfo
|
|
1187
|
-
}), isForgotPassword && React.createElement(BlockForgetPassword, null)), isResetPassword && React.createElement(BlockResetPassword, null), isLoginTwoFactor && React.createElement(BlockTwoFactorLogin, null))));
|
|
1188
|
-
};
|
|
1189
|
-
|
|
1190
1014
|
var QuoteContent = function QuoteContent(_ref) {
|
|
1191
1015
|
var descriptions = _ref.descriptions;
|
|
1192
1016
|
return React.createElement("div", {
|
|
@@ -1595,11 +1419,11 @@ var TheHeader = function TheHeader() {
|
|
|
1595
1419
|
}, "Privacy Policy"), !isDistrict && React.createElement(NotificationButton, null), React.createElement(TheHeaderDropdown, null)));
|
|
1596
1420
|
};
|
|
1597
1421
|
|
|
1598
|
-
var TITLE$
|
|
1422
|
+
var TITLE$2 = "Not found";
|
|
1599
1423
|
|
|
1600
1424
|
var NotFound = function NotFound() {
|
|
1601
1425
|
useEffect(function () {
|
|
1602
|
-
document.title = TITLE$
|
|
1426
|
+
document.title = TITLE$2;
|
|
1603
1427
|
});
|
|
1604
1428
|
return React.createElement("div", {
|
|
1605
1429
|
className: "not-found"
|
|
@@ -1963,7 +1787,7 @@ var useFilters = function useFilters() {
|
|
|
1963
1787
|
|
|
1964
1788
|
var EMAIL_TEMPLATE_URL$1 = "/admin/email-template";
|
|
1965
1789
|
var CREATE_TEMPLATE_URL = "/admin/create-email-template";
|
|
1966
|
-
var TITLE$
|
|
1790
|
+
var TITLE$3 = "Email template list";
|
|
1967
1791
|
|
|
1968
1792
|
var useEmailTemplateList = function useEmailTemplateList() {
|
|
1969
1793
|
var history = useHistory();
|
|
@@ -2064,7 +1888,7 @@ var useEmailTemplateList = function useEmailTemplateList() {
|
|
|
2064
1888
|
history.push(url);
|
|
2065
1889
|
}, []);
|
|
2066
1890
|
useEffect(function () {
|
|
2067
|
-
document.title = TITLE$
|
|
1891
|
+
document.title = TITLE$3;
|
|
2068
1892
|
}, []);
|
|
2069
1893
|
useEffect(function () {
|
|
2070
1894
|
getData();
|
|
@@ -2550,7 +2374,7 @@ var initValue = {
|
|
|
2550
2374
|
attachments: []
|
|
2551
2375
|
};
|
|
2552
2376
|
var EMAIL_TEMPLATE_LIST_URL = "/admin/email-template";
|
|
2553
|
-
var TITLE$
|
|
2377
|
+
var TITLE$4 = "Email template detail";
|
|
2554
2378
|
var MAX_FILES_SIZE = 4194304;
|
|
2555
2379
|
|
|
2556
2380
|
var useEmailTemplateDetail = function useEmailTemplateDetail(id) {
|
|
@@ -2585,7 +2409,7 @@ var useEmailTemplateDetail = function useEmailTemplateDetail(id) {
|
|
|
2585
2409
|
setFileUpload = _useState4[1];
|
|
2586
2410
|
|
|
2587
2411
|
useEffect(function () {
|
|
2588
|
-
document.title = TITLE$
|
|
2412
|
+
document.title = TITLE$4;
|
|
2589
2413
|
setEdited(false);
|
|
2590
2414
|
if (!!localStorage.getItem(window.location.href)) localStorage.removeItem(window.location.href);
|
|
2591
2415
|
}, []);
|
|
@@ -2816,7 +2640,7 @@ var useEmailTemplateDetail = function useEmailTemplateDetail(id) {
|
|
|
2816
2640
|
};
|
|
2817
2641
|
};
|
|
2818
2642
|
|
|
2819
|
-
var schema$
|
|
2643
|
+
var schema$1 = object({
|
|
2820
2644
|
subject: string().required("Template subject is required"),
|
|
2821
2645
|
categoryId: number().required("Template category is required").test("test category id", "Template category is required", function (value) {
|
|
2822
2646
|
return value >= 1;
|
|
@@ -2853,7 +2677,7 @@ var EmailTemplateDetail = function EmailTemplateDetail() {
|
|
|
2853
2677
|
return React.createElement(Formik, {
|
|
2854
2678
|
initialValues: emailTemplateDetail,
|
|
2855
2679
|
enableReinitialize: true,
|
|
2856
|
-
validationSchema: schema$
|
|
2680
|
+
validationSchema: schema$1,
|
|
2857
2681
|
onSubmit: function onSubmit(values) {
|
|
2858
2682
|
confirmData(values);
|
|
2859
2683
|
setEdited(false);
|
|
@@ -3070,7 +2894,7 @@ var CommonModal = function CommonModal(props, ref) {
|
|
|
3070
2894
|
|
|
3071
2895
|
var CommonModal$1 = forwardRef(CommonModal);
|
|
3072
2896
|
|
|
3073
|
-
var schema$
|
|
2897
|
+
var schema$2 = object({
|
|
3074
2898
|
question: string().required("Question is required"),
|
|
3075
2899
|
answer: string().required("Answer is required")
|
|
3076
2900
|
});
|
|
@@ -3088,7 +2912,7 @@ var FaqDetailModal = function FaqDetailModal(props, ref) {
|
|
|
3088
2912
|
return React.createElement(Formik, {
|
|
3089
2913
|
initialValues: faqDetail,
|
|
3090
2914
|
enableReinitialize: true,
|
|
3091
|
-
validationSchema: schema$
|
|
2915
|
+
validationSchema: schema$2,
|
|
3092
2916
|
onSubmit: function onSubmit(values, actions) {
|
|
3093
2917
|
onConfirm(values);
|
|
3094
2918
|
actions.resetForm();
|
|
@@ -3170,7 +2994,7 @@ var remove$1 = function remove(id) {
|
|
|
3170
2994
|
return api["delete"](FAQ_URL + "/" + id);
|
|
3171
2995
|
};
|
|
3172
2996
|
|
|
3173
|
-
var TITLE$
|
|
2997
|
+
var TITLE$5 = "FAQ list";
|
|
3174
2998
|
|
|
3175
2999
|
var useFaqList = function useFaqList() {
|
|
3176
3000
|
var faqList = useSelector(function (state) {
|
|
@@ -3253,7 +3077,7 @@ var useFaqList = function useFaqList() {
|
|
|
3253
3077
|
dispatch(setLoading(false));
|
|
3254
3078
|
}, [filters]);
|
|
3255
3079
|
useEffect(function () {
|
|
3256
|
-
document.title = TITLE$
|
|
3080
|
+
document.title = TITLE$5;
|
|
3257
3081
|
}, []);
|
|
3258
3082
|
useEffect(function () {
|
|
3259
3083
|
getData();
|
|
@@ -3600,7 +3424,7 @@ var SkillSelector = function SkillSelector(props) {
|
|
|
3600
3424
|
}));
|
|
3601
3425
|
};
|
|
3602
3426
|
|
|
3603
|
-
var schema$
|
|
3427
|
+
var schema$3 = object({
|
|
3604
3428
|
name: string().required("Name is required"),
|
|
3605
3429
|
description: string()
|
|
3606
3430
|
});
|
|
@@ -3619,7 +3443,7 @@ var SkillDetailModal = function SkillDetailModal(props, ref) {
|
|
|
3619
3443
|
return React.createElement(Formik, {
|
|
3620
3444
|
initialValues: skillDetail,
|
|
3621
3445
|
enableReinitialize: true,
|
|
3622
|
-
validationSchema: schema$
|
|
3446
|
+
validationSchema: schema$3,
|
|
3623
3447
|
onSubmit: function onSubmit(values, actions) {
|
|
3624
3448
|
onConfirm(values);
|
|
3625
3449
|
actions.resetForm();
|
|
@@ -3693,7 +3517,7 @@ var SkillDetailModal$1 = forwardRef(SkillDetailModal);
|
|
|
3693
3517
|
|
|
3694
3518
|
var setSkillList = createAction("skills/setSkillList");
|
|
3695
3519
|
|
|
3696
|
-
var TITLE$
|
|
3520
|
+
var TITLE$6 = "Skill list";
|
|
3697
3521
|
|
|
3698
3522
|
var useSkillList = function useSkillList() {
|
|
3699
3523
|
var skillList = useSelector(function (state) {
|
|
@@ -3787,7 +3611,7 @@ var useSkillList = function useSkillList() {
|
|
|
3787
3611
|
dispatch(setLoading(false));
|
|
3788
3612
|
}, [filters]);
|
|
3789
3613
|
useEffect(function () {
|
|
3790
|
-
document.title = TITLE$
|
|
3614
|
+
document.title = TITLE$6;
|
|
3791
3615
|
}, []);
|
|
3792
3616
|
useEffect(function () {
|
|
3793
3617
|
getData();
|
|
@@ -4062,6 +3886,7 @@ var setStudentList = createAction("users/setStudentList");
|
|
|
4062
3886
|
|
|
4063
3887
|
var USER_URL = BASE_URL + "/api/user";
|
|
4064
3888
|
var CHANGE_PASSWORD = BASE_URL + "/api/Account/changePassword";
|
|
3889
|
+
var ACCOUNT_URL$1 = BASE_URL + "/api/account";
|
|
4065
3890
|
var get$5 = function get(filter) {
|
|
4066
3891
|
return api.get("" + USER_URL, {
|
|
4067
3892
|
params: filter
|
|
@@ -4082,10 +3907,13 @@ var remove$3 = function remove(id) {
|
|
|
4082
3907
|
var changePassword = function changePassword(formData) {
|
|
4083
3908
|
return api.post(CHANGE_PASSWORD, formData);
|
|
4084
3909
|
};
|
|
3910
|
+
var forgotChangePassword = function forgotChangePassword(data) {
|
|
3911
|
+
return api.post(ACCOUNT_URL$1 + "/forgotchangepassword", data);
|
|
3912
|
+
};
|
|
4085
3913
|
|
|
4086
3914
|
var USER_URL$1 = "/admin/user";
|
|
4087
3915
|
var CREATE_USER_URL = "/admin/create-user";
|
|
4088
|
-
var TITLE$
|
|
3916
|
+
var TITLE$7 = "User list";
|
|
4089
3917
|
|
|
4090
3918
|
var useUserList = function useUserList() {
|
|
4091
3919
|
var history = useHistory();
|
|
@@ -4142,7 +3970,7 @@ var useUserList = function useUserList() {
|
|
|
4142
3970
|
}
|
|
4143
3971
|
}, [dispatch, filters]);
|
|
4144
3972
|
useEffect(function () {
|
|
4145
|
-
document.title = TITLE$
|
|
3973
|
+
document.title = TITLE$7;
|
|
4146
3974
|
}, []);
|
|
4147
3975
|
useEffect(function () {
|
|
4148
3976
|
if (!!fullName) {
|
|
@@ -4467,7 +4295,7 @@ var initValue$3 = {
|
|
|
4467
4295
|
profileImageFileName: ""
|
|
4468
4296
|
};
|
|
4469
4297
|
var USER_LIST_URL = "/admin/user";
|
|
4470
|
-
var TITLE$
|
|
4298
|
+
var TITLE$8 = "User detail";
|
|
4471
4299
|
|
|
4472
4300
|
var useUserDetail = function useUserDetail(id) {
|
|
4473
4301
|
var dispatch = useDispatch();
|
|
@@ -4496,7 +4324,7 @@ var useUserDetail = function useUserDetail(id) {
|
|
|
4496
4324
|
};
|
|
4497
4325
|
|
|
4498
4326
|
useEffect(function () {
|
|
4499
|
-
document.title = TITLE$
|
|
4327
|
+
document.title = TITLE$8;
|
|
4500
4328
|
setEdited(false);
|
|
4501
4329
|
if (!!localStorage.getItem(window.location.href)) localStorage.removeItem(window.location.href);
|
|
4502
4330
|
}, []);
|
|
@@ -4623,6 +4451,35 @@ var useUserDetail = function useUserDetail(id) {
|
|
|
4623
4451
|
}
|
|
4624
4452
|
};
|
|
4625
4453
|
|
|
4454
|
+
var forgotPasswordRequest = useCallback(function (data) {
|
|
4455
|
+
try {
|
|
4456
|
+
var _temp17 = function _temp17() {
|
|
4457
|
+
dispatch(setLoading(false));
|
|
4458
|
+
};
|
|
4459
|
+
|
|
4460
|
+
dispatch(setLoading(true));
|
|
4461
|
+
|
|
4462
|
+
var _temp18 = _catch(function () {
|
|
4463
|
+
return Promise.resolve(forgotChangePassword(data)).then(function () {
|
|
4464
|
+
dispatch(setAlert({
|
|
4465
|
+
type: "success",
|
|
4466
|
+
message: "Send forgot password link successfully"
|
|
4467
|
+
}));
|
|
4468
|
+
});
|
|
4469
|
+
}, function (err) {
|
|
4470
|
+
var _err$response3, _err$response3$data;
|
|
4471
|
+
|
|
4472
|
+
dispatch(setAlert({
|
|
4473
|
+
type: "danger",
|
|
4474
|
+
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 || "Error occured"
|
|
4475
|
+
}));
|
|
4476
|
+
});
|
|
4477
|
+
|
|
4478
|
+
return Promise.resolve(_temp18 && _temp18.then ? _temp18.then(_temp17) : _temp17(_temp18));
|
|
4479
|
+
} catch (e) {
|
|
4480
|
+
return Promise.reject(e);
|
|
4481
|
+
}
|
|
4482
|
+
}, []);
|
|
4626
4483
|
return {
|
|
4627
4484
|
userDetail: userDetail,
|
|
4628
4485
|
backToList: backToList,
|
|
@@ -4632,7 +4489,8 @@ var useUserDetail = function useUserDetail(id) {
|
|
|
4632
4489
|
edited: edited,
|
|
4633
4490
|
setEdited: setEdited,
|
|
4634
4491
|
setEditedTrue: setEditedTrue,
|
|
4635
|
-
confirmChangePassword: confirmChangePassword
|
|
4492
|
+
confirmChangePassword: confirmChangePassword,
|
|
4493
|
+
forgotPasswordRequest: forgotPasswordRequest
|
|
4636
4494
|
};
|
|
4637
4495
|
};
|
|
4638
4496
|
|
|
@@ -4678,7 +4536,8 @@ var UserDetail = function UserDetail() {
|
|
|
4678
4536
|
edited = _useUserDetail.edited,
|
|
4679
4537
|
setEdited = _useUserDetail.setEdited,
|
|
4680
4538
|
setEditedTrue = _useUserDetail.setEditedTrue,
|
|
4681
|
-
confirmChangePassword = _useUserDetail.confirmChangePassword
|
|
4539
|
+
confirmChangePassword = _useUserDetail.confirmChangePassword,
|
|
4540
|
+
forgotPasswordRequest = _useUserDetail.forgotPasswordRequest;
|
|
4682
4541
|
|
|
4683
4542
|
var initialValueForm = {
|
|
4684
4543
|
oldPassword: "",
|
|
@@ -4693,6 +4552,18 @@ var UserDetail = function UserDetail() {
|
|
|
4693
4552
|
window.open(url);
|
|
4694
4553
|
};
|
|
4695
4554
|
|
|
4555
|
+
var onResetPw = function onResetPw(email) {
|
|
4556
|
+
try {
|
|
4557
|
+
var data = {
|
|
4558
|
+
email: email
|
|
4559
|
+
};
|
|
4560
|
+
forgotPasswordRequest(data);
|
|
4561
|
+
return Promise.resolve();
|
|
4562
|
+
} catch (e) {
|
|
4563
|
+
return Promise.reject(e);
|
|
4564
|
+
}
|
|
4565
|
+
};
|
|
4566
|
+
|
|
4696
4567
|
return React.createElement(Formik, {
|
|
4697
4568
|
initialValues: userDetail,
|
|
4698
4569
|
enableReinitialize: true,
|
|
@@ -4735,14 +4606,21 @@ var UserDetail = function UserDetail() {
|
|
|
4735
4606
|
}), !!id && React.createElement(Row, {
|
|
4736
4607
|
className: "pt-2"
|
|
4737
4608
|
}, React.createElement(Col, {
|
|
4738
|
-
md:
|
|
4609
|
+
md: 6
|
|
4739
4610
|
}, " "), React.createElement(Col, {
|
|
4740
|
-
md:
|
|
4611
|
+
md: 5,
|
|
4612
|
+
className: "text-right"
|
|
4741
4613
|
}, React.createElement(Button, {
|
|
4614
|
+
color: "primary",
|
|
4615
|
+
onClick: function onClick() {
|
|
4616
|
+
onResetPw(values.email || "");
|
|
4617
|
+
}
|
|
4618
|
+
}, "Send forgot password link"), " ", React.createElement(Button, {
|
|
4742
4619
|
color: "success",
|
|
4743
4620
|
onClick: function onClick() {
|
|
4744
4621
|
getFile();
|
|
4745
|
-
}
|
|
4622
|
+
},
|
|
4623
|
+
className: "ml-4"
|
|
4746
4624
|
}, "Download user data"), " ")), React.createElement("h5", {
|
|
4747
4625
|
className: "mb-2"
|
|
4748
4626
|
}, header), React.createElement(Row, {
|
|
@@ -5336,7 +5214,7 @@ var defaultFilters = {
|
|
|
5336
5214
|
searchString: "",
|
|
5337
5215
|
isRead: false
|
|
5338
5216
|
};
|
|
5339
|
-
var TITLE$
|
|
5217
|
+
var TITLE$9 = "Notification list";
|
|
5340
5218
|
var NOTIFICATION_CHANNEL$1 = "NOTIFICATION_CHANNEL";
|
|
5341
5219
|
var NEW_NOTIFICATION$1 = "NEW_NOTIFICATION";
|
|
5342
5220
|
|
|
@@ -5429,7 +5307,7 @@ var useNotificationList = function useNotificationList() {
|
|
|
5429
5307
|
}
|
|
5430
5308
|
}, [filters]);
|
|
5431
5309
|
useEffect(function () {
|
|
5432
|
-
document.title = TITLE$
|
|
5310
|
+
document.title = TITLE$9;
|
|
5433
5311
|
}, []);
|
|
5434
5312
|
useEffect(function () {
|
|
5435
5313
|
getData();
|
|
@@ -5679,7 +5557,7 @@ var CommonAlert = function CommonAlert() {
|
|
|
5679
5557
|
}, alert.message)) : null;
|
|
5680
5558
|
};
|
|
5681
5559
|
|
|
5682
|
-
var schema$
|
|
5560
|
+
var schema$4 = object({
|
|
5683
5561
|
name: string().required("Name is required")
|
|
5684
5562
|
});
|
|
5685
5563
|
|
|
@@ -5693,7 +5571,7 @@ var ActionModal = function ActionModal(props, ref) {
|
|
|
5693
5571
|
name: targetMedia === null || targetMedia === void 0 ? void 0 : targetMedia.name
|
|
5694
5572
|
},
|
|
5695
5573
|
enableReinitialize: true,
|
|
5696
|
-
validationSchema: schema$
|
|
5574
|
+
validationSchema: schema$4,
|
|
5697
5575
|
onSubmit: function onSubmit(values, actions) {
|
|
5698
5576
|
onConfirm && onConfirm(values);
|
|
5699
5577
|
actions.resetForm();
|
|
@@ -5991,7 +5869,7 @@ var get$8 = function get(filter) {
|
|
|
5991
5869
|
});
|
|
5992
5870
|
};
|
|
5993
5871
|
|
|
5994
|
-
var TITLE$
|
|
5872
|
+
var TITLE$a = "Gallery";
|
|
5995
5873
|
var defaultFilter = {
|
|
5996
5874
|
searchString: ""
|
|
5997
5875
|
};
|
|
@@ -6228,7 +6106,7 @@ var useGalleryList = function useGalleryList(isLibrary) {
|
|
|
6228
6106
|
}
|
|
6229
6107
|
}, [dispatch, filters]);
|
|
6230
6108
|
useEffect(function () {
|
|
6231
|
-
document.title = TITLE$
|
|
6109
|
+
document.title = TITLE$a;
|
|
6232
6110
|
dispatch(setTargetMedia({
|
|
6233
6111
|
targetMedia: undefined
|
|
6234
6112
|
}));
|