@selfcommunity/react-ui 0.10.2-courses.197 → 0.10.2-courses.198
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/components/CourseDashboard/Teacher/Comments.js +1 -1
- package/lib/cjs/components/Notification/Course/Course.js +5 -5
- package/lib/esm/components/CourseDashboard/Teacher/Comments.js +1 -1
- package/lib/esm/components/Notification/Course/Course.js +5 -5
- package/lib/umd/react-ui.js +1 -1
- package/package.json +8 -8
|
@@ -98,7 +98,7 @@ function Comments(props) {
|
|
|
98
98
|
map.set(name, [...map.get(name), comment]);
|
|
99
99
|
}
|
|
100
100
|
});
|
|
101
|
-
return Array.from(map.entries()).map(([name, comments]) => ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.outerWrapper }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h5" }, { children: name })), (0, jsx_runtime_1.jsx)(material_1.Divider, {}), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.innerWrapper }, { children: [comments.map((comment) => ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.userWrapper }, { children: [(0, jsx_runtime_1.jsx)(material_1.Avatar, { src: comment.created_by.avatar, alt: comment.created_by.username, className: classes.avatar }), (0, jsx_runtime_1.jsxs)(material_1.Box, { children: [(0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.userInfo }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: comment.created_by.username })), (0, jsx_runtime_1.jsx)(material_1.Box, { className: classes.circle }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedDate, { value: comment.created_at }) }))] })), (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body1", component: "div", dangerouslySetInnerHTML: { __html: comment.html } })] })] }), comment.id))), (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.
|
|
101
|
+
return Array.from(map.entries()).map(([name, comments]) => ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.outerWrapper }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h5" }, { children: name })), (0, jsx_runtime_1.jsx)(material_1.Divider, {}), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.innerWrapper }, { children: [comments.map((comment) => ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.userWrapper }, { children: [(0, jsx_runtime_1.jsx)(material_1.Avatar, { src: comment.created_by.avatar, alt: comment.created_by.username, className: classes.avatar }), (0, jsx_runtime_1.jsxs)(material_1.Box, { children: [(0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.userInfo }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: comment.created_by.username })), (0, jsx_runtime_1.jsx)(material_1.Box, { className: classes.circle }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedDate, { value: comment.created_at }) }))] })), (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body1", component: "div", dangerouslySetInnerHTML: { __html: comment.html } })] })] }), comment.id))), (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.COURSE_LESSON_COMMENTS_ROUTE_NAME, (0, course_1.getUrlLesson)(comments[0].extras.course, comments[0].extras.lesson, comments[0].extras.section)), size: "small", variant: "outlined", color: "inherit", className: classes.button }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.course.dashboard.teacher.tab.comments.lessons.btn.label", defaultMessage: "ui.course.dashboard.teacher.tab.comments.lessons.btn.label" }) })) }))] }))] }), name)));
|
|
102
102
|
}, [state.results]);
|
|
103
103
|
if (!state.initialized) {
|
|
104
104
|
return (0, jsx_runtime_1.jsx)(CommentsSkeleton, {});
|
|
@@ -70,12 +70,12 @@ function CourseNotification(props) {
|
|
|
70
70
|
? notificationObject.comment.lesson_name
|
|
71
71
|
: notificationObject.course.name,
|
|
72
72
|
link: (...chunks) => ((0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({ to: scRoutingContext.url(notificationObject.type === types_1.SCNotificationTypologyType.USER_COMMENTED_A_COURSE_LESSON
|
|
73
|
-
? react_core_1.SCRoutes.
|
|
73
|
+
? react_core_1.SCRoutes.COURSE_LESSON_COMMENTS_ROUTE_NAME
|
|
74
74
|
: react_core_1.SCRoutes.COURSE_ROUTE_NAME, notificationObject.type === types_1.SCNotificationTypologyType.USER_COMMENTED_A_COURSE_LESSON
|
|
75
75
|
? formatLessonUrl(notificationObject)
|
|
76
76
|
: notificationObject.course) }, { children: chunks })))
|
|
77
77
|
} })] }), footer: isToastTemplate ? ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", justifyContent: "space-between", alignItems: "center", spacing: 2 }, { children: [(0, jsx_runtime_1.jsx)(DateTimeAgo_1.default, { date: notificationObject.active_at }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ color: "primary" }, { children: (0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({ to: scRoutingContext.url(notificationObject.type === types_1.SCNotificationTypologyType.USER_COMMENTED_A_COURSE_LESSON
|
|
78
|
-
? react_core_1.SCRoutes.
|
|
78
|
+
? react_core_1.SCRoutes.COURSE_LESSON_COMMENTS_ROUTE_NAME
|
|
79
79
|
: react_core_1.SCRoutes.COURSE_ROUTE_NAME, notificationObject.type === types_1.SCNotificationTypologyType.USER_COMMENTED_A_COURSE_LESSON
|
|
80
80
|
? formatLessonUrl(notificationObject)
|
|
81
81
|
: notificationObject.course) }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.notification.course.button.see", defaultMessage: "ui.notification.course.button.see" }) })) }))] }))) : ((0, jsx_runtime_1.jsx)(DateTimeAgo_1.default, { date: notificationObject.active_at, className: classes.snippetTime })) }, rest)));
|
|
@@ -91,12 +91,12 @@ function CourseNotification(props) {
|
|
|
91
91
|
? notificationObject.comment.lesson_name
|
|
92
92
|
: notificationObject.course.name,
|
|
93
93
|
link: (...chunks) => ((0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({ to: scRoutingContext.url(notificationObject.type === types_1.SCNotificationTypologyType.USER_COMMENTED_A_COURSE_LESSON
|
|
94
|
-
? react_core_1.SCRoutes.
|
|
94
|
+
? react_core_1.SCRoutes.COURSE_LESSON_COMMENTS_ROUTE_NAME
|
|
95
95
|
: react_core_1.SCRoutes.COURSE_ROUTE_NAME, notificationObject.type === types_1.SCNotificationTypologyType.USER_COMMENTED_A_COURSE_LESSON
|
|
96
96
|
? formatLessonUrl(notificationObject)
|
|
97
97
|
: notificationObject.course) }, { children: chunks })))
|
|
98
|
-
} }), notificationObject.type
|
|
99
|
-
? react_core_1.SCRoutes.
|
|
98
|
+
} }), notificationObject.type === types_1.SCNotificationTypologyType.USER_COMMENTED_A_COURSE_LESSON ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", dangerouslySetInnerHTML: { __html: notificationObject.comment.html } })) : ((0, jsx_runtime_1.jsx)(Course_1.default, { course: notificationObject.course, actions: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {}), template: types_2.SCCourseTemplateType.SNIPPET, elevation: 0 }))] }), actions: (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", justifyContent: "space-between", alignItems: "center", spacing: 2 }, { children: [(0, jsx_runtime_1.jsx)(DateTimeAgo_1.default, { date: notificationObject.active_at, className: classes.activeAt }), (0, jsx_runtime_1.jsx)(lab_1.LoadingButton, Object.assign({ color: 'primary', variant: "outlined", size: "small", classes: { root: classes.seeButton }, component: react_core_1.Link, to: scRoutingContext.url(notificationObject.type === types_1.SCNotificationTypologyType.USER_COMMENTED_A_COURSE_LESSON
|
|
99
|
+
? react_core_1.SCRoutes.COURSE_LESSON_COMMENTS_ROUTE_NAME
|
|
100
100
|
: react_core_1.SCRoutes.COURSE_ROUTE_NAME, notificationObject.type === types_1.SCNotificationTypologyType.USER_COMMENTED_A_COURSE_LESSON
|
|
101
101
|
? formatLessonUrl(notificationObject)
|
|
102
102
|
: notificationObject.course) }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.notification.course.button.see", defaultMessage: "ui.notification.course.button.see" }) }))] })) }, rest)), openAlert && (0, jsx_runtime_1.jsx)(UserDeletedSnackBar_1.default, { open: openAlert, handleClose: () => setOpenAlert(false) })] }));
|
|
@@ -96,7 +96,7 @@ function Comments(props) {
|
|
|
96
96
|
map.set(name, [...map.get(name), comment]);
|
|
97
97
|
}
|
|
98
98
|
});
|
|
99
|
-
return Array.from(map.entries()).map(([name, comments]) => (_jsxs(Box, Object.assign({ className: classes.outerWrapper }, { children: [_jsx(Typography, Object.assign({ variant: "h5" }, { children: name })), _jsx(Divider, {}), _jsxs(Stack, Object.assign({ className: classes.innerWrapper }, { children: [comments.map((comment) => (_jsxs(Stack, Object.assign({ className: classes.userWrapper }, { children: [_jsx(Avatar, { src: comment.created_by.avatar, alt: comment.created_by.username, className: classes.avatar }), _jsxs(Box, { children: [_jsxs(Stack, Object.assign({ className: classes.userInfo }, { children: [_jsx(Typography, Object.assign({ variant: "body1" }, { children: comment.created_by.username })), _jsx(Box, { className: classes.circle }), _jsx(Typography, Object.assign({ variant: "body2" }, { children: _jsx(FormattedDate, { value: comment.created_at }) }))] })), _jsx(Typography, { variant: "body1", component: "div", dangerouslySetInnerHTML: { __html: comment.html } })] })] }), comment.id))), _jsx(Button, Object.assign({ component: Link, to: scRoutingContext.url(SCRoutes.
|
|
99
|
+
return Array.from(map.entries()).map(([name, comments]) => (_jsxs(Box, Object.assign({ className: classes.outerWrapper }, { children: [_jsx(Typography, Object.assign({ variant: "h5" }, { children: name })), _jsx(Divider, {}), _jsxs(Stack, Object.assign({ className: classes.innerWrapper }, { children: [comments.map((comment) => (_jsxs(Stack, Object.assign({ className: classes.userWrapper }, { children: [_jsx(Avatar, { src: comment.created_by.avatar, alt: comment.created_by.username, className: classes.avatar }), _jsxs(Box, { children: [_jsxs(Stack, Object.assign({ className: classes.userInfo }, { children: [_jsx(Typography, Object.assign({ variant: "body1" }, { children: comment.created_by.username })), _jsx(Box, { className: classes.circle }), _jsx(Typography, Object.assign({ variant: "body2" }, { children: _jsx(FormattedDate, { value: comment.created_at }) }))] })), _jsx(Typography, { variant: "body1", component: "div", dangerouslySetInnerHTML: { __html: comment.html } })] })] }), comment.id))), _jsx(Button, Object.assign({ component: Link, to: scRoutingContext.url(SCRoutes.COURSE_LESSON_COMMENTS_ROUTE_NAME, getUrlLesson(comments[0].extras.course, comments[0].extras.lesson, comments[0].extras.section)), size: "small", variant: "outlined", color: "inherit", className: classes.button }, { children: _jsx(Typography, Object.assign({ variant: "body2" }, { children: _jsx(FormattedMessage, { id: "ui.course.dashboard.teacher.tab.comments.lessons.btn.label", defaultMessage: "ui.course.dashboard.teacher.tab.comments.lessons.btn.label" }) })) }))] }))] }), name)));
|
|
100
100
|
}, [state.results]);
|
|
101
101
|
if (!state.initialized) {
|
|
102
102
|
return _jsx(CommentsSkeleton, {});
|
|
@@ -68,12 +68,12 @@ export default function CourseNotification(props) {
|
|
|
68
68
|
? notificationObject.comment.lesson_name
|
|
69
69
|
: notificationObject.course.name,
|
|
70
70
|
link: (...chunks) => (_jsx(Link, Object.assign({ to: scRoutingContext.url(notificationObject.type === SCNotificationTypologyType.USER_COMMENTED_A_COURSE_LESSON
|
|
71
|
-
? SCRoutes.
|
|
71
|
+
? SCRoutes.COURSE_LESSON_COMMENTS_ROUTE_NAME
|
|
72
72
|
: SCRoutes.COURSE_ROUTE_NAME, notificationObject.type === SCNotificationTypologyType.USER_COMMENTED_A_COURSE_LESSON
|
|
73
73
|
? formatLessonUrl(notificationObject)
|
|
74
74
|
: notificationObject.course) }, { children: chunks })))
|
|
75
75
|
} })] }), footer: isToastTemplate ? (_jsxs(Stack, Object.assign({ direction: "row", justifyContent: "space-between", alignItems: "center", spacing: 2 }, { children: [_jsx(DateTimeAgo, { date: notificationObject.active_at }), _jsx(Typography, Object.assign({ color: "primary" }, { children: _jsx(Link, Object.assign({ to: scRoutingContext.url(notificationObject.type === SCNotificationTypologyType.USER_COMMENTED_A_COURSE_LESSON
|
|
76
|
-
? SCRoutes.
|
|
76
|
+
? SCRoutes.COURSE_LESSON_COMMENTS_ROUTE_NAME
|
|
77
77
|
: SCRoutes.COURSE_ROUTE_NAME, notificationObject.type === SCNotificationTypologyType.USER_COMMENTED_A_COURSE_LESSON
|
|
78
78
|
? formatLessonUrl(notificationObject)
|
|
79
79
|
: notificationObject.course) }, { children: _jsx(FormattedMessage, { id: "ui.notification.course.button.see", defaultMessage: "ui.notification.course.button.see" }) })) }))] }))) : (_jsx(DateTimeAgo, { date: notificationObject.active_at, className: classes.snippetTime })) }, rest)));
|
|
@@ -89,12 +89,12 @@ export default function CourseNotification(props) {
|
|
|
89
89
|
? notificationObject.comment.lesson_name
|
|
90
90
|
: notificationObject.course.name,
|
|
91
91
|
link: (...chunks) => (_jsx(Link, Object.assign({ to: scRoutingContext.url(notificationObject.type === SCNotificationTypologyType.USER_COMMENTED_A_COURSE_LESSON
|
|
92
|
-
? SCRoutes.
|
|
92
|
+
? SCRoutes.COURSE_LESSON_COMMENTS_ROUTE_NAME
|
|
93
93
|
: SCRoutes.COURSE_ROUTE_NAME, notificationObject.type === SCNotificationTypologyType.USER_COMMENTED_A_COURSE_LESSON
|
|
94
94
|
? formatLessonUrl(notificationObject)
|
|
95
95
|
: notificationObject.course) }, { children: chunks })))
|
|
96
|
-
} }), notificationObject.type
|
|
97
|
-
? SCRoutes.
|
|
96
|
+
} }), notificationObject.type === SCNotificationTypologyType.USER_COMMENTED_A_COURSE_LESSON ? (_jsx(Typography, { variant: "body2", dangerouslySetInnerHTML: { __html: notificationObject.comment.html } })) : (_jsx(CourseItem, { course: notificationObject.course, actions: _jsx(_Fragment, {}), template: SCCourseTemplateType.SNIPPET, elevation: 0 }))] }), actions: _jsxs(Stack, Object.assign({ direction: "row", justifyContent: "space-between", alignItems: "center", spacing: 2 }, { children: [_jsx(DateTimeAgo, { date: notificationObject.active_at, className: classes.activeAt }), _jsx(LoadingButton, Object.assign({ color: 'primary', variant: "outlined", size: "small", classes: { root: classes.seeButton }, component: Link, to: scRoutingContext.url(notificationObject.type === SCNotificationTypologyType.USER_COMMENTED_A_COURSE_LESSON
|
|
97
|
+
? SCRoutes.COURSE_LESSON_COMMENTS_ROUTE_NAME
|
|
98
98
|
: SCRoutes.COURSE_ROUTE_NAME, notificationObject.type === SCNotificationTypologyType.USER_COMMENTED_A_COURSE_LESSON
|
|
99
99
|
? formatLessonUrl(notificationObject)
|
|
100
100
|
: notificationObject.course) }, { children: _jsx(FormattedMessage, { id: "ui.notification.course.button.see", defaultMessage: "ui.notification.course.button.see" }) }))] })) }, rest)), openAlert && _jsx(UserDeletedSnackBar, { open: openAlert, handleClose: () => setOpenAlert(false) })] }));
|