touchstudy-core 0.1.87 → 0.1.89

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.
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ declare const ReleaseAlert: () => React.JSX.Element | null;
3
+ export default ReleaseAlert;
@@ -0,0 +1,2 @@
1
+ import ReleaseAlert from "./ReleaseAlert";
2
+ export { ReleaseAlert };
@@ -9,3 +9,4 @@ export declare type Language = {
9
9
  };
10
10
  export declare const LANGUAGES: Language[];
11
11
  export declare const DEFAULT_LANGUAGE: Language;
12
+ export declare const LOGIN_URL = "/login";
@@ -9,7 +9,7 @@ interface Props {
9
9
  t: any;
10
10
  selectedStudent: StudentClassResponse | undefined;
11
11
  textSearchRef: RefObject<HTMLInputElement> | null;
12
- disabled?: boolean;
12
+ isOneRoleExists?: boolean;
13
13
  handleOpenDeleteClassDialog: (value: StudentClassResponse) => void;
14
14
  handleCloseConfirmDialog: () => void;
15
15
  handleSort: (key: UserClassSortBy) => void;
@@ -4,9 +4,14 @@ import _ from "lodash";
4
4
  import { ChangeEvent } from "react";
5
5
  import { ClassResponse, StudentClassResponse, TeacherClassResponse, ClassRequest, LessonRequest } from "../configs/types";
6
6
  import { PagingResponse } from "../../../utils/types/pagingResponse";
7
+ import { Role } from "../../..";
7
8
  import { UserSortColumn } from "../../../utils/enums";
8
9
  declare type DialogOpenType = "Student" | "Teacher" | "Lesson";
9
- declare const useClassDetail: (history: any, id?: string | undefined) => {
10
+ declare const useClassDetail: ({ history, id, role }: {
11
+ history: any;
12
+ id?: string | undefined;
13
+ role: Role;
14
+ }) => {
10
15
  id: string | undefined;
11
16
  schema: import("yup").ObjectSchema<{
12
17
  name: string;
@@ -25,6 +30,7 @@ declare const useClassDetail: (history: any, id?: string | undefined) => {
25
30
  mainTeacherId: undefined;
26
31
  courseWeeklyDays: "";
27
32
  }, "">;
33
+ isAdmin: boolean;
28
34
  paging: PagingResponse;
29
35
  filter: import("../../../utils/types/searchQuery").BaseSearchQuery<UserSortColumn>;
30
36
  listUserSelected: number[];
@@ -43,6 +49,7 @@ declare const useClassDetail: (history: any, id?: string | undefined) => {
43
49
  course: ClassResponse | undefined;
44
50
  userList: StudentClassResponse[] | TeacherClassResponse[];
45
51
  teacherOptions: import("../configs/types").TeacherSimpleResponse[];
52
+ isOneRoleExists: boolean;
46
53
  studentListProps: {
47
54
  paging: PagingResponse;
48
55
  classList: StudentClassResponse[];
@@ -80,7 +87,7 @@ declare const useClassDetail: (history: any, id?: string | undefined) => {
80
87
  classList: import("../configs/types").LessonResponse[];
81
88
  filter: import("../configs/types").LessonQuery;
82
89
  selectedLesson: import("../configs/types").LessonResponse | undefined;
83
- openDialog: "Update" | "Remove" | "Create" | undefined;
90
+ openDialog: "Update" | "Create" | "Remove" | undefined;
84
91
  t: any;
85
92
  handleOpenCreateOrUpdateDialog: (value?: import("../configs/types").LessonResponse | undefined) => void;
86
93
  handleOpenDeleteClassDialog: (value: import("../configs/types").LessonResponse) => void;
@@ -7,7 +7,7 @@ declare const useLessonClassList: (courseId: number) => {
7
7
  classList: LessonResponse[];
8
8
  filter: LessonQuery;
9
9
  selectedLesson: LessonResponse | undefined;
10
- openDialog: "Update" | "Remove" | "Create" | undefined;
10
+ openDialog: "Update" | "Create" | "Remove" | undefined;
11
11
  t: any;
12
12
  handleOpenCreateOrUpdateDialog: (value?: LessonResponse | undefined) => void;
13
13
  handleOpenDeleteClassDialog: (value: LessonResponse) => void;
@@ -1,3 +1,4 @@
1
+ import { SignInOTPRequest } from "../configs/types";
1
2
  export declare const getGoogleClientId: () => Promise<import("axios").AxiosResponse<any, any>>;
2
3
  export declare const signInApi: ({ email, password, role }: {
3
4
  email: string;
@@ -9,11 +10,7 @@ export declare const signInWithEmailApi: ({ academyDomain, email, reCaptcha }: {
9
10
  email: string;
10
11
  reCaptcha: string;
11
12
  }) => Promise<import("axios").AxiosResponse<any, any>>;
12
- export declare const signInWithOTPApi: ({ academyDomain, otp, role }: {
13
- academyDomain: string;
14
- otp: number;
15
- role?: string | undefined;
16
- }) => Promise<import("axios").AxiosResponse<any, any>>;
13
+ export declare const signInWithOTPApi: ({ academyDomain, otp, email, reCaptcha, role }: SignInOTPRequest) => Promise<import("axios").AxiosResponse<any, any>>;
17
14
  export declare const signInWithKeyApi: ({ academyDomain, key, role }: {
18
15
  academyDomain: string;
19
16
  key: string;
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { Role } from "../../../utils/constants";
3
+ import { LoginEmailRequest } from "../configs/types";
3
4
  declare type LoginInfo = {
4
5
  email: string;
5
6
  otp: number | string;
@@ -26,10 +27,7 @@ declare const useLogin: ({ history, homeAcademyUrl, homeUrl, registerUrl, role }
26
27
  isShowPassword: boolean;
27
28
  setIsShowPassword: import("react").Dispatch<import("react").SetStateAction<boolean>>;
28
29
  infoUser: any;
29
- handleSubmit: (values: {
30
- email?: string;
31
- otp?: number;
32
- }) => Promise<void>;
30
+ handleSubmit: (values: LoginEmailRequest) => Promise<void>;
33
31
  setInfoUser: import("react").Dispatch<any>;
34
32
  };
35
33
  export default useLogin;
package/dist/index.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,10 @@ 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
- 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, 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, 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 };
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 * from "./components/Alerts";
87
+ 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 };