touchstudy-core 0.1.86 → 0.1.88
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/components/CkEditor/CkEditor.d.ts +10 -0
- package/dist/components/CkEditor/config.d.ts +19 -0
- package/dist/components/ErrorHandler.d.ts +6 -0
- package/dist/components/LabelRequired.d.ts +8 -0
- package/dist/components/Selectors/ClassSelector.d.ts +10 -0
- package/dist/components/Selectors/StudentSelector.d.ts +10 -0
- package/dist/containers/Classes/apiClients/classService.d.ts +16 -0
- package/dist/containers/Classes/apiClients/teacherService.d.ts +2 -0
- package/dist/containers/Classes/components/ClassForm.d.ts +4 -0
- package/dist/containers/Classes/components/CorrectAnswerSelector.d.ts +7 -0
- package/dist/containers/Classes/components/LessonFormBody.d.ts +4 -0
- package/dist/containers/Classes/components/LessonFormDialog.d.ts +14 -0
- package/dist/containers/Classes/components/LessonList.d.ts +27 -0
- package/dist/containers/Classes/components/SelectDialog.d.ts +30 -0
- package/dist/containers/Classes/components/StudentList.d.ts +21 -0
- package/dist/containers/Classes/components/TeacherList.d.ts +21 -0
- package/dist/containers/Classes/components/TeacherSelector.d.ts +11 -0
- package/dist/containers/Classes/configs/constants.d.ts +70 -0
- package/dist/containers/Classes/configs/interfaces.d.ts +23 -0
- package/dist/containers/Classes/configs/types.d.ts +215 -0
- package/dist/containers/Classes/hooks/useClassDetail.d.ts +105 -0
- package/dist/containers/Classes/hooks/useClassList.d.ts +20 -0
- package/dist/containers/Classes/hooks/useLessonClassList.d.ts +20 -0
- package/dist/containers/Classes/hooks/useStudentClassList.d.ts +22 -0
- package/dist/containers/Classes/hooks/useTab.d.ts +5 -0
- package/dist/containers/Classes/hooks/useTeacherClassList.d.ts +22 -0
- package/dist/containers/Classes/hooks/useTeacherList.d.ts +6 -0
- package/dist/containers/Classes/views/ClassDetail.d.ts +10 -0
- package/dist/containers/Classes/views/ClassList.d.ts +10 -0
- package/dist/containers/Login/apiClient/index.d.ts +2 -5
- package/dist/containers/Login/hooks/useLogin.d.ts +2 -4
- package/dist/containers/Notifications/apiClients/notificationService.d.ts +6 -0
- package/dist/containers/Notifications/components/NotificationForm.d.ts +4 -0
- package/dist/containers/Notifications/components/SelectFilterType.d.ts +13 -0
- package/dist/containers/Notifications/components/TypeSelector.d.ts +13 -0
- package/dist/containers/Notifications/configs/constants.d.ts +14 -0
- package/dist/containers/Notifications/configs/interfaces.d.ts +10 -0
- package/dist/containers/Notifications/configs/types.d.ts +60 -0
- package/dist/containers/Notifications/hooks/useNotificationDetail.d.ts +23 -0
- package/dist/containers/Notifications/hooks/useNotificationList.d.ts +29 -0
- package/dist/containers/Notifications/views/NotificationDetail.d.ts +9 -0
- package/dist/containers/Notifications/views/NotificationList.d.ts +8 -0
- package/dist/containers/Users/apiClient/userService.d.ts +9 -0
- package/dist/containers/Users/components/Dialogs/DeleteUserCsvDialog.d.ts +10 -0
- package/dist/containers/Users/components/Dialogs/RecentUserActionDialog.d.ts +9 -0
- package/dist/containers/Users/components/Dialogs/UserDialog.d.ts +12 -0
- package/dist/containers/Users/configs/constants.d.ts +37 -0
- package/dist/containers/Users/configs/types.d.ts +11 -0
- package/dist/containers/Users/hooks/useExportUsersCsv.d.ts +5 -0
- package/dist/containers/Users/hooks/useRecentUserAction.d.ts +10 -0
- package/dist/containers/Users/hooks/useUserList.d.ts +40 -0
- package/dist/containers/Users/views/UserList.d.ts +7 -0
- package/dist/index.css +48 -0
- package/dist/index.d.ts +7 -2
- package/dist/index.js +5133 -59
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +5123 -56
- package/dist/index.modern.js.map +1 -1
- package/dist/services/classService.d.ts +4 -0
- package/dist/services/studentService.d.ts +1 -0
- package/dist/utils/enums/index.d.ts +2 -1
- package/dist/utils/enums/userSortColumn.d.ts +11 -0
- package/dist/utils/formatTime.d.ts +2 -0
- package/dist/utils/helpers.d.ts +3 -0
- package/dist/utils/hooks/useCountDownTimer.d.ts +0 -1
- package/dist/utils/toLocalTime.d.ts +1 -0
- package/dist/utils/types/index.d.ts +2 -1
- package/dist/utils/types/searchQuery.d.ts +7 -0
- package/dist/utils/types/users.d.ts +17 -0
- package/package.json +7 -3
@@ -0,0 +1,20 @@
|
|
1
|
+
import { ChangeEvent } from "react";
|
2
|
+
import { ClassQuery, ClassResponse, ClassSortBy } from "../configs/types";
|
3
|
+
import { PagingResponse } from "../../../utils/types/pagingResponse";
|
4
|
+
declare const useClassList: (history: any, classCreateUrl?: string | undefined, classUpdateUrl?: string | undefined) => {
|
5
|
+
paging: PagingResponse;
|
6
|
+
classList: ClassResponse[];
|
7
|
+
classFilter: ClassQuery;
|
8
|
+
textSearchRef: import("react").RefObject<HTMLInputElement>;
|
9
|
+
selectedClass: ClassResponse | undefined;
|
10
|
+
t: any;
|
11
|
+
handleOpenDeleteClassDialog: (value: ClassResponse) => void;
|
12
|
+
handleCloseConfirmDialog: () => void;
|
13
|
+
handleSort: (key: ClassSortBy) => void;
|
14
|
+
handleChangeSearchText: (e: ChangeEvent<HTMLInputElement>) => void;
|
15
|
+
handleCreateClass: () => void;
|
16
|
+
handleUpdateClass: (value: ClassResponse) => void;
|
17
|
+
handleChangePage: (_: any, page: number) => void;
|
18
|
+
handleDeleteClass: () => Promise<void>;
|
19
|
+
};
|
20
|
+
export default useClassList;
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { ChangeEvent } from "react";
|
2
|
+
import { LessonResponse, LessonQuery, LessonSortBy } from "../configs/types";
|
3
|
+
import { PagingResponse } from "../../../utils/types/pagingResponse";
|
4
|
+
export declare type DialogType = "Update" | "Remove" | "Create";
|
5
|
+
declare const useLessonClassList: (courseId: number) => {
|
6
|
+
paging: PagingResponse;
|
7
|
+
classList: LessonResponse[];
|
8
|
+
filter: LessonQuery;
|
9
|
+
selectedLesson: LessonResponse | undefined;
|
10
|
+
openDialog: "Update" | "Create" | "Remove" | undefined;
|
11
|
+
t: any;
|
12
|
+
handleOpenCreateOrUpdateDialog: (value?: LessonResponse | undefined) => void;
|
13
|
+
handleOpenDeleteClassDialog: (value: LessonResponse) => void;
|
14
|
+
handleCloseConfirmDialog: () => void;
|
15
|
+
handleSort: (key: LessonSortBy) => void;
|
16
|
+
handleChangeSearchText: (e: ChangeEvent<HTMLInputElement>) => void;
|
17
|
+
handleChangePage: (_: any, page: number) => void;
|
18
|
+
getLessons: () => Promise<void>;
|
19
|
+
};
|
20
|
+
export default useLessonClassList;
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { ChangeEvent } from "react";
|
2
|
+
import { StudentClassQuery, UserClassSortBy, StudentClassResponse } from "../configs/types";
|
3
|
+
import _ from "lodash";
|
4
|
+
import { PagingResponse } from "../../../utils/types/pagingResponse";
|
5
|
+
declare const useStudentClassList: (courseId: number) => {
|
6
|
+
paging: PagingResponse;
|
7
|
+
classList: StudentClassResponse[];
|
8
|
+
filter: StudentClassQuery;
|
9
|
+
selectedStudent: StudentClassResponse | undefined;
|
10
|
+
t: any;
|
11
|
+
textSearchRef: import("react").RefObject<HTMLInputElement>;
|
12
|
+
debounceSearch: _.DebouncedFunc<() => void>;
|
13
|
+
handleOpenDeleteClassDialog: (value: StudentClassResponse) => void;
|
14
|
+
handleCloseConfirmDialog: () => void;
|
15
|
+
handleSort: (key: UserClassSortBy) => void;
|
16
|
+
handleChangeSearchText: (e: ChangeEvent<HTMLInputElement>) => void;
|
17
|
+
handleChangePage: (_: any, page: number) => void;
|
18
|
+
handleRemoveStudentFromClass: () => Promise<void>;
|
19
|
+
getStudents: () => Promise<void>;
|
20
|
+
resetData: () => void;
|
21
|
+
};
|
22
|
+
export default useStudentClassList;
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { ChangeEvent } from "react";
|
2
|
+
import { StudentClassQuery, TeacherClassResponse, UserClassSortBy } from "../configs/types";
|
3
|
+
import _ from "lodash";
|
4
|
+
import { PagingResponse } from "../../../utils/types/pagingResponse";
|
5
|
+
declare const useTeacherClassList: (courseId: number) => {
|
6
|
+
paging: PagingResponse;
|
7
|
+
classList: TeacherClassResponse[];
|
8
|
+
filter: StudentClassQuery;
|
9
|
+
selectedTeacher: TeacherClassResponse | undefined;
|
10
|
+
t: any;
|
11
|
+
textSearchRef: import("react").RefObject<HTMLInputElement>;
|
12
|
+
debounceSearch: _.DebouncedFunc<() => void>;
|
13
|
+
handleOpenDeleteClassDialog: (value: TeacherClassResponse) => void;
|
14
|
+
handleCloseConfirmDialog: () => void;
|
15
|
+
handleSort: (key: UserClassSortBy) => void;
|
16
|
+
handleChangeSearchText: (e: ChangeEvent<HTMLInputElement>) => void;
|
17
|
+
handleChangePage: (_: any, page: number) => void;
|
18
|
+
handleRemoveTeacherFromClass: () => Promise<void>;
|
19
|
+
getTeachers: () => Promise<void>;
|
20
|
+
resetData: () => void;
|
21
|
+
};
|
22
|
+
export default useTeacherClassList;
|
@@ -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;
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { NotificationQuery, NotificationRequest } from "../configs/types";
|
2
|
+
export declare const get: (query: NotificationQuery) => Promise<import("axios").AxiosResponse<any, any>>;
|
3
|
+
export declare const create: (model: NotificationRequest) => Promise<import("axios").AxiosResponse<any, any>>;
|
4
|
+
export declare const update: (notificationId: number, model: NotificationRequest) => Promise<import("axios").AxiosResponse<any, any>>;
|
5
|
+
export declare const deleteNotificationApi: (notificationId: number) => Promise<import("axios").AxiosResponse<any, any>>;
|
6
|
+
export declare const getById: (id: number) => Promise<import("axios").AxiosResponse<any, any>>;
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { FC } from "react";
|
2
|
+
import { Option, TypeNotificationEnum } from "../configs/types";
|
3
|
+
interface Props {
|
4
|
+
value: number[] | undefined;
|
5
|
+
onChange: (val: Option[]) => void;
|
6
|
+
optionTypeNotification: {
|
7
|
+
value: TypeNotificationEnum;
|
8
|
+
label: string;
|
9
|
+
}[];
|
10
|
+
isDisabled?: boolean;
|
11
|
+
}
|
12
|
+
declare const SelectFilterType: FC<Props>;
|
13
|
+
export default SelectFilterType;
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { FC } from "react";
|
2
|
+
import { Option, TypeNotificationEnum } from "../configs/types";
|
3
|
+
interface Props {
|
4
|
+
value?: number | null;
|
5
|
+
onChange: (val: Option | null) => void;
|
6
|
+
optionTypeNotification: {
|
7
|
+
value: TypeNotificationEnum;
|
8
|
+
label: string;
|
9
|
+
}[];
|
10
|
+
disabled?: boolean;
|
11
|
+
}
|
12
|
+
declare const TypeSelector: FC<Props>;
|
13
|
+
export default TypeSelector;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import * as yup from "yup";
|
2
|
+
import { NotificationHeaderTable, NotificationQuery, NotificationRequest } from "./types";
|
3
|
+
export declare const NOTIFICATION_HEADERS: NotificationHeaderTable[];
|
4
|
+
export declare const DefaultNotificationFilter: NotificationQuery;
|
5
|
+
export declare const CLASS_QUESTIONS: number[];
|
6
|
+
export declare const DEFAULT_NOTIFICATION_REQUEST: NotificationRequest;
|
7
|
+
export declare const DATE_TIME_FORMAT = "YYYY-MM-DD";
|
8
|
+
export declare const NotificationSchema: (t: any) => yup.ObjectSchema<{
|
9
|
+
name: string;
|
10
|
+
type: number;
|
11
|
+
}, yup.AnyObject, {
|
12
|
+
name: undefined;
|
13
|
+
type: undefined;
|
14
|
+
}, "">;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { FormikProps } from "formik";
|
2
|
+
import { NotificationRequest, NotificationResponse } from "./types";
|
3
|
+
export interface NotificationFormProps {
|
4
|
+
id?: string;
|
5
|
+
formikProp: FormikProps<NotificationRequest>;
|
6
|
+
data?: NotificationResponse;
|
7
|
+
navigate: any;
|
8
|
+
isAdmin: boolean;
|
9
|
+
isTeacherAdmin: boolean;
|
10
|
+
}
|
@@ -0,0 +1,60 @@
|
|
1
|
+
export declare type NotificationResponse = {
|
2
|
+
id?: number;
|
3
|
+
name: string;
|
4
|
+
type: TypeNotificationEnum;
|
5
|
+
content: string;
|
6
|
+
createdAt: string;
|
7
|
+
isOwned: boolean;
|
8
|
+
notificationTypes: NotificationType[];
|
9
|
+
};
|
10
|
+
export declare type NotificationType = {
|
11
|
+
notificationId: number;
|
12
|
+
courseId: number | null;
|
13
|
+
studentId: number | null;
|
14
|
+
courseName: string;
|
15
|
+
studentName: string;
|
16
|
+
studentEmail: string;
|
17
|
+
};
|
18
|
+
export declare enum TypeNotificationEnum {
|
19
|
+
Default = 0,
|
20
|
+
Academy = 1,
|
21
|
+
Class = 2,
|
22
|
+
Student = 3
|
23
|
+
}
|
24
|
+
export declare const optionTypeNotification: {
|
25
|
+
value: TypeNotificationEnum;
|
26
|
+
label: string;
|
27
|
+
}[];
|
28
|
+
export declare type NotificationRequest = {
|
29
|
+
id?: number | string;
|
30
|
+
name: string;
|
31
|
+
content: string;
|
32
|
+
type: TypeNotificationEnum;
|
33
|
+
studentIds: number[];
|
34
|
+
classIds: number[];
|
35
|
+
};
|
36
|
+
export declare type NotificationQuery = {
|
37
|
+
currentPage: number;
|
38
|
+
pageSize: number;
|
39
|
+
sortColumnName: NotificationSortBy;
|
40
|
+
textSearch?: string;
|
41
|
+
sortColumnDirection: OrderBy;
|
42
|
+
type: number[];
|
43
|
+
};
|
44
|
+
export declare enum NotificationSortBy {
|
45
|
+
CreatedAt = "CreatedAt",
|
46
|
+
Name = "Name",
|
47
|
+
Type = "Type"
|
48
|
+
}
|
49
|
+
export declare enum OrderBy {
|
50
|
+
ASC = "ASC",
|
51
|
+
DESC = "DESC"
|
52
|
+
}
|
53
|
+
export declare type NotificationHeaderTable = {
|
54
|
+
title: string;
|
55
|
+
sortKey?: NotificationSortBy;
|
56
|
+
};
|
57
|
+
export declare type Option = {
|
58
|
+
label: string;
|
59
|
+
value: number;
|
60
|
+
};
|
@@ -0,0 +1,23 @@
|
|
1
|
+
/// <reference types="yup" />
|
2
|
+
import { FormikHelpers } from "formik";
|
3
|
+
import { NotificationRequest, NotificationResponse } from "../configs/types";
|
4
|
+
import { Role } from "../../../utils/constants";
|
5
|
+
declare type Props = {
|
6
|
+
navigate: any;
|
7
|
+
id?: string;
|
8
|
+
role: Role;
|
9
|
+
};
|
10
|
+
declare const useNotificationDetail: ({ navigate, id, role }: Props) => {
|
11
|
+
schema: import("yup").ObjectSchema<{
|
12
|
+
name: string;
|
13
|
+
type: number;
|
14
|
+
}, import("yup").AnyObject, {
|
15
|
+
name: undefined;
|
16
|
+
type: undefined;
|
17
|
+
}, "">;
|
18
|
+
isAdmin: boolean;
|
19
|
+
isTeacherAdmin: any;
|
20
|
+
handleSubmit: (values: NotificationRequest, _: FormikHelpers<NotificationRequest>) => Promise<void>;
|
21
|
+
detailNotification: NotificationResponse | undefined;
|
22
|
+
};
|
23
|
+
export default useNotificationDetail;
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import { ChangeEvent } from "react";
|
2
|
+
import { NotificationQuery, NotificationResponse, NotificationSortBy, Option } from "../configs/types";
|
3
|
+
import { PagingResponse } from "../../../utils/types/pagingResponse";
|
4
|
+
import { Role } from "../../../utils/constants";
|
5
|
+
declare type Props = {
|
6
|
+
navigate: any;
|
7
|
+
role: Role;
|
8
|
+
};
|
9
|
+
declare const useNotificationList: ({ navigate, role }: Props) => {
|
10
|
+
t: any;
|
11
|
+
theme: import("@mui/material").Theme;
|
12
|
+
paging: PagingResponse;
|
13
|
+
isAdmin: boolean;
|
14
|
+
isTeacherAdmin: any;
|
15
|
+
notificationList: NotificationResponse[];
|
16
|
+
notificationFilter: NotificationQuery;
|
17
|
+
textSearchRef: import("react").RefObject<HTMLInputElement>;
|
18
|
+
selectedNotification: NotificationResponse | undefined;
|
19
|
+
handleOpenDeleteNotificationDialog: (value: NotificationResponse) => void;
|
20
|
+
handleCloseConfirmDialog: () => void;
|
21
|
+
handleSort: (key: NotificationSortBy) => void;
|
22
|
+
handleChangeSearchText: (e: ChangeEvent<HTMLInputElement>) => void;
|
23
|
+
handleCreateNotification: () => void;
|
24
|
+
handleUpdateNotification: (value: NotificationResponse) => void;
|
25
|
+
handleChangePage: (_: any, page: number) => void;
|
26
|
+
handleDeleteNotification: () => Promise<void>;
|
27
|
+
onChangeFilterType: (val: Option[]) => void;
|
28
|
+
};
|
29
|
+
export default useNotificationList;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { Role } from '../../../utils/constants';
|
3
|
+
declare type Props = {
|
4
|
+
id?: string;
|
5
|
+
navigate: any;
|
6
|
+
role: Role;
|
7
|
+
};
|
8
|
+
declare const NotificationDetail: ({ id, navigate, role }: Props) => React.JSX.Element;
|
9
|
+
export default NotificationDetail;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { UserSearchQuery } from "../../../utils/types/users";
|
2
|
+
import { UserForm } from "../configs/types";
|
3
|
+
export declare const getUserListApi: (query: UserSearchQuery) => Promise<import("axios").AxiosResponse<any, any>>;
|
4
|
+
export declare const getUserTemplateApi: () => Promise<import("axios").AxiosResponse<any, any>>;
|
5
|
+
export declare const exportUserCsvApi: (query: UserSearchQuery) => Promise<import("axios").AxiosResponse<any, any>>;
|
6
|
+
export declare const importUserCsvApi: (data: FormData, isDelete: boolean) => Promise<import("axios").AxiosResponse<any, any>>;
|
7
|
+
export declare const updateUserApi: (data: UserForm, id: number) => Promise<import("axios").AxiosResponse<any, any>>;
|
8
|
+
export declare const createUserApi: (data: UserForm) => Promise<import("axios").AxiosResponse<any, any>>;
|
9
|
+
export declare const deleteUserApi: (id: number) => Promise<import("axios").AxiosResponse<any, any>>;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { FC } from "react";
|
2
|
+
interface Props {
|
3
|
+
open: boolean;
|
4
|
+
file?: File;
|
5
|
+
onChangeFile: (file?: File) => void;
|
6
|
+
onClose: () => void;
|
7
|
+
onSubmit: () => Promise<boolean>;
|
8
|
+
}
|
9
|
+
declare const DeleteUserCsvDialog: FC<Props>;
|
10
|
+
export default DeleteUserCsvDialog;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { FC } from "react";
|
2
|
+
import { Types } from "../../../..";
|
3
|
+
interface Props {
|
4
|
+
open: boolean;
|
5
|
+
onClose: () => void;
|
6
|
+
recentUserActions?: Types.RecentUserActionResponse[];
|
7
|
+
}
|
8
|
+
declare const RecentUserActionDialog: FC<Props>;
|
9
|
+
export default RecentUserActionDialog;
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { FC } from "react";
|
2
|
+
import { UserForm } from "../../configs/types";
|
3
|
+
import { User } from "../../../../utils/types/users";
|
4
|
+
interface Props {
|
5
|
+
open: boolean;
|
6
|
+
data?: User;
|
7
|
+
disabled?: boolean;
|
8
|
+
onClose: () => void;
|
9
|
+
onSubmitForm: (data: UserForm) => void;
|
10
|
+
}
|
11
|
+
declare const UserDialog: FC<Props>;
|
12
|
+
export default UserDialog;
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import { Role } from "../../../utils/constants";
|
2
|
+
import { UserSortColumn } from "../../../utils/enums";
|
3
|
+
import * as yup from "yup";
|
4
|
+
import { User, UserSearchQuery } from "../../../utils/types/users";
|
5
|
+
export declare const USER_HEADERS: ({
|
6
|
+
title: string;
|
7
|
+
sortKey?: undefined;
|
8
|
+
} | {
|
9
|
+
title: string;
|
10
|
+
sortKey: UserSortColumn;
|
11
|
+
})[];
|
12
|
+
export declare const DEFAULT_USER_FILTERS: UserSearchQuery;
|
13
|
+
export declare const UserSchema: yup.ObjectSchema<{
|
14
|
+
fullName: string;
|
15
|
+
email: string;
|
16
|
+
phoneNumber: string;
|
17
|
+
schoolName: string | undefined;
|
18
|
+
grade: number | null | undefined;
|
19
|
+
major: string | undefined;
|
20
|
+
parentPhoneNumber: string | undefined;
|
21
|
+
parentName: string | undefined;
|
22
|
+
}, yup.AnyObject, {
|
23
|
+
fullName: undefined;
|
24
|
+
email: undefined;
|
25
|
+
phoneNumber: undefined;
|
26
|
+
schoolName: undefined;
|
27
|
+
grade: undefined;
|
28
|
+
major: undefined;
|
29
|
+
parentPhoneNumber: undefined;
|
30
|
+
parentName: undefined;
|
31
|
+
}, "">;
|
32
|
+
export declare const DEFAULT_USER: User;
|
33
|
+
export declare const ROLES: Role[];
|
34
|
+
export declare const RECENT_USER_ACTION_HEADERS: {
|
35
|
+
title: string;
|
36
|
+
}[];
|
37
|
+
export declare const CSV_PREFIX = "data:text/csv;charset=utf-8,";
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { Types } from "../../..";
|
2
|
+
import { Role } from "../../../utils/constants";
|
3
|
+
declare const useRecentUserAction: (role: Role) => {
|
4
|
+
recentUserActions: Types.RecentUserActionResponse[] | undefined;
|
5
|
+
isOpenRecentUserActionDialog: boolean;
|
6
|
+
handleOpenRecentUserActionDialog: () => void;
|
7
|
+
handleCloseRecentUserActionDialog: () => void;
|
8
|
+
getRecentExam: () => Promise<void>;
|
9
|
+
};
|
10
|
+
export default useRecentUserAction;
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import { ChangeEvent } from "react";
|
2
|
+
import { UserForm } from "../configs/types";
|
3
|
+
import _ from "lodash";
|
4
|
+
import { Enums, Role } from "../../..";
|
5
|
+
import { PagingResponse } from "../../../utils/types/pagingResponse";
|
6
|
+
import { UserSortColumn } from "../../../utils/enums";
|
7
|
+
import { User } from "../../../utils/types/users";
|
8
|
+
declare const useUserList: (role: Role) => {
|
9
|
+
inputFileRef: import("react").RefObject<HTMLInputElement>;
|
10
|
+
paging: PagingResponse;
|
11
|
+
openConfirmDialog: boolean;
|
12
|
+
openUserDialog: boolean;
|
13
|
+
userList: User[];
|
14
|
+
selectedUser: User | undefined;
|
15
|
+
filter: import("../../../utils/types/searchQuery").BaseSearchQuery<Enums.UserSortColumn>;
|
16
|
+
textSearchRef: import("react").RefObject<HTMLInputElement>;
|
17
|
+
deleteFile: File | undefined;
|
18
|
+
isOpenDeleteUserCsv: boolean;
|
19
|
+
handleToggleDeleteUserCsv: () => void;
|
20
|
+
handleDeleteUserCsv: () => Promise<boolean>;
|
21
|
+
handleChangeDeleteFile: (file?: File | undefined) => void;
|
22
|
+
handleChangePage: (_: any, page: number) => void;
|
23
|
+
setUserList: import("react").Dispatch<import("react").SetStateAction<User[]>>;
|
24
|
+
toggleConfirmDialog: () => void;
|
25
|
+
openDeleteDialog: (user: User) => void;
|
26
|
+
handleSort: _.DebouncedFunc<(key: UserSortColumn) => void>;
|
27
|
+
handleChangeSearchText: (e: ChangeEvent<HTMLInputElement>) => void;
|
28
|
+
handleOpenUserDialog: (user: User) => Promise<void>;
|
29
|
+
handleCreateOrUpdateUser: (value: UserForm) => Promise<void>;
|
30
|
+
handleCloseUserDialog: () => void;
|
31
|
+
handleDeleteUser: () => Promise<void>;
|
32
|
+
downloadTemplate: () => Promise<void>;
|
33
|
+
handleChooseFile: () => void;
|
34
|
+
handleChangeFileImport: (e: ChangeEvent<HTMLInputElement>) => Promise<void>;
|
35
|
+
recentUserActions: import("../../../utils/types").RecentUserActionResponse[] | undefined;
|
36
|
+
isOpenRecentUserActionDialog: boolean;
|
37
|
+
handleOpenRecentUserActionDialog: () => void;
|
38
|
+
handleCloseRecentUserActionDialog: () => void;
|
39
|
+
};
|
40
|
+
export default useUserList;
|
package/dist/index.css
CHANGED
@@ -1431,3 +1431,51 @@
|
|
1431
1431
|
|
1432
1432
|
._3rPGh {
|
1433
1433
|
page-break-inside: avoid; }
|
1434
|
+
|
1435
|
+
._2rJkZ {
|
1436
|
+
width: 42px;
|
1437
|
+
height: 42px; }
|
1438
|
+
|
1439
|
+
._1iqE2 {
|
1440
|
+
width: 100%; }
|
1441
|
+
._1iqE2 input {
|
1442
|
+
padding: 10px 12px; }
|
1443
|
+
|
1444
|
+
._20xtc input {
|
1445
|
+
padding: 10px 12px; }
|
1446
|
+
|
1447
|
+
._3L1Oj > div {
|
1448
|
+
margin-bottom: 0 !important; }
|
1449
|
+
|
1450
|
+
._1jXbz {
|
1451
|
+
border-radius: 50%;
|
1452
|
+
width: 36px;
|
1453
|
+
height: 36px;
|
1454
|
+
display: flex;
|
1455
|
+
justify-content: center;
|
1456
|
+
align-items: center;
|
1457
|
+
margin-inline: 0.25rem; }
|
1458
|
+
._1jXbz svg {
|
1459
|
+
width: 0.75rem; }
|
1460
|
+
._at4xP {
|
1461
|
+
stroke: #FFF;
|
1462
|
+
width: 1rem !important; }
|
1463
|
+
|
1464
|
+
._12gv9 {
|
1465
|
+
transform: rotate(180deg); }
|
1466
|
+
|
1467
|
+
._R4bn5 {
|
1468
|
+
border: 1px dashed #DDD;
|
1469
|
+
border-radius: 0.5rem;
|
1470
|
+
height: 200px;
|
1471
|
+
display: flex;
|
1472
|
+
justify-content: center;
|
1473
|
+
align-items: center;
|
1474
|
+
cursor: pointer; }
|
1475
|
+
._R4bn5 input {
|
1476
|
+
width: 100%;
|
1477
|
+
height: 100%; }
|
1478
|
+
|
1479
|
+
._8niRT {
|
1480
|
+
width: 42px;
|
1481
|
+
height: 42px; }
|
package/dist/index.d.ts
CHANGED
@@ -66,7 +66,7 @@ import { DEFAULT_PAGING_RESPONSE, PagingResponse } from "./utils/types/pagingRes
|
|
66
66
|
import AcademyList from "./containers/Academies/views/AcademyList";
|
67
67
|
import { getErrorMessage } from "./utils/getErrorMessage";
|
68
68
|
import getAcademyDomain from "./utils/getAcademyDomain";
|
69
|
-
import { getOrdinalSuffix } from './utils/helpers';
|
69
|
+
import { formatRole, getOrdinalSuffix, getRole } from './utils/helpers';
|
70
70
|
import { Language } from './utils/constants';
|
71
71
|
import useCountDownTimer from "./utils/hooks/useCountDownTimer";
|
72
72
|
import useLoadMore from "./utils/hooks/useLoadMore";
|
@@ -78,4 +78,9 @@ import { checkSuperUrl } from "./utils/types/checkSuperUrl";
|
|
78
78
|
import PrintExamResultView from "./containers/ExamResult/views/PrintExamResultView";
|
79
79
|
import PrintExamView2 from "./components/Print/PrintExamView2";
|
80
80
|
import LoginWithEmail from "./containers/Login/views/LoginWithEmail";
|
81
|
-
|
81
|
+
import ClassList from "./containers/Classes/views/ClassList";
|
82
|
+
import ClassDetail from "./containers/Classes/views/ClassDetail";
|
83
|
+
import UserList from "./containers/Users/views/UserList";
|
84
|
+
import NotificationDetail from "./containers/Notifications/views/NotificationDetail";
|
85
|
+
import NotificationList from "./containers/Notifications/views/NotificationList";
|
86
|
+
export { diffFromNow, formatTime, utcToLocalTime, setLoading, setReadyRegisterPusher, BASE_URL, SUPER_ADMIN_BASE_URL, ACCESS_TOKEN, Login, store, setAlert, setUser, Loading, NotFound, LayoutContext, api, apiUpload, ConfirmDialog, CommonDialog, LoginWithEmail, NotificationList, CustomPagination, useGoogleSignOut, RecentUserAction, PUSHER_CONFIG, ExamEvent, EXAM_CHANNEL, EXAM_STUDENT_CHANNEL, setLanguage, i18n, TheLanguageDropdown, PrintExamView2, TheAcademyDropdown, useTranslation, I18nextProvider, DATE_MIN_VALUE, DATE_TIME_MIN_VALUE, ACADEMY_DOMAIN, minutesToTimeSpan, toISOString, canAccessRoute, CustomSelect, NotificationDetail, CustomAsyncSelect, CustomSelectOption, LoginWithPassword, getRecentUserActionListApi, getAccessToken, ChatContainer, getOrdinalSuffix, IChatContainerProps, IChatItemProps, IChatHeaderProps, IInputChatProps, ChatItemType, useChatContainer, ConversationResponse, usePusherConversation, ExamResultV2, ToastContainer, toast, Role, useLanguage, useSwitchAcademy, LANGUAGES, CustomCreatable, moment, ExamDetailView, ExamDetailViewProps, Exam, Question, ArticleGroup, getAcademyDomain, useSubjectSelect, useLogin, useAutoAcademyDomain, createRecentUserActionListApi, LoginAccessTokenRequest, LoginRequest, setReFetchUserAcademies, ChatTypes, AcademyHeaders, Types, Enums, CoreHooks, Language, ArticleGroupView, AnswerCountSelector, QuestionCountSelector, ScoreSelector, ArticleCategorySelector, SubjectSelector, useCategorySelect, InputText, Textbook, TextbookDetail, TextbookList, timeUtils, Header, DEFAULT_PAGING_RESPONSE, PagingResponse, AcademyList, getErrorMessage, DefaultErrorMessage, useCountDownTimer, useLoadMore, useVirtualizeList, PassCodeCheck, PassCodeCheckProps, LoadingComponent, PrintExamResultView, checkSuperUrl, ClassList, ClassDetail, formatRole, getRole, UserList };
|