@selfcommunity/react-ui 0.11.0-alpha.60 → 0.11.0-alpha.62
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/assets/courses/clapping.d.ts +1 -0
- package/lib/cjs/assets/courses/clapping.js +4 -0
- package/lib/cjs/components/BottomNavigation/BottomNavigation.js +17 -2
- package/lib/cjs/components/CategoryAutocomplete/CategoryAutocomplete.js +6 -8
- package/lib/cjs/components/CommentObject/CommentObject.d.ts +5 -0
- package/lib/cjs/components/CommentObject/CommentObject.js +2 -2
- package/lib/cjs/components/CommentObjectReply/CommentObjectReply.d.ts +24 -2
- package/lib/cjs/components/CommentObjectReply/CommentObjectReply.js +17 -4
- package/lib/cjs/components/Composer/Content/ContentLesson/ContentLesson.d.ts +38 -0
- package/lib/cjs/components/Composer/Content/ContentLesson/ContentLesson.js +67 -0
- package/lib/cjs/components/Composer/Content/ContentLesson/index.d.ts +3 -0
- package/lib/cjs/components/Composer/Content/ContentLesson/index.js +5 -0
- package/lib/cjs/components/Composer/Layer/AudienceLayer/AudienceLayer.js +2 -2
- package/lib/cjs/components/ComposerIconButton/ComposerIconButton.d.ts +9 -3
- package/lib/cjs/components/ComposerIconButton/ComposerIconButton.js +38 -9
- package/lib/cjs/components/Course/Course.d.ts +92 -0
- package/lib/cjs/components/Course/Course.js +185 -0
- package/lib/cjs/components/Course/CreatePlaceholder.d.ts +39 -0
- package/lib/cjs/components/Course/CreatePlaceholder.js +59 -0
- package/lib/cjs/components/Course/Skeleton.d.ts +51 -0
- package/lib/cjs/components/Course/Skeleton.js +77 -0
- package/lib/cjs/components/Course/constants.d.ts +1 -0
- package/lib/cjs/components/Course/constants.js +4 -0
- package/lib/cjs/components/Course/index.d.ts +4 -0
- package/lib/cjs/components/Course/index.js +8 -0
- package/lib/cjs/components/CourseCompletedDialog/CourseCompletedDialog.d.ts +9 -0
- package/lib/cjs/components/CourseCompletedDialog/CourseCompletedDialog.js +40 -0
- package/lib/cjs/components/CourseCompletedDialog/index.d.ts +3 -0
- package/lib/cjs/components/CourseCompletedDialog/index.js +5 -0
- package/lib/cjs/components/CourseContentMenu/CourseContentMenu.d.ts +25 -0
- package/lib/cjs/components/CourseContentMenu/CourseContentMenu.js +47 -0
- package/lib/cjs/components/CourseContentMenu/constants.d.ts +1 -0
- package/lib/cjs/components/CourseContentMenu/constants.js +4 -0
- package/lib/cjs/components/CourseContentMenu/index.d.ts +3 -0
- package/lib/cjs/components/CourseContentMenu/index.js +5 -0
- package/lib/cjs/components/CourseDashboard/Header/Skeleton.d.ts +1 -0
- package/lib/cjs/components/CourseDashboard/Header/Skeleton.js +16 -0
- package/lib/cjs/components/CourseDashboard/Header.d.ts +9 -0
- package/lib/cjs/components/CourseDashboard/Header.js +44 -0
- package/lib/cjs/components/CourseDashboard/Student/ActionButton.d.ts +8 -0
- package/lib/cjs/components/CourseDashboard/Student/ActionButton.js +16 -0
- package/lib/cjs/components/CourseDashboard/Student/Skeleton.d.ts +1 -0
- package/lib/cjs/components/CourseDashboard/Student/Skeleton.js +30 -0
- package/lib/cjs/components/CourseDashboard/Student.d.ts +11 -0
- package/lib/cjs/components/CourseDashboard/Student.js +203 -0
- package/lib/cjs/components/CourseDashboard/Teacher/Comments.d.ts +9 -0
- package/lib/cjs/components/CourseDashboard/Teacher/Comments.js +108 -0
- package/lib/cjs/components/CourseDashboard/Teacher/Info.d.ts +11 -0
- package/lib/cjs/components/CourseDashboard/Teacher/Info.js +19 -0
- package/lib/cjs/components/CourseDashboard/Teacher/Skeleton.d.ts +1 -0
- package/lib/cjs/components/CourseDashboard/Teacher/Skeleton.js +25 -0
- package/lib/cjs/components/CourseDashboard/Teacher/Students.d.ts +10 -0
- package/lib/cjs/components/CourseDashboard/Teacher/Students.js +71 -0
- package/lib/cjs/components/CourseDashboard/Teacher.d.ts +11 -0
- package/lib/cjs/components/CourseDashboard/Teacher.js +62 -0
- package/lib/cjs/components/CourseDashboard/constants.d.ts +1 -0
- package/lib/cjs/components/CourseDashboard/constants.js +4 -0
- package/lib/cjs/components/CourseDashboard/index.d.ts +11 -0
- package/lib/cjs/components/CourseDashboard/index.js +11 -0
- package/lib/cjs/components/CourseDashboard/types.d.ts +8 -0
- package/lib/cjs/components/CourseDashboard/types.js +13 -0
- package/lib/cjs/components/CourseForm/CourseForm.d.ts +74 -0
- package/lib/cjs/components/CourseForm/CourseForm.js +273 -0
- package/lib/cjs/components/CourseForm/Dialog.d.ts +8 -0
- package/lib/cjs/components/CourseForm/Dialog.js +19 -0
- package/lib/cjs/components/CourseForm/Edit.d.ts +24 -0
- package/lib/cjs/components/CourseForm/Edit.js +53 -0
- package/lib/cjs/components/CourseForm/Skeleton.d.ts +1 -0
- package/lib/cjs/components/CourseForm/Skeleton.js +17 -0
- package/lib/cjs/components/CourseForm/UploadCourseCover.d.ts +45 -0
- package/lib/cjs/components/CourseForm/UploadCourseCover.js +94 -0
- package/lib/cjs/components/CourseForm/constants.d.ts +1 -0
- package/lib/cjs/components/CourseForm/constants.js +4 -0
- package/lib/cjs/components/CourseForm/index.d.ts +4 -0
- package/lib/cjs/components/CourseForm/index.js +8 -0
- package/lib/cjs/components/CourseFormDialog/CourseFormDialog.d.ts +48 -0
- package/lib/cjs/components/CourseFormDialog/CourseFormDialog.js +67 -0
- package/lib/cjs/components/CourseFormDialog/constants.d.ts +1 -0
- package/lib/cjs/components/CourseFormDialog/constants.js +4 -0
- package/lib/cjs/components/CourseFormDialog/index.d.ts +3 -0
- package/lib/cjs/components/CourseFormDialog/index.js +5 -0
- package/lib/cjs/components/CourseJoinButton/CourseJoinButton.d.ts +56 -0
- package/lib/cjs/components/CourseJoinButton/CourseJoinButton.js +148 -0
- package/lib/cjs/components/CourseJoinButton/index.d.ts +3 -0
- package/lib/cjs/components/CourseJoinButton/index.js +5 -0
- package/lib/cjs/components/CourseParticipantsButton/CourseParticipantsButton.d.ts +53 -0
- package/lib/cjs/components/CourseParticipantsButton/CourseParticipantsButton.js +150 -0
- package/lib/cjs/components/CourseParticipantsButton/index.d.ts +3 -0
- package/lib/cjs/components/CourseParticipantsButton/index.js +5 -0
- package/lib/cjs/components/Courses/Courses.d.ts +100 -0
- package/lib/cjs/components/Courses/Courses.js +237 -0
- package/lib/cjs/components/Courses/Skeleton.d.ts +54 -0
- package/lib/cjs/components/Courses/Skeleton.js +45 -0
- package/lib/cjs/components/Courses/constants.d.ts +1 -0
- package/lib/cjs/components/Courses/constants.js +4 -0
- package/lib/cjs/components/Courses/index.d.ts +4 -0
- package/lib/cjs/components/Courses/index.js +8 -0
- package/lib/cjs/components/Courses/prefetchedCourses.d.ts +81 -0
- package/lib/cjs/components/Courses/prefetchedCourses.js +186 -0
- package/lib/cjs/components/CreateCourseButton/CreateCourseButton.d.ts +38 -0
- package/lib/cjs/components/CreateCourseButton/CreateCourseButton.js +81 -0
- package/lib/cjs/components/CreateCourseButton/index.d.ts +3 -0
- package/lib/cjs/components/CreateCourseButton/index.js +5 -0
- package/lib/cjs/components/EditCourse/Customize.d.ts +9 -0
- package/lib/cjs/components/EditCourse/Customize.js +31 -0
- package/lib/cjs/components/EditCourse/EditCourse.d.ts +13 -0
- package/lib/cjs/components/EditCourse/EditCourse.js +110 -0
- package/lib/cjs/components/EditCourse/Lessons/AddButton.d.ts +9 -0
- package/lib/cjs/components/EditCourse/Lessons/AddButton.js +29 -0
- package/lib/cjs/components/EditCourse/Lessons/ChangeLessonStatus.d.ts +13 -0
- package/lib/cjs/components/EditCourse/Lessons/ChangeLessonStatus.js +92 -0
- package/lib/cjs/components/EditCourse/Lessons/FieldName.d.ts +15 -0
- package/lib/cjs/components/EditCourse/Lessons/FieldName.js +83 -0
- package/lib/cjs/components/EditCourse/Lessons/LessonRow.d.ts +15 -0
- package/lib/cjs/components/EditCourse/Lessons/LessonRow.js +68 -0
- package/lib/cjs/components/EditCourse/Lessons/SectionRow.d.ts +14 -0
- package/lib/cjs/components/EditCourse/Lessons/SectionRow.js +158 -0
- package/lib/cjs/components/EditCourse/Lessons/Skeleton.d.ts +1 -0
- package/lib/cjs/components/EditCourse/Lessons/Skeleton.js +20 -0
- package/lib/cjs/components/EditCourse/Lessons.d.ts +11 -0
- package/lib/cjs/components/EditCourse/Lessons.js +196 -0
- package/lib/cjs/components/EditCourse/MenuRow.d.ts +9 -0
- package/lib/cjs/components/EditCourse/MenuRow.js +25 -0
- package/lib/cjs/components/EditCourse/Options/Skeleton.d.ts +1 -0
- package/lib/cjs/components/EditCourse/Options/Skeleton.js +15 -0
- package/lib/cjs/components/EditCourse/Options/SwitchForm.d.ts +11 -0
- package/lib/cjs/components/EditCourse/Options/SwitchForm.js +20 -0
- package/lib/cjs/components/EditCourse/Options.d.ts +9 -0
- package/lib/cjs/components/EditCourse/Options.js +96 -0
- package/lib/cjs/components/EditCourse/Requests.d.ts +12 -0
- package/lib/cjs/components/EditCourse/Requests.js +97 -0
- package/lib/cjs/components/EditCourse/Skeleton.d.ts +8 -0
- package/lib/cjs/components/EditCourse/Skeleton.js +28 -0
- package/lib/cjs/components/EditCourse/Status.d.ts +9 -0
- package/lib/cjs/components/EditCourse/Status.js +33 -0
- package/lib/cjs/components/EditCourse/Users/Skeleton.d.ts +1 -0
- package/lib/cjs/components/EditCourse/Users/Skeleton.js +15 -0
- package/lib/cjs/components/EditCourse/Users.d.ts +11 -0
- package/lib/cjs/components/EditCourse/Users.js +140 -0
- package/lib/cjs/components/EditCourse/constants.d.ts +1 -0
- package/lib/cjs/components/EditCourse/constants.js +4 -0
- package/lib/cjs/components/EditCourse/hooks.d.ts +3 -0
- package/lib/cjs/components/EditCourse/hooks.js +22 -0
- package/lib/cjs/components/EditCourse/index.d.ts +4 -0
- package/lib/cjs/components/EditCourse/index.js +8 -0
- package/lib/cjs/components/EditCourse/types.d.ts +29 -0
- package/lib/cjs/components/EditCourse/types.js +19 -0
- package/lib/cjs/components/Editor/Editor.d.ts +37 -0
- package/lib/cjs/components/Editor/Editor.js +6 -3
- package/lib/cjs/components/Editor/plugins/EmojiPlugin.d.ts +3 -1
- package/lib/cjs/components/Editor/plugins/EmojiPlugin.js +4 -10
- package/lib/cjs/components/Editor/plugins/MediaPlugin.d.ts +14 -0
- package/lib/cjs/components/Editor/plugins/MediaPlugin.js +121 -0
- package/lib/cjs/components/Editor/plugins/ToolbarPlugin.d.ts +5 -0
- package/lib/cjs/components/Editor/plugins/ToolbarPlugin.js +3 -2
- package/lib/cjs/components/Editor/plugins/index.d.ts +2 -1
- package/lib/cjs/components/Editor/plugins/index.js +3 -1
- package/lib/cjs/components/EventForm/EventForm.js +1 -1
- package/lib/cjs/components/LessonAppbar/LessonAppbar.d.ts +42 -0
- package/lib/cjs/components/LessonAppbar/LessonAppbar.js +34 -0
- package/lib/cjs/components/LessonAppbar/constants.d.ts +1 -0
- package/lib/cjs/components/LessonAppbar/constants.js +4 -0
- package/lib/cjs/components/LessonAppbar/index.d.ts +3 -0
- package/lib/cjs/components/LessonAppbar/index.js +5 -0
- package/lib/cjs/components/LessonCommentObject/LessonCommentObject.d.ts +94 -0
- package/lib/cjs/components/LessonCommentObject/LessonCommentObject.js +202 -0
- package/lib/cjs/components/LessonCommentObject/Skeleton.d.ts +21 -0
- package/lib/cjs/components/LessonCommentObject/Skeleton.js +46 -0
- package/lib/cjs/components/LessonCommentObject/constants.d.ts +1 -0
- package/lib/cjs/components/LessonCommentObject/constants.js +4 -0
- package/lib/cjs/components/LessonCommentObject/index.d.ts +4 -0
- package/lib/cjs/components/LessonCommentObject/index.js +8 -0
- package/lib/cjs/components/LessonCommentObjects/LessonCommentObjects.d.ts +76 -0
- package/lib/cjs/components/LessonCommentObjects/LessonCommentObjects.js +185 -0
- package/lib/cjs/components/LessonCommentObjects/Skeleton.d.ts +23 -0
- package/lib/cjs/components/LessonCommentObjects/Skeleton.js +40 -0
- package/lib/cjs/components/LessonCommentObjects/constants.d.ts +1 -0
- package/lib/cjs/components/LessonCommentObjects/constants.js +4 -0
- package/lib/cjs/components/LessonCommentObjects/index.d.ts +4 -0
- package/lib/cjs/components/LessonCommentObjects/index.js +8 -0
- package/lib/cjs/components/LessonDrawer/LessonDrawer.d.ts +50 -0
- package/lib/cjs/components/LessonDrawer/LessonDrawer.js +37 -0
- package/lib/cjs/components/LessonDrawer/constants.d.ts +1 -0
- package/lib/cjs/components/LessonDrawer/constants.js +4 -0
- package/lib/cjs/components/LessonDrawer/index.d.ts +3 -0
- package/lib/cjs/components/LessonDrawer/index.js +5 -0
- package/lib/cjs/components/LessonEditForm/LessonEditForm.d.ts +24 -0
- package/lib/cjs/components/LessonEditForm/LessonEditForm.js +45 -0
- package/lib/cjs/components/LessonEditForm/constants.d.ts +1 -0
- package/lib/cjs/components/LessonEditForm/constants.js +4 -0
- package/lib/cjs/components/LessonEditForm/index.d.ts +3 -0
- package/lib/cjs/components/LessonEditForm/index.js +5 -0
- package/lib/cjs/components/LessonObject/LessonObject.d.ts +40 -0
- package/lib/cjs/components/LessonObject/LessonObject.js +70 -0
- package/lib/cjs/components/LessonObject/constants.d.ts +1 -0
- package/lib/cjs/components/LessonObject/constants.js +4 -0
- package/lib/cjs/components/LessonObject/index.d.ts +3 -0
- package/lib/cjs/components/LessonObject/index.js +5 -0
- package/lib/cjs/components/LessonReleaseMenu/LessonReleaseMenu.d.ts +26 -0
- package/lib/cjs/components/LessonReleaseMenu/LessonReleaseMenu.js +172 -0
- package/lib/cjs/components/LessonReleaseMenu/constants.d.ts +5 -0
- package/lib/cjs/components/LessonReleaseMenu/constants.js +9 -0
- package/lib/cjs/components/LessonReleaseMenu/index.d.ts +3 -0
- package/lib/cjs/components/LessonReleaseMenu/index.js +5 -0
- package/lib/cjs/components/NavigationMenuIconButton/DefaultDrawerContent.js +7 -5
- package/lib/cjs/components/NavigationToolbar/NavigationToolbar.js +12 -1
- package/lib/cjs/components/Notification/Course/Course.d.ts +15 -0
- package/lib/cjs/components/Notification/Course/Course.js +89 -0
- package/lib/cjs/components/Notification/Course/index.d.ts +3 -0
- package/lib/cjs/components/Notification/Course/index.js +5 -0
- package/lib/cjs/components/Notification/Course/utils.d.ts +5 -0
- package/lib/cjs/components/Notification/Course/utils.js +44 -0
- package/lib/cjs/components/Notification/Notification.js +9 -0
- package/lib/cjs/components/SnippetNotifications/SnippetNotifications.js +9 -0
- package/lib/cjs/components/TagAutocomplete/TagAutocomplete.js +2 -2
- package/lib/cjs/components/ToastNotifications/ToastNotifications.js +9 -0
- package/lib/cjs/components/UserCreatedCoursesWidget/Skeleton.d.ts +21 -0
- package/lib/cjs/components/UserCreatedCoursesWidget/Skeleton.js +43 -0
- package/lib/cjs/components/UserCreatedCoursesWidget/UserCreatedCoursesWidget.d.ts +63 -0
- package/lib/cjs/components/UserCreatedCoursesWidget/UserCreatedCoursesWidget.js +154 -0
- package/lib/cjs/components/UserCreatedCoursesWidget/constants.d.ts +1 -0
- package/lib/cjs/components/UserCreatedCoursesWidget/constants.js +4 -0
- package/lib/cjs/components/UserCreatedCoursesWidget/index.d.ts +4 -0
- package/lib/cjs/components/UserCreatedCoursesWidget/index.js +8 -0
- package/lib/cjs/constants/Course.d.ts +6 -0
- package/lib/cjs/constants/Course.js +10 -0
- package/lib/cjs/constants/PubSub.d.ts +14 -0
- package/lib/cjs/constants/PubSub.js +16 -1
- package/lib/cjs/index.d.ts +23 -2
- package/lib/cjs/index.js +60 -5
- package/lib/cjs/shared/AccordionLessons/AccordionLessons.d.ts +8 -0
- package/lib/cjs/shared/AccordionLessons/AccordionLessons.js +65 -0
- package/lib/cjs/shared/AccordionLessons/Skeleton.d.ts +1 -0
- package/lib/cjs/shared/AccordionLessons/Skeleton.js +21 -0
- package/lib/cjs/shared/AccordionLessons/constants.d.ts +1 -0
- package/lib/cjs/shared/AccordionLessons/constants.js +4 -0
- package/lib/cjs/shared/AccordionLessons/index.d.ts +4 -0
- package/lib/cjs/shared/AccordionLessons/index.js +8 -0
- package/lib/cjs/shared/AddUsersButton/AddUsersButton.d.ts +29 -0
- package/lib/cjs/shared/AddUsersButton/AddUsersButton.js +136 -0
- package/lib/cjs/shared/AddUsersButton/index.d.ts +3 -0
- package/lib/cjs/shared/AddUsersButton/index.js +5 -0
- package/lib/cjs/shared/CourseTypePopover/CourseTypePopover.d.ts +9 -0
- package/lib/cjs/shared/CourseTypePopover/CourseTypePopover.js +48 -0
- package/lib/cjs/shared/CourseTypePopover/index.d.ts +3 -0
- package/lib/cjs/shared/CourseTypePopover/index.js +5 -0
- package/lib/cjs/shared/CourseUsersTable/ChangeUsersStatus.d.ts +9 -0
- package/lib/cjs/shared/CourseUsersTable/ChangeUsersStatus.js +58 -0
- package/lib/cjs/shared/CourseUsersTable/CourseUsersTable.d.ts +21 -0
- package/lib/cjs/shared/CourseUsersTable/CourseUsersTable.js +155 -0
- package/lib/cjs/shared/CourseUsersTable/RemoveButton.d.ts +10 -0
- package/lib/cjs/shared/CourseUsersTable/RemoveButton.js +51 -0
- package/lib/cjs/shared/CourseUsersTable/RequestButton.d.ts +10 -0
- package/lib/cjs/shared/CourseUsersTable/RequestButton.js +79 -0
- package/lib/cjs/shared/CourseUsersTable/RowSkeleton.d.ts +8 -0
- package/lib/cjs/shared/CourseUsersTable/RowSkeleton.js +14 -0
- package/lib/cjs/shared/CourseUsersTable/SeeProgressButton.d.ts +9 -0
- package/lib/cjs/shared/CourseUsersTable/SeeProgressButton.js +56 -0
- package/lib/cjs/shared/CourseUsersTable/Skeleton.d.ts +1 -0
- package/lib/cjs/shared/CourseUsersTable/Skeleton.js +19 -0
- package/lib/cjs/shared/CourseUsersTable/constants.d.ts +1 -0
- package/lib/cjs/shared/CourseUsersTable/constants.js +4 -0
- package/lib/cjs/shared/CourseUsersTable/index.d.ts +4 -0
- package/lib/cjs/shared/CourseUsersTable/index.js +8 -0
- package/lib/cjs/shared/DateTimeAgo/index.d.ts +1 -1
- package/lib/cjs/shared/EmptyStatus/EmptyStatus.d.ts +11 -0
- package/lib/cjs/shared/EmptyStatus/EmptyStatus.js +26 -0
- package/lib/cjs/shared/EmptyStatus/index.d.ts +3 -0
- package/lib/cjs/shared/EmptyStatus/index.js +5 -0
- package/lib/cjs/shared/LessonCommentActionsMenu/index.d.ts +41 -0
- package/lib/cjs/shared/LessonCommentActionsMenu/index.js +197 -0
- package/lib/cjs/shared/LessonFilePreview/index.d.ts +12 -0
- package/lib/cjs/shared/LessonFilePreview/index.js +29 -0
- package/lib/cjs/shared/Media/Link/UrlTextField/index.js +2 -3
- package/lib/cjs/types/course.d.ts +40 -0
- package/lib/cjs/types/course.js +33 -0
- package/lib/cjs/types/index.d.ts +2 -1
- package/lib/cjs/types/index.js +6 -1
- package/lib/cjs/utils/course.d.ts +14 -0
- package/lib/cjs/utils/course.js +39 -0
- package/lib/esm/assets/courses/clapping.d.ts +1 -0
- package/lib/esm/assets/courses/clapping.js +1 -0
- package/lib/esm/components/BottomNavigation/BottomNavigation.js +17 -2
- package/lib/esm/components/CategoryAutocomplete/CategoryAutocomplete.js +6 -8
- package/lib/esm/components/CommentObject/CommentObject.d.ts +5 -0
- package/lib/esm/components/CommentObject/CommentObject.js +2 -2
- package/lib/esm/components/CommentObjectReply/CommentObjectReply.d.ts +24 -2
- package/lib/esm/components/CommentObjectReply/CommentObjectReply.js +18 -5
- package/lib/esm/components/Composer/Content/ContentLesson/ContentLesson.d.ts +38 -0
- package/lib/esm/components/Composer/Content/ContentLesson/ContentLesson.js +64 -0
- package/lib/esm/components/Composer/Content/ContentLesson/index.d.ts +3 -0
- package/lib/esm/components/Composer/Content/ContentLesson/index.js +2 -0
- package/lib/esm/components/Composer/Layer/AudienceLayer/AudienceLayer.js +2 -2
- package/lib/esm/components/ComposerIconButton/ComposerIconButton.d.ts +9 -3
- package/lib/esm/components/ComposerIconButton/ComposerIconButton.js +38 -9
- package/lib/esm/components/Course/Course.d.ts +92 -0
- package/lib/esm/components/Course/Course.js +182 -0
- package/lib/esm/components/Course/CreatePlaceholder.d.ts +39 -0
- package/lib/esm/components/Course/CreatePlaceholder.js +56 -0
- package/lib/esm/components/Course/Skeleton.d.ts +51 -0
- package/lib/esm/components/Course/Skeleton.js +74 -0
- package/lib/esm/components/Course/constants.d.ts +1 -0
- package/lib/esm/components/Course/constants.js +1 -0
- package/lib/esm/components/Course/index.d.ts +4 -0
- package/lib/esm/components/Course/index.js +4 -0
- package/lib/esm/components/CourseCompletedDialog/CourseCompletedDialog.d.ts +9 -0
- package/lib/esm/components/CourseCompletedDialog/CourseCompletedDialog.js +37 -0
- package/lib/esm/components/CourseCompletedDialog/index.d.ts +3 -0
- package/lib/esm/components/CourseCompletedDialog/index.js +2 -0
- package/lib/esm/components/CourseContentMenu/CourseContentMenu.d.ts +25 -0
- package/lib/esm/components/CourseContentMenu/CourseContentMenu.js +44 -0
- package/lib/esm/components/CourseContentMenu/constants.d.ts +1 -0
- package/lib/esm/components/CourseContentMenu/constants.js +1 -0
- package/lib/esm/components/CourseContentMenu/index.d.ts +3 -0
- package/lib/esm/components/CourseContentMenu/index.js +2 -0
- package/lib/esm/components/CourseDashboard/Header/Skeleton.d.ts +1 -0
- package/lib/esm/components/CourseDashboard/Header/Skeleton.js +13 -0
- package/lib/esm/components/CourseDashboard/Header.d.ts +9 -0
- package/lib/esm/components/CourseDashboard/Header.js +41 -0
- package/lib/esm/components/CourseDashboard/Student/ActionButton.d.ts +8 -0
- package/lib/esm/components/CourseDashboard/Student/ActionButton.js +13 -0
- package/lib/esm/components/CourseDashboard/Student/Skeleton.d.ts +1 -0
- package/lib/esm/components/CourseDashboard/Student/Skeleton.js +26 -0
- package/lib/esm/components/CourseDashboard/Student.d.ts +11 -0
- package/lib/esm/components/CourseDashboard/Student.js +201 -0
- package/lib/esm/components/CourseDashboard/Teacher/Comments.d.ts +9 -0
- package/lib/esm/components/CourseDashboard/Teacher/Comments.js +106 -0
- package/lib/esm/components/CourseDashboard/Teacher/Info.d.ts +11 -0
- package/lib/esm/components/CourseDashboard/Teacher/Info.js +16 -0
- package/lib/esm/components/CourseDashboard/Teacher/Skeleton.d.ts +1 -0
- package/lib/esm/components/CourseDashboard/Teacher/Skeleton.js +21 -0
- package/lib/esm/components/CourseDashboard/Teacher/Students.d.ts +10 -0
- package/lib/esm/components/CourseDashboard/Teacher/Students.js +68 -0
- package/lib/esm/components/CourseDashboard/Teacher.d.ts +11 -0
- package/lib/esm/components/CourseDashboard/Teacher.js +60 -0
- package/lib/esm/components/CourseDashboard/constants.d.ts +1 -0
- package/lib/esm/components/CourseDashboard/constants.js +1 -0
- package/lib/esm/components/CourseDashboard/index.d.ts +11 -0
- package/lib/esm/components/CourseDashboard/index.js +6 -0
- package/lib/esm/components/CourseDashboard/types.d.ts +8 -0
- package/lib/esm/components/CourseDashboard/types.js +10 -0
- package/lib/esm/components/CourseForm/CourseForm.d.ts +74 -0
- package/lib/esm/components/CourseForm/CourseForm.js +270 -0
- package/lib/esm/components/CourseForm/Dialog.d.ts +8 -0
- package/lib/esm/components/CourseForm/Dialog.js +16 -0
- package/lib/esm/components/CourseForm/Edit.d.ts +24 -0
- package/lib/esm/components/CourseForm/Edit.js +50 -0
- package/lib/esm/components/CourseForm/Skeleton.d.ts +1 -0
- package/lib/esm/components/CourseForm/Skeleton.js +14 -0
- package/lib/esm/components/CourseForm/UploadCourseCover.d.ts +45 -0
- package/lib/esm/components/CourseForm/UploadCourseCover.js +91 -0
- package/lib/esm/components/CourseForm/constants.d.ts +1 -0
- package/lib/esm/components/CourseForm/constants.js +1 -0
- package/lib/esm/components/CourseForm/index.d.ts +4 -0
- package/lib/esm/components/CourseForm/index.js +4 -0
- package/lib/esm/components/CourseFormDialog/CourseFormDialog.d.ts +48 -0
- package/lib/esm/components/CourseFormDialog/CourseFormDialog.js +64 -0
- package/lib/esm/components/CourseFormDialog/constants.d.ts +1 -0
- package/lib/esm/components/CourseFormDialog/constants.js +1 -0
- package/lib/esm/components/CourseFormDialog/index.d.ts +3 -0
- package/lib/esm/components/CourseFormDialog/index.js +2 -0
- package/lib/esm/components/CourseJoinButton/CourseJoinButton.d.ts +56 -0
- package/lib/esm/components/CourseJoinButton/CourseJoinButton.js +145 -0
- package/lib/esm/components/CourseJoinButton/index.d.ts +3 -0
- package/lib/esm/components/CourseJoinButton/index.js +2 -0
- package/lib/esm/components/CourseParticipantsButton/CourseParticipantsButton.d.ts +53 -0
- package/lib/esm/components/CourseParticipantsButton/CourseParticipantsButton.js +147 -0
- package/lib/esm/components/CourseParticipantsButton/index.d.ts +3 -0
- package/lib/esm/components/CourseParticipantsButton/index.js +2 -0
- package/lib/esm/components/Courses/Courses.d.ts +100 -0
- package/lib/esm/components/Courses/Courses.js +233 -0
- package/lib/esm/components/Courses/Skeleton.d.ts +54 -0
- package/lib/esm/components/Courses/Skeleton.js +42 -0
- package/lib/esm/components/Courses/constants.d.ts +1 -0
- package/lib/esm/components/Courses/constants.js +1 -0
- package/lib/esm/components/Courses/index.d.ts +4 -0
- package/lib/esm/components/Courses/index.js +4 -0
- package/lib/esm/components/Courses/prefetchedCourses.d.ts +81 -0
- package/lib/esm/components/Courses/prefetchedCourses.js +183 -0
- package/lib/esm/components/CreateCourseButton/CreateCourseButton.d.ts +38 -0
- package/lib/esm/components/CreateCourseButton/CreateCourseButton.js +78 -0
- package/lib/esm/components/CreateCourseButton/index.d.ts +3 -0
- package/lib/esm/components/CreateCourseButton/index.js +2 -0
- package/lib/esm/components/EditCourse/Customize.d.ts +9 -0
- package/lib/esm/components/EditCourse/Customize.js +28 -0
- package/lib/esm/components/EditCourse/EditCourse.d.ts +13 -0
- package/lib/esm/components/EditCourse/EditCourse.js +107 -0
- package/lib/esm/components/EditCourse/Lessons/AddButton.d.ts +9 -0
- package/lib/esm/components/EditCourse/Lessons/AddButton.js +27 -0
- package/lib/esm/components/EditCourse/Lessons/ChangeLessonStatus.d.ts +13 -0
- package/lib/esm/components/EditCourse/Lessons/ChangeLessonStatus.js +89 -0
- package/lib/esm/components/EditCourse/Lessons/FieldName.d.ts +15 -0
- package/lib/esm/components/EditCourse/Lessons/FieldName.js +80 -0
- package/lib/esm/components/EditCourse/Lessons/LessonRow.d.ts +15 -0
- package/lib/esm/components/EditCourse/Lessons/LessonRow.js +65 -0
- package/lib/esm/components/EditCourse/Lessons/SectionRow.d.ts +14 -0
- package/lib/esm/components/EditCourse/Lessons/SectionRow.js +155 -0
- package/lib/esm/components/EditCourse/Lessons/Skeleton.d.ts +1 -0
- package/lib/esm/components/EditCourse/Lessons/Skeleton.js +17 -0
- package/lib/esm/components/EditCourse/Lessons.d.ts +11 -0
- package/lib/esm/components/EditCourse/Lessons.js +193 -0
- package/lib/esm/components/EditCourse/MenuRow.d.ts +9 -0
- package/lib/esm/components/EditCourse/MenuRow.js +22 -0
- package/lib/esm/components/EditCourse/Options/Skeleton.d.ts +1 -0
- package/lib/esm/components/EditCourse/Options/Skeleton.js +12 -0
- package/lib/esm/components/EditCourse/Options/SwitchForm.d.ts +11 -0
- package/lib/esm/components/EditCourse/Options/SwitchForm.js +18 -0
- package/lib/esm/components/EditCourse/Options.d.ts +9 -0
- package/lib/esm/components/EditCourse/Options.js +93 -0
- package/lib/esm/components/EditCourse/Requests.d.ts +12 -0
- package/lib/esm/components/EditCourse/Requests.js +94 -0
- package/lib/esm/components/EditCourse/Skeleton.d.ts +8 -0
- package/lib/esm/components/EditCourse/Skeleton.js +25 -0
- package/lib/esm/components/EditCourse/Status.d.ts +9 -0
- package/lib/esm/components/EditCourse/Status.js +29 -0
- package/lib/esm/components/EditCourse/Users/Skeleton.d.ts +1 -0
- package/lib/esm/components/EditCourse/Users/Skeleton.js +12 -0
- package/lib/esm/components/EditCourse/Users.d.ts +11 -0
- package/lib/esm/components/EditCourse/Users.js +137 -0
- package/lib/esm/components/EditCourse/constants.d.ts +1 -0
- package/lib/esm/components/EditCourse/constants.js +1 -0
- package/lib/esm/components/EditCourse/hooks.d.ts +3 -0
- package/lib/esm/components/EditCourse/hooks.js +17 -0
- package/lib/esm/components/EditCourse/index.d.ts +4 -0
- package/lib/esm/components/EditCourse/index.js +4 -0
- package/lib/esm/components/EditCourse/types.d.ts +29 -0
- package/lib/esm/components/EditCourse/types.js +16 -0
- package/lib/esm/components/Editor/Editor.d.ts +37 -0
- package/lib/esm/components/Editor/Editor.js +7 -4
- package/lib/esm/components/Editor/plugins/EmojiPlugin.d.ts +3 -1
- package/lib/esm/components/Editor/plugins/EmojiPlugin.js +4 -10
- package/lib/esm/components/Editor/plugins/MediaPlugin.d.ts +14 -0
- package/lib/esm/components/Editor/plugins/MediaPlugin.js +117 -0
- package/lib/esm/components/Editor/plugins/ToolbarPlugin.d.ts +5 -0
- package/lib/esm/components/Editor/plugins/ToolbarPlugin.js +3 -2
- package/lib/esm/components/Editor/plugins/index.d.ts +2 -1
- package/lib/esm/components/Editor/plugins/index.js +2 -1
- package/lib/esm/components/EventForm/EventForm.js +1 -1
- package/lib/esm/components/LessonAppbar/LessonAppbar.d.ts +42 -0
- package/lib/esm/components/LessonAppbar/LessonAppbar.js +31 -0
- package/lib/esm/components/LessonAppbar/constants.d.ts +1 -0
- package/lib/esm/components/LessonAppbar/constants.js +1 -0
- package/lib/esm/components/LessonAppbar/index.d.ts +3 -0
- package/lib/esm/components/LessonAppbar/index.js +2 -0
- package/lib/esm/components/LessonCommentObject/LessonCommentObject.d.ts +94 -0
- package/lib/esm/components/LessonCommentObject/LessonCommentObject.js +199 -0
- package/lib/esm/components/LessonCommentObject/Skeleton.d.ts +21 -0
- package/lib/esm/components/LessonCommentObject/Skeleton.js +43 -0
- package/lib/esm/components/LessonCommentObject/constants.d.ts +1 -0
- package/lib/esm/components/LessonCommentObject/constants.js +1 -0
- package/lib/esm/components/LessonCommentObject/index.d.ts +4 -0
- package/lib/esm/components/LessonCommentObject/index.js +4 -0
- package/lib/esm/components/LessonCommentObjects/LessonCommentObjects.d.ts +76 -0
- package/lib/esm/components/LessonCommentObjects/LessonCommentObjects.js +182 -0
- package/lib/esm/components/LessonCommentObjects/Skeleton.d.ts +23 -0
- package/lib/esm/components/LessonCommentObjects/Skeleton.js +37 -0
- package/lib/esm/components/LessonCommentObjects/constants.d.ts +1 -0
- package/lib/esm/components/LessonCommentObjects/constants.js +1 -0
- package/lib/esm/components/LessonCommentObjects/index.d.ts +4 -0
- package/lib/esm/components/LessonCommentObjects/index.js +4 -0
- package/lib/esm/components/LessonDrawer/LessonDrawer.d.ts +50 -0
- package/lib/esm/components/LessonDrawer/LessonDrawer.js +34 -0
- package/lib/esm/components/LessonDrawer/constants.d.ts +1 -0
- package/lib/esm/components/LessonDrawer/constants.js +1 -0
- package/lib/esm/components/LessonDrawer/index.d.ts +3 -0
- package/lib/esm/components/LessonDrawer/index.js +2 -0
- package/lib/esm/components/LessonEditForm/LessonEditForm.d.ts +24 -0
- package/lib/esm/components/LessonEditForm/LessonEditForm.js +42 -0
- package/lib/esm/components/LessonEditForm/constants.d.ts +1 -0
- package/lib/esm/components/LessonEditForm/constants.js +1 -0
- package/lib/esm/components/LessonEditForm/index.d.ts +3 -0
- package/lib/esm/components/LessonEditForm/index.js +2 -0
- package/lib/esm/components/LessonObject/LessonObject.d.ts +40 -0
- package/lib/esm/components/LessonObject/LessonObject.js +67 -0
- package/lib/esm/components/LessonObject/constants.d.ts +1 -0
- package/lib/esm/components/LessonObject/constants.js +1 -0
- package/lib/esm/components/LessonObject/index.d.ts +3 -0
- package/lib/esm/components/LessonObject/index.js +2 -0
- package/lib/esm/components/LessonReleaseMenu/LessonReleaseMenu.d.ts +26 -0
- package/lib/esm/components/LessonReleaseMenu/LessonReleaseMenu.js +169 -0
- package/lib/esm/components/LessonReleaseMenu/constants.d.ts +5 -0
- package/lib/esm/components/LessonReleaseMenu/constants.js +6 -0
- package/lib/esm/components/LessonReleaseMenu/index.d.ts +3 -0
- package/lib/esm/components/LessonReleaseMenu/index.js +2 -0
- package/lib/esm/components/NavigationMenuIconButton/DefaultDrawerContent.js +9 -7
- package/lib/esm/components/NavigationToolbar/NavigationToolbar.js +12 -1
- package/lib/esm/components/Notification/Course/Course.d.ts +15 -0
- package/lib/esm/components/Notification/Course/Course.js +86 -0
- package/lib/esm/components/Notification/Course/index.d.ts +3 -0
- package/lib/esm/components/Notification/Course/index.js +2 -0
- package/lib/esm/components/Notification/Course/utils.d.ts +5 -0
- package/lib/esm/components/Notification/Course/utils.js +39 -0
- package/lib/esm/components/Notification/Notification.js +9 -0
- package/lib/esm/components/SnippetNotifications/SnippetNotifications.js +9 -0
- package/lib/esm/components/TagAutocomplete/TagAutocomplete.js +2 -2
- package/lib/esm/components/ToastNotifications/ToastNotifications.js +9 -0
- package/lib/esm/components/UserCreatedCoursesWidget/Skeleton.d.ts +21 -0
- package/lib/esm/components/UserCreatedCoursesWidget/Skeleton.js +39 -0
- package/lib/esm/components/UserCreatedCoursesWidget/UserCreatedCoursesWidget.d.ts +63 -0
- package/lib/esm/components/UserCreatedCoursesWidget/UserCreatedCoursesWidget.js +151 -0
- package/lib/esm/components/UserCreatedCoursesWidget/constants.d.ts +1 -0
- package/lib/esm/components/UserCreatedCoursesWidget/constants.js +1 -0
- package/lib/esm/components/UserCreatedCoursesWidget/index.d.ts +4 -0
- package/lib/esm/components/UserCreatedCoursesWidget/index.js +4 -0
- package/lib/esm/constants/Course.d.ts +6 -0
- package/lib/esm/constants/Course.js +7 -0
- package/lib/esm/constants/PubSub.d.ts +14 -0
- package/lib/esm/constants/PubSub.js +15 -0
- package/lib/esm/index.d.ts +23 -2
- package/lib/esm/index.js +26 -5
- package/lib/esm/shared/AccordionLessons/AccordionLessons.d.ts +8 -0
- package/lib/esm/shared/AccordionLessons/AccordionLessons.js +61 -0
- package/lib/esm/shared/AccordionLessons/Skeleton.d.ts +1 -0
- package/lib/esm/shared/AccordionLessons/Skeleton.js +18 -0
- package/lib/esm/shared/AccordionLessons/constants.d.ts +1 -0
- package/lib/esm/shared/AccordionLessons/constants.js +1 -0
- package/lib/esm/shared/AccordionLessons/index.d.ts +4 -0
- package/lib/esm/shared/AccordionLessons/index.js +4 -0
- package/lib/esm/shared/AddUsersButton/AddUsersButton.d.ts +29 -0
- package/lib/esm/shared/AddUsersButton/AddUsersButton.js +134 -0
- package/lib/esm/shared/AddUsersButton/index.d.ts +3 -0
- package/lib/esm/shared/AddUsersButton/index.js +2 -0
- package/lib/esm/shared/CourseTypePopover/CourseTypePopover.d.ts +9 -0
- package/lib/esm/shared/CourseTypePopover/CourseTypePopover.js +45 -0
- package/lib/esm/shared/CourseTypePopover/index.d.ts +3 -0
- package/lib/esm/shared/CourseTypePopover/index.js +2 -0
- package/lib/esm/shared/CourseUsersTable/ChangeUsersStatus.d.ts +9 -0
- package/lib/esm/shared/CourseUsersTable/ChangeUsersStatus.js +56 -0
- package/lib/esm/shared/CourseUsersTable/CourseUsersTable.d.ts +21 -0
- package/lib/esm/shared/CourseUsersTable/CourseUsersTable.js +152 -0
- package/lib/esm/shared/CourseUsersTable/RemoveButton.d.ts +10 -0
- package/lib/esm/shared/CourseUsersTable/RemoveButton.js +48 -0
- package/lib/esm/shared/CourseUsersTable/RequestButton.d.ts +10 -0
- package/lib/esm/shared/CourseUsersTable/RequestButton.js +76 -0
- package/lib/esm/shared/CourseUsersTable/RowSkeleton.d.ts +8 -0
- package/lib/esm/shared/CourseUsersTable/RowSkeleton.js +11 -0
- package/lib/esm/shared/CourseUsersTable/SeeProgressButton.d.ts +9 -0
- package/lib/esm/shared/CourseUsersTable/SeeProgressButton.js +53 -0
- package/lib/esm/shared/CourseUsersTable/Skeleton.d.ts +1 -0
- package/lib/esm/shared/CourseUsersTable/Skeleton.js +15 -0
- package/lib/esm/shared/CourseUsersTable/constants.d.ts +1 -0
- package/lib/esm/shared/CourseUsersTable/constants.js +1 -0
- package/lib/esm/shared/CourseUsersTable/index.d.ts +4 -0
- package/lib/esm/shared/CourseUsersTable/index.js +4 -0
- package/lib/esm/shared/DateTimeAgo/index.d.ts +1 -1
- package/lib/esm/shared/EmptyStatus/EmptyStatus.d.ts +11 -0
- package/lib/esm/shared/EmptyStatus/EmptyStatus.js +23 -0
- package/lib/esm/shared/EmptyStatus/index.d.ts +3 -0
- package/lib/esm/shared/EmptyStatus/index.js +2 -0
- package/lib/esm/shared/LessonCommentActionsMenu/index.d.ts +41 -0
- package/lib/esm/shared/LessonCommentActionsMenu/index.js +194 -0
- package/lib/esm/shared/LessonFilePreview/index.d.ts +12 -0
- package/lib/esm/shared/LessonFilePreview/index.js +25 -0
- package/lib/esm/shared/Media/Link/UrlTextField/index.js +3 -4
- package/lib/esm/types/course.d.ts +40 -0
- package/lib/esm/types/course.js +30 -0
- package/lib/esm/types/index.d.ts +2 -1
- package/lib/esm/types/index.js +2 -1
- package/lib/esm/utils/course.d.ts +14 -0
- package/lib/esm/utils/course.js +32 -0
- package/lib/umd/578.js +2 -0
- package/lib/umd/60a7fdeaadfe844bc015.woff2 +0 -0
- package/lib/umd/assets/icons.svg +9 -3
- package/lib/umd/{c3528e120c4e831db2ae.woff → b6dbec3d5816ff8baef1.woff} +0 -0
- package/lib/umd/{a221d3aba0f6753cfbb7.ttf → ba74e493633796d551d1.ttf} +0 -0
- package/lib/umd/{2aa155858f48b8f3911a.eot → c473ce30406a3dad83e1.eot} +0 -0
- package/lib/umd/react-ui.js +1 -1
- package/package.json +9 -8
- package/lib/umd/239.js +0 -2
- package/lib/umd/36f3af7f155d916c26ff.woff2 +0 -0
- /package/lib/umd/{239.js.LICENSE.txt → 578.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const material_1 = require("@mui/material");
|
|
5
|
+
const constants_1 = require("../constants");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const classes = {
|
|
8
|
+
optionsWrapper: `${constants_1.PREFIX}-options-wrapper`,
|
|
9
|
+
optionsDivider: `${constants_1.PREFIX}-options-divider`,
|
|
10
|
+
optionsButtonWrapper: `${constants_1.PREFIX}-options-button-wrapper`
|
|
11
|
+
};
|
|
12
|
+
function OptionsSkeleton() {
|
|
13
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Stack, Object.assign({ className: classes.optionsWrapper }, { children: Array.from(Array(3)).map((_, i) => ((0, jsx_runtime_1.jsxs)(material_1.FormControl, Object.assign({ component: "fieldset", variant: "standard" }, { children: [(0, jsx_runtime_1.jsx)(material_1.FormLabel, Object.assign({ component: "legend" }, { children: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", variant: "text", width: "52px", height: "21px" }) })), (0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { control: (0, jsx_runtime_1.jsx)(material_1.Switch, {}), label: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", variant: "text", width: "215px", height: "38px" }) })] }), i))) })), (0, jsx_runtime_1.jsx)(material_1.Divider, { className: classes.optionsDivider }), (0, jsx_runtime_1.jsx)(material_1.Stack, Object.assign({ className: classes.optionsButtonWrapper }, { children: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", variant: "rounded", width: "133px", height: "33px" }) }))] }));
|
|
14
|
+
}
|
|
15
|
+
exports.default = OptionsSkeleton;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface SwitchFormProps {
|
|
3
|
+
name: string;
|
|
4
|
+
title: string;
|
|
5
|
+
description: string;
|
|
6
|
+
checked: boolean;
|
|
7
|
+
handleChangeOptions: (key: string, value: boolean) => void;
|
|
8
|
+
}
|
|
9
|
+
declare function SwitchForm(props: SwitchFormProps): JSX.Element;
|
|
10
|
+
declare const _default: import("react").MemoExoticComponent<typeof SwitchForm>;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const material_1 = require("@mui/material");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const react_intl_1 = require("react-intl");
|
|
7
|
+
function SwitchForm(props) {
|
|
8
|
+
// PROPS
|
|
9
|
+
const { name, title, description, checked, handleChangeOptions } = props;
|
|
10
|
+
// STATES
|
|
11
|
+
const [value, setValue] = (0, react_1.useState)(checked);
|
|
12
|
+
// HANDLERS
|
|
13
|
+
const handleChange = (0, react_1.useCallback)((e) => {
|
|
14
|
+
const _checked = e.target.checked;
|
|
15
|
+
setValue(_checked);
|
|
16
|
+
handleChangeOptions(name, _checked);
|
|
17
|
+
}, [setValue]);
|
|
18
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.FormControl, Object.assign({ component: "fieldset", variant: "standard" }, { children: [(0, jsx_runtime_1.jsx)(material_1.FormLabel, Object.assign({ component: "legend" }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h5" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: title, defaultMessage: title }) })) })), (0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { control: (0, jsx_runtime_1.jsx)(material_1.Switch, { color: "primary", checked: value, name: name, onChange: handleChange }), label: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: description, defaultMessage: description }) })) })] })));
|
|
19
|
+
}
|
|
20
|
+
exports.default = (0, react_1.memo)(SwitchForm);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SCCourseType } from '@selfcommunity/types';
|
|
3
|
+
interface OptionsProps {
|
|
4
|
+
course: SCCourseType;
|
|
5
|
+
setCourse: (course: SCCourseType) => void;
|
|
6
|
+
}
|
|
7
|
+
declare function Options(props: OptionsProps): JSX.Element;
|
|
8
|
+
declare const _default: import("react").MemoExoticComponent<typeof Options>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const material_1 = require("@mui/material");
|
|
6
|
+
const react_intl_1 = require("react-intl");
|
|
7
|
+
const constants_1 = require("./constants");
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const utils_1 = require("@selfcommunity/utils");
|
|
10
|
+
const Errors_1 = require("../../constants/Errors");
|
|
11
|
+
const notistack_1 = require("notistack");
|
|
12
|
+
const SwitchForm_1 = tslib_1.__importDefault(require("./Options/SwitchForm"));
|
|
13
|
+
const use_deep_compare_effect_1 = tslib_1.__importDefault(require("use-deep-compare-effect"));
|
|
14
|
+
const lab_1 = require("@mui/lab");
|
|
15
|
+
const api_services_1 = require("@selfcommunity/api-services");
|
|
16
|
+
const classes = {
|
|
17
|
+
optionsContainer: `${constants_1.PREFIX}-options-container`,
|
|
18
|
+
optionsWrapper: `${constants_1.PREFIX}-options-wrapper`,
|
|
19
|
+
optionsDivider: `${constants_1.PREFIX}-options-divider`,
|
|
20
|
+
optionsButtonWrapper: `${constants_1.PREFIX}-options-button-wrapper`
|
|
21
|
+
};
|
|
22
|
+
const OPTIONS = {
|
|
23
|
+
enforce_lessons_order: {
|
|
24
|
+
title: 'ui.editCourse.tab.options',
|
|
25
|
+
description: 'ui.editCourse.tab.options.description'
|
|
26
|
+
},
|
|
27
|
+
new_comment_notification_enabled: {
|
|
28
|
+
title: 'ui.editCourse.tab.options.notifications',
|
|
29
|
+
description: 'ui.editCourse.tab.options.notifications.description'
|
|
30
|
+
},
|
|
31
|
+
hide_member_count: {
|
|
32
|
+
title: 'ui.editCourse.tab.options.permissions',
|
|
33
|
+
description: 'ui.editCourse.tab.options.permissions.description'
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
function Options(props) {
|
|
37
|
+
// PROPS
|
|
38
|
+
const { course, setCourse } = props;
|
|
39
|
+
// STATES
|
|
40
|
+
const [tempOptions, setTempOptions] = (0, react_1.useState)(null);
|
|
41
|
+
const [canSave, setCanSave] = (0, react_1.useState)(false);
|
|
42
|
+
const [loading, setLoading] = (0, react_1.useState)(false);
|
|
43
|
+
// HOOKS
|
|
44
|
+
const { enqueueSnackbar } = (0, notistack_1.useSnackbar)();
|
|
45
|
+
// EFFECTS
|
|
46
|
+
(0, use_deep_compare_effect_1.default)(() => {
|
|
47
|
+
if (!tempOptions) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
if (course.enforce_lessons_order !== tempOptions.enforce_lessons_order ||
|
|
51
|
+
course.new_comment_notification_enabled !== tempOptions.new_comment_notification_enabled ||
|
|
52
|
+
course.hide_member_count !== tempOptions.hide_member_count) {
|
|
53
|
+
setCanSave(true);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
setCanSave(false);
|
|
57
|
+
}
|
|
58
|
+
}, [course, tempOptions, setCanSave]);
|
|
59
|
+
// HANDLERS
|
|
60
|
+
const handleChange = (0, react_1.useCallback)((key, value) => {
|
|
61
|
+
setTempOptions((prevOptions) => {
|
|
62
|
+
if (!prevOptions) {
|
|
63
|
+
return {
|
|
64
|
+
enforce_lessons_order: course.enforce_lessons_order,
|
|
65
|
+
new_comment_notification_enabled: course.new_comment_notification_enabled,
|
|
66
|
+
hide_member_count: course.hide_member_count,
|
|
67
|
+
[key]: value
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
return Object.assign(Object.assign({}, prevOptions), { [key]: value });
|
|
71
|
+
});
|
|
72
|
+
}, [setTempOptions, course]);
|
|
73
|
+
const handleSubmit = (0, react_1.useCallback)(() => {
|
|
74
|
+
setLoading(true);
|
|
75
|
+
api_services_1.CourseService.patchCourse(course.id, Object.assign({ id: course.id }, tempOptions))
|
|
76
|
+
.then((data) => {
|
|
77
|
+
setCourse(Object.assign(Object.assign({}, course), data));
|
|
78
|
+
setTempOptions(null);
|
|
79
|
+
setCanSave(false);
|
|
80
|
+
setLoading(false);
|
|
81
|
+
enqueueSnackbar((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.contributionActionMenu.actionSuccess", defaultMessage: "ui.contributionActionMenu.actionSuccess" }), {
|
|
82
|
+
variant: 'success',
|
|
83
|
+
autoHideDuration: 3000
|
|
84
|
+
});
|
|
85
|
+
})
|
|
86
|
+
.catch((error) => {
|
|
87
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, error);
|
|
88
|
+
enqueueSnackbar((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.common.error.action", defaultMessage: "ui.common.error.action" }), {
|
|
89
|
+
variant: 'error',
|
|
90
|
+
autoHideDuration: 3000
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
}, [course, tempOptions, setCanSave, setLoading]);
|
|
94
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.optionsContainer }, { children: [(0, jsx_runtime_1.jsx)(material_1.Stack, Object.assign({ className: classes.optionsWrapper }, { children: Object.entries(OPTIONS).map(([key, value], i) => ((0, jsx_runtime_1.jsx)(SwitchForm_1.default, { name: key, title: value.title, description: value.description, checked: course[key], handleChangeOptions: handleChange }, i))) })), (0, jsx_runtime_1.jsx)(material_1.Stack, Object.assign({ className: classes.optionsButtonWrapper }, { children: (0, jsx_runtime_1.jsx)(lab_1.LoadingButton, Object.assign({ size: "small", variant: "contained", disabled: !canSave, onClick: handleSubmit, loading: loading }, { 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.editCourse.tab.options.button.save", defaultMessage: "ui.editCourse.tab.options.button.save" }) })) })) }))] })));
|
|
95
|
+
}
|
|
96
|
+
exports.default = (0, react_1.memo)(Options);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SyntheticEvent } from 'react';
|
|
2
|
+
import { SCCourseType } from '@selfcommunity/types';
|
|
3
|
+
import { BaseGetParams } from '@selfcommunity/api-services';
|
|
4
|
+
import { SCCourseEditTabType } from '../../types/course';
|
|
5
|
+
interface RequestsProps {
|
|
6
|
+
course: SCCourseType;
|
|
7
|
+
endpointQueryParams?: BaseGetParams;
|
|
8
|
+
handleTabChange: (_e: SyntheticEvent, newTabValue: SCCourseEditTabType) => void;
|
|
9
|
+
}
|
|
10
|
+
declare function Requests(props: RequestsProps): JSX.Element;
|
|
11
|
+
declare const _default: import("react").MemoExoticComponent<typeof Requests>;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const material_1 = require("@mui/material");
|
|
6
|
+
const react_intl_1 = require("react-intl");
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const utils_1 = require("@selfcommunity/utils");
|
|
9
|
+
const Errors_1 = require("../../constants/Errors");
|
|
10
|
+
const Status_1 = tslib_1.__importDefault(require("./Status"));
|
|
11
|
+
const CourseUsersTable_1 = tslib_1.__importDefault(require("../../shared/CourseUsersTable"));
|
|
12
|
+
const Pagination_1 = require("../../constants/Pagination");
|
|
13
|
+
const react_core_1 = require("@selfcommunity/react-core");
|
|
14
|
+
const widget_1 = require("../../utils/widget");
|
|
15
|
+
const api_services_1 = require("@selfcommunity/api-services");
|
|
16
|
+
const constants_1 = require("./constants");
|
|
17
|
+
const pubsub_js_1 = tslib_1.__importDefault(require("pubsub-js"));
|
|
18
|
+
const PubSub_1 = require("../../constants/PubSub");
|
|
19
|
+
const course_1 = require("../../types/course");
|
|
20
|
+
const classes = {
|
|
21
|
+
usersStatusWrapper: `${constants_1.PREFIX}-users-status-wrapper`,
|
|
22
|
+
contrastColor: `${constants_1.PREFIX}-contrast-color`
|
|
23
|
+
};
|
|
24
|
+
const headerCells = [
|
|
25
|
+
{
|
|
26
|
+
id: 'ui.editCourse.tab.users.table.header.name'
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: 'ui.editCourse.tab.users.table.header.registration'
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: 'ui.editCourse.tab.users.table.header.latestActivity'
|
|
33
|
+
},
|
|
34
|
+
{}
|
|
35
|
+
];
|
|
36
|
+
function Requests(props) {
|
|
37
|
+
// PROPS
|
|
38
|
+
const { course, endpointQueryParams = {
|
|
39
|
+
limit: 6,
|
|
40
|
+
offset: Pagination_1.DEFAULT_PAGINATION_OFFSET
|
|
41
|
+
}, handleTabChange } = props;
|
|
42
|
+
// STATES
|
|
43
|
+
const [state, dispatch] = (0, react_1.useReducer)(widget_1.dataWidgetReducer, {
|
|
44
|
+
isLoadingPrevious: false,
|
|
45
|
+
isLoadingNext: false,
|
|
46
|
+
next: null,
|
|
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.NETWORK_ONLY,
|
|
49
|
+
visibleItems: endpointQueryParams.limit
|
|
50
|
+
}, widget_1.stateWidgetInitializer);
|
|
51
|
+
// CONTEXTS
|
|
52
|
+
const scUserContext = (0, react_core_1.useSCUser)();
|
|
53
|
+
// REFS
|
|
54
|
+
const updatedUsers = (0, react_1.useRef)(null);
|
|
55
|
+
// CALLBACKS
|
|
56
|
+
const _init = (0, react_1.useCallback)(() => {
|
|
57
|
+
if (!state.initialized && !state.isLoadingNext) {
|
|
58
|
+
dispatch({ type: widget_1.actionWidgetTypes.LOADING_NEXT });
|
|
59
|
+
api_services_1.CourseService.getCourseWaitingApproval(course.id, Object.assign({}, endpointQueryParams))
|
|
60
|
+
.then((payload) => {
|
|
61
|
+
dispatch({ type: widget_1.actionWidgetTypes.LOAD_NEXT_SUCCESS, payload: Object.assign(Object.assign({}, payload), { initialized: true }) });
|
|
62
|
+
})
|
|
63
|
+
.catch((error) => {
|
|
64
|
+
dispatch({ type: widget_1.actionWidgetTypes.LOAD_NEXT_FAILURE, payload: { errorLoadNext: error } });
|
|
65
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, error);
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}, [state.isLoadingNext, state.initialized, course, dispatch, endpointQueryParams]);
|
|
69
|
+
// HANDLERS
|
|
70
|
+
const handleRejectUser = (0, react_1.useCallback)((_msg, user) => {
|
|
71
|
+
dispatch({
|
|
72
|
+
type: widget_1.actionWidgetTypes.SET_RESULTS,
|
|
73
|
+
payload: { count: state.results.length - 1, results: state.results.filter((result) => result.id !== user.id) }
|
|
74
|
+
});
|
|
75
|
+
}, [state.count, state.results, dispatch]);
|
|
76
|
+
// EFFECTS
|
|
77
|
+
(0, react_1.useEffect)(() => {
|
|
78
|
+
let _t;
|
|
79
|
+
if (scUserContext.user) {
|
|
80
|
+
_t = setTimeout(_init);
|
|
81
|
+
return () => {
|
|
82
|
+
clearTimeout(_t);
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
}, [scUserContext.user, _init]);
|
|
86
|
+
(0, react_1.useEffect)(() => {
|
|
87
|
+
updatedUsers.current = pubsub_js_1.default.subscribe(`${PubSub_1.SCTopicType.COURSE}.${PubSub_1.SCCourseEventType.REJECT_MEMBER}`, handleRejectUser);
|
|
88
|
+
return () => {
|
|
89
|
+
updatedUsers.current && pubsub_js_1.default.unsubscribe(updatedUsers.current);
|
|
90
|
+
};
|
|
91
|
+
}, [handleRejectUser]);
|
|
92
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h6", className: classes.contrastColor }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.editCourse.tab.requests.title", defaultMessage: "ui.editCourse.tab.requests.title", values: { requestsNumber: state.results.length } }) })), (0, jsx_runtime_1.jsx)(material_1.Stack, Object.assign({ className: classes.usersStatusWrapper }, { children: (0, jsx_runtime_1.jsx)(Status_1.default, { course: course, handleTabChange: handleTabChange }) })), (0, jsx_runtime_1.jsx)(CourseUsersTable_1.default, { state: state, dispatch: dispatch, course: course, endpointSearch: {
|
|
93
|
+
url: () => api_services_1.Endpoints.GetCourseWaitingApproval.url({ id: course.id }),
|
|
94
|
+
method: api_services_1.Endpoints.GetCourseWaitingApproval.method
|
|
95
|
+
}, headerCells: headerCells, mode: course_1.SCCourseUsersTableModeType.REQUESTS, emptyStatusTitle: "ui.courseUsersTable.empty.requests.title" })] }));
|
|
96
|
+
}
|
|
97
|
+
exports.default = (0, react_1.memo)(Requests);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SCCourseEditTabType } from '../../types';
|
|
3
|
+
interface EditCourseSkeletonProps {
|
|
4
|
+
tab?: SCCourseEditTabType;
|
|
5
|
+
}
|
|
6
|
+
declare function EditCourseSkeleton(props: EditCourseSkeletonProps): JSX.Element;
|
|
7
|
+
declare const _default: import("react").MemoExoticComponent<typeof EditCourseSkeleton>;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const constants_1 = require("./constants");
|
|
6
|
+
const material_1 = require("@mui/material");
|
|
7
|
+
const Skeleton_1 = tslib_1.__importDefault(require("./Lessons/Skeleton"));
|
|
8
|
+
const Skeleton_2 = tslib_1.__importDefault(require("./Users/Skeleton"));
|
|
9
|
+
const Skeleton_3 = tslib_1.__importDefault(require("../CourseForm/Skeleton"));
|
|
10
|
+
const Skeleton_4 = tslib_1.__importDefault(require("./Options/Skeleton"));
|
|
11
|
+
const types_1 = require("../../types");
|
|
12
|
+
const react_1 = require("react");
|
|
13
|
+
const classes = {
|
|
14
|
+
root: `${constants_1.PREFIX}-skeleton-root`,
|
|
15
|
+
header: `${constants_1.PREFIX}-header`,
|
|
16
|
+
tabList: `${constants_1.PREFIX}-tab-list`
|
|
17
|
+
};
|
|
18
|
+
const Root = (0, material_1.styled)(material_1.Box, {
|
|
19
|
+
name: constants_1.PREFIX,
|
|
20
|
+
slot: 'SkeletonRoot',
|
|
21
|
+
overridesResolver: (_props, styles) => styles.skeletonRoot
|
|
22
|
+
})(() => ({}));
|
|
23
|
+
function EditCourseSkeleton(props) {
|
|
24
|
+
// PROPS
|
|
25
|
+
const { tab } = props;
|
|
26
|
+
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: classes.root }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.header }, { children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", variant: "rectangular", width: "14px", height: "14px" }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", variant: "text", width: "125px", height: "21px" })] })), (0, jsx_runtime_1.jsx)(material_1.Stack, Object.assign({ className: classes.tabList }, { children: Array.from(new Array(5)).map((_, i) => ((0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", variant: "text", width: "80px", height: "21px" }, i))) })), tab === types_1.SCCourseEditTabType.LESSONS && (0, jsx_runtime_1.jsx)(Skeleton_1.default, {}), tab === types_1.SCCourseEditTabType.CUSTOMIZE && (0, jsx_runtime_1.jsx)(Skeleton_3.default, {}), tab === types_1.SCCourseEditTabType.USERS && (0, jsx_runtime_1.jsx)(Skeleton_2.default, {}), tab === types_1.SCCourseEditTabType.REQUESTS && (0, jsx_runtime_1.jsx)(Skeleton_2.default, {}), tab === types_1.SCCourseEditTabType.OPTIONS && (0, jsx_runtime_1.jsx)(Skeleton_4.default, {})] })));
|
|
27
|
+
}
|
|
28
|
+
exports.default = (0, react_1.memo)(EditCourseSkeleton);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SCCourseType } from '@selfcommunity/types';
|
|
2
|
+
import { SyntheticEvent } from 'react';
|
|
3
|
+
import { SCCourseEditTabType } from '../../types';
|
|
4
|
+
interface StatusProps {
|
|
5
|
+
course: SCCourseType;
|
|
6
|
+
handleTabChange: (_e: SyntheticEvent, newTabValue: SCCourseEditTabType) => void;
|
|
7
|
+
}
|
|
8
|
+
export default function Status(props: StatusProps): JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const material_1 = require("@mui/material");
|
|
6
|
+
const react_intl_1 = require("react-intl");
|
|
7
|
+
const constants_1 = require("./constants");
|
|
8
|
+
const types_1 = require("@selfcommunity/types");
|
|
9
|
+
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
10
|
+
const react_1 = require("react");
|
|
11
|
+
const types_2 = require("../../types");
|
|
12
|
+
const classes = {
|
|
13
|
+
status: `${constants_1.PREFIX}-status`,
|
|
14
|
+
contrastColor: `${constants_1.PREFIX}-contrast-color`
|
|
15
|
+
};
|
|
16
|
+
function Status(props) {
|
|
17
|
+
// STATES
|
|
18
|
+
const { course, handleTabChange } = props;
|
|
19
|
+
// HOOKS
|
|
20
|
+
const intl = (0, react_intl_1.useIntl)();
|
|
21
|
+
// HANDLERS
|
|
22
|
+
const handleClick = (0, react_1.useCallback)(() => {
|
|
23
|
+
handleTabChange(null, types_2.SCCourseEditTabType.CUSTOMIZE);
|
|
24
|
+
}, [handleTabChange]);
|
|
25
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Chip, { label: (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ size: "small", variant: "text", color: "inherit", onClick: handleClick }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: intl.formatMessage({ id: 'ui.editCourse.tab.lessons.status', defaultMessage: 'ui.editCourse.tab.lessons.status' }, {
|
|
26
|
+
status: intl.formatMessage({
|
|
27
|
+
id: `ui.course.privacy.${course.privacy === types_1.SCCoursePrivacyType.DRAFT ? 'draft' : course.privacy}`,
|
|
28
|
+
defaultMessage: `ui.course.privacy.${course.privacy === types_1.SCCoursePrivacyType.DRAFT ? 'draft' : course.privacy}`
|
|
29
|
+
}),
|
|
30
|
+
b: (chunks) => ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ component: "b", fontWeight: "bold" }, { children: chunks })))
|
|
31
|
+
}) })) })), className: (0, classnames_1.default)(classes.status, classes.contrastColor) }));
|
|
32
|
+
}
|
|
33
|
+
exports.default = Status;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function UsersSkeleton(): JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const material_1 = require("@mui/material");
|
|
5
|
+
const constants_1 = require("../constants");
|
|
6
|
+
const CourseUsersTable_1 = require("../../../shared/CourseUsersTable");
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const classes = {
|
|
9
|
+
root: `${constants_1.PREFIX}-skeleton-root`,
|
|
10
|
+
usersStatusWrapper: `${constants_1.PREFIX}-users-status-wrapper`
|
|
11
|
+
};
|
|
12
|
+
function UsersSkeleton() {
|
|
13
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", variant: "text", width: "136px", height: "22px" }), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.usersStatusWrapper }, { children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", variant: "rectangular", width: "122px", height: "32px" }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", variant: "rounded", width: "154px", height: "29px" })] })), (0, jsx_runtime_1.jsx)(CourseUsersTable_1.CourseUsersTableSkeleton, {})] }));
|
|
14
|
+
}
|
|
15
|
+
exports.default = UsersSkeleton;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SyntheticEvent } from 'react';
|
|
2
|
+
import { SCCourseType } from '@selfcommunity/types';
|
|
3
|
+
import { SCCourseEditTabType } from '../../types/course';
|
|
4
|
+
interface UsersProps {
|
|
5
|
+
course: SCCourseType;
|
|
6
|
+
endpointQueryParams?: Record<string, string | number>;
|
|
7
|
+
handleTabChange: (_e: SyntheticEvent, newTabValue: SCCourseEditTabType) => void;
|
|
8
|
+
}
|
|
9
|
+
declare function Users(props: UsersProps): JSX.Element;
|
|
10
|
+
declare const _default: import("react").MemoExoticComponent<typeof Users>;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const material_1 = require("@mui/material");
|
|
6
|
+
const react_intl_1 = require("react-intl");
|
|
7
|
+
const AddUsersButton_1 = tslib_1.__importDefault(require("../../shared/AddUsersButton"));
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const types_1 = require("@selfcommunity/types");
|
|
10
|
+
const utils_1 = require("@selfcommunity/utils");
|
|
11
|
+
const Errors_1 = require("../../constants/Errors");
|
|
12
|
+
const notistack_1 = require("notistack");
|
|
13
|
+
const Status_1 = tslib_1.__importDefault(require("./Status"));
|
|
14
|
+
const constants_1 = require("./constants");
|
|
15
|
+
const CourseUsersTable_1 = tslib_1.__importDefault(require("../../shared/CourseUsersTable"));
|
|
16
|
+
const Pagination_1 = require("../../constants/Pagination");
|
|
17
|
+
const react_core_1 = require("@selfcommunity/react-core");
|
|
18
|
+
const widget_1 = require("../../utils/widget");
|
|
19
|
+
const api_services_1 = require("@selfcommunity/api-services");
|
|
20
|
+
const pubsub_js_1 = tslib_1.__importDefault(require("pubsub-js"));
|
|
21
|
+
const PubSub_1 = require("../../constants/PubSub");
|
|
22
|
+
const course_1 = require("../../types/course");
|
|
23
|
+
const classes = {
|
|
24
|
+
usersStatusWrapper: `${constants_1.PREFIX}-users-status-wrapper`,
|
|
25
|
+
contrastColor: `${constants_1.PREFIX}-contrast-color`
|
|
26
|
+
};
|
|
27
|
+
const headerCells = [
|
|
28
|
+
{
|
|
29
|
+
id: 'ui.editCourse.tab.users.table.header.name'
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: 'ui.editCourse.tab.users.table.header.role'
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
id: 'ui.editCourse.tab.users.table.header.registration'
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
id: 'ui.editCourse.tab.users.table.header.latestActivity'
|
|
39
|
+
},
|
|
40
|
+
{}
|
|
41
|
+
];
|
|
42
|
+
function Users(props) {
|
|
43
|
+
// PROPS
|
|
44
|
+
const { course, endpointQueryParams = {
|
|
45
|
+
limit: 6,
|
|
46
|
+
offset: Pagination_1.DEFAULT_PAGINATION_OFFSET,
|
|
47
|
+
statuses: JSON.stringify([types_1.SCCourseJoinStatusType.JOINED, types_1.SCCourseJoinStatusType.MANAGER, types_1.SCCourseJoinStatusType.CREATOR])
|
|
48
|
+
}, handleTabChange } = props;
|
|
49
|
+
// STATES
|
|
50
|
+
const [state, dispatch] = (0, react_1.useReducer)(widget_1.dataWidgetReducer, {
|
|
51
|
+
isLoadingNext: false,
|
|
52
|
+
next: null,
|
|
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.NETWORK_ONLY,
|
|
55
|
+
visibleItems: endpointQueryParams.limit
|
|
56
|
+
}, widget_1.stateWidgetInitializer);
|
|
57
|
+
// CONTEXTS
|
|
58
|
+
const scUserContext = (0, react_core_1.useSCUser)();
|
|
59
|
+
// HOOKS
|
|
60
|
+
const { enqueueSnackbar } = (0, notistack_1.useSnackbar)();
|
|
61
|
+
// REFS
|
|
62
|
+
const updatedUsers = (0, react_1.useRef)(null);
|
|
63
|
+
const removedUsers = (0, react_1.useRef)(null);
|
|
64
|
+
// CALLBACKS
|
|
65
|
+
const _init = (0, react_1.useCallback)(() => {
|
|
66
|
+
if (!state.initialized && !state.isLoadingNext) {
|
|
67
|
+
dispatch({ type: widget_1.actionWidgetTypes.LOADING_NEXT });
|
|
68
|
+
api_services_1.CourseService.getCourseDashboardUsers(course.id, Object.assign({}, endpointQueryParams))
|
|
69
|
+
.then((payload) => {
|
|
70
|
+
dispatch({ type: widget_1.actionWidgetTypes.LOAD_NEXT_SUCCESS, payload: Object.assign(Object.assign({}, payload), { initialized: true }) });
|
|
71
|
+
})
|
|
72
|
+
.catch((error) => {
|
|
73
|
+
dispatch({ type: widget_1.actionWidgetTypes.LOAD_NEXT_FAILURE, payload: { errorLoadNext: error } });
|
|
74
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, error);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}, [state.isLoadingNext, state.initialized, course, dispatch, endpointQueryParams]);
|
|
78
|
+
// HANDLERS
|
|
79
|
+
const handleAddUser = (0, react_1.useCallback)((_msg, user) => {
|
|
80
|
+
dispatch({ type: widget_1.actionWidgetTypes.LOAD_PREVIOUS_SUCCESS, payload: { count: state.count + 1, results: [user], initialized: true } });
|
|
81
|
+
}, [state.count, dispatch]);
|
|
82
|
+
const handleRemoveUser = (0, react_1.useCallback)((_msg, user) => {
|
|
83
|
+
dispatch({
|
|
84
|
+
type: widget_1.actionWidgetTypes.SET_RESULTS,
|
|
85
|
+
payload: { count: state.count - 1, results: state.results.filter((result) => result.id !== user.id), initialized: true }
|
|
86
|
+
});
|
|
87
|
+
}, [state.count, state.results, dispatch]);
|
|
88
|
+
// EFFECTS
|
|
89
|
+
(0, react_1.useEffect)(() => {
|
|
90
|
+
let _t;
|
|
91
|
+
if (scUserContext.user) {
|
|
92
|
+
_t = setTimeout(_init);
|
|
93
|
+
return () => {
|
|
94
|
+
clearTimeout(_t);
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
}, [scUserContext.user, _init]);
|
|
98
|
+
(0, react_1.useEffect)(() => {
|
|
99
|
+
updatedUsers.current = pubsub_js_1.default.subscribe(`${PubSub_1.SCTopicType.COURSE}.${PubSub_1.SCCourseEventType.ADD_MEMBER}`, handleAddUser);
|
|
100
|
+
removedUsers.current = pubsub_js_1.default.subscribe(`${PubSub_1.SCTopicType.COURSE}.${PubSub_1.SCCourseEventType.REMOVE_MEMBER}`, handleRemoveUser);
|
|
101
|
+
return () => {
|
|
102
|
+
updatedUsers.current && pubsub_js_1.default.unsubscribe(updatedUsers.current);
|
|
103
|
+
removedUsers.current && pubsub_js_1.default.unsubscribe(removedUsers.current);
|
|
104
|
+
};
|
|
105
|
+
}, [handleAddUser, handleRemoveUser]);
|
|
106
|
+
const handleConfirm = (0, react_1.useCallback)((newUsers) => {
|
|
107
|
+
const data = {
|
|
108
|
+
joined: newUsers.map((user) => user.id)
|
|
109
|
+
};
|
|
110
|
+
api_services_1.CourseService.changeCourseUserRole(course.id, data)
|
|
111
|
+
.then(() => {
|
|
112
|
+
dispatch({
|
|
113
|
+
type: widget_1.actionWidgetTypes.LOAD_PREVIOUS_SUCCESS,
|
|
114
|
+
payload: { count: state.count + newUsers.length, results: newUsers, initialized: true }
|
|
115
|
+
});
|
|
116
|
+
enqueueSnackbar((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.editCourse.tab.users.table.snackbar.success", defaultMessage: "ui.editCourse.tab.users.table.snackbar.success" }), {
|
|
117
|
+
variant: 'success',
|
|
118
|
+
autoHideDuration: 3000
|
|
119
|
+
});
|
|
120
|
+
})
|
|
121
|
+
.catch((error) => {
|
|
122
|
+
dispatch({ type: widget_1.actionWidgetTypes.LOAD_NEXT_FAILURE, payload: { errorLoadNext: error } });
|
|
123
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, error);
|
|
124
|
+
enqueueSnackbar((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.common.error.action", defaultMessage: "ui.common.error.action" }), {
|
|
125
|
+
variant: 'error',
|
|
126
|
+
autoHideDuration: 3000
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
}, [course, dispatch]);
|
|
130
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h6", className: classes.contrastColor }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.editCourse.tab.users.title", defaultMessage: "ui.editCourse.tab.users.title", values: { usersNumber: state.count } }) })), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.usersStatusWrapper }, { children: [(0, jsx_runtime_1.jsx)(Status_1.default, { course: course, handleTabChange: handleTabChange }), (0, jsx_runtime_1.jsx)(AddUsersButton_1.default, { label: "ui.editCourse.tab.users.addUsersButton.label", endpoint: {
|
|
131
|
+
url: () => api_services_1.Endpoints.GetCourseSuggestedUsers.url({ id: course.id }),
|
|
132
|
+
method: api_services_1.Endpoints.GetCourseSuggestedUsers.method
|
|
133
|
+
}, onConfirm: handleConfirm })] })), (0, jsx_runtime_1.jsx)(CourseUsersTable_1.default, { state: state, dispatch: dispatch, course: course, endpointSearch: {
|
|
134
|
+
url: () => api_services_1.Endpoints.GetCourseDashboardUsers.url({ id: course.id }),
|
|
135
|
+
method: api_services_1.Endpoints.GetCourseDashboardUsers.method
|
|
136
|
+
}, endpointQueryParamsSearch: {
|
|
137
|
+
statuses: JSON.stringify([types_1.SCCourseJoinStatusType.JOINED, types_1.SCCourseJoinStatusType.MANAGER, types_1.SCCourseJoinStatusType.CREATOR])
|
|
138
|
+
}, headerCells: headerCells, mode: course_1.SCCourseUsersTableModeType.EDIT, emptyStatusTitle: "ui.courseUsersTable.empty.users.title", emptyStatusDescription: "ui.courseUsersTable.empty.users.description" })] }));
|
|
139
|
+
}
|
|
140
|
+
exports.default = (0, react_1.memo)(Users);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const PREFIX = "SCEditCourse";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useIsDisabled = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const pubsub_js_1 = tslib_1.__importDefault(require("pubsub-js"));
|
|
7
|
+
const PubSub_1 = require("../../constants/PubSub");
|
|
8
|
+
const useIsDisabled = () => {
|
|
9
|
+
// STATES
|
|
10
|
+
const [isDisabled, setIsDisabled] = (0, react_1.useState)(false);
|
|
11
|
+
// REFS
|
|
12
|
+
const updateDragStatus = (0, react_1.useRef)(null);
|
|
13
|
+
// EFFECTS
|
|
14
|
+
(0, react_1.useEffect)(() => {
|
|
15
|
+
updateDragStatus.current = pubsub_js_1.default.subscribe(`${PubSub_1.SCTopicType.COURSE}.${PubSub_1.SCGroupEventType.UPDATE}`, (_msg, data) => setIsDisabled(data));
|
|
16
|
+
return () => {
|
|
17
|
+
updateDragStatus.current && pubsub_js_1.default.unsubscribe(updateDragStatus.current);
|
|
18
|
+
};
|
|
19
|
+
}, [setIsDisabled]);
|
|
20
|
+
return { isDisabled };
|
|
21
|
+
};
|
|
22
|
+
exports.useIsDisabled = useIsDisabled;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EditCourseSkeleton = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const EditCourse_1 = tslib_1.__importDefault(require("./EditCourse"));
|
|
6
|
+
const Skeleton_1 = tslib_1.__importDefault(require("./Skeleton"));
|
|
7
|
+
exports.EditCourseSkeleton = Skeleton_1.default;
|
|
8
|
+
exports.default = EditCourse_1.default;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { SCCourseLessonType, SCCourseSectionType } from '@selfcommunity/types';
|
|
2
|
+
export declare enum ActionLessonType {
|
|
3
|
+
ADD = "add",
|
|
4
|
+
RENAME = "rename",
|
|
5
|
+
DELETE = "delete",
|
|
6
|
+
UPDATE = "update",
|
|
7
|
+
ADD_UPDATE = "add_update",
|
|
8
|
+
RENAME_UPDATE = "rename_update",
|
|
9
|
+
DELETE_UPDATE = "delete_update",
|
|
10
|
+
UPDATE_UPDATE = "update_update"
|
|
11
|
+
}
|
|
12
|
+
export interface OptionsData {
|
|
13
|
+
enforce_lessons_order: boolean;
|
|
14
|
+
new_comment_notification_enabled: boolean;
|
|
15
|
+
hide_member_count: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare enum RowType {
|
|
18
|
+
SECTION = "section",
|
|
19
|
+
LESSON = "lesson"
|
|
20
|
+
}
|
|
21
|
+
export interface DeleteRowProps {
|
|
22
|
+
row: RowType;
|
|
23
|
+
section: SCCourseSectionType;
|
|
24
|
+
lesson?: SCCourseLessonType;
|
|
25
|
+
}
|
|
26
|
+
export interface DeleteRowRef {
|
|
27
|
+
handleDeleteSection?: (section: SCCourseSectionType) => void;
|
|
28
|
+
handleDeleteLesson: (section: SCCourseSectionType, lesson: SCCourseLessonType) => void;
|
|
29
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RowType = exports.ActionLessonType = void 0;
|
|
4
|
+
var ActionLessonType;
|
|
5
|
+
(function (ActionLessonType) {
|
|
6
|
+
ActionLessonType["ADD"] = "add";
|
|
7
|
+
ActionLessonType["RENAME"] = "rename";
|
|
8
|
+
ActionLessonType["DELETE"] = "delete";
|
|
9
|
+
ActionLessonType["UPDATE"] = "update";
|
|
10
|
+
ActionLessonType["ADD_UPDATE"] = "add_update";
|
|
11
|
+
ActionLessonType["RENAME_UPDATE"] = "rename_update";
|
|
12
|
+
ActionLessonType["DELETE_UPDATE"] = "delete_update";
|
|
13
|
+
ActionLessonType["UPDATE_UPDATE"] = "update_update";
|
|
14
|
+
})(ActionLessonType = exports.ActionLessonType || (exports.ActionLessonType = {}));
|
|
15
|
+
var RowType;
|
|
16
|
+
(function (RowType) {
|
|
17
|
+
RowType["SECTION"] = "section";
|
|
18
|
+
RowType["LESSON"] = "lesson";
|
|
19
|
+
})(RowType = exports.RowType || (exports.RowType = {}));
|