@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,26 @@
|
|
|
1
|
+
import { SCCourseSectionType, SCCourseType } from '@selfcommunity/types';
|
|
2
|
+
export interface LessonReleaseMenuProps {
|
|
3
|
+
/**
|
|
4
|
+
* The lesson object
|
|
5
|
+
*/
|
|
6
|
+
section: SCCourseSectionType;
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
course: SCCourseType;
|
|
11
|
+
/**
|
|
12
|
+
* Overrides or extends the styles applied to the component.
|
|
13
|
+
* @default null
|
|
14
|
+
*/
|
|
15
|
+
className?: string;
|
|
16
|
+
/**
|
|
17
|
+
* onSuccess Callback
|
|
18
|
+
*/
|
|
19
|
+
onSuccess?: (data: SCCourseSectionType) => void;
|
|
20
|
+
/**
|
|
21
|
+
*
|
|
22
|
+
* Any other properties
|
|
23
|
+
*/
|
|
24
|
+
[p: string]: any;
|
|
25
|
+
}
|
|
26
|
+
export default function LessonReleaseMenu(inProps: LessonReleaseMenuProps): JSX.Element;
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useState } from 'react';
|
|
4
|
+
import { styled } from '@mui/material/styles';
|
|
5
|
+
import { useThemeProps } from '@mui/system';
|
|
6
|
+
import classNames from 'classnames';
|
|
7
|
+
import { Box, Button, FormControl, FormControlLabel, Icon, IconButton, InputAdornment, Popover, Radio, RadioGroup, TextField, Typography } from '@mui/material';
|
|
8
|
+
import { defineMessages, FormattedMessage, useIntl } from 'react-intl';
|
|
9
|
+
import { PREFIX, unitType } from './constants';
|
|
10
|
+
import { DateTimePickerTabs, LocalizationProvider, MobileDateTimePicker } from '@mui/x-date-pickers';
|
|
11
|
+
import { SCCourseTypologyType } from '@selfcommunity/types';
|
|
12
|
+
import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns';
|
|
13
|
+
import { useSCContext } from '@selfcommunity/react-core';
|
|
14
|
+
import itLocale from 'date-fns/locale/it';
|
|
15
|
+
import enLocale from 'date-fns/locale/en-US';
|
|
16
|
+
import { CourseService } from '@selfcommunity/api-services';
|
|
17
|
+
import { SCOPE_SC_UI } from '../../constants/Errors';
|
|
18
|
+
import { Logger } from '@selfcommunity/utils';
|
|
19
|
+
import { getDripDelayAndUnit } from '../../utils/course';
|
|
20
|
+
import { useIsDisabled } from '../EditCourse/hooks';
|
|
21
|
+
const messages = defineMessages({
|
|
22
|
+
pickerPlaceholder: {
|
|
23
|
+
id: 'ui.lessonReleaseMenu.scheduled.picker.placeholder',
|
|
24
|
+
defaultMessage: 'ui.lessonReleaseMenu.scheduled.picker.placeholder'
|
|
25
|
+
},
|
|
26
|
+
pickerCancelMessage: {
|
|
27
|
+
id: 'ui.lessonReleaseMenu.scheduled.picker.cancel',
|
|
28
|
+
defaultMessage: 'ui.lessonReleaseMenu.scheduled.picker.cancel'
|
|
29
|
+
},
|
|
30
|
+
pickerClearMessage: {
|
|
31
|
+
id: 'ui.lessonReleaseMenu.scheduled.picker.clear',
|
|
32
|
+
defaultMessage: 'ui.lessonReleaseMenu.scheduled.picker.clear'
|
|
33
|
+
},
|
|
34
|
+
pickerOkMessage: {
|
|
35
|
+
id: 'ui.lessonReleaseMenu.scheduled.picker.ok',
|
|
36
|
+
defaultMessage: 'ui.lessonReleaseMenu.scheduled.picker.ok'
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
const classes = {
|
|
40
|
+
root: `${PREFIX}-root`,
|
|
41
|
+
label: `${PREFIX}-label`,
|
|
42
|
+
picker: `${PREFIX}-picker`,
|
|
43
|
+
popoverRoot: `${PREFIX}-popover-root`,
|
|
44
|
+
popoverContent: `${PREFIX}-popover-content`,
|
|
45
|
+
popoverSelection: `${PREFIX}-popover-selection`,
|
|
46
|
+
popoverAction: `${PREFIX}-popover-action`
|
|
47
|
+
};
|
|
48
|
+
const Root = styled(FormControl, {
|
|
49
|
+
name: PREFIX,
|
|
50
|
+
slot: 'Root',
|
|
51
|
+
overridesResolver: (_props, styles) => [styles.root]
|
|
52
|
+
})(() => ({}));
|
|
53
|
+
const PopoverRoot = styled(Popover, {
|
|
54
|
+
name: PREFIX,
|
|
55
|
+
slot: 'PopoverRoot',
|
|
56
|
+
overridesResolver: (_props, styles) => styles.popoverRoot
|
|
57
|
+
})(() => ({}));
|
|
58
|
+
export default function LessonReleaseMenu(inProps) {
|
|
59
|
+
// PROPS
|
|
60
|
+
const props = useThemeProps({
|
|
61
|
+
props: inProps,
|
|
62
|
+
name: PREFIX
|
|
63
|
+
});
|
|
64
|
+
const { className = null, course, section, onSuccess } = props, rest = __rest(props, ["className", "course", "section", "onSuccess"]);
|
|
65
|
+
// CONTEXT
|
|
66
|
+
const scContext = useSCContext();
|
|
67
|
+
// STATE
|
|
68
|
+
const [drippedAt, setDrippedAt] = useState(null);
|
|
69
|
+
const { delay, _unit } = getDripDelayAndUnit((section === null || section === void 0 ? void 0 : section.drip_delay) || 0);
|
|
70
|
+
const [dripDelay, setDripDelay] = useState(delay);
|
|
71
|
+
const [unit, setUnit] = useState(_unit);
|
|
72
|
+
const [anchorEl, setAnchorEl] = useState(null);
|
|
73
|
+
const [open, setOpen] = useState(false);
|
|
74
|
+
// HOOKS
|
|
75
|
+
const { isDisabled } = useIsDisabled();
|
|
76
|
+
//INTL
|
|
77
|
+
const intl = useIntl();
|
|
78
|
+
const handleUnitChange = (e) => {
|
|
79
|
+
setUnit(e.target.value);
|
|
80
|
+
};
|
|
81
|
+
// EFFECTS
|
|
82
|
+
useEffect(() => {
|
|
83
|
+
if (section && section.dripped_at) {
|
|
84
|
+
setDrippedAt(new Date(section.dripped_at));
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
setDrippedAt(null);
|
|
88
|
+
}
|
|
89
|
+
}, [section, setDrippedAt]);
|
|
90
|
+
useEffect(() => {
|
|
91
|
+
if (section) {
|
|
92
|
+
setDripDelay(delay);
|
|
93
|
+
}
|
|
94
|
+
}, [section, setDripDelay]);
|
|
95
|
+
// HANDLERS
|
|
96
|
+
const handleClick = (event) => {
|
|
97
|
+
setAnchorEl(event.currentTarget);
|
|
98
|
+
setOpen(true);
|
|
99
|
+
};
|
|
100
|
+
const handleClose = () => {
|
|
101
|
+
setOpen(false);
|
|
102
|
+
};
|
|
103
|
+
const handleValueChange = (e) => {
|
|
104
|
+
setDripDelay(e.target.value);
|
|
105
|
+
};
|
|
106
|
+
const handleSave = () => {
|
|
107
|
+
const _delay = unit === unitType.DAYS ? dripDelay : dripDelay * 7;
|
|
108
|
+
CourseService.patchCourseSection(course.id, section.id, { drip_delay: _delay })
|
|
109
|
+
.then((data) => {
|
|
110
|
+
setOpen(false);
|
|
111
|
+
onSuccess(data);
|
|
112
|
+
})
|
|
113
|
+
.catch((e) => {
|
|
114
|
+
Logger.error(SCOPE_SC_UI, e);
|
|
115
|
+
});
|
|
116
|
+
};
|
|
117
|
+
const handleUpdate = (value) => {
|
|
118
|
+
CourseService.patchCourseSection(course.id, section.id, { dripped_at: value ? value.toISOString() : null })
|
|
119
|
+
.then((data) => {
|
|
120
|
+
setOpen(false);
|
|
121
|
+
onSuccess(data);
|
|
122
|
+
})
|
|
123
|
+
.catch((e) => {
|
|
124
|
+
Logger.error(SCOPE_SC_UI, e);
|
|
125
|
+
});
|
|
126
|
+
};
|
|
127
|
+
const placeholderStructured = dripDelay > 0
|
|
128
|
+
? intl.formatMessage({
|
|
129
|
+
id: `ui.lessonReleaseMenu.structured.label.${unit}`,
|
|
130
|
+
defaultMessage: `ui.lessonReleaseMenu.structured.label.${unit}`
|
|
131
|
+
}, { total: dripDelay })
|
|
132
|
+
: intl.formatMessage({
|
|
133
|
+
id: 'ui.lessonReleaseMenu.now.label',
|
|
134
|
+
defaultMessage: 'ui.lessonReleaseMenu.now.label'
|
|
135
|
+
});
|
|
136
|
+
return (_jsx(Root, Object.assign({ className: classNames(className, classes.root) }, rest, { children: course && course.type === SCCourseTypologyType.SCHEDULED ? (_jsx(LocalizationProvider, Object.assign({ dateAdapter: AdapterDateFns, adapterLocale: scContext.settings.locale.default === 'it' ? itLocale : enLocale, localeText: {
|
|
137
|
+
okButtonLabel: `${intl.formatMessage(messages.pickerOkMessage)}`,
|
|
138
|
+
cancelButtonLabel: `${intl.formatMessage(messages.pickerCancelMessage)}`,
|
|
139
|
+
clearButtonLabel: `${intl.formatMessage(messages.pickerClearMessage)}`
|
|
140
|
+
} }, { children: _jsx(MobileDateTimePicker, { className: classes.picker, disablePast: true, label: drippedAt && (_jsx(FormattedMessage, { id: "ui.lessonReleaseMenu.scheduled.picker.placeholder", defaultMessage: "ui.lessonReleaseMenu.scheduled.picker.placeholder" })), value: drippedAt, slots: {
|
|
141
|
+
//actionBar: PickerActionBar,
|
|
142
|
+
tabs: (props) => _jsx(DateTimePickerTabs, Object.assign({}, props)),
|
|
143
|
+
textField: (params) => (_jsx(TextField, Object.assign({}, params, { error: false, InputProps: Object.assign(Object.assign({}, params.InputProps), { placeholder: `${intl.formatMessage(messages.pickerPlaceholder)}`, endAdornment: (_jsx(InputAdornment, Object.assign({ position: "end" }, { children: _jsx(IconButton, Object.assign({ disabled: isDisabled }, { children: _jsx(Icon, { children: "expand_more" }) })) }))) }) })))
|
|
144
|
+
}, slotProps: {
|
|
145
|
+
tabs: {
|
|
146
|
+
hidden: false
|
|
147
|
+
},
|
|
148
|
+
toolbar: {
|
|
149
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore,@typescript-eslint/ban-ts-comment
|
|
150
|
+
// @ts-ignore
|
|
151
|
+
toolbarTitle: (_jsx(FormattedMessage, { id: "ui.lessonReleaseMenu.scheduled.picker.placeholder", defaultMessage: "ui.lessonReleaseMenu.scheduled.picker.placeholder" }))
|
|
152
|
+
},
|
|
153
|
+
actionBar: {
|
|
154
|
+
actions: ['cancel', 'clear', 'accept']
|
|
155
|
+
}
|
|
156
|
+
}, onChange: (value) => setDrippedAt(value), onAccept: handleUpdate, onClear: () => setDrippedAt(null), disabled: isDisabled }) }))) : (_jsxs(_Fragment, { children: [_jsx(TextField, { size: "small", value: placeholderStructured, onClick: isDisabled ? undefined : handleClick, InputProps: {
|
|
157
|
+
endAdornment: (_jsx(InputAdornment, Object.assign({ position: "end" }, { children: _jsx(IconButton, Object.assign({ onClick: handleClick, disabled: isDisabled }, { children: _jsx(Icon, { children: "expand_more" }) })) })))
|
|
158
|
+
}, disabled: isDisabled }), _jsxs(PopoverRoot, Object.assign({ className: classes.popoverRoot, open: open, anchorEl: anchorEl, onClose: handleClose, anchorOrigin: {
|
|
159
|
+
vertical: 'bottom',
|
|
160
|
+
horizontal: 'left'
|
|
161
|
+
}, transformOrigin: {
|
|
162
|
+
vertical: 'top',
|
|
163
|
+
horizontal: 'left'
|
|
164
|
+
} }, { children: [_jsx(Typography, Object.assign({ variant: "h6" }, { children: _jsx(FormattedMessage, { id: "ui.lessonReleaseMenu.dialog.title", defaultMessage: "ui.lessonReleaseMenu.dialog.title" }) })), _jsxs(Box, Object.assign({ className: classes.popoverContent }, { children: [_jsxs(Box, Object.assign({ className: classes.popoverSelection }, { children: [_jsx(TextField, { type: "number", value: dripDelay, onChange: handleValueChange, InputProps: {
|
|
165
|
+
inputProps: {
|
|
166
|
+
min: 0
|
|
167
|
+
}
|
|
168
|
+
} }), _jsx(FormControl, { children: _jsxs(RadioGroup, Object.assign({ value: unit, onChange: handleUnitChange }, { children: [_jsx(FormControlLabel, { value: unitType.DAYS, control: _jsx(Radio, { size: "small" }), label: _jsx(FormattedMessage, { id: "ui.lessonReleaseMenu.dialog.days", defaultMessage: "ui.lessonReleaseMenu.dialog.days" }) }), _jsx(FormControlLabel, { value: unitType.WEEKS, control: _jsx(Radio, { size: "small" }), label: _jsx(FormattedMessage, { id: "ui.lessonReleaseMenu.dialog.weeks", defaultMessage: "ui.lessonReleaseMenu.dialog.weeks" }) })] })) })] })), _jsx(Typography, Object.assign({ variant: "body1" }, { children: dripDelay > 0 ? (_jsx(FormattedMessage, { id: `ui.lessonReleaseMenu.dialog.info.structured.${unit}`, defaultMessage: `ui.lessonReleaseMenu.dialog.info.structured.${unit}`, values: { total: dripDelay } })) : (_jsx(FormattedMessage, { id: "ui.lessonReleaseMenu.dialog.info.now", defaultMessage: "ui.lessonReleaseMenu.dialog.info.now" })) })), _jsx(Button, Object.assign({ className: classes.popoverAction, variant: "contained", disabled: section.drip_delay === dripDelay, onClick: handleSave }, { children: _jsx(FormattedMessage, { id: "ui.lessonReleaseMenu.dialog.button.done", defaultMessage: "ui.lessonReleaseMenu.dialog.button.done" }) }))] }))] }))] })) })));
|
|
169
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
3
|
-
import { Box, Divider, Icon, List, ListItem, ListItemButton, ListItemIcon, ListItemText, Typography,
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Box, Divider, Icon, List, ListItem, ListItemButton, ListItemIcon, ListItemText, Typography, Zoom } from '@mui/material';
|
|
4
4
|
import { Link, SCPreferences, SCRoutes, useSCFetchCategories, useSCPreferences, useSCRouting, useSCUser } from '@selfcommunity/react-core';
|
|
5
5
|
import { useEffect, useMemo, useState } from 'react';
|
|
6
6
|
import Category from '../Category';
|
|
@@ -10,7 +10,6 @@ import { SCFeatureName } from '@selfcommunity/types';
|
|
|
10
10
|
import { styled } from '@mui/material/styles';
|
|
11
11
|
import classNames from 'classnames';
|
|
12
12
|
import { useThemeProps } from '@mui/system';
|
|
13
|
-
import DefaultDrawerSkeleton from './DefaultDrawerSkeleton';
|
|
14
13
|
const PREFIX = 'SCDefaultDrawerContent';
|
|
15
14
|
const classes = {
|
|
16
15
|
root: `${PREFIX}-root`,
|
|
@@ -30,14 +29,12 @@ export default function DefaultDrawerContent(inProps) {
|
|
|
30
29
|
});
|
|
31
30
|
const { className, CategoryItemProps = { showTooltip: true } } = props, rest = __rest(props, ["className", "CategoryItemProps"]);
|
|
32
31
|
// HOOKS
|
|
33
|
-
const { categories
|
|
32
|
+
const { categories } = useSCFetchCategories();
|
|
34
33
|
const [categoriesOrdered, setCategoriesOrdered] = useState([]);
|
|
35
34
|
// ROUTING
|
|
36
35
|
const scRoutingContext = useSCRouting();
|
|
37
36
|
// CONTEXT
|
|
38
37
|
const scUserContext = useSCUser();
|
|
39
|
-
const theme = useTheme();
|
|
40
|
-
const isMobile = useMediaQuery(theme.breakpoints.down('md'));
|
|
41
38
|
// PREFERENCES
|
|
42
39
|
const { preferences, features } = useSCPreferences();
|
|
43
40
|
//STATE
|
|
@@ -54,6 +51,11 @@ export default function DefaultDrawerContent(inProps) {
|
|
|
54
51
|
features.includes(SCFeatureName.TAGGING) &&
|
|
55
52
|
SCPreferences.CONFIGURATIONS_EVENTS_ENABLED in preferences &&
|
|
56
53
|
preferences[SCPreferences.CONFIGURATIONS_EVENTS_ENABLED].value, [preferences, features]);
|
|
54
|
+
const coursesEnabled = useMemo(() => preferences &&
|
|
55
|
+
features &&
|
|
56
|
+
features.includes(SCFeatureName.TAGGING) &&
|
|
57
|
+
SCPreferences.CONFIGURATIONS_COURSES_ENABLED in preferences &&
|
|
58
|
+
preferences[SCPreferences.CONFIGURATIONS_COURSES_ENABLED].value, [preferences, features]);
|
|
57
59
|
const exploreStreamEnabled = preferences[SCPreferences.CONFIGURATIONS_EXPLORE_STREAM_ENABLED].value;
|
|
58
60
|
const contentAvailable = preferences[SCPreferences.CONFIGURATIONS_CONTENT_AVAILABILITY].value;
|
|
59
61
|
// HANDLERS
|
|
@@ -78,5 +80,5 @@ export default function DefaultDrawerContent(inProps) {
|
|
|
78
80
|
onTouchMove: mouseLeave
|
|
79
81
|
});
|
|
80
82
|
//order
|
|
81
|
-
return (_jsxs(Root, Object.assign({ className: classNames(className, classes.root) }, rest, { children: [
|
|
83
|
+
return (_jsxs(Root, Object.assign({ className: classNames(className, classes.root) }, rest, { children: [_jsxs(List, Object.assign({ className: classes.navigation }, { children: [scUserContext.user && (_jsx(ListItem, Object.assign({ disablePadding: true }, { children: _jsxs(ListItemButton, Object.assign({ component: Link, to: scRoutingContext.url(SCRoutes.HOME_ROUTE_NAME, {}) }, { children: [_jsx(ListItemIcon, { children: _jsx(Icon, { children: "home" }) }), _jsx(ListItemText, { primary: _jsx(FormattedMessage, { id: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.home", defaultMessage: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.home" }) })] })) }))), coursesEnabled && (scUserContext.user || contentAvailable) && (_jsx(ListItem, Object.assign({ disablePadding: true }, { children: _jsxs(ListItemButton, Object.assign({ component: Link, to: scRoutingContext.url(SCRoutes.COURSES_ROUTE_NAME, {}) }, { children: [_jsx(ListItemIcon, { children: _jsx(Icon, { children: "courses" }) }), _jsx(ListItemText, { primary: _jsx(FormattedMessage, { id: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.courses", defaultMessage: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.courses" }) })] })) }))), groupsEnabled && scUserContext.user && (_jsx(ListItem, Object.assign({ disablePadding: true }, { children: _jsxs(ListItemButton, Object.assign({ component: Link, to: scRoutingContext.url(SCRoutes.GROUPS_ROUTE_NAME, {}) }, { children: [_jsx(ListItemIcon, { children: _jsx(Icon, { children: "groups" }) }), _jsx(ListItemText, { primary: _jsx(FormattedMessage, { id: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.groups", defaultMessage: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.groups" }) })] })) }))), eventsEnabled && (scUserContext.user || contentAvailable) && (_jsx(ListItem, Object.assign({ disablePadding: true }, { children: _jsxs(ListItemButton, Object.assign({ component: Link, to: scRoutingContext.url(SCRoutes.EVENTS_ROUTE_NAME, {}) }, { children: [_jsx(ListItemIcon, { children: _jsx(Icon, { children: "CalendarIcon" }) }), _jsx(ListItemText, { primary: _jsx(FormattedMessage, { id: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.events", defaultMessage: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.events" }) })] })) }))), exploreStreamEnabled && (contentAvailable || scUserContext.user) && (_jsx(ListItem, Object.assign({ disablePadding: true }, { children: _jsxs(ListItemButton, Object.assign({ component: Link, to: scRoutingContext.url(SCRoutes.EXPLORE_ROUTE_NAME, {}) }, { children: [_jsx(ListItemIcon, { children: _jsx(Icon, { children: "explore" }) }), _jsx(ListItemText, { primary: _jsx(FormattedMessage, { id: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.explore", defaultMessage: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.explore" }) })] })) })))] })), _jsx(Divider, {}), _jsx(Typography, Object.assign({ variant: "subtitle1", className: classes.title }, { children: _jsx(FormattedMessage, { id: "ui.navigationMenuIconButton.defaultDrawerContent.category.title", defaultMessage: "ui.navigationMenuIconButton.defaultDrawerContent.category.title" }) })), !categoriesOrdered.length && (_jsx(Typography, Object.assign({ variant: "body1", className: classes.noResults }, { children: _jsx(FormattedMessage, { id: "ui.navigationMenuIconButton.defaultDrawerContent.category.noResults", defaultMessage: "ui.navigationMenuIconButton.defaultDrawerContent.category.noResults" }) }))), categoriesOrdered.map((c, index) => (_jsx(Zoom, Object.assign({ in: true, style: { transform: isHovered[c.id] && 'scale(1.05)' } }, { children: _jsx(ListItem, { children: _jsx(Category, Object.assign({ ButtonBaseProps: { component: Link, to: scRoutingContext.url(SCRoutes.CATEGORY_ROUTE_NAME, c) }, elevation: 0, category: c, actions: null }, CategoryItemProps, getMouseEvents(() => handleMouseEnter(c.id), () => handleMouseLeave(c.id)))) }, c.id) }), index)))] })));
|
|
82
84
|
}
|
|
@@ -25,6 +25,7 @@ const classes = {
|
|
|
25
25
|
explore: `${PREFIX}-explore`,
|
|
26
26
|
events: `${PREFIX}-events`,
|
|
27
27
|
groups: `${PREFIX}-groups`,
|
|
28
|
+
courses: `${PREFIX}-courses`,
|
|
28
29
|
search: `${PREFIX}-search`,
|
|
29
30
|
composer: `${PREFIX}-composer`,
|
|
30
31
|
profile: `${PREFIX}-profile`,
|
|
@@ -120,6 +121,11 @@ export default function NavigationToolbar(inProps) {
|
|
|
120
121
|
scPreferences.features.includes(SCFeatureName.EVENT) &&
|
|
121
122
|
SCPreferences.CONFIGURATIONS_EVENTS_ENABLED in scPreferences.preferences &&
|
|
122
123
|
scPreferences.preferences[SCPreferences.CONFIGURATIONS_EVENTS_ENABLED].value, [scPreferences.preferences, scPreferences.features]);
|
|
124
|
+
const coursesEnabled = useMemo(() => scPreferences.preferences &&
|
|
125
|
+
scPreferences.features &&
|
|
126
|
+
scPreferences.features.includes(SCFeatureName.TAGGING) &&
|
|
127
|
+
SCPreferences.CONFIGURATIONS_COURSES_ENABLED in scPreferences.preferences &&
|
|
128
|
+
scPreferences.preferences[SCPreferences.CONFIGURATIONS_COURSES_ENABLED].value, [scPreferences.preferences, scPreferences.features]);
|
|
123
129
|
const showComposer = useMemo(() => {
|
|
124
130
|
return (!disableComposer &&
|
|
125
131
|
(!scPreferences.preferences[SCPreferences.CONFIGURATIONS_POST_ONLY_STAFF_ENABLED].value || UserUtils.isStaff(scUserContext.user)));
|
|
@@ -140,7 +146,12 @@ export default function NavigationToolbar(inProps) {
|
|
|
140
146
|
return _jsx(NavigationToolbarSkeleton, {});
|
|
141
147
|
}
|
|
142
148
|
const _children = children || (_jsxs(Box, Object.assign({ className: classes.navigation }, { children: [scUserContext.user && (_jsx(IconButton, Object.assign({ className: classNames(classes.home, { [classes.active]: value.startsWith(scRoutingContext.url(SCRoutes.HOME_ROUTE_NAME, {})) }), "aria-label": "Home", to: scRoutingContext.url(SCRoutes.HOME_ROUTE_NAME, {}), component: Link }, { children: _jsx(Icon, { children: "home" }) }))), preferences[SCPreferences.CONFIGURATIONS_EXPLORE_STREAM_ENABLED] &&
|
|
143
|
-
(preferences[SCPreferences.CONFIGURATIONS_CONTENT_AVAILABILITY] || scUserContext.user) &&
|
|
149
|
+
(preferences[SCPreferences.CONFIGURATIONS_CONTENT_AVAILABILITY] || scUserContext.user) &&
|
|
150
|
+
(!scUserContext.user || (!groupsEnabled && !coursesEnabled && !eventsEnabled)) && (_jsx(IconButton, Object.assign({ className: classNames(classes.explore, {
|
|
151
|
+
[classes.active]: value.startsWith(scRoutingContext.url(SCRoutes.EXPLORE_ROUTE_NAME, {}))
|
|
152
|
+
}), "aria-label": "Explore", to: scRoutingContext.url(SCRoutes.EXPLORE_ROUTE_NAME, {}), component: Link }, { children: _jsx(Icon, { children: "explore" }) }))), coursesEnabled && (scUserContext.user || preferences[SCPreferences.CONFIGURATIONS_CONTENT_AVAILABILITY]) && (_jsx(IconButton, Object.assign({ className: classNames(classes.courses, {
|
|
153
|
+
[classes.active]: value.startsWith(scRoutingContext.url(SCRoutes.COURSES_ROUTE_NAME, {}))
|
|
154
|
+
}), "aria-label": "Courses", to: scRoutingContext.url(SCRoutes.COURSES_ROUTE_NAME, {}), component: Link }, { children: _jsx(Icon, { children: "courses" }) }))), groupsEnabled && scUserContext.user && (_jsx(IconButton, Object.assign({ className: classNames(classes.groups, {
|
|
144
155
|
[classes.active]: value.startsWith(scRoutingContext.url(SCRoutes.GROUPS_SUBSCRIBED_ROUTE_NAME, {})) ||
|
|
145
156
|
value.startsWith(scRoutingContext.url(SCRoutes.GROUPS_ROUTE_NAME, {}))
|
|
146
157
|
}), "aria-label": "Groups", to: scRoutingContext.url(SCRoutes.GROUPS_SUBSCRIBED_ROUTE_NAME, {}), component: Link }, { children: _jsx(Icon, { children: "groups" }) }))), eventsEnabled && (scUserContext.user || preferences[SCPreferences.CONFIGURATIONS_CONTENT_AVAILABILITY]) && (_jsx(IconButton, Object.assign({ className: classNames(classes.events, {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SCNotificationCourseActivityType } from '@selfcommunity/types';
|
|
2
|
+
import { NotificationItemProps } from '../../../shared/NotificationItem';
|
|
3
|
+
export interface NotificationCourseProps extends Pick<NotificationItemProps, Exclude<keyof NotificationItemProps, 'image' | 'disableTypography' | 'primary' | 'primaryTypographyProps' | 'secondary' | 'secondaryTypographyProps' | 'actions' | 'footer' | 'isNew'>> {
|
|
4
|
+
/**
|
|
5
|
+
* Notification obj
|
|
6
|
+
* @default null
|
|
7
|
+
*/
|
|
8
|
+
notificationObject: SCNotificationCourseActivityType;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* This component render the content of the notification of type course
|
|
12
|
+
* @constructor
|
|
13
|
+
* @param props
|
|
14
|
+
*/
|
|
15
|
+
export default function CourseNotification(props: NotificationCourseProps): JSX.Element;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { styled } from '@mui/material/styles';
|
|
5
|
+
import { Avatar, Box, Stack, Typography } from '@mui/material';
|
|
6
|
+
import { Link, SCRoutes, useSCRouting } from '@selfcommunity/react-core';
|
|
7
|
+
import { SCNotificationTypologyType } from '@selfcommunity/types';
|
|
8
|
+
import { FormattedMessage } from 'react-intl';
|
|
9
|
+
import DateTimeAgo from '../../../shared/DateTimeAgo';
|
|
10
|
+
import classNames from 'classnames';
|
|
11
|
+
import { SCCourseTemplateType, SCNotificationObjectTemplateType } from '../../../types';
|
|
12
|
+
import NotificationItem from '../../../shared/NotificationItem';
|
|
13
|
+
import { LoadingButton } from '@mui/lab';
|
|
14
|
+
import UserDeletedSnackBar from '../../../shared/UserDeletedSnackBar';
|
|
15
|
+
import UserAvatar from '../../../shared/UserAvatar';
|
|
16
|
+
import { PREFIX } from '../constants';
|
|
17
|
+
import { default as CourseItem } from '../../Course';
|
|
18
|
+
import HiddenPlaceholder from '../../../shared/HiddenPlaceholder';
|
|
19
|
+
import { formatLessonUrl, getRouteName, getRouteParams } from './utils';
|
|
20
|
+
const classes = {
|
|
21
|
+
root: `${PREFIX}-course-root`,
|
|
22
|
+
avatar: `${PREFIX}-avatar`,
|
|
23
|
+
actions: `${PREFIX}-actions`,
|
|
24
|
+
seeButton: `${PREFIX}see-button`,
|
|
25
|
+
activeAt: `${PREFIX}-active-at`,
|
|
26
|
+
snippetTime: `${PREFIX}-snippet-time`,
|
|
27
|
+
username: `${PREFIX}-username`
|
|
28
|
+
};
|
|
29
|
+
const Root = styled(NotificationItem, {
|
|
30
|
+
name: PREFIX,
|
|
31
|
+
slot: 'CourseRoot'
|
|
32
|
+
})(() => ({}));
|
|
33
|
+
/**
|
|
34
|
+
* This component render the content of the notification of type course
|
|
35
|
+
* @constructor
|
|
36
|
+
* @param props
|
|
37
|
+
*/
|
|
38
|
+
export default function CourseNotification(props) {
|
|
39
|
+
// PROPS
|
|
40
|
+
const { notificationObject, id = `n_${props.notificationObject['sid']}`, className, template = SCNotificationObjectTemplateType.DETAIL } = props, rest = __rest(props, ["notificationObject", "id", "className", "template"]);
|
|
41
|
+
// CONTEXT
|
|
42
|
+
const scRoutingContext = useSCRouting();
|
|
43
|
+
// STATE
|
|
44
|
+
const [openAlert, setOpenAlert] = useState(false);
|
|
45
|
+
// CONST
|
|
46
|
+
const isSnippetTemplate = template === SCNotificationObjectTemplateType.SNIPPET;
|
|
47
|
+
const isToastTemplate = template === SCNotificationObjectTemplateType.TOAST;
|
|
48
|
+
if (!notificationObject.course) {
|
|
49
|
+
return _jsx(HiddenPlaceholder, {});
|
|
50
|
+
}
|
|
51
|
+
// RENDER
|
|
52
|
+
if (isSnippetTemplate || isToastTemplate) {
|
|
53
|
+
return (_jsx(Root, Object.assign({ id: id, className: classNames(classes.root, className, `${PREFIX}-${template}`), template: template, isNew: notificationObject.is_new, disableTypography: true, image: _jsx(Link, Object.assign({}, (!notificationObject.user.deleted && {
|
|
54
|
+
to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, notificationObject.user)
|
|
55
|
+
}), { onClick: notificationObject.user.deleted ? () => setOpenAlert(true) : null }, { children: _jsx(UserAvatar, Object.assign({ hide: !notificationObject.user.community_badge, smaller: true }, { children: _jsx(Avatar, { alt: notificationObject.user.username, variant: "circular", src: notificationObject.user.avatar, classes: { root: classes.avatar } }) })) })), primary: _jsxs(Box, { children: [_jsx(Link, Object.assign({}, (!notificationObject.user.deleted && {
|
|
56
|
+
to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, notificationObject.user)
|
|
57
|
+
}), { onClick: notificationObject.user.deleted ? () => setOpenAlert(true) : null, className: classes.username }, { children: notificationObject.user.username })), ' ', _jsx(FormattedMessage, { id: `ui.notification.course.${notificationObject.type}`, defaultMessage: `ui.notification.course.${notificationObject.type}`, values: {
|
|
58
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
59
|
+
// @ts-ignore
|
|
60
|
+
name: notificationObject.type === SCNotificationTypologyType.USER_COMMENTED_A_COURSE_LESSON
|
|
61
|
+
? notificationObject.comment.lesson_name
|
|
62
|
+
: notificationObject.course.name,
|
|
63
|
+
link: (...chunks) => (_jsx(Link, Object.assign({ to: scRoutingContext.url(notificationObject.type === SCNotificationTypologyType.USER_COMMENTED_A_COURSE_LESSON
|
|
64
|
+
? SCRoutes.COURSE_LESSON_ROUTE_NAME
|
|
65
|
+
: SCRoutes.COURSE_ROUTE_NAME, notificationObject.type === SCNotificationTypologyType.USER_COMMENTED_A_COURSE_LESSON
|
|
66
|
+
? formatLessonUrl(notificationObject)
|
|
67
|
+
: notificationObject.course) }, { children: chunks })))
|
|
68
|
+
} })] }), 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(getRouteName(notificationObject), getRouteParams(notificationObject)) }, { 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)));
|
|
69
|
+
}
|
|
70
|
+
return (_jsxs(_Fragment, { children: [_jsx(Root, Object.assign({ id: id, className: classNames(classes.root, className, `${PREFIX}-${template}`), template: template, isNew: notificationObject.is_new, disableTypography: true, image: _jsx(Link, Object.assign({}, (!notificationObject.user.deleted && {
|
|
71
|
+
to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, notificationObject.user)
|
|
72
|
+
}), { onClick: notificationObject.user.deleted ? () => setOpenAlert(true) : null }, { children: _jsx(UserAvatar, Object.assign({ hide: !notificationObject.user.community_badge, smaller: true }, { children: _jsx(Avatar, { className: classes.avatar, alt: notificationObject.user.username, variant: "circular", src: notificationObject.user.avatar }) })) })), primary: _jsxs(_Fragment, { children: [_jsx(Link, Object.assign({}, (!notificationObject.user.deleted && {
|
|
73
|
+
to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, notificationObject.user)
|
|
74
|
+
}), { onClick: notificationObject.user.deleted ? () => setOpenAlert(true) : null, className: classes.username }, { children: notificationObject.user.username })), ' ', _jsx(FormattedMessage, { id: `ui.notification.course.${notificationObject.type}`, defaultMessage: `ui.notification.course.${notificationObject.type}`, values: {
|
|
75
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
76
|
+
// @ts-ignore
|
|
77
|
+
name: notificationObject.type === SCNotificationTypologyType.USER_COMMENTED_A_COURSE_LESSON
|
|
78
|
+
? notificationObject.comment.lesson_name
|
|
79
|
+
: notificationObject.course.name,
|
|
80
|
+
link: (...chunks) => (_jsx(Link, Object.assign({ to: scRoutingContext.url(notificationObject.type === SCNotificationTypologyType.USER_COMMENTED_A_COURSE_LESSON
|
|
81
|
+
? SCRoutes.COURSE_LESSON_ROUTE_NAME
|
|
82
|
+
: SCRoutes.COURSE_ROUTE_NAME, notificationObject.type === SCNotificationTypologyType.USER_COMMENTED_A_COURSE_LESSON
|
|
83
|
+
? formatLessonUrl(notificationObject)
|
|
84
|
+
: notificationObject.course) }, { children: chunks })))
|
|
85
|
+
} }), 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(getRouteName(notificationObject), getRouteParams(notificationObject)) }, { children: _jsx(FormattedMessage, { id: "ui.notification.course.button.see", defaultMessage: "ui.notification.course.button.see" }) }))] })) }, rest)), openAlert && _jsx(UserDeletedSnackBar, { open: openAlert, handleClose: () => setOpenAlert(false) })] }));
|
|
86
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { SCNotificationCourseActivityType } from '@selfcommunity/types';
|
|
2
|
+
declare function formatLessonUrl(notificationObject: SCNotificationCourseActivityType): any;
|
|
3
|
+
declare const getRouteName: (notificationObject: SCNotificationCourseActivityType) => "course_edit" | "course_lesson_comments" | "course";
|
|
4
|
+
declare const getRouteParams: (notificationObject: SCNotificationCourseActivityType) => any;
|
|
5
|
+
export { getRouteName, getRouteParams, formatLessonUrl };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { SCCourseEditTabType } from '../../../types/course';
|
|
2
|
+
import { SCNotificationTypologyType } from '@selfcommunity/types';
|
|
3
|
+
import { SCRoutes } from '@selfcommunity/react-core';
|
|
4
|
+
function formatLessonUrl(notificationObject) {
|
|
5
|
+
return {
|
|
6
|
+
id: notificationObject.course.id,
|
|
7
|
+
slug: notificationObject.course.slug,
|
|
8
|
+
section_id: notificationObject.comment.section_id,
|
|
9
|
+
lesson_id: notificationObject.comment.lesson_id
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function formatCourseRequestsUrl(notificationObject) {
|
|
13
|
+
return {
|
|
14
|
+
id: notificationObject.course.id,
|
|
15
|
+
slug: notificationObject.course.slug,
|
|
16
|
+
tab: SCCourseEditTabType.REQUESTS
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
const getRouteName = (notificationObject) => {
|
|
20
|
+
switch (notificationObject.type) {
|
|
21
|
+
case SCNotificationTypologyType.USER_COMMENTED_A_COURSE_LESSON:
|
|
22
|
+
return SCRoutes.COURSE_LESSON_COMMENTS_ROUTE_NAME;
|
|
23
|
+
case SCNotificationTypologyType.USER_REQUESTED_TO_JOIN_COURSE:
|
|
24
|
+
return SCRoutes.COURSE_EDIT_ROUTE_NAME;
|
|
25
|
+
default:
|
|
26
|
+
return SCRoutes.COURSE_ROUTE_NAME;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
const getRouteParams = (notificationObject) => {
|
|
30
|
+
switch (notificationObject.type) {
|
|
31
|
+
case SCNotificationTypologyType.USER_COMMENTED_A_COURSE_LESSON:
|
|
32
|
+
return formatLessonUrl(notificationObject);
|
|
33
|
+
case SCNotificationTypologyType.USER_REQUESTED_TO_JOIN_COURSE:
|
|
34
|
+
return formatCourseRequestsUrl(notificationObject);
|
|
35
|
+
default:
|
|
36
|
+
return notificationObject.course;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
export { getRouteName, getRouteParams, formatLessonUrl };
|
|
@@ -37,6 +37,7 @@ import UserDeletedSnackBar from '../../shared/UserDeletedSnackBar';
|
|
|
37
37
|
import UserAvatar from '../../shared/UserAvatar';
|
|
38
38
|
import { PREFIX } from './constants';
|
|
39
39
|
import GroupNotification from './Group';
|
|
40
|
+
import CourseNotification from './Course';
|
|
40
41
|
const messages = defineMessages({
|
|
41
42
|
receivePrivateMessage: {
|
|
42
43
|
id: 'ui.notification.receivePrivateMessage',
|
|
@@ -307,6 +308,14 @@ export default function UserNotification(inProps) {
|
|
|
307
308
|
n.type === SCNotificationTypologyType.USER_REQUESTED_TO_JOIN_EVENT) {
|
|
308
309
|
return _jsx(EventNotification, { notificationObject: n }, i);
|
|
309
310
|
}
|
|
311
|
+
else if (n.type === SCNotificationTypologyType.USER_ADDED_TO_COURSE ||
|
|
312
|
+
n.type === SCNotificationTypologyType.MANAGER_ADDED_TO_COURSE ||
|
|
313
|
+
n.type === SCNotificationTypologyType.USER_COMMENTED_A_COURSE_LESSON ||
|
|
314
|
+
n.type === SCNotificationTypologyType.USER_INVITED_TO_JOIN_COURSE ||
|
|
315
|
+
n.type === SCNotificationTypologyType.USER_ACCEPTED_TO_JOIN_COURSE ||
|
|
316
|
+
n.type === SCNotificationTypologyType.USER_REQUESTED_TO_JOIN_COURSE) {
|
|
317
|
+
return _jsx(CourseNotification, { notificationObject: n }, i);
|
|
318
|
+
}
|
|
310
319
|
else if (n.type === SCNotificationTypologyType.LIVE_STREAM_STARTED) {
|
|
311
320
|
return _jsx(LiveStreamNotification, { notificationObject: n }, i);
|
|
312
321
|
}
|
|
@@ -35,6 +35,7 @@ import { PREFIX } from './constants';
|
|
|
35
35
|
import GroupNotification from '../Notification/Group';
|
|
36
36
|
import EventNotification from '../Notification/Event/Event';
|
|
37
37
|
import LiveStreamNotification from '../Notification/LiveStream';
|
|
38
|
+
import CourseNotification from '../Notification/Course';
|
|
38
39
|
const classes = {
|
|
39
40
|
root: `${PREFIX}-root`,
|
|
40
41
|
notificationsWrap: `${PREFIX}-notifications-wrap`,
|
|
@@ -268,6 +269,14 @@ export default function SnippetNotifications(inProps) {
|
|
|
268
269
|
n.type === SCNotificationTypologyType.USER_REQUESTED_TO_JOIN_EVENT) {
|
|
269
270
|
return _jsx(EventNotification, { notificationObject: n, template: SCNotificationObjectTemplateType.SNIPPET }, i);
|
|
270
271
|
}
|
|
272
|
+
else if (n.type === SCNotificationTypologyType.USER_ADDED_TO_COURSE ||
|
|
273
|
+
n.type === SCNotificationTypologyType.MANAGER_ADDED_TO_COURSE ||
|
|
274
|
+
n.type === SCNotificationTypologyType.USER_COMMENTED_A_COURSE_LESSON ||
|
|
275
|
+
n.type === SCNotificationTypologyType.USER_INVITED_TO_JOIN_COURSE ||
|
|
276
|
+
n.type === SCNotificationTypologyType.USER_ACCEPTED_TO_JOIN_COURSE ||
|
|
277
|
+
n.type === SCNotificationTypologyType.USER_REQUESTED_TO_JOIN_COURSE) {
|
|
278
|
+
return _jsx(CourseNotification, { notificationObject: n, template: SCNotificationObjectTemplateType.SNIPPET }, i);
|
|
279
|
+
}
|
|
271
280
|
else if (type === SCNotificationTypologyType.LIVE_STREAM_STARTED) {
|
|
272
281
|
content = _jsx(LiveStreamNotification, { notificationObject: n, template: SCNotificationObjectTemplateType.SNIPPET }, i);
|
|
273
282
|
}
|
|
@@ -17,7 +17,7 @@ const classes = {
|
|
|
17
17
|
const Root = styled(Autocomplete, {
|
|
18
18
|
name: PREFIX,
|
|
19
19
|
slot: 'Root',
|
|
20
|
-
overridesResolver: (
|
|
20
|
+
overridesResolver: (_props, styles) => styles.root
|
|
21
21
|
})(() => ({}));
|
|
22
22
|
/**
|
|
23
23
|
* > API documentation for the Community-JS Tag Autocomplete component. Learn about the available props and the CSS API.
|
|
@@ -73,7 +73,7 @@ const TagAutocomplete = (inProps) => {
|
|
|
73
73
|
const handleClose = () => {
|
|
74
74
|
setOpen(false);
|
|
75
75
|
};
|
|
76
|
-
const handleChange = (
|
|
76
|
+
const handleChange = (_event, newValue) => {
|
|
77
77
|
setValue(newValue);
|
|
78
78
|
};
|
|
79
79
|
// Render
|
|
@@ -25,6 +25,7 @@ import ContributionNotification from '../Notification/Contribution';
|
|
|
25
25
|
import GroupNotification from '../Notification/Group';
|
|
26
26
|
import EventNotification from '../Notification/Event/Event';
|
|
27
27
|
import LiveStreamNotification from '../Notification/LiveStream';
|
|
28
|
+
import CourseNotification from '../Notification/Course';
|
|
28
29
|
const Root = styled(Box, {
|
|
29
30
|
name: PREFIX,
|
|
30
31
|
slot: 'Root'
|
|
@@ -124,6 +125,14 @@ export default function UserToastNotifications(inProps) {
|
|
|
124
125
|
type === SCNotificationTypologyType.USER_REQUESTED_TO_JOIN_EVENT) {
|
|
125
126
|
content = _jsx(EventNotification, { notificationObject: n.notification_obj, template: SCNotificationObjectTemplateType.TOAST });
|
|
126
127
|
}
|
|
128
|
+
else if (type === SCNotificationTypologyType.USER_ADDED_TO_COURSE ||
|
|
129
|
+
type === SCNotificationTypologyType.MANAGER_ADDED_TO_COURSE ||
|
|
130
|
+
type === SCNotificationTypologyType.USER_COMMENTED_A_COURSE_LESSON ||
|
|
131
|
+
type === SCNotificationTypologyType.USER_INVITED_TO_JOIN_COURSE ||
|
|
132
|
+
type === SCNotificationTypologyType.USER_ACCEPTED_TO_JOIN_COURSE ||
|
|
133
|
+
type === SCNotificationTypologyType.USER_REQUESTED_TO_JOIN_COURSE) {
|
|
134
|
+
content = _jsx(CourseNotification, { notificationObject: n.notification_obj, template: SCNotificationObjectTemplateType.TOAST });
|
|
135
|
+
}
|
|
127
136
|
else if (type === SCNotificationTypologyType.LIVE_STREAM_STARTED) {
|
|
128
137
|
content = _jsx(LiveStreamNotification, { notificationObject: n.notification_obj, template: SCNotificationObjectTemplateType.TOAST });
|
|
129
138
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* > API documentation for the Community-JS User Profile Categories Followed Widget Skeleton component. Learn about the available props and the CSS API.
|
|
3
|
+
|
|
4
|
+
#### Import
|
|
5
|
+
|
|
6
|
+
```jsx
|
|
7
|
+
import {UserCreatedCoursesWidgetSkeleton} from '@selfcommunity/react-ui';
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
#### Component Name
|
|
11
|
+
|
|
12
|
+
The name `SCUserCategoriesFollowedWidget-skeleton-root` can be used when providing style overrides in the theme.
|
|
13
|
+
|
|
14
|
+
#### CSS
|
|
15
|
+
|
|
16
|
+
|Rule Name|Global class|Description|
|
|
17
|
+
|---|---|---|
|
|
18
|
+
|root|.SCUserCreatedCoursesWidget-skeleton-root|Styles applied to the root element.|
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
export default function UserCreatedCoursesWidgetSkeleton(props: any): JSX.Element;
|