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.
Files changed (70) 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 +2 -5
  31. package/dist/containers/Login/hooks/useLogin.d.ts +2 -4
  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.css +48 -0
  54. package/dist/index.d.ts +7 -2
  55. package/dist/index.js +5133 -59
  56. package/dist/index.js.map +1 -1
  57. package/dist/index.modern.js +5123 -56
  58. package/dist/index.modern.js.map +1 -1
  59. package/dist/services/classService.d.ts +4 -0
  60. package/dist/services/studentService.d.ts +1 -0
  61. package/dist/utils/enums/index.d.ts +2 -1
  62. package/dist/utils/enums/userSortColumn.d.ts +11 -0
  63. package/dist/utils/formatTime.d.ts +2 -0
  64. package/dist/utils/helpers.d.ts +3 -0
  65. package/dist/utils/hooks/useCountDownTimer.d.ts +0 -1
  66. package/dist/utils/toLocalTime.d.ts +1 -0
  67. package/dist/utils/types/index.d.ts +2 -1
  68. package/dist/utils/types/searchQuery.d.ts +7 -0
  69. package/dist/utils/types/users.d.ts +17 -0
  70. package/package.json +7 -3
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ interface Props {
3
+ ref?: any;
4
+ value: string;
5
+ onChange: any;
6
+ option?: any;
7
+ disabled: boolean;
8
+ }
9
+ declare const CkEditor: ({ ref, value, onChange, option, disabled }: Props) => React.JSX.Element;
10
+ export default CkEditor;
@@ -0,0 +1,19 @@
1
+ export declare const config: {
2
+ height: number;
3
+ allowedContent: boolean;
4
+ toolbar: (string | string[] | {
5
+ name: string;
6
+ groups: string[];
7
+ items: string[];
8
+ } | {
9
+ name: string;
10
+ items: string[];
11
+ groups?: undefined;
12
+ } | {
13
+ name: string;
14
+ groups?: undefined;
15
+ items?: undefined;
16
+ })[];
17
+ filebrowserImageUploadUrl: string;
18
+ filebrowserUploadUrl: string;
19
+ };
@@ -0,0 +1,6 @@
1
+ import { FC } from "react";
2
+ interface Props {
3
+ text: string;
4
+ }
5
+ declare const ErrorHandler: FC<Props>;
6
+ export default ErrorHandler;
@@ -0,0 +1,8 @@
1
+ import { FormLabelProps } from "@mui/material";
2
+ import { FC } from "react";
3
+ interface Props extends FormLabelProps {
4
+ text: string;
5
+ isRequired?: boolean;
6
+ }
7
+ declare const LabelRequired: FC<Props>;
8
+ export default LabelRequired;
@@ -0,0 +1,10 @@
1
+ import { FC } from "react";
2
+ interface Props {
3
+ value?: any;
4
+ onChange: any;
5
+ externalClassIds?: number[];
6
+ title?: string;
7
+ disabled?: boolean;
8
+ }
9
+ declare const ClassSelector: FC<Props>;
10
+ export default ClassSelector;
@@ -0,0 +1,10 @@
1
+ import { FC } from "react";
2
+ interface Props {
3
+ value?: any;
4
+ onChange: any;
5
+ externalStudentIds?: number[];
6
+ title?: string;
7
+ disabled: boolean;
8
+ }
9
+ declare const StudentSelector: FC<Props>;
10
+ export default StudentSelector;
@@ -0,0 +1,16 @@
1
+ import { ClassQuery, ClassRequestBody, LessonQuery, LessonRequestBody, StudentClassQuery } from "../configs/types";
2
+ export declare const getListClassApi: (query: ClassQuery) => Promise<import("axios").AxiosResponse<any, any>>;
3
+ export declare const getStudentClassApi: (classId: number, query: StudentClassQuery) => Promise<import("axios").AxiosResponse<any, any>>;
4
+ export declare const getTeacherClassApi: (classId: number, query: StudentClassQuery) => Promise<import("axios").AxiosResponse<any, any>>;
5
+ export declare const getLessonClassApi: (classId: number, query: LessonQuery) => Promise<import("axios").AxiosResponse<any, any>>;
6
+ export declare const createLessonClassApi: (classId: number, model: LessonRequestBody) => Promise<import("axios").AxiosResponse<any, any>>;
7
+ export declare const updateLessonClassApi: (classId: number, lessonId: number, model: LessonRequestBody) => Promise<import("axios").AxiosResponse<any, any>>;
8
+ export declare const deleteLessonClassApi: (classId: number, lessonId: number) => Promise<import("axios").AxiosResponse<any, any>>;
9
+ export declare const getClassByIdApi: (id: number) => Promise<import("axios").AxiosResponse<any, any>>;
10
+ export declare const createClassApi: (model: ClassRequestBody) => Promise<import("axios").AxiosResponse<any, any>>;
11
+ export declare const updateClassApi: (id: number, model: ClassRequestBody) => Promise<import("axios").AxiosResponse<any, any>>;
12
+ export declare const deleteClassApi: (id: number) => Promise<import("axios").AxiosResponse<any, any>>;
13
+ export declare const addStudentToClass: (id: number, studentIds: number[]) => Promise<import("axios").AxiosResponse<any, any>>;
14
+ export declare const removeStudentFromClass: (id: number, studentId: number) => Promise<import("axios").AxiosResponse<any, any>>;
15
+ export declare const addTeacherToClass: (id: number, teacherIds: number[]) => Promise<import("axios").AxiosResponse<any, any>>;
16
+ export declare const removeTeacherFromClass: (id: number, teacherId: number) => Promise<import("axios").AxiosResponse<any, any>>;
@@ -0,0 +1,2 @@
1
+ import { TeacherQuery } from "../configs/types";
2
+ export declare const getTeacherListApi: (query: TeacherQuery) => Promise<import("axios").AxiosResponse<any, any>>;
@@ -0,0 +1,4 @@
1
+ import { FC } from "react";
2
+ import { ClassFormProps } from "../configs/interfaces";
3
+ declare const ClassForm: FC<ClassFormProps>;
4
+ export default ClassForm;
@@ -0,0 +1,7 @@
1
+ import { FC } from "react";
2
+ interface Props {
3
+ innerProps?: any;
4
+ answerCount: number;
5
+ }
6
+ declare const CorrectAnswerSelector: FC<Props>;
7
+ export default CorrectAnswerSelector;
@@ -0,0 +1,4 @@
1
+ import { LessonFormProps } from "../configs/interfaces";
2
+ import { FC } from "react";
3
+ declare const LessonFormBody: FC<LessonFormProps>;
4
+ export default LessonFormBody;
@@ -0,0 +1,14 @@
1
+ import { LessonRequest, LessonResponse, TeacherSimpleResponse } from "../configs/types";
2
+ import { FC } from "react";
3
+ interface Props {
4
+ data?: LessonResponse;
5
+ open: boolean;
6
+ startDate?: any;
7
+ endDate?: any;
8
+ teachers: TeacherSimpleResponse[];
9
+ onSearchTeachers: (text: string) => void;
10
+ onClose: () => void;
11
+ onSubmit: (lesson: LessonRequest) => void;
12
+ }
13
+ declare const LessonFormDialog: FC<Props>;
14
+ export default LessonFormDialog;
@@ -0,0 +1,27 @@
1
+ import { LessonQuery, LessonRequest, LessonResponse, LessonSortBy, TeacherSimpleResponse } from "../configs/types";
2
+ import { ChangeEvent, FC } from "react";
3
+ import { DialogType } from "../hooks/useLessonClassList";
4
+ import { PagingResponse } from "../../../utils/types/pagingResponse";
5
+ interface Props {
6
+ openDialog?: DialogType;
7
+ paging: PagingResponse;
8
+ classList: LessonResponse[];
9
+ filter: LessonQuery;
10
+ startDate?: any;
11
+ endDate?: any;
12
+ t: any;
13
+ selectedLesson: LessonResponse | undefined;
14
+ teachers: TeacherSimpleResponse[];
15
+ disabled?: boolean;
16
+ onSearchTeachers: (text: string) => void;
17
+ handleOpenDeleteClassDialog: (value: LessonResponse) => void;
18
+ handleCloseConfirmDialog: () => void;
19
+ handleSort: (key: LessonSortBy) => void;
20
+ handleChangeSearchText: (e: ChangeEvent<HTMLInputElement>) => void;
21
+ handleChangePage: (_: any, page: number) => void;
22
+ handleDeleteLessonClass: () => Promise<void>;
23
+ handleCreateOrUpdateLesson: (lesson: LessonRequest) => void;
24
+ handleOpenCreateOrUpdateDialog: (value?: LessonResponse) => void;
25
+ }
26
+ declare const LessonList: FC<Props>;
27
+ export default LessonList;
@@ -0,0 +1,30 @@
1
+ import { ChangeEvent, FC, RefObject } from "react";
2
+ import { PagingResponse } from "../../../utils/types/pagingResponse";
3
+ import React from "react";
4
+ import { UserSortColumn } from "../../../utils/enums";
5
+ import { UserSearchQuery } from "../../../utils/types/users";
6
+ interface Props {
7
+ open: boolean;
8
+ title: string;
9
+ submitText: string;
10
+ onClose: () => void;
11
+ onSubmit: (userIds: number[]) => void;
12
+ isStudent: boolean;
13
+ paging: PagingResponse;
14
+ filter: UserSearchQuery;
15
+ selected: number[];
16
+ userList: any;
17
+ isCheckAll: (userList: any, userLength: number) => boolean;
18
+ isSelected: (id: number) => boolean;
19
+ numSelected: number;
20
+ textSearchRef: RefObject<HTMLInputElement>;
21
+ handleFetchUsers: () => void;
22
+ handleSort: (key: UserSortColumn) => void;
23
+ handleChangeSearchText: (e: ChangeEvent<HTMLInputElement>) => void;
24
+ handleClickCheckbox: (event: React.MouseEvent<unknown>, id: number) => void;
25
+ handleChangePage: (_: any, page: number) => void;
26
+ handleClear: () => void;
27
+ handleSelectAllClick: (event: React.ChangeEvent<HTMLInputElement>, users: any) => void;
28
+ }
29
+ declare const SelectDialog: FC<Props>;
30
+ export default SelectDialog;
@@ -0,0 +1,21 @@
1
+ import { StudentClassQuery, StudentClassResponse, UserClassSortBy } from "../configs/types";
2
+ import { ChangeEvent, FC, RefObject } from "react";
3
+ import { PagingResponse } from "../../../utils/types/pagingResponse";
4
+ interface Props {
5
+ onAdd?: Function;
6
+ paging: PagingResponse;
7
+ classList: StudentClassResponse[];
8
+ filter: StudentClassQuery;
9
+ t: any;
10
+ selectedStudent: StudentClassResponse | undefined;
11
+ textSearchRef: RefObject<HTMLInputElement> | null;
12
+ disabled?: boolean;
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
+ }
20
+ declare const StudentList: FC<Props>;
21
+ export default StudentList;
@@ -0,0 +1,21 @@
1
+ import { StudentClassQuery, UserClassSortBy, TeacherClassResponse } from "../configs/types";
2
+ import { ChangeEvent, FC, RefObject } from "react";
3
+ import { PagingResponse } from "../../../utils/types/pagingResponse";
4
+ interface Props {
5
+ onAdd?: Function;
6
+ paging: PagingResponse;
7
+ classList: TeacherClassResponse[];
8
+ filter: StudentClassQuery;
9
+ t: any;
10
+ selectedTeacher: TeacherClassResponse | undefined;
11
+ textSearchRef: RefObject<HTMLInputElement> | null;
12
+ disabled?: boolean;
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
+ }
20
+ declare const TeacherList: FC<Props>;
21
+ export default TeacherList;
@@ -0,0 +1,11 @@
1
+ import { FC } from "react";
2
+ import { Option, TeacherSimpleResponse } from "../configs/types";
3
+ interface Props {
4
+ teachers: TeacherSimpleResponse[];
5
+ value?: number | null;
6
+ onChange: (val: Option | null) => void;
7
+ onInputChange: (inputText: string) => void;
8
+ isDisabled?: boolean;
9
+ }
10
+ declare const TeacherSelector: FC<Props>;
11
+ export default TeacherSelector;
@@ -0,0 +1,70 @@
1
+ import * as yup from "yup";
2
+ import { ClassHeaderTable, ClassQuery, ClassRequest, QuestionColumn, StudentClassQuery, DayOfWeek, LessonQuery, LessonClassHeaderTable, LessonRequest, TeacherQuery, UserClassHeaderTable } from "./types";
3
+ import { UserSortColumn } from "../../../utils/enums";
4
+ import { UserSearchQuery } from "../../../utils/types/users";
5
+ export declare const CLASS_HEADERS: ClassHeaderTable[];
6
+ export declare const USER_HEADERS: ({
7
+ title: string;
8
+ sortKey?: undefined;
9
+ } | {
10
+ title: string;
11
+ sortKey: UserSortColumn;
12
+ })[];
13
+ export declare const DefaultClassFilter: ClassQuery;
14
+ export declare const DefaultStudentClassFilter: StudentClassQuery;
15
+ export declare const DefaultLessonFilter: LessonQuery;
16
+ export declare const DefaultTeacherFilter: TeacherQuery;
17
+ export declare const CLASS_QUESTIONS: number[];
18
+ export declare const DEFAULT_CLASS_REQUEST: ClassRequest;
19
+ export declare const DATE_TIME_FORMAT = "YYYY-MM-DDTHH:mm:ss";
20
+ export declare const DEFAULT_LESSON_REQUEST: LessonRequest;
21
+ export declare const ClassSchema: (t: any) => yup.ObjectSchema<{
22
+ name: string;
23
+ startDate: Date;
24
+ endDate: Date;
25
+ mainTeacherId: number;
26
+ courseWeeklyDays: {
27
+ dayOfWeek: any;
28
+ startTime: any;
29
+ endTime: any;
30
+ }[] | undefined;
31
+ }, yup.AnyObject, {
32
+ name: undefined;
33
+ startDate: undefined;
34
+ endDate: undefined;
35
+ mainTeacherId: undefined;
36
+ courseWeeklyDays: "";
37
+ }, "">;
38
+ export declare const LessonSchema: (t: any) => yup.ObjectSchema<{
39
+ date: Date;
40
+ startTime: string;
41
+ endTime: string;
42
+ mainTeacherId: number;
43
+ }, yup.AnyObject, {
44
+ date: undefined;
45
+ startTime: undefined;
46
+ endTime: undefined;
47
+ mainTeacherId: undefined;
48
+ }, "">;
49
+ export declare const QUESTION_HEADER_COLUMNS: QuestionColumn[];
50
+ export declare const ANSWERS_COUNT: number[];
51
+ export declare const MAX_ANSWERS_COUNT = 10;
52
+ export declare const CLASS_INFORMATION_FORM = "CLASS_INFORMATION_FORM";
53
+ export declare const STUDENT_CLASS_HEADERS: UserClassHeaderTable[];
54
+ export declare const TEACHER_CLASS_HEADERS: UserClassHeaderTable[];
55
+ export declare const LESSON_CLASS_HEADERS: LessonClassHeaderTable[];
56
+ export declare const DayOfWeekOptions: (t: any) => {
57
+ label: any;
58
+ value: DayOfWeek;
59
+ }[];
60
+ export declare const dayOfWeekStrings: any;
61
+ export declare const TabList: ({
62
+ label: string;
63
+ value: number;
64
+ key?: undefined;
65
+ } | {
66
+ label: string;
67
+ key: string;
68
+ value: number;
69
+ })[];
70
+ export declare const DEFAULT_USER_FILTERS: UserSearchQuery;
@@ -0,0 +1,23 @@
1
+ import { FormikProps } from "formik";
2
+ import { ClassRequest, LessonRequest, TeacherSimpleResponse } from "./types";
3
+ export interface ClassFormProps {
4
+ id?: string;
5
+ history: any;
6
+ formikProp: FormikProps<ClassRequest>;
7
+ teachers: TeacherSimpleResponse[];
8
+ onSearchTeachers: (text: string) => void;
9
+ data?: ClassRequest;
10
+ disabled?: boolean;
11
+ classListUrl: string;
12
+ }
13
+ export interface LessonFormProps {
14
+ id?: number;
15
+ open: boolean;
16
+ formikProp: FormikProps<LessonRequest>;
17
+ startDate?: any;
18
+ endDate?: any;
19
+ data?: LessonRequest;
20
+ teachers: TeacherSimpleResponse[];
21
+ onSearchTeachers: (text: string) => void;
22
+ onClose: () => void;
23
+ }
@@ -0,0 +1,215 @@
1
+ export declare type ClassResponse = {
2
+ id?: number;
3
+ name: string;
4
+ startDate: string;
5
+ endDate: string;
6
+ totalStudents: number;
7
+ totalTeachers: number;
8
+ totalLessons: number;
9
+ mainTeacherId: number;
10
+ courseWeeklyDays: WeeklyDayResponse[];
11
+ };
12
+ export declare type StudentClassResponse = {
13
+ id?: number;
14
+ studentId: number;
15
+ studentName: string;
16
+ studentEmail: string;
17
+ studentPhoneNumber?: string;
18
+ roles: Array<string>;
19
+ paymentTime?: string;
20
+ createdAt?: string;
21
+ studentCreatedAt?: string;
22
+ };
23
+ export declare type TeacherClassResponse = {
24
+ teacherId: number;
25
+ teacherName: string;
26
+ roles: Array<string>;
27
+ teacherEmail: string;
28
+ teacherPhoneNumber?: string;
29
+ teacherCreatedAt?: string;
30
+ };
31
+ export declare type Question = {
32
+ id: number;
33
+ answerCount: number;
34
+ correctAnswers: number[];
35
+ };
36
+ export declare type QuestionResponse = {
37
+ id: number;
38
+ answerCount: number;
39
+ correctAnswers: string;
40
+ };
41
+ export declare enum ClassType {
42
+ Normal = "Normal",
43
+ Standard = "Standard"
44
+ }
45
+ export declare type ClassRequest = {
46
+ id?: number | string;
47
+ name: string;
48
+ startDate: moment.Moment | null;
49
+ endDate: moment.Moment | null;
50
+ mainTeacherId: number | null;
51
+ courseWeeklyDays: WeeklyDayRequest[];
52
+ };
53
+ export declare type ClassRequestBody = {
54
+ name: string;
55
+ startDate: string;
56
+ endDate: string;
57
+ mainTeacherId: number;
58
+ courseWeeklyDays: WeeklyDayRequestBody[];
59
+ };
60
+ export declare type WeeklyDayRequest = {
61
+ dayOfWeek: DayOfWeek;
62
+ startTime: moment.Moment | null;
63
+ endTime: moment.Moment | null;
64
+ };
65
+ export declare type WeeklyDayRequestBody = {
66
+ dayOfWeek: DayOfWeek;
67
+ startTime: string;
68
+ endTime: string;
69
+ };
70
+ export declare type WeeklyDayResponse = {
71
+ dayOfWeek: DayOfWeek;
72
+ startTime: string;
73
+ endTime: string;
74
+ };
75
+ export declare type LessonResponse = {
76
+ id: number;
77
+ startTime: string;
78
+ endTime: string;
79
+ mainTeacherId: number;
80
+ mainTeacherUserId: number;
81
+ mainTeacherName: string;
82
+ mainTeacherEmail: string;
83
+ date: string;
84
+ isCancelled: boolean;
85
+ };
86
+ export declare type LessonRequest = {
87
+ startTime: moment.Moment | null;
88
+ endTime: moment.Moment | null;
89
+ mainTeacherId: number | null;
90
+ date: moment.Moment | null;
91
+ isCancelled: boolean;
92
+ };
93
+ export declare type LessonRequestBody = {
94
+ startTime: string;
95
+ endTime: string;
96
+ mainTeacherId: number | null;
97
+ date: string;
98
+ isCancelled: boolean;
99
+ };
100
+ export declare enum DayOfWeek {
101
+ Sunday = 0,
102
+ Monday = 1,
103
+ Tuesday = 2,
104
+ Wednesday = 3,
105
+ Thursday = 4,
106
+ Friday = 5,
107
+ Saturday = 6
108
+ }
109
+ export declare type QuestionRequest = {
110
+ numberOfAnswers: number;
111
+ correctAnswers: number[];
112
+ score?: number;
113
+ categoryId?: number;
114
+ id?: number;
115
+ article?: number;
116
+ };
117
+ export declare type QuestionColumn = {
118
+ name: string;
119
+ width?: string | number;
120
+ };
121
+ export declare type ClassGenerateRequest = {
122
+ numberOfQuestions?: string;
123
+ numberOfArticles?: string;
124
+ };
125
+ export declare type ClassQuery = {
126
+ currentPage: number;
127
+ pageSize: number;
128
+ sortColumnName: ClassSortBy;
129
+ textSearch?: string;
130
+ sortColumnDirection: OrderBy;
131
+ statuses?: ClassStatus[];
132
+ };
133
+ export declare type StudentClassQuery = {
134
+ currentPage: number;
135
+ pageSize: number;
136
+ sortColumnName: UserClassSortBy;
137
+ textSearch?: string;
138
+ sortColumnDirection: OrderBy;
139
+ isInCourse?: boolean;
140
+ };
141
+ export declare type LessonQuery = {
142
+ currentPage: number;
143
+ pageSize: number;
144
+ sortColumnName: LessonSortBy;
145
+ textSearch: string;
146
+ sortColumnDirection: OrderBy;
147
+ };
148
+ export declare type TeacherQuery = {
149
+ currentPage: number;
150
+ pageSize: number;
151
+ sortColumnName: TeacherSortBy;
152
+ textSearch: string;
153
+ sortColumnDirection: OrderBy;
154
+ };
155
+ export declare enum TeacherSortBy {
156
+ Name = "UserProfile.FullName",
157
+ Email = "UserProfile.Email"
158
+ }
159
+ export declare enum ClassStatus {
160
+ Default = "Default",
161
+ Pending = "Pending",
162
+ Inprogress = "Inprogress",
163
+ Completed = "Completed"
164
+ }
165
+ export declare enum ClassStatusNumber {
166
+ Default = 0,
167
+ Pending = 1,
168
+ Inprogress = 2,
169
+ Completed = 3
170
+ }
171
+ export declare enum ClassSortBy {
172
+ CreatedAt = "CreatedAt",
173
+ EndDate = "EndDate",
174
+ Name = "Name",
175
+ StartDate = "StartDate"
176
+ }
177
+ export declare enum UserClassSortBy {
178
+ CreatedAt = "CreatedAt",
179
+ PhoneNumber = "PhoneNumber",
180
+ FullName = "FullName",
181
+ Email = "Email"
182
+ }
183
+ export declare enum LessonSortBy {
184
+ CreatedAt = "CreatedAt",
185
+ Date = "Date",
186
+ IsCancelled = "IsCancelled",
187
+ StartTime = "StartTime",
188
+ EndTime = "EndTime"
189
+ }
190
+ export declare enum OrderBy {
191
+ ASC = "ASC",
192
+ DESC = "DESC"
193
+ }
194
+ export declare type ClassHeaderTable = {
195
+ title: string;
196
+ sortKey?: ClassSortBy;
197
+ };
198
+ export declare type UserClassHeaderTable = {
199
+ title: string;
200
+ sortKey?: UserClassSortBy;
201
+ };
202
+ export declare type LessonClassHeaderTable = {
203
+ title: string;
204
+ sortKey?: LessonSortBy;
205
+ };
206
+ export declare type TeacherSimpleResponse = {
207
+ id: number;
208
+ teacherUserId: number;
209
+ teacherName: string;
210
+ teacherEmail: string;
211
+ };
212
+ export declare type Option = {
213
+ label: string;
214
+ value: number | string;
215
+ };
@@ -0,0 +1,105 @@
1
+ /// <reference types="yup" />
2
+ import { FormikHelpers } from "formik";
3
+ import _ from "lodash";
4
+ import { ChangeEvent } from "react";
5
+ import { ClassResponse, StudentClassResponse, TeacherClassResponse, ClassRequest, LessonRequest } from "../configs/types";
6
+ import { PagingResponse } from "../../../utils/types/pagingResponse";
7
+ import { UserSortColumn } from "../../../utils/enums";
8
+ declare type DialogOpenType = "Student" | "Teacher" | "Lesson";
9
+ declare const useClassDetail: (history: any, id?: string | undefined) => {
10
+ id: string | undefined;
11
+ schema: import("yup").ObjectSchema<{
12
+ name: string;
13
+ startDate: Date;
14
+ endDate: Date;
15
+ mainTeacherId: number;
16
+ courseWeeklyDays: {
17
+ dayOfWeek: any;
18
+ startTime: any;
19
+ endTime: any;
20
+ }[] | undefined;
21
+ }, import("yup").AnyObject, {
22
+ name: undefined;
23
+ startDate: undefined;
24
+ endDate: undefined;
25
+ mainTeacherId: undefined;
26
+ courseWeeklyDays: "";
27
+ }, "">;
28
+ paging: PagingResponse;
29
+ filter: import("../../../utils/types/searchQuery").BaseSearchQuery<UserSortColumn>;
30
+ listUserSelected: number[];
31
+ isSelected: (id: number) => boolean;
32
+ textSearchRef: import("react").RefObject<HTMLInputElement>;
33
+ numSelected: number;
34
+ handleClickCheckbox: (_: React.MouseEvent<unknown>, id: number) => void;
35
+ handleChangePage: (_: any, page: number) => void;
36
+ handleClear: () => void;
37
+ handleSort: (key: UserSortColumn) => void;
38
+ handleChangeSearchText: (e: ChangeEvent<HTMLInputElement>) => void;
39
+ handleSelectAllClick: (event: React.ChangeEvent<HTMLInputElement>, users: any) => void;
40
+ debounceSort: _.DebouncedFunc<(key: UserSortColumn) => void>;
41
+ isCheckAll: (userList: any, userLength: number) => boolean;
42
+ handleFetchUsers: () => void;
43
+ course: ClassResponse | undefined;
44
+ userList: StudentClassResponse[] | TeacherClassResponse[];
45
+ teacherOptions: import("../configs/types").TeacherSimpleResponse[];
46
+ studentListProps: {
47
+ paging: PagingResponse;
48
+ classList: StudentClassResponse[];
49
+ filter: import("../configs/types").StudentClassQuery;
50
+ selectedStudent: StudentClassResponse | undefined;
51
+ t: any;
52
+ textSearchRef: import("react").RefObject<HTMLInputElement>;
53
+ debounceSearch: _.DebouncedFunc<() => void>;
54
+ handleOpenDeleteClassDialog: (value: StudentClassResponse) => void;
55
+ handleCloseConfirmDialog: () => void;
56
+ handleSort: (key: import("../configs/types").UserClassSortBy) => void;
57
+ handleChangeSearchText: (e: ChangeEvent<HTMLInputElement>) => void;
58
+ handleChangePage: (_: any, page: number) => void;
59
+ handleRemoveStudentFromClass: () => Promise<void>;
60
+ resetData: () => void;
61
+ };
62
+ teacherListProps: {
63
+ paging: PagingResponse;
64
+ classList: TeacherClassResponse[];
65
+ filter: import("../configs/types").StudentClassQuery;
66
+ selectedTeacher: TeacherClassResponse | undefined;
67
+ t: any;
68
+ textSearchRef: import("react").RefObject<HTMLInputElement>;
69
+ debounceSearch: _.DebouncedFunc<() => void>;
70
+ handleOpenDeleteClassDialog: (value: TeacherClassResponse) => void;
71
+ handleCloseConfirmDialog: () => void;
72
+ handleSort: (key: import("../configs/types").UserClassSortBy) => void;
73
+ handleChangeSearchText: (e: ChangeEvent<HTMLInputElement>) => void;
74
+ handleChangePage: (_: any, page: number) => void;
75
+ handleRemoveTeacherFromClass: () => Promise<void>;
76
+ resetData: () => void;
77
+ };
78
+ lessonListProps: {
79
+ paging: PagingResponse;
80
+ classList: import("../configs/types").LessonResponse[];
81
+ filter: import("../configs/types").LessonQuery;
82
+ selectedLesson: import("../configs/types").LessonResponse | undefined;
83
+ openDialog: "Update" | "Create" | "Remove" | undefined;
84
+ t: any;
85
+ handleOpenCreateOrUpdateDialog: (value?: import("../configs/types").LessonResponse | undefined) => void;
86
+ handleOpenDeleteClassDialog: (value: import("../configs/types").LessonResponse) => void;
87
+ handleCloseConfirmDialog: () => void;
88
+ handleSort: (key: import("../configs/types").LessonSortBy) => void;
89
+ handleChangeSearchText: (e: ChangeEvent<HTMLInputElement>) => void;
90
+ handleChangePage: (_: any, page: number) => void;
91
+ };
92
+ openSelectDialog: "Student" | "Teacher" | "Lesson" | undefined;
93
+ classRequest: ClassRequest | undefined;
94
+ handleChangeTextSearchTeachers: (text: string) => void;
95
+ handleCloseSelectDialog: () => void;
96
+ handleSubmit: (values: ClassRequest, _: FormikHelpers<ClassRequest>) => Promise<void>;
97
+ handleOpenSelectDialog: (type: DialogOpenType) => void;
98
+ handleAddToClass: (userIds: number[]) => Promise<void>;
99
+ handleDeleteLessonClass: () => Promise<void>;
100
+ handleCreateOrUpdateLesson: (lesson: LessonRequest) => Promise<void>;
101
+ getStudents: () => Promise<void>;
102
+ getLessons: () => Promise<void>;
103
+ getTeachers: () => Promise<void>;
104
+ };
105
+ export default useClassDetail;