@selfcommunity/react-ui 0.10.2-courses.204 → 0.10.2-courses.206
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/Students.js +1 -1
- package/lib/cjs/components/EditCourse/Requests.js +1 -1
- package/lib/cjs/components/EditCourse/Users.js +1 -1
- package/lib/cjs/components/LessonCommentObjects/LessonCommentObjects.js +6 -2
- package/lib/esm/components/CourseDashboard/Teacher/Students.js +1 -1
- package/lib/esm/components/EditCourse/Requests.js +1 -1
- package/lib/esm/components/EditCourse/Users.js +1 -1
- package/lib/esm/components/LessonCommentObjects/LessonCommentObjects.js +6 -2
- package/lib/umd/react-ui.js +1 -1
- package/package.json +8 -8
|
@@ -34,7 +34,7 @@ function Students(props) {
|
|
|
34
34
|
isLoadingNext: false,
|
|
35
35
|
next: null,
|
|
36
36
|
cacheKey: react_core_1.SCCache.getWidgetStateCacheKey(react_core_1.SCCache.STUDENTS_PARTECIPANTS_COURSES_STATE_CACHE_PREFIX_KEY, course.id),
|
|
37
|
-
cacheStrategy: utils_1.CacheStrategies.
|
|
37
|
+
cacheStrategy: utils_1.CacheStrategies.NETWORK_ONLY,
|
|
38
38
|
visibleItems: endpointQueryParams.limit
|
|
39
39
|
}, widget_1.stateWidgetInitializer);
|
|
40
40
|
// HOOKS
|
|
@@ -45,7 +45,7 @@ function Requests(props) {
|
|
|
45
45
|
isLoadingNext: false,
|
|
46
46
|
next: null,
|
|
47
47
|
cacheKey: react_core_1.SCCache.getWidgetStateCacheKey(react_core_1.SCCache.USERS_REQUESTS_COURSES_STATE_CACHE_PREFIX_KEY, course.id),
|
|
48
|
-
cacheStrategy: utils_1.CacheStrategies.
|
|
48
|
+
cacheStrategy: utils_1.CacheStrategies.NETWORK_ONLY,
|
|
49
49
|
visibleItems: endpointQueryParams.limit
|
|
50
50
|
}, widget_1.stateWidgetInitializer);
|
|
51
51
|
// CONTEXTS
|
|
@@ -51,7 +51,7 @@ function Users(props) {
|
|
|
51
51
|
isLoadingNext: false,
|
|
52
52
|
next: null,
|
|
53
53
|
cacheKey: react_core_1.SCCache.getWidgetStateCacheKey(react_core_1.SCCache.USERS_PARTECIPANTS_COURSES_STATE_CACHE_PREFIX_KEY, course.id),
|
|
54
|
-
cacheStrategy: utils_1.CacheStrategies.
|
|
54
|
+
cacheStrategy: utils_1.CacheStrategies.NETWORK_ONLY,
|
|
55
55
|
visibleItems: endpointQueryParams.limit
|
|
56
56
|
}, widget_1.stateWidgetInitializer);
|
|
57
57
|
// CONTEXTS
|
|
@@ -87,7 +87,6 @@ function LessonCommentObjects(inProps) {
|
|
|
87
87
|
const commentsObject = (0, react_core_1.useSCFetchLessonCommentObjects)({
|
|
88
88
|
id: lessonObject.id,
|
|
89
89
|
lessonObject: lessonObject,
|
|
90
|
-
pageSize: 8,
|
|
91
90
|
orderBy: types_1.SCCommentsOrderBy.ADDED_AT_ASC,
|
|
92
91
|
cacheStrategy
|
|
93
92
|
});
|
|
@@ -176,6 +175,11 @@ function LessonCommentObjects(inProps) {
|
|
|
176
175
|
if (!commentsObject.comments.length && commentsObject.isLoadingNext) {
|
|
177
176
|
return (0, jsx_runtime_1.jsx)(Skeleton_1.default, Object.assign({ count: 5 }, CommentsObjectSkeletonProps));
|
|
178
177
|
}
|
|
179
|
-
return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ id: id, className: (0, classnames_1.default)(classes.root, className) }, rest, { children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: commentsObject.comments.length > 0 ? ((0, jsx_runtime_1.jsx)(InfiniteScroll_1.default, Object.assign({ height: '100%', dataLength: commentsObject.comments.length, next: handleNext, hasMoreNext: Boolean(commentsObject.next), loaderNext: (0, jsx_runtime_1.jsx)(LessonCommentObject_1.LessonCommentObjectSkeleton, Object.assign({}, CommentObjectSkeletonProps, { count: 1 })) }, { children: (0, jsx_runtime_1.jsx)(material_1.List, Object.assign({ ref: commentsEndRef }, { children: commentsObject.comments.map((c, index) => ((0, jsx_runtime_1.jsx)(material_1.ListItem, { children: (0, jsx_runtime_1.jsx)(LessonCommentObject_1.default, Object.assign({ commentObject: c, lessonObject: commentsObject.lessonObject, onDelete: (comment) => handleCommentsUpdate(comment, true), isEditing: (editing) => setIsEditing(editing) }, CommentComponentProps, { CommentObjectSkeletonProps: CommentObjectSkeletonProps }), c.id) }, index))) })) }))) : null }), !editing && ((0, jsx_runtime_1.jsx)(CommentObjectReply_1.default, { id: `reply-lessonCommentObjects`, showAvatar: false, replyIcon: true, editable: !commenting, onReply: handleCommentAction, EditorProps: {
|
|
178
|
+
return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ id: id, className: (0, classnames_1.default)(classes.root, className) }, rest, { children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: commentsObject.comments.length > 0 ? ((0, jsx_runtime_1.jsx)(InfiniteScroll_1.default, Object.assign({ height: '100%', dataLength: commentsObject.comments.length, next: handleNext, hasMoreNext: Boolean(commentsObject.next), loaderNext: (0, jsx_runtime_1.jsx)(LessonCommentObject_1.LessonCommentObjectSkeleton, Object.assign({}, CommentObjectSkeletonProps, { count: 1 })) }, { children: (0, jsx_runtime_1.jsx)(material_1.List, Object.assign({ ref: commentsEndRef }, { children: commentsObject.comments.map((c, index) => ((0, jsx_runtime_1.jsx)(material_1.ListItem, { children: (0, jsx_runtime_1.jsx)(LessonCommentObject_1.default, Object.assign({ commentObject: c, lessonObject: commentsObject.lessonObject, onDelete: (comment) => handleCommentsUpdate(comment, true), isEditing: (editing) => setIsEditing(editing) }, CommentComponentProps, { CommentObjectSkeletonProps: CommentObjectSkeletonProps }), c.id) }, index))) })) }))) : null }), !editing && ((0, jsx_runtime_1.jsx)(CommentObjectReply_1.default, { id: `reply-lessonCommentObjects`, showAvatar: false, replyIcon: true, editable: !commenting, onReply: handleCommentAction, EditorProps: {
|
|
179
|
+
placeholder: intl.formatMessage(messages.commentEditorPlaceholder),
|
|
180
|
+
uploadFile: true,
|
|
181
|
+
uploadImage: false,
|
|
182
|
+
isLessonCommentEditor: true
|
|
183
|
+
} }, replyKey))] }) })));
|
|
180
184
|
}
|
|
181
185
|
exports.default = LessonCommentObjects;
|
|
@@ -31,7 +31,7 @@ function Students(props) {
|
|
|
31
31
|
isLoadingNext: false,
|
|
32
32
|
next: null,
|
|
33
33
|
cacheKey: SCCache.getWidgetStateCacheKey(SCCache.STUDENTS_PARTECIPANTS_COURSES_STATE_CACHE_PREFIX_KEY, course.id),
|
|
34
|
-
cacheStrategy: CacheStrategies.
|
|
34
|
+
cacheStrategy: CacheStrategies.NETWORK_ONLY,
|
|
35
35
|
visibleItems: endpointQueryParams.limit
|
|
36
36
|
}, stateWidgetInitializer);
|
|
37
37
|
// HOOKS
|
|
@@ -42,7 +42,7 @@ function Requests(props) {
|
|
|
42
42
|
isLoadingNext: false,
|
|
43
43
|
next: null,
|
|
44
44
|
cacheKey: SCCache.getWidgetStateCacheKey(SCCache.USERS_REQUESTS_COURSES_STATE_CACHE_PREFIX_KEY, course.id),
|
|
45
|
-
cacheStrategy: CacheStrategies.
|
|
45
|
+
cacheStrategy: CacheStrategies.NETWORK_ONLY,
|
|
46
46
|
visibleItems: endpointQueryParams.limit
|
|
47
47
|
}, stateWidgetInitializer);
|
|
48
48
|
// CONTEXTS
|
|
@@ -48,7 +48,7 @@ function Users(props) {
|
|
|
48
48
|
isLoadingNext: false,
|
|
49
49
|
next: null,
|
|
50
50
|
cacheKey: SCCache.getWidgetStateCacheKey(SCCache.USERS_PARTECIPANTS_COURSES_STATE_CACHE_PREFIX_KEY, course.id),
|
|
51
|
-
cacheStrategy: CacheStrategies.
|
|
51
|
+
cacheStrategy: CacheStrategies.NETWORK_ONLY,
|
|
52
52
|
visibleItems: endpointQueryParams.limit
|
|
53
53
|
}, stateWidgetInitializer);
|
|
54
54
|
// CONTEXTS
|
|
@@ -85,7 +85,6 @@ export default function LessonCommentObjects(inProps) {
|
|
|
85
85
|
const commentsObject = useSCFetchLessonCommentObjects({
|
|
86
86
|
id: lessonObject.id,
|
|
87
87
|
lessonObject: lessonObject,
|
|
88
|
-
pageSize: 8,
|
|
89
88
|
orderBy: SCCommentsOrderBy.ADDED_AT_ASC,
|
|
90
89
|
cacheStrategy
|
|
91
90
|
});
|
|
@@ -174,5 +173,10 @@ export default function LessonCommentObjects(inProps) {
|
|
|
174
173
|
if (!commentsObject.comments.length && commentsObject.isLoadingNext) {
|
|
175
174
|
return _jsx(LessonCommentsObjectSkeleton, Object.assign({ count: 5 }, CommentsObjectSkeletonProps));
|
|
176
175
|
}
|
|
177
|
-
return (_jsx(Root, Object.assign({ id: id, className: classNames(classes.root, className) }, rest, { children: _jsxs(_Fragment, { children: [_jsx(_Fragment, { children: commentsObject.comments.length > 0 ? (_jsx(InfiniteScroll, Object.assign({ height: '100%', dataLength: commentsObject.comments.length, next: handleNext, hasMoreNext: Boolean(commentsObject.next), loaderNext: _jsx(LessonCommentObjectSkeleton, Object.assign({}, CommentObjectSkeletonProps, { count: 1 })) }, { children: _jsx(List, Object.assign({ ref: commentsEndRef }, { children: commentsObject.comments.map((c, index) => (_jsx(ListItem, { children: _jsx(LessonCommentObject, Object.assign({ commentObject: c, lessonObject: commentsObject.lessonObject, onDelete: (comment) => handleCommentsUpdate(comment, true), isEditing: (editing) => setIsEditing(editing) }, CommentComponentProps, { CommentObjectSkeletonProps: CommentObjectSkeletonProps }), c.id) }, index))) })) }))) : null }), !editing && (_jsx(CommentObjectReply, { id: `reply-lessonCommentObjects`, showAvatar: false, replyIcon: true, editable: !commenting, onReply: handleCommentAction, EditorProps: {
|
|
176
|
+
return (_jsx(Root, Object.assign({ id: id, className: classNames(classes.root, className) }, rest, { children: _jsxs(_Fragment, { children: [_jsx(_Fragment, { children: commentsObject.comments.length > 0 ? (_jsx(InfiniteScroll, Object.assign({ height: '100%', dataLength: commentsObject.comments.length, next: handleNext, hasMoreNext: Boolean(commentsObject.next), loaderNext: _jsx(LessonCommentObjectSkeleton, Object.assign({}, CommentObjectSkeletonProps, { count: 1 })) }, { children: _jsx(List, Object.assign({ ref: commentsEndRef }, { children: commentsObject.comments.map((c, index) => (_jsx(ListItem, { children: _jsx(LessonCommentObject, Object.assign({ commentObject: c, lessonObject: commentsObject.lessonObject, onDelete: (comment) => handleCommentsUpdate(comment, true), isEditing: (editing) => setIsEditing(editing) }, CommentComponentProps, { CommentObjectSkeletonProps: CommentObjectSkeletonProps }), c.id) }, index))) })) }))) : null }), !editing && (_jsx(CommentObjectReply, { id: `reply-lessonCommentObjects`, showAvatar: false, replyIcon: true, editable: !commenting, onReply: handleCommentAction, EditorProps: {
|
|
177
|
+
placeholder: intl.formatMessage(messages.commentEditorPlaceholder),
|
|
178
|
+
uploadFile: true,
|
|
179
|
+
uploadImage: false,
|
|
180
|
+
isLessonCommentEditor: true
|
|
181
|
+
} }, replyKey))] }) })));
|
|
178
182
|
}
|