touchstudy-core 0.1.114 → 0.1.116

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.
@@ -1,7 +1,7 @@
1
1
  import { FormikProps } from "formik";
2
2
  import { ClassRequest, LessonRequest, TeacherSimpleResponse } from "./types";
3
3
  export interface ClassFormProps {
4
- id?: string;
4
+ classId?: number;
5
5
  history: any;
6
6
  formikProp: FormikProps<ClassRequest>;
7
7
  teachers: TeacherSimpleResponse[];
@@ -7,12 +7,13 @@ import { PagingResponse } from "../../../utils/types/pagingResponse";
7
7
  import { UserSortColumn } from "../../../utils/enums";
8
8
  import { Role } from "../../../utils";
9
9
  declare type DialogOpenType = "Student" | "Teacher" | "Lesson";
10
- declare const useClassDetail: ({ history, id, role }: {
10
+ declare const useClassDetail: ({ history, classId, role, classListUrl }: {
11
11
  history: any;
12
- id?: string | undefined;
12
+ classId: number;
13
13
  role: Role;
14
+ classListUrl: string;
14
15
  }) => {
15
- id: string | undefined;
16
+ classId: number;
16
17
  schema: import("yup").ObjectSchema<{
17
18
  name: string;
18
19
  startDate: Date;
@@ -30,7 +31,7 @@ declare const useClassDetail: ({ history, id, role }: {
30
31
  mainTeacherId: undefined;
31
32
  courseWeeklyDays: "";
32
33
  }, "">;
33
- isAdmin: boolean;
34
+ isDisabled: boolean;
34
35
  paging: PagingResponse;
35
36
  filter: import("../../../utils").BaseSearchQuery<UserSortColumn>;
36
37
  isTeacher: boolean;
@@ -5,11 +5,7 @@ export declare const signInApi: ({ email, password, role }: {
5
5
  password: string;
6
6
  role: string;
7
7
  }) => Promise<import("axios").AxiosResponse<any, any>>;
8
- export declare const signInWithEmailApi: ({ isAcademy, email, reCaptcha }: {
9
- isAcademy: boolean;
10
- email: string;
11
- reCaptcha: string;
12
- }) => Promise<import("axios").AxiosResponse<any, any>>;
8
+ export declare const signInWithEmailApi: ({ isAcademy, email, reCaptcha, role }: any) => Promise<import("axios").AxiosResponse<any, any>>;
13
9
  export declare const signInWithOTPApi: ({ isAcademy, otp, email, reCaptcha, role }: SignInOTPRequest) => Promise<import("axios").AxiosResponse<any, any>>;
14
10
  export declare const signInWithKeyApi: ({ isAcademy, key, role }: {
15
11
  isAcademy: boolean;
@@ -1,4 +1,4 @@
1
- import { Role } from './../../../utils/constants';
1
+ import { Role } from "./../../../utils/constants";
2
2
  declare type Props = {
3
3
  history: any;
4
4
  role?: Role;
@@ -3,13 +3,15 @@ import { Theme } from "@mui/material";
3
3
  import { PreparedFilterType, PreparedType, Textbook } from "../configs/types";
4
4
  declare type Props = {
5
5
  t: any;
6
+ user: any;
6
7
  theme: Theme;
7
8
  textbook: Textbook;
8
- isTeacher: boolean;
9
+ isStudent: boolean;
10
+ isSuperAdmin: boolean;
9
11
  navigate?: any;
10
12
  preparedType?: PreparedType;
11
13
  preparedFilterType?: PreparedFilterType;
12
14
  getTextbookList: () => void;
13
15
  };
14
- declare const Textbook: ({ t, theme, textbook, isTeacher, navigate, preparedType, preparedFilterType, getTextbookList }: Props) => React.JSX.Element;
16
+ declare const Textbook: ({ t, user, theme, textbook, isStudent, isSuperAdmin, navigate, preparedType, preparedFilterType, getTextbookList }: Props) => React.JSX.Element;
15
17
  export default Textbook;
@@ -3,11 +3,13 @@ import { PreparedType } from "../../../../utils";
3
3
  import { PreparedFilterType } from "../../configs/types";
4
4
  declare type Props = {
5
5
  isOpen: boolean;
6
+ user: any;
7
+ isSuperAdmin: boolean;
6
8
  onClose: Function;
7
9
  textbookId?: number;
8
10
  navigate?: any;
9
11
  preparedType?: PreparedType;
10
12
  preparedFilterType?: PreparedFilterType;
11
13
  };
12
- declare const TextbookInfoDrawer: ({ isOpen, onClose, textbookId, navigate, preparedType, preparedFilterType }: Props) => React.JSX.Element;
14
+ declare const TextbookInfoDrawer: ({ user, isSuperAdmin, isOpen, onClose, textbookId, navigate, preparedType, preparedFilterType }: Props) => React.JSX.Element;
13
15
  export default TextbookInfoDrawer;
@@ -126,6 +126,7 @@ export declare type Textbook = {
126
126
  subject?: Subject;
127
127
  totalQuestions?: number;
128
128
  subjectName?: string;
129
+ isShared?: boolean;
129
130
  isStudying?: boolean;
130
131
  totalUses: number;
131
132
  createdBy: Profile;
@@ -14,7 +14,10 @@ declare const usePreparedExam: ({ handleCloseExpand, preparedType, preparedFilte
14
14
  isKor: boolean;
15
15
  paging: PagingResponse;
16
16
  user: any;
17
+ isAdmin: any;
17
18
  isTeacher: any;
19
+ isStudent: any;
20
+ isSuperAdmin: any;
18
21
  monthOptions: {
19
22
  label: string | undefined;
20
23
  value: number;
@@ -47,6 +47,7 @@ export declare type Textbook = {
47
47
  grade: string;
48
48
  subject?: Subject;
49
49
  textbookOwners?: TextbookOwner[];
50
+ isPrepared?: boolean;
50
51
  };
51
52
  export declare type Academy = {
52
53
  id: number;
@@ -1,9 +1,9 @@
1
1
  import { Textbook } from "../configs/types";
2
2
  declare type Props = {
3
- navigate: any;
4
3
  textbookId?: string;
4
+ onNavigateList: () => void;
5
5
  };
6
- declare const useTextbookManagement: ({ navigate, textbookId }: Props) => {
6
+ declare const useTextbookManagement: ({ textbookId, onNavigateList }: Props) => {
7
7
  t: any;
8
8
  theme: import("@mui/material").Theme;
9
9
  history: History;
@@ -1,7 +1,8 @@
1
1
  import { FC } from "react";
2
2
  interface Props {
3
- navigate: any;
4
3
  textbookId?: string;
4
+ onNavigateList: () => void;
5
+ navigate: any;
5
6
  }
6
7
  export declare const PreparedTextbook: FC<Props>;
7
8
  export {};
@@ -1,6 +1,8 @@
1
1
  import React from "react";
2
+ import { TextbookResponse } from "../configs/types";
2
3
  declare type Props = {
3
- navigate: any;
4
+ onNavigteCreate: () => void;
5
+ onNavigateDetail: (data: TextbookResponse) => void;
4
6
  };
5
- declare const PreparedTextbookList: ({ navigate }: Props) => React.JSX.Element;
7
+ declare const PreparedTextbookList: ({ onNavigateDetail, onNavigteCreate }: Props) => React.JSX.Element;
6
8
  export default PreparedTextbookList;
@@ -18,8 +18,5 @@ export declare const TEXTBOOK_PAGE_TITLE: string;
18
18
  export declare const TEXT_BOOK_SEARCH_PLACEHOLDER: string;
19
19
  export declare const TEACHER_SEARCH_PLACEHOLDER: string;
20
20
  export declare const TextbookDefaultQuery: TextbookSearchQuery;
21
- export declare const TEXTBOOK_URL = "/teacher/teacher-admin/textbooks";
22
- export declare const ADMIN_TEXTBOOK_URL = "/textbooks";
23
- export declare const SUPER_ADMIN_TEXTBOOK_URL = "/personal/textbooks";
24
21
  export declare const DEFAULT_TEXTBOOK: TextbookDetailResponse;
25
22
  export declare const DEFAULT_ARTICLE_CREATE_REQUEST: ArticleCreateRequest;
@@ -72,6 +72,7 @@ export declare type TextbookDetailResponse = {
72
72
  chapters: ChapterResponse[];
73
73
  isCreatedByAdmin?: boolean;
74
74
  createdBy?: UserResponse;
75
+ isPrepared?: boolean;
75
76
  };
76
77
  export declare type UserResponse = {
77
78
  id: number;
@@ -12,8 +12,8 @@ declare const useTextbookList: (props: TextbookListProps) => {
12
12
  handleChangeSearchText: (e: import("react").ChangeEvent<HTMLInputElement>) => void;
13
13
  handleChangePage: (_: any, page: number) => void;
14
14
  calcOrderNumber: (index: number) => number;
15
- handleViewTextbook: (id: number) => void;
16
- handleUpdateTextbook: (id: number) => void;
15
+ handleViewTextbook: (data: TextbookResponse) => void;
16
+ handleUpdateTextbook: (data: TextbookResponse) => void;
17
17
  handleCreateTextbook: () => void;
18
18
  toggleConfirmDialog: () => void;
19
19
  handleDeleteTextbook: () => Promise<void>;
@@ -30,7 +30,8 @@ declare const useTextbookShare: (props: TextbookShareProps) => {
30
30
  isUpdate: boolean;
31
31
  handleUpdateSharedTextbook: (teacherIds: number[], textbookId: number) => Promise<void>;
32
32
  currentModel: TextbookResponse | undefined;
33
- handleDisable: (textbook: TextbookResponse) => any;
33
+ enabledSave: (textbook: TextbookResponse) => any;
34
+ enabledShare: (textbook: TextbookResponse) => any;
34
35
  isAdmin: any;
35
36
  isAdminSite: boolean;
36
37
  };
@@ -7,6 +7,8 @@ export interface TextbookDetailProps {
7
7
  id: string;
8
8
  isSuperAdmin: any;
9
9
  as?: any;
10
+ onNavigateDetail?: (data: any, readOnly?: boolean, replace?: boolean) => void;
11
+ onNavigateList: (replace?: boolean) => void;
10
12
  className?: string;
11
13
  }
12
14
  declare const TextbookViewDetail: FC<TextbookDetailProps>;
@@ -1,9 +1,12 @@
1
+ import { TextbookResponse } from "../configs/types";
1
2
  import { FC } from "react";
2
3
  import { Role } from "../../../utils/constants";
3
4
  export interface TextbookListProps {
4
5
  role: Role;
5
- navigate: any;
6
+ onNavigateCreate?: () => void;
7
+ onNavigateDetail: (data: TextbookResponse, readOnly?: boolean, replace?: boolean) => void;
6
8
  isSuperAdmin: any;
9
+ createable?: boolean;
7
10
  }
8
11
  declare const TextbookList: FC<TextbookListProps>;
9
12
  export default TextbookList;