@selfcommunity/react-ui 0.11.0-mui7.16 → 0.11.0-mui7.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/components/AcceptRequestUserEventButton/AcceptRequestUserEventButton.js +1 -2
- package/lib/cjs/components/AcceptRequestUserGroupButton/AcceptRequestUserGroupButton.js +1 -2
- package/lib/cjs/components/AccountDataPortability/AccountDataPortability.js +4 -9
- package/lib/cjs/components/AccountDelete/AccountDelete.js +2 -9
- package/lib/cjs/components/BuyButton/BuyButton.js +1 -2
- package/lib/cjs/components/Categories/Categories.js +1 -1
- package/lib/cjs/components/Categories/Skeleton.js +1 -1
- package/lib/cjs/components/CategoryFollowButton/CategoryFollowButton.js +3 -4
- package/lib/cjs/components/ChangeGroupCover/ChangeGroupCover.js +1 -2
- package/lib/cjs/components/ChangeGroupPicture/ChangeGroupPicture.js +1 -2
- package/lib/cjs/components/Checkout/Skeleton.js +1 -1
- package/lib/cjs/components/CommentObjectReply/CommentObjectReply.js +1 -2
- package/lib/cjs/components/CommunityPaywalls/CommunityPaywalls.js +1 -1
- package/lib/cjs/components/Composer/Composer.js +1 -2
- package/lib/cjs/components/Composer/Content/ContentPoll/ContentPoll.js +4 -4
- package/lib/cjs/components/Composer/Layer/ScheduledLayer/ScheduledLayer.js +5 -5
- package/lib/cjs/components/CourseDashboard/Student/ActionButton.d.ts +1 -2
- package/lib/cjs/components/CourseDashboard/Student/ActionButton.js +1 -2
- package/lib/cjs/components/CourseDashboard/Teacher/Comments.js +1 -2
- package/lib/cjs/components/CourseForm/CourseForm.js +1 -2
- package/lib/cjs/components/CourseForm/UploadCourseCover.js +1 -2
- package/lib/cjs/components/CourseJoinButton/CourseJoinButton.js +3 -4
- package/lib/cjs/components/Courses/Courses.js +3 -3
- package/lib/cjs/components/Courses/Skeleton.js +1 -1
- package/lib/cjs/components/CreatePaymentProductForm/CreatePaymentProductForm.js +1 -2
- package/lib/cjs/components/EditCourse/Lessons/ChangeLessonStatus.js +2 -3
- package/lib/cjs/components/EditCourse/Lessons/FieldName.js +1 -2
- package/lib/cjs/components/EditCourse/Options.js +1 -2
- package/lib/cjs/components/EventForm/EventForm.js +5 -6
- package/lib/cjs/components/EventForm/UploadEventCover.js +1 -2
- package/lib/cjs/components/EventInviteButton/EventInviteButton.js +1 -2
- package/lib/cjs/components/EventMediaWidget/EventMediaWidget.js +1 -2
- package/lib/cjs/components/EventMediaWidget/TriggerButton.d.ts +2 -2
- package/lib/cjs/components/EventMediaWidget/TriggerButton.js +1 -2
- package/lib/cjs/components/EventSubscribeButton/EventSubscribeButton.js +1 -2
- package/lib/cjs/components/Events/Events.js +4 -4
- package/lib/cjs/components/Events/Skeleton.js +1 -1
- package/lib/cjs/components/Feed/Feed.js +1 -1
- package/lib/cjs/components/Feed/Skeleton.js +1 -1
- package/lib/cjs/components/FeedObject/Actions/Follow/Follow.js +2 -3
- package/lib/cjs/components/FeedObject/Actions/Share/Share.js +1 -2
- package/lib/cjs/components/FeedObject/Poll/Choice/Choice.js +1 -2
- package/lib/cjs/components/FollowUserButton/FollowUserButton.js +1 -2
- package/lib/cjs/components/FriendshipUserButton/FriendshipUserButton.js +2 -3
- package/lib/cjs/components/GroupForm/GroupForm.js +1 -2
- package/lib/cjs/components/GroupInviteButton/GroupInviteButton.js +1 -2
- package/lib/cjs/components/GroupSubscribeButton/GroupSubscribeButton.js +3 -4
- package/lib/cjs/components/Groups/Groups.js +2 -2
- package/lib/cjs/components/Groups/Skeleton.js +1 -1
- package/lib/cjs/components/IncubatorListWidget/CreateIncubatorDialog/CreateIncubatorDialog.js +2 -3
- package/lib/cjs/components/IncubatorSubscribeButton/IncubatorSubscribeButton.js +3 -4
- package/lib/cjs/components/InviteUserEventButton/InviteUserEventButton.js +1 -2
- package/lib/cjs/components/LessonAppbar/LessonAppbar.js +3 -4
- package/lib/cjs/components/LessonEditForm/LessonEditForm.js +1 -2
- package/lib/cjs/components/LessonReleaseMenu/LessonReleaseMenu.js +3 -3
- package/lib/cjs/components/LiveStreamForm/LiveStreamForm.js +1 -2
- package/lib/cjs/components/Notification/Course/Course.js +1 -6
- package/lib/cjs/components/Notification/Event/Event.js +3 -8
- package/lib/cjs/components/Notification/Group/Group.js +1 -2
- package/lib/cjs/components/Notification/LiveStream/LiveStream.js +1 -6
- package/lib/cjs/components/Notification/Notification.js +13 -5
- package/lib/cjs/components/Notification/PrivateMessage/PrivateMessage.js +1 -2
- package/lib/cjs/components/OnBoardingWidget/Steps/Appearance/Appearance.js +3 -4
- package/lib/cjs/components/PaymentOrders/PaymentOrders.js +5 -6
- package/lib/cjs/components/PaymentProducts/Skeleton.js +1 -1
- package/lib/cjs/components/Paywalls/Skeleton.js +1 -1
- package/lib/cjs/components/PaywallsConfigurator/Skeleton.js +1 -1
- package/lib/cjs/components/PdfPreviewDialog/PdfPreviewDialog.js +1 -1
- package/lib/cjs/components/PlatformWidget/Skeleton.js +1 -1
- package/lib/cjs/components/PrivateMessageComponent/PrivateMessageComponent.js +2 -2
- package/lib/cjs/components/PrivateMessageComponent/Skeleton.js +1 -1
- package/lib/cjs/components/UserAddPaymentMethodForm/UserAddPaymentMethodForm.js +2 -4
- package/lib/cjs/components/UserBillingInfo/Skeleton.js +1 -1
- package/lib/cjs/components/UserBillingInfo/UserBillingInfo.js +8 -9
- package/lib/cjs/components/UserChangeAddressDialog/UserChangeAddressDialog.js +1 -2
- package/lib/cjs/components/UserProfileBlocked/UserProfileBlocked.js +1 -2
- package/lib/cjs/components/UserProfileEdit/Section/AccountCredentials.js +1 -2
- package/lib/cjs/components/UserProfileEdit/Section/PublicInfo.js +4 -5
- package/lib/cjs/components/VoteAudienceButton/VoteAudienceButton.d.ts +2 -2
- package/lib/cjs/components/VoteAudienceButton/VoteAudienceButton.js +4 -5
- package/lib/cjs/components/VoteButton/VoteButton.d.ts +2 -2
- package/lib/cjs/components/VoteButton/VoteButton.js +2 -3
- package/lib/cjs/shared/AddUsersButton/AddUsersButton.js +1 -2
- package/lib/cjs/shared/ConfirmDialog/ConfirmDialog.js +1 -2
- package/lib/cjs/shared/CourseUsersTable/ChangeUsersStatus.js +1 -2
- package/lib/cjs/shared/CourseUsersTable/CourseUsersTable.js +2 -3
- package/lib/cjs/shared/CourseUsersTable/RemoveButton.js +1 -2
- package/lib/cjs/shared/CourseUsersTable/RequestButton.js +1 -2
- package/lib/cjs/shared/HiddenPurchasableContent/HiddenPurchasableContent.js +3 -4
- package/lib/cjs/shared/Media/File/DisplayComponent.js +2 -2
- package/lib/cjs/shared/ScrollContainer/index.js +2 -2
- package/lib/cjs/shared/VirtualizedScroller/VirtualizedScroller.d.ts +1 -1
- package/lib/esm/components/AcceptRequestUserEventButton/AcceptRequestUserEventButton.js +2 -3
- package/lib/esm/components/AcceptRequestUserGroupButton/AcceptRequestUserGroupButton.js +2 -3
- package/lib/esm/components/AccountDataPortability/AccountDataPortability.js +5 -10
- package/lib/esm/components/AccountDelete/AccountDelete.js +3 -10
- package/lib/esm/components/BuyButton/BuyButton.js +2 -3
- package/lib/esm/components/Categories/Categories.js +1 -1
- package/lib/esm/components/Categories/Skeleton.js +1 -1
- package/lib/esm/components/CategoryFollowButton/CategoryFollowButton.js +4 -5
- package/lib/esm/components/ChangeGroupCover/ChangeGroupCover.js +2 -3
- package/lib/esm/components/ChangeGroupPicture/ChangeGroupPicture.js +2 -3
- package/lib/esm/components/Checkout/Skeleton.js +1 -1
- package/lib/esm/components/CommentObjectReply/CommentObjectReply.js +2 -3
- package/lib/esm/components/CommunityPaywalls/CommunityPaywalls.js +1 -1
- package/lib/esm/components/Composer/Composer.js +2 -3
- package/lib/esm/components/Composer/Content/ContentPoll/ContentPoll.js +4 -4
- package/lib/esm/components/Composer/Layer/ScheduledLayer/ScheduledLayer.js +6 -6
- package/lib/esm/components/CourseDashboard/Student/ActionButton.d.ts +1 -2
- package/lib/esm/components/CourseDashboard/Student/ActionButton.js +1 -2
- package/lib/esm/components/CourseDashboard/Teacher/Comments.js +1 -2
- package/lib/esm/components/CourseForm/CourseForm.js +2 -3
- package/lib/esm/components/CourseForm/UploadCourseCover.js +2 -3
- package/lib/esm/components/CourseJoinButton/CourseJoinButton.js +4 -5
- package/lib/esm/components/Courses/Courses.js +3 -3
- package/lib/esm/components/Courses/Skeleton.js +1 -1
- package/lib/esm/components/CreatePaymentProductForm/CreatePaymentProductForm.js +1 -2
- package/lib/esm/components/EditCourse/Lessons/ChangeLessonStatus.js +3 -4
- package/lib/esm/components/EditCourse/Lessons/FieldName.js +2 -3
- package/lib/esm/components/EditCourse/Options.js +2 -3
- package/lib/esm/components/EventForm/EventForm.js +6 -7
- package/lib/esm/components/EventForm/UploadEventCover.js +2 -3
- package/lib/esm/components/EventInviteButton/EventInviteButton.js +1 -2
- package/lib/esm/components/EventMediaWidget/EventMediaWidget.js +1 -2
- package/lib/esm/components/EventMediaWidget/TriggerButton.d.ts +2 -2
- package/lib/esm/components/EventMediaWidget/TriggerButton.js +2 -3
- package/lib/esm/components/EventSubscribeButton/EventSubscribeButton.js +1 -2
- package/lib/esm/components/Events/Events.js +4 -4
- package/lib/esm/components/Events/Skeleton.js +1 -1
- package/lib/esm/components/Feed/Feed.js +1 -1
- package/lib/esm/components/Feed/Skeleton.js +1 -1
- package/lib/esm/components/FeedObject/Actions/Follow/Follow.js +3 -4
- package/lib/esm/components/FeedObject/Actions/Share/Share.js +1 -2
- package/lib/esm/components/FeedObject/Poll/Choice/Choice.js +2 -3
- package/lib/esm/components/FollowUserButton/FollowUserButton.js +2 -3
- package/lib/esm/components/FriendshipUserButton/FriendshipUserButton.js +3 -4
- package/lib/esm/components/GroupForm/GroupForm.js +2 -3
- package/lib/esm/components/GroupInviteButton/GroupInviteButton.js +1 -2
- package/lib/esm/components/GroupSubscribeButton/GroupSubscribeButton.js +4 -5
- package/lib/esm/components/Groups/Groups.js +2 -2
- package/lib/esm/components/Groups/Skeleton.js +1 -1
- package/lib/esm/components/IncubatorListWidget/CreateIncubatorDialog/CreateIncubatorDialog.js +3 -4
- package/lib/esm/components/IncubatorSubscribeButton/IncubatorSubscribeButton.js +4 -5
- package/lib/esm/components/InviteUserEventButton/InviteUserEventButton.js +2 -3
- package/lib/esm/components/LessonAppbar/LessonAppbar.js +4 -5
- package/lib/esm/components/LessonEditForm/LessonEditForm.js +2 -3
- package/lib/esm/components/LessonReleaseMenu/LessonReleaseMenu.js +3 -3
- package/lib/esm/components/LiveStreamForm/LiveStreamForm.js +2 -3
- package/lib/esm/components/Notification/Course/Course.js +2 -7
- package/lib/esm/components/Notification/Event/Event.js +4 -9
- package/lib/esm/components/Notification/Group/Group.js +2 -3
- package/lib/esm/components/Notification/LiveStream/LiveStream.js +2 -7
- package/lib/esm/components/Notification/Notification.js +14 -6
- package/lib/esm/components/Notification/PrivateMessage/PrivateMessage.js +2 -3
- package/lib/esm/components/OnBoardingWidget/Steps/Appearance/Appearance.js +3 -4
- package/lib/esm/components/PaymentOrders/PaymentOrders.js +5 -6
- package/lib/esm/components/PaymentProducts/Skeleton.js +1 -1
- package/lib/esm/components/Paywalls/Skeleton.js +1 -1
- package/lib/esm/components/PaywallsConfigurator/Skeleton.js +1 -1
- package/lib/esm/components/PdfPreviewDialog/PdfPreviewDialog.js +1 -1
- package/lib/esm/components/PlatformWidget/Skeleton.js +1 -1
- package/lib/esm/components/PrivateMessageComponent/PrivateMessageComponent.js +2 -2
- package/lib/esm/components/PrivateMessageComponent/Skeleton.js +1 -1
- package/lib/esm/components/UserAddPaymentMethodForm/UserAddPaymentMethodForm.js +2 -4
- package/lib/esm/components/UserBillingInfo/Skeleton.js +1 -1
- package/lib/esm/components/UserBillingInfo/UserBillingInfo.js +8 -9
- package/lib/esm/components/UserChangeAddressDialog/UserChangeAddressDialog.js +1 -2
- package/lib/esm/components/UserProfileBlocked/UserProfileBlocked.js +2 -3
- package/lib/esm/components/UserProfileEdit/Section/AccountCredentials.js +1 -2
- package/lib/esm/components/UserProfileEdit/Section/PublicInfo.js +5 -6
- package/lib/esm/components/VoteAudienceButton/VoteAudienceButton.d.ts +2 -2
- package/lib/esm/components/VoteAudienceButton/VoteAudienceButton.js +5 -6
- package/lib/esm/components/VoteButton/VoteButton.d.ts +2 -2
- package/lib/esm/components/VoteButton/VoteButton.js +3 -4
- package/lib/esm/shared/AddUsersButton/AddUsersButton.js +1 -2
- package/lib/esm/shared/ConfirmDialog/ConfirmDialog.js +1 -2
- package/lib/esm/shared/CourseUsersTable/ChangeUsersStatus.js +2 -3
- package/lib/esm/shared/CourseUsersTable/CourseUsersTable.js +3 -4
- package/lib/esm/shared/CourseUsersTable/RemoveButton.js +2 -3
- package/lib/esm/shared/CourseUsersTable/RequestButton.js +2 -3
- package/lib/esm/shared/HiddenPurchasableContent/HiddenPurchasableContent.js +3 -4
- package/lib/esm/shared/Media/File/DisplayComponent.js +2 -2
- package/lib/esm/shared/ScrollContainer/index.js +1 -1
- package/lib/esm/shared/VirtualizedScroller/VirtualizedScroller.d.ts +1 -1
- package/lib/umd/484.js +2 -0
- package/lib/umd/react-ui.js +1 -1
- package/package.json +14 -14
- package/lib/umd/54.js +0 -2
- /package/lib/umd/{54.js.LICENSE.txt → 484.js.LICENSE.txt} +0 -0
package/lib/esm/components/IncubatorListWidget/CreateIncubatorDialog/CreateIncubatorDialog.js
CHANGED
|
@@ -2,14 +2,13 @@ import { __rest } from "tslib";
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { useState } from 'react';
|
|
4
4
|
import { defineMessages, FormattedMessage, useIntl } from 'react-intl';
|
|
5
|
-
import { TextField, Typography, FormGroup, styled } from '@mui/material';
|
|
5
|
+
import { TextField, Typography, FormGroup, styled, Button } from '@mui/material';
|
|
6
6
|
import { http, Endpoints } from '@selfcommunity/api-services';
|
|
7
7
|
import { Logger } from '@selfcommunity/utils';
|
|
8
8
|
import { useSCUser } from '@selfcommunity/react-core';
|
|
9
9
|
import BaseDialog from '../../../shared/BaseDialog';
|
|
10
10
|
import classNames from 'classnames';
|
|
11
11
|
import { SCOPE_SC_UI } from '../../../constants/Errors';
|
|
12
|
-
import { LoadingButton } from '@mui/lab';
|
|
13
12
|
import { PREFIX } from '../constants';
|
|
14
13
|
const messages = defineMessages({
|
|
15
14
|
name: {
|
|
@@ -59,7 +58,7 @@ export default function CreateIncubatorDialog(props) {
|
|
|
59
58
|
slogan: slogan
|
|
60
59
|
}
|
|
61
60
|
})
|
|
62
|
-
.then((
|
|
61
|
+
.then(() => {
|
|
63
62
|
setIsSubmitting(false);
|
|
64
63
|
setSubmitted(true);
|
|
65
64
|
})
|
|
@@ -77,7 +76,7 @@ export default function CreateIncubatorDialog(props) {
|
|
|
77
76
|
dialogContent = (_jsx(Typography, Object.assign({ variant: 'subtitle2', className: classes.submittedMessage }, { children: _jsx(FormattedMessage, { id: "ui.incubatorListWidget.createIncubatorDialog.propose.success", defaultMessage: "ui.incubatorListWidget.createIncubatorDialog.propose.success" }) })));
|
|
78
77
|
}
|
|
79
78
|
else {
|
|
80
|
-
dialogContent = (_jsxs(_Fragment, { children: [_jsx(Typography, Object.assign({ component: 'span', className: classes.intro }, { children: _jsx(FormattedMessage, { id: "ui.incubatorsListDialog.createIncubatorDialog.intro", defaultMessage: "ui.incubatorsListDialog.createIncubatorDialog.intro" }) })), _jsxs(FormGroup, Object.assign({ className: classes.form }, { children: [_jsx(TextField, { required: true, error: Boolean(error), className: classes.name, placeholder: `${intl.formatMessage(messages.name)}`, margin: "normal", value: name, onChange: (event) => setName(event.target.value) }), _jsx(TextField, { multiline: true, error: Boolean(error), className: classes.slogan, placeholder: `${intl.formatMessage(messages.slogan)}`, margin: "normal", value: slogan, onChange: (event) => setSlogan(event.target.value) })] })), _jsx(
|
|
79
|
+
dialogContent = (_jsxs(_Fragment, { children: [_jsx(Typography, Object.assign({ component: 'span', className: classes.intro }, { children: _jsx(FormattedMessage, { id: "ui.incubatorsListDialog.createIncubatorDialog.intro", defaultMessage: "ui.incubatorsListDialog.createIncubatorDialog.intro" }) })), _jsxs(FormGroup, Object.assign({ className: classes.form }, { children: [_jsx(TextField, { required: true, error: Boolean(error), className: classes.name, placeholder: `${intl.formatMessage(messages.name)}`, margin: "normal", value: name, onChange: (event) => setName(event.target.value) }), _jsx(TextField, { multiline: true, error: Boolean(error), className: classes.slogan, placeholder: `${intl.formatMessage(messages.slogan)}`, margin: "normal", value: slogan, onChange: (event) => setSlogan(event.target.value) })] })), _jsx(Button, Object.assign({ loading: isSubmitting, disabled: !name || Boolean(error), variant: "contained", onClick: handleSubmit }, { children: _jsx(FormattedMessage, { id: "ui.incubatorListWidget.createIncubatorDialog.button", defaultMessage: "ui.incubatorListWidget.createIncubatorDialog.button" }) }))] }));
|
|
81
80
|
}
|
|
82
81
|
// RENDER
|
|
83
82
|
return (_jsx(Root, Object.assign({ title: _jsx(FormattedMessage, { id: "ui.incubatorListWidget.createIncubatorDialog.title", defaultMessage: "ui.incubatorListWidget.createIncubatorDialog.title" }), open: open, onClose: onClose, className: classNames(classes.root, className) }, rest, { children: dialogContent })));
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useEffect, useState } from 'react';
|
|
4
|
-
import { styled } from '@mui/material';
|
|
4
|
+
import { Button, styled } from '@mui/material';
|
|
5
5
|
import { SCOPE_SC_UI } from '../../constants/Errors';
|
|
6
|
-
import { LoadingButton } from '@mui/lab';
|
|
7
6
|
import { FormattedMessage } from 'react-intl';
|
|
8
7
|
import classNames from 'classnames';
|
|
9
8
|
import { CacheStrategies, Logger } from '@selfcommunity/utils';
|
|
@@ -13,11 +12,11 @@ const PREFIX = 'SCIncubatorSubscribeButton';
|
|
|
13
12
|
const classes = {
|
|
14
13
|
root: `${PREFIX}-root`
|
|
15
14
|
};
|
|
16
|
-
const Root = styled(
|
|
15
|
+
const Root = styled(Button, {
|
|
17
16
|
name: PREFIX,
|
|
18
17
|
slot: 'Root',
|
|
19
|
-
overridesResolver: (
|
|
20
|
-
})((
|
|
18
|
+
overridesResolver: (_props, styles) => styles.root
|
|
19
|
+
})(() => ({}));
|
|
21
20
|
/**
|
|
22
21
|
* > API documentation for the Community-JS Incubator Subscribe Button component. Learn about the available props and the CSS API.
|
|
23
22
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import { styled } from '@mui/material';
|
|
3
|
+
import { Button, styled } from '@mui/material';
|
|
5
4
|
import { useThemeProps } from '@mui/system';
|
|
6
5
|
import { EventService } from '@selfcommunity/api-services';
|
|
7
6
|
import { useSCFetchEvent, useSCFetchUser } from '@selfcommunity/react-core';
|
|
@@ -14,7 +13,7 @@ const PREFIX = 'SCInviteUserEventButton';
|
|
|
14
13
|
const classes = {
|
|
15
14
|
root: `${PREFIX}-root`
|
|
16
15
|
};
|
|
17
|
-
const InviteButton = styled(
|
|
16
|
+
const InviteButton = styled(Button, {
|
|
18
17
|
name: PREFIX,
|
|
19
18
|
slot: 'Root',
|
|
20
19
|
overridesResolver: (_props, styles) => styles.root
|
|
@@ -2,11 +2,10 @@ import { __rest } from "tslib";
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { useThemeProps } from '@mui/system';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
|
-
import { AppBar, Icon, IconButton, Toolbar, Typography, Box, styled } from '@mui/material';
|
|
5
|
+
import { AppBar, Icon, IconButton, Toolbar, Typography, Box, styled, Button } from '@mui/material';
|
|
6
6
|
import { PREFIX } from './constants';
|
|
7
7
|
import { SCLessonActionsType } from '../../types';
|
|
8
8
|
import { FormattedMessage } from 'react-intl';
|
|
9
|
-
import { LoadingButton } from '@mui/lab';
|
|
10
9
|
const classes = {
|
|
11
10
|
root: `${PREFIX}-root`,
|
|
12
11
|
startItems: `${PREFIX}-start-items`,
|
|
@@ -16,9 +15,9 @@ const classes = {
|
|
|
16
15
|
const Root = styled(AppBar, {
|
|
17
16
|
name: PREFIX,
|
|
18
17
|
slot: 'Root',
|
|
19
|
-
overridesResolver: (
|
|
18
|
+
overridesResolver: (_props, styles) => [styles.root],
|
|
20
19
|
shouldForwardProp: (prop) => prop !== 'open'
|
|
21
|
-
})((
|
|
20
|
+
})(() => ({}));
|
|
22
21
|
export default function LessonAppbar(inProps) {
|
|
23
22
|
// PROPS
|
|
24
23
|
const props = useThemeProps({
|
|
@@ -26,5 +25,5 @@ export default function LessonAppbar(inProps) {
|
|
|
26
25
|
name: PREFIX
|
|
27
26
|
});
|
|
28
27
|
const { className = null, title = '', showComments, activePanel = null, handleOpen, onSave, editMode, onArrowBackClick, updating } = props, rest = __rest(props, ["className", "title", "showComments", "activePanel", "handleOpen", "onSave", "editMode", "onArrowBackClick", "updating"]);
|
|
29
|
-
return (_jsx(Root, Object.assign({ position: "fixed", open: Boolean(activePanel), className: classNames(classes.root, className) }, rest, { children: _jsxs(Toolbar, { children: [_jsxs(Box, Object.assign({ className: classes.startItems }, { children: [_jsx(IconButton, Object.assign({ edge: "start", onClick: onArrowBackClick }, { children: _jsx(Icon, { children: "arrow_back" }) })), _jsx(Typography, Object.assign({ variant: "h6", className: classes.title }, { children: title }))] })), editMode ? (_jsxs(_Fragment, { children: [_jsx(IconButton, Object.assign({ onClick: () => handleOpen(SCLessonActionsType.SETTINGS), color: "primary" }, { children: _jsx(Icon, { children: "settings" }) })), _jsx(
|
|
28
|
+
return (_jsx(Root, Object.assign({ position: "fixed", open: Boolean(activePanel), className: classNames(classes.root, className) }, rest, { children: _jsxs(Toolbar, { children: [_jsxs(Box, Object.assign({ className: classes.startItems }, { children: [_jsx(IconButton, Object.assign({ edge: "start", onClick: onArrowBackClick }, { children: _jsx(Icon, { children: "arrow_back" }) })), _jsx(Typography, Object.assign({ variant: "h6", className: classes.title }, { children: title }))] })), editMode ? (_jsxs(_Fragment, { children: [_jsx(IconButton, Object.assign({ onClick: () => handleOpen(SCLessonActionsType.SETTINGS), color: "primary" }, { children: _jsx(Icon, { children: "settings" }) })), _jsx(Button, Object.assign({ variant: "contained", size: "small", onClick: onSave, loading: updating }, { children: _jsx(FormattedMessage, { id: "ui.lessonAppbar.button.save", defaultMessage: "ui.lessonAppbar.button.save" }) }))] })) : (_jsxs(Box, Object.assign({ className: classes.endItems }, { children: [showComments && (_jsx(IconButton, Object.assign({ onClick: () => handleOpen(SCLessonActionsType.COMMENTS) }, { children: _jsx(Icon, { children: "chat_bubble_outline" }) }))), _jsx(IconButton, Object.assign({ onClick: () => handleOpen(SCLessonActionsType.LESSONS) }, { children: _jsx(Icon, { children: "courses" }) }))] })))] }) })));
|
|
30
29
|
}
|
|
@@ -3,11 +3,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { useState } from 'react';
|
|
4
4
|
import { useThemeProps } from '@mui/system';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
|
-
import { Box, Checkbox, FormControl, FormControlLabel, FormLabel, Radio, RadioGroup, styled } from '@mui/material';
|
|
6
|
+
import { Box, Button, Checkbox, FormControl, FormControlLabel, FormLabel, Radio, RadioGroup, styled } from '@mui/material';
|
|
7
7
|
import { PREFIX } from './constants';
|
|
8
8
|
import { FormattedMessage } from 'react-intl';
|
|
9
9
|
import { SCCourseLessonStatusType } from '@selfcommunity/types';
|
|
10
|
-
import { LoadingButton } from '@mui/lab';
|
|
11
10
|
const classes = {
|
|
12
11
|
root: `${PREFIX}-root`,
|
|
13
12
|
form: `${PREFIX}-form`,
|
|
@@ -37,5 +36,5 @@ export default function LessonEditForm(inProps) {
|
|
|
37
36
|
/**
|
|
38
37
|
* Rendering
|
|
39
38
|
*/
|
|
40
|
-
return (_jsxs(Root, Object.assign({ className: classNames(className, classes.root) }, rest, { children: [_jsxs(Box, Object.assign({ className: classes.form }, { children: [_jsxs(FormControl, { children: [_jsx(FormLabel, Object.assign({ id: "status" }, { children: _jsx(FormattedMessage, { id: "ui.lessonEditForm.status.title", defaultMessage: "ui.lessonEditForm.status.title" }) })), _jsxs(RadioGroup, Object.assign({ "aria-labelledby": "course-status-radio-buttons-group", name: "course-status-radio-buttons-group", value: settings.status, onChange: (e) => handleChange('status', e.target.value) }, { children: [_jsx(FormControlLabel, { value: SCCourseLessonStatusType.DRAFT, control: _jsx(Radio, {}), label: _jsx(FormattedMessage, { id: "ui.lessonEditForm.status.draft", defaultMessage: "ui.lessonEditForm.status.draft" }) }), _jsx(FormControlLabel, { value: SCCourseLessonStatusType.PUBLISHED, control: _jsx(Radio, {}), label: _jsx(FormattedMessage, { id: "ui.lessonEditForm.status.published", defaultMessage: "ui.lessonEditForm.status.published" }) })] }))] }), _jsxs(FormControl, Object.assign({ className: classes.settings }, { children: [_jsx(FormLabel, Object.assign({ id: "settings" }, { children: _jsx(FormattedMessage, { id: "ui.lessonEditForm.settings.title", defaultMessage: "ui.lessonEditForm.settings.title" }) })), _jsx(FormControlLabel, { control: _jsx(Checkbox, { checked: settings.comments_enabled, onChange: (e) => handleChange('comments_enabled', e.target.checked) }), label: _jsx(FormattedMessage, { id: "ui.lessonEditForm.settings.enableComments", defaultMessage: "ui.lessonEditForm.settings.enableComments" }) })] }))] })), _jsx(
|
|
39
|
+
return (_jsxs(Root, Object.assign({ className: classNames(className, classes.root) }, rest, { children: [_jsxs(Box, Object.assign({ className: classes.form }, { children: [_jsxs(FormControl, { children: [_jsx(FormLabel, Object.assign({ id: "status" }, { children: _jsx(FormattedMessage, { id: "ui.lessonEditForm.status.title", defaultMessage: "ui.lessonEditForm.status.title" }) })), _jsxs(RadioGroup, Object.assign({ "aria-labelledby": "course-status-radio-buttons-group", name: "course-status-radio-buttons-group", value: settings.status, onChange: (e) => handleChange('status', e.target.value) }, { children: [_jsx(FormControlLabel, { value: SCCourseLessonStatusType.DRAFT, control: _jsx(Radio, {}), label: _jsx(FormattedMessage, { id: "ui.lessonEditForm.status.draft", defaultMessage: "ui.lessonEditForm.status.draft" }) }), _jsx(FormControlLabel, { value: SCCourseLessonStatusType.PUBLISHED, control: _jsx(Radio, {}), label: _jsx(FormattedMessage, { id: "ui.lessonEditForm.status.published", defaultMessage: "ui.lessonEditForm.status.published" }) })] }))] }), _jsxs(FormControl, Object.assign({ className: classes.settings }, { children: [_jsx(FormLabel, Object.assign({ id: "settings" }, { children: _jsx(FormattedMessage, { id: "ui.lessonEditForm.settings.title", defaultMessage: "ui.lessonEditForm.settings.title" }) })), _jsx(FormControlLabel, { control: _jsx(Checkbox, { checked: settings.comments_enabled, onChange: (e) => handleChange('comments_enabled', e.target.checked) }), label: _jsx(FormattedMessage, { id: "ui.lessonEditForm.settings.enableComments", defaultMessage: "ui.lessonEditForm.settings.enableComments" }) })] }))] })), _jsx(Button, Object.assign({ className: classes.button, variant: "contained", size: "small", onClick: onSave, loading: updating }, { children: _jsx(FormattedMessage, { id: "ui.lessonEditForm.button.save", defaultMessage: "ui.lessonEditForm.button.save" }) }))] })));
|
|
41
40
|
}
|
|
@@ -11,8 +11,8 @@ import { DateTimePickerTabs, LocalizationProvider, MobileDateTimePicker } from '
|
|
|
11
11
|
import { SCCourseTypologyType } from '@selfcommunity/types';
|
|
12
12
|
import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns';
|
|
13
13
|
import { useSCContext } from '@selfcommunity/react-core';
|
|
14
|
-
import
|
|
15
|
-
import
|
|
14
|
+
import { it } from 'date-fns/locale/it';
|
|
15
|
+
import { enUS } from 'date-fns/locale/en-US';
|
|
16
16
|
import { CourseService } from '@selfcommunity/api-services';
|
|
17
17
|
import { SCOPE_SC_UI } from '../../constants/Errors';
|
|
18
18
|
import { Logger } from '@selfcommunity/utils';
|
|
@@ -133,7 +133,7 @@ export default function LessonReleaseMenu(inProps) {
|
|
|
133
133
|
id: 'ui.lessonReleaseMenu.now.label',
|
|
134
134
|
defaultMessage: 'ui.lessonReleaseMenu.now.label'
|
|
135
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' ?
|
|
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' ? it : enUS, localeText: {
|
|
137
137
|
okButtonLabel: `${intl.formatMessage(messages.pickerOkMessage)}`,
|
|
138
138
|
cancelButtonLabel: `${intl.formatMessage(messages.pickerCancelMessage)}`,
|
|
139
139
|
clearButtonLabel: `${intl.formatMessage(messages.pickerClearMessage)}`
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import { Alert, Box, FormGroup, Paper, TextField, Typography, styled } from '@mui/material';
|
|
3
|
+
import { Alert, Box, Button, FormGroup, Paper, TextField, Typography, styled } from '@mui/material';
|
|
5
4
|
import { useThemeProps } from '@mui/system';
|
|
6
5
|
import { SCCommunityEnvironment, SCCommunitySubscriptionTier } from '@selfcommunity/types';
|
|
7
6
|
import classNames from 'classnames';
|
|
@@ -241,7 +240,7 @@ export default function LiveStreamForm(inProps) {
|
|
|
241
240
|
input: {
|
|
242
241
|
endAdornment: (_jsx(Typography, Object.assign({ variant: "body2" }, { children: ((_b = field.description) === null || _b === void 0 ? void 0 : _b.length) ? LIVE_STREAM_DESCRIPTION_MAX_LENGTH - field.description.length : LIVE_STREAM_DESCRIPTION_MAX_LENGTH })))
|
|
243
242
|
}
|
|
244
|
-
}, error: Boolean(((_c = field.description) === null || _c === void 0 ? void 0 : _c.length) > LIVE_STREAM_DESCRIPTION_MAX_LENGTH), helperText: ((_d = field.description) === null || _d === void 0 ? void 0 : _d.length) > LIVE_STREAM_DESCRIPTION_MAX_LENGTH ? (_jsx(FormattedMessage, { id: "ui.liveStreamForm.description.error.maxLength", defaultMessage: "ui.liveStreamForm.description.error.maxLength" })) : null }), _jsx(LiveStreamSettingsForm, { settings: field.settings, onChange: handleChangeSettings }), genericError && (_jsx(Box, Object.assign({ className: classes.genericError }, { children: _jsx(Alert, Object.assign({ variant: "filled", severity: "error" }, { children: genericError })) }))), _jsx(Box, Object.assign({ className: classes.actions }, { children: _jsx(
|
|
243
|
+
}, error: Boolean(((_c = field.description) === null || _c === void 0 ? void 0 : _c.length) > LIVE_STREAM_DESCRIPTION_MAX_LENGTH), helperText: ((_d = field.description) === null || _d === void 0 ? void 0 : _d.length) > LIVE_STREAM_DESCRIPTION_MAX_LENGTH ? (_jsx(FormattedMessage, { id: "ui.liveStreamForm.description.error.maxLength", defaultMessage: "ui.liveStreamForm.description.error.maxLength" })) : null }), _jsx(LiveStreamSettingsForm, { settings: field.settings, onChange: handleChangeSettings }), genericError && (_jsx(Box, Object.assign({ className: classes.genericError }, { children: _jsx(Alert, Object.assign({ variant: "filled", severity: "error" }, { children: genericError })) }))), _jsx(Box, Object.assign({ className: classes.actions }, { children: _jsx(Button, Object.assign({ loading: field.isSubmitting, disabled: !field.title ||
|
|
245
244
|
field.isSubmitting ||
|
|
246
245
|
field.title.length > LIVE_STREAM_TITLE_MAX_LENGTH ||
|
|
247
246
|
field.description.length > LIVE_STREAM_DESCRIPTION_MAX_LENGTH ||
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { useState } from 'react';
|
|
4
|
-
import { Avatar, Box, Stack, Typography, styled } from '@mui/material';
|
|
4
|
+
import { Avatar, Box, Button, Stack, Typography, styled } from '@mui/material';
|
|
5
5
|
import { Link, SCRoutes, useSCRouting } from '@selfcommunity/react-core';
|
|
6
6
|
import { SCNotificationTypologyType } from '@selfcommunity/types';
|
|
7
7
|
import { FormattedMessage } from 'react-intl';
|
|
@@ -9,7 +9,6 @@ import DateTimeAgo from '../../../shared/DateTimeAgo';
|
|
|
9
9
|
import classNames from 'classnames';
|
|
10
10
|
import { SCCourseTemplateType, SCNotificationObjectTemplateType } from '../../../types';
|
|
11
11
|
import NotificationItem from '../../../shared/NotificationItem';
|
|
12
|
-
import { LoadingButton } from '@mui/lab';
|
|
13
12
|
import UserDeletedSnackBar from '../../../shared/UserDeletedSnackBar';
|
|
14
13
|
import UserAvatar from '../../../shared/UserAvatar';
|
|
15
14
|
import { PREFIX } from '../constants';
|
|
@@ -54,8 +53,6 @@ export default function CourseNotification(props) {
|
|
|
54
53
|
}), { 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 && {
|
|
55
54
|
to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, notificationObject.user)
|
|
56
55
|
}), { 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: {
|
|
57
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
58
|
-
// @ts-ignore
|
|
59
56
|
name: notificationObject.type === SCNotificationTypologyType.USER_COMMENTED_A_COURSE_LESSON
|
|
60
57
|
? notificationObject.comment.lesson_name
|
|
61
58
|
: notificationObject.course.name,
|
|
@@ -71,8 +68,6 @@ export default function CourseNotification(props) {
|
|
|
71
68
|
}), { 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 && {
|
|
72
69
|
to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, notificationObject.user)
|
|
73
70
|
}), { 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: {
|
|
74
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
75
|
-
// @ts-ignore
|
|
76
71
|
name: notificationObject.type === SCNotificationTypologyType.USER_COMMENTED_A_COURSE_LESSON
|
|
77
72
|
? notificationObject.comment.lesson_name
|
|
78
73
|
: notificationObject.course.name,
|
|
@@ -81,5 +76,5 @@ export default function CourseNotification(props) {
|
|
|
81
76
|
: SCRoutes.COURSE_ROUTE_NAME, notificationObject.type === SCNotificationTypologyType.USER_COMMENTED_A_COURSE_LESSON
|
|
82
77
|
? formatLessonUrl(notificationObject)
|
|
83
78
|
: notificationObject.course) }, { children: chunks })))
|
|
84
|
-
} }), 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(
|
|
79
|
+
} }), 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(Button, 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) })] }));
|
|
85
80
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { useState } from 'react';
|
|
4
|
-
import { Avatar, Box, Icon, Stack, Typography, styled } from '@mui/material';
|
|
4
|
+
import { Avatar, Box, Button, Icon, Stack, Typography, styled } from '@mui/material';
|
|
5
5
|
import { Link, SCRoutes, useSCRouting } from '@selfcommunity/react-core';
|
|
6
6
|
import { SCEventLocationType, SCEventSubscriptionStatusType, SCNotificationTypologyType } from '@selfcommunity/types';
|
|
7
7
|
import { FormattedMessage, useIntl } from 'react-intl';
|
|
@@ -9,7 +9,6 @@ import DateTimeAgo from '../../../shared/DateTimeAgo';
|
|
|
9
9
|
import classNames from 'classnames';
|
|
10
10
|
import { SCNotificationObjectTemplateType } from '../../../types';
|
|
11
11
|
import NotificationItem from '../../../shared/NotificationItem';
|
|
12
|
-
import { LoadingButton } from '@mui/lab';
|
|
13
12
|
import UserDeletedSnackBar from '../../../shared/UserDeletedSnackBar';
|
|
14
13
|
import UserAvatar from '../../../shared/UserAvatar';
|
|
15
14
|
import { PREFIX } from '../constants';
|
|
@@ -61,8 +60,6 @@ export default function EventNotification(props) {
|
|
|
61
60
|
}), { 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 && {
|
|
62
61
|
to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, notificationObject.user)
|
|
63
62
|
}), { onClick: notificationObject.user.deleted ? () => setOpenAlert(true) : null, className: classes.username }, { children: notificationObject.user.username })), ' ', _jsx(FormattedMessage, { id: `ui.notification.event.${notificationObject.type}`, defaultMessage: `ui.notification.event.${notificationObject.type}`, values: {
|
|
64
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
65
|
-
// @ts-ignore
|
|
66
63
|
icon: (...chunks) => _jsx(Icon, { children: chunks }),
|
|
67
64
|
event: notificationObject.event.name,
|
|
68
65
|
link: (...chunks) => _jsx(Link, Object.assign({ to: scRoutingContext.url(SCRoutes.EVENT_ROUTE_NAME, notificationObject.event) }, { children: chunks }))
|
|
@@ -74,21 +71,19 @@ export default function EventNotification(props) {
|
|
|
74
71
|
month: 'long'
|
|
75
72
|
}),
|
|
76
73
|
hour: intl.formatDate(notificationObject.event.start_date, { hour: 'numeric', minute: 'numeric' })
|
|
77
|
-
} }) })), _jsxs(Typography, Object.assign({ component: "p", variant: "body2" }, { children: [_jsx(FormattedMessage, { id: `ui.notification.event.privacy.${notificationObject.event.privacy}`, defaultMessage: `ui.notification.event.privacy.${notificationObject.event.privacy}` }), ' ', "-", ' ', notificationObject.event.location === SCEventLocationType.PERSON ? (_jsx(FormattedMessage, { id: `ui.notification.event.address.live.label`, defaultMessage: `ui.notification.event.address.live.label` })) : (_jsx(FormattedMessage, { id: `ui.notification.event.address.online.label`, defaultMessage: `ui.notification.event.address.online.label` }))] }))] }), 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: notificationObject.type === SCNotificationTypologyType.USER_REQUESTED_TO_JOIN_EVENT ? (_jsx(
|
|
74
|
+
} }) })), _jsxs(Typography, Object.assign({ component: "p", variant: "body2" }, { children: [_jsx(FormattedMessage, { id: `ui.notification.event.privacy.${notificationObject.event.privacy}`, defaultMessage: `ui.notification.event.privacy.${notificationObject.event.privacy}` }), ' ', "-", ' ', notificationObject.event.location === SCEventLocationType.PERSON ? (_jsx(FormattedMessage, { id: `ui.notification.event.address.live.label`, defaultMessage: `ui.notification.event.address.live.label` })) : (_jsx(FormattedMessage, { id: `ui.notification.event.address.online.label`, defaultMessage: `ui.notification.event.address.online.label` }))] }))] }), 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: notificationObject.type === SCNotificationTypologyType.USER_REQUESTED_TO_JOIN_EVENT ? (_jsx(Button, Object.assign({ disabled: disabled, loading: loading, color: "primary", variant: "text", size: "small", onClick: () => acceptRequest(notificationObject.event) }, { children: disabled ? (_jsx(FormattedMessage, { id: "ui.notification.event.button.accepted", defaultMessage: "ui.notification.event.button.accepted" })) : (_jsx(FormattedMessage, { id: "ui.notification.event.button.accept", defaultMessage: "ui.notification.event.button.accept" })) }))) : (_jsx(Link, Object.assign({ to: scRoutingContext.url(SCRoutes.EVENT_ROUTE_NAME, notificationObject.event) }, { children: _jsx(FormattedMessage, { id: "ui.notification.event.button.see", defaultMessage: "ui.notification.event.button.see" }) }))) }))] }))) : (_jsx(DateTimeAgo, { date: notificationObject.active_at, className: classes.snippetTime })) }, rest)));
|
|
78
75
|
}
|
|
79
76
|
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 && {
|
|
80
77
|
to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, notificationObject.user)
|
|
81
78
|
}), { 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 && {
|
|
82
79
|
to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, notificationObject.user)
|
|
83
80
|
}), { onClick: notificationObject.user.deleted ? () => setOpenAlert(true) : null, className: classes.username }, { children: notificationObject.user.username })), ' ', _jsx(FormattedMessage, { id: `ui.notification.${notificationObject.type}`, defaultMessage: `ui.notification.${notificationObject.type}`, values: {
|
|
84
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
85
|
-
// @ts-ignore
|
|
86
81
|
icon: (...chunks) => _jsx(Icon, { children: chunks }),
|
|
87
82
|
event: notificationObject.event.name,
|
|
88
83
|
link: (...chunks) => _jsx(Link, Object.assign({ to: scRoutingContext.url(SCRoutes.EVENT_ROUTE_NAME, notificationObject.event) }, { children: chunks }))
|
|
89
|
-
} }), _jsx(EventItem, { event: notificationObject.event, actions: _jsx(_Fragment, {}), 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(
|
|
84
|
+
} }), _jsx(EventItem, { event: notificationObject.event, actions: _jsx(_Fragment, {}), 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(Button, Object.assign({}, (notificationObject.type === SCNotificationTypologyType.USER_REQUESTED_TO_JOIN_EVENT && {
|
|
90
85
|
disabled: disabled
|
|
91
|
-
}), { loading: loading, color:
|
|
86
|
+
}), { loading: loading, color: "primary", variant: "outlined", size: "small", classes: { root: classes.seeButton } }, (notificationObject.type !== SCNotificationTypologyType.USER_REQUESTED_TO_JOIN_EVENT && {
|
|
92
87
|
component: Link,
|
|
93
88
|
to: scRoutingContext.url(SCRoutes.EVENT_ROUTE_NAME, notificationObject.event)
|
|
94
89
|
}), { onClick: notificationObject.type === SCNotificationTypologyType.USER_REQUESTED_TO_JOIN_EVENT
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { useContext, useEffect, useState } from 'react';
|
|
4
|
-
import { Avatar, Box, Stack, Typography, styled } from '@mui/material';
|
|
4
|
+
import { Avatar, Box, Button, Stack, Typography, styled } from '@mui/material';
|
|
5
5
|
import { Link, SCRoutes, SCUserContext, useSCRouting } from '@selfcommunity/react-core';
|
|
6
6
|
import { SCGroupSubscriptionStatusType, SCNotificationTypologyType } from '@selfcommunity/types';
|
|
7
7
|
import { FormattedMessage } from 'react-intl';
|
|
@@ -9,7 +9,6 @@ import DateTimeAgo from '../../../shared/DateTimeAgo';
|
|
|
9
9
|
import classNames from 'classnames';
|
|
10
10
|
import { SCNotificationObjectTemplateType } from '../../../types';
|
|
11
11
|
import NotificationItem from '../../../shared/NotificationItem';
|
|
12
|
-
import { LoadingButton } from '@mui/lab';
|
|
13
12
|
import UserDeletedSnackBar from '../../../shared/UserDeletedSnackBar';
|
|
14
13
|
import UserAvatar from '../../../shared/UserAvatar';
|
|
15
14
|
import { PREFIX } from '../constants';
|
|
@@ -63,7 +62,7 @@ export default function GroupNotification(props) {
|
|
|
63
62
|
? scRoutingContext.url(SCRoutes.GROUP_MEMBERS_ROUTE_NAME, notificationObject.group)
|
|
64
63
|
: scRoutingContext.url(SCRoutes.GROUP_ROUTE_NAME, notificationObject.group) }, { children: _jsx(FormattedMessage, { id: "ui.notification.group.button.see", defaultMessage: "ui.notification.group.button.see" }) })) })))] }))) }, rest)));
|
|
65
64
|
}
|
|
66
|
-
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, actions: _jsxs(Stack, Object.assign({ direction: "row", justifyContent: "space-between", alignItems: "center", spacing: 2 }, { children: [_jsx(DateTimeAgo, { date: notificationObject.active_at, className: classes.activeAt }), status && status !== SCGroupSubscriptionStatusType.SUBSCRIBED && (_jsx(
|
|
65
|
+
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, actions: _jsxs(Stack, Object.assign({ direction: "row", justifyContent: "space-between", alignItems: "center", spacing: 2 }, { children: [_jsx(DateTimeAgo, { date: notificationObject.active_at, className: classes.activeAt }), status && status !== SCGroupSubscriptionStatusType.SUBSCRIBED && (_jsx(Button, Object.assign({ color: "primary", variant: "outlined", size: "small", classes: { root: classes.acceptButton }, component: Link, loading: scUserContext.user ? status === null || manager.isLoading(notificationObject.group) : null, to: notificationObject.type === SCNotificationTypologyType.USER_REQUESTED_TO_JOIN_GROUP ||
|
|
67
66
|
notificationObject.type === SCNotificationTypologyType.USER_ACCEPTED_TO_JOIN_GROUP
|
|
68
67
|
? scRoutingContext.url(SCRoutes.GROUP_MEMBERS_ROUTE_NAME, notificationObject.group)
|
|
69
68
|
: scRoutingContext.url(SCRoutes.GROUP_ROUTE_NAME, notificationObject.group) }, { children: _jsx(FormattedMessage, { id: "ui.notification.group.button.see", defaultMessage: "ui.notification.group.button.see" }) })))] })) }, rest)), openAlert && _jsx(UserDeletedSnackBar, { open: openAlert, handleClose: () => setOpenAlert(false) })] }));
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { useState } from 'react';
|
|
4
|
-
import { Avatar, Box, Icon, Stack, Typography, styled } from '@mui/material';
|
|
4
|
+
import { Avatar, Box, Button, Icon, Stack, Typography, styled } from '@mui/material';
|
|
5
5
|
import { Link, SCRoutes, useSCRouting } from '@selfcommunity/react-core';
|
|
6
6
|
import { FormattedMessage } from 'react-intl';
|
|
7
7
|
import DateTimeAgo from '../../../shared/DateTimeAgo';
|
|
8
8
|
import classNames from 'classnames';
|
|
9
9
|
import { SCNotificationObjectTemplateType } from '../../../types';
|
|
10
10
|
import NotificationItem from '../../../shared/NotificationItem';
|
|
11
|
-
import { LoadingButton } from '@mui/lab';
|
|
12
11
|
import UserDeletedSnackBar from '../../../shared/UserDeletedSnackBar';
|
|
13
12
|
import UserAvatar from '../../../shared/UserAvatar';
|
|
14
13
|
import { PREFIX } from '../constants';
|
|
@@ -51,8 +50,6 @@ export default function LiveStreamNotification(props) {
|
|
|
51
50
|
}), { onClick: notificationObject.live_stream.host.deleted ? () => setOpenAlert(true) : null }, { children: _jsx(UserAvatar, Object.assign({ hide: !notificationObject.live_stream.host.community_badge, smaller: true }, { children: _jsx(Avatar, { alt: notificationObject.live_stream.host.username, variant: "circular", src: notificationObject.live_stream.host.avatar, classes: { root: classes.avatar } }) })) })), primary: _jsxs(Box, { children: [_jsx(Link, Object.assign({}, (!notificationObject.live_stream.host.deleted && {
|
|
52
51
|
to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, notificationObject.live_stream.host)
|
|
53
52
|
}), { onClick: notificationObject.live_stream.host.deleted ? () => setOpenAlert(true) : null, className: classes.username }, { children: notificationObject.live_stream.host.username })), ' ', _jsx(FormattedMessage, { id: `ui.notification.${notificationObject.type}.title`, defaultMessage: `ui.notification.${notificationObject.type}.title`, values: {
|
|
54
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
55
|
-
// @ts-ignore
|
|
56
53
|
icon: (...chunks) => _jsx(Icon, { children: chunks }),
|
|
57
54
|
live: notificationObject.live_stream.title,
|
|
58
55
|
link: (...chunks) => _jsx(Link, Object.assign({ to: scRoutingContext.url(SCRoutes.LIVESTREAM_ROUTE_NAME, notificationObject.live_stream) }, { children: chunks }))
|
|
@@ -63,9 +60,7 @@ export default function LiveStreamNotification(props) {
|
|
|
63
60
|
}), { onClick: notificationObject.live_stream.host.deleted ? () => setOpenAlert(true) : null }, { children: _jsx(UserAvatar, Object.assign({ hide: !notificationObject.live_stream.host.community_badge, smaller: true }, { children: _jsx(Avatar, { className: classes.avatar, alt: notificationObject.live_stream.host.username, variant: "circular", src: notificationObject.live_stream.host.avatar }) })) })), primary: _jsxs(_Fragment, { children: [_jsx(Link, Object.assign({}, (!notificationObject.live_stream.host.deleted && {
|
|
64
61
|
to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, notificationObject.live_stream.host)
|
|
65
62
|
}), { onClick: notificationObject.live_stream.host.deleted ? () => setOpenAlert(true) : null, className: classes.username }, { children: notificationObject.live_stream.host.username })), ' ', _jsx(FormattedMessage, { id: `ui.notification.${notificationObject.type}`, defaultMessage: `ui.notification.${notificationObject.type}`, values: {
|
|
66
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
67
|
-
// @ts-ignore
|
|
68
63
|
live: notificationObject.live_stream.title,
|
|
69
64
|
link: (...chunks) => _jsx(Link, Object.assign({ to: scRoutingContext.url(SCRoutes.LIVESTREAM_ROUTE_NAME, notificationObject.live_stream) }, { children: chunks }))
|
|
70
|
-
} }), _jsx(LiveStream, { liveStream: notificationObject.live_stream, hideInProgress: !inProgress, actions: _jsx(_Fragment, {}), 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(
|
|
65
|
+
} }), _jsx(LiveStream, { liveStream: notificationObject.live_stream, hideInProgress: !inProgress, actions: _jsx(_Fragment, {}), 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(Button, Object.assign({ color: "primary", variant: "outlined", size: "small", classes: { root: classes.seeButton }, component: Link, disabled: Boolean(notificationObject.live_stream.closed_at_by_host), to: scRoutingContext.url(SCRoutes.LIVESTREAM_ROUTE_NAME, notificationObject.live_stream) }, { children: _jsx(FormattedMessage, { id: "ui.notification.live_stream_started.join", defaultMessage: "ui.notification.live_stream_started.join" }) }))] })) }, rest)), openAlert && _jsx(UserDeletedSnackBar, { open: openAlert, handleClose: () => setOpenAlert(false) })] }));
|
|
71
66
|
}
|
|
@@ -19,13 +19,12 @@ import LiveStreamNotification from './LiveStream/LiveStream';
|
|
|
19
19
|
import { SCOPE_SC_UI } from '../../constants/Errors';
|
|
20
20
|
import { getContribution, getContributionRouteName, getContributionSnippet, getRouteData } from '../../utils/contribution';
|
|
21
21
|
import ContributionFollowNotification from './ContributionFollow';
|
|
22
|
-
import { Avatar, CardHeader, Collapse, ListItemButton, ListItemText, Tooltip, styled, CardContent, Icon } from '@mui/material';
|
|
22
|
+
import { Avatar, CardHeader, Collapse, ListItemButton, ListItemText, Tooltip, styled, CardContent, Icon, Button } from '@mui/material';
|
|
23
23
|
import IncubatorApprovedNotification from './IncubatorApproved';
|
|
24
24
|
import { Endpoints, http } from '@selfcommunity/api-services';
|
|
25
25
|
import { Link, SCRoutes, useSCRouting } from '@selfcommunity/react-core';
|
|
26
26
|
import ContributionNotification from './Contribution';
|
|
27
27
|
import classNames from 'classnames';
|
|
28
|
-
import LoadingButton from '@mui/lab/LoadingButton';
|
|
29
28
|
import Widget from '../Widget';
|
|
30
29
|
import { useThemeProps } from '@mui/system';
|
|
31
30
|
import { Logger } from '@selfcommunity/utils';
|
|
@@ -139,7 +138,7 @@ export default function UserNotification(inProps) {
|
|
|
139
138
|
function handleStopContentNotification(contribution) {
|
|
140
139
|
setLoadingSuspendNotification(true);
|
|
141
140
|
performSuspendNotification(contribution)
|
|
142
|
-
.then((
|
|
141
|
+
.then(() => {
|
|
143
142
|
const newObj = obj;
|
|
144
143
|
newObj[contribution.type].suspended = !newObj[contribution.type].suspended;
|
|
145
144
|
setObj(newObj);
|
|
@@ -184,7 +183,9 @@ export default function UserNotification(inProps) {
|
|
|
184
183
|
let messageNotification = notificationObject.aggregated[0];
|
|
185
184
|
return (_jsx(CardHeader, { className: classes.header, avatar: _jsx(Link, Object.assign({}, (!messageNotification.message.sender.deleted && {
|
|
186
185
|
to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, messageNotification.message.sender)
|
|
187
|
-
}), { onClick: messageNotification.message.sender.deleted ? () => setOpenAlert(true) : null }, { children: _jsx(UserAvatar, Object.assign({ hide: !messageNotification.message.sender.community_badge, smaller: true }, { children: _jsx(Avatar, { className: classes.avatar, alt: messageNotification.message.sender.username, variant: "circular", src: messageNotification.message.sender.avatar }) })) })),
|
|
186
|
+
}), { onClick: messageNotification.message.sender.deleted ? () => setOpenAlert(true) : null }, { children: _jsx(UserAvatar, Object.assign({ hide: !messageNotification.message.sender.community_badge, smaller: true }, { children: _jsx(Avatar, { className: classes.avatar, alt: messageNotification.message.sender.username, variant: "circular", src: messageNotification.message.sender.avatar }) })) })), slotProps: {
|
|
187
|
+
title: { className: classes.title, variant: 'subtitle1' }
|
|
188
|
+
}, title: _jsxs(_Fragment, { children: [_jsx(Link, Object.assign({}, (!messageNotification.message.sender.deleted && {
|
|
188
189
|
to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, messageNotification.message.sender)
|
|
189
190
|
}), { onClick: messageNotification.message.sender.deleted ? () => setOpenAlert(true) : null, className: classes.username }, { children: messageNotification.message.sender.username })), ' ', intl.formatMessage(messages.receivePrivateMessage, {
|
|
190
191
|
total: notificationObject.aggregated.length,
|
|
@@ -202,7 +203,9 @@ export default function UserNotification(inProps) {
|
|
|
202
203
|
let groupNotification = notificationObject.aggregated[0];
|
|
203
204
|
return (_jsx(CardHeader, { className: classes.header, avatar: _jsx(Link, Object.assign({}, (!groupNotification.user.deleted && {
|
|
204
205
|
to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, groupNotification.user)
|
|
205
|
-
}), { onClick: groupNotification.user.deleted ? () => setOpenAlert(true) : null }, { children: _jsx(UserAvatar, Object.assign({ hide: !groupNotification.user.community_badge, smaller: true }, { children: _jsx(Avatar, { className: classes.avatar, alt: groupNotification.user.username, variant: "circular", src: groupNotification.user.avatar }) })) })),
|
|
206
|
+
}), { onClick: groupNotification.user.deleted ? () => setOpenAlert(true) : null }, { children: _jsx(UserAvatar, Object.assign({ hide: !groupNotification.user.community_badge, smaller: true }, { children: _jsx(Avatar, { className: classes.avatar, alt: groupNotification.user.username, variant: "circular", src: groupNotification.user.avatar }) })) })), slotProps: {
|
|
207
|
+
title: { className: classes.title, variant: 'subtitle1' }
|
|
208
|
+
}, title: _jsxs(_Fragment, { children: [_jsx(Link, Object.assign({}, (!groupNotification.user.deleted && {
|
|
206
209
|
to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, groupNotification.user)
|
|
207
210
|
}), { onClick: groupNotification.user.deleted ? () => setOpenAlert(true) : null, className: classes.username }, { children: groupNotification.user.username })), ' ', _jsx(FormattedMessage, { id: `ui.notification.${notificationObject.aggregated[0].type}`, defaultMessage: `ui.notification.${notificationObject.aggregated[0].type}`, values: {
|
|
208
211
|
group: groupNotification.group.name,
|
|
@@ -223,7 +226,12 @@ export default function UserNotification(inProps) {
|
|
|
223
226
|
notificationObject.aggregated[0].type === SCNotificationTypologyType.VOTE_UP ||
|
|
224
227
|
notificationObject.aggregated[0].type === SCNotificationTypologyType.CONTRIBUTION)) {
|
|
225
228
|
const contribution = getContribution(notificationObject);
|
|
226
|
-
return (_jsx(CardHeader, { className: classes.header,
|
|
229
|
+
return (_jsx(CardHeader, { className: classes.header, slotProps: {
|
|
230
|
+
title: {
|
|
231
|
+
className: classes.title,
|
|
232
|
+
variant: 'subtitle1'
|
|
233
|
+
}
|
|
234
|
+
}, title: _jsx(Link, Object.assign({ to: scRoutingContext.url(getContributionRouteName(contribution), getRouteData(notificationObject[contribution.type])) }, { children: getContributionSnippet(contribution) })), action: contribution && (_jsx(Tooltip, Object.assign({ title: contribution.suspended ? (_jsx(FormattedMessage, { id: 'ui.notification.notificationSuspended', defaultMessage: 'ui.notification.notificationSuspended' })) : (_jsx(FormattedMessage, { id: 'ui.notification.notificationSuspend', defaultMessage: 'ui.notification.notificationSuspend' })) }, { children: _jsx(Button, Object.assign({ variant: "text", size: "small", loading: loadingSuspendNotification, color: "inherit", classes: { root: classes.stopButton }, onClick: () => handleStopContentNotification(contribution) }, { children: contribution.suspended ? _jsx(Icon, Object.assign({ color: 'primary' }, { children: "notifications_off" })) : _jsx(Icon, Object.assign({ color: 'inherit' }, { children: "notifications_active" })) })) }))) }));
|
|
227
235
|
}
|
|
228
236
|
return null;
|
|
229
237
|
}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { useContext, useEffect, useMemo, useState } from 'react';
|
|
4
|
-
import { Avatar, Box, Stack, Typography, styled } from '@mui/material';
|
|
4
|
+
import { Avatar, Box, Button, Stack, Typography, styled } from '@mui/material';
|
|
5
5
|
import { Link, SCPreferences, SCRoutes, SCUserContext, useSCPreferences, useSCRouting } from '@selfcommunity/react-core';
|
|
6
6
|
import { defineMessages, FormattedMessage, useIntl } from 'react-intl';
|
|
7
7
|
import DateTimeAgo from '../../../shared/DateTimeAgo';
|
|
8
8
|
import classNames from 'classnames';
|
|
9
9
|
import { SCNotificationObjectTemplateType } from '../../../types';
|
|
10
10
|
import NotificationItem from '../../../shared/NotificationItem';
|
|
11
|
-
import { LoadingButton } from '@mui/lab';
|
|
12
11
|
import UserDeletedSnackBar from '../../../shared/UserDeletedSnackBar';
|
|
13
12
|
import UserAvatar from '../../../shared/UserAvatar';
|
|
14
13
|
import { PREFIX } from '../constants';
|
|
@@ -94,7 +93,7 @@ export default function PrivateMessageNotification(props) {
|
|
|
94
93
|
? scRoutingContext.url(SCRoutes.GROUP_MESSAGES_ROUTE_NAME, notificationObject.message.group)
|
|
95
94
|
: scRoutingContext.url(SCRoutes.USER_PRIVATE_MESSAGES_ROUTE_NAME, notificationObject.message.sender) }, { children: scUserContext.user && follower ? (_jsx(FormattedMessage, { id: "ui.userToastNotifications.replyMessage", defaultMessage: 'ui.userToastNotifications.replyMessage' })) : (_jsx(FormattedMessage, { id: "ui.userToastNotifications.viewMessage", defaultMessage: 'ui.userToastNotifications.viewMessage' })) })) }))] }))) }, rest)));
|
|
96
95
|
}
|
|
97
|
-
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, 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(
|
|
96
|
+
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, 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(Button, Object.assign({ color: "primary", variant: "outlined", size: "small", classes: { root: classes.replyButton }, component: Link, loading: notificationObject.message.sender.deleted
|
|
98
97
|
? null
|
|
99
98
|
: scUserContext.user
|
|
100
99
|
? follower === null || manager.isLoading(notificationObject.message.sender)
|
|
@@ -13,7 +13,6 @@ import { formatColorLabel, formatLogoLabel } from '../../../../utils/onBoarding'
|
|
|
13
13
|
import { defineMessages, FormattedMessage, useIntl } from 'react-intl';
|
|
14
14
|
import { SCOPE_SC_UI } from '../../../../constants/Errors';
|
|
15
15
|
import { Logger } from '@selfcommunity/utils';
|
|
16
|
-
import { LoadingButton } from '@mui/lab';
|
|
17
16
|
import ScrollContainer from '../../../../shared/ScrollContainer';
|
|
18
17
|
const messages = defineMessages({
|
|
19
18
|
titleField: {
|
|
@@ -178,9 +177,9 @@ export default function Appearance(inProps) {
|
|
|
178
177
|
}, []);
|
|
179
178
|
return (_jsxs(Root, Object.assign({ className: classNames(classes.root, className) }, { children: [_jsx(Typography, Object.assign({ variant: "h4", className: classes.title, alignSelf: "self-start" }, { children: _jsx(FormattedMessage, { id: "ui.onBoardingWidget.appearance", defaultMessage: "ui.onBoardingWidget.appearance" }) })), _jsx(Typography, Object.assign({ className: classes.summary }, { children: _jsx(FormattedMessage, { id: "ui.onBoardingWidget.step.appearance.summary", defaultMessage: "ui.onBoardingWidget.step.appearance.summary" }) })), _jsx(Button, Object.assign({ variant: "outlined", size: "small", color: "primary", onClick: handleOpen }, { children: _jsx(FormattedMessage, { id: "ui.onBoardingWidget.step.appearance.button", defaultMessage: "ui.onBoardingWidget.step.appearance.button" }) })), _jsxs(DrawerRoot, Object.assign({ className: classes.drawerRoot, anchor: "right", open: Boolean(anchorEl), onClose: handleClose }, { children: [_jsxs(Box, Object.assign({ className: classes.drawerHeader }, { children: [_jsx(Typography, Object.assign({ variant: "h4", color: "primary" }, { children: _jsx(FormattedMessage, { id: "ui.onBoardingWidget.step.appearance.header.title", defaultMessage: "ui.onBoardingWidget.step.appearance.header.title" }) })), _jsx(IconButton, Object.assign({ className: classes.drawerHeaderAction, onClick: handleClose }, { children: _jsx(Icon, { children: "close" }) }))] })), _jsxs(Tabs, Object.assign({ value: tab, onChange: handleTabChange, variant: "scrollable", scrollButtons: "auto", "aria-label": "scrollable-tabs" }, { children: [_jsx(Tab, { value: AppearanceTabType.COLOR, label: _jsx(FormattedMessage, { id: "ui.onBoardingWidget.step.appearance.colors.title", defaultMessage: "ui.onBoardingWidget.step.appearance.colors.title" }) }), _jsx(Tab, { value: AppearanceTabType.LOGO, label: _jsx(FormattedMessage, { id: "ui.onBoardingWidget.step.appearance.logo.title", defaultMessage: "ui.onBoardingWidget.step.appearance.logo.title" }) }), _jsx(Tab, { value: AppearanceTabType.SLOGAN, label: _jsx(FormattedMessage, { id: "ui.onBoardingWidget.step.appearance.titleSlogan.title", defaultMessage: "ui.onBoardingWidget.step.appearance.titleSlogan.title" }) })] })), _jsx(ScrollContainer, { children: _jsxs(Box, Object.assign({ className: classes.drawerContent }, { children: [tab === AppearanceTabType.COLOR && (_jsxs(Box, Object.assign({ className: classes.colorContainer }, { children: [preferences
|
|
180
179
|
.filter((item) => item.section === SCPreferenceSection.COLORS)
|
|
181
|
-
.map((color) => (_jsxs(React.Fragment, { children: [_jsx(Typography, Object.assign({ variant: "h6" }, { children: formatColorLabel(color) })), _jsx(Box, { children: _jsx(MuiColorInput, { inputRef: colorRef, className: classes.color, format: "hex", value: color.value, onChange: (value) => handleColorChange(value, color.name), isAlphaHidden: true, PopoverProps: { onClose: handleClosePopover } }) })] }, color.id))), _jsx(
|
|
180
|
+
.map((color) => (_jsxs(React.Fragment, { children: [_jsx(Typography, Object.assign({ variant: "h6" }, { children: formatColorLabel(color) })), _jsx(Box, { children: _jsx(MuiColorInput, { inputRef: colorRef, className: classes.color, format: "hex", value: color.value, onChange: (value) => handleColorChange(value, color.name), isAlphaHidden: true, PopoverProps: { onClose: handleClosePopover } }) })] }, color.id))), _jsx(Button, Object.assign({ loading: loading || updating, disabled: loading || updating || Object.keys(data).length === 0, variant: "outlined", size: "small", color: "primary", onClick: updatePreference }, { children: _jsx(FormattedMessage, { id: "ui.onBoardingWidget.step.appearance.titleSlogan.button", defaultMessage: "ui.onBoardingWidget.step.appearance.titleSlogan.button" }) }))] }))), tab === AppearanceTabType.LOGO && (_jsx(_Fragment, { children: preferences
|
|
182
181
|
.filter((item) => item.section === SCPreferenceSection.LOGO)
|
|
183
|
-
.map((logo) => (_jsxs(React.Fragment, { children: [_jsx(Typography, Object.assign({ variant: "h6" }, { children: formatLogoLabel(logo.name) })), _jsxs(Box, Object.assign({ className: classes.logoContainer }, { children: [_jsx("img", { src: logo.value, className: classes.logo }), _jsx("input", { type: "file", onChange: (event) => handleUpload(event, logo.name), hidden: true, accept: ".gif,.png,.jpg,.jpeg", id: logo.name }), _jsx(
|
|
182
|
+
.map((logo) => (_jsxs(React.Fragment, { children: [_jsx(Typography, Object.assign({ variant: "h6" }, { children: formatLogoLabel(logo.name) })), _jsxs(Box, Object.assign({ className: classes.logoContainer }, { children: [_jsx("img", { src: logo.value, className: classes.logo }), _jsx("input", { type: "file", onChange: (event) => handleUpload(event, logo.name), hidden: true, accept: ".gif,.png,.jpg,.jpeg", id: logo.name }), _jsx(Button, Object.assign({ className: classes.uploadButton, onClick: () => document.getElementById(`${logo.name}`).click(), loading: Boolean(loadingLogo) && Boolean(logo.name === loadingLogo), disabled: Boolean(loadingLogo) && Boolean(logo.name !== loadingLogo) }, { children: _jsx(Icon, { children: "upload" }) }))] }))] }, logo.id))) })), tab === AppearanceTabType.SLOGAN && (_jsxs(Box, { children: [_jsx(TextField, { multiline: true, fullWidth: true, label: `${intl.formatMessage(messages.titleField)}`, margin: "normal", value: ((_a = preferences === null || preferences === void 0 ? void 0 : preferences.find((item) => item.section === 'text' && item.name === 'application_slogan1')) === null || _a === void 0 ? void 0 : _a.value) || '', name: "application_slogan1", onChange: handleChange, slotProps: {
|
|
184
183
|
input: {
|
|
185
184
|
endAdornment: (_jsx(Typography, Object.assign({ variant: "body2" }, { children: ((_c = (_b = preferences === null || preferences === void 0 ? void 0 : preferences.find((item) => item.section === 'text' && item.name === 'application_slogan1')) === null || _b === void 0 ? void 0 : _b.value) === null || _c === void 0 ? void 0 : _c.length)
|
|
186
185
|
? 50 - ((_d = preferences === null || preferences === void 0 ? void 0 : preferences.find((item) => item.section === 'text' && item.name === 'application_slogan1')) === null || _d === void 0 ? void 0 : _d.value.length)
|
|
@@ -192,5 +191,5 @@ export default function Appearance(inProps) {
|
|
|
192
191
|
? 150 - ((_k = preferences === null || preferences === void 0 ? void 0 : preferences.find((item) => item.section === 'text' && item.name === 'application_slogan2')) === null || _k === void 0 ? void 0 : _k.value.length)
|
|
193
192
|
: 150 })))
|
|
194
193
|
}
|
|
195
|
-
}, error: Boolean(((_m = (_l = preferences === null || preferences === void 0 ? void 0 : preferences.find((item) => item.section === 'text' && item.name === 'application_slogan2')) === null || _l === void 0 ? void 0 : _l.value) === null || _m === void 0 ? void 0 : _m.length) > 150) }), _jsx(
|
|
194
|
+
}, error: Boolean(((_m = (_l = preferences === null || preferences === void 0 ? void 0 : preferences.find((item) => item.section === 'text' && item.name === 'application_slogan2')) === null || _l === void 0 ? void 0 : _l.value) === null || _m === void 0 ? void 0 : _m.length) > 150) }), _jsx(Button, Object.assign({ loading: updating, disabled: updating || Object.keys(data).length === 0, variant: "outlined", size: "small", color: "primary", onClick: updatePreference }, { children: _jsx(FormattedMessage, { id: "ui.onBoardingWidget.step.appearance.titleSlogan.button", defaultMessage: "ui.onBoardingWidget.step.appearance.titleSlogan.button" }) }))] }))] })) })] }))] })));
|
|
196
195
|
}
|
|
@@ -3,7 +3,6 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
3
3
|
import { useCallback, useEffect, useState } from 'react';
|
|
4
4
|
import { Box, Chip, Paper, Table, TableBody, Skeleton, TableCell, TableContainer, TableHead, TableRow, Typography, Stack, CircularProgress, styled, Grid, TextField, InputAdornment, IconButton, Icon, Button, useTheme, useMediaQuery, MenuItem } from '@mui/material';
|
|
5
5
|
import { defineMessages, FormattedMessage, useIntl } from 'react-intl';
|
|
6
|
-
import LoadingButton from '@mui/lab/LoadingButton';
|
|
7
6
|
import { useInView } from 'react-intersection-observer';
|
|
8
7
|
import { PaymentService } from '@selfcommunity/api-services';
|
|
9
8
|
import { useThemeProps } from '@mui/system';
|
|
@@ -22,8 +21,8 @@ import { SCOPE_SC_UI } from '../../constants/Errors';
|
|
|
22
21
|
import HiddenPlaceholder from '../../shared/HiddenPlaceholder';
|
|
23
22
|
import { LocalizationProvider, MobileDatePicker } from '@mui/x-date-pickers';
|
|
24
23
|
import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns';
|
|
25
|
-
import
|
|
26
|
-
import
|
|
24
|
+
import { it } from 'date-fns/locale/it';
|
|
25
|
+
import { enUS } from 'date-fns/locale/en-US';
|
|
27
26
|
import Category from '../Category';
|
|
28
27
|
const PREFIX = 'SCPaymentOrders';
|
|
29
28
|
const messages = defineMessages({
|
|
@@ -207,7 +206,7 @@ export default function PaymentOrders(inProps) {
|
|
|
207
206
|
const skeleton = () => {
|
|
208
207
|
return (_jsxs(TableRow, Object.assign({ ref: ref }, { children: [_jsx(TableCell, Object.assign({ component: "th", scope: "row" }, { children: _jsx(Skeleton, { variant: "text", height: 40, width: 20 }) })), _jsx(TableCell, Object.assign({ component: "th", scope: "row" }, { children: _jsx(Skeleton, { variant: "text", height: 40, width: 30 }) })), _jsx(TableCell, Object.assign({ component: "th", scope: "row" }, { children: _jsx(Skeleton, { variant: "text", height: 80, width: 250 }) })), _jsx(TableCell, Object.assign({ component: "th", scope: "row" }, { children: _jsx(Skeleton, { variant: "text", height: 40, width: 65 }) })), _jsx(TableCell, Object.assign({ component: "th", scope: "row" }, { children: _jsx(Skeleton, { variant: "text", height: 40, width: 65 }) })), _jsx(TableCell, Object.assign({ component: "th", scope: "row" }, { children: _jsx(Skeleton, { variant: "text", height: 40, width: 65 }) })), _jsx(TableCell, Object.assign({ component: "th", scope: "row" }, { children: _jsx(Skeleton, { variant: "text", height: 40, width: 65 }) })), _jsx(TableCell, Object.assign({ component: "th", scope: "row" }, { children: _jsx(Skeleton, { variant: "text", height: 40, width: 65 }) }))] })));
|
|
209
208
|
};
|
|
210
|
-
return (_jsxs(Root, Object.assign({ variant: "outlined", className: classNames(classes.root, className) }, rest, { children: [_jsxs(Grid, Object.assign({ container: true, width: "100%", className: classes.filters, gap: 3 }, { children: [_jsx(Grid, Object.assign({ size: { md: 3 } }, { children: _jsx(TextField, { className: classes.search, size: "small", fullWidth: true, value: query, label: _jsx(FormattedMessage, { id: "ui.paymentOrders.search", defaultMessage: "ui.paymentOrders.search" }), variant: "outlined", onChange: handleChange, disabled: isLoading, onKeyUp: (e) => {
|
|
209
|
+
return (_jsxs(Root, Object.assign({ variant: "outlined", className: classNames(classes.root, className) }, rest, { children: [_jsxs(Grid, Object.assign({ container: true, width: "100%", className: classes.filters, gap: 3 }, { children: [_jsx(Grid, Object.assign({ size: { xs: 12, md: 3 } }, { children: _jsx(TextField, { className: classes.search, size: "small", fullWidth: true, value: query, label: _jsx(FormattedMessage, { id: "ui.paymentOrders.search", defaultMessage: "ui.paymentOrders.search" }), variant: "outlined", onChange: handleChange, disabled: isLoading, onKeyUp: (e) => {
|
|
211
210
|
e.preventDefault();
|
|
212
211
|
if (e.key === 'Enter') {
|
|
213
212
|
fetchInvoices();
|
|
@@ -219,7 +218,7 @@ export default function PaymentOrders(inProps) {
|
|
|
219
218
|
fetchInvoices('');
|
|
220
219
|
}, disabled: isLoading }, { children: _jsx(Icon, { children: "close" }) }))), isMobile ? (_jsx(IconButton, { onClick: () => fetchInvoices(), disabled: isLoading })) : (_jsx(Button, { size: "small", variant: "contained", color: "secondary", onClick: () => fetchInvoices(), endIcon: _jsx(Icon, { children: "search" }), disabled: isLoading }))] })))
|
|
221
220
|
}
|
|
222
|
-
} }) })), _jsx(Grid, Object.assign({ size: { md: 3 } }, { children: _jsx(TextField, Object.assign({ select: true, fullWidth: true, disabled: isLoading, size: "small", label: _jsx(FormattedMessage, { id: "ui.paymentOrders.contentTypeFilter", defaultMessage: "ui.paymentOrders.contentTypeFilter" }), value: contentTypeFilter, onChange: handleContentTypeChange }, { children: options.map((option) => (_jsx(MenuItem, Object.assign({ value: option.value }, { children: option.label }), option.value))) })) })), _jsx(Grid, Object.assign({ size: { sm: 8, md: 4 } }, { children: _jsx(LocalizationProvider, Object.assign({ dateAdapter: AdapterDateFns, adapterLocale: scContext.settings.locale.default === 'it' ?
|
|
221
|
+
} }) })), _jsx(Grid, Object.assign({ size: { xs: 12, md: 3 } }, { children: _jsx(TextField, Object.assign({ select: true, fullWidth: true, disabled: isLoading, size: "small", label: _jsx(FormattedMessage, { id: "ui.paymentOrders.contentTypeFilter", defaultMessage: "ui.paymentOrders.contentTypeFilter" }), value: contentTypeFilter, onChange: handleContentTypeChange }, { children: options.map((option) => (_jsx(MenuItem, Object.assign({ value: option.value }, { children: option.label }), option.value))) })) })), _jsx(Grid, Object.assign({ size: { xs: 12, sm: 8, md: 4 } }, { children: _jsx(LocalizationProvider, Object.assign({ dateAdapter: AdapterDateFns, adapterLocale: scContext.settings.locale.default === 'it' ? it : enUS, localeText: {
|
|
223
222
|
cancelButtonLabel: `${intl.formatMessage(messages.pickerCancelAction)}`,
|
|
224
223
|
clearButtonLabel: `${intl.formatMessage(messages.pickerClearAction)}`
|
|
225
224
|
} }, { children: _jsxs(Grid, Object.assign({ container: true, width: "100%", spacing: 2 }, { children: [_jsx(Grid, Object.assign({ size: 6 }, { children: _jsx(MobileDatePicker, { className: classes.picker, label: _jsx(FormattedMessage, { id: "ui.paymentOrders.dateFrom", defaultMessage: "ui.paymentOrders.dateFrom" }), value: startDate, slots: {
|
|
@@ -263,5 +262,5 @@ export default function PaymentOrders(inProps) {
|
|
|
263
262
|
hour: 'numeric',
|
|
264
263
|
minute: 'numeric'
|
|
265
264
|
})
|
|
266
|
-
: '-' })), _jsx(TableCell, Object.assign({ scope: "row" }, { children: _jsx(Chip, { variant: 'outlined', label: _jsx(FormattedMessage, { id: "ui.paymentOrders.status.paid", defaultMessage: "ui.paymentOrders.status.paid" }), color: "success", size: "small" }) })), _jsx(TableCell, Object.assign({ scope: "row" }, { children: _jsxs(Stack, Object.assign({ direction: "row", justifyContent: "left", alignItems: "center", spacing: 2 }, { children: [order.content_type === SCContentType.EVENT && _jsx(PaymentOrderPdfButton, { paymentOrder: order }), Boolean(!order.paid && order.billing_reason === 'subscription_create') && (_jsx(
|
|
265
|
+
: '-' })), _jsx(TableCell, Object.assign({ scope: "row" }, { children: _jsx(Chip, { variant: 'outlined', label: _jsx(FormattedMessage, { id: "ui.paymentOrders.status.paid", defaultMessage: "ui.paymentOrders.status.paid" }), color: "success", size: "small" }) })), _jsx(TableCell, Object.assign({ scope: "row" }, { children: _jsxs(Stack, Object.assign({ direction: "row", justifyContent: "left", alignItems: "center", spacing: 2 }, { children: [order.content_type === SCContentType.EVENT && _jsx(PaymentOrderPdfButton, { paymentOrder: order }), Boolean(!order.paid && order.billing_reason === 'subscription_create') && (_jsx(Button, Object.assign({ size: "small", variant: "contained", disabled: true }, { children: _jsx(FormattedMessage, { id: "ui.paymentOrders.pay", defaultMessage: "ui.paymentOrders.pay" }) })))] })) }))] }, index))), orders.length < 1 && (_jsx(TableRow, { children: _jsx(TableCell, Object.assign({ align: "left", colSpan: 6 }, { children: _jsx(Typography, Object.assign({ variant: "body2" }, { children: _jsx(FormattedMessage, { id: "ui.paymentOrders.noOrders", defaultMessage: "ui.paymentOrders.noOrders" }) })) })) })), hasMore && _jsx(_Fragment, { children: skeleton() })] })] })) }))) : (_jsx(CircularProgress, {})) }))] })));
|
|
267
266
|
}
|
|
@@ -39,5 +39,5 @@ export default function PaymentProductsSkeleton(inProps) {
|
|
|
39
39
|
// HOOKS
|
|
40
40
|
const theme = useTheme();
|
|
41
41
|
const isMobile = useMediaQuery(theme.breakpoints.down('md'));
|
|
42
|
-
return (_jsx(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { children: _jsx(Grid, Object.assign({ container: true, width: "100%", spacing: { xs: 3 }, className: classes.products }, { children: [...Array(isMobile ? 1 : 2)].map((_product, index) => (_jsx(Grid, { children: _jsx(PaymentProductSkeleton, Object.assign({ elevation: 0, variant: "outlined" }, PaymentProductSkeletonProps)) }, index))) })) })));
|
|
42
|
+
return (_jsx(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { children: _jsx(Grid, Object.assign({ container: true, width: "100%", spacing: { xs: 3 }, className: classes.products }, { children: [...Array(isMobile ? 1 : 2)].map((_product, index) => (_jsx(Grid, Object.assign({ size: 12 }, { children: _jsx(PaymentProductSkeleton, Object.assign({ elevation: 0, variant: "outlined" }, PaymentProductSkeletonProps)) }), index))) })) })));
|
|
43
43
|
}
|