@selfcommunity/react-ui 0.11.0-alpha.60 → 0.11.0-alpha.61
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,136 @@
|
|
|
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 lab_1 = require("@mui/lab");
|
|
6
|
+
const material_1 = require("@mui/material");
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const react_intl_1 = require("react-intl");
|
|
9
|
+
const BaseDialog_1 = tslib_1.__importDefault(require("../BaseDialog"));
|
|
10
|
+
const api_services_1 = require("@selfcommunity/api-services");
|
|
11
|
+
const Pagination_1 = require("../../constants/Pagination");
|
|
12
|
+
const utils_1 = require("@selfcommunity/utils");
|
|
13
|
+
const Errors_1 = require("../../constants/Errors");
|
|
14
|
+
const notistack_1 = require("notistack");
|
|
15
|
+
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
16
|
+
const PREFIX = 'SCAddUsersButton';
|
|
17
|
+
const classes = {
|
|
18
|
+
root: `${PREFIX}-root`,
|
|
19
|
+
dialogRoot: `${PREFIX}-dialog-root`,
|
|
20
|
+
dialogAutocompleteWrapper: `${PREFIX}-dialog-autocomplete-wrapper`,
|
|
21
|
+
dialogUserWrapper: `${PREFIX}-dialog-user-wrapper`,
|
|
22
|
+
dialogChipWrapper: `${PREFIX}-dialog-chip-wrapper`,
|
|
23
|
+
contrastColor: `${PREFIX}-contrast-color`
|
|
24
|
+
};
|
|
25
|
+
const messages = (0, react_intl_1.defineMessages)({
|
|
26
|
+
placeholder: {
|
|
27
|
+
id: 'ui.addUserButton.dialog.searchBar.placeholder',
|
|
28
|
+
defaultMessage: 'ui.addUserButton.dialog.searchBar.placeholder'
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
const Root = (0, material_1.styled)(material_1.Button, {
|
|
32
|
+
name: PREFIX,
|
|
33
|
+
slot: 'Root',
|
|
34
|
+
overridesResolver: (_props, styles) => styles.root
|
|
35
|
+
})(() => ({}));
|
|
36
|
+
const DialogRoot = (0, material_1.styled)(BaseDialog_1.default, {
|
|
37
|
+
name: PREFIX,
|
|
38
|
+
slot: 'DialogRoot',
|
|
39
|
+
overridesResolver: (_props, styles) => styles.dialogRoot
|
|
40
|
+
})(() => ({}));
|
|
41
|
+
function AddUsersButton(inProps) {
|
|
42
|
+
// PROPS
|
|
43
|
+
const props = (0, material_1.useThemeProps)({
|
|
44
|
+
props: inProps,
|
|
45
|
+
name: PREFIX
|
|
46
|
+
});
|
|
47
|
+
const { label, variant = 'outlined', color = 'inherit', size = 'small', endpoint = api_services_1.Endpoints.GetCourseSuggestedUsers, endpointQueryParams = { limit: Pagination_1.DEFAULT_PAGINATION_LIMIT, offset: Pagination_1.DEFAULT_PAGINATION_OFFSET, search: '' }, onConfirm, className } = props, rest = tslib_1.__rest(props, ["label", "variant", "color", "size", "endpoint", "endpointQueryParams", "onConfirm", "className"]);
|
|
48
|
+
// STATES
|
|
49
|
+
const [openDialog, setOpenDialog] = (0, react_1.useState)(false);
|
|
50
|
+
const [invited, setInvited] = (0, react_1.useState)([]);
|
|
51
|
+
const [suggested, setSuggested] = (0, react_1.useState)([]);
|
|
52
|
+
const [value, setValue] = (0, react_1.useState)('');
|
|
53
|
+
const [loading, setLoading] = (0, react_1.useState)(false);
|
|
54
|
+
// HOOKS
|
|
55
|
+
const intl = (0, react_intl_1.useIntl)();
|
|
56
|
+
const { enqueueSnackbar } = (0, notistack_1.useSnackbar)();
|
|
57
|
+
// CALLBACKS
|
|
58
|
+
const fetchUsers = (0, react_1.useCallback)((newValue) => {
|
|
59
|
+
setLoading(true);
|
|
60
|
+
api_services_1.http
|
|
61
|
+
.request({
|
|
62
|
+
url: endpoint.url(),
|
|
63
|
+
method: endpoint.method,
|
|
64
|
+
params: Object.assign(Object.assign({}, endpointQueryParams), { search: newValue })
|
|
65
|
+
})
|
|
66
|
+
.then((response) => {
|
|
67
|
+
setSuggested(response.data.results);
|
|
68
|
+
setLoading(false);
|
|
69
|
+
})
|
|
70
|
+
.catch((error) => {
|
|
71
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, error);
|
|
72
|
+
enqueueSnackbar((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.common.error.action", defaultMessage: "ui.common.error.action" }), {
|
|
73
|
+
variant: 'error',
|
|
74
|
+
autoHideDuration: 3000
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
}, [setLoading, endpoint, endpointQueryParams, setSuggested]);
|
|
78
|
+
// EFFECTS
|
|
79
|
+
(0, react_1.useEffect)(() => {
|
|
80
|
+
if (openDialog) {
|
|
81
|
+
fetchUsers(value);
|
|
82
|
+
}
|
|
83
|
+
}, [openDialog, value]);
|
|
84
|
+
// HANDLERS DIALOG
|
|
85
|
+
/**
|
|
86
|
+
* Handles dialog closing
|
|
87
|
+
* @param reason
|
|
88
|
+
*/
|
|
89
|
+
const handleToggleDialogOpen = (0, react_1.useCallback)(() => {
|
|
90
|
+
setOpenDialog((prev) => !prev);
|
|
91
|
+
}, [setOpenDialog]);
|
|
92
|
+
/**
|
|
93
|
+
* Handles action confirm
|
|
94
|
+
*/
|
|
95
|
+
const handleConfirm = (0, react_1.useCallback)(() => {
|
|
96
|
+
onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm(invited);
|
|
97
|
+
setInvited([]);
|
|
98
|
+
handleToggleDialogOpen();
|
|
99
|
+
}, [invited, onConfirm, handleToggleDialogOpen]);
|
|
100
|
+
// HANDLERS AUTOCOMPLETE
|
|
101
|
+
const handleInputChange = (0, react_1.useCallback)((_, newValue, reason) => {
|
|
102
|
+
switch (reason) {
|
|
103
|
+
case 'input':
|
|
104
|
+
setValue(newValue);
|
|
105
|
+
!newValue && setSuggested([]);
|
|
106
|
+
break;
|
|
107
|
+
case 'reset':
|
|
108
|
+
setValue(newValue);
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
}, [setValue, setSuggested]);
|
|
112
|
+
const filterOptions = (0, react_1.useCallback)((options, state) => {
|
|
113
|
+
return options.filter((option) => {
|
|
114
|
+
const usernameMatch = option.username.toLowerCase().includes(state.inputValue.toLowerCase());
|
|
115
|
+
const nameMatch = option.real_name.toLowerCase().includes(state.inputValue.toLowerCase());
|
|
116
|
+
return usernameMatch || nameMatch;
|
|
117
|
+
});
|
|
118
|
+
}, []);
|
|
119
|
+
const handleChange = (0, react_1.useCallback)((e, value, reason) => {
|
|
120
|
+
e.preventDefault();
|
|
121
|
+
e.stopPropagation();
|
|
122
|
+
switch (reason) {
|
|
123
|
+
case 'selectOption':
|
|
124
|
+
case 'removeOption':
|
|
125
|
+
setInvited(value);
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
}, [setInvited]);
|
|
129
|
+
const handleDelete = (0, react_1.useCallback)((userToDelete) => {
|
|
130
|
+
setInvited((prev) => prev.filter((user) => user.id !== userToDelete.id));
|
|
131
|
+
}, [setInvited]);
|
|
132
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Root, Object.assign({ onClick: handleToggleDialogOpen, variant: variant, color: color, size: size, className: (0, classnames_1.default)(classes.root, classes.contrastColor, className) }, rest, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: label, defaultMessage: label }) })), openDialog && ((0, jsx_runtime_1.jsx)(DialogRoot, Object.assign({ DialogContentProps: { dividers: false }, open: true, onClose: handleToggleDialogOpen, title: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h5" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.addUserButton.dialog.title", defaultMessage: "ui.addUserButton.dialog.title" }) })), actions: (0, jsx_runtime_1.jsx)(lab_1.LoadingButton, Object.assign({ onClick: handleConfirm, size: "medium", variant: "contained", autoFocus: true, disabled: !invited.length }, { 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.addUserButton.dialog.confirm", defaultMessage: "ui.addUserButton.dialog.confirm" }) })) })), className: classes.dialogRoot }, { children: (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.dialogAutocompleteWrapper }, { children: [(0, jsx_runtime_1.jsx)(material_1.Autocomplete, { loading: loading, size: "small", multiple: true, options: suggested, onChange: handleChange, onInputChange: handleInputChange, inputValue: value, filterOptions: filterOptions, value: invited, getOptionLabel: (option) => (option === null || option === void 0 ? void 0 : option.username) || '...', isOptionEqualToValue: (option, value) => (option === null || option === void 0 ? void 0 : option.id) === value.id, loadingText: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.addUserButton.autocomplete.loading", defaultMessage: "ui.addUserButton.autocomplete.loading" }), noOptionsText: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.addUserButton.autocomplete.noResults", defaultMessage: "ui.addUserButton.autocomplete.noResults" }), renderTags: () => null, popupIcon: null, disableClearable: true, renderOption: (props, option) => ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ component: "li", flexDirection: "row", gap: "5px" }, props, { children: [(0, jsx_runtime_1.jsx)(material_1.Avatar, { alt: option.username, src: option.avatar }), (0, jsx_runtime_1.jsx)(material_1.Typography, { children: option.username })] }))), renderInput: (params) => ((0, jsx_runtime_1.jsx)(material_1.TextField, Object.assign({}, params, { variant: "outlined", placeholder: `${intl.formatMessage(messages.placeholder)}`, InputProps: Object.assign({}, params.InputProps) }))) }), (0, jsx_runtime_1.jsx)(material_1.Stack, Object.assign({ className: classes.dialogChipWrapper }, { children: invited.map((option, index) => ((0, jsx_runtime_1.jsx)(material_1.Chip, { avatar: (0, jsx_runtime_1.jsx)(material_1.Avatar, { alt: option.username, src: option.avatar }), label: option.username, onDelete: () => {
|
|
133
|
+
handleDelete(option);
|
|
134
|
+
} }, index))) }))] })) })))] }));
|
|
135
|
+
}
|
|
136
|
+
exports.default = (0, react_1.memo)(AddUsersButton);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SCCourseType } from '@selfcommunity/types';
|
|
2
|
+
import { HTMLAttributes } from 'react';
|
|
3
|
+
export interface CourseTypePopoverProps {
|
|
4
|
+
course: SCCourseType;
|
|
5
|
+
className?: HTMLAttributes<HTMLDivElement>['className'];
|
|
6
|
+
}
|
|
7
|
+
declare function CourseTypePopover(props: CourseTypePopoverProps): JSX.Element;
|
|
8
|
+
declare const _default: import("react").MemoExoticComponent<typeof CourseTypePopover>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,48 @@
|
|
|
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 classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const react_intl_1 = require("react-intl");
|
|
9
|
+
const PREFIX = 'SCCourseTypePopover';
|
|
10
|
+
const classes = {
|
|
11
|
+
root: `${PREFIX}-root`,
|
|
12
|
+
button: `${PREFIX}-button`,
|
|
13
|
+
contrastColor: `${PREFIX}-contrast-color`
|
|
14
|
+
};
|
|
15
|
+
const Root = (0, material_1.styled)(material_1.Stack, {
|
|
16
|
+
name: PREFIX,
|
|
17
|
+
slot: 'Root',
|
|
18
|
+
overridesResolver: (_props, styles) => styles.root
|
|
19
|
+
})(() => ({}));
|
|
20
|
+
function CourseTypePopover(props) {
|
|
21
|
+
// PROPS
|
|
22
|
+
const { course, className } = props;
|
|
23
|
+
// STATES
|
|
24
|
+
const [anchorEl, setAnchorEl] = (0, react_1.useState)(null);
|
|
25
|
+
const open = Boolean(anchorEl);
|
|
26
|
+
// INTL
|
|
27
|
+
const intl = (0, react_intl_1.useIntl)();
|
|
28
|
+
// HANDLERS
|
|
29
|
+
const handleOpenPopover = (0, react_1.useCallback)((e) => {
|
|
30
|
+
setAnchorEl(e.currentTarget);
|
|
31
|
+
}, [setAnchorEl]);
|
|
32
|
+
const handlePopoverClose = (0, react_1.useCallback)(() => {
|
|
33
|
+
setAnchorEl(null);
|
|
34
|
+
}, [setAnchorEl]);
|
|
35
|
+
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, classes.contrastColor, className) }, { children: [(0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ fontSize: "small" }, { children: "courses" })), (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ variant: "text", color: "inherit", size: "small", className: classes.button, onClick: handleOpenPopover }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.course.type", defaultMessage: "ui.course.type", values: {
|
|
36
|
+
typeOfCourse: intl.formatMessage({
|
|
37
|
+
id: `ui.course.type.${course.type}`,
|
|
38
|
+
defaultMessage: `ui.course.type.${course.type}`
|
|
39
|
+
})
|
|
40
|
+
} }) })) })), open && ((0, jsx_runtime_1.jsx)(material_1.Popover, Object.assign({ open: true, anchorEl: anchorEl, anchorOrigin: {
|
|
41
|
+
vertical: 'bottom',
|
|
42
|
+
horizontal: 'left'
|
|
43
|
+
}, transformOrigin: {
|
|
44
|
+
vertical: 'top',
|
|
45
|
+
horizontal: 'left'
|
|
46
|
+
}, onClose: handlePopoverClose }, { children: (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ sx: { padding: '10px' } }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ component: "span", variant: "body2", sx: { whiteSpace: 'pre-line' } }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: `ui.courseForm.${course.type}.info`, defaultMessage: `ui.courseForm.${course.type}.info` }) })) })) })))] })));
|
|
47
|
+
}
|
|
48
|
+
exports.default = (0, react_1.memo)(CourseTypePopover);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SCCourseType, SCUserType } from '@selfcommunity/types';
|
|
3
|
+
interface ChangeUserStatusProps {
|
|
4
|
+
course: SCCourseType;
|
|
5
|
+
user: SCUserType;
|
|
6
|
+
}
|
|
7
|
+
declare function ChangeUserStatus(props: ChangeUserStatusProps): JSX.Element;
|
|
8
|
+
declare const _default: import("react").MemoExoticComponent<typeof ChangeUserStatus>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,58 @@
|
|
|
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
|
+
const lab_1 = require("@mui/lab");
|
|
8
|
+
const types_1 = require("@selfcommunity/types");
|
|
9
|
+
const api_services_1 = require("@selfcommunity/api-services");
|
|
10
|
+
const utils_1 = require("@selfcommunity/utils");
|
|
11
|
+
const Errors_1 = require("../../constants/Errors");
|
|
12
|
+
const notistack_1 = require("notistack");
|
|
13
|
+
const OPTIONS = ['ui.editCourse.tab.users.table.select.joined', 'ui.editCourse.tab.users.table.select.manager'];
|
|
14
|
+
function ChangeUserStatus(props) {
|
|
15
|
+
// PROPS
|
|
16
|
+
const { course, user } = props;
|
|
17
|
+
// STATES
|
|
18
|
+
const [value, setValue] = (0, react_1.useState)('');
|
|
19
|
+
const [loading, setLoading] = (0, react_1.useState)(false);
|
|
20
|
+
// CONTEXTS
|
|
21
|
+
const { enqueueSnackbar } = (0, notistack_1.useSnackbar)();
|
|
22
|
+
// EFFECTS
|
|
23
|
+
(0, react_1.useEffect)(() => {
|
|
24
|
+
setValue(`ui.editCourse.tab.users.table.select.${user.join_status || 'joined'}`);
|
|
25
|
+
}, [user, setValue]);
|
|
26
|
+
// HANDLERS
|
|
27
|
+
const handleChange = (0, react_1.useCallback)((e) => {
|
|
28
|
+
setLoading(true);
|
|
29
|
+
const newValue = e.target.value;
|
|
30
|
+
const data = {
|
|
31
|
+
joined: newValue.endsWith(types_1.SCCourseJoinStatusType.JOINED) ? [user.id] : undefined,
|
|
32
|
+
managers: newValue.endsWith(types_1.SCCourseJoinStatusType.MANAGER) ? [user.id] : undefined
|
|
33
|
+
};
|
|
34
|
+
api_services_1.CourseService.changeCourseUserRole(course.id, data)
|
|
35
|
+
.then(() => {
|
|
36
|
+
setValue(newValue);
|
|
37
|
+
setLoading(false);
|
|
38
|
+
enqueueSnackbar((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.courseUsersTable.changeStatus.snackbar.success", defaultMessage: "ui.courseUsersTable.changeStatus.snackbar.success" }), {
|
|
39
|
+
variant: 'success',
|
|
40
|
+
autoHideDuration: 3000
|
|
41
|
+
});
|
|
42
|
+
})
|
|
43
|
+
.catch((error) => {
|
|
44
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, error);
|
|
45
|
+
enqueueSnackbar((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.common.error.action", defaultMessage: "ui.common.error.action" }), {
|
|
46
|
+
variant: 'error',
|
|
47
|
+
autoHideDuration: 3000
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
}, [course, user, setLoading, setValue]);
|
|
51
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Select, Object.assign({ size: "small", value: value, onChange: handleChange }, { children: OPTIONS.map((option, i) => ((0, jsx_runtime_1.jsx)(material_1.MenuItem, Object.assign({ value: option }, { children: (0, jsx_runtime_1.jsx)(lab_1.LoadingButton, Object.assign({ size: "small", color: "inherit", loading: loading, disabled: loading, sx: {
|
|
52
|
+
padding: 0,
|
|
53
|
+
':hover': {
|
|
54
|
+
backgroundColor: 'unset'
|
|
55
|
+
}
|
|
56
|
+
} }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: option, defaultMessage: option }) })) })) }), i))) })));
|
|
57
|
+
}
|
|
58
|
+
exports.default = (0, react_1.memo)(ChangeUserStatus);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Dispatch } from 'react';
|
|
2
|
+
import { SCCourseType } from '@selfcommunity/types';
|
|
3
|
+
import { EndpointType } from '@selfcommunity/api-services';
|
|
4
|
+
import { SCCourseUsersTableModeType } from '../../types/course';
|
|
5
|
+
type HeaderCellsType = {
|
|
6
|
+
id?: string;
|
|
7
|
+
};
|
|
8
|
+
export interface CourseUsersTableProps {
|
|
9
|
+
state: any;
|
|
10
|
+
dispatch: Dispatch<any>;
|
|
11
|
+
course: SCCourseType;
|
|
12
|
+
endpointSearch: EndpointType;
|
|
13
|
+
endpointQueryParamsSearch?: Record<string, string | number>;
|
|
14
|
+
headerCells: HeaderCellsType[];
|
|
15
|
+
mode: SCCourseUsersTableModeType;
|
|
16
|
+
emptyStatusTitle: string;
|
|
17
|
+
emptyStatusDescription?: string;
|
|
18
|
+
}
|
|
19
|
+
declare function CourseUsersTable(inProps: CourseUsersTableProps): JSX.Element;
|
|
20
|
+
declare const _default: import("react").MemoExoticComponent<typeof CourseUsersTable>;
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,155 @@
|
|
|
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_1 = require("react");
|
|
7
|
+
const react_intl_1 = require("react-intl");
|
|
8
|
+
const RowSkeleton_1 = tslib_1.__importDefault(require("./RowSkeleton"));
|
|
9
|
+
const lab_1 = require("@mui/lab");
|
|
10
|
+
const types_1 = require("@selfcommunity/types");
|
|
11
|
+
const constants_1 = require("./constants");
|
|
12
|
+
const EmptyStatus_1 = tslib_1.__importDefault(require("../EmptyStatus"));
|
|
13
|
+
const SeeProgressButton_1 = tslib_1.__importDefault(require("./SeeProgressButton"));
|
|
14
|
+
const Skeleton_1 = tslib_1.__importDefault(require("./Skeleton"));
|
|
15
|
+
const widget_1 = require("../../utils/widget");
|
|
16
|
+
const api_services_1 = require("@selfcommunity/api-services");
|
|
17
|
+
const utils_1 = require("@selfcommunity/utils");
|
|
18
|
+
const Errors_1 = require("../../constants/Errors");
|
|
19
|
+
const ChangeUsersStatus_1 = tslib_1.__importDefault(require("./ChangeUsersStatus"));
|
|
20
|
+
const react_core_1 = require("@selfcommunity/react-core");
|
|
21
|
+
const RequestButton_1 = tslib_1.__importDefault(require("./RequestButton"));
|
|
22
|
+
const course_1 = require("../../types/course");
|
|
23
|
+
const RemoveButton_1 = tslib_1.__importDefault(require("./RemoveButton"));
|
|
24
|
+
const ConfirmDialog_1 = tslib_1.__importDefault(require("../ConfirmDialog/ConfirmDialog"));
|
|
25
|
+
const course_2 = require("../../types/course");
|
|
26
|
+
const classes = {
|
|
27
|
+
root: `${constants_1.PREFIX}-root`,
|
|
28
|
+
search: `${constants_1.PREFIX}-search`,
|
|
29
|
+
endAdornmentWrapper: `${constants_1.PREFIX}-end-adornment-wrapper`,
|
|
30
|
+
searchButton: `${constants_1.PREFIX}-search-button`,
|
|
31
|
+
avatarWrapper: `${constants_1.PREFIX}-avatar-wrapper`,
|
|
32
|
+
progressWrapper: `${constants_1.PREFIX}-progress-wrapper`,
|
|
33
|
+
progress: `${constants_1.PREFIX}-progress`,
|
|
34
|
+
loadingButton: `${constants_1.PREFIX}-loading-button`
|
|
35
|
+
};
|
|
36
|
+
const Root = (0, material_1.styled)(material_1.Box, {
|
|
37
|
+
name: constants_1.PREFIX,
|
|
38
|
+
slot: 'Root',
|
|
39
|
+
overridesResolver: (_props, styles) => styles.root
|
|
40
|
+
})(() => ({}));
|
|
41
|
+
function CourseUsersTable(inProps) {
|
|
42
|
+
// PROPS
|
|
43
|
+
const props = (0, material_1.useThemeProps)({
|
|
44
|
+
props: inProps,
|
|
45
|
+
name: constants_1.PREFIX
|
|
46
|
+
});
|
|
47
|
+
const { state, dispatch, course, endpointSearch, endpointQueryParamsSearch = { statuses: JSON.stringify([types_1.SCCourseJoinStatusType.JOINED, types_1.SCCourseJoinStatusType.MANAGER]) }, headerCells, mode, emptyStatusTitle, emptyStatusDescription } = props;
|
|
48
|
+
// STATES
|
|
49
|
+
const [users, setUsers] = (0, react_1.useState)(null);
|
|
50
|
+
const [loadingSearch, setLoadingSearch] = (0, react_1.useState)(false);
|
|
51
|
+
const [value, setValue] = (0, react_1.useState)('');
|
|
52
|
+
const [dialog, setDialog] = (0, react_1.useState)(null);
|
|
53
|
+
// REFS
|
|
54
|
+
const buttonRef = (0, react_1.useRef)(null);
|
|
55
|
+
const inputRef = (0, react_1.useRef)(null);
|
|
56
|
+
// CONTEXTS
|
|
57
|
+
const scUserContext = (0, react_core_1.useSCUser)();
|
|
58
|
+
// INTL
|
|
59
|
+
const intl = (0, react_intl_1.useIntl)();
|
|
60
|
+
// HANDLERS
|
|
61
|
+
const handleNext = (0, react_1.useCallback)(() => {
|
|
62
|
+
dispatch({ type: widget_1.actionWidgetTypes.LOADING_NEXT });
|
|
63
|
+
api_services_1.http
|
|
64
|
+
.request({
|
|
65
|
+
url: state.next,
|
|
66
|
+
method: 'GET'
|
|
67
|
+
})
|
|
68
|
+
.then((res) => {
|
|
69
|
+
dispatch({ type: widget_1.actionWidgetTypes.LOAD_NEXT_SUCCESS, payload: res.data });
|
|
70
|
+
})
|
|
71
|
+
.catch((error) => {
|
|
72
|
+
dispatch({ type: widget_1.actionWidgetTypes.LOAD_NEXT_FAILURE, payload: { errorLoadNext: error } });
|
|
73
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, error);
|
|
74
|
+
});
|
|
75
|
+
}, [state.next, dispatch]);
|
|
76
|
+
const handleOpenDialog = (0, react_1.useCallback)((tab) => {
|
|
77
|
+
setDialog(tab);
|
|
78
|
+
}, [setDialog]);
|
|
79
|
+
const handleConfirm = (0, react_1.useCallback)(() => {
|
|
80
|
+
switch (dialog.tab) {
|
|
81
|
+
case course_2.SCCourseEditTabType.USERS:
|
|
82
|
+
buttonRef.current.handleManageUser(dialog.user);
|
|
83
|
+
break;
|
|
84
|
+
case course_2.SCCourseEditTabType.REQUESTS:
|
|
85
|
+
buttonRef.current.handleManageUser(dialog.request);
|
|
86
|
+
}
|
|
87
|
+
handleOpenDialog(null);
|
|
88
|
+
}, [dialog, handleOpenDialog]);
|
|
89
|
+
const handleSearchClear = (0, react_1.useCallback)(() => {
|
|
90
|
+
setUsers(state.results);
|
|
91
|
+
setValue('');
|
|
92
|
+
}, [setValue, setUsers, state.results]);
|
|
93
|
+
const handleChange = (0, react_1.useCallback)((e) => {
|
|
94
|
+
const _value = e.target.value;
|
|
95
|
+
if (_value.length === 0) {
|
|
96
|
+
handleSearchClear();
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
setValue(_value);
|
|
100
|
+
}
|
|
101
|
+
}, [setValue, handleSearchClear]);
|
|
102
|
+
const handleSearchStart = (0, react_1.useCallback)(() => {
|
|
103
|
+
setLoadingSearch(true);
|
|
104
|
+
api_services_1.http
|
|
105
|
+
.request({
|
|
106
|
+
url: endpointSearch.url(),
|
|
107
|
+
method: endpointSearch.method,
|
|
108
|
+
params: Object.assign(Object.assign({}, endpointQueryParamsSearch), { search: value })
|
|
109
|
+
})
|
|
110
|
+
.then((res) => {
|
|
111
|
+
setUsers(res.data.results);
|
|
112
|
+
setLoadingSearch(false);
|
|
113
|
+
})
|
|
114
|
+
.catch((error) => {
|
|
115
|
+
dispatch({ type: widget_1.actionWidgetTypes.LOAD_NEXT_FAILURE, payload: { errorLoadNext: error } });
|
|
116
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, error);
|
|
117
|
+
});
|
|
118
|
+
}, [value, endpointSearch, setUsers, setLoadingSearch, dispatch]);
|
|
119
|
+
const handleKeyUp = (0, react_1.useCallback)((e) => {
|
|
120
|
+
if (value.length > 0 && e.key === 'Enter') {
|
|
121
|
+
handleSearchStart();
|
|
122
|
+
}
|
|
123
|
+
}, [value, handleSearchStart]);
|
|
124
|
+
// EFFECTS
|
|
125
|
+
(0, react_1.useEffect)(() => {
|
|
126
|
+
setUsers(state.results);
|
|
127
|
+
}, [state.results, setUsers]);
|
|
128
|
+
(0, react_1.useEffect)(() => {
|
|
129
|
+
var _a;
|
|
130
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('keyup', handleKeyUp);
|
|
131
|
+
return () => {
|
|
132
|
+
var _a;
|
|
133
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('keyup', handleKeyUp);
|
|
134
|
+
};
|
|
135
|
+
}, [handleKeyUp]);
|
|
136
|
+
if (!users) {
|
|
137
|
+
return (0, jsx_runtime_1.jsx)(Skeleton_1.default, {});
|
|
138
|
+
}
|
|
139
|
+
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: classes.root }, { children: [(0, jsx_runtime_1.jsx)(material_1.TextField, { ref: inputRef, placeholder: intl.formatMessage({
|
|
140
|
+
id: 'ui.courseUsersTable.searchBar.placeholder',
|
|
141
|
+
defaultMessage: 'ui.courseUsersTable.searchBar.placeholder'
|
|
142
|
+
}), InputProps: {
|
|
143
|
+
startAdornment: ((0, jsx_runtime_1.jsx)(material_1.InputAdornment, Object.assign({ position: "start" }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "search" }) }))),
|
|
144
|
+
endAdornment: value.length > 0 ? ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.endAdornmentWrapper }, { children: [(0, jsx_runtime_1.jsx)(material_1.InputAdornment, Object.assign({ position: "start" }, { children: (0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ color: "inherit", onClick: handleSearchClear }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "close" }) })) })), (0, jsx_runtime_1.jsx)(material_1.InputAdornment, Object.assign({ position: "end" }, { children: (0, jsx_runtime_1.jsx)(lab_1.LoadingButton, Object.assign({ color: "primary", variant: "contained", onClick: handleSearchStart, loading: loadingSearch, disabled: loadingSearch, className: classes.searchButton }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "search" }) })) }))] }))) : undefined
|
|
145
|
+
}, value: value, onChange: handleChange, disabled: users.length === 0 && value.length === 0, fullWidth: true, className: classes.search }), (0, jsx_runtime_1.jsx)(material_1.TableContainer, { children: (0, jsx_runtime_1.jsxs)(material_1.Table, { children: [(0, jsx_runtime_1.jsx)(material_1.TableHead, { children: (0, jsx_runtime_1.jsx)(material_1.TableRow, { children: headerCells.map((cell, i, array) => {
|
|
146
|
+
if (i === array.length - 1) {
|
|
147
|
+
return (0, jsx_runtime_1.jsx)(material_1.TableCell, { width: "14%" }, i);
|
|
148
|
+
}
|
|
149
|
+
return ((0, jsx_runtime_1.jsx)(material_1.TableCell, Object.assign({ width: mode === course_1.SCCourseUsersTableModeType.DASHBOARD ? '20%' : '25%' }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: cell.id, defaultMessage: cell.id }) })) }), i));
|
|
150
|
+
}) }) }), (0, jsx_runtime_1.jsxs)(material_1.TableBody, { children: [users.length > 0 &&
|
|
151
|
+
users.map((user, i) => ((0, jsx_runtime_1.jsxs)(material_1.TableRow, { children: [(0, jsx_runtime_1.jsx)(material_1.TableCell, { children: (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.avatarWrapper }, { children: [(0, jsx_runtime_1.jsx)(material_1.Avatar, { alt: user.username, src: user.avatar }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: user.username }))] })) }), mode === course_1.SCCourseUsersTableModeType.DASHBOARD && ((0, jsx_runtime_1.jsx)(material_1.TableCell, { children: (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.progressWrapper }, { children: [(0, jsx_runtime_1.jsx)(material_1.LinearProgress, { className: classes.progress, variant: "determinate", value: user.user_completion_rate }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: `${Math.round(user.user_completion_rate)}%` }))] })) })), mode === course_1.SCCourseUsersTableModeType.EDIT && ((0, jsx_runtime_1.jsx)(material_1.TableCell, { children: user.join_status !== types_1.SCCourseJoinStatusType.CREATOR && scUserContext.user.id !== user.id ? ((0, jsx_runtime_1.jsx)(ChangeUsersStatus_1.default, { course: course, user: user })) : ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: `ui.editCourse.tab.users.table.select.${user.join_status}`, defaultMessage: `ui.editCourse.tab.users.table.select.${user.join_status}` }) }))) })), (0, jsx_runtime_1.jsx)(material_1.TableCell, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedDate, { value: mode === course_1.SCCourseUsersTableModeType.REQUESTS ? user.date_joined : user.joined_at || new Date() }) })) }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedDate, { value: mode === course_1.SCCourseUsersTableModeType.REQUESTS ? user.date_joined : user.last_active_at || new Date() }) })) }), mode === course_1.SCCourseUsersTableModeType.EDIT &&
|
|
152
|
+
user.join_status !== types_1.SCCourseJoinStatusType.CREATOR &&
|
|
153
|
+
scUserContext.user.id !== user.id ? ((0, jsx_runtime_1.jsx)(material_1.TableCell, { children: (0, jsx_runtime_1.jsx)(RemoveButton_1.default, { ref: buttonRef, course: course, user: user, handleOpenDialog: handleOpenDialog }) })) : (mode === course_1.SCCourseUsersTableModeType.EDIT && (0, jsx_runtime_1.jsx)(material_1.TableCell, {})), mode === course_1.SCCourseUsersTableModeType.DASHBOARD && ((0, jsx_runtime_1.jsx)(material_1.TableCell, { children: (0, jsx_runtime_1.jsx)(SeeProgressButton_1.default, { course: course, user: user }) })), mode === course_1.SCCourseUsersTableModeType.REQUESTS && ((0, jsx_runtime_1.jsx)(material_1.TableCell, { children: (0, jsx_runtime_1.jsx)(RequestButton_1.default, { ref: buttonRef, course: course, user: user, handleOpenDialog: handleOpenDialog }) }))] }, i))), state.isLoadingNext && (0, jsx_runtime_1.jsx)(RowSkeleton_1.default, { editMode: mode !== course_1.SCCourseUsersTableModeType.DASHBOARD })] })] }) }), users.length > 0 && ((0, jsx_runtime_1.jsx)(lab_1.LoadingButton, Object.assign({ size: "small", variant: "outlined", color: "inherit", loading: state.isLoadingNext, disabled: value.length > 0 || !state.next, className: classes.loadingButton, onClick: handleNext }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.courseUsersTable.btn.label", defaultMessage: "ui.courseUsersTable.btn.label" }) })) }))), users.length === 0 && ((0, jsx_runtime_1.jsx)(EmptyStatus_1.default, { icon: "face", title: value.length > 0 ? 'ui.courseUsersTable.empty.search.title' : emptyStatusTitle, description: value.length > 0 ? 'ui.courseUsersTable.empty.search.description' : emptyStatusDescription })), dialog && (0, jsx_runtime_1.jsx)(ConfirmDialog_1.default, { open: true, onClose: () => handleOpenDialog(null), onConfirm: handleConfirm })] })));
|
|
154
|
+
}
|
|
155
|
+
exports.default = (0, react_1.memo)(CourseUsersTable);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SCCourseType, SCUserType } from '@selfcommunity/types';
|
|
3
|
+
import { SCCourseEditManageUserProps, SCCourseEditManageUserRef } from '../../types/course';
|
|
4
|
+
interface RemoveButtonProps {
|
|
5
|
+
course: SCCourseType;
|
|
6
|
+
user: SCUserType;
|
|
7
|
+
handleOpenDialog: (tab: SCCourseEditManageUserProps) => void;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<RemoveButtonProps & import("react").RefAttributes<SCCourseEditManageUserRef>>>;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,51 @@
|
|
|
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 lab_1 = require("@mui/lab");
|
|
6
|
+
const material_1 = require("@mui/material");
|
|
7
|
+
const api_services_1 = require("@selfcommunity/api-services");
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const Errors_1 = require("../../constants/Errors");
|
|
10
|
+
const utils_1 = require("@selfcommunity/utils");
|
|
11
|
+
const react_intl_1 = require("react-intl");
|
|
12
|
+
const notistack_1 = require("notistack");
|
|
13
|
+
const pubsub_js_1 = tslib_1.__importDefault(require("pubsub-js"));
|
|
14
|
+
const PubSub_1 = require("../../constants/PubSub");
|
|
15
|
+
const course_1 = require("../../types/course");
|
|
16
|
+
function RemoveButton(props, ref) {
|
|
17
|
+
// PROPS
|
|
18
|
+
const { course, user, handleOpenDialog } = props;
|
|
19
|
+
// STATES
|
|
20
|
+
const [loading, setLoading] = (0, react_1.useState)(false);
|
|
21
|
+
// HOOKS
|
|
22
|
+
const { enqueueSnackbar } = (0, notistack_1.useSnackbar)();
|
|
23
|
+
// HANDLERS
|
|
24
|
+
const handleSubmit = (0, react_1.useCallback)((userToRemove) => {
|
|
25
|
+
setLoading(true);
|
|
26
|
+
const params = {
|
|
27
|
+
user: userToRemove.id
|
|
28
|
+
};
|
|
29
|
+
api_services_1.CourseService.leaveOrRemoveCourseRequest(course.id, params)
|
|
30
|
+
.then(() => {
|
|
31
|
+
setLoading(false);
|
|
32
|
+
pubsub_js_1.default.publish(`${PubSub_1.SCTopicType.COURSE}.${PubSub_1.SCCourseEventType.REMOVE_MEMBER}`, userToRemove);
|
|
33
|
+
enqueueSnackbar((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.editCourse.tab.users.table.snackbar.removed", defaultMessage: "ui.editCourse.tab.users.table.snackbar.removed" }), {
|
|
34
|
+
variant: 'success',
|
|
35
|
+
autoHideDuration: 3000
|
|
36
|
+
});
|
|
37
|
+
})
|
|
38
|
+
.catch((error) => {
|
|
39
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, error);
|
|
40
|
+
enqueueSnackbar((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.common.error.action", defaultMessage: "ui.common.error.action" }), {
|
|
41
|
+
variant: 'error',
|
|
42
|
+
autoHideDuration: 3000
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
}, [course, setLoading]);
|
|
46
|
+
(0, react_1.useImperativeHandle)(ref, () => ({
|
|
47
|
+
handleManageUser: (userToRemove) => handleSubmit(userToRemove)
|
|
48
|
+
}), [handleSubmit]);
|
|
49
|
+
return ((0, jsx_runtime_1.jsx)(lab_1.LoadingButton, Object.assign({ size: "small", color: "inherit", variant: "outlined", onClick: () => handleOpenDialog({ tab: course_1.SCCourseEditTabType.USERS, user }), loading: loading, disabled: loading }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "close" }) })));
|
|
50
|
+
}
|
|
51
|
+
exports.default = (0, react_1.memo)((0, react_1.forwardRef)(RemoveButton));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SCCourseType, SCUserType } from '@selfcommunity/types';
|
|
3
|
+
import { SCCourseEditManageUserProps, SCCourseEditManageUserRef } from '../../types/course';
|
|
4
|
+
interface RequestButtonProps {
|
|
5
|
+
course: SCCourseType;
|
|
6
|
+
user: SCUserType;
|
|
7
|
+
handleOpenDialog: (tab: SCCourseEditManageUserProps) => void;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<RequestButtonProps & import("react").RefAttributes<SCCourseEditManageUserRef>>>;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,79 @@
|
|
|
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 lab_1 = require("@mui/lab");
|
|
6
|
+
const material_1 = require("@mui/material");
|
|
7
|
+
const api_services_1 = require("@selfcommunity/api-services");
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const Errors_1 = require("../../constants/Errors");
|
|
10
|
+
const utils_1 = require("@selfcommunity/utils");
|
|
11
|
+
const react_intl_1 = require("react-intl");
|
|
12
|
+
const notistack_1 = require("notistack");
|
|
13
|
+
const constants_1 = require("./constants");
|
|
14
|
+
const pubsub_js_1 = tslib_1.__importDefault(require("pubsub-js"));
|
|
15
|
+
const PubSub_1 = require("../../constants/PubSub");
|
|
16
|
+
const course_1 = require("../../types/course");
|
|
17
|
+
const classes = {
|
|
18
|
+
requestButtonWrapper: `${constants_1.PREFIX}-request-button-wrapper`
|
|
19
|
+
};
|
|
20
|
+
function RequestButton(props, ref) {
|
|
21
|
+
// PROPS
|
|
22
|
+
const { course, user, handleOpenDialog } = props;
|
|
23
|
+
// STATES
|
|
24
|
+
const [acceptLoading, setAcceptLoading] = (0, react_1.useState)(false);
|
|
25
|
+
const [rejectLoading, setRejectLoading] = (0, react_1.useState)(false);
|
|
26
|
+
// HOOKS
|
|
27
|
+
const { enqueueSnackbar } = (0, notistack_1.useSnackbar)();
|
|
28
|
+
// HANDLERS
|
|
29
|
+
const handleAccept = (0, react_1.useCallback)(() => {
|
|
30
|
+
setAcceptLoading(true);
|
|
31
|
+
const data = {
|
|
32
|
+
users: [user.id]
|
|
33
|
+
};
|
|
34
|
+
api_services_1.CourseService.inviteOrAcceptUsersToCourse(course.id, data)
|
|
35
|
+
.then(() => {
|
|
36
|
+
setAcceptLoading(false);
|
|
37
|
+
pubsub_js_1.default.publish(`${PubSub_1.SCTopicType.COURSE}.${PubSub_1.SCCourseEventType.ADD_MEMBER}`, user);
|
|
38
|
+
pubsub_js_1.default.publish(`${PubSub_1.SCTopicType.COURSE}.${PubSub_1.SCCourseEventType.REJECT_MEMBER}`, user);
|
|
39
|
+
enqueueSnackbar((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.editCourse.tab.requests.table.snackbar.accepted", defaultMessage: "ui.editCourse.tab.requests.table.snackbar.accepted" }), {
|
|
40
|
+
variant: 'success',
|
|
41
|
+
autoHideDuration: 3000
|
|
42
|
+
});
|
|
43
|
+
})
|
|
44
|
+
.catch((error) => {
|
|
45
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, error);
|
|
46
|
+
enqueueSnackbar((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.common.error.action", defaultMessage: "ui.common.error.action" }), {
|
|
47
|
+
variant: 'error',
|
|
48
|
+
autoHideDuration: 3000
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
}, [course, user, setAcceptLoading]);
|
|
52
|
+
const handleReject = (0, react_1.useCallback)((userToReject) => {
|
|
53
|
+
setRejectLoading(true);
|
|
54
|
+
const params = {
|
|
55
|
+
user: userToReject.id
|
|
56
|
+
};
|
|
57
|
+
api_services_1.CourseService.leaveOrRemoveCourseRequest(course.id, params)
|
|
58
|
+
.then(() => {
|
|
59
|
+
setRejectLoading(false);
|
|
60
|
+
pubsub_js_1.default.publish(`${PubSub_1.SCTopicType.COURSE}.${PubSub_1.SCCourseEventType.REJECT_MEMBER}`, userToReject);
|
|
61
|
+
enqueueSnackbar((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.editCourse.tab.requests.table.snackbar.rejected", defaultMessage: "ui.editCourse.tab.requests.table.snackbar.rejected" }), {
|
|
62
|
+
variant: 'success',
|
|
63
|
+
autoHideDuration: 3000
|
|
64
|
+
});
|
|
65
|
+
})
|
|
66
|
+
.catch((error) => {
|
|
67
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, error);
|
|
68
|
+
enqueueSnackbar((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.common.error.action", defaultMessage: "ui.common.error.action" }), {
|
|
69
|
+
variant: 'error',
|
|
70
|
+
autoHideDuration: 3000
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
}, [course, setRejectLoading]);
|
|
74
|
+
(0, react_1.useImperativeHandle)(ref, () => ({
|
|
75
|
+
handleManageUser: (userToReject) => handleReject(userToReject)
|
|
76
|
+
}), [handleReject]);
|
|
77
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.requestButtonWrapper }, { children: [(0, jsx_runtime_1.jsx)(lab_1.LoadingButton, Object.assign({ size: "small", color: "primary", variant: "outlined", onClick: handleAccept, loading: acceptLoading, disabled: acceptLoading }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "check" }) })), (0, jsx_runtime_1.jsx)(lab_1.LoadingButton, Object.assign({ size: "small", color: "inherit", variant: "outlined", onClick: () => handleOpenDialog({ tab: course_1.SCCourseEditTabType.REQUESTS, request: user }), loading: rejectLoading, disabled: rejectLoading }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "close" }) }))] })));
|
|
78
|
+
}
|
|
79
|
+
exports.default = (0, react_1.memo)((0, react_1.forwardRef)(RequestButton));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SkeletonOwnProps } from '@mui/material';
|
|
2
|
+
interface CourseUsersTableRowSkeletonProps {
|
|
3
|
+
header?: boolean;
|
|
4
|
+
animation?: SkeletonOwnProps['animation'];
|
|
5
|
+
editMode?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export default function CourseUsersTableRowSkeleton(props: CourseUsersTableRowSkeletonProps): JSX.Element;
|
|
8
|
+
export {};
|