touchstudy-core 0.1.85 → 0.1.87

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.
Files changed (62) hide show
  1. package/dist/components/CkEditor/CkEditor.d.ts +10 -0
  2. package/dist/components/CkEditor/config.d.ts +19 -0
  3. package/dist/components/ErrorHandler.d.ts +6 -0
  4. package/dist/components/LabelRequired.d.ts +8 -0
  5. package/dist/components/Selectors/ClassSelector.d.ts +10 -0
  6. package/dist/components/Selectors/StudentSelector.d.ts +10 -0
  7. package/dist/containers/Classes/apiClients/classService.d.ts +16 -0
  8. package/dist/containers/Classes/apiClients/teacherService.d.ts +2 -0
  9. package/dist/containers/Classes/components/ClassForm.d.ts +4 -0
  10. package/dist/containers/Classes/components/CorrectAnswerSelector.d.ts +7 -0
  11. package/dist/containers/Classes/components/LessonFormBody.d.ts +4 -0
  12. package/dist/containers/Classes/components/LessonFormDialog.d.ts +14 -0
  13. package/dist/containers/Classes/components/LessonList.d.ts +27 -0
  14. package/dist/containers/Classes/components/SelectDialog.d.ts +30 -0
  15. package/dist/containers/Classes/components/StudentList.d.ts +21 -0
  16. package/dist/containers/Classes/components/TeacherList.d.ts +21 -0
  17. package/dist/containers/Classes/components/TeacherSelector.d.ts +11 -0
  18. package/dist/containers/Classes/configs/constants.d.ts +70 -0
  19. package/dist/containers/Classes/configs/interfaces.d.ts +23 -0
  20. package/dist/containers/Classes/configs/types.d.ts +215 -0
  21. package/dist/containers/Classes/hooks/useClassDetail.d.ts +105 -0
  22. package/dist/containers/Classes/hooks/useClassList.d.ts +20 -0
  23. package/dist/containers/Classes/hooks/useLessonClassList.d.ts +20 -0
  24. package/dist/containers/Classes/hooks/useStudentClassList.d.ts +22 -0
  25. package/dist/containers/Classes/hooks/useTab.d.ts +5 -0
  26. package/dist/containers/Classes/hooks/useTeacherClassList.d.ts +22 -0
  27. package/dist/containers/Classes/hooks/useTeacherList.d.ts +6 -0
  28. package/dist/containers/Classes/views/ClassDetail.d.ts +10 -0
  29. package/dist/containers/Classes/views/ClassList.d.ts +10 -0
  30. package/dist/containers/Login/apiClient/index.d.ts +5 -2
  31. package/dist/containers/Login/hooks/useLogin.d.ts +4 -2
  32. package/dist/containers/Notifications/apiClients/notificationService.d.ts +6 -0
  33. package/dist/containers/Notifications/components/NotificationForm.d.ts +4 -0
  34. package/dist/containers/Notifications/components/SelectFilterType.d.ts +13 -0
  35. package/dist/containers/Notifications/components/TypeSelector.d.ts +13 -0
  36. package/dist/containers/Notifications/configs/constants.d.ts +14 -0
  37. package/dist/containers/Notifications/configs/interfaces.d.ts +10 -0
  38. package/dist/containers/Notifications/configs/types.d.ts +60 -0
  39. package/dist/containers/Notifications/hooks/useNotificationDetail.d.ts +23 -0
  40. package/dist/containers/Notifications/hooks/useNotificationList.d.ts +29 -0
  41. package/dist/containers/Notifications/views/NotificationDetail.d.ts +9 -0
  42. package/dist/containers/Notifications/views/NotificationList.d.ts +8 -0
  43. package/dist/containers/Users/apiClient/userService.d.ts +9 -0
  44. package/dist/containers/Users/components/Dialogs/DeleteUserCsvDialog.d.ts +10 -0
  45. package/dist/containers/Users/components/Dialogs/RecentUserActionDialog.d.ts +9 -0
  46. package/dist/containers/Users/components/Dialogs/UserDialog.d.ts +12 -0
  47. package/dist/containers/Users/configs/constants.d.ts +37 -0
  48. package/dist/containers/Users/configs/types.d.ts +11 -0
  49. package/dist/containers/Users/hooks/useExportUsersCsv.d.ts +5 -0
  50. package/dist/containers/Users/hooks/useRecentUserAction.d.ts +10 -0
  51. package/dist/containers/Users/hooks/useUserList.d.ts +40 -0
  52. package/dist/containers/Users/views/UserList.d.ts +7 -0
  53. package/dist/index.js +67 -34
  54. package/dist/index.js.map +1 -1
  55. package/dist/index.modern.js +67 -34
  56. package/dist/index.modern.js.map +1 -1
  57. package/dist/services/classService.d.ts +4 -0
  58. package/dist/services/studentService.d.ts +1 -0
  59. package/dist/utils/enums/userSortColumn.d.ts +11 -0
  60. package/dist/utils/toLocalTime.d.ts +1 -0
  61. package/dist/utils/types/users.d.ts +17 -0
  62. package/package.json +1 -1
@@ -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" | "Remove" | "Create" | 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,5 @@
1
+ declare const useTab: () => {
2
+ selected: number;
3
+ handleChangeTab: (newValue: number) => void;
4
+ };
5
+ export default useTab;
@@ -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;
@@ -0,0 +1,6 @@
1
+ import { TeacherSimpleResponse } from "../configs/types";
2
+ declare const useTeacherList: () => {
3
+ teachers: TeacherSimpleResponse[];
4
+ handleChangeTextSearch: (text: string) => void;
5
+ };
6
+ export default useTeacherList;
@@ -0,0 +1,10 @@
1
+ import { FC } from "react";
2
+ import { Role } from "../../../utils/constants";
3
+ interface Props {
4
+ id?: string;
5
+ classListUrl: string;
6
+ history: any;
7
+ role: Role;
8
+ }
9
+ declare const ClassDetail: FC<Props>;
10
+ export default ClassDetail;
@@ -0,0 +1,10 @@
1
+ import { FC } from "react";
2
+ import { Role } from "../../../utils/constants";
3
+ interface Props {
4
+ history: any;
5
+ role: Role;
6
+ classCreateUrl?: string;
7
+ classUpdateUrl?: string;
8
+ }
9
+ declare const ClassList: FC<Props>;
10
+ export default ClassList;
@@ -1,4 +1,3 @@
1
- import { SignInOTPRequest } from "../configs/types";
2
1
  export declare const getGoogleClientId: () => Promise<import("axios").AxiosResponse<any, any>>;
3
2
  export declare const signInApi: ({ email, password, role }: {
4
3
  email: string;
@@ -10,7 +9,11 @@ export declare const signInWithEmailApi: ({ academyDomain, email, reCaptcha }: {
10
9
  email: string;
11
10
  reCaptcha: string;
12
11
  }) => Promise<import("axios").AxiosResponse<any, any>>;
13
- export declare const signInWithOTPApi: ({ academyDomain, otp, email, reCaptcha, role }: SignInOTPRequest) => 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>>;
14
17
  export declare const signInWithKeyApi: ({ academyDomain, key, role }: {
15
18
  academyDomain: string;
16
19
  key: string;
@@ -1,6 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import { Role } from "../../../utils/constants";
3
- import { LoginEmailRequest } from "../configs/types";
4
3
  declare type LoginInfo = {
5
4
  email: string;
6
5
  otp: number | string;
@@ -27,7 +26,10 @@ declare const useLogin: ({ history, homeAcademyUrl, homeUrl, registerUrl, role }
27
26
  isShowPassword: boolean;
28
27
  setIsShowPassword: import("react").Dispatch<import("react").SetStateAction<boolean>>;
29
28
  infoUser: any;
30
- handleSubmit: (values: LoginEmailRequest) => Promise<void>;
29
+ handleSubmit: (values: {
30
+ email?: string;
31
+ otp?: number;
32
+ }) => Promise<void>;
31
33
  setInfoUser: import("react").Dispatch<any>;
32
34
  };
33
35
  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,4 @@
1
+ import { FC } from "react";
2
+ import { NotificationFormProps } from "../configs/interfaces";
3
+ declare const NotificationForm: FC<NotificationFormProps>;
4
+ export default NotificationForm;
@@ -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,8 @@
1
+ import React from "react";
2
+ import { Role } from "../../../utils/constants";
3
+ declare type Props = {
4
+ navigate: any;
5
+ role: Role;
6
+ };
7
+ declare const NotificationList: ({ navigate, role }: Props) => React.JSX.Element;
8
+ export default NotificationList;
@@ -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,11 @@
1
+ export declare type UserForm = {
2
+ fullName: string;
3
+ email: string;
4
+ phoneNumber: string;
5
+ schoolName?: string;
6
+ grade?: number | null;
7
+ major?: string;
8
+ parentName?: string;
9
+ parentPhoneNumber?: string;
10
+ roles?: string[];
11
+ };
@@ -0,0 +1,5 @@
1
+ import { UserSearchQuery } from "../../../utils/types/users";
2
+ declare const useExportUsersCsv: () => {
3
+ exportUsers: (filters: UserSearchQuery) => Promise<void>;
4
+ };
5
+ export default useExportUsersCsv;
@@ -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;
@@ -0,0 +1,7 @@
1
+ import { FC } from "react";
2
+ import { Role } from "../../../utils/constants";
3
+ interface Props {
4
+ role: Role;
5
+ }
6
+ declare const UserList: FC<Props>;
7
+ export default UserList;