@selfcommunity/react-ui 0.10.2-courses.105 → 0.10.2-courses.107
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/Course/CreatePlaceholder.d.ts +6 -0
- package/lib/cjs/components/Course/CreatePlaceholder.js +2 -2
- package/lib/cjs/components/CourseDashboard/Header.js +3 -1
- package/lib/cjs/components/CourseDashboard/Student.js +3 -2
- package/lib/cjs/components/CourseDashboard/Teacher.d.ts +0 -3
- package/lib/cjs/components/CourseDashboard/Teacher.js +2 -3
- package/lib/cjs/components/CourseDashboard/types.d.ts +0 -19
- package/lib/cjs/components/CourseForm/CourseForm.d.ts +1 -4
- package/lib/cjs/components/CourseForm/CourseForm.js +7 -13
- package/lib/cjs/components/CourseFormDialog/CourseFormDialog.js +2 -2
- package/lib/cjs/components/Courses/Courses.d.ts +6 -0
- package/lib/cjs/components/Courses/Courses.js +2 -2
- package/lib/cjs/components/EditCourse/Customize.js +2 -2
- package/lib/cjs/constants/Course.d.ts +4 -0
- package/lib/cjs/constants/Course.js +6 -1
- package/lib/cjs/index.d.ts +2 -1
- package/lib/cjs/index.js +6 -4
- package/lib/cjs/shared/AccordionLessons/AccordionLessons.js +3 -3
- package/lib/esm/components/Course/CreatePlaceholder.d.ts +6 -0
- package/lib/esm/components/Course/CreatePlaceholder.js +2 -2
- package/lib/esm/components/CourseDashboard/Header.js +3 -1
- package/lib/esm/components/CourseDashboard/Student.js +3 -2
- package/lib/esm/components/CourseDashboard/Teacher.d.ts +0 -3
- package/lib/esm/components/CourseDashboard/Teacher.js +2 -3
- package/lib/esm/components/CourseDashboard/types.d.ts +0 -19
- package/lib/esm/components/CourseForm/CourseForm.d.ts +1 -4
- package/lib/esm/components/CourseForm/CourseForm.js +1 -6
- package/lib/esm/components/CourseFormDialog/CourseFormDialog.js +1 -1
- package/lib/esm/components/Courses/Courses.d.ts +6 -0
- package/lib/esm/components/Courses/Courses.js +2 -2
- package/lib/esm/components/EditCourse/Customize.js +1 -1
- package/lib/esm/constants/Course.d.ts +4 -0
- package/lib/esm/constants/Course.js +5 -0
- package/lib/esm/index.d.ts +2 -1
- package/lib/esm/index.js +2 -1
- package/lib/esm/shared/AccordionLessons/AccordionLessons.js +4 -4
- package/lib/umd/react-ui.js +1 -1
- package/package.json +8 -8
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { WidgetProps } from '../Widget';
|
|
2
|
+
import { CreateCourseButtonProps } from '../CreateCourseButton';
|
|
2
3
|
export interface CourseSkeletonProps extends WidgetProps {
|
|
4
|
+
/**
|
|
5
|
+
* Props to spread to CreateCourseButton component
|
|
6
|
+
* @default {}
|
|
7
|
+
*/
|
|
8
|
+
CreateCourseButtonComponentProps?: CreateCourseButtonProps;
|
|
3
9
|
/**
|
|
4
10
|
* Overrides or extends the styles applied to the component.
|
|
5
11
|
* @default null
|
|
@@ -51,9 +51,9 @@ function CourseCreatePlaceholder(inProps) {
|
|
|
51
51
|
props: inProps,
|
|
52
52
|
name: constants_1.PREFIX
|
|
53
53
|
});
|
|
54
|
-
const { className } = props, rest = tslib_1.__rest(props, ["className"]);
|
|
54
|
+
const { CreateCourseButtonComponentProps = {}, className } = props, rest = tslib_1.__rest(props, ["CreateCourseButtonComponentProps", "className"]);
|
|
55
55
|
// HOOK
|
|
56
56
|
const { preferences } = (0, react_core_1.useSCPreferences)();
|
|
57
|
-
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ position: "relative", className: classes.imageWrapper }, { children: [(0, jsx_runtime_1.jsx)(material_1.CardMedia, { component: "img", image: `${preferences[react_core_1.SCPreferences.IMAGES_USER_DEFAULT_COVER].value}`, alt: "placeholder image", className: classes.image }), (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ className: classes.icon, fontSize: "large" }, { children: "courses" }))] })), (0, jsx_runtime_1.jsx)(material_1.CardActions, Object.assign({ className: classes.actions }, { children: (0, jsx_runtime_1.jsx)(CreateCourseButton_1.default, {}) }))] })));
|
|
57
|
+
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ position: "relative", className: classes.imageWrapper }, { children: [(0, jsx_runtime_1.jsx)(material_1.CardMedia, { component: "img", image: `${preferences[react_core_1.SCPreferences.IMAGES_USER_DEFAULT_COVER].value}`, alt: "placeholder image", className: classes.image }), (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ className: classes.icon, fontSize: "large" }, { children: "courses" }))] })), (0, jsx_runtime_1.jsx)(material_1.CardActions, Object.assign({ className: classes.actions }, { children: (0, jsx_runtime_1.jsx)(CreateCourseButton_1.default, Object.assign({}, CreateCourseButtonComponentProps)) }))] })));
|
|
58
58
|
}
|
|
59
59
|
exports.default = CourseCreatePlaceholder;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
4
|
const material_1 = require("@mui/material");
|
|
5
|
+
const types_1 = require("@selfcommunity/types");
|
|
5
6
|
const react_intl_1 = require("react-intl");
|
|
6
7
|
const constants_1 = require("./constants");
|
|
7
8
|
const react_1 = require("react");
|
|
@@ -30,12 +31,13 @@ function HeaderCourseDashboard(props) {
|
|
|
30
31
|
}
|
|
31
32
|
}, [course, hasAction]);
|
|
32
33
|
const iconData = (0, react_1.useMemo)(() => {
|
|
34
|
+
const underId = (course === null || course === void 0 ? void 0 : course.privacy) === types_1.SCCoursePrivacyType.DRAFT ? 'draft' : course === null || course === void 0 ? void 0 : course.privacy;
|
|
33
35
|
return [
|
|
34
36
|
{
|
|
35
37
|
id: 'ui.course.label',
|
|
36
38
|
icon: 'public',
|
|
37
39
|
key: 'privacy',
|
|
38
|
-
underId: `ui.course.privacy.${
|
|
40
|
+
underId: `ui.course.privacy.${underId}`
|
|
39
41
|
},
|
|
40
42
|
{
|
|
41
43
|
id: 'ui.course.type',
|
|
@@ -28,6 +28,7 @@ const classes = {
|
|
|
28
28
|
root: `${constants_1.PREFIX}-root`,
|
|
29
29
|
studentContainer: `${constants_1.PREFIX}-student-container`,
|
|
30
30
|
userWrapper: `${constants_1.PREFIX}-user-wrapper`,
|
|
31
|
+
actionsWrapper: `${constants_1.PREFIX}-actions-wrapper`,
|
|
31
32
|
user: `${constants_1.PREFIX}-user`,
|
|
32
33
|
avatar: `${constants_1.PREFIX}-avatar`,
|
|
33
34
|
progress: `${constants_1.PREFIX}-progress`,
|
|
@@ -112,12 +113,12 @@ function Student(inProps) {
|
|
|
112
113
|
if (!scCourse) {
|
|
113
114
|
return (0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", variant: "rounded", width: "160px", height: "28px" });
|
|
114
115
|
}
|
|
115
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({
|
|
116
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.actionsWrapper }, { children: [((scCourse === null || scCourse === void 0 ? void 0 : scCourse.join_status) === types_1.SCCourseJoinStatusType.CREATOR || (scCourse === null || scCourse === void 0 ? void 0 : scCourse.join_status) === types_1.SCCourseJoinStatusType.MANAGER) && ((0, jsx_runtime_1.jsx)(ActionButton_1.default, { labelId: messages.dashboard, to: scRoutingContext.url(react_core_1.SCRoutes.COURSE_DASHBOARD_ROUTE_NAME, scCourse), color: "inherit", variant: "outlined" })), ((scCourse === null || scCourse === void 0 ? void 0 : scCourse.join_status) === types_1.SCCourseJoinStatusType.MANAGER || (scCourse === null || scCourse === void 0 ? void 0 : scCourse.join_status) === types_1.SCCourseJoinStatusType.JOINED) &&
|
|
116
117
|
((scCourse === null || scCourse === void 0 ? void 0 : scCourse.join_status) !== null || scCourse.privacy !== types_1.SCCoursePrivacyType.PRIVATE) &&
|
|
117
118
|
scCourse.user_completion_rate < 100 && ((0, jsx_runtime_1.jsx)(ActionButton_1.default, { labelId: scCourse.num_lessons_completed === 0 ? messages.start : messages.continue, to: scRoutingContext.url(react_core_1.SCRoutes.COURSE_LESSON_ROUTE_NAME, getUrlNextLesson(scCourse)) })), scCourse.privacy === types_1.SCCoursePrivacyType.PRIVATE &&
|
|
118
119
|
(scCourse.join_status === null || scCourse.join_status === types_1.SCCourseJoinStatusType.REQUESTED) && ((0, jsx_runtime_1.jsx)(ActionButton_1.default, { labelId: sentRequest ? messages.cancel : messages.request, color: "inherit", variant: "outlined", loading: loadingRequest, onClick: handleRequest }))] })));
|
|
119
120
|
}, [scCourse, sentRequest, loadingRequest, handleRequest]);
|
|
120
|
-
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, classes.studentContainer, className) }, rest, { children: [(0, jsx_runtime_1.jsx)(Header_1.default, { course: scCourse }), (0, jsx_runtime_1.jsx)(material_1.Divider, {}), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.userWrapper }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.user }, { children: [scCourse ? ((0, jsx_runtime_1.jsx)(material_1.Avatar, { className: classes.avatar, src: scCourse.created_by.avatar, alt: scCourse.created_by.username })) : ((0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", variant: "circular", className: classes.avatar })), (0, jsx_runtime_1.jsx)(material_1.Box, { children: scCourse ? ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: scCourse.created_by.username })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children:
|
|
121
|
+
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, classes.studentContainer, className) }, rest, { children: [(0, jsx_runtime_1.jsx)(Header_1.default, { course: scCourse }), (0, jsx_runtime_1.jsx)(material_1.Divider, {}), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.userWrapper }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.user }, { children: [scCourse ? ((0, jsx_runtime_1.jsx)(material_1.Avatar, { className: classes.avatar, src: scCourse.created_by.avatar, alt: scCourse.created_by.username })) : ((0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", variant: "circular", className: classes.avatar })), (0, jsx_runtime_1.jsx)(material_1.Box, { children: scCourse ? ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: scCourse.created_by.username })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.course.dashboard.header.user.creator", defaultMessage: "ui.course.dashboard.header.user.creator" }) }))] })) : ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", variant: "text", width: "105px", height: "21px" }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", variant: "text", width: "74px", height: "21px" })] })) })] })), actionButton] })), (0, jsx_runtime_1.jsx)(material_1.Divider, {}), ((scCourse === null || scCourse === void 0 ? void 0 : scCourse.join_status) === types_1.SCCourseJoinStatusType.CREATOR ||
|
|
121
122
|
(scCourse === null || scCourse === void 0 ? void 0 : scCourse.join_status) === types_1.SCCourseJoinStatusType.MANAGER ||
|
|
122
123
|
(scCourse === null || scCourse === void 0 ? void 0 : scCourse.join_status) === types_1.SCCourseJoinStatusType.JOINED ||
|
|
123
124
|
(scCourse === null || scCourse === void 0 ? void 0 : scCourse.privacy) !== types_1.SCCoursePrivacyType.PRIVATE) && ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h6", className: classes.margin }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.course.dashboard.student.description", defaultMessage: "ui.course.dashboard.student.description" }) })), (0, jsx_runtime_1.jsx)(material_1.Stack, Object.assign({ className: classes.box }, { children: scCourse ? (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: scCourse.description })) : (0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", variant: "text", height: "130px" }) }))] })), ((scCourse === null || scCourse === void 0 ? void 0 : scCourse.join_status) === types_1.SCCourseJoinStatusType.MANAGER || (scCourse === null || scCourse === void 0 ? void 0 : scCourse.join_status) === types_1.SCCourseJoinStatusType.JOINED) && ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h6", className: classes.margin }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.course.dashboard.student.progress", defaultMessage: "ui.course.dashboard.student.description" }) })), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.box }, { children: [(0, jsx_runtime_1.jsx)(material_1.Stack, Object.assign({ className: classes.percentageWrapper }, { children: scCourse ? ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.course.dashboard.student.progress.described", defaultMessage: "ui.course.dashboard.student.progress.described", values: { progress: scCourse.num_lessons_completed, end: scCourse.num_lessons } }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.course.dashboard.student.progress.percentage", defaultMessage: "ui.course.dashboard.student.progress.percentage", values: { percentage: scCourse.user_completion_rate } }) }))] })) : ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", variant: "text", width: "168px", height: "19px" }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", variant: "text", width: "108px", height: "19px" })] })) })), (0, jsx_runtime_1.jsx)(material_1.LinearProgress, { className: classes.progress, variant: "determinate", value: scCourse === null || scCourse === void 0 ? void 0 : scCourse.user_completion_rate })] })), (scCourse === null || scCourse === void 0 ? void 0 : scCourse.user_completion_rate) === 100 && ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: (0, classnames_1.default)(classes.completedWrapper, classes.margin) }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h3" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.course.dashboard.student.completed", defaultMessage: "ui.course.dashboard.student.completed" }) })), (0, jsx_runtime_1.jsx)("img", { src: clapping_1.CLAPPING, alt: intl.formatMessage({ id: 'ui.course.dashboard.student.completed', defaultMessage: 'ui.course.dashboard.student.completed' }), width: 32, height: 32 })] }))), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h6", className: classes.margin }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.course.dashboard.student.contents", defaultMessage: "ui.course.dashboard.student.contents" }) })), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.lessonsSections }, { children: [scCourse ? ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h5" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.course.table.sections.title", defaultMessage: "ui.course.table.sections.title", values: {
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
|
-
import { CourseDashboardPage } from './types';
|
|
3
2
|
import { SCCourseType } from '@selfcommunity/types';
|
|
4
3
|
export interface TeacherCourseDashboardProps {
|
|
5
4
|
courseId?: number;
|
|
6
5
|
course?: SCCourseType;
|
|
7
|
-
page: CourseDashboardPage;
|
|
8
|
-
onTabChange: (page: CourseDashboardPage) => void;
|
|
9
6
|
className?: HTMLAttributes<HTMLDivElement>['className'];
|
|
10
7
|
[p: string]: any;
|
|
11
8
|
}
|
|
@@ -43,15 +43,14 @@ function Teacher(inProps) {
|
|
|
43
43
|
props: inProps,
|
|
44
44
|
name: constants_1.PREFIX
|
|
45
45
|
});
|
|
46
|
-
const { courseId, course,
|
|
46
|
+
const { courseId, course, className } = props, rest = tslib_1.__rest(props, ["courseId", "course", "className"]);
|
|
47
47
|
// STATES
|
|
48
|
-
const [tabValue, setTabValue] = (0, react_1.useState)(types_1.TabContentEnum
|
|
48
|
+
const [tabValue, setTabValue] = (0, react_1.useState)(types_1.TabContentEnum.STUDENTS);
|
|
49
49
|
// HOOKS
|
|
50
50
|
const { scCourse } = (0, react_core_1.useSCFetchCourse)({ id: courseId, course, params: { view: api_services_1.CourseInfoViewType.DASHBOARD } });
|
|
51
51
|
// HANDLERS
|
|
52
52
|
const handleTabChange = (0, react_1.useCallback)((_evt, newTabValue) => {
|
|
53
53
|
setTabValue(newTabValue);
|
|
54
|
-
onTabChange(types_1.TabContentEnum[newTabValue]);
|
|
55
54
|
}, [setTabValue]);
|
|
56
55
|
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: "first" }), (0, jsx_runtime_1.jsx)(Info_1.default, { title: "ui.course.dashboard.teacher.info.completion", course: scCourse, position: "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.TabContentEnum.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.TabContentEnum.COMMENTS }, { children: (0, jsx_runtime_1.jsx)(Comments_1.default, { course: scCourse }) }))] }))] })));
|
|
57
56
|
}
|
|
@@ -1,24 +1,5 @@
|
|
|
1
|
-
export declare type CourseDashboardPage = 'students' | 'comments';
|
|
2
1
|
export declare type TabContentType = '1' | '2';
|
|
3
2
|
export declare enum TabContentEnum {
|
|
4
3
|
STUDENTS = "1",
|
|
5
4
|
COMMENTS = "2"
|
|
6
5
|
}
|
|
7
|
-
declare type LessonsUserType = {
|
|
8
|
-
id: number;
|
|
9
|
-
name: string;
|
|
10
|
-
avatar: string;
|
|
11
|
-
date: string;
|
|
12
|
-
comment: string;
|
|
13
|
-
};
|
|
14
|
-
declare type CommentsLessonType = {
|
|
15
|
-
id: number;
|
|
16
|
-
name: string;
|
|
17
|
-
users: LessonsUserType[];
|
|
18
|
-
};
|
|
19
|
-
export declare type CommentsType = {
|
|
20
|
-
total: number;
|
|
21
|
-
next: boolean;
|
|
22
|
-
lessons: CommentsLessonType[];
|
|
23
|
-
};
|
|
24
|
-
export {};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { BoxProps } from '@mui/material';
|
|
2
2
|
import { SCCourseType } from '@selfcommunity/types';
|
|
3
|
-
|
|
4
|
-
GENERAL = "general",
|
|
5
|
-
CUSTOMIZATION = "customization"
|
|
6
|
-
}
|
|
3
|
+
import { SCCourseFormStepType } from '../../constants/Course';
|
|
7
4
|
export interface CourseFormProps extends BoxProps {
|
|
8
5
|
/**
|
|
9
6
|
* Overrides or extends the styles applied to the component.
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SCCourseFormStepType = void 0;
|
|
4
3
|
const tslib_1 = require("tslib");
|
|
5
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
5
|
const lab_1 = require("@mui/lab");
|
|
@@ -63,11 +62,6 @@ const Root = (0, styles_1.styled)(material_1.Box, {
|
|
|
63
62
|
name: constants_1.PREFIX,
|
|
64
63
|
slot: 'Root'
|
|
65
64
|
})(() => ({}));
|
|
66
|
-
var SCCourseFormStepType;
|
|
67
|
-
(function (SCCourseFormStepType) {
|
|
68
|
-
SCCourseFormStepType["GENERAL"] = "general";
|
|
69
|
-
SCCourseFormStepType["CUSTOMIZATION"] = "customization";
|
|
70
|
-
})(SCCourseFormStepType = exports.SCCourseFormStepType || (exports.SCCourseFormStepType = {}));
|
|
71
65
|
/**
|
|
72
66
|
*> API documentation for the Community-JS Course Form component. Learn about the available props and the CSS API.
|
|
73
67
|
*
|
|
@@ -109,7 +103,7 @@ function CourseForm(inProps) {
|
|
|
109
103
|
props: inProps,
|
|
110
104
|
name: constants_1.PREFIX
|
|
111
105
|
});
|
|
112
|
-
const { className, onSuccess, onError, course = null, step = SCCourseFormStepType.GENERAL } = props, rest = tslib_1.__rest(props, ["className", "onSuccess", "onError", "course", "step"]);
|
|
106
|
+
const { className, onSuccess, onError, course = null, step = Course_1.SCCourseFormStepType.GENERAL } = props, rest = tslib_1.__rest(props, ["className", "onSuccess", "onError", "course", "step"]);
|
|
113
107
|
// INTL
|
|
114
108
|
const intl = (0, react_intl_1.useIntl)();
|
|
115
109
|
const initialFieldState = {
|
|
@@ -254,20 +248,20 @@ function CourseForm(inProps) {
|
|
|
254
248
|
/**
|
|
255
249
|
* Renders root object
|
|
256
250
|
*/
|
|
257
|
-
return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: _step === SCCourseFormStepType.GENERAL ? classes.stepOne : classes.stepTwo }, { children: [_step === SCCourseFormStepType.GENERAL && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: Object.values(types_1.SCCourseTypologyType).map((option, index) => ((0, jsx_runtime_1.jsx)(material_1.Card, Object.assign({ className: (0, classnames_1.default)(classes.card, { [classes.selected]: option === field.type }) }, { children: (0, jsx_runtime_1.jsx)(material_1.CardActionArea, Object.assign({ onClick: () => setField((prev) => (Object.assign(Object.assign({}, prev), { ['type']: option }))) }, { children: (0, jsx_runtime_1.jsxs)(material_1.CardContent, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "subtitle2" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: `ui.courseForm.${option}.title`, defaultMessage: `ui.courseForm.${option}.title` }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: `ui.courseForm.${option}.info`, defaultMessage: `ui.courseForm.${option}.info` }) }))] }) })) }), index))) })), _step === SCCourseFormStepType.CUSTOMIZATION && ((0, jsx_runtime_1.jsxs)(material_1.FormGroup, Object.assign({ className: classes.form }, { children: [course && ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h5" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.courseForm.edit.title.general", defaultMessage: "ui.courseForm.edit.title.general" }) }))), (0, jsx_runtime_1.jsx)(material_1.Paper, Object.assign({ style: _backgroundCover, classes: { root: classes.cover } }, { children: (0, jsx_runtime_1.jsx)(UploadCourseCover_1.default, { isCreationMode: true, onChange: handleChangeCover }) })), (0, jsx_runtime_1.jsx)(material_1.TextField, { required: true, className: classes.name, placeholder: `${intl.formatMessage(messages.name)}`, margin: "normal", value: field.name, name: "name", onChange: handleChange, InputProps: {
|
|
251
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: _step === Course_1.SCCourseFormStepType.GENERAL ? classes.stepOne : classes.stepTwo }, { children: [_step === Course_1.SCCourseFormStepType.GENERAL && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: Object.values(types_1.SCCourseTypologyType).map((option, index) => ((0, jsx_runtime_1.jsx)(material_1.Card, Object.assign({ className: (0, classnames_1.default)(classes.card, { [classes.selected]: option === field.type }) }, { children: (0, jsx_runtime_1.jsx)(material_1.CardActionArea, Object.assign({ onClick: () => setField((prev) => (Object.assign(Object.assign({}, prev), { ['type']: option }))) }, { children: (0, jsx_runtime_1.jsxs)(material_1.CardContent, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "subtitle2" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: `ui.courseForm.${option}.title`, defaultMessage: `ui.courseForm.${option}.title` }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: `ui.courseForm.${option}.info`, defaultMessage: `ui.courseForm.${option}.info` }) }))] }) })) }), index))) })), _step === Course_1.SCCourseFormStepType.CUSTOMIZATION && ((0, jsx_runtime_1.jsxs)(material_1.FormGroup, Object.assign({ className: classes.form }, { children: [course && ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h5" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.courseForm.edit.title.general", defaultMessage: "ui.courseForm.edit.title.general" }) }))), (0, jsx_runtime_1.jsx)(material_1.Paper, Object.assign({ style: _backgroundCover, classes: { root: classes.cover } }, { children: (0, jsx_runtime_1.jsx)(UploadCourseCover_1.default, { isCreationMode: true, onChange: handleChangeCover }) })), (0, jsx_runtime_1.jsx)(material_1.TextField, { required: true, className: classes.name, placeholder: `${intl.formatMessage(messages.name)}`, margin: "normal", value: field.name, name: "name", onChange: handleChange, InputProps: {
|
|
258
252
|
endAdornment: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: Course_1.COURSE_TITLE_MAX_LENGTH - field.name.length }))
|
|
259
253
|
}, error: Boolean(field.name.length > Course_1.COURSE_TITLE_MAX_LENGTH) || Boolean(error['nameError']), helperText: field.name.length > Course_1.COURSE_TITLE_MAX_LENGTH ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.courseForm.name.error.maxLength", defaultMessage: "ui.courseForm.name.error.maxLength" })) : error['nameError'] ? (error['nameError']) : null }), (0, jsx_runtime_1.jsx)(material_1.TextField, { multiline: true, className: classes.description, placeholder: `${intl.formatMessage(messages.description)}`, margin: "normal", value: field.description, name: "description", onChange: handleChange, InputProps: {
|
|
260
254
|
endAdornment: ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: ((_a = field.description) === null || _a === void 0 ? void 0 : _a.length) ? Course_1.COURSE_DESCRIPTION_MAX_LENGTH - field.description.length : Course_1.COURSE_DESCRIPTION_MAX_LENGTH })))
|
|
261
|
-
}, error: Boolean(((_b = field.description) === null || _b === void 0 ? void 0 : _b.length) > Course_1.COURSE_DESCRIPTION_MAX_LENGTH), helperText: ((_c = field.description) === null || _c === void 0 ? void 0 : _c.length) > Course_1.COURSE_DESCRIPTION_MAX_LENGTH ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.courseForm.description.error.maxLength", defaultMessage: "ui.courseForm.description.error.maxLength" })) : null }), (0, jsx_runtime_1.jsx)(CategoryAutocomplete_1.default, { defaultValue: field.categories, TextFieldProps: { label: intl.formatMessage(Object.keys(field.categories).length ? messages.category : messages.categoryEmpty) }, multiple: true, onChange: handleOnChangeCategory }), course && (0, jsx_runtime_1.jsx)(Edit_1.default, { course: course, onPrivacyChange: (privacy) => setField((prev) => (Object.assign(Object.assign({}, prev), { ['privacy']: privacy }))) })] }))), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.actions }, { children: (0, jsx_runtime_1.jsx)(lab_1.LoadingButton, Object.assign({ size: "small", loading: field.isSubmitting, disabled: _step === SCCourseFormStepType.GENERAL
|
|
255
|
+
}, error: Boolean(((_b = field.description) === null || _b === void 0 ? void 0 : _b.length) > Course_1.COURSE_DESCRIPTION_MAX_LENGTH), helperText: ((_c = field.description) === null || _c === void 0 ? void 0 : _c.length) > Course_1.COURSE_DESCRIPTION_MAX_LENGTH ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.courseForm.description.error.maxLength", defaultMessage: "ui.courseForm.description.error.maxLength" })) : null }), (0, jsx_runtime_1.jsx)(CategoryAutocomplete_1.default, { defaultValue: field.categories, TextFieldProps: { label: intl.formatMessage(Object.keys(field.categories).length ? messages.category : messages.categoryEmpty) }, multiple: true, onChange: handleOnChangeCategory }), course && (0, jsx_runtime_1.jsx)(Edit_1.default, { course: course, onPrivacyChange: (privacy) => setField((prev) => (Object.assign(Object.assign({}, prev), { ['privacy']: privacy }))) })] }))), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.actions }, { children: (0, jsx_runtime_1.jsx)(lab_1.LoadingButton, Object.assign({ size: "small", loading: field.isSubmitting, disabled: _step === Course_1.SCCourseFormStepType.GENERAL
|
|
262
256
|
? !field.type || Object.keys(error).length !== 0
|
|
263
|
-
: _step === SCCourseFormStepType.CUSTOMIZATION &&
|
|
257
|
+
: _step === Course_1.SCCourseFormStepType.CUSTOMIZATION &&
|
|
264
258
|
(!field.name ||
|
|
265
259
|
Object.keys(error).length !== 0 ||
|
|
266
260
|
field.name.length > Course_1.COURSE_TITLE_MAX_LENGTH ||
|
|
267
|
-
field.description.length > Course_1.COURSE_DESCRIPTION_MAX_LENGTH), variant: "contained", onClick: _step === SCCourseFormStepType.GENERAL
|
|
268
|
-
? () => handleChangeStep(SCCourseFormStepType.CUSTOMIZATION)
|
|
261
|
+
field.description.length > Course_1.COURSE_DESCRIPTION_MAX_LENGTH), variant: "contained", onClick: _step === Course_1.SCCourseFormStepType.GENERAL
|
|
262
|
+
? () => handleChangeStep(Course_1.SCCourseFormStepType.CUSTOMIZATION)
|
|
269
263
|
: field.privacy !== types_1.SCCoursePrivacyType.DRAFT && course.privacy === types_1.SCCoursePrivacyType.DRAFT
|
|
270
264
|
? () => setOpenDialog(true)
|
|
271
|
-
: handleSubmit, color: "primary" }, { children: course ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.courseForm.edit.action.save", defaultMessage: "ui.courseForm.edit.action.save" })) : _step === SCCourseFormStepType.GENERAL ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.courseForm.button.next", defaultMessage: "ui.courseForm.button.next" })) : ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.courseForm.button.create", defaultMessage: "ui.courseForm.button.create" })) })) }))] })) })), openDialog && (0, jsx_runtime_1.jsx)(Dialog_1.default, { onSubmit: handleSubmit, onClose: handleClose })] }));
|
|
265
|
+
: handleSubmit, color: "primary" }, { children: course ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.courseForm.edit.action.save", defaultMessage: "ui.courseForm.edit.action.save" })) : _step === Course_1.SCCourseFormStepType.GENERAL ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.courseForm.button.next", defaultMessage: "ui.courseForm.button.next" })) : ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.courseForm.button.create", defaultMessage: "ui.courseForm.button.create" })) })) }))] })) })), openDialog && (0, jsx_runtime_1.jsx)(Dialog_1.default, { onSubmit: handleSubmit, onClose: handleClose })] }));
|
|
272
266
|
}
|
|
273
267
|
exports.default = CourseForm;
|
|
@@ -10,7 +10,7 @@ const BaseDialog_1 = tslib_1.__importDefault(require("../../shared/BaseDialog"))
|
|
|
10
10
|
const constants_1 = require("./constants");
|
|
11
11
|
const CourseForm_1 = tslib_1.__importDefault(require("../CourseForm"));
|
|
12
12
|
const react_1 = require("react");
|
|
13
|
-
const
|
|
13
|
+
const Course_1 = require("../../constants/Course");
|
|
14
14
|
const classes = {
|
|
15
15
|
root: `${constants_1.PREFIX}-root`
|
|
16
16
|
};
|
|
@@ -43,7 +43,7 @@ function CourseFormDialog(inProps) {
|
|
|
43
43
|
props: inProps,
|
|
44
44
|
name: constants_1.PREFIX
|
|
45
45
|
});
|
|
46
|
-
const { className, open = true, onClose, CourseFormComponentProps = { step:
|
|
46
|
+
const { className, open = true, onClose, CourseFormComponentProps = { step: Course_1.SCCourseFormStepType.GENERAL } } = props, rest = tslib_1.__rest(props, ["className", "open", "onClose", "CourseFormComponentProps"]);
|
|
47
47
|
const handleSuccess = (0, react_1.useCallback)((course) => {
|
|
48
48
|
var _a;
|
|
49
49
|
(_a = CourseFormComponentProps.onSuccess) === null || _a === void 0 ? void 0 : _a.call(CourseFormComponentProps, course);
|
|
@@ -2,6 +2,7 @@ import { GridProps } from '@mui/material';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { CourseProps, CourseSkeletonProps } from '../Course';
|
|
4
4
|
import { CoursesSkeletonProps } from '../Courses/Skeleton';
|
|
5
|
+
import { CreateCourseButtonProps } from '../CreateCourseButton';
|
|
5
6
|
export declare const CoursesChipRoot: import("@emotion/styled").StyledComponent<import("@mui/material").ChipOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
6
7
|
ref?: React.Ref<HTMLDivElement>;
|
|
7
8
|
}, "avatar" | "className" | "style" | "classes" | "label" | "tabIndex" | "color" | "children" | "sx" | "variant" | "disabled" | "size" | "icon" | "clickable" | "deleteIcon" | "onDelete" | "skipFocusWhenDisabled"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -31,6 +32,11 @@ export interface CoursesProps {
|
|
|
31
32
|
* @default {}
|
|
32
33
|
*/
|
|
33
34
|
CoursesSkeletonComponentProps?: CoursesSkeletonProps;
|
|
35
|
+
/**
|
|
36
|
+
* Props to spread to CreateCourseButton component
|
|
37
|
+
* @default {}
|
|
38
|
+
*/
|
|
39
|
+
CreateCourseButtonComponentProps?: CreateCourseButtonProps;
|
|
34
40
|
/**
|
|
35
41
|
* Props spread to grid container
|
|
36
42
|
* @default {}
|
|
@@ -88,7 +88,7 @@ function Courses(inProps) {
|
|
|
88
88
|
props: inProps,
|
|
89
89
|
name: constants_1.PREFIX
|
|
90
90
|
});
|
|
91
|
-
const { endpointQueryParams = { limit: 8, offset: Pagination_1.DEFAULT_PAGINATION_OFFSET }, className, CourseComponentProps = {}, CoursesSkeletonComponentProps = {}, CourseSkeletonComponentProps = { template: course_1.SCCourseTemplateType.PREVIEW }, GridContainerComponentProps = {}, GridItemComponentProps = {}, showFilters = true, filters } = props, rest = tslib_1.__rest(props, ["endpointQueryParams", "className", "CourseComponentProps", "CoursesSkeletonComponentProps", "CourseSkeletonComponentProps", "GridContainerComponentProps", "GridItemComponentProps", "showFilters", "filters"]);
|
|
91
|
+
const { endpointQueryParams = { limit: 8, offset: Pagination_1.DEFAULT_PAGINATION_OFFSET }, className, CourseComponentProps = {}, CoursesSkeletonComponentProps = {}, CourseSkeletonComponentProps = { template: course_1.SCCourseTemplateType.PREVIEW }, CreateCourseButtonComponentProps = {}, GridContainerComponentProps = {}, GridItemComponentProps = {}, showFilters = true, filters } = props, rest = tslib_1.__rest(props, ["endpointQueryParams", "className", "CourseComponentProps", "CoursesSkeletonComponentProps", "CourseSkeletonComponentProps", "CreateCourseButtonComponentProps", "GridContainerComponentProps", "GridItemComponentProps", "showFilters", "filters"]);
|
|
92
92
|
// STATE
|
|
93
93
|
const [courses, setCourses] = (0, react_1.useState)([]);
|
|
94
94
|
const [loading, setLoading] = (0, react_1.useState)(true);
|
|
@@ -224,7 +224,7 @@ function Courses(inProps) {
|
|
|
224
224
|
// @ts-expect-error this is needed to use showForMe into SCCourses
|
|
225
225
|
showForMe: showMyCourses, deleteIcon: showMyCourses ? (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "close" }) : null, onDelete: showMyCourses ? () => setShowMyCourses(false) : null, disabled: loading || showForMe }) }))), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, md: "auto" }, { children: (0, jsx_runtime_1.jsx)(material_1.FormControl, Object.assign({ fullWidth: true }, { children: (0, jsx_runtime_1.jsx)(CategoryAutocomplete_1.default, { onChange: handleOnChangeCategory, className: classes.category, size: "small", multiple: true }) })) })), authUserId && ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true }, { children: (0, jsx_runtime_1.jsx)(exports.CoursesChipRoot, { color: showForMe ? 'primary' : 'default', variant: showForMe ? 'filled' : 'outlined', label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.courses.filterByCoursesForMe", defaultMessage: "ui.courses.filterByCoursesForMe" }), onClick: handleChipClick,
|
|
226
226
|
// @ts-expect-error this is needed to use showForMe into SCCourses
|
|
227
|
-
showForMe: showForMe, deleteIcon: showForMe ? (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "close" }) : null, onDelete: showForMe ? handleDeleteClick : null, disabled: loading || showMyCourses }) })))] })) }))), (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: loading ? ((0, jsx_runtime_1.jsx)(Skeleton_1.default, Object.assign({}, CoursesSkeletonComponentProps, { CourseSkeletonProps: CourseSkeletonComponentProps }))) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: !courses.length ? ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.noResults }, { children: !canCreateCourse && onlyStaffEnabled ? ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.studentEmptyView }, { children: [(0, jsx_runtime_1.jsx)(material_1.Stack, Object.assign({ className: classes.emptyBox }, { children: (0, jsx_runtime_1.jsx)(material_1.Stack, Object.assign({ className: classes.emptyRotatedBox }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ className: classes.emptyIcon, color: "disabled", fontSize: "large" }, { children: "courses" })) })) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h5", textAlign: "center" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.courses.empty.title", defaultMessage: "ui.courses.empty.title" }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1", textAlign: "center" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.courses.empty.info", defaultMessage: "ui.courses.empty.info" }) })), (0, jsx_runtime_1.jsx)(Skeleton_1.default, Object.assign({ coursesNumber: 4 }, CoursesSkeletonComponentProps, { CourseSkeletonProps: CourseSkeletonComponentProps }))] }))) : ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.teacherEmptyView }, { children: (0, jsx_runtime_1.jsx)(Skeleton_1.default, Object.assign({ teacherView: (onlyStaffEnabled && canCreateCourse) || !onlyStaffEnabled, coursesNumber: 1 }, CoursesSkeletonComponentProps, { CourseSkeletonProps: CourseSkeletonComponentProps })) }))) }))) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, spacing: { xs: 2 }, className: classes.courses }, GridContainerComponentProps, { children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [courses.map((course) => ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, sm: 12, md: 6, lg: 3, className: classes.item }, GridItemComponentProps, { children: (0, jsx_runtime_1.jsx)(Course_1.default, Object.assign({ courseId: course.id }, CourseComponentProps)) }), course.id))), authUserId && courses.length % 2 !== 0 && ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, sm: 12, md: 6, lg: 3, className: classes.itemPlaceholder }, GridItemComponentProps, { children: (0, jsx_runtime_1.jsx)(CreatePlaceholder_1.default, {}) }), 'placeholder-item'))] }) })), Boolean(next) && ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ color: "secondary", variant: "text", onClick: handleNext, className: classes.showMore }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.courses.button.seeMore", defaultMessage: "ui.courses.button.seeMore" }) })))] })) })) })] }));
|
|
227
|
+
showForMe: showForMe, deleteIcon: showForMe ? (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "close" }) : null, onDelete: showForMe ? handleDeleteClick : null, disabled: loading || showMyCourses }) })))] })) }))), (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: loading ? ((0, jsx_runtime_1.jsx)(Skeleton_1.default, Object.assign({}, CoursesSkeletonComponentProps, { CourseSkeletonProps: CourseSkeletonComponentProps }))) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: !courses.length ? ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.noResults }, { children: !canCreateCourse && onlyStaffEnabled ? ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.studentEmptyView }, { children: [(0, jsx_runtime_1.jsx)(material_1.Stack, Object.assign({ className: classes.emptyBox }, { children: (0, jsx_runtime_1.jsx)(material_1.Stack, Object.assign({ className: classes.emptyRotatedBox }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ className: classes.emptyIcon, color: "disabled", fontSize: "large" }, { children: "courses" })) })) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h5", textAlign: "center" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.courses.empty.title", defaultMessage: "ui.courses.empty.title" }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1", textAlign: "center" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.courses.empty.info", defaultMessage: "ui.courses.empty.info" }) })), (0, jsx_runtime_1.jsx)(Skeleton_1.default, Object.assign({ coursesNumber: 4 }, CoursesSkeletonComponentProps, { CourseSkeletonProps: CourseSkeletonComponentProps }))] }))) : ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.teacherEmptyView }, { children: (0, jsx_runtime_1.jsx)(Skeleton_1.default, Object.assign({ teacherView: (onlyStaffEnabled && canCreateCourse) || !onlyStaffEnabled, coursesNumber: 1 }, CoursesSkeletonComponentProps, { CourseSkeletonProps: CourseSkeletonComponentProps })) }))) }))) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, spacing: { xs: 2 }, className: classes.courses }, GridContainerComponentProps, { children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [courses.map((course) => ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, sm: 12, md: 6, lg: 3, className: classes.item }, GridItemComponentProps, { children: (0, jsx_runtime_1.jsx)(Course_1.default, Object.assign({ courseId: course.id }, CourseComponentProps)) }), course.id))), authUserId && courses.length % 2 !== 0 && ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, sm: 12, md: 6, lg: 3, className: classes.itemPlaceholder }, GridItemComponentProps, { children: (0, jsx_runtime_1.jsx)(CreatePlaceholder_1.default, { CreateCourseButtonComponentProps: CreateCourseButtonComponentProps }) }), 'placeholder-item'))] }) })), Boolean(next) && ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ color: "secondary", variant: "text", onClick: handleNext, className: classes.showMore }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.courses.button.seeMore", defaultMessage: "ui.courses.button.seeMore" }) })))] })) })) })] }));
|
|
228
228
|
/**
|
|
229
229
|
* Renders root object (if content availability community option is false and user is anonymous, component is hidden)
|
|
230
230
|
*/
|
|
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const CourseForm_1 = tslib_1.__importDefault(require("../CourseForm"));
|
|
6
|
-
const CourseForm_2 = require("../CourseForm/CourseForm");
|
|
7
6
|
const react_1 = require("react");
|
|
8
7
|
const notistack_1 = require("notistack");
|
|
9
8
|
const react_intl_1 = require("react-intl");
|
|
10
9
|
const Skeleton_1 = tslib_1.__importDefault(require("../CourseForm/Skeleton"));
|
|
10
|
+
const Course_1 = require("../../constants/Course");
|
|
11
11
|
function Customize(props) {
|
|
12
12
|
// PROPS
|
|
13
13
|
const { course, setSCCourse } = props;
|
|
@@ -30,6 +30,6 @@ function Customize(props) {
|
|
|
30
30
|
if (!course) {
|
|
31
31
|
return (0, jsx_runtime_1.jsx)(Skeleton_1.default, {});
|
|
32
32
|
}
|
|
33
|
-
return (0, jsx_runtime_1.jsx)(CourseForm_1.default, { course: course, step:
|
|
33
|
+
return (0, jsx_runtime_1.jsx)(CourseForm_1.default, { course: course, step: Course_1.SCCourseFormStepType.CUSTOMIZATION, onSuccess: handleSuccess, onError: handleError });
|
|
34
34
|
}
|
|
35
35
|
exports.default = (0, react_1.memo)(Customize);
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.COURSE_DESCRIPTION_MAX_LENGTH = exports.COURSE_TITLE_MAX_LENGTH = void 0;
|
|
3
|
+
exports.SCCourseFormStepType = exports.COURSE_DESCRIPTION_MAX_LENGTH = exports.COURSE_TITLE_MAX_LENGTH = void 0;
|
|
4
4
|
exports.COURSE_TITLE_MAX_LENGTH = 50;
|
|
5
5
|
exports.COURSE_DESCRIPTION_MAX_LENGTH = 150;
|
|
6
|
+
var SCCourseFormStepType;
|
|
7
|
+
(function (SCCourseFormStepType) {
|
|
8
|
+
SCCourseFormStepType["GENERAL"] = "general";
|
|
9
|
+
SCCourseFormStepType["CUSTOMIZATION"] = "customization";
|
|
10
|
+
})(SCCourseFormStepType = exports.SCCourseFormStepType || (exports.SCCourseFormStepType = {}));
|
package/lib/cjs/index.d.ts
CHANGED
|
@@ -141,6 +141,7 @@ import UserSuggestionWidget, { UserSuggestionWidgetProps, UserSuggestionWidgetSk
|
|
|
141
141
|
import UserLiveStreamWidget, { UserLiveStreamWidgetProps, UserLiveStreamWidgetSkeleton } from './components/UserLiveStreamWidget';
|
|
142
142
|
import Widget, { WidgetProps } from './components/Widget';
|
|
143
143
|
import { MEDIA_EMBED_SC_LINK_TYPE, MEDIA_EMBED_SC_SHARED_EVENT, MEDIA_EMBED_SC_SHARED_OBJECT, MEDIA_TYPE_DOCUMENT, MEDIA_TYPE_EMBED, MEDIA_TYPE_EVENT, MEDIA_TYPE_IMAGE, MEDIA_TYPE_LINK, MEDIA_TYPE_SHARE, MEDIA_TYPE_URL, MEDIA_TYPE_VIDEO } from './constants/Media';
|
|
144
|
+
import { SCCourseFormStepType } from './constants/Course';
|
|
144
145
|
import AccordionLessons, { AccordionLessonsProps } from './shared/AccordionLessons';
|
|
145
146
|
import AddUsersButton, { AddUsersButtonProps } from './shared/AddUsersButton';
|
|
146
147
|
import EmptyStatus, { EmptyStatusProps } from './shared/EmptyStatus';
|
|
@@ -208,4 +209,4 @@ import DefaultCoverSelfCommunity from './assets/deafultCover';
|
|
|
208
209
|
/**
|
|
209
210
|
* List all exports
|
|
210
211
|
*/
|
|
211
|
-
export { AcceptRequestUserEventButton, AcceptRequestUserEventButtonProps, AccountChangeMailValidation, AccountChangeMailValidationProps, AccountDataPortability, AccountDataPortabilityButton, AccountDataPortabilityButtonProps, AccountDataPortabilityProps, AccountDelete, AccountDeleteButton, AccountDeleteButtonProps, AccountDeleteProps, AccountRecover, AccountRecoverProps, AccountReset, AccountResetProps, AccountVerify, AccountVerifyProps, AvatarGroupSkeleton, BaseDialog, BaseDialogProps, BaseItem, BaseItemProps, BaseLightbox, BaseLightboxProps, BottomNavigation, BottomNavigationProps, BroadcastMessages, BroadcastMessagesProps, BroadcastMessagesSkeleton, bytesToSize, generateRoomId, randomString, decodePassphrase, encodePassphrase, getCurrentSectionAndLessonIndex, Calendar, CalendarProps, Categories, CategoriesPopularWidget, CategoriesPopularWidgetSkeleton, CategoriesProps, CategoriesSkeleton, CategoriesSkeletonProps, CategoriesSuggestionWidget, CategoriesSuggestionWidgetProps, CategoriesSuggestionWidgetSkeleton, Category, CategoryAutocomplete, CategoryAutocompleteProps, CategoryFollowButton, CategoryFollowButtonProps, CategoryFollowersButton, CategoryFollowersButtonProps, CategoryHeader, CategoryHeaderProps, CategoryHeaderSkeleton, CategoryProps, CategorySkeleton, CategoryTrendingFeedWidget, CategoryTrendingFeedWidgetProps, CategoryTrendingFeedWidgetSkeleton, CategoryTrendingPeopleWidgetSkeleton, CategoryTrendingUsersWidget, CategoryTrendingUsersWidgetProps, CentralProgress, ChangeCover, ChangeCoverProps, ChangeGroupCover, ChangeGroupCoverProps, ChangeGroupPicture, ChangeGroupPictureProps, ChangePicture, ChangePictureProps, CommentObject, CommentObjectProps, CommentObjectReply, CommentObjectReplyProps, CommentObjectSkeleton, CommentsFeedObject, CommentsFeedObjectProps, CommentsFeedObjectSkeleton, CommentsObject, CommentsObjectProps, CommentsObjectSkeleton, Composer, ComposerIconButton, ComposerIconButtonProps, ComposerProps, ConfirmDialog, ConnectionUserButton, ConsentSolution, ConsentSolutionButton, ConsentSolutionButtonProps, ConsentSolutionProps, ConsentSolutionSkeleton, ContributionUtils, Course, CourseProps, CourseSkeleton, CourseSkeletonProps, CourseJoinButton, CourseJoinButtonProps, Courses, CreateCourseButton, CreateCourseButtonProps, CoursesProps, CoursesSkeleton, CoursesSkeletonProps, CourseContentMenu, CourseContentMenuProps, CourseDashboard, TeacherCourseDashboardProps, StudentCourseDashboardProps, CreateEventButton, CreateEventButtonProps, CreateEventWidget, CreateEventWidgetProps, CreateEventWidgetSkeleton, CreateGroupButton, EventForm, EventFormProps, EventFormDialog, EventFormDialogProps, CreateGroupButtonProps, CustomAdv, CustomAdvProps, CustomAdvSkeleton, DEFAULT_FIELDS, DEFAULT_PAGINATION_LIMIT, DEFAULT_PAGINATION_OFFSET, DEFAULT_PAGINATION_QUERY_PARAM_NAME, DEFAULT_PRELOAD_OFFSET_VIEWPORT, DEFAULT_WIDGETS_NUMBER, DefaultDrawerContent, DefaultDrawerContentProps, DefaultHeaderContent, DefaultHeaderContentProps, DefaultDrawerSkeleton, DefaultDrawerSkeletonProps, EditEventButton, EditEventButtonProps, EditGroupButton, EditGroupButtonProps, EditMediaProps, Editor, EditorProps, EditorSkeleton, EmailTextField, EditCourse, EditCourseProps, Event, EventActionsMenu, EventActionsMenuProps, EventHeader, EventHeaderProps, EventHeaderSkeleton, EventInfoDetails, EventInfoDetailsProps, EventInfoWidget, EventInfoWidgetProps, EventInviteButton, EventInviteButtonProps, EventLocationWidget, EventLocationWidgetProps, EventLocationWidgetSkeleton, EventMediaWidget, EventMediaWidgetProps, EventMediaWidgetSkeleton, EventMembersWidget, EventMembersWidgetProps, EventMembersWidgetSkeleton, EventParticipantsButton, EventParticipantsButtonProps, EventProps, Events, EventSkeleton, EventSkeletonProps, EventsProps, EventsSkeleton, EventsSkeletonProps, FACEBOOK_SHARE, Feed, FeedObject, FeedObjectMediaPreview, FeedObjectMediaPreviewProps, FeedObjectProps, FeedObjectSkeleton, FeedProps, FeedRef, FeedSidebarProps, FeedSkeleton, FeedUpdatesWidget, FeedUpdatesWidgetProps, FeedUpdatesWidgetSkeleton, File, FollowUserButton, FollowUserButtonProps, Footer, FooterProps, FooterSkeleton, FriendshipButtonProps, FriendshipUserButton, GenericSkeleton, getRelativeTime, getUnseenNotification, getUnseenNotificationCounter, Group, GroupActionsMenu, GroupActionsMenuProps, GroupForm, GroupFormProps, GroupHeader, GroupHeaderProps, GroupHeaderSkeleton, GroupInfoWidget, GroupInfoWidgetProps, GroupInfoWidgetSkeleton, GroupInviteButton, GroupInviteButtonProps, GroupInvitedWidget, GroupInvitedWidgetProps, GroupInvitedWidgetSkeleton, GroupMembersButton, GroupMembersButtonProps, GroupMembersWidget, GroupMembersWidgetProps, GroupMembersWidgetSkeleton, GroupProps, GroupRequestsWidget, GroupRequestsWidgetProps, GroupRequestsWidgetSkeleton, Groups, GroupSettingsIconButton, GroupSettingsIconButtonProps, GroupSkeleton, GroupsProps, GroupsSkeleton, GroupSubscribeButton, GroupSubscribeButtonProps, AccordionLessons, AccordionLessonsProps, AddUsersButton, AddUsersButtonProps, CourseUsersTable, CourseUsersTableProps, CourseUsersTableSkeleton, EmptyStatus, EmptyStatusProps, HiddenPlaceholder, Incubator, IncubatorDetail, IncubatorDetailProps, IncubatorListWidget, IncubatorListWidgetProps, IncubatorProps, IncubatorSubscribeButton, IncubatorSubscribeButtonProps, IncubatorSuggestionWidget, IncubatorSuggestionWidgetProps, InfiniteScroll, ScrollContainer, InlineComposerWidget, InlineComposerWidgetProps, InlineComposerWidgetSkeleton, InviteUserEventButton, LessonAppbar, LessonAppbarProps, LessonDrawer, LessonDrawerProps, LessonEditForm, LessonEditFormProps, LessonObject, LessonObjectProps, InviteUserEventButtonProps, LanguageSwitcher, LEGAL_POLICIES, CourseCompletedDialog, CourseCompletedDialogProps, Lightbox, LightboxProps, Link, LINKEDIN_SHARE, LocationAutocomplete, LocationAutocompleteProps, LogoSelfCommunity, DefaultCoverSelfCommunity, LoyaltyProgramWidget, LoyaltyProgramWidgetProps, LoyaltyProgramWidgetSkeleton, MAX_PRELOAD_OFFSET_VIEWPORT, MEDIA_EMBED_SC_LINK_TYPE, MEDIA_EMBED_SC_SHARED_EVENT, MEDIA_EMBED_SC_SHARED_OBJECT, MEDIA_TYPE_DOCUMENT, MEDIA_TYPE_EMBED, MEDIA_TYPE_EVENT, MEDIA_TYPE_IMAGE, MEDIA_TYPE_LINK, MEDIA_TYPE_SHARE, MEDIA_TYPE_URL, MEDIA_TYPE_VIDEO, MediaChunkUploader, MediaChunkUploaderProps, MessageUploaderUtils, MetadataField, MetadataFieldProps, MIN_PRELOAD_OFFSET_VIEWPORT, MyEventsWidget, MyEventsWidgetProps, MyEventsWidgetSkeleton, NavigationMenuContent, NavigationMenuDrawer, NavigationMenuDrawerProps, NavigationMenuHeader, NavigationMenuIconButton, NavigationMenuIconButtonProps, NavigationSettingsIconButton, NavigationSettingsIconButtonProps, NavigationSettingsItem, NavigationToolbar, NavigationToolbarMobile, NavigationToolbarMobileProps, NavigationToolbarMobileSkeleton, NavigationToolbarProps, NavigationToolbarSkeleton, Notification, NotificationProps, NotificationSkeleton, OnBoardingWidget, OnBoardingWidgetProps, OnBoardingWidgetSkeleton, PasswordTextField, PhoneTextField, PlatformWidget, PlatformWidgetActionType, PlatformWidgetProps, PlatformWidgetSkeleton, PollSuggestionWidget, PollSuggestionWidgetProps, PrivateMessageComponent, PrivateMessageComponentProps, PrivateMessageComponentSkeleton, PrivateMessageEditor, PrivateMessageEditorProps, PrivateMessageEditorSkeleton, PrivateMessageSettingsIconButton, PrivateMessageSettingsIconButtonProps, PrivateMessageSnippetItem, PrivateMessageSnippetItemProps, PrivateMessageSnippetItemSkeleton, PrivateMessageSnippets, PrivateMessageSnippetsProps, PrivateMessageSnippetsSkeleton, PrivateMessageThread, PrivateMessageThreadItem, PrivateMessageThreadItemProps, PrivateMessageThreadItemSkeleton, PrivateMessageThreadProps, PrivateMessageThreadSkeleton, ProgressBar, ProgressBarProps, RelatedEventsWidget, RelatedEventsWidgetProps, RelatedEventsWidgetSkeleton, RelatedFeedObjectsWidget, RelatedFeedObjectsWidgetSkeleton, RelatedFeedObjectWidgetProps, ReplyComment, SCBroadcastMessageTemplateType, SCCommentsOrderBy, SCEventMembersEventType, SCEventTemplateType, SCFeedObjectActivitiesType, SCFeedObjectTemplateType, SCFeedWidgetType, SCGroupMembersEventType, SCMediaChunkType, SCMediaObjectType, SCNotificationObjectTemplateType, SCUserProfileFields, SCUserProfileSettings, SCUserSocialAssociations, SearchAutocomplete, SearchAutocompleteProps, SearchDialog, SearchDialogProps, Share, SnippetNotifications, SnippetNotificationsProps, SnippetNotificationsSkeleton, StickyBox, StickyBoxComponent, StickyBoxProps, SuggestedEventsWidget, TagAutocomplete, TagAutocompleteProps, SuggestedEventsWidgetProps, SuggestedEventsWidgetSkeleton, TagChip, TagChipProps, ToastNotifications, ToastNotificationsProps, ToastNotificationsSkeleton, UrlTextField, User, UserActionIconButton, UserActionIconButtonProps, UserAvatar, UserAvatarProps, UserConnectionsRequestsSentWidget, UserConnectionsRequestsSentWidgetProps, UserConnectionsRequestsSentWidgetSkeleton, UserConnectionsRequestsWidget, UserConnectionsRequestsWidgetProps, UserConnectionsRequestsWidgetSkeleton, UserConnectionsWidget, UserConnectionsWidgetProps, UserConnectionsWidgetSkeleton, UserCounters, UserCountersProps, UserDeletedSnackBar, UserDeletedSnackBarProps, UserFollowedCategoriesWidget, UserFollowedCategoriesWidgetProps, UserFollowedCategoriesWidgetSkeleton, UserFollowedUsersWidget, UserFollowedUsersWidgetProps, UserFollowedUsersWidgetSkeleton, UserFollowersWidget, UserFollowersWidgetProps, UserFollowersWidgetSkeleton, UserInfo, UserInfoDialog, UserInfoDialogProps, UserInfoProps, UserInfoSkeleton, UsernameTextField, UserProfileBlocked, UserProfileBlockedProps, UserProfileEdit, UserProfileEditProps, UserProfileEditSectionAccount, UserProfileEditSectionAccountProps, UserProfileEditSectionPublicInfo, UserProfileEditSectionPublicInfoProps, UserProfileEditSectionSettings, UserProfileEditSectionSettingsProps, UserProfileEditSkeleton, UserProfileHeader, UserProfileHeaderProps, UserProfileHeaderSkeleton, UserProps, UserSkeleton, UserSocialAssociation, UserSocialAssociationProps, UserSubscribedGroupsWidget, UserSubscribedGroupsWidgetProps, UserSubscribedGroupsWidgetSkeleton, UserSuggestionWidget, UserSuggestionWidgetProps, UserSuggestionWidgetSkeleton, UserLiveStreamWidget, UserLiveStreamWidgetProps, UserLiveStreamWidgetSkeleton, useStickyBox, UseStickyBoxProps, LiveStream, LiveStreamProps, LiveStreamSkeletonProps, LiveStreamSkeleton, LiveStreamInfoDetails, LiveStreamInfoDetailsProps, UpScalingTierBadge, UpScalingTierProps, CreateLiveStreamDialog, CreateLiveStreamDialogProps, CreateLiveStreamButton, CreateLiveStreamButtonProps, LiveStreamForm, LiveStreamFormProps, LiveStreamRoom, LiveStreamRoomProps, LiveStreamVideoConference, LiveStreamVideoConferenceProps, VirtualScrollerItemProps, SCCourseTemplateType, SCLessonActionsType, SCLessonModeType, Widget, WidgetProps, X_SHARE, PROVIDER_ICONS_CONTAINED, PROVIDER_ICONS_OUTLINED };
|
|
212
|
+
export { AcceptRequestUserEventButton, AcceptRequestUserEventButtonProps, AccountChangeMailValidation, AccountChangeMailValidationProps, AccountDataPortability, AccountDataPortabilityButton, AccountDataPortabilityButtonProps, AccountDataPortabilityProps, AccountDelete, AccountDeleteButton, AccountDeleteButtonProps, AccountDeleteProps, AccountRecover, AccountRecoverProps, AccountReset, AccountResetProps, AccountVerify, AccountVerifyProps, AvatarGroupSkeleton, BaseDialog, BaseDialogProps, BaseItem, BaseItemProps, BaseLightbox, BaseLightboxProps, BottomNavigation, BottomNavigationProps, BroadcastMessages, BroadcastMessagesProps, BroadcastMessagesSkeleton, bytesToSize, generateRoomId, randomString, decodePassphrase, encodePassphrase, getCurrentSectionAndLessonIndex, Calendar, CalendarProps, Categories, CategoriesPopularWidget, CategoriesPopularWidgetSkeleton, CategoriesProps, CategoriesSkeleton, CategoriesSkeletonProps, CategoriesSuggestionWidget, CategoriesSuggestionWidgetProps, CategoriesSuggestionWidgetSkeleton, Category, CategoryAutocomplete, CategoryAutocompleteProps, CategoryFollowButton, CategoryFollowButtonProps, CategoryFollowersButton, CategoryFollowersButtonProps, CategoryHeader, CategoryHeaderProps, CategoryHeaderSkeleton, CategoryProps, CategorySkeleton, CategoryTrendingFeedWidget, CategoryTrendingFeedWidgetProps, CategoryTrendingFeedWidgetSkeleton, CategoryTrendingPeopleWidgetSkeleton, CategoryTrendingUsersWidget, CategoryTrendingUsersWidgetProps, CentralProgress, ChangeCover, ChangeCoverProps, ChangeGroupCover, ChangeGroupCoverProps, ChangeGroupPicture, ChangeGroupPictureProps, ChangePicture, ChangePictureProps, CommentObject, CommentObjectProps, CommentObjectReply, CommentObjectReplyProps, CommentObjectSkeleton, CommentsFeedObject, CommentsFeedObjectProps, CommentsFeedObjectSkeleton, CommentsObject, CommentsObjectProps, CommentsObjectSkeleton, Composer, ComposerIconButton, ComposerIconButtonProps, ComposerProps, ConfirmDialog, ConnectionUserButton, ConsentSolution, ConsentSolutionButton, ConsentSolutionButtonProps, ConsentSolutionProps, ConsentSolutionSkeleton, ContributionUtils, Course, CourseProps, CourseSkeleton, CourseSkeletonProps, CourseJoinButton, CourseJoinButtonProps, Courses, CreateCourseButton, CreateCourseButtonProps, CoursesProps, CoursesSkeleton, CoursesSkeletonProps, CourseContentMenu, CourseContentMenuProps, CourseDashboard, TeacherCourseDashboardProps, StudentCourseDashboardProps, CreateEventButton, CreateEventButtonProps, CreateEventWidget, CreateEventWidgetProps, CreateEventWidgetSkeleton, CreateGroupButton, EventForm, EventFormProps, EventFormDialog, EventFormDialogProps, CreateGroupButtonProps, CustomAdv, CustomAdvProps, CustomAdvSkeleton, DEFAULT_FIELDS, DEFAULT_PAGINATION_LIMIT, DEFAULT_PAGINATION_OFFSET, DEFAULT_PAGINATION_QUERY_PARAM_NAME, DEFAULT_PRELOAD_OFFSET_VIEWPORT, DEFAULT_WIDGETS_NUMBER, DefaultDrawerContent, DefaultDrawerContentProps, DefaultHeaderContent, DefaultHeaderContentProps, DefaultDrawerSkeleton, DefaultDrawerSkeletonProps, EditEventButton, EditEventButtonProps, EditGroupButton, EditGroupButtonProps, EditMediaProps, Editor, EditorProps, EditorSkeleton, EmailTextField, EditCourse, EditCourseProps, Event, EventActionsMenu, EventActionsMenuProps, EventHeader, EventHeaderProps, EventHeaderSkeleton, EventInfoDetails, EventInfoDetailsProps, EventInfoWidget, EventInfoWidgetProps, EventInviteButton, EventInviteButtonProps, EventLocationWidget, EventLocationWidgetProps, EventLocationWidgetSkeleton, EventMediaWidget, EventMediaWidgetProps, EventMediaWidgetSkeleton, EventMembersWidget, EventMembersWidgetProps, EventMembersWidgetSkeleton, EventParticipantsButton, EventParticipantsButtonProps, EventProps, Events, EventSkeleton, EventSkeletonProps, EventsProps, EventsSkeleton, EventsSkeletonProps, FACEBOOK_SHARE, Feed, FeedObject, FeedObjectMediaPreview, FeedObjectMediaPreviewProps, FeedObjectProps, FeedObjectSkeleton, FeedProps, FeedRef, FeedSidebarProps, FeedSkeleton, FeedUpdatesWidget, FeedUpdatesWidgetProps, FeedUpdatesWidgetSkeleton, File, FollowUserButton, FollowUserButtonProps, Footer, FooterProps, FooterSkeleton, FriendshipButtonProps, FriendshipUserButton, GenericSkeleton, getRelativeTime, getUnseenNotification, getUnseenNotificationCounter, Group, GroupActionsMenu, GroupActionsMenuProps, GroupForm, GroupFormProps, GroupHeader, GroupHeaderProps, GroupHeaderSkeleton, GroupInfoWidget, GroupInfoWidgetProps, GroupInfoWidgetSkeleton, GroupInviteButton, GroupInviteButtonProps, GroupInvitedWidget, GroupInvitedWidgetProps, GroupInvitedWidgetSkeleton, GroupMembersButton, GroupMembersButtonProps, GroupMembersWidget, GroupMembersWidgetProps, GroupMembersWidgetSkeleton, GroupProps, GroupRequestsWidget, GroupRequestsWidgetProps, GroupRequestsWidgetSkeleton, Groups, GroupSettingsIconButton, GroupSettingsIconButtonProps, GroupSkeleton, GroupsProps, GroupsSkeleton, GroupSubscribeButton, GroupSubscribeButtonProps, AccordionLessons, AccordionLessonsProps, AddUsersButton, AddUsersButtonProps, CourseUsersTable, CourseUsersTableProps, CourseUsersTableSkeleton, EmptyStatus, EmptyStatusProps, HiddenPlaceholder, Incubator, IncubatorDetail, IncubatorDetailProps, IncubatorListWidget, IncubatorListWidgetProps, IncubatorProps, IncubatorSubscribeButton, IncubatorSubscribeButtonProps, IncubatorSuggestionWidget, IncubatorSuggestionWidgetProps, InfiniteScroll, ScrollContainer, InlineComposerWidget, InlineComposerWidgetProps, InlineComposerWidgetSkeleton, InviteUserEventButton, LessonAppbar, LessonAppbarProps, LessonDrawer, LessonDrawerProps, LessonEditForm, LessonEditFormProps, LessonObject, LessonObjectProps, InviteUserEventButtonProps, LanguageSwitcher, LEGAL_POLICIES, CourseCompletedDialog, CourseCompletedDialogProps, Lightbox, LightboxProps, Link, LINKEDIN_SHARE, LocationAutocomplete, LocationAutocompleteProps, LogoSelfCommunity, DefaultCoverSelfCommunity, LoyaltyProgramWidget, LoyaltyProgramWidgetProps, LoyaltyProgramWidgetSkeleton, MAX_PRELOAD_OFFSET_VIEWPORT, MEDIA_EMBED_SC_LINK_TYPE, MEDIA_EMBED_SC_SHARED_EVENT, MEDIA_EMBED_SC_SHARED_OBJECT, MEDIA_TYPE_DOCUMENT, MEDIA_TYPE_EMBED, MEDIA_TYPE_EVENT, MEDIA_TYPE_IMAGE, MEDIA_TYPE_LINK, MEDIA_TYPE_SHARE, MEDIA_TYPE_URL, MEDIA_TYPE_VIDEO, SCCourseFormStepType, MediaChunkUploader, MediaChunkUploaderProps, MessageUploaderUtils, MetadataField, MetadataFieldProps, MIN_PRELOAD_OFFSET_VIEWPORT, MyEventsWidget, MyEventsWidgetProps, MyEventsWidgetSkeleton, NavigationMenuContent, NavigationMenuDrawer, NavigationMenuDrawerProps, NavigationMenuHeader, NavigationMenuIconButton, NavigationMenuIconButtonProps, NavigationSettingsIconButton, NavigationSettingsIconButtonProps, NavigationSettingsItem, NavigationToolbar, NavigationToolbarMobile, NavigationToolbarMobileProps, NavigationToolbarMobileSkeleton, NavigationToolbarProps, NavigationToolbarSkeleton, Notification, NotificationProps, NotificationSkeleton, OnBoardingWidget, OnBoardingWidgetProps, OnBoardingWidgetSkeleton, PasswordTextField, PhoneTextField, PlatformWidget, PlatformWidgetActionType, PlatformWidgetProps, PlatformWidgetSkeleton, PollSuggestionWidget, PollSuggestionWidgetProps, PrivateMessageComponent, PrivateMessageComponentProps, PrivateMessageComponentSkeleton, PrivateMessageEditor, PrivateMessageEditorProps, PrivateMessageEditorSkeleton, PrivateMessageSettingsIconButton, PrivateMessageSettingsIconButtonProps, PrivateMessageSnippetItem, PrivateMessageSnippetItemProps, PrivateMessageSnippetItemSkeleton, PrivateMessageSnippets, PrivateMessageSnippetsProps, PrivateMessageSnippetsSkeleton, PrivateMessageThread, PrivateMessageThreadItem, PrivateMessageThreadItemProps, PrivateMessageThreadItemSkeleton, PrivateMessageThreadProps, PrivateMessageThreadSkeleton, ProgressBar, ProgressBarProps, RelatedEventsWidget, RelatedEventsWidgetProps, RelatedEventsWidgetSkeleton, RelatedFeedObjectsWidget, RelatedFeedObjectsWidgetSkeleton, RelatedFeedObjectWidgetProps, ReplyComment, SCBroadcastMessageTemplateType, SCCommentsOrderBy, SCEventMembersEventType, SCEventTemplateType, SCFeedObjectActivitiesType, SCFeedObjectTemplateType, SCFeedWidgetType, SCGroupMembersEventType, SCMediaChunkType, SCMediaObjectType, SCNotificationObjectTemplateType, SCUserProfileFields, SCUserProfileSettings, SCUserSocialAssociations, SearchAutocomplete, SearchAutocompleteProps, SearchDialog, SearchDialogProps, Share, SnippetNotifications, SnippetNotificationsProps, SnippetNotificationsSkeleton, StickyBox, StickyBoxComponent, StickyBoxProps, SuggestedEventsWidget, TagAutocomplete, TagAutocompleteProps, SuggestedEventsWidgetProps, SuggestedEventsWidgetSkeleton, TagChip, TagChipProps, ToastNotifications, ToastNotificationsProps, ToastNotificationsSkeleton, UrlTextField, User, UserActionIconButton, UserActionIconButtonProps, UserAvatar, UserAvatarProps, UserConnectionsRequestsSentWidget, UserConnectionsRequestsSentWidgetProps, UserConnectionsRequestsSentWidgetSkeleton, UserConnectionsRequestsWidget, UserConnectionsRequestsWidgetProps, UserConnectionsRequestsWidgetSkeleton, UserConnectionsWidget, UserConnectionsWidgetProps, UserConnectionsWidgetSkeleton, UserCounters, UserCountersProps, UserDeletedSnackBar, UserDeletedSnackBarProps, UserFollowedCategoriesWidget, UserFollowedCategoriesWidgetProps, UserFollowedCategoriesWidgetSkeleton, UserFollowedUsersWidget, UserFollowedUsersWidgetProps, UserFollowedUsersWidgetSkeleton, UserFollowersWidget, UserFollowersWidgetProps, UserFollowersWidgetSkeleton, UserInfo, UserInfoDialog, UserInfoDialogProps, UserInfoProps, UserInfoSkeleton, UsernameTextField, UserProfileBlocked, UserProfileBlockedProps, UserProfileEdit, UserProfileEditProps, UserProfileEditSectionAccount, UserProfileEditSectionAccountProps, UserProfileEditSectionPublicInfo, UserProfileEditSectionPublicInfoProps, UserProfileEditSectionSettings, UserProfileEditSectionSettingsProps, UserProfileEditSkeleton, UserProfileHeader, UserProfileHeaderProps, UserProfileHeaderSkeleton, UserProps, UserSkeleton, UserSocialAssociation, UserSocialAssociationProps, UserSubscribedGroupsWidget, UserSubscribedGroupsWidgetProps, UserSubscribedGroupsWidgetSkeleton, UserSuggestionWidget, UserSuggestionWidgetProps, UserSuggestionWidgetSkeleton, UserLiveStreamWidget, UserLiveStreamWidgetProps, UserLiveStreamWidgetSkeleton, useStickyBox, UseStickyBoxProps, LiveStream, LiveStreamProps, LiveStreamSkeletonProps, LiveStreamSkeleton, LiveStreamInfoDetails, LiveStreamInfoDetailsProps, UpScalingTierBadge, UpScalingTierProps, CreateLiveStreamDialog, CreateLiveStreamDialogProps, CreateLiveStreamButton, CreateLiveStreamButtonProps, LiveStreamForm, LiveStreamFormProps, LiveStreamRoom, LiveStreamRoomProps, LiveStreamVideoConference, LiveStreamVideoConferenceProps, VirtualScrollerItemProps, SCCourseTemplateType, SCLessonActionsType, SCLessonModeType, Widget, WidgetProps, X_SHARE, PROVIDER_ICONS_CONTAINED, PROVIDER_ICONS_OUTLINED };
|
package/lib/cjs/index.js
CHANGED
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.CommentsFeedObjectSkeleton = exports.CommentsFeedObject = exports.CommentObjectSkeleton = exports.CommentObjectReply = exports.CommentObject = exports.ChangePicture = exports.ChangeGroupPicture = exports.ChangeGroupCover = exports.ChangeCover = exports.CentralProgress = exports.CategoryTrendingUsersWidget = exports.CategoryTrendingPeopleWidgetSkeleton = exports.CategoryTrendingFeedWidgetSkeleton = exports.CategoryTrendingFeedWidget = exports.CategorySkeleton = exports.CategoryHeaderSkeleton = exports.CategoryHeader = exports.CategoryFollowersButton = exports.CategoryFollowButton = exports.CategoryAutocomplete = exports.Category = exports.CategoriesSuggestionWidgetSkeleton = exports.CategoriesSuggestionWidget = exports.CategoriesSkeleton = exports.CategoriesPopularWidgetSkeleton = exports.CategoriesPopularWidget = exports.Categories = exports.Calendar = exports.getCurrentSectionAndLessonIndex = exports.encodePassphrase = exports.decodePassphrase = exports.randomString = exports.generateRoomId = exports.bytesToSize = exports.BroadcastMessagesSkeleton = exports.BroadcastMessages = exports.BottomNavigation = exports.BaseLightbox = exports.BaseItem = exports.BaseDialog = exports.AvatarGroupSkeleton = exports.AccountVerify = exports.AccountReset = exports.AccountRecover = exports.AccountDeleteButton = exports.AccountDelete = exports.AccountDataPortabilityButton = exports.AccountDataPortability = exports.AccountChangeMailValidation = exports.AcceptRequestUserEventButton = void 0;
|
|
4
4
|
exports.EventLocationWidgetSkeleton = exports.EventLocationWidget = exports.EventInviteButton = exports.EventInfoWidget = exports.EventInfoDetails = exports.EventHeaderSkeleton = exports.EventHeader = exports.EventActionsMenu = exports.Event = exports.EditCourse = exports.EmailTextField = exports.EditorSkeleton = exports.Editor = exports.EditGroupButton = exports.EditEventButton = exports.DefaultDrawerSkeleton = exports.DefaultHeaderContent = exports.DefaultDrawerContent = exports.DEFAULT_WIDGETS_NUMBER = exports.DEFAULT_PRELOAD_OFFSET_VIEWPORT = exports.DEFAULT_PAGINATION_QUERY_PARAM_NAME = exports.DEFAULT_PAGINATION_OFFSET = exports.DEFAULT_PAGINATION_LIMIT = exports.DEFAULT_FIELDS = exports.CustomAdvSkeleton = exports.CustomAdv = exports.EventFormDialog = exports.EventForm = exports.CreateGroupButton = exports.CreateEventWidgetSkeleton = exports.CreateEventWidget = exports.CreateEventButton = exports.CourseDashboard = exports.CourseContentMenu = exports.CoursesSkeleton = exports.CreateCourseButton = exports.Courses = exports.CourseJoinButton = exports.CourseSkeleton = exports.Course = exports.ContributionUtils = exports.ConsentSolutionSkeleton = exports.ConsentSolutionButton = exports.ConsentSolution = exports.ConnectionUserButton = exports.ConfirmDialog = exports.ComposerIconButton = exports.Composer = exports.CommentsObjectSkeleton = exports.CommentsObject = void 0;
|
|
5
5
|
exports.EmptyStatus = exports.CourseUsersTableSkeleton = exports.CourseUsersTable = exports.AddUsersButton = exports.AccordionLessons = exports.GroupSubscribeButton = exports.GroupsSkeleton = exports.GroupSkeleton = exports.GroupSettingsIconButton = exports.Groups = exports.GroupRequestsWidgetSkeleton = exports.GroupRequestsWidget = exports.GroupMembersWidgetSkeleton = exports.GroupMembersWidget = exports.GroupMembersButton = exports.GroupInvitedWidgetSkeleton = exports.GroupInvitedWidget = exports.GroupInviteButton = exports.GroupInfoWidgetSkeleton = exports.GroupInfoWidget = exports.GroupHeaderSkeleton = exports.GroupHeader = exports.GroupForm = exports.GroupActionsMenu = exports.Group = exports.getUnseenNotificationCounter = exports.getUnseenNotification = exports.getRelativeTime = exports.GenericSkeleton = exports.FriendshipUserButton = exports.FooterSkeleton = exports.Footer = exports.FollowUserButton = exports.File = exports.FeedUpdatesWidgetSkeleton = exports.FeedUpdatesWidget = exports.FeedSkeleton = exports.FeedObjectSkeleton = exports.FeedObjectMediaPreview = exports.FeedObject = exports.Feed = exports.FACEBOOK_SHARE = exports.EventsSkeleton = exports.EventSkeleton = exports.Events = exports.EventParticipantsButton = exports.EventMembersWidgetSkeleton = exports.EventMembersWidget = exports.EventMediaWidgetSkeleton = exports.EventMediaWidget = void 0;
|
|
6
|
-
exports.
|
|
7
|
-
exports.
|
|
8
|
-
exports.
|
|
9
|
-
exports.PROVIDER_ICONS_OUTLINED = exports.PROVIDER_ICONS_CONTAINED = exports.X_SHARE = exports.Widget = exports.SCLessonModeType = exports.SCLessonActionsType = exports.SCCourseTemplateType = void 0;
|
|
6
|
+
exports.NavigationSettingsIconButton = exports.NavigationMenuIconButton = exports.NavigationMenuHeader = exports.NavigationMenuDrawer = exports.NavigationMenuContent = exports.MyEventsWidgetSkeleton = exports.MyEventsWidget = exports.MIN_PRELOAD_OFFSET_VIEWPORT = exports.MetadataField = exports.MessageUploaderUtils = exports.MediaChunkUploader = exports.SCCourseFormStepType = exports.MEDIA_TYPE_VIDEO = exports.MEDIA_TYPE_URL = exports.MEDIA_TYPE_SHARE = exports.MEDIA_TYPE_LINK = exports.MEDIA_TYPE_IMAGE = exports.MEDIA_TYPE_EVENT = exports.MEDIA_TYPE_EMBED = exports.MEDIA_TYPE_DOCUMENT = exports.MEDIA_EMBED_SC_SHARED_OBJECT = exports.MEDIA_EMBED_SC_SHARED_EVENT = exports.MEDIA_EMBED_SC_LINK_TYPE = exports.MAX_PRELOAD_OFFSET_VIEWPORT = exports.LoyaltyProgramWidgetSkeleton = exports.LoyaltyProgramWidget = exports.DefaultCoverSelfCommunity = exports.LogoSelfCommunity = exports.LocationAutocomplete = exports.LINKEDIN_SHARE = exports.Link = exports.Lightbox = exports.CourseCompletedDialog = exports.LEGAL_POLICIES = exports.LanguageSwitcher = exports.LessonObject = exports.LessonEditForm = exports.LessonDrawer = exports.LessonAppbar = exports.InviteUserEventButton = exports.InlineComposerWidgetSkeleton = exports.InlineComposerWidget = exports.ScrollContainer = exports.InfiniteScroll = exports.IncubatorSuggestionWidget = exports.IncubatorSubscribeButton = exports.IncubatorListWidget = exports.IncubatorDetail = exports.Incubator = exports.HiddenPlaceholder = void 0;
|
|
7
|
+
exports.SuggestedEventsWidgetSkeleton = exports.TagAutocomplete = exports.SuggestedEventsWidget = exports.StickyBox = exports.SnippetNotificationsSkeleton = exports.SnippetNotifications = exports.Share = exports.SearchDialog = exports.SearchAutocomplete = exports.SCUserSocialAssociations = exports.SCUserProfileSettings = exports.SCUserProfileFields = exports.SCNotificationObjectTemplateType = exports.SCFeedObjectTemplateType = exports.SCFeedObjectActivitiesType = exports.SCEventTemplateType = exports.SCCommentsOrderBy = exports.SCBroadcastMessageTemplateType = exports.ReplyComment = exports.RelatedFeedObjectsWidgetSkeleton = exports.RelatedFeedObjectsWidget = exports.RelatedEventsWidgetSkeleton = exports.RelatedEventsWidget = exports.ProgressBar = exports.PrivateMessageThreadSkeleton = exports.PrivateMessageThreadItemSkeleton = exports.PrivateMessageThreadItem = exports.PrivateMessageThread = exports.PrivateMessageSnippetsSkeleton = exports.PrivateMessageSnippets = exports.PrivateMessageSnippetItemSkeleton = exports.PrivateMessageSnippetItem = exports.PrivateMessageSettingsIconButton = exports.PrivateMessageEditorSkeleton = exports.PrivateMessageEditor = exports.PrivateMessageComponentSkeleton = exports.PrivateMessageComponent = exports.PollSuggestionWidget = exports.PlatformWidgetSkeleton = exports.PlatformWidget = exports.PhoneTextField = exports.PasswordTextField = exports.OnBoardingWidgetSkeleton = exports.OnBoardingWidget = exports.NotificationSkeleton = exports.Notification = exports.NavigationToolbarSkeleton = exports.NavigationToolbarMobileSkeleton = exports.NavigationToolbarMobile = exports.NavigationToolbar = void 0;
|
|
8
|
+
exports.LiveStreamRoom = exports.LiveStreamForm = exports.CreateLiveStreamButton = exports.CreateLiveStreamDialog = exports.UpScalingTierBadge = exports.LiveStreamInfoDetails = exports.LiveStreamSkeleton = exports.LiveStream = exports.useStickyBox = exports.UserLiveStreamWidgetSkeleton = exports.UserLiveStreamWidget = exports.UserSuggestionWidgetSkeleton = exports.UserSuggestionWidget = exports.UserSubscribedGroupsWidgetSkeleton = exports.UserSubscribedGroupsWidget = exports.UserSocialAssociation = exports.UserSkeleton = exports.UserProfileHeaderSkeleton = exports.UserProfileHeader = exports.UserProfileEditSkeleton = exports.UserProfileEditSectionSettings = exports.UserProfileEditSectionPublicInfo = exports.UserProfileEditSectionAccount = exports.UserProfileEdit = exports.UserProfileBlocked = exports.UsernameTextField = exports.UserInfoSkeleton = exports.UserInfoDialog = exports.UserInfo = exports.UserFollowersWidgetSkeleton = exports.UserFollowersWidget = exports.UserFollowedUsersWidgetSkeleton = exports.UserFollowedUsersWidget = exports.UserFollowedCategoriesWidgetSkeleton = exports.UserFollowedCategoriesWidget = exports.UserDeletedSnackBar = exports.UserCounters = exports.UserConnectionsWidgetSkeleton = exports.UserConnectionsWidget = exports.UserConnectionsRequestsWidgetSkeleton = exports.UserConnectionsRequestsWidget = exports.UserConnectionsRequestsSentWidgetSkeleton = exports.UserConnectionsRequestsSentWidget = exports.UserAvatar = exports.UserActionIconButton = exports.User = exports.UrlTextField = exports.ToastNotificationsSkeleton = exports.ToastNotifications = exports.TagChip = void 0;
|
|
9
|
+
exports.PROVIDER_ICONS_OUTLINED = exports.PROVIDER_ICONS_CONTAINED = exports.X_SHARE = exports.Widget = exports.SCLessonModeType = exports.SCLessonActionsType = exports.SCCourseTemplateType = exports.LiveStreamVideoConference = void 0;
|
|
10
10
|
const tslib_1 = require("tslib");
|
|
11
11
|
/**
|
|
12
12
|
* Components
|
|
@@ -375,6 +375,8 @@ Object.defineProperty(exports, "MEDIA_TYPE_LINK", { enumerable: true, get: funct
|
|
|
375
375
|
Object.defineProperty(exports, "MEDIA_TYPE_SHARE", { enumerable: true, get: function () { return Media_1.MEDIA_TYPE_SHARE; } });
|
|
376
376
|
Object.defineProperty(exports, "MEDIA_TYPE_URL", { enumerable: true, get: function () { return Media_1.MEDIA_TYPE_URL; } });
|
|
377
377
|
Object.defineProperty(exports, "MEDIA_TYPE_VIDEO", { enumerable: true, get: function () { return Media_1.MEDIA_TYPE_VIDEO; } });
|
|
378
|
+
const Course_2 = require("./constants/Course");
|
|
379
|
+
Object.defineProperty(exports, "SCCourseFormStepType", { enumerable: true, get: function () { return Course_2.SCCourseFormStepType; } });
|
|
378
380
|
const AccordionLessons_1 = tslib_1.__importDefault(require("./shared/AccordionLessons"));
|
|
379
381
|
exports.AccordionLessons = AccordionLessons_1.default;
|
|
380
382
|
const AddUsersButton_1 = tslib_1.__importDefault(require("./shared/AddUsersButton"));
|
|
@@ -40,8 +40,8 @@ function AccordionLessons(inProps) {
|
|
|
40
40
|
if (!course) {
|
|
41
41
|
return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, { children: (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.accordion }, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.summary }, { children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", variant: "text", width: "210px", height: "21px" }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", variant: "text", width: "54px", height: "21px" })] })) })) })));
|
|
42
42
|
}
|
|
43
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
return ((0, jsx_runtime_1.jsx)(react_1.Fragment, { children: ((_a = course.sections) === null || _a === void 0 ? void 0 : _a.length) > 0 ? ((0, jsx_runtime_1.jsx)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, { children: course.sections.map((section) => ((0, jsx_runtime_1.jsxs)(material_1.Accordion, Object.assign({ className: classes.accordion, expanded: expanded === section.id, onChange: handleChange(section.id), disableGutters: true, elevation: 0, square: true }, { children: [(0, jsx_runtime_1.jsxs)(material_1.AccordionSummary, Object.assign({ className: classes.summary, expandIcon: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "expand_less" }) }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ component: "span", variant: "body1" }, { children: section.name })), !isMobile && ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ component: "span", variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.course.table.lessons.title", defaultMessage: "ui.course.table.lessons.title", values: {
|
|
44
|
+
lessonsNumber: section.lessons.length
|
|
45
|
+
} }) })))] })), section.lessons.map((lesson) => ((0, jsx_runtime_1.jsxs)(material_1.AccordionDetails, Object.assign({ className: classes.details }, { children: [lesson.completion_status === types_1.SCCourseLessonCompletionStatusType.COMPLETED ? ((0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ fontSize: "small", color: "primary" }, { children: "circle_checked" }))) : ((0, jsx_runtime_1.jsx)(material_1.Box, { className: classes.circle })), (0, jsx_runtime_1.jsx)(material_1.Typography, { children: lesson.name })] }), lesson.id)))] }), section.id))) }))) : ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.course.accordionLessons.empty", defaultMessage: "ui.course.accordionLessons.empty" }) }))) }));
|
|
46
46
|
}
|
|
47
47
|
exports.default = AccordionLessons;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { WidgetProps } from '../Widget';
|
|
2
|
+
import { CreateCourseButtonProps } from '../CreateCourseButton';
|
|
2
3
|
export interface CourseSkeletonProps extends WidgetProps {
|
|
4
|
+
/**
|
|
5
|
+
* Props to spread to CreateCourseButton component
|
|
6
|
+
* @default {}
|
|
7
|
+
*/
|
|
8
|
+
CreateCourseButtonComponentProps?: CreateCourseButtonProps;
|
|
3
9
|
/**
|
|
4
10
|
* Overrides or extends the styles applied to the component.
|
|
5
11
|
* @default null
|
|
@@ -49,8 +49,8 @@ export default function CourseCreatePlaceholder(inProps) {
|
|
|
49
49
|
props: inProps,
|
|
50
50
|
name: PREFIX
|
|
51
51
|
});
|
|
52
|
-
const { className } = props, rest = __rest(props, ["className"]);
|
|
52
|
+
const { CreateCourseButtonComponentProps = {}, className } = props, rest = __rest(props, ["CreateCourseButtonComponentProps", "className"]);
|
|
53
53
|
// HOOK
|
|
54
54
|
const { preferences } = useSCPreferences();
|
|
55
|
-
return (_jsxs(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { children: [_jsxs(Box, Object.assign({ position: "relative", className: classes.imageWrapper }, { children: [_jsx(CardMedia, { component: "img", image: `${preferences[SCPreferences.IMAGES_USER_DEFAULT_COVER].value}`, alt: "placeholder image", className: classes.image }), _jsx(Icon, Object.assign({ className: classes.icon, fontSize: "large" }, { children: "courses" }))] })), _jsx(CardActions, Object.assign({ className: classes.actions }, { children: _jsx(CreateCourseButton, {}) }))] })));
|
|
55
|
+
return (_jsxs(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { children: [_jsxs(Box, Object.assign({ position: "relative", className: classes.imageWrapper }, { children: [_jsx(CardMedia, { component: "img", image: `${preferences[SCPreferences.IMAGES_USER_DEFAULT_COVER].value}`, alt: "placeholder image", className: classes.image }), _jsx(Icon, Object.assign({ className: classes.icon, fontSize: "large" }, { children: "courses" }))] })), _jsx(CardActions, Object.assign({ className: classes.actions }, { children: _jsx(CreateCourseButton, Object.assign({}, CreateCourseButtonComponentProps)) }))] })));
|
|
56
56
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Box, Button, Icon, Skeleton, Stack, Typography } from '@mui/material';
|
|
3
|
+
import { SCCoursePrivacyType } from '@selfcommunity/types';
|
|
3
4
|
import { FormattedMessage, useIntl } from 'react-intl';
|
|
4
5
|
import { PREFIX } from './constants';
|
|
5
6
|
import { memo, useMemo } from 'react';
|
|
@@ -28,12 +29,13 @@ function HeaderCourseDashboard(props) {
|
|
|
28
29
|
}
|
|
29
30
|
}, [course, hasAction]);
|
|
30
31
|
const iconData = useMemo(() => {
|
|
32
|
+
const underId = (course === null || course === void 0 ? void 0 : course.privacy) === SCCoursePrivacyType.DRAFT ? 'draft' : course === null || course === void 0 ? void 0 : course.privacy;
|
|
31
33
|
return [
|
|
32
34
|
{
|
|
33
35
|
id: 'ui.course.label',
|
|
34
36
|
icon: 'public',
|
|
35
37
|
key: 'privacy',
|
|
36
|
-
underId: `ui.course.privacy.${
|
|
38
|
+
underId: `ui.course.privacy.${underId}`
|
|
37
39
|
},
|
|
38
40
|
{
|
|
39
41
|
id: 'ui.course.type',
|
|
@@ -26,6 +26,7 @@ const classes = {
|
|
|
26
26
|
root: `${PREFIX}-root`,
|
|
27
27
|
studentContainer: `${PREFIX}-student-container`,
|
|
28
28
|
userWrapper: `${PREFIX}-user-wrapper`,
|
|
29
|
+
actionsWrapper: `${PREFIX}-actions-wrapper`,
|
|
29
30
|
user: `${PREFIX}-user`,
|
|
30
31
|
avatar: `${PREFIX}-avatar`,
|
|
31
32
|
progress: `${PREFIX}-progress`,
|
|
@@ -110,12 +111,12 @@ function Student(inProps) {
|
|
|
110
111
|
if (!scCourse) {
|
|
111
112
|
return _jsx(Skeleton, { animation: "wave", variant: "rounded", width: "160px", height: "28px" });
|
|
112
113
|
}
|
|
113
|
-
return (_jsxs(Stack, Object.assign({
|
|
114
|
+
return (_jsxs(Stack, Object.assign({ className: classes.actionsWrapper }, { children: [((scCourse === null || scCourse === void 0 ? void 0 : scCourse.join_status) === SCCourseJoinStatusType.CREATOR || (scCourse === null || scCourse === void 0 ? void 0 : scCourse.join_status) === SCCourseJoinStatusType.MANAGER) && (_jsx(ActionButton, { labelId: messages.dashboard, to: scRoutingContext.url(SCRoutes.COURSE_DASHBOARD_ROUTE_NAME, scCourse), color: "inherit", variant: "outlined" })), ((scCourse === null || scCourse === void 0 ? void 0 : scCourse.join_status) === SCCourseJoinStatusType.MANAGER || (scCourse === null || scCourse === void 0 ? void 0 : scCourse.join_status) === SCCourseJoinStatusType.JOINED) &&
|
|
114
115
|
((scCourse === null || scCourse === void 0 ? void 0 : scCourse.join_status) !== null || scCourse.privacy !== SCCoursePrivacyType.PRIVATE) &&
|
|
115
116
|
scCourse.user_completion_rate < 100 && (_jsx(ActionButton, { labelId: scCourse.num_lessons_completed === 0 ? messages.start : messages.continue, to: scRoutingContext.url(SCRoutes.COURSE_LESSON_ROUTE_NAME, getUrlNextLesson(scCourse)) })), scCourse.privacy === SCCoursePrivacyType.PRIVATE &&
|
|
116
117
|
(scCourse.join_status === null || scCourse.join_status === SCCourseJoinStatusType.REQUESTED) && (_jsx(ActionButton, { labelId: sentRequest ? messages.cancel : messages.request, color: "inherit", variant: "outlined", loading: loadingRequest, onClick: handleRequest }))] })));
|
|
117
118
|
}, [scCourse, sentRequest, loadingRequest, handleRequest]);
|
|
118
|
-
return (_jsxs(Root, Object.assign({ className: classNames(classes.root, classes.studentContainer, className) }, rest, { children: [_jsx(HeaderCourseDashboard, { course: scCourse }), _jsx(Divider, {}), _jsxs(Stack, Object.assign({ className: classes.userWrapper }, { children: [_jsxs(Stack, Object.assign({ className: classes.user }, { children: [scCourse ? (_jsx(Avatar, { className: classes.avatar, src: scCourse.created_by.avatar, alt: scCourse.created_by.username })) : (_jsx(Skeleton, { animation: "wave", variant: "circular", className: classes.avatar })), _jsx(Box, { children: scCourse ? (_jsxs(Fragment, { children: [_jsx(Typography, Object.assign({ variant: "body1" }, { children: scCourse.created_by.username })), _jsx(Typography, Object.assign({ variant: "body1" }, { children:
|
|
119
|
+
return (_jsxs(Root, Object.assign({ className: classNames(classes.root, classes.studentContainer, className) }, rest, { children: [_jsx(HeaderCourseDashboard, { course: scCourse }), _jsx(Divider, {}), _jsxs(Stack, Object.assign({ className: classes.userWrapper }, { children: [_jsxs(Stack, Object.assign({ className: classes.user }, { children: [scCourse ? (_jsx(Avatar, { className: classes.avatar, src: scCourse.created_by.avatar, alt: scCourse.created_by.username })) : (_jsx(Skeleton, { animation: "wave", variant: "circular", className: classes.avatar })), _jsx(Box, { children: scCourse ? (_jsxs(Fragment, { children: [_jsx(Typography, Object.assign({ variant: "body1" }, { children: scCourse.created_by.username })), _jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsx(FormattedMessage, { id: "ui.course.dashboard.header.user.creator", defaultMessage: "ui.course.dashboard.header.user.creator" }) }))] })) : (_jsxs(Fragment, { children: [_jsx(Skeleton, { animation: "wave", variant: "text", width: "105px", height: "21px" }), _jsx(Skeleton, { animation: "wave", variant: "text", width: "74px", height: "21px" })] })) })] })), actionButton] })), _jsx(Divider, {}), ((scCourse === null || scCourse === void 0 ? void 0 : scCourse.join_status) === SCCourseJoinStatusType.CREATOR ||
|
|
119
120
|
(scCourse === null || scCourse === void 0 ? void 0 : scCourse.join_status) === SCCourseJoinStatusType.MANAGER ||
|
|
120
121
|
(scCourse === null || scCourse === void 0 ? void 0 : scCourse.join_status) === SCCourseJoinStatusType.JOINED ||
|
|
121
122
|
(scCourse === null || scCourse === void 0 ? void 0 : scCourse.privacy) !== SCCoursePrivacyType.PRIVATE) && (_jsxs(Fragment, { children: [_jsx(Typography, Object.assign({ variant: "h6", className: classes.margin }, { children: _jsx(FormattedMessage, { id: "ui.course.dashboard.student.description", defaultMessage: "ui.course.dashboard.student.description" }) })), _jsx(Stack, Object.assign({ className: classes.box }, { children: scCourse ? _jsx(Typography, Object.assign({ variant: "body1" }, { children: scCourse.description })) : _jsx(Skeleton, { animation: "wave", variant: "text", height: "130px" }) }))] })), ((scCourse === null || scCourse === void 0 ? void 0 : scCourse.join_status) === SCCourseJoinStatusType.MANAGER || (scCourse === null || scCourse === void 0 ? void 0 : scCourse.join_status) === SCCourseJoinStatusType.JOINED) && (_jsxs(Fragment, { children: [_jsx(Typography, Object.assign({ variant: "h6", className: classes.margin }, { children: _jsx(FormattedMessage, { id: "ui.course.dashboard.student.progress", defaultMessage: "ui.course.dashboard.student.description" }) })), _jsxs(Stack, Object.assign({ className: classes.box }, { children: [_jsx(Stack, Object.assign({ className: classes.percentageWrapper }, { children: scCourse ? (_jsxs(Fragment, { children: [_jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsx(FormattedMessage, { id: "ui.course.dashboard.student.progress.described", defaultMessage: "ui.course.dashboard.student.progress.described", values: { progress: scCourse.num_lessons_completed, end: scCourse.num_lessons } }) })), _jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsx(FormattedMessage, { id: "ui.course.dashboard.student.progress.percentage", defaultMessage: "ui.course.dashboard.student.progress.percentage", values: { percentage: scCourse.user_completion_rate } }) }))] })) : (_jsxs(Fragment, { children: [_jsx(Skeleton, { animation: "wave", variant: "text", width: "168px", height: "19px" }), _jsx(Skeleton, { animation: "wave", variant: "text", width: "108px", height: "19px" })] })) })), _jsx(LinearProgress, { className: classes.progress, variant: "determinate", value: scCourse === null || scCourse === void 0 ? void 0 : scCourse.user_completion_rate })] })), (scCourse === null || scCourse === void 0 ? void 0 : scCourse.user_completion_rate) === 100 && (_jsxs(Stack, Object.assign({ className: classNames(classes.completedWrapper, classes.margin) }, { children: [_jsx(Typography, Object.assign({ variant: "h3" }, { children: _jsx(FormattedMessage, { id: "ui.course.dashboard.student.completed", defaultMessage: "ui.course.dashboard.student.completed" }) })), _jsx("img", { src: CLAPPING, alt: intl.formatMessage({ id: 'ui.course.dashboard.student.completed', defaultMessage: 'ui.course.dashboard.student.completed' }), width: 32, height: 32 })] }))), _jsx(Typography, Object.assign({ variant: "h6", className: classes.margin }, { children: _jsx(FormattedMessage, { id: "ui.course.dashboard.student.contents", defaultMessage: "ui.course.dashboard.student.contents" }) })), _jsxs(Stack, Object.assign({ className: classes.lessonsSections }, { children: [scCourse ? (_jsx(Typography, Object.assign({ variant: "h5" }, { children: _jsx(FormattedMessage, { id: "ui.course.table.sections.title", defaultMessage: "ui.course.table.sections.title", values: {
|