touchstudy-core 0.1.95 → 0.1.97
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/containers/Classes/components/StudentList.d.ts +1 -1
- package/dist/containers/Classes/hooks/useClassDetail.d.ts +1 -0
- package/dist/containers/Textbooks/apiClient/teacherService.d.ts +2 -0
- package/dist/containers/Textbooks/components/ShareToTeacherDialog.d.ts +27 -0
- package/dist/containers/Textbooks/hooks/useTextbookShare.d.ts +32 -0
- package/dist/index.js +23 -23
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +23 -23
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
@@ -9,7 +9,7 @@ interface Props {
|
|
9
9
|
t: any;
|
10
10
|
selectedStudent: StudentClassResponse | undefined;
|
11
11
|
textSearchRef: RefObject<HTMLInputElement> | null;
|
12
|
-
|
12
|
+
disabled?: boolean;
|
13
13
|
handleOpenDeleteClassDialog: (value: StudentClassResponse) => void;
|
14
14
|
handleCloseConfirmDialog: () => void;
|
15
15
|
handleSort: (key: UserClassSortBy) => void;
|
@@ -33,6 +33,7 @@ declare const useClassDetail: ({ history, id, role }: {
|
|
33
33
|
isAdmin: boolean;
|
34
34
|
paging: PagingResponse;
|
35
35
|
filter: import("../../../utils/types/searchQuery").BaseSearchQuery<UserSortColumn>;
|
36
|
+
isTeacher: boolean;
|
36
37
|
listUserSelected: number[];
|
37
38
|
isSelected: (id: number) => boolean;
|
38
39
|
textSearchRef: import("react").RefObject<HTMLInputElement>;
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import React, { FC } from "react";
|
2
|
+
import { TeacherSimpleResponse } from "../configs/types";
|
3
|
+
import { SearchQuery } from "../../../utils/types/searchQuery";
|
4
|
+
import { PagingResponse } from "../../../utils/types/pagingResponse";
|
5
|
+
interface Props {
|
6
|
+
open: boolean;
|
7
|
+
selectedShare: number[];
|
8
|
+
textSearchShareRef: React.RefObject<HTMLInputElement>;
|
9
|
+
handleChangeSearchTextShare: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
10
|
+
numSelectedShare: number;
|
11
|
+
isCheckAllShare: (userLength: number) => boolean;
|
12
|
+
handleSelectAllClickShare: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
13
|
+
teachers: TeacherSimpleResponse[];
|
14
|
+
handleSortShare: (sortColumnName: string) => void;
|
15
|
+
filterShare: SearchQuery;
|
16
|
+
pagingShare: PagingResponse;
|
17
|
+
handleChangePageShare: (_: any, page: number) => void;
|
18
|
+
handleShareModel: (teacherIds: number[], textbookId: number) => Promise<void>;
|
19
|
+
isSelectedShare: (id: number) => boolean;
|
20
|
+
handleCloseShareDialog: () => void;
|
21
|
+
handleClickCheckboxShare: (id: number) => void;
|
22
|
+
selectedTeacher: TeacherSimpleResponse | undefined;
|
23
|
+
dataId: number;
|
24
|
+
isUpdate: boolean;
|
25
|
+
}
|
26
|
+
declare const ShareToTeacherDialog: FC<Props>;
|
27
|
+
export default ShareToTeacherDialog;
|
@@ -0,0 +1,32 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { TeacherSimpleResponse, TextbookResponse } from "../configs/types";
|
3
|
+
export interface TextbookShareProps {
|
4
|
+
getData: (isLoading?: boolean) => Promise<void>;
|
5
|
+
}
|
6
|
+
declare const useTextbookShare: (props: TextbookShareProps) => {
|
7
|
+
filterShare: import("../../../utils/types").SearchQuery;
|
8
|
+
textSearchShareRef: import("react").RefObject<HTMLInputElement>;
|
9
|
+
pagingShare: import("../../..").PagingResponse;
|
10
|
+
selectedShare: number[];
|
11
|
+
handleSortShare: (sortColumnName: string) => void;
|
12
|
+
handleChangeSearchTextShare: (e: import("react").ChangeEvent<HTMLInputElement>) => void;
|
13
|
+
handleChangePageShare: (_: any, page: number) => void;
|
14
|
+
numSelectedShare: number;
|
15
|
+
handleShareTextbook: (teacherIds: number[], textbookId: number) => Promise<void>;
|
16
|
+
isSelectedShare: (id: number) => boolean;
|
17
|
+
handleOpenShareDialog: (textbook: TextbookResponse) => void;
|
18
|
+
handleCloseShareDialog: () => void;
|
19
|
+
openShareDialog: boolean;
|
20
|
+
isCheckAllShare: (userLength: number) => boolean;
|
21
|
+
handleClickCheckboxShare: (id: number) => void;
|
22
|
+
handleSelectAllClickShare: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
23
|
+
notShared: TeacherSimpleResponse[];
|
24
|
+
shared: TeacherSimpleResponse[];
|
25
|
+
selectedTeacher: TeacherSimpleResponse | undefined;
|
26
|
+
handleOpenUpdateShareDialog: (textbook: TextbookResponse) => void;
|
27
|
+
isUpdate: boolean;
|
28
|
+
handleUpdateSharedTextbook: (teacherIds: number[], textbookId: number) => Promise<void>;
|
29
|
+
handleDisableShare: (textbook: TextbookResponse) => boolean;
|
30
|
+
currentModel: TextbookResponse | undefined;
|
31
|
+
};
|
32
|
+
export default useTextbookShare;
|
package/dist/index.js
CHANGED
@@ -7392,8 +7392,10 @@ var useMessageList = function useMessageList(_ref) {
|
|
7392
7392
|
var _state$common, _state$common$user;
|
7393
7393
|
return (state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : (_state$common$user = _state$common.user) === null || _state$common$user === void 0 ? void 0 : _state$common$user.roles) || [];
|
7394
7394
|
});
|
7395
|
-
var
|
7396
|
-
var
|
7395
|
+
var isAdmin = roles === null || roles === void 0 ? void 0 : roles.includes(exports.Role.Admin);
|
7396
|
+
var isTeacher = (roles === null || roles === void 0 ? void 0 : roles.includes(exports.Role.Teacher)) && !isAdmin;
|
7397
|
+
var isStudent = !isTeacher && !isAdmin;
|
7398
|
+
var firstRef = React.useRef(true);
|
7397
7399
|
var getMessageList = function getMessageList(conversationId) {
|
7398
7400
|
try {
|
7399
7401
|
var _temp3 = function _temp3() {
|
@@ -7413,14 +7415,14 @@ var useMessageList = function useMessageList(_ref) {
|
|
7413
7415
|
});
|
7414
7416
|
});
|
7415
7417
|
var _temp = function () {
|
7416
|
-
if (
|
7418
|
+
if (firstRef.current && !isStudent) {
|
7417
7419
|
return Promise.resolve(createRecentUserActionListApi({
|
7418
7420
|
userId: (student === null || student === void 0 ? void 0 : student.id) || 0,
|
7419
7421
|
action: RecentUserAction$1.ViewedQNA,
|
7420
7422
|
data: "" + conversationId,
|
7421
|
-
isAdmin:
|
7423
|
+
isAdmin: false
|
7422
7424
|
})).then(function () {
|
7423
|
-
|
7425
|
+
firstRef.current = false;
|
7424
7426
|
});
|
7425
7427
|
}
|
7426
7428
|
}();
|
@@ -16443,7 +16445,6 @@ var singleLogo = function singleLogo(_ref) {
|
|
16443
16445
|
};
|
16444
16446
|
|
16445
16447
|
var Header = function Header(_ref) {
|
16446
|
-
var _user$roles;
|
16447
16448
|
var academyListRoute = _ref.academyListRoute,
|
16448
16449
|
homeRoute = _ref.homeRoute,
|
16449
16450
|
registerRoute = _ref.registerRoute,
|
@@ -16455,27 +16456,24 @@ var Header = function Header(_ref) {
|
|
16455
16456
|
t = _useTranslation.t;
|
16456
16457
|
var location = reactRouterDom.useLocation();
|
16457
16458
|
var theme = material.useTheme();
|
16458
|
-
var
|
16459
|
-
var _state$common;
|
16460
|
-
return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.user;
|
16461
|
-
});
|
16459
|
+
var param = window.location.pathname;
|
16462
16460
|
var language = reactRedux.useSelector(function (state) {
|
16463
|
-
var _state$
|
16464
|
-
return state === null || state === void 0 ? void 0 : (_state$
|
16461
|
+
var _state$common;
|
16462
|
+
return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.language;
|
16465
16463
|
});
|
16466
|
-
var
|
16464
|
+
var isTeacherSide = param.includes('teacher');
|
16467
16465
|
var isLargerThanXL = material.useMediaQuery(theme.breakpoints.up("xl"));
|
16468
16466
|
var academyDomain = reactRedux.useSelector(function (state) {
|
16469
|
-
var _state$
|
16470
|
-
return state === null || state === void 0 ? void 0 : (_state$
|
16467
|
+
var _state$common2, _state$common2$user;
|
16468
|
+
return state === null || state === void 0 ? void 0 : (_state$common2 = state.common) === null || _state$common2 === void 0 ? void 0 : (_state$common2$user = _state$common2.user) === null || _state$common2$user === void 0 ? void 0 : _state$common2$user.academyDomain;
|
16471
16469
|
});
|
16472
16470
|
var logo = React.useMemo(function () {
|
16473
|
-
if (
|
16471
|
+
if (isTeacherSide) {
|
16474
16472
|
return language === exports.Language.en ? React__default.createElement(teacherFullLogoEn, null) : React__default.createElement(teacherFullLogoKo, null);
|
16475
16473
|
} else {
|
16476
16474
|
return language === exports.Language.en ? React__default.createElement(studentFullLogoEn, null) : React__default.createElement(studentFullLogoKo, null);
|
16477
16475
|
}
|
16478
|
-
}, [
|
16476
|
+
}, [isTeacherSide, language]);
|
16479
16477
|
var pathname = location.pathname.toLowerCase();
|
16480
16478
|
return React__default.createElement(material.Stack, {
|
16481
16479
|
width: "100%",
|
@@ -18660,7 +18658,7 @@ var StudentList = function StudentList(_ref) {
|
|
18660
18658
|
selectedStudent = _ref.selectedStudent,
|
18661
18659
|
t = _ref.t,
|
18662
18660
|
textSearchRef = _ref.textSearchRef,
|
18663
|
-
|
18661
|
+
disabled = _ref.disabled,
|
18664
18662
|
handleOpenDeleteClassDialog = _ref.handleOpenDeleteClassDialog,
|
18665
18663
|
handleCloseConfirmDialog = _ref.handleCloseConfirmDialog,
|
18666
18664
|
handleSort = _ref.handleSort,
|
@@ -18720,7 +18718,7 @@ var StudentList = function StudentList(_ref) {
|
|
18720
18718
|
},
|
18721
18719
|
placeholder: t("search_for"),
|
18722
18720
|
onChange: handleChangeSearchText
|
18723
|
-
}))),
|
18721
|
+
}))), !disabled && React__default.createElement(material.Grid, {
|
18724
18722
|
item: true,
|
18725
18723
|
xs: 6,
|
18726
18724
|
className: "d-flex align-items-center"
|
@@ -18756,11 +18754,11 @@ var StudentList = function StudentList(_ref) {
|
|
18756
18754
|
className: "d-flex"
|
18757
18755
|
}, React__default.createElement(material.IconButton, {
|
18758
18756
|
color: "default",
|
18759
|
-
className: (
|
18757
|
+
className: (disabled ? "bg-secondary" : "bg-danger") + " text-white",
|
18760
18758
|
onClick: function onClick() {
|
18761
18759
|
return handleOpenDeleteClassDialog(i);
|
18762
18760
|
},
|
18763
|
-
disabled:
|
18761
|
+
disabled: disabled
|
18764
18762
|
}, React__default.createElement(fa6.FaTrashCan, {
|
18765
18763
|
size: 12
|
18766
18764
|
})))));
|
@@ -19485,6 +19483,7 @@ var useClassDetail = function useClassDetail(_ref) {
|
|
19485
19483
|
var roles = (user === null || user === void 0 ? void 0 : user.roles) || [];
|
19486
19484
|
var isOneRoleExists = roles.length === 1;
|
19487
19485
|
var isAdmin = roles.includes(exports.Role.Admin) && role === exports.Role.Admin;
|
19486
|
+
var isTeacher = roles.includes(exports.Role.Teacher) && !roles.includes(exports.Role.Admin) && role === exports.Role.Teacher;
|
19488
19487
|
var _useState = React.useState(),
|
19489
19488
|
course = _useState[0],
|
19490
19489
|
setCourse = _useState[1];
|
@@ -19907,6 +19906,7 @@ var useClassDetail = function useClassDetail(_ref) {
|
|
19907
19906
|
isAdmin: isAdmin,
|
19908
19907
|
paging: paging,
|
19909
19908
|
filter: filter,
|
19909
|
+
isTeacher: isTeacher,
|
19910
19910
|
listUserSelected: selected,
|
19911
19911
|
isSelected: isSelected,
|
19912
19912
|
textSearchRef: textSearchRef,
|
@@ -20289,6 +20289,7 @@ var ClassDetail = function ClassDetail(_ref) {
|
|
20289
20289
|
schema = _useClassDetail.schema,
|
20290
20290
|
paging = _useClassDetail.paging,
|
20291
20291
|
isAdmin = _useClassDetail.isAdmin,
|
20292
|
+
isTeacher = _useClassDetail.isTeacher,
|
20292
20293
|
filter = _useClassDetail.filter,
|
20293
20294
|
listUserSelected = _useClassDetail.listUserSelected,
|
20294
20295
|
userList = _useClassDetail.userList,
|
@@ -20305,7 +20306,6 @@ var ClassDetail = function ClassDetail(_ref) {
|
|
20305
20306
|
course = _useClassDetail.course,
|
20306
20307
|
classRequest = _useClassDetail.classRequest,
|
20307
20308
|
teacherOptions = _useClassDetail.teacherOptions,
|
20308
|
-
isOneRoleExists = _useClassDetail.isOneRoleExists,
|
20309
20309
|
studentListProps = _useClassDetail.studentListProps,
|
20310
20310
|
teacherListProps = _useClassDetail.teacherListProps,
|
20311
20311
|
lessonListProps = _useClassDetail.lessonListProps,
|
@@ -20393,7 +20393,7 @@ var ClassDetail = function ClassDetail(_ref) {
|
|
20393
20393
|
value: selected,
|
20394
20394
|
index: TabList$2[1].value
|
20395
20395
|
}, !!id && !Number.isNaN(+id) && selected === TabList$2[1].value && React__default.createElement(StudentList, Object.assign({
|
20396
|
-
|
20396
|
+
disabled: !isTeacher && !isAdmin,
|
20397
20397
|
onAdd: handleOpenSelectDialog
|
20398
20398
|
}, studentListProps))), React__default.createElement(CustomTabPanel, {
|
20399
20399
|
value: selected,
|