touchstudy-core 0.1.84 → 0.1.85
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/abc/index.d.ts +2 -0
- package/dist/abc.js +4 -0
- package/dist/abc.js.map +1 -0
- package/dist/abc.modern.js +4 -0
- package/dist/abc.modern.js.map +1 -0
- package/dist/containers/Login/apiClient/index.d.ts +2 -5
- package/dist/containers/Login/configs/types.d.ts +11 -0
- package/dist/containers/Login/hooks/useLogin.d.ts +2 -4
- package/dist/index.js +29 -18
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +29 -18
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/ErrorHandler.d.ts +0 -6
- package/dist/components/LabelRequired.d.ts +0 -8
- package/dist/components/Selectors/InActiveAcademySelector.d.ts +0 -16
- package/dist/components/Selectors/TimeZoneSelector.d.ts +0 -9
- package/dist/components/Selectors/configs/enums.d.ts +0 -6
- package/dist/components/Selects/styles.d.ts +0 -6
- package/dist/containers/Classes/apiClients/classService.d.ts +0 -16
- package/dist/containers/Classes/apiClients/teacherService.d.ts +0 -2
- package/dist/containers/Classes/components/ClassForm.d.ts +0 -4
- package/dist/containers/Classes/components/CorrectAnswerSelector.d.ts +0 -7
- package/dist/containers/Classes/components/LessonFormBody.d.ts +0 -4
- package/dist/containers/Classes/components/LessonFormDialog.d.ts +0 -14
- package/dist/containers/Classes/components/LessonList.d.ts +0 -27
- package/dist/containers/Classes/components/SelectDialog.d.ts +0 -30
- package/dist/containers/Classes/components/StudentList.d.ts +0 -21
- package/dist/containers/Classes/components/TeacherList.d.ts +0 -21
- package/dist/containers/Classes/components/TeacherSelector.d.ts +0 -11
- package/dist/containers/Classes/configs/constants.d.ts +0 -70
- package/dist/containers/Classes/configs/interfaces.d.ts +0 -23
- package/dist/containers/Classes/configs/types.d.ts +0 -215
- package/dist/containers/Classes/hooks/useClassDetail.d.ts +0 -105
- package/dist/containers/Classes/hooks/useClassList.d.ts +0 -20
- package/dist/containers/Classes/hooks/useLessonClassList.d.ts +0 -20
- package/dist/containers/Classes/hooks/useStudentClassList.d.ts +0 -22
- package/dist/containers/Classes/hooks/useTab.d.ts +0 -5
- package/dist/containers/Classes/hooks/useTeacherClassList.d.ts +0 -22
- package/dist/containers/Classes/hooks/useTeacherList.d.ts +0 -6
- package/dist/containers/Classes/views/ClassDetail.d.ts +0 -10
- package/dist/containers/Classes/views/ClassList.d.ts +0 -10
- package/dist/containers/ExamResult/components/Dialog/PrintDialog.d.ts +0 -6
- package/dist/containers/ExamResult/views/ExamResultView.d.ts +0 -11
- package/dist/containers/ExamResult/views/PrintPdfExamResult.d.ts +0 -12
- package/dist/containers/Textbooks/components/ChapterNameDialog.d.ts +0 -10
- package/dist/containers/Users/apiClient/userService.d.ts +0 -9
- package/dist/containers/Users/components/Dialogs/DeleteUserCsvDialog.d.ts +0 -10
- package/dist/containers/Users/components/Dialogs/RecentUserActionDialog.d.ts +0 -9
- package/dist/containers/Users/components/Dialogs/UserDialog.d.ts +0 -12
- package/dist/containers/Users/configs/constants.d.ts +0 -37
- package/dist/containers/Users/configs/types.d.ts +0 -11
- package/dist/containers/Users/hooks/useExportUsersCsv.d.ts +0 -5
- package/dist/containers/Users/hooks/useRecentUserAction.d.ts +0 -10
- package/dist/containers/Users/hooks/useUserList.d.ts +0 -40
- package/dist/containers/Users/views/UserList.d.ts +0 -7
- package/dist/test/performance_login.d.ts +0 -5
- package/dist/tests/performances/do-exam-session-list-student.d.ts +0 -19
- package/dist/tests/performances/do-exam-session-request-answer-one-time.d.ts +0 -19
- package/dist/tests/performances/do-exam-session-skip-answer.d.ts +0 -19
- package/dist/tests/performances/do-exam-session2.d.ts +0 -19
- package/dist/tests/performances/do-exam.d.ts +0 -15
- package/dist/tests/performances/join-exam.d.ts +0 -13
- package/dist/tests/performances/login.d.ts +0 -20
- package/dist/tests/performances/ramping-vus.d.ts +0 -7
- package/dist/utilities.d.ts +0 -1
- package/dist/utils/enums/UserSortColumn.d.ts +0 -11
- package/dist/utils/enums/orderBy.d.ts +0 -4
- package/dist/utils/hooks/useCheckExam.d.ts +0 -5
- package/dist/utils/toLocalTime.d.ts +0 -1
- package/dist/utils/types/user.d.ts +0 -3
- package/dist/utils/types/users.d.ts +0 -17
- /package/dist/utils/types/{PagingResponse.d.ts → pagingResponse.d.ts} +0 -0
package/dist/abc.js
ADDED
package/dist/abc.js.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"abc.js","sources":["../src/abc/index.ts"],"sourcesContent":["const ABC = \"123\"\nexport {\n ABC\n}"],"names":["ABC"],"mappings":"IAAMA,GAAG,GAAG;;;;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"abc.modern.js","sources":["../src/abc/index.ts"],"sourcesContent":["const ABC = \"123\"\nexport {\n ABC\n}"],"names":["ABC"],"mappings":"MAAMA,GAAG,GAAG;;;;"}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { SignInOTPRequest } from "../configs/types";
|
1
2
|
export declare const getGoogleClientId: () => Promise<import("axios").AxiosResponse<any, any>>;
|
2
3
|
export declare const signInApi: ({ email, password, role }: {
|
3
4
|
email: string;
|
@@ -9,11 +10,7 @@ export declare const signInWithEmailApi: ({ academyDomain, email, reCaptcha }: {
|
|
9
10
|
email: string;
|
10
11
|
reCaptcha: string;
|
11
12
|
}) => Promise<import("axios").AxiosResponse<any, any>>;
|
12
|
-
export declare const signInWithOTPApi: ({ academyDomain, otp, role }:
|
13
|
-
academyDomain: string;
|
14
|
-
otp: number;
|
15
|
-
role?: string | undefined;
|
16
|
-
}) => Promise<import("axios").AxiosResponse<any, any>>;
|
13
|
+
export declare const signInWithOTPApi: ({ academyDomain, otp, email, reCaptcha, role }: SignInOTPRequest) => Promise<import("axios").AxiosResponse<any, any>>;
|
17
14
|
export declare const signInWithKeyApi: ({ academyDomain, key, role }: {
|
18
15
|
academyDomain: string;
|
19
16
|
key: string;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import { Role } from "../../../utils/constants";
|
3
|
+
import { LoginEmailRequest } from "../configs/types";
|
3
4
|
declare type LoginInfo = {
|
4
5
|
email: string;
|
5
6
|
otp: number | string;
|
@@ -26,10 +27,7 @@ declare const useLogin: ({ history, homeAcademyUrl, homeUrl, registerUrl, role }
|
|
26
27
|
isShowPassword: boolean;
|
27
28
|
setIsShowPassword: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
28
29
|
infoUser: any;
|
29
|
-
handleSubmit: (values:
|
30
|
-
email?: string;
|
31
|
-
otp?: number;
|
32
|
-
}) => Promise<void>;
|
30
|
+
handleSubmit: (values: LoginEmailRequest) => Promise<void>;
|
33
31
|
setInfoUser: import("react").Dispatch<any>;
|
34
32
|
};
|
35
33
|
export default useLogin;
|
package/dist/index.js
CHANGED
@@ -799,16 +799,11 @@ var BlockLogin = function BlockLogin(_ref3) {
|
|
799
799
|
onSubmit: onSubmit
|
800
800
|
}, function (_ref4) {
|
801
801
|
var errors = _ref4.errors,
|
802
|
-
values = _ref4.values,
|
803
802
|
setFieldValue = _ref4.setFieldValue;
|
804
|
-
console.log({
|
805
|
-
errors: errors,
|
806
|
-
values: values
|
807
|
-
});
|
808
803
|
React.useEffect(function () {
|
809
|
-
if (
|
804
|
+
if (isEmail) setFieldValue("otp", "");
|
805
|
+
if (!isOTP && !isEmail) {
|
810
806
|
setFieldValue("email", "");
|
811
|
-
} else {
|
812
807
|
setFieldValue("otp", "");
|
813
808
|
}
|
814
809
|
}, [isOTP, isEmail]);
|
@@ -844,8 +839,9 @@ var BlockLogin = function BlockLogin(_ref3) {
|
|
844
839
|
fontSize: "14px",
|
845
840
|
fontWeight: 700,
|
846
841
|
color: colors.blue[700]
|
847
|
-
}, t("sign_in_with_email"))))), (isEmail || isOTP) && React__default.createElement(material.Stack, null,
|
842
|
+
}, t("sign_in_with_email"))))), (isEmail || isOTP) && React__default.createElement(material.Stack, null, React__default.createElement(material.Stack, {
|
848
843
|
flexDirection: "column",
|
844
|
+
display: isOTP ? "none" : "flex",
|
849
845
|
gap: 1
|
850
846
|
}, React__default.createElement(material.Typography, {
|
851
847
|
fontWeight: 700,
|
@@ -861,8 +857,9 @@ var BlockLogin = function BlockLogin(_ref3) {
|
|
861
857
|
fontSize: "10px",
|
862
858
|
lineHeight: "11.93px",
|
863
859
|
color: !(errors !== null && errors !== void 0 && errors.email) ? "#97A1AF" : "#F34B4B"
|
864
|
-
}, errors === null || errors === void 0 ? void 0 : errors.email))
|
860
|
+
}, errors === null || errors === void 0 ? void 0 : errors.email)), React__default.createElement(material.Stack, {
|
865
861
|
flexDirection: "column",
|
862
|
+
display: !isOTP ? "none" : "flex",
|
866
863
|
gap: 1
|
867
864
|
}, React__default.createElement(material.Typography, {
|
868
865
|
fontWeight: 700,
|
@@ -901,10 +898,18 @@ var BlockLogin = function BlockLogin(_ref3) {
|
|
901
898
|
color: colors.blue[700]
|
902
899
|
}, t("sign_in_with_google_account"))), React__default.createElement(material.Stack, {
|
903
900
|
flexDirection: "row",
|
904
|
-
justifyContent: "end",
|
901
|
+
justifyContent: isOTP ? "space-between" : "end",
|
905
902
|
gap: 1,
|
906
903
|
mt: 2
|
907
|
-
}, React__default.createElement(material.Button, {
|
904
|
+
}, isOTP && React__default.createElement(material.Button, {
|
905
|
+
variant: "contained",
|
906
|
+
color: "secondary",
|
907
|
+
className: "bg-secondary",
|
908
|
+
onClick: function onClick() {
|
909
|
+
handleSwitchEmail(true);
|
910
|
+
handleSwitchOTP(false);
|
911
|
+
}
|
912
|
+
}, t("back")), React__default.createElement(material.Button, {
|
908
913
|
variant: "contained",
|
909
914
|
color: "primary",
|
910
915
|
type: "submit",
|
@@ -941,10 +946,14 @@ var signInWithEmailApi = function signInWithEmailApi(_ref2) {
|
|
941
946
|
var signInWithOTPApi = function signInWithOTPApi(_ref3) {
|
942
947
|
var academyDomain = _ref3.academyDomain,
|
943
948
|
otp = _ref3.otp,
|
949
|
+
email = _ref3.email,
|
950
|
+
reCaptcha = _ref3.reCaptcha,
|
944
951
|
role = _ref3.role;
|
945
952
|
return api.post((academyDomain ? SIGN_IN_URL : SIGN_IN_SUPER_ADMIN_URL) + "/otp", {
|
946
953
|
otp: otp,
|
947
|
-
|
954
|
+
email: email,
|
955
|
+
role: role,
|
956
|
+
reCaptcha: reCaptcha
|
948
957
|
});
|
949
958
|
};
|
950
959
|
var signInWithKeyApi = function signInWithKeyApi(_ref4) {
|
@@ -1031,6 +1040,9 @@ var useLogin$1 = function useLogin(_ref) {
|
|
1031
1040
|
var handleSubmit = function handleSubmit(values) {
|
1032
1041
|
try {
|
1033
1042
|
var _temp5 = function _temp5() {
|
1043
|
+
setRefreshReCaptcha(function (b) {
|
1044
|
+
return !b;
|
1045
|
+
});
|
1034
1046
|
dispatch(setLoading(false));
|
1035
1047
|
};
|
1036
1048
|
if (!tokenReCaptcha) return Promise.resolve();
|
@@ -1040,11 +1052,13 @@ var useLogin$1 = function useLogin(_ref) {
|
|
1040
1052
|
var _temp4 = _catch(function () {
|
1041
1053
|
function _temp3() {
|
1042
1054
|
var _temp = function () {
|
1043
|
-
if (otp) {
|
1055
|
+
if (email && otp) {
|
1044
1056
|
return Promise.resolve(signInWithOTPApi({
|
1045
1057
|
academyDomain: academyDomain,
|
1058
|
+
email: email,
|
1046
1059
|
otp: otp,
|
1047
|
-
role: role
|
1060
|
+
role: role,
|
1061
|
+
reCaptcha: tokenReCaptcha
|
1048
1062
|
})).then(function (res) {
|
1049
1063
|
var loginResponse = res === null || res === void 0 ? void 0 : res.data;
|
1050
1064
|
var isFirstLogin = loginResponse.isFirstLogin,
|
@@ -1061,7 +1075,7 @@ var useLogin$1 = function useLogin(_ref) {
|
|
1061
1075
|
if (_temp && _temp.then) return _temp.then(function () {});
|
1062
1076
|
}
|
1063
1077
|
var _temp2 = function () {
|
1064
|
-
if (email) {
|
1078
|
+
if (email && !otp) {
|
1065
1079
|
return Promise.resolve(signInWithEmailApi({
|
1066
1080
|
academyDomain: academyDomain,
|
1067
1081
|
email: email,
|
@@ -1070,9 +1084,6 @@ var useLogin$1 = function useLogin(_ref) {
|
|
1070
1084
|
reactToastify.toast.success(t("please_check_your_mailbox"));
|
1071
1085
|
handleSwitchOTP(true);
|
1072
1086
|
handleSwitchEmail(false);
|
1073
|
-
setRefreshReCaptcha(function (b) {
|
1074
|
-
return !b;
|
1075
|
-
});
|
1076
1087
|
});
|
1077
1088
|
}
|
1078
1089
|
}();
|