@selfcommunity/react-ui 0.10.2-courses.125 → 0.10.2-courses.126
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/lib/cjs/components/CourseDashboard/Teacher/Info.js +1 -1
- package/lib/cjs/components/CourseDashboard/Teacher.js +4 -4
- package/lib/cjs/components/CourseDashboard/types.d.ts +4 -6
- package/lib/cjs/components/CourseDashboard/types.js +11 -11
- package/lib/cjs/components/EditCourse/EditCourse.d.ts +3 -2
- package/lib/cjs/components/EditCourse/EditCourse.js +21 -16
- package/lib/cjs/components/EditCourse/Lessons/FieldName.js +2 -2
- package/lib/cjs/components/EditCourse/Lessons/LessonRow.js +1 -1
- package/lib/cjs/components/EditCourse/Lessons/SectionRow.js +8 -8
- package/lib/cjs/components/EditCourse/Lessons.js +7 -7
- package/lib/cjs/components/EditCourse/Skeleton.js +1 -1
- package/lib/cjs/components/EditCourse/types.d.ts +1 -10
- package/lib/cjs/components/EditCourse/types.js +11 -19
- package/lib/cjs/components/EventMembersWidget/EventMembersWidget.js +11 -11
- package/lib/cjs/components/EventMembersWidget/TabContentComponent.js +8 -8
- package/lib/cjs/components/EventMembersWidget/types.d.ts +4 -5
- package/lib/cjs/components/EventMembersWidget/types.js +7 -7
- package/lib/cjs/index.d.ts +2 -2
- package/lib/cjs/index.js +2 -2
- package/lib/cjs/types/course.d.ts +1 -2
- package/lib/cjs/types/course.js +9 -9
- package/lib/cjs/types/index.d.ts +2 -4
- package/lib/cjs/types/index.js +2 -2
- package/lib/esm/components/CourseDashboard/Teacher/Info.js +2 -2
- package/lib/esm/components/CourseDashboard/Teacher.js +5 -5
- package/lib/esm/components/CourseDashboard/types.d.ts +4 -6
- package/lib/esm/components/CourseDashboard/types.js +10 -10
- package/lib/esm/components/EditCourse/EditCourse.d.ts +3 -2
- package/lib/esm/components/EditCourse/EditCourse.js +21 -16
- package/lib/esm/components/EditCourse/Lessons/FieldName.js +3 -3
- package/lib/esm/components/EditCourse/Lessons/LessonRow.js +2 -2
- package/lib/esm/components/EditCourse/Lessons/SectionRow.js +9 -9
- package/lib/esm/components/EditCourse/Lessons.js +8 -8
- package/lib/esm/components/EditCourse/Skeleton.js +2 -2
- package/lib/esm/components/EditCourse/types.d.ts +1 -10
- package/lib/esm/components/EditCourse/types.js +10 -18
- package/lib/esm/components/EventMembersWidget/EventMembersWidget.js +12 -12
- package/lib/esm/components/EventMembersWidget/TabContentComponent.js +9 -9
- package/lib/esm/components/EventMembersWidget/types.d.ts +4 -5
- package/lib/esm/components/EventMembersWidget/types.js +6 -6
- package/lib/esm/index.d.ts +2 -2
- package/lib/esm/index.js +2 -2
- package/lib/esm/types/course.d.ts +1 -2
- package/lib/esm/types/course.js +8 -8
- package/lib/esm/types/index.d.ts +2 -4
- package/lib/esm/types/index.js +2 -2
- package/lib/umd/react-ui.js +1 -1
- package/package.json +8 -8
|
@@ -14,6 +14,6 @@ const classes = {
|
|
|
14
14
|
function InfoCourseDashboard(props) {
|
|
15
15
|
// PROPS
|
|
16
16
|
const { title, course, position } = props;
|
|
17
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.info }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h4" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: title, defaultMessage: title }) })), position === types_1.
|
|
17
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.info }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h4" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: title, defaultMessage: title }) })), position === types_1.InfoPositionType.FIRST && (0, jsx_runtime_1.jsx)(CourseParticipantsButton_1.default, { course: course }), position === types_1.InfoPositionType.SECOND && (0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ variant: "h5" }, { children: [course.avg_completion_rate, "%"] }))] })));
|
|
18
18
|
}
|
|
19
19
|
exports.default = (0, react_1.memo)(InfoCourseDashboard);
|
|
@@ -26,11 +26,11 @@ const classes = {
|
|
|
26
26
|
const TAB_DATA = [
|
|
27
27
|
{
|
|
28
28
|
label: 'ui.course.dashboard.teacher.tab.students',
|
|
29
|
-
value: types_1.
|
|
29
|
+
value: types_1.TabContentType.STUDENTS
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
32
|
label: 'ui.course.dashboard.teacher.tab.comments',
|
|
33
|
-
value: types_1.
|
|
33
|
+
value: types_1.TabContentType.COMMENTS
|
|
34
34
|
}
|
|
35
35
|
];
|
|
36
36
|
const Root = (0, material_1.styled)(material_1.Box, {
|
|
@@ -46,7 +46,7 @@ function Teacher(inProps) {
|
|
|
46
46
|
});
|
|
47
47
|
const { courseId, course, className } = props, rest = tslib_1.__rest(props, ["courseId", "course", "className"]);
|
|
48
48
|
// STATES
|
|
49
|
-
const [tabValue, setTabValue] = (0, react_1.useState)(types_1.
|
|
49
|
+
const [tabValue, setTabValue] = (0, react_1.useState)(types_1.TabContentType.STUDENTS);
|
|
50
50
|
// HOOKS
|
|
51
51
|
const { scCourse } = (0, react_core_1.useSCFetchCourse)({ id: courseId, course, params: { view: api_services_1.CourseInfoViewType.DASHBOARD } });
|
|
52
52
|
// HANDLERS
|
|
@@ -56,6 +56,6 @@ function Teacher(inProps) {
|
|
|
56
56
|
if (!scCourse) {
|
|
57
57
|
return (0, jsx_runtime_1.jsx)(Skeleton_1.default, {});
|
|
58
58
|
}
|
|
59
|
-
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest, { children: [(0, jsx_runtime_1.jsx)(Header_1.default, { course: scCourse, hasAction: true }), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.infoWrapper }, { children: [(0, jsx_runtime_1.jsx)(Info_1.default, { title: "ui.course.dashboard.teacher.info.students", course: scCourse, position: types_1.
|
|
59
|
+
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest, { children: [(0, jsx_runtime_1.jsx)(Header_1.default, { course: scCourse, hasAction: true }), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.infoWrapper }, { children: [(0, jsx_runtime_1.jsx)(Info_1.default, { title: "ui.course.dashboard.teacher.info.students", course: scCourse, position: types_1.InfoPositionType.FIRST }), (0, jsx_runtime_1.jsx)(Info_1.default, { title: "ui.course.dashboard.teacher.info.completion", course: scCourse, position: types_1.InfoPositionType.SECOND })] })), (0, jsx_runtime_1.jsxs)(lab_1.TabContext, Object.assign({ value: tabValue }, { children: [(0, jsx_runtime_1.jsx)(lab_1.TabList, Object.assign({ className: classes.tabList, onChange: handleTabChange, textColor: "primary", indicatorColor: "primary", variant: "standard", centered: true }, { children: TAB_DATA.map((data, i) => ((0, jsx_runtime_1.jsx)(material_1.Tab, { label: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h6" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: data.label, defaultMessage: data.label }) })), value: data.value, className: classes.tab }, i))) })), (0, jsx_runtime_1.jsx)(lab_1.TabPanel, Object.assign({ className: classes.tabPanel, value: types_1.TabContentType.STUDENTS }, { children: (0, jsx_runtime_1.jsx)(Students_1.default, { course: scCourse }) })), (0, jsx_runtime_1.jsx)(lab_1.TabPanel, Object.assign({ className: classes.tabPanel, value: types_1.TabContentType.COMMENTS }, { children: (0, jsx_runtime_1.jsx)(Comments_1.default, { course: scCourse }) }))] }))] })));
|
|
60
60
|
}
|
|
61
61
|
exports.default = (0, react_1.memo)(Teacher);
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
export declare
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
COMMENTS = "2"
|
|
1
|
+
export declare enum TabContentType {
|
|
2
|
+
STUDENTS = "students",
|
|
3
|
+
COMMENTS = "comments"
|
|
5
4
|
}
|
|
6
|
-
export declare
|
|
7
|
-
export declare enum InfoPositionEnum {
|
|
5
|
+
export declare enum InfoPositionType {
|
|
8
6
|
FIRST = "first",
|
|
9
7
|
SECOND = "second"
|
|
10
8
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
var
|
|
5
|
-
(function (
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
})(
|
|
9
|
-
var
|
|
10
|
-
(function (
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
})(
|
|
3
|
+
exports.InfoPositionType = exports.TabContentType = void 0;
|
|
4
|
+
var TabContentType;
|
|
5
|
+
(function (TabContentType) {
|
|
6
|
+
TabContentType["STUDENTS"] = "students";
|
|
7
|
+
TabContentType["COMMENTS"] = "comments";
|
|
8
|
+
})(TabContentType = exports.TabContentType || (exports.TabContentType = {}));
|
|
9
|
+
var InfoPositionType;
|
|
10
|
+
(function (InfoPositionType) {
|
|
11
|
+
InfoPositionType["FIRST"] = "first";
|
|
12
|
+
InfoPositionType["SECOND"] = "second";
|
|
13
|
+
})(InfoPositionType = exports.InfoPositionType || (exports.InfoPositionType = {}));
|
|
@@ -4,8 +4,9 @@ import { SCCourseEditTabType } from '../../types/course';
|
|
|
4
4
|
export interface EditCourseProps {
|
|
5
5
|
courseId?: number;
|
|
6
6
|
course?: SCCourseType;
|
|
7
|
-
tab
|
|
8
|
-
onTabChange
|
|
7
|
+
tab?: SCCourseEditTabType;
|
|
8
|
+
onTabChange?: (tab: SCCourseEditTabType) => void;
|
|
9
|
+
onTabSelect?: (tab: SCCourseEditTabType) => void;
|
|
9
10
|
className?: HTMLAttributes<HTMLDivElement>['className'];
|
|
10
11
|
[p: string]: any;
|
|
11
12
|
}
|
|
@@ -8,7 +8,6 @@ const react_1 = require("react");
|
|
|
8
8
|
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
9
9
|
const lab_1 = require("@mui/lab");
|
|
10
10
|
const react_intl_1 = require("react-intl");
|
|
11
|
-
const types_1 = require("./types");
|
|
12
11
|
const Lessons_1 = tslib_1.__importDefault(require("./Lessons"));
|
|
13
12
|
const Customize_1 = tslib_1.__importDefault(require("./Customize"));
|
|
14
13
|
const Users_1 = tslib_1.__importDefault(require("./Users"));
|
|
@@ -16,6 +15,7 @@ const Options_1 = tslib_1.__importDefault(require("./Options"));
|
|
|
16
15
|
const react_core_1 = require("@selfcommunity/react-core");
|
|
17
16
|
const api_services_1 = require("@selfcommunity/api-services");
|
|
18
17
|
const Requests_1 = tslib_1.__importDefault(require("./Requests"));
|
|
18
|
+
const course_1 = require("../../types/course");
|
|
19
19
|
const Skeleton_1 = tslib_1.__importDefault(require("./Skeleton"));
|
|
20
20
|
const classes = {
|
|
21
21
|
root: `${constants_1.PREFIX}-root`,
|
|
@@ -27,45 +27,45 @@ const classes = {
|
|
|
27
27
|
const TAB_DATA = [
|
|
28
28
|
{
|
|
29
29
|
label: 'ui.editCourse.tab.lessons',
|
|
30
|
-
value:
|
|
30
|
+
value: course_1.SCCourseEditTabType.LESSONS
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
label: 'ui.editCourse.tab.customize',
|
|
34
|
-
value:
|
|
34
|
+
value: course_1.SCCourseEditTabType.CUSTOMIZE
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
label: 'ui.editCourse.tab.users',
|
|
38
|
-
value:
|
|
38
|
+
value: course_1.SCCourseEditTabType.USERS
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
label: 'ui.editCourse.tab.requests',
|
|
42
|
-
value:
|
|
42
|
+
value: course_1.SCCourseEditTabType.REQUESTS
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
45
|
label: 'ui.editCourse.tab.options',
|
|
46
|
-
value:
|
|
46
|
+
value: course_1.SCCourseEditTabType.OPTIONS
|
|
47
47
|
}
|
|
48
48
|
];
|
|
49
49
|
function getPanelData(course, setSCCourse) {
|
|
50
50
|
return [
|
|
51
51
|
{
|
|
52
|
-
value:
|
|
52
|
+
value: course_1.SCCourseEditTabType.LESSONS,
|
|
53
53
|
children: (0, jsx_runtime_1.jsx)(Lessons_1.default, { course: course, setSCCourse: setSCCourse })
|
|
54
54
|
},
|
|
55
55
|
{
|
|
56
|
-
value:
|
|
56
|
+
value: course_1.SCCourseEditTabType.CUSTOMIZE,
|
|
57
57
|
children: (0, jsx_runtime_1.jsx)(Customize_1.default, { course: course, setSCCourse: setSCCourse })
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
|
-
value:
|
|
60
|
+
value: course_1.SCCourseEditTabType.USERS,
|
|
61
61
|
children: (0, jsx_runtime_1.jsx)(Users_1.default, { course: course })
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
|
-
value:
|
|
64
|
+
value: course_1.SCCourseEditTabType.REQUESTS,
|
|
65
65
|
children: (0, jsx_runtime_1.jsx)(Requests_1.default, { course: course })
|
|
66
66
|
},
|
|
67
67
|
{
|
|
68
|
-
value:
|
|
68
|
+
value: course_1.SCCourseEditTabType.OPTIONS,
|
|
69
69
|
children: (0, jsx_runtime_1.jsx)(Options_1.default, { course: course, setSCCourse: setSCCourse })
|
|
70
70
|
}
|
|
71
71
|
];
|
|
@@ -81,9 +81,9 @@ function EditCourse(inProps) {
|
|
|
81
81
|
props: inProps,
|
|
82
82
|
name: constants_1.PREFIX
|
|
83
83
|
});
|
|
84
|
-
const { courseId, course, tab, onTabChange, className } = props, rest = tslib_1.__rest(props, ["courseId", "course", "tab", "onTabChange", "className"]);
|
|
84
|
+
const { courseId, course, tab = course_1.SCCourseEditTabType.LESSONS, onTabChange, onTabSelect, className } = props, rest = tslib_1.__rest(props, ["courseId", "course", "tab", "onTabChange", "onTabSelect", "className"]);
|
|
85
85
|
// STATES
|
|
86
|
-
const [tabValue, setTabValue] = (0, react_1.useState)(
|
|
86
|
+
const [tabValue, setTabValue] = (0, react_1.useState)(tab);
|
|
87
87
|
// CONTEXTS
|
|
88
88
|
const scRoutingContext = (0, react_core_1.useSCRouting)();
|
|
89
89
|
// HOOKS
|
|
@@ -92,9 +92,14 @@ function EditCourse(inProps) {
|
|
|
92
92
|
const isMobile = (0, material_1.useMediaQuery)(theme.breakpoints.down('md'));
|
|
93
93
|
// HANDLERS
|
|
94
94
|
const handleTabChange = (0, react_1.useCallback)((_evt, newTabValue) => {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
if (onTabSelect) {
|
|
96
|
+
onTabSelect(newTabValue);
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
setTabValue(newTabValue);
|
|
100
|
+
onTabChange === null || onTabChange === void 0 ? void 0 : onTabChange(newTabValue);
|
|
101
|
+
}
|
|
102
|
+
}, [setTabValue, onTabChange, onTabSelect]);
|
|
98
103
|
if (!scCourse) {
|
|
99
104
|
return (0, jsx_runtime_1.jsx)(Skeleton_1.default, { tab: tab });
|
|
100
105
|
}
|
|
@@ -48,7 +48,7 @@ function FieldName(props) {
|
|
|
48
48
|
}
|
|
49
49
|
})
|
|
50
50
|
.then((response) => {
|
|
51
|
-
handleManageRow(response.data, isNewRow ? types_2.
|
|
51
|
+
handleManageRow(response.data, isNewRow ? types_2.ActionLessonType.ADD : types_2.ActionLessonType.RENAME);
|
|
52
52
|
setName(null);
|
|
53
53
|
setLoading(false);
|
|
54
54
|
handleDisableEditMode();
|
|
@@ -70,7 +70,7 @@ function FieldName(props) {
|
|
|
70
70
|
}, [isNewRow, name, endpoint, setLoading, handleDisableEditMode, handleManageRow]);
|
|
71
71
|
const handleClose = (0, react_1.useCallback)(() => {
|
|
72
72
|
if (isNewRow) {
|
|
73
|
-
handleManageRow(row, types_2.
|
|
73
|
+
handleManageRow(row, types_2.ActionLessonType.DELETE);
|
|
74
74
|
pubsub_js_1.default.publish(`${PubSub_1.SCTopicType.COURSE}.${PubSub_1.SCGroupEventType.UPDATE}`, false);
|
|
75
75
|
}
|
|
76
76
|
else {
|
|
@@ -48,7 +48,7 @@ function LessonRow(props) {
|
|
|
48
48
|
const handleDeleteLesson = (0, react_1.useCallback)(() => {
|
|
49
49
|
api_services_1.CourseService.deleteCourseLesson(course.id, section.id, lesson.id)
|
|
50
50
|
.then(() => {
|
|
51
|
-
handleManageLesson(lesson, types_1.
|
|
51
|
+
handleManageLesson(lesson, types_1.ActionLessonType.DELETE);
|
|
52
52
|
enqueueSnackbar((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.editCourse.tab.lessons.table.snackbar.delete", defaultMessage: "ui.editCourse.tab.lessons.table.snackbar.delete" }), {
|
|
53
53
|
variant: 'success',
|
|
54
54
|
autoHideDuration: 3000
|
|
@@ -71,7 +71,7 @@ function SectionRow(props) {
|
|
|
71
71
|
lessons_order: tempLessons.map((tempLesson) => tempLesson.id)
|
|
72
72
|
};
|
|
73
73
|
api_services_1.CourseService.patchCourseSection(course.id, section.id, data)
|
|
74
|
-
.then(() => handleManageSection(tempSection, types_2.
|
|
74
|
+
.then(() => handleManageSection(tempSection, types_2.ActionLessonType.UPDATE))
|
|
75
75
|
.catch((error) => {
|
|
76
76
|
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, error);
|
|
77
77
|
enqueueSnackbar((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.common.error.action", defaultMessage: "ui.common.error.action" }), {
|
|
@@ -89,7 +89,7 @@ function SectionRow(props) {
|
|
|
89
89
|
api_services_1.CourseService.deleteCourseSection(course.id, section.id)
|
|
90
90
|
.then(() => {
|
|
91
91
|
const tempSection = Object.assign(Object.assign({}, section), { num_lessons: section.lessons.length });
|
|
92
|
-
handleManageSection(tempSection, types_2.
|
|
92
|
+
handleManageSection(tempSection, types_2.ActionLessonType.DELETE);
|
|
93
93
|
enqueueSnackbar((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.editCourse.tab.lessons.table.snackbar.delete", defaultMessage: "ui.editCourse.tab.lessons.table.snackbar.delete" }), {
|
|
94
94
|
variant: 'success',
|
|
95
95
|
autoHideDuration: 3000
|
|
@@ -105,24 +105,24 @@ function SectionRow(props) {
|
|
|
105
105
|
}, [course, section, handleManageSection]);
|
|
106
106
|
const handleManageLesson = (0, react_1.useCallback)((lesson, type) => {
|
|
107
107
|
switch (type) {
|
|
108
|
-
case types_2.
|
|
108
|
+
case types_2.ActionLessonType.ADD: {
|
|
109
109
|
const tempSection = Object.assign(Object.assign({}, section), { lessons: section.lessons ? [...section.lessons, lesson] : [lesson] });
|
|
110
|
-
handleManageSection(tempSection, types_2.
|
|
110
|
+
handleManageSection(tempSection, types_2.ActionLessonType.ADD_UPDATE);
|
|
111
111
|
break;
|
|
112
112
|
}
|
|
113
|
-
case types_2.
|
|
113
|
+
case types_2.ActionLessonType.RENAME: {
|
|
114
114
|
const tempSection = Object.assign(Object.assign({}, section), { lessons: section.lessons.map((prevLesson) => {
|
|
115
115
|
if (prevLesson.id === lesson.id) {
|
|
116
116
|
return Object.assign(Object.assign({}, prevLesson), { name: lesson.name });
|
|
117
117
|
}
|
|
118
118
|
return prevLesson;
|
|
119
119
|
}) });
|
|
120
|
-
handleManageSection(tempSection, types_2.
|
|
120
|
+
handleManageSection(tempSection, types_2.ActionLessonType.RENAME_UPDATE);
|
|
121
121
|
break;
|
|
122
122
|
}
|
|
123
|
-
case types_2.
|
|
123
|
+
case types_2.ActionLessonType.DELETE: {
|
|
124
124
|
const tempSection = Object.assign(Object.assign({}, section), { lessons: section.lessons.filter((prevLesson) => prevLesson.id !== lesson.id) });
|
|
125
|
-
handleManageSection(tempSection, types_2.
|
|
125
|
+
handleManageSection(tempSection, types_2.ActionLessonType.DELETE_UPDATE);
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
}, [section, handleManageSection]);
|
|
@@ -99,10 +99,10 @@ function Lessons(props) {
|
|
|
99
99
|
}, [setSections]);
|
|
100
100
|
const handleManageSection = (0, react_1.useCallback)((section, type) => {
|
|
101
101
|
switch (type) {
|
|
102
|
-
case types_1.
|
|
102
|
+
case types_1.ActionLessonType.ADD:
|
|
103
103
|
setSCCourse(Object.assign(Object.assign({}, course), { num_sections: course.num_sections + 1, sections: [...course.sections, section] }));
|
|
104
104
|
break;
|
|
105
|
-
case types_1.
|
|
105
|
+
case types_1.ActionLessonType.RENAME:
|
|
106
106
|
setSCCourse(Object.assign(Object.assign({}, course), { sections: course.sections.map((prevSection) => {
|
|
107
107
|
if (prevSection.id === section.id) {
|
|
108
108
|
return Object.assign(Object.assign({}, prevSection), { name: section.name });
|
|
@@ -110,10 +110,10 @@ function Lessons(props) {
|
|
|
110
110
|
return prevSection;
|
|
111
111
|
}) }));
|
|
112
112
|
break;
|
|
113
|
-
case types_1.
|
|
113
|
+
case types_1.ActionLessonType.DELETE:
|
|
114
114
|
setSCCourse(Object.assign(Object.assign({}, course), { num_sections: course.num_sections - 1, num_lessons: course.num_lessons - section.num_lessons, sections: course.sections.filter((prevSection) => prevSection.id !== section.id) }));
|
|
115
115
|
break;
|
|
116
|
-
case types_1.
|
|
116
|
+
case types_1.ActionLessonType.UPDATE:
|
|
117
117
|
setSCCourse(Object.assign(Object.assign({}, course), { sections: course.sections.map((prevSection) => {
|
|
118
118
|
if (prevSection.id === section.id) {
|
|
119
119
|
return Object.assign(Object.assign({}, prevSection), { lessons: section.lessons });
|
|
@@ -121,12 +121,12 @@ function Lessons(props) {
|
|
|
121
121
|
return prevSection;
|
|
122
122
|
}) }));
|
|
123
123
|
break;
|
|
124
|
-
case type.endsWith(types_1.
|
|
124
|
+
case type.endsWith(types_1.ActionLessonType.UPDATE) && type: {
|
|
125
125
|
let numLessons = course.num_lessons;
|
|
126
|
-
if (type === types_1.
|
|
126
|
+
if (type === types_1.ActionLessonType.ADD_UPDATE) {
|
|
127
127
|
numLessons = course.num_lessons + 1;
|
|
128
128
|
}
|
|
129
|
-
else if (type === types_1.
|
|
129
|
+
else if (type === types_1.ActionLessonType.DELETE_UPDATE) {
|
|
130
130
|
numLessons = course.num_lessons - 1;
|
|
131
131
|
}
|
|
132
132
|
setSCCourse(Object.assign(Object.assign({}, course), { num_lessons: numLessons, sections: course.sections.map((prevSection) => {
|
|
@@ -23,6 +23,6 @@ const Root = (0, material_1.styled)(material_1.Box, {
|
|
|
23
23
|
function EditCourseSkeleton(props) {
|
|
24
24
|
// PROPS
|
|
25
25
|
const { tab } = props;
|
|
26
|
-
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: classes.root }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.header }, { children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", variant: "rectangular", width: "14px", height: "14px" }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", variant: "text", width: "125px", height: "21px" })] })), (0, jsx_runtime_1.jsx)(material_1.Stack, Object.assign({ className: classes.tabList }, { children: Array.from(new Array(5)).map((_, i) => ((0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", variant: "text", width: "80px", height: "21px" }, i))) })), tab === types_1.
|
|
26
|
+
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: classes.root }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.header }, { children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", variant: "rectangular", width: "14px", height: "14px" }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", variant: "text", width: "125px", height: "21px" })] })), (0, jsx_runtime_1.jsx)(material_1.Stack, Object.assign({ className: classes.tabList }, { children: Array.from(new Array(5)).map((_, i) => ((0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", variant: "text", width: "80px", height: "21px" }, i))) })), tab === types_1.SCCourseEditTabType.LESSONS && (0, jsx_runtime_1.jsx)(Skeleton_1.default, {}), tab === types_1.SCCourseEditTabType.CUSTOMIZE && (0, jsx_runtime_1.jsx)(Skeleton_3.default, {}), tab === types_1.SCCourseEditTabType.USERS && (0, jsx_runtime_1.jsx)(Skeleton_2.default, {}), tab === types_1.SCCourseEditTabType.REQUESTS && (0, jsx_runtime_1.jsx)(Skeleton_2.default, {}), tab === types_1.SCCourseEditTabType.OPTIONS && (0, jsx_runtime_1.jsx)(Skeleton_4.default, {})] })));
|
|
27
27
|
}
|
|
28
28
|
exports.default = (0, react_1.memo)(EditCourseSkeleton);
|
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
export declare
|
|
2
|
-
export declare enum TabContentEnum {
|
|
3
|
-
LESSONS = "1",
|
|
4
|
-
CUSTOMIZE = "2",
|
|
5
|
-
USERS = "3",
|
|
6
|
-
REQUESTS = "4",
|
|
7
|
-
OPTIONS = "5"
|
|
8
|
-
}
|
|
9
|
-
export declare type ActionLessonType = 'add' | 'rename' | 'delete' | 'update' | 'add_update' | 'rename_update' | 'delete_update';
|
|
10
|
-
export declare enum ActionLessonEnum {
|
|
1
|
+
export declare enum ActionLessonType {
|
|
11
2
|
ADD = "add",
|
|
12
3
|
RENAME = "rename",
|
|
13
4
|
DELETE = "delete",
|
|
@@ -1,21 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
var
|
|
5
|
-
(function (
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
(
|
|
14
|
-
ActionLessonEnum["ADD"] = "add";
|
|
15
|
-
ActionLessonEnum["RENAME"] = "rename";
|
|
16
|
-
ActionLessonEnum["DELETE"] = "delete";
|
|
17
|
-
ActionLessonEnum["UPDATE"] = "update";
|
|
18
|
-
ActionLessonEnum["ADD_UPDATE"] = "add_update";
|
|
19
|
-
ActionLessonEnum["RENAME_UPDATE"] = "rename_update";
|
|
20
|
-
ActionLessonEnum["DELETE_UPDATE"] = "delete_update";
|
|
21
|
-
})(ActionLessonEnum = exports.ActionLessonEnum || (exports.ActionLessonEnum = {}));
|
|
3
|
+
exports.ActionLessonType = void 0;
|
|
4
|
+
var ActionLessonType;
|
|
5
|
+
(function (ActionLessonType) {
|
|
6
|
+
ActionLessonType["ADD"] = "add";
|
|
7
|
+
ActionLessonType["RENAME"] = "rename";
|
|
8
|
+
ActionLessonType["DELETE"] = "delete";
|
|
9
|
+
ActionLessonType["UPDATE"] = "update";
|
|
10
|
+
ActionLessonType["ADD_UPDATE"] = "add_update";
|
|
11
|
+
ActionLessonType["RENAME_UPDATE"] = "rename_update";
|
|
12
|
+
ActionLessonType["DELETE_UPDATE"] = "delete_update";
|
|
13
|
+
})(ActionLessonType = exports.ActionLessonType || (exports.ActionLessonType = {}));
|
|
@@ -66,7 +66,7 @@ function EventMembersWidget(inProps) {
|
|
|
66
66
|
const [invitedCount, setInvitedCount] = (0, react_1.useState)(invited.count);
|
|
67
67
|
const [requestsCount, setRequestsCount] = (0, react_1.useState)(requests.count);
|
|
68
68
|
const [requestsUsers, setRequestsUsers] = (0, react_1.useState)(requests.results);
|
|
69
|
-
const [tabValue, setTabValue] = (0, react_1.useState)(types_1.
|
|
69
|
+
const [tabValue, setTabValue] = (0, react_1.useState)(types_1.TabContentType.PARTICIPANTS);
|
|
70
70
|
const [refresh, setRefresh] = (0, react_1.useState)(null);
|
|
71
71
|
// CONTEXT
|
|
72
72
|
const scUserContext = (0, react_core_1.useSCUser)();
|
|
@@ -76,11 +76,11 @@ function EventMembersWidget(inProps) {
|
|
|
76
76
|
const hasAllow = (0, react_1.useMemo)(() => { var _a; return ((_a = scUserContext.user) === null || _a === void 0 ? void 0 : _a.id) === (scEvent === null || scEvent === void 0 ? void 0 : scEvent.managed_by.id); }, [scUserContext, scEvent]);
|
|
77
77
|
const title = (0, react_1.useMemo)(() => {
|
|
78
78
|
switch (tabValue) {
|
|
79
|
-
case types_1.
|
|
79
|
+
case types_1.TabContentType.REQUESTS:
|
|
80
80
|
return 'ui.eventMembersWidget.requests';
|
|
81
|
-
case types_1.
|
|
81
|
+
case types_1.TabContentType.INVITED:
|
|
82
82
|
return 'ui.eventMembersWidget.invited';
|
|
83
|
-
case types_1.
|
|
83
|
+
case types_1.TabContentType.PARTICIPANTS:
|
|
84
84
|
default:
|
|
85
85
|
return 'ui.eventMembersWidget.participants';
|
|
86
86
|
}
|
|
@@ -134,11 +134,11 @@ function EventMembersWidget(inProps) {
|
|
|
134
134
|
let _t;
|
|
135
135
|
if (scUserContext.user && scEvent) {
|
|
136
136
|
_t = setTimeout(() => {
|
|
137
|
-
if (refresh === types_1.
|
|
137
|
+
if (refresh === types_1.TabContentType.PARTICIPANTS) {
|
|
138
138
|
_initParticipants();
|
|
139
139
|
setRefresh(null);
|
|
140
140
|
}
|
|
141
|
-
else if (refresh === types_1.
|
|
141
|
+
else if (refresh === types_1.TabContentType.INVITED) {
|
|
142
142
|
_initInvited();
|
|
143
143
|
setRefresh(null);
|
|
144
144
|
}
|
|
@@ -165,10 +165,10 @@ function EventMembersWidget(inProps) {
|
|
|
165
165
|
setTabValue(newTabValue);
|
|
166
166
|
}, [setTabValue]);
|
|
167
167
|
const handleRefresh = (0, react_1.useCallback)((_tabValue) => {
|
|
168
|
-
if (_tabValue === types_1.
|
|
168
|
+
if (_tabValue === types_1.TabContentType.PARTICIPANTS) {
|
|
169
169
|
dispatchParticipants({ type: widget_1.actionWidgetTypes.RESET });
|
|
170
170
|
}
|
|
171
|
-
else if (_tabValue === types_1.
|
|
171
|
+
else if (_tabValue === types_1.TabContentType.INVITED) {
|
|
172
172
|
dispatchInvited({ type: widget_1.actionWidgetTypes.RESET });
|
|
173
173
|
}
|
|
174
174
|
setRefresh(_tabValue);
|
|
@@ -179,13 +179,13 @@ function EventMembersWidget(inProps) {
|
|
|
179
179
|
if (!scEvent ||
|
|
180
180
|
!participants.initialized ||
|
|
181
181
|
(scEvent && ((eventId !== undefined && scEvent.id !== eventId) || (event && scEvent.id !== event.id))) ||
|
|
182
|
-
(tabValue === types_1.
|
|
182
|
+
(tabValue === types_1.TabContentType.PARTICIPANTS && participants.isLoadingNext && !participants.initialized)) {
|
|
183
183
|
return (0, jsx_runtime_1.jsx)(Skeleton_1.default, {});
|
|
184
184
|
}
|
|
185
|
-
return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ className: classes.root }, rest, { children: (0, jsx_runtime_1.jsxs)(material_1.CardContent, Object.assign({ className: classes.content }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h5", className: classes.title }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: title, defaultMessage: title }) })), (0, jsx_runtime_1.jsxs)(lab_1.TabContext, Object.assign({ value: tabValue }, { children: [(0, jsx_runtime_1.jsxs)(lab_1.TabList, Object.assign({ className: classes.tabsWrapper, onChange: handleTabChange, textColor: "primary", indicatorColor: "primary", variant: "fullWidth" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Tab, { label: (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.tabLabelWrapper }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h3" }, { children: participantsCount })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "subtitle2" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventMembersWidget.participants", defaultMessage: "ui.eventMembersWidget.participants" }) }))] })), value: types_1.
|
|
185
|
+
return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ className: classes.root }, rest, { children: (0, jsx_runtime_1.jsxs)(material_1.CardContent, Object.assign({ className: classes.content }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h5", className: classes.title }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: title, defaultMessage: title }) })), (0, jsx_runtime_1.jsxs)(lab_1.TabContext, Object.assign({ value: tabValue }, { children: [(0, jsx_runtime_1.jsxs)(lab_1.TabList, Object.assign({ className: classes.tabsWrapper, onChange: handleTabChange, textColor: "primary", indicatorColor: "primary", variant: "fullWidth" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Tab, { label: (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.tabLabelWrapper }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h3" }, { children: participantsCount })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "subtitle2" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventMembersWidget.participants", defaultMessage: "ui.eventMembersWidget.participants" }) }))] })), value: types_1.TabContentType.PARTICIPANTS }), hasAllow && ((0, jsx_runtime_1.jsx)(material_1.Tab, { label: (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.tabLabelWrapper }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h3" }, { children: invitedCount })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "subtitle2" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventMembersWidget.invited", defaultMessage: "ui.eventMembersWidget.invited" }) }))] })), value: types_1.TabContentType.INVITED })), hasAllow && ((0, jsx_runtime_1.jsx)(material_1.Tab, { label: (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.tabLabelWrapper }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h3" }, { children: requestsCount })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "subtitle2" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventMembersWidget.requests", defaultMessage: "ui.eventMembersWidget.requests" }) }))] })), value: types_1.TabContentType.REQUESTS }))] })), (0, jsx_runtime_1.jsx)(lab_1.TabPanel, Object.assign({ value: types_1.TabContentType.PARTICIPANTS, className: classes.tabPanel }, { children: (0, jsx_runtime_1.jsx)(TabContentComponent_1.default, { tabValue: types_1.TabContentType.PARTICIPANTS, state: participants, dispatch: dispatchParticipants, userProps: userProps, dialogProps: dialogProps, handleRefresh: handleRefresh }) })), hasAllow && ((0, jsx_runtime_1.jsx)(lab_1.TabPanel, Object.assign({ value: types_1.TabContentType.INVITED, className: classes.tabPanel }, { children: (0, jsx_runtime_1.jsx)(TabContentComponent_1.default, { tabValue: types_1.TabContentType.INVITED, state: invited, dispatch: dispatchInvited, userProps: userProps, dialogProps: dialogProps, actionProps: {
|
|
186
186
|
scEvent,
|
|
187
187
|
setCount: setInvitedCount
|
|
188
|
-
}, handleRefresh: handleRefresh }) }))), hasAllow && ((0, jsx_runtime_1.jsx)(lab_1.TabPanel, Object.assign({ value: types_1.
|
|
188
|
+
}, handleRefresh: handleRefresh }) }))), hasAllow && ((0, jsx_runtime_1.jsx)(lab_1.TabPanel, Object.assign({ value: types_1.TabContentType.REQUESTS, className: classes.tabPanel }, { children: (0, jsx_runtime_1.jsx)(TabContentComponent_1.default, { tabValue: types_1.TabContentType.REQUESTS, state: requests, dispatch: dispatchRequests, userProps: userProps, dialogProps: dialogProps, actionProps: {
|
|
189
189
|
scEvent,
|
|
190
190
|
count: requestsCount,
|
|
191
191
|
setCount: setRequestsCount,
|
|
@@ -43,7 +43,7 @@ function TabContentComponent(props) {
|
|
|
43
43
|
// HOOKS
|
|
44
44
|
const { enqueueSnackbar } = (0, notistack_1.useSnackbar)();
|
|
45
45
|
// CONSTS
|
|
46
|
-
const users = (0, react_1.useMemo)(() => (tabValue === types_1.
|
|
46
|
+
const users = (0, react_1.useMemo)(() => (tabValue === types_1.TabContentType.REQUESTS ? actionProps === null || actionProps === void 0 ? void 0 : actionProps.users : state.results), [tabValue, actionProps === null || actionProps === void 0 ? void 0 : actionProps.users, state.results]);
|
|
47
47
|
// EFFECTS
|
|
48
48
|
(0, react_1.useEffect)(() => {
|
|
49
49
|
updatesInvited.current = pubsub_js_1.default.subscribe(`${PubSub_1.SCTopicType.EVENT}.${PubSub_1.SCGroupEventType.INVITE_MEMBER}`, handleInviteMember);
|
|
@@ -80,13 +80,13 @@ function TabContentComponent(props) {
|
|
|
80
80
|
setOpenDialog((prev) => !prev);
|
|
81
81
|
}, [setOpenDialog]);
|
|
82
82
|
const handleToggleMember = (0, react_1.useCallback)(() => {
|
|
83
|
-
handleRefresh === null || handleRefresh === void 0 ? void 0 : handleRefresh(types_1.
|
|
83
|
+
handleRefresh === null || handleRefresh === void 0 ? void 0 : handleRefresh(types_1.TabContentType.PARTICIPANTS);
|
|
84
84
|
}, [handleRefresh]);
|
|
85
85
|
const handleInviteMember = (0, react_1.useCallback)(() => {
|
|
86
|
-
handleRefresh === null || handleRefresh === void 0 ? void 0 : handleRefresh(types_1.
|
|
86
|
+
handleRefresh === null || handleRefresh === void 0 ? void 0 : handleRefresh(types_1.TabContentType.INVITED);
|
|
87
87
|
}, [handleRefresh]);
|
|
88
88
|
const getActionsComponent = (0, react_1.useCallback)((userId) => {
|
|
89
|
-
if (tabValue === types_1.
|
|
89
|
+
if (tabValue === types_1.TabContentType.INVITED && actionProps) {
|
|
90
90
|
const _handleInvitations = (invited) => {
|
|
91
91
|
var _a, _b;
|
|
92
92
|
if (invited) {
|
|
@@ -98,7 +98,7 @@ function TabContentComponent(props) {
|
|
|
98
98
|
};
|
|
99
99
|
return (0, jsx_runtime_1.jsx)(InviteUserEventButton_1.default, { event: actionProps.scEvent, userId: userId, handleInvitations: _handleInvitations });
|
|
100
100
|
}
|
|
101
|
-
else if (tabValue === types_1.
|
|
101
|
+
else if (tabValue === types_1.TabContentType.REQUESTS && actionProps) {
|
|
102
102
|
const handleConfirm = (id) => {
|
|
103
103
|
if (id) {
|
|
104
104
|
actionProps.setCount((prev) => prev - 1);
|
|
@@ -119,10 +119,10 @@ function TabContentComponent(props) {
|
|
|
119
119
|
}
|
|
120
120
|
return undefined;
|
|
121
121
|
}, [tabValue, actionProps]);
|
|
122
|
-
if (tabValue === types_1.
|
|
122
|
+
if (tabValue === types_1.TabContentType.PARTICIPANTS && (actionProps === null || actionProps === void 0 ? void 0 : actionProps.count) === 0) {
|
|
123
123
|
return ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventMembersWidget.noParticipants", defaultMessage: "ui.eventMembersWidget.noParticipants" }) })));
|
|
124
124
|
}
|
|
125
|
-
else if (tabValue === types_1.
|
|
125
|
+
else if (tabValue === types_1.TabContentType.INVITED && state.count === 0 && actionProps) {
|
|
126
126
|
const date = actionProps.scEvent.end_date || actionProps.scEvent.start_date;
|
|
127
127
|
const disabled = new Date(date).getTime() < new Date().getTime();
|
|
128
128
|
const handleInvitations = (invited) => {
|
|
@@ -132,7 +132,7 @@ function TabContentComponent(props) {
|
|
|
132
132
|
};
|
|
133
133
|
return ((0, jsx_runtime_1.jsx)(EventInviteButton_1.default, { event: actionProps.scEvent, className: classes.eventButton, handleInvitations: handleInvitations, disabled: disabled }));
|
|
134
134
|
}
|
|
135
|
-
else if (tabValue === types_1.
|
|
135
|
+
else if (tabValue === types_1.TabContentType.REQUESTS && (actionProps === null || actionProps === void 0 ? void 0 : actionProps.count) === 0) {
|
|
136
136
|
return ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventMembersWidget.noOtherRequests", defaultMessage: "ui.eventMembersWidget.noOtherRequests" }) })));
|
|
137
137
|
}
|
|
138
138
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.List, { children: users === null || users === void 0 ? void 0 : users.slice(0, state.visibleItems).map((user) => ((0, jsx_runtime_1.jsx)(material_1.ListItem, { children: (0, jsx_runtime_1.jsx)(User_1.default, Object.assign({ elevation: 0, user: user }, userProps, { actions: getActionsComponent(user.id) })) }, user.id))) }), state.count > state.visibleItems && ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ onClick: handleToggleDialogOpen, className: classes.actionButton }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "caption" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventMembersWidget.showAll", defaultMessage: "ui.eventMembersWidget.showAll" }) })) }))), openDialog && ((0, jsx_runtime_1.jsx)(DialogRoot, Object.assign({ className: classes.dialogRoot, title: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { defaultMessage: "ui.eventMembersWidget.title", id: "ui.eventMembersWidget.title" }), onClose: handleToggleDialogOpen, open: true }, dialogProps, { children: (0, jsx_runtime_1.jsx)(InfiniteScroll_1.default, Object.assign({ dataLength: state.results.length, next: handleNext, hasMoreNext: Boolean(state.next), loaderNext: (0, jsx_runtime_1.jsx)(User_1.UserSkeleton, Object.assign({ elevation: 0 }, userProps)), className: classes.infiniteScroll, endMessage: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.endMessage }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventMembersWidget.noMoreResults", defaultMessage: "ui.eventMembersWidget.noMoreResults" }) })) }, { children: (0, jsx_runtime_1.jsx)(material_1.List, { children: state.results.map((user) => ((0, jsx_runtime_1.jsx)(material_1.ListItem, { children: (0, jsx_runtime_1.jsx)(User_1.default, Object.assign({ elevation: 0, user: user }, userProps)) }, user.id))) }) })) })))] }));
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export declare
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
REQUESTS = "3"
|
|
1
|
+
export declare enum TabContentType {
|
|
2
|
+
PARTICIPANTS = "participants",
|
|
3
|
+
INVITED = "invited",
|
|
4
|
+
REQUESTS = "requests"
|
|
6
5
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
var
|
|
5
|
-
(function (
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
})(
|
|
3
|
+
exports.TabContentType = void 0;
|
|
4
|
+
var TabContentType;
|
|
5
|
+
(function (TabContentType) {
|
|
6
|
+
TabContentType["PARTICIPANTS"] = "participants";
|
|
7
|
+
TabContentType["INVITED"] = "invited";
|
|
8
|
+
TabContentType["REQUESTS"] = "requests";
|
|
9
|
+
})(TabContentType = exports.TabContentType || (exports.TabContentType = {}));
|