@selfcommunity/react-ui 0.8.0-live.80 → 0.8.0-live.85
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/onBoarding/android.d.ts +1 -1
- package/lib/cjs/assets/onBoarding/android.js +1 -1
- package/lib/cjs/components/CategoryFollowersButton/CategoryFollowersButton.d.ts +2 -2
- package/lib/cjs/components/CategoryFollowersButton/CategoryFollowersButton.js +20 -15
- package/lib/cjs/components/CommentObject/CommentObject.js +6 -3
- package/lib/cjs/components/CommentObjectReply/CommentObjectReply.js +4 -1
- package/lib/cjs/components/CreateEventButton/CreateEventButton.d.ts +1 -1
- package/lib/cjs/components/CreateEventButton/CreateEventButton.js +1 -1
- package/lib/cjs/components/EditEventButton/EditEventButton.js +2 -2
- package/lib/cjs/components/Editor/plugins/AutoLinkPlugin.js +7 -1
- package/lib/cjs/components/Event/Event.js +4 -4
- package/lib/cjs/components/EventForm/EventAddress.js +5 -8
- package/lib/cjs/components/EventForm/EventForm.js +32 -25
- package/lib/cjs/components/EventForm/constants.d.ts +4 -4
- package/lib/cjs/components/EventForm/constants.js +4 -4
- package/lib/cjs/components/EventForm/utils.d.ts +3 -3
- package/lib/cjs/components/EventForm/utils.js +8 -5
- package/lib/cjs/components/EventHeader/EventHeader.js +4 -35
- package/lib/cjs/components/EventInviteButton/EventInviteButton.js +5 -5
- package/lib/cjs/components/EventLocationWidget/EventLocationWidget.js +3 -7
- package/lib/cjs/components/EventMembersWidget/TabContentComponent.js +1 -1
- package/lib/cjs/components/EventParticipantsButton/EventParticipantsButton.js +9 -5
- package/lib/cjs/components/EventSubscribeButton/EventSubscribeButton.d.ts +2 -2
- package/lib/cjs/components/EventSubscribeButton/EventSubscribeButton.js +14 -16
- package/lib/cjs/components/Events/Events.js +12 -35
- package/lib/cjs/components/Events/PastEventsFilter.js +2 -12
- package/lib/cjs/components/FeedObject/Actions/Share/Share.js +1 -1
- package/lib/cjs/components/FeedObject/FeedObject.js +5 -6
- package/lib/cjs/components/GroupMembersButton/GroupMembersButton.d.ts +2 -2
- package/lib/cjs/components/GroupMembersButton/GroupMembersButton.js +20 -15
- package/lib/cjs/components/LiveStreamRoom/LiveStreamRoom.js +6 -1
- package/lib/cjs/components/NavigationMenuIconButton/DefaultDrawerContent.js +24 -2
- package/lib/cjs/components/NavigationToolbar/NavigationToolbar.js +1 -1
- package/lib/cjs/components/Notification/Comment/Comment.js +2 -2
- package/lib/cjs/components/Notification/Notification.js +1 -1
- package/lib/cjs/components/OnBoardingWidget/OnBoardingWidget.js +2 -2
- package/lib/cjs/components/OnBoardingWidget/Steps/App/App.js +2 -1
- package/lib/cjs/components/OnBoardingWidget/Steps/Appearance/Appearance.js +65 -104
- package/lib/cjs/components/PrivateMessageThread/PrivateMessageThread.js +4 -7
- package/lib/cjs/components/SearchAutocomplete/SearchAutocomplete.js +3 -2
- package/lib/cjs/components/Skeleton/AvatarGroupSkeleton.js +4 -4
- package/lib/cjs/components/SuggestedEventsWidget/Arrow.js +2 -1
- package/lib/cjs/components/TagAutocomplete/TagAutocomplete.d.ts +44 -0
- package/lib/cjs/components/TagAutocomplete/TagAutocomplete.js +92 -0
- package/lib/cjs/components/TagAutocomplete/index.d.ts +3 -0
- package/lib/cjs/components/TagAutocomplete/index.js +5 -0
- package/lib/cjs/components/UserActionIconButton/UserActionIconButton.js +24 -2
- package/lib/cjs/components/UserProfileEdit/Section/PublicInfo.js +1 -1
- package/lib/cjs/components/UserProfileEdit/UserProfileEdit.d.ts +1 -1
- package/lib/cjs/components/UserProfileEdit/UserProfileEdit.js +1 -1
- package/lib/cjs/components/UserSocialAssociation/UserSocialAssociation.js +16 -4
- package/lib/cjs/constants/SocialShare.d.ts +12 -0
- package/lib/cjs/constants/SocialShare.js +15 -2
- package/lib/cjs/index.d.ts +3 -2
- package/lib/cjs/index.js +6 -2
- package/lib/cjs/shared/CopyTextArea/index.d.ts +10 -0
- package/lib/cjs/shared/CopyTextArea/index.js +77 -0
- package/lib/cjs/utils/buttonCounters.d.ts +1 -0
- package/lib/cjs/utils/buttonCounters.js +15 -0
- package/lib/cjs/utils/contribution.d.ts +7 -0
- package/lib/cjs/utils/contribution.js +13 -1
- package/lib/cjs/utils/string.js +1 -1
- package/lib/esm/assets/onBoarding/android.d.ts +1 -1
- package/lib/esm/assets/onBoarding/android.js +1 -1
- package/lib/esm/components/CategoryFollowersButton/CategoryFollowersButton.d.ts +2 -2
- package/lib/esm/components/CategoryFollowersButton/CategoryFollowersButton.js +20 -15
- package/lib/esm/components/CommentObject/CommentObject.js +8 -5
- package/lib/esm/components/CommentObjectReply/CommentObjectReply.js +5 -2
- package/lib/esm/components/CreateEventButton/CreateEventButton.d.ts +1 -1
- package/lib/esm/components/CreateEventButton/CreateEventButton.js +1 -1
- package/lib/esm/components/EditEventButton/EditEventButton.js +2 -2
- package/lib/esm/components/Editor/plugins/AutoLinkPlugin.js +7 -1
- package/lib/esm/components/Event/Event.js +4 -4
- package/lib/esm/components/EventForm/EventAddress.js +6 -9
- package/lib/esm/components/EventForm/EventForm.js +32 -25
- package/lib/esm/components/EventForm/constants.d.ts +4 -4
- package/lib/esm/components/EventForm/constants.js +4 -4
- package/lib/esm/components/EventForm/utils.d.ts +3 -3
- package/lib/esm/components/EventForm/utils.js +8 -5
- package/lib/esm/components/EventHeader/EventHeader.js +5 -36
- package/lib/esm/components/EventInviteButton/EventInviteButton.js +5 -5
- package/lib/esm/components/EventLocationWidget/EventLocationWidget.js +5 -9
- package/lib/esm/components/EventMembersWidget/TabContentComponent.js +1 -1
- package/lib/esm/components/EventParticipantsButton/EventParticipantsButton.js +9 -5
- package/lib/esm/components/EventSubscribeButton/EventSubscribeButton.d.ts +2 -2
- package/lib/esm/components/EventSubscribeButton/EventSubscribeButton.js +16 -18
- package/lib/esm/components/Events/Events.js +11 -34
- package/lib/esm/components/Events/PastEventsFilter.js +2 -12
- package/lib/esm/components/FeedObject/Actions/Share/Share.js +1 -1
- package/lib/esm/components/FeedObject/FeedObject.js +5 -6
- package/lib/esm/components/GroupMembersButton/GroupMembersButton.d.ts +2 -2
- package/lib/esm/components/GroupMembersButton/GroupMembersButton.js +20 -15
- package/lib/esm/components/LiveStreamRoom/LiveStreamRoom.js +8 -3
- package/lib/esm/components/NavigationMenuIconButton/DefaultDrawerContent.js +27 -5
- package/lib/esm/components/NavigationToolbar/NavigationToolbar.js +1 -1
- package/lib/esm/components/Notification/Comment/Comment.js +2 -2
- package/lib/esm/components/Notification/Notification.js +1 -1
- package/lib/esm/components/OnBoardingWidget/OnBoardingWidget.js +2 -2
- package/lib/esm/components/OnBoardingWidget/Steps/App/App.js +2 -1
- package/lib/esm/components/OnBoardingWidget/Steps/Appearance/Appearance.js +67 -106
- package/lib/esm/components/PrivateMessageThread/PrivateMessageThread.js +4 -7
- package/lib/esm/components/SearchAutocomplete/SearchAutocomplete.js +3 -2
- package/lib/esm/components/Skeleton/AvatarGroupSkeleton.js +4 -4
- package/lib/esm/components/SuggestedEventsWidget/Arrow.js +2 -1
- package/lib/esm/components/TagAutocomplete/TagAutocomplete.d.ts +44 -0
- package/lib/esm/components/TagAutocomplete/TagAutocomplete.js +90 -0
- package/lib/esm/components/TagAutocomplete/index.d.ts +3 -0
- package/lib/esm/components/TagAutocomplete/index.js +2 -0
- package/lib/esm/components/UserActionIconButton/UserActionIconButton.js +24 -2
- package/lib/esm/components/UserProfileEdit/Section/PublicInfo.js +1 -1
- package/lib/esm/components/UserProfileEdit/UserProfileEdit.d.ts +1 -1
- package/lib/esm/components/UserProfileEdit/UserProfileEdit.js +1 -1
- package/lib/esm/components/UserSocialAssociation/UserSocialAssociation.js +18 -6
- package/lib/esm/constants/SocialShare.d.ts +12 -0
- package/lib/esm/constants/SocialShare.js +13 -0
- package/lib/esm/index.d.ts +3 -2
- package/lib/esm/index.js +3 -2
- package/lib/esm/shared/CopyTextArea/index.d.ts +10 -0
- package/lib/esm/shared/CopyTextArea/index.js +74 -0
- package/lib/esm/utils/buttonCounters.d.ts +1 -0
- package/lib/esm/utils/buttonCounters.js +11 -0
- package/lib/esm/utils/contribution.d.ts +7 -0
- package/lib/esm/utils/contribution.js +11 -0
- package/lib/esm/utils/string.js +1 -1
- package/lib/umd/2aa155858f48b8f3911a.eot +0 -0
- package/lib/umd/36f3af7f155d916c26ff.woff2 +0 -0
- package/lib/umd/749.js +2 -0
- package/lib/umd/80884d7cc0fcb1a47982.svg +1 -0
- package/lib/umd/a221d3aba0f6753cfbb7.ttf +0 -0
- package/lib/umd/assets/icons.svg +251 -0
- package/lib/umd/c3528e120c4e831db2ae.woff +0 -0
- package/lib/umd/react-ui.js +1 -1
- package/package.json +9 -8
- package/lib/cjs/components/OnBoardingWidget/Steps/Appearance/reducer.d.ts +0 -15
- package/lib/cjs/components/OnBoardingWidget/Steps/Appearance/reducer.js +0 -42
- package/lib/esm/components/OnBoardingWidget/Steps/Appearance/reducer.d.ts +0 -15
- package/lib/esm/components/OnBoardingWidget/Steps/Appearance/reducer.js +0 -37
- package/lib/umd/32.js +0 -2
- /package/lib/umd/{32.js.LICENSE.txt → 749.js.LICENSE.txt} +0 -0
|
@@ -21,6 +21,7 @@ const LiveStreamProvider_1 = require("./LiveStreamVideoConference/LiveStreamProv
|
|
|
21
21
|
const notistack_1 = require("notistack");
|
|
22
22
|
const DialogContent_1 = tslib_1.__importDefault(require("@mui/material/DialogContent"));
|
|
23
23
|
const BaseDialog_1 = tslib_1.__importDefault(require("../../shared/BaseDialog"));
|
|
24
|
+
const CopyTextArea_1 = tslib_1.__importDefault(require("../../shared/CopyTextArea"));
|
|
24
25
|
const classes = {
|
|
25
26
|
root: `${constants_1.PREFIX}-root`,
|
|
26
27
|
content: `${constants_1.PREFIX}-content`,
|
|
@@ -32,6 +33,7 @@ const classes = {
|
|
|
32
33
|
preJoin: `${constants_1.PREFIX}-prejoin`,
|
|
33
34
|
preJoinLoading: `${constants_1.PREFIX}-prejoin-loading`,
|
|
34
35
|
prejoinLoader: `${constants_1.PREFIX}-prejoin-loader`,
|
|
36
|
+
shareLink: `${constants_1.PREFIX}-share-link`,
|
|
35
37
|
endPrejoinContent: `${constants_1.PREFIX}-end-prejoin-content`,
|
|
36
38
|
conference: `${constants_1.PREFIX}-conference`,
|
|
37
39
|
error: `${constants_1.PREFIX}-error`
|
|
@@ -80,6 +82,7 @@ function LiveStreamRoom(inProps) {
|
|
|
80
82
|
const { id = `live_stream_room_object_${props.liveStreamId ? props.liveStreamId : props.liveStream ? props.liveStream.id : ''}`, liveStreamId = null, liveStream = null, className, showPrejoinTitle = true, showPrejoinDescription = false, startPrejoinContent, endPrejoinContent, presetConnectionDetails, presetPreJoinChoices, LiveStreamVideoConferenceComponentProps = { options: { codec: 'vp8', hq: false } } } = props, rest = tslib_1.__rest(props, ["id", "liveStreamId", "liveStream", "className", "showPrejoinTitle", "showPrejoinDescription", "startPrejoinContent", "endPrejoinContent", "presetConnectionDetails", "presetPreJoinChoices", "LiveStreamVideoConferenceComponentProps"]);
|
|
81
83
|
// CONTEXT
|
|
82
84
|
const scUserContext = (0, react_core_1.useSCUser)();
|
|
85
|
+
const scRoutingContext = (0, react_core_1.useSCRouting)();
|
|
83
86
|
const { preferences, features } = (0, react_core_1.useSCPreferences)();
|
|
84
87
|
// STATE
|
|
85
88
|
const { scLiveStream } = (0, react_core_1.useSCFetchLiveStream)({ id: liveStreamId, liveStream });
|
|
@@ -100,6 +103,8 @@ function LiveStreamRoom(inProps) {
|
|
|
100
103
|
features.includes(types_1.SCFeatureName.LIVE_STREAM) &&
|
|
101
104
|
react_core_1.SCPreferences.CONFIGURATIONS_LIVE_STREAM_ENABLED in preferences &&
|
|
102
105
|
preferences[react_core_1.SCPreferences.CONFIGURATIONS_LIVE_STREAM_ENABLED].value, [preferences, features]);
|
|
106
|
+
const scPreferencesContext = (0, react_1.useContext)(react_core_1.SCPreferencesContext);
|
|
107
|
+
const appUrl = (0, react_1.useMemo)(() => scPreferencesContext.preferences && scPreferencesContext.preferences[react_core_1.SCPreferences.CONFIGURATIONS_APP_URL].value, [scPreferencesContext.preferences]);
|
|
103
108
|
// INTL
|
|
104
109
|
const intl = (0, react_intl_1.useIntl)();
|
|
105
110
|
// MESSAGES
|
|
@@ -184,6 +189,6 @@ function LiveStreamRoom(inProps) {
|
|
|
184
189
|
}), camLabel: intl.formatMessage({ id: 'ui.liveStreamRoom.preJoin.camera', defaultMessage: 'ui.liveStreamRoom.preJoin.camera' }), userLabel: intl.formatMessage({ id: 'ui.liveStreamRoom.preJoin.username', defaultMessage: 'ui.liveStreamRoom.preJoin.username' }) }) })), loading && ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.prejoinLoader }, { children: [(0, jsx_runtime_1.jsx)(material_1.CircularProgress, {}), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ component: 'div', variant: "body2" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamRoom.connecting", defaultMessage: "ui.liveStreamRoom.connecting" }) }))] })))] })), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.endPrejoinContent }, { children: [Boolean(scUserContext.user &&
|
|
185
190
|
scUserContext.user.id !== scLiveStream.host.id &&
|
|
186
191
|
scLiveStream &&
|
|
187
|
-
(((_a = scLiveStream.settings) === null || _a === void 0 ? void 0 : _a.muteParticipants) || (scLiveStream && ((_b = scLiveStream.settings) === null || _b === void 0 ? void 0 : _b.disableVideo)))) && ((0, jsx_runtime_1.
|
|
192
|
+
(((_a = scLiveStream.settings) === null || _a === void 0 ? void 0 : _a.muteParticipants) || (scLiveStream && ((_b = scLiveStream.settings) === null || _b === void 0 ? void 0 : _b.disableVideo)))) && ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ sx: { width: '47%' }, spacing: 1 }, { children: [scLiveStream && (((_c = scLiveStream.settings) === null || _c === void 0 ? void 0 : _c.muteParticipants) || ((_d = scLiveStream.settings) === null || _d === void 0 ? void 0 : _d.disableVideo)) && ((0, jsx_runtime_1.jsxs)(material_1.Alert, Object.assign({ variant: "filled", severity: "info" }, { children: [(0, jsx_runtime_1.jsx)(material_1.AlertTitle, { children: (0, jsx_runtime_1.jsx)("b", { children: "Info" }) }), ((_e = scLiveStream.settings) === null || _e === void 0 ? void 0 : _e.muteParticipants) && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["-", ' ', (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamRoom.hostDisableMicrophone", defaultMessage: "ui.liveStreamRoom.hostDisableMicrophone" }), (0, jsx_runtime_1.jsx)("br", {})] })), ((_f = scLiveStream.settings) === null || _f === void 0 ? void 0 : _f.disableVideo) && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["- ", (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamRoom.hostDisableVideo", defaultMessage: "ui.liveStreamRoom.hostDisableVideo" })] }))] }))), (0, jsx_runtime_1.jsx)(CopyTextArea_1.default, { className: classes.shareLink, value: `${appUrl}${scRoutingContext.url(react_core_1.SCRoutes.LIVESTREAM_ROUTE_NAME, scLiveStream)}`, label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamRoom.shareLink", defaultMessage: "ui.liveStreamRoom.shareLink" }) })] }))), endPrejoinContent] }))] })) : ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.conference }, { children: (0, jsx_runtime_1.jsx)(LiveStreamProvider_1.LiveStreamContext.Provider, Object.assign({ value: { liveStream: scLiveStream } }, { children: (0, jsx_runtime_1.jsx)(LiveStreamVideoConference_1.default, Object.assign({ connectionDetails: connectionDetails, userChoices: preJoinChoices }, LiveStreamVideoConferenceComponentProps)) })) }))) }))) })));
|
|
188
193
|
}
|
|
189
194
|
exports.default = LiveStreamRoom;
|
|
@@ -8,12 +8,16 @@ const react_1 = require("react");
|
|
|
8
8
|
const Category_1 = tslib_1.__importDefault(require("../Category"));
|
|
9
9
|
const react_intl_1 = require("react-intl");
|
|
10
10
|
const utils_1 = require("@selfcommunity/utils");
|
|
11
|
+
const types_1 = require("@selfcommunity/types");
|
|
11
12
|
const styles_1 = require("@mui/material/styles");
|
|
12
13
|
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
13
14
|
const system_1 = require("@mui/system");
|
|
14
15
|
const PREFIX = 'SCDefaultDrawerContent';
|
|
15
16
|
const classes = {
|
|
16
|
-
root: `${PREFIX}-root
|
|
17
|
+
root: `${PREFIX}-root`,
|
|
18
|
+
navigation: `${PREFIX}-navigation`,
|
|
19
|
+
noResults: `${PREFIX}-no-results`,
|
|
20
|
+
title: `${PREFIX}-title`
|
|
17
21
|
};
|
|
18
22
|
const Root = (0, styles_1.styled)(material_1.Box, {
|
|
19
23
|
name: PREFIX,
|
|
@@ -31,8 +35,26 @@ function DefaultDrawerContent(inProps) {
|
|
|
31
35
|
const [categoriesOrdered, setCategoriesOrdered] = (0, react_1.useState)([]);
|
|
32
36
|
// ROUTING
|
|
33
37
|
const scRoutingContext = (0, react_core_1.useSCRouting)();
|
|
38
|
+
// CONTEXT
|
|
39
|
+
const scUserContext = (0, react_core_1.useSCUser)();
|
|
40
|
+
// PREFERENCES
|
|
41
|
+
const { preferences, features } = (0, react_core_1.useSCPreferences)();
|
|
34
42
|
//STATE
|
|
35
43
|
const [isHovered, setIsHovered] = (0, react_1.useState)({});
|
|
44
|
+
// MEMO
|
|
45
|
+
const groupsEnabled = (0, react_1.useMemo)(() => preferences &&
|
|
46
|
+
features &&
|
|
47
|
+
features.includes(types_1.SCFeatureName.TAGGING) &&
|
|
48
|
+
features.includes(types_1.SCFeatureName.GROUPING) &&
|
|
49
|
+
react_core_1.SCPreferences.CONFIGURATIONS_GROUPS_ENABLED in preferences &&
|
|
50
|
+
preferences[react_core_1.SCPreferences.CONFIGURATIONS_GROUPS_ENABLED].value, [preferences, features]);
|
|
51
|
+
const eventsEnabled = (0, react_1.useMemo)(() => preferences &&
|
|
52
|
+
features &&
|
|
53
|
+
features.includes(types_1.SCFeatureName.TAGGING) &&
|
|
54
|
+
react_core_1.SCPreferences.CONFIGURATIONS_EVENTS_ENABLED in preferences &&
|
|
55
|
+
preferences[react_core_1.SCPreferences.CONFIGURATIONS_EVENTS_ENABLED].value, [preferences, features]);
|
|
56
|
+
const exploreStreamEnabled = preferences[react_core_1.SCPreferences.CONFIGURATIONS_EXPLORE_STREAM_ENABLED].value;
|
|
57
|
+
const contentAvailable = preferences[react_core_1.SCPreferences.CONFIGURATIONS_CONTENT_AVAILABILITY].value;
|
|
36
58
|
// HANDLERS
|
|
37
59
|
const handleMouseEnter = (index) => {
|
|
38
60
|
setIsHovered((prevState) => {
|
|
@@ -55,6 +77,6 @@ function DefaultDrawerContent(inProps) {
|
|
|
55
77
|
onTouchMove: mouseLeave
|
|
56
78
|
});
|
|
57
79
|
//order
|
|
58
|
-
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(className, classes.root) }, rest, { children: [(0, jsx_runtime_1.jsxs)(material_1.
|
|
80
|
+
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(className, classes.root) }, rest, { children: [(0, jsx_runtime_1.jsxs)(material_1.List, Object.assign({ className: classes.navigation }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItem, Object.assign({ disablePadding: true }, { children: (0, jsx_runtime_1.jsxs)(material_1.ListItemButton, Object.assign({ component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.HOME_ROUTE_NAME, {}) }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "home" }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.home", defaultMessage: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.home" }) })] })) })), groupsEnabled && scUserContext.user && ((0, jsx_runtime_1.jsx)(material_1.ListItem, Object.assign({ disablePadding: true }, { children: (0, jsx_runtime_1.jsxs)(material_1.ListItemButton, Object.assign({ component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.GROUPS_ROUTE_NAME, {}) }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "groups" }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.groups", defaultMessage: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.groups" }) })] })) }))), eventsEnabled && (scUserContext.user || contentAvailable) && ((0, jsx_runtime_1.jsx)(material_1.ListItem, Object.assign({ disablePadding: true }, { children: (0, jsx_runtime_1.jsxs)(material_1.ListItemButton, Object.assign({ component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.EVENTS_ROUTE_NAME, {}) }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "CalendarIcon" }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.events", defaultMessage: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.events" }) })] })) }))), exploreStreamEnabled && (contentAvailable || scUserContext.user) && ((0, jsx_runtime_1.jsx)(material_1.ListItem, Object.assign({ disablePadding: true }, { children: (0, jsx_runtime_1.jsxs)(material_1.ListItemButton, Object.assign({ component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.EXPLORE_ROUTE_NAME, {}) }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "explore" }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.explore", defaultMessage: "ui.navigationMenuIconButton.defaultDrawerContent.navigation.explore" }) })] })) })))] })), (0, jsx_runtime_1.jsx)(material_1.Divider, {}), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "subtitle1", className: classes.title }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.navigationMenuIconButton.defaultDrawerContent.category.title", defaultMessage: "ui.navigationMenuIconButton.defaultDrawerContent.category.title" }) })), !categoriesOrdered.length && ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1", className: classes.noResults }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.navigationMenuIconButton.defaultDrawerContent.category.noResults", defaultMessage: "ui.navigationMenuIconButton.defaultDrawerContent.category.noResults" }) }))), categoriesOrdered.map((c, index) => ((0, jsx_runtime_1.jsx)(material_1.Zoom, Object.assign({ in: true, style: { transform: isHovered[c.id] && 'scale(1.05)' } }, { children: (0, jsx_runtime_1.jsx)(material_1.ListItem, { children: (0, jsx_runtime_1.jsx)(Category_1.default, Object.assign({ ButtonBaseProps: { component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.CATEGORY_ROUTE_NAME, c) }, elevation: 0, category: c, actions: null }, CategoryItemProps, getMouseEvents(() => handleMouseEnter(c.id), () => handleMouseLeave(c.id)))) }, c.id) }), index)))] })));
|
|
59
81
|
}
|
|
60
82
|
exports.default = DefaultDrawerContent;
|
|
@@ -146,7 +146,7 @@ function NavigationToolbar(inProps) {
|
|
|
146
146
|
value.startsWith(scRoutingContext.url(react_core_1.SCRoutes.GROUPS_ROUTE_NAME, {}))
|
|
147
147
|
}), "aria-label": "Groups", to: scRoutingContext.url(react_core_1.SCRoutes.GROUPS_SUBSCRIBED_ROUTE_NAME, {}), component: react_core_1.Link }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "groups" }) }))), eventsEnabled && (scUserContext.user || preferences[react_core_1.SCPreferences.CONFIGURATIONS_CONTENT_AVAILABILITY]) && ((0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ className: (0, classnames_1.default)(classes.events, {
|
|
148
148
|
[classes.active]: value.startsWith(scRoutingContext.url(react_core_1.SCRoutes.EVENTS_ROUTE_NAME, {}))
|
|
149
|
-
}), "aria-label": "
|
|
149
|
+
}), "aria-label": "Events", to: scRoutingContext.url(react_core_1.SCRoutes.EVENTS_ROUTE_NAME, {}), component: react_core_1.Link }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "CalendarIcon" }) })))] })));
|
|
150
150
|
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(className, classes.root) }, rest, { children: [(0, jsx_runtime_1.jsx)(NavigationMenuIconButtonComponent, Object.assign({}, NavigationMenuIconButtonComponentProps)), (0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({ to: scRoutingContext.url(react_core_1.SCRoutes.HOME_ROUTE_NAME, {}), className: classes.logo }, { children: (0, jsx_runtime_1.jsx)("img", { src: preferences[react_core_1.SCPreferences.LOGO_NAVBAR_LOGO], alt: "logo" }) })), !scUserContext.user && !preferences[react_core_1.SCPreferences.ADDONS_CLOSED_COMMUNITY] && ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ color: "inherit", component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.SIGNUP_ROUTE_NAME, {}), className: classes.register }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.appBar.navigation.register", defaultMessage: "ui.appBar.navigation.register" }) }))), preferences[react_core_1.SCPreferences.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_ENABLED] && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: preferences[react_core_1.SCPreferences.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_TEXT] ? ((0, jsx_runtime_1.jsx)(material_1.Tooltip, Object.assign({ title: preferences[react_core_1.SCPreferences.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_TEXT] }, { children: (0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({ target: "blank", to: preferences[react_core_1.SCPreferences.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_URL], className: classes.customItem }, { children: (0, jsx_runtime_1.jsx)("img", { src: preferences[react_core_1.SCPreferences.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_IMAGE], alt: "custom_item" }) })) }))) : ((0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({ target: "blank", to: preferences[react_core_1.SCPreferences.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_URL], className: classes.customItem }, { children: (0, jsx_runtime_1.jsx)("img", { src: preferences[react_core_1.SCPreferences.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_IMAGE], alt: "custom_item" }) }))) })), _children, (preferences[react_core_1.SCPreferences.CONFIGURATIONS_CONTENT_AVAILABILITY] || scUserContext.user) && !disableSearch ? ((0, jsx_runtime_1.jsx)(SearchAutocomplete_1.default, Object.assign({ className: classes.search, blurOnSelect: true }, SearchAutocompleteProps))) : ((0, jsx_runtime_1.jsx)(material_1.Box, { className: classes.search })), startActions, scUserContext.user ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [showComposer && (0, jsx_runtime_1.jsx)(ComposerIconButton_1.default, Object.assign({ className: classes.composer }, ComposerIconButtonProps)), (0, jsx_runtime_1.jsx)(material_1.Tooltip, Object.assign({ title: scUserContext.user.username }, { children: (0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.USER_PROFILE_ROUTE_NAME, scUserContext.user), "aria-label": "Profile", className: classes.profile }, { children: (0, jsx_runtime_1.jsx)(material_1.Avatar, { alt: scUserContext.user.username, src: scUserContext.user.avatar }) })) })), (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ className: (0, classnames_1.default)(classes.notification, {
|
|
151
151
|
[classes.active]: value.startsWith(scRoutingContext.url(react_core_1.SCRoutes.USER_NOTIFICATIONS_ROUTE_NAME, {}))
|
|
152
152
|
}), "aria-label": "Notification", onClick: handleOpenNotificationMenu }, { children: (0, jsx_runtime_1.jsx)(material_1.Badge, Object.assign({ badgeContent: scUserContext.user.unseen_notification_banners_counter + scUserContext.user.unseen_interactions_counter, color: "secondary" }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "notifications_active" }) })) })), (0, jsx_runtime_1.jsx)(NotificationMenu_1.default, Object.assign({ className: classes.notificationsMenu, id: "notification-menu", anchorEl: anchorNotification, open: Boolean(anchorNotification), onClose: handleCloseNotificationMenu, onClick: handleCloseNotificationMenu, transformOrigin: { horizontal: 'right', vertical: 'top' }, anchorOrigin: { horizontal: 'right', vertical: 'bottom' } }, NotificationMenuProps))] }), privateMessagingEnabled && ((0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ className: (0, classnames_1.default)(classes.messages, {
|
|
@@ -67,10 +67,10 @@ function CommentNotification(props) {
|
|
|
67
67
|
}), { onClick: notificationObject.comment.author.deleted ? () => setOpenAlert(true) : null }, { children: (0, jsx_runtime_1.jsx)(UserAvatar_1.default, Object.assign({ hide: !notificationObject.comment.author.community_badge, smaller: true }, { children: (0, jsx_runtime_1.jsx)(material_1.Avatar, { alt: notificationObject.comment.author.username, variant: "circular", src: notificationObject.comment.author.avatar, classes: { root: classes.avatar } }) })) })), primary: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({}, (!notificationObject.comment.author.deleted && {
|
|
68
68
|
to: scRoutingContext.url(react_core_1.SCRoutes.USER_PROFILE_ROUTE_NAME, notificationObject.comment.author)
|
|
69
69
|
}), { onClick: notificationObject.comment.author.deleted ? () => setOpenAlert(true) : null, className: classes.username }, { children: notificationObject.comment.author.username })), ' ', notificationObject.type === types_1.SCNotificationTypologyType.NESTED_COMMENT
|
|
70
|
-
? intl.formatMessage(messages.
|
|
70
|
+
? intl.formatMessage(messages.nestedComment, {
|
|
71
71
|
b: (...chunks) => (0, jsx_runtime_1.jsx)("strong", { children: chunks })
|
|
72
72
|
})
|
|
73
|
-
: intl.formatMessage(messages.
|
|
73
|
+
: intl.formatMessage(messages.comment, {
|
|
74
74
|
b: (...chunks) => (0, jsx_runtime_1.jsx)("strong", { children: chunks })
|
|
75
75
|
})] }), secondary: (0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({ to: scRoutingContext.url(react_core_1.SCRoutes.COMMENT_ROUTE_NAME, (0, contribution_1.getRouteData)(notificationObject.comment)) }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2", className: classes.contributionText }, { children: (0, contribution_1.getContributionSnippet)(notificationObject.comment) })) })), (template === types_2.SCNotificationObjectTemplateType.DETAIL || template === types_2.SCNotificationObjectTemplateType.SNIPPET) && ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", justifyContent: "flex-start", alignItems: "center", spacing: 1 }, { children: [(0, jsx_runtime_1.jsx)(DateTimeAgo_1.default, { date: notificationObject.active_at, className: classes.activeAt }), (0, jsx_runtime_1.jsx)(Bullet_1.default, { className: classes.bullet }), (0, jsx_runtime_1.jsx)(VoteButton_1.default, { className: classes.voteButton, variant: "text", size: "small", contributionId: notificationObject.comment.id, contributionType: types_1.SCContributionType.COMMENT, contribution: notificationObject.comment, onVote: handleVote })] })))] }), footer: template === types_2.SCNotificationObjectTemplateType.TOAST && ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", justifyContent: "space-between", alignItems: "center", spacing: 2 }, { children: [(0, jsx_runtime_1.jsx)(DateTimeAgo_1.default, { date: notificationObject.active_at }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ color: "primary", component: 'div' }, { children: (0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({ to: scRoutingContext.url(react_core_1.SCRoutes.COMMENT_ROUTE_NAME, (0, contribution_1.getRouteData)(notificationObject.comment)) }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.userToastNotifications.viewContribution", defaultMessage: 'ui.userToastNotifications.viewContribution' }) })) }))] }))) }, rest)), openAlert && (0, jsx_runtime_1.jsx)(UserDeletedSnackBar_1.default, { open: openAlert, handleClose: () => setOpenAlert(false) })] }));
|
|
76
76
|
}
|
|
@@ -227,7 +227,7 @@ function UserNotification(inProps) {
|
|
|
227
227
|
notificationObject.aggregated[0].type === types_1.SCNotificationTypologyType.VOTE_UP ||
|
|
228
228
|
notificationObject.aggregated[0].type === types_1.SCNotificationTypologyType.CONTRIBUTION)) {
|
|
229
229
|
const contribution = (0, contribution_1.getContribution)(notificationObject);
|
|
230
|
-
return ((0, jsx_runtime_1.jsx)(material_1.CardHeader, { className: classes.header, titleTypographyProps: { className: classes.title, variant: 'subtitle1' }, title: (0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({ to: scRoutingContext.url((0, contribution_1.getContributionRouteName)(contribution), (0, contribution_1.getRouteData)(notificationObject[contribution.type])) }, { children: (0, contribution_1.getContributionSnippet)(contribution) })), action: contribution && ((0, jsx_runtime_1.jsx)(material_1.Tooltip, Object.assign({ title: contribution.suspended ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: 'ui.notification.notificationSuspended', defaultMessage: 'ui.notification.notificationSuspended' })) : ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: 'ui.notification.notificationSuspend', defaultMessage: 'ui.notification.notificationSuspend' })) }, { children: (0, jsx_runtime_1.jsx)(LoadingButton_1.default, Object.assign({ variant: "text", size: "small", loading: loadingSuspendNotification, color: 'inherit', classes: { root: classes.stopButton }, onClick: () => handleStopContentNotification(contribution) }, { children: contribution.suspended ? (0, jsx_runtime_1.jsx)(Icon_1.default, Object.assign({ color: 'primary' }, { children: "notifications_off" })) : (0, jsx_runtime_1.jsx)(Icon_1.default, Object.assign({ color: 'inherit' }, { children: "
|
|
230
|
+
return ((0, jsx_runtime_1.jsx)(material_1.CardHeader, { className: classes.header, titleTypographyProps: { className: classes.title, variant: 'subtitle1' }, title: (0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({ to: scRoutingContext.url((0, contribution_1.getContributionRouteName)(contribution), (0, contribution_1.getRouteData)(notificationObject[contribution.type])) }, { children: (0, contribution_1.getContributionSnippet)(contribution) })), action: contribution && ((0, jsx_runtime_1.jsx)(material_1.Tooltip, Object.assign({ title: contribution.suspended ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: 'ui.notification.notificationSuspended', defaultMessage: 'ui.notification.notificationSuspended' })) : ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: 'ui.notification.notificationSuspend', defaultMessage: 'ui.notification.notificationSuspend' })) }, { children: (0, jsx_runtime_1.jsx)(LoadingButton_1.default, Object.assign({ variant: "text", size: "small", loading: loadingSuspendNotification, color: 'inherit', classes: { root: classes.stopButton }, onClick: () => handleStopContentNotification(contribution) }, { children: contribution.suspended ? (0, jsx_runtime_1.jsx)(Icon_1.default, Object.assign({ color: 'primary' }, { children: "notifications_off" })) : (0, jsx_runtime_1.jsx)(Icon_1.default, Object.assign({ color: 'inherit' }, { children: "notifications_active" })) })) }))) }));
|
|
231
231
|
}
|
|
232
232
|
return null;
|
|
233
233
|
}
|
|
@@ -249,13 +249,13 @@ const OnBoardingWidget = (inProps) => {
|
|
|
249
249
|
notifyLayoutChanges({ forceExpanded: _expanded });
|
|
250
250
|
}, [allStepsDone]);
|
|
251
251
|
(0, react_1.useEffect)(() => {
|
|
252
|
-
if (isAdmin) {
|
|
252
|
+
if (isAdmin && showOnBoarding) {
|
|
253
253
|
getSteps();
|
|
254
254
|
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
255
255
|
const intervalId = setInterval(getSteps, isGenerating ? 6000 : 3 * 60 * 1000);
|
|
256
256
|
return () => clearInterval(intervalId);
|
|
257
257
|
}
|
|
258
|
-
}, [scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user, isGenerating, isAdmin]);
|
|
258
|
+
}, [scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user, isGenerating, isAdmin, showOnBoarding]);
|
|
259
259
|
/**
|
|
260
260
|
* updates categories info when generating category content
|
|
261
261
|
*/
|
|
@@ -21,6 +21,7 @@ const classes = {
|
|
|
21
21
|
summary: `${constants_1.PREFIX}-app-summary`,
|
|
22
22
|
step: `${constants_1.PREFIX}-app-step`,
|
|
23
23
|
image: `${constants_1.PREFIX}-app-image`,
|
|
24
|
+
imageAndroid: `${constants_1.PREFIX}-app-image-android`,
|
|
24
25
|
action: `${constants_1.PREFIX}-app-action`,
|
|
25
26
|
button: `${constants_1.PREFIX}-app-button`
|
|
26
27
|
};
|
|
@@ -56,7 +57,7 @@ function App(inProps) {
|
|
|
56
57
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
57
58
|
// @ts-ignore
|
|
58
59
|
b: (...chunks) => (0, jsx_runtime_1.jsx)("strong", { children: chunks })
|
|
59
|
-
} }) })), (0, jsx_runtime_1.jsx)(material_1.CardMedia, { className: classes.
|
|
60
|
+
} }) })), (0, jsx_runtime_1.jsx)(material_1.CardMedia, { className: classes.imageAndroid, component: "img", src: android_1.default })] })), tab === 1 && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.summary }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.app.ios", defaultMessage: "ui.onBoardingWidget.step.app.ios" }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.step }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.app.ios.a", defaultMessage: "ui.onBoardingWidget.step.app.ios.a", values: {
|
|
60
61
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
61
62
|
// @ts-ignore
|
|
62
63
|
icon: (...chunks) => (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ fontSize: "medium" }, { children: chunks })),
|
|
@@ -11,9 +11,8 @@ const react_core_1 = require("@selfcommunity/react-core");
|
|
|
11
11
|
const constants_1 = require("../../constants");
|
|
12
12
|
const material_1 = require("@mui/material");
|
|
13
13
|
const mui_color_input_1 = require("mui-color-input");
|
|
14
|
-
const reducer_1 = require("./reducer");
|
|
15
|
-
const reducer_2 = require("./reducer");
|
|
16
14
|
const api_services_1 = require("@selfcommunity/api-services");
|
|
15
|
+
const types_1 = require("@selfcommunity/types");
|
|
17
16
|
const onBoarding_1 = require("../../../../utils/onBoarding");
|
|
18
17
|
const react_intl_1 = require("react-intl");
|
|
19
18
|
const Icon_1 = tslib_1.__importDefault(require("@mui/material/Icon"));
|
|
@@ -46,6 +45,12 @@ const classes = {
|
|
|
46
45
|
drawerHeaderAction: `${constants_1.PREFIX}-appearance-drawer-header-action`,
|
|
47
46
|
drawerContent: `${constants_1.PREFIX}-appearance-drawer-content`
|
|
48
47
|
};
|
|
48
|
+
var AppearanceTabType;
|
|
49
|
+
(function (AppearanceTabType) {
|
|
50
|
+
AppearanceTabType["COLOR"] = "color";
|
|
51
|
+
AppearanceTabType["LOGO"] = "logo";
|
|
52
|
+
AppearanceTabType["SLOGAN"] = "slogan";
|
|
53
|
+
})(AppearanceTabType || (AppearanceTabType = {}));
|
|
49
54
|
const Root = (0, styles_1.styled)(Box_1.default, {
|
|
50
55
|
name: constants_1.PREFIX,
|
|
51
56
|
slot: 'AppearanceRoot'
|
|
@@ -56,7 +61,7 @@ const DrawerRoot = (0, styles_1.styled)(material_1.Drawer, {
|
|
|
56
61
|
overridesResolver: (props, styles) => styles.appearanceDrawerRoot
|
|
57
62
|
})(({ theme }) => ({}));
|
|
58
63
|
function Appearance(inProps) {
|
|
59
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
64
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
60
65
|
// PROPS
|
|
61
66
|
const props = (0, system_1.useThemeProps)({
|
|
62
67
|
props: inProps,
|
|
@@ -64,18 +69,20 @@ function Appearance(inProps) {
|
|
|
64
69
|
});
|
|
65
70
|
const { className, onCompleteAction } = props;
|
|
66
71
|
// STATE
|
|
67
|
-
const [
|
|
72
|
+
const [preferences, setPreferences] = (0, react_1.useState)([]);
|
|
73
|
+
const [data, setData] = (0, react_1.useState)({});
|
|
74
|
+
const [loading, setLoading] = (0, react_1.useState)(true);
|
|
68
75
|
const [loadingLogo, setLoadingLogo] = (0, react_1.useState)('');
|
|
69
76
|
const [anchorEl, setAnchorEl] = (0, react_1.useState)(null);
|
|
70
|
-
const [tab, setTab] = (0, react_1.useState)(
|
|
77
|
+
const [tab, setTab] = (0, react_1.useState)(AppearanceTabType.COLOR);
|
|
71
78
|
const [updating, setUpdating] = (0, react_1.useState)(false);
|
|
72
|
-
const [updatingColor, setUpdatingColor] = (0, react_1.useState)('');
|
|
73
79
|
const colorRef = (0, react_1.useRef)(null);
|
|
74
80
|
// INTL
|
|
75
81
|
const intl = (0, react_intl_1.useIntl)();
|
|
76
82
|
// HANDLERS
|
|
77
83
|
const handleTabChange = (event, newValue) => {
|
|
78
84
|
setTab(newValue);
|
|
85
|
+
setData({});
|
|
79
86
|
};
|
|
80
87
|
const handleOpen = (0, react_1.useCallback)((event) => {
|
|
81
88
|
setAnchorEl(event.currentTarget);
|
|
@@ -83,82 +90,58 @@ function Appearance(inProps) {
|
|
|
83
90
|
const handleClose = (0, react_1.useCallback)(() => {
|
|
84
91
|
setAnchorEl(null);
|
|
85
92
|
}, []);
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
})
|
|
98
|
-
.catch((e) => {
|
|
99
|
-
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, e);
|
|
100
|
-
dispatch({ type: reducer_1.actionTypes.SET_COLORS, payload: { loading: false, colors: [] } });
|
|
93
|
+
const handleClosePopover = () => {
|
|
94
|
+
if (colorRef.current) {
|
|
95
|
+
colorRef.current.blur();
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
const handleChange = (event) => {
|
|
99
|
+
const { name, value } = event.target;
|
|
100
|
+
setPreferences((prev) => {
|
|
101
|
+
return prev.map((p) => Object.assign({}, p, { value: p.name === name ? value : p.value }));
|
|
101
102
|
});
|
|
103
|
+
handleDataUpdate(name, value);
|
|
102
104
|
};
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
.then((res) => {
|
|
107
|
-
dispatch({
|
|
108
|
-
type: reducer_1.actionTypes.SET_LOGOS,
|
|
109
|
-
payload: {
|
|
110
|
-
loading: false,
|
|
111
|
-
logos: res.results
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
})
|
|
115
|
-
.catch((e) => {
|
|
116
|
-
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, e);
|
|
117
|
-
dispatch({ type: reducer_1.actionTypes.SET_LOGOS, payload: { loading: false, logos: [] } });
|
|
105
|
+
const handleColorChange = (newColor, name) => {
|
|
106
|
+
setPreferences((prev) => {
|
|
107
|
+
return prev.map((p) => Object.assign({}, p, { value: p.name === name ? newColor : p.value }));
|
|
118
108
|
});
|
|
109
|
+
handleDataUpdate(name, newColor);
|
|
119
110
|
};
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
|
|
111
|
+
const handleDataUpdate = (key, value) => {
|
|
112
|
+
const elementInDict = preferences.filter((p) => p.name === key && p.value === value);
|
|
113
|
+
if (elementInDict.length) {
|
|
114
|
+
const newData = Object.assign({}, data);
|
|
115
|
+
delete newData[key];
|
|
116
|
+
setData(newData);
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
setData((prevData) => (Object.assign(Object.assign({}, prevData), { [key]: value })));
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
const fetchPreferences = () => {
|
|
123
|
+
api_services_1.PreferenceService.searchPreferences('', '', `${react_core_1.Preferences.COLORS_COLORBACK},${react_core_1.Preferences.COLORS_COLORPRIMARY},${react_core_1.Preferences.COLORS_COLORSECONDARY},${react_core_1.Preferences.COLORS_NAVBARBACK},${react_core_1.Preferences.COLORS_COLORFONT},${react_core_1.Preferences.COLORS_COLORFONTSECONDARY}, ${react_core_1.Preferences.LOGO_NAVBAR_LOGO},${react_core_1.Preferences.LOGO_NAVBAR_LOGO_MOBILE}, ${react_core_1.Preferences.TEXT_APPLICATION_SLOGAN1},${react_core_1.Preferences.TEXT_APPLICATION_SLOGAN2}`)
|
|
123
124
|
.then((res) => {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
payload: {
|
|
127
|
-
loading: false,
|
|
128
|
-
slogans: res.results
|
|
129
|
-
}
|
|
130
|
-
});
|
|
125
|
+
setPreferences(res.results);
|
|
126
|
+
setLoading(false);
|
|
131
127
|
})
|
|
132
128
|
.catch((e) => {
|
|
133
129
|
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, e);
|
|
134
|
-
|
|
130
|
+
setLoading(false);
|
|
135
131
|
});
|
|
136
132
|
};
|
|
137
|
-
const updatePreference = (
|
|
138
|
-
try {
|
|
139
|
-
yield api_services_1.PreferenceService.updatePreferences(preference);
|
|
140
|
-
}
|
|
141
|
-
catch (e) {
|
|
142
|
-
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, e);
|
|
143
|
-
}
|
|
144
|
-
finally {
|
|
145
|
-
setUpdating(false);
|
|
146
|
-
setUpdatingColor('');
|
|
147
|
-
onCompleteAction();
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
const updateSlogans = () => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
133
|
+
const updatePreference = () => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
151
134
|
setUpdating(true);
|
|
152
135
|
try {
|
|
153
|
-
yield
|
|
154
|
-
return updatePreference({ [name]: value });
|
|
155
|
-
}));
|
|
136
|
+
yield api_services_1.PreferenceService.updatePreferences(data);
|
|
156
137
|
}
|
|
157
138
|
catch (e) {
|
|
158
139
|
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, e);
|
|
159
140
|
}
|
|
160
141
|
finally {
|
|
161
142
|
setUpdating(false);
|
|
143
|
+
setData({});
|
|
144
|
+
onCompleteAction();
|
|
162
145
|
}
|
|
163
146
|
});
|
|
164
147
|
const updateLogoPreference = (name, file) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
@@ -168,14 +151,15 @@ function Appearance(inProps) {
|
|
|
168
151
|
yield api_services_1.PreferenceService.updatePreferences(formData)
|
|
169
152
|
.then((preference) => {
|
|
170
153
|
setLoadingLogo('');
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
154
|
+
setData({});
|
|
155
|
+
setPreferences((prev) => {
|
|
156
|
+
return prev.map((p) => Object.assign({}, p, { value: p.name === name ? preference[name].value : p.value }));
|
|
174
157
|
});
|
|
175
158
|
onCompleteAction();
|
|
176
159
|
})
|
|
177
160
|
.catch((e) => {
|
|
178
161
|
setLoadingLogo('');
|
|
162
|
+
setData({});
|
|
179
163
|
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, e);
|
|
180
164
|
});
|
|
181
165
|
});
|
|
@@ -191,43 +175,20 @@ function Appearance(inProps) {
|
|
|
191
175
|
}
|
|
192
176
|
};
|
|
193
177
|
(0, react_1.useEffect)(() => {
|
|
194
|
-
|
|
195
|
-
fetchLogos();
|
|
196
|
-
fetchSlogans();
|
|
178
|
+
fetchPreferences();
|
|
197
179
|
}, []);
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
const handleChange = (event) => {
|
|
212
|
-
const { name, value } = event.target;
|
|
213
|
-
dispatch({
|
|
214
|
-
type: reducer_1.actionTypes.SET_SLOGANS,
|
|
215
|
-
payload: { slogans: state.slogans.map((s) => (s.name === name ? Object.assign(Object.assign({}, s), { value: value }) : s)) }
|
|
216
|
-
});
|
|
217
|
-
};
|
|
218
|
-
const handleClosePopover = () => {
|
|
219
|
-
if (colorRef.current) {
|
|
220
|
-
colorRef.current.blur();
|
|
221
|
-
}
|
|
222
|
-
};
|
|
223
|
-
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h4", className: classes.title, alignSelf: "self-start" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.appearance", defaultMessage: "ui.onBoardingWidget.appearance" }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.summary }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.appearance.summary", defaultMessage: "ui.onBoardingWidget.step.appearance.summary" }) })), (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ variant: "outlined", size: "small", color: "primary", onClick: handleOpen }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.appearance.button", defaultMessage: "ui.onBoardingWidget.step.appearance.button" }) })), (0, jsx_runtime_1.jsxs)(DrawerRoot, Object.assign({ className: classes.drawerRoot, anchor: "right", open: Boolean(anchorEl), onClose: handleClose }, { children: [(0, jsx_runtime_1.jsxs)(Box_1.default, Object.assign({ className: classes.drawerHeader }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h4", color: "primary" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.appearance.header.title", defaultMessage: "ui.onBoardingWidget.step.appearance.header.title" }) })), (0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ className: classes.drawerHeaderAction, onClick: handleClose }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "close" }) }))] })), (0, jsx_runtime_1.jsxs)(material_1.Tabs, Object.assign({ value: tab, onChange: handleTabChange, variant: "scrollable", scrollButtons: "auto", "aria-label": "scrollable-tabs" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Tab, { label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.appearance.colors.title", defaultMessage: "ui.onBoardingWidget.step.appearance.colors.title" }) }), (0, jsx_runtime_1.jsx)(material_1.Tab, { label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.appearance.logo.title", defaultMessage: "ui.onBoardingWidget.step.appearance.logo.title" }) }), (0, jsx_runtime_1.jsx)(material_1.Tab, { label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.appearance.titleSlogan.title", defaultMessage: "ui.onBoardingWidget.step.appearance.titleSlogan.title" }) })] })), (0, jsx_runtime_1.jsx)(ScrollContainer_1.default, { children: (0, jsx_runtime_1.jsxs)(Box_1.default, Object.assign({ className: classes.drawerContent }, { children: [tab === 0 && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: state.colors.map((color) => ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h6" }, { children: (0, onBoarding_1.formatColorLabel)(color) })), (0, jsx_runtime_1.jsxs)(Box_1.default, Object.assign({ className: classes.colorContainer }, { children: [(0, jsx_runtime_1.jsx)(mui_color_input_1.MuiColorInput, { inputRef: colorRef, className: classes.color, format: "hex", value: color.value, onChange: (newColor) => handleColorChange(newColor, color.name), isAlphaHidden: true, PopoverProps: { onClose: handleClosePopover } }), updatingColor && updatingColor === color.name && ((0, jsx_runtime_1.jsx)(material_1.CircularProgress, { className: classes.colorProgress, color: "secondary", size: 24 }))] }))] }, color.id))) })), tab === 1 && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: state.logos.map((logo) => ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h6" }, { children: (0, onBoarding_1.formatLogoLabel)(logo.name) })), (0, jsx_runtime_1.jsxs)(Box_1.default, Object.assign({ className: classes.logoContainer }, { children: [(0, jsx_runtime_1.jsx)("img", { src: logo.value, className: classes.logo }), (0, jsx_runtime_1.jsx)("input", { type: "file", onChange: (event) => handleUpload(event, logo.name), hidden: true, accept: ".gif,.png,.jpg,.jpeg", id: logo.name }), (0, jsx_runtime_1.jsx)(lab_1.LoadingButton, 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: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "upload" }) }))] }))] }, logo.id))) })), tab === 2 && ((0, jsx_runtime_1.jsxs)(Box_1.default, { children: [(0, jsx_runtime_1.jsx)(material_1.TextField, { multiline: true, fullWidth: true,
|
|
224
|
-
//className={classes.field}
|
|
225
|
-
label: `${intl.formatMessage(messages.titleField)}`, margin: "normal", value: (_a = state === null || state === void 0 ? void 0 : state.slogans[0]) === null || _a === void 0 ? void 0 : _a.value, name: "application_slogan1", onChange: handleChange, InputProps: {
|
|
226
|
-
endAdornment: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: ((_b = state.slogans[0].value) === null || _b === void 0 ? void 0 : _b.length) ? 50 - ((_c = state.slogans[0].value) === null || _c === void 0 ? void 0 : _c.length) : 50 }))
|
|
227
|
-
}, error: Boolean(((_e = (_d = state === null || state === void 0 ? void 0 : state.slogans[0]) === null || _d === void 0 ? void 0 : _d.value) === null || _e === void 0 ? void 0 : _e.length) > 50) }), (0, jsx_runtime_1.jsx)(material_1.TextField, { multiline: true, fullWidth: true,
|
|
228
|
-
//className={classes.field}
|
|
229
|
-
label: `${intl.formatMessage(messages.sloganField)}`, margin: "normal", value: (_f = state === null || state === void 0 ? void 0 : state.slogans[1]) === null || _f === void 0 ? void 0 : _f.value, name: "application_slogan2", onChange: handleChange, InputProps: {
|
|
230
|
-
endAdornment: ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: ((_g = state.slogans[1].value) === null || _g === void 0 ? void 0 : _g.length) ? 150 - ((_h = state.slogans[1].value) === null || _h === void 0 ? void 0 : _h.length) : 150 })))
|
|
231
|
-
}, error: Boolean(((_k = (_j = state === null || state === void 0 ? void 0 : state.slogans[1]) === null || _j === void 0 ? void 0 : _j.value) === null || _k === void 0 ? void 0 : _k.length) > 150) }), (0, jsx_runtime_1.jsx)(lab_1.LoadingButton, Object.assign({ loading: updating, disabled: updating, variant: "outlined", size: "small", color: "primary", onClick: updateSlogans }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.appearance.titleSlogan.button", defaultMessage: "ui.onBoardingWidget.step.appearance.titleSlogan.button" }) }))] }))] })) })] }))] })));
|
|
180
|
+
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h4", className: classes.title, alignSelf: "self-start" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.appearance", defaultMessage: "ui.onBoardingWidget.appearance" }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.summary }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.appearance.summary", defaultMessage: "ui.onBoardingWidget.step.appearance.summary" }) })), (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ variant: "outlined", size: "small", color: "primary", onClick: handleOpen }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.appearance.button", defaultMessage: "ui.onBoardingWidget.step.appearance.button" }) })), (0, jsx_runtime_1.jsxs)(DrawerRoot, Object.assign({ className: classes.drawerRoot, anchor: "right", open: Boolean(anchorEl), onClose: handleClose }, { children: [(0, jsx_runtime_1.jsxs)(Box_1.default, Object.assign({ className: classes.drawerHeader }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h4", color: "primary" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.appearance.header.title", defaultMessage: "ui.onBoardingWidget.step.appearance.header.title" }) })), (0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ className: classes.drawerHeaderAction, onClick: handleClose }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "close" }) }))] })), (0, jsx_runtime_1.jsxs)(material_1.Tabs, Object.assign({ value: tab, onChange: handleTabChange, variant: "scrollable", scrollButtons: "auto", "aria-label": "scrollable-tabs" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Tab, { value: AppearanceTabType.COLOR, label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.appearance.colors.title", defaultMessage: "ui.onBoardingWidget.step.appearance.colors.title" }) }), (0, jsx_runtime_1.jsx)(material_1.Tab, { value: AppearanceTabType.LOGO, label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.appearance.logo.title", defaultMessage: "ui.onBoardingWidget.step.appearance.logo.title" }) }), (0, jsx_runtime_1.jsx)(material_1.Tab, { value: AppearanceTabType.SLOGAN, label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.appearance.titleSlogan.title", defaultMessage: "ui.onBoardingWidget.step.appearance.titleSlogan.title" }) })] })), (0, jsx_runtime_1.jsx)(ScrollContainer_1.default, { children: (0, jsx_runtime_1.jsxs)(Box_1.default, Object.assign({ className: classes.drawerContent }, { children: [tab === AppearanceTabType.COLOR && ((0, jsx_runtime_1.jsxs)(Box_1.default, Object.assign({ className: classes.colorContainer }, { children: [preferences
|
|
181
|
+
.filter((item) => item.section === types_1.SCPreferenceSection.COLORS)
|
|
182
|
+
.map((color) => ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h6" }, { children: (0, onBoarding_1.formatColorLabel)(color) })), (0, jsx_runtime_1.jsx)(Box_1.default, { children: (0, jsx_runtime_1.jsx)(mui_color_input_1.MuiColorInput, { inputRef: colorRef, className: classes.color, format: "hex", value: color.value, onChange: (value) => handleColorChange(value, color.name), isAlphaHidden: true, PopoverProps: { onClose: handleClosePopover } }) })] }, color.id))), (0, jsx_runtime_1.jsx)(lab_1.LoadingButton, Object.assign({ loading: loading || updating, disabled: loading || updating || Object.keys(data).length === 0, variant: "outlined", size: "small", color: "primary", onClick: updatePreference }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.appearance.titleSlogan.button", defaultMessage: "ui.onBoardingWidget.step.appearance.titleSlogan.button" }) }))] }))), tab === AppearanceTabType.LOGO && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: preferences
|
|
183
|
+
.filter((item) => item.section === types_1.SCPreferenceSection.LOGO)
|
|
184
|
+
.map((logo) => ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h6" }, { children: (0, onBoarding_1.formatLogoLabel)(logo.name) })), (0, jsx_runtime_1.jsxs)(Box_1.default, Object.assign({ className: classes.logoContainer }, { children: [(0, jsx_runtime_1.jsx)("img", { src: logo.value, className: classes.logo }), (0, jsx_runtime_1.jsx)("input", { type: "file", onChange: (event) => handleUpload(event, logo.name), hidden: true, accept: ".gif,.png,.jpg,.jpeg", id: logo.name }), (0, jsx_runtime_1.jsx)(lab_1.LoadingButton, 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: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "upload" }) }))] }))] }, logo.id))) })), tab === AppearanceTabType.SLOGAN && ((0, jsx_runtime_1.jsxs)(Box_1.default, { children: [(0, jsx_runtime_1.jsx)(material_1.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, InputProps: {
|
|
185
|
+
endAdornment: ((0, jsx_runtime_1.jsx)(material_1.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
|
+
? 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)
|
|
187
|
+
: 50 })))
|
|
188
|
+
}, error: Boolean(((_f = (_e = preferences === null || preferences === void 0 ? void 0 : preferences.find((item) => item.section === 'text' && item.name === 'application_slogan1')) === null || _e === void 0 ? void 0 : _e.value) === null || _f === void 0 ? void 0 : _f.length) > 50) }), (0, jsx_runtime_1.jsx)(material_1.TextField, { multiline: true, fullWidth: true, label: `${intl.formatMessage(messages.sloganField)}`, margin: "normal", value: ((_g = preferences === null || preferences === void 0 ? void 0 : preferences.find((item) => item.section === 'text' && item.name === 'application_slogan2')) === null || _g === void 0 ? void 0 : _g.value) || '', name: "application_slogan2", onChange: handleChange, InputProps: {
|
|
189
|
+
endAdornment: ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: ((_j = (_h = preferences === null || preferences === void 0 ? void 0 : preferences.find((item) => item.section === 'text' && item.name === 'application_slogan2')) === null || _h === void 0 ? void 0 : _h.value) === null || _j === void 0 ? void 0 : _j.length)
|
|
190
|
+
? 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)
|
|
191
|
+
: 150 })))
|
|
192
|
+
}, 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) }), (0, jsx_runtime_1.jsx)(lab_1.LoadingButton, Object.assign({ loading: updating, disabled: updating || Object.keys(data).length === 0, variant: "outlined", size: "small", color: "primary", onClick: updatePreference }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.appearance.titleSlogan.button", defaultMessage: "ui.onBoardingWidget.step.appearance.titleSlogan.button" }) }))] }))] })) })] }))] })));
|
|
232
193
|
}
|
|
233
194
|
exports.default = Appearance;
|
|
@@ -177,13 +177,10 @@ function PrivateMessageThread(inProps) {
|
|
|
177
177
|
* Memoized message recipients ids
|
|
178
178
|
*/
|
|
179
179
|
const ids = (0, react_1.useMemo)(() => {
|
|
180
|
-
if (recipients
|
|
181
|
-
return
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
}
|
|
185
|
-
return [recipients];
|
|
186
|
-
}, [recipients]);
|
|
180
|
+
if (!recipients)
|
|
181
|
+
return [];
|
|
182
|
+
return Array.isArray(recipients) ? recipients.map((u) => parseInt(u.id, 10)) : [parseInt(recipients.id || recipients, 10)];
|
|
183
|
+
}, [recipients, openNewMessage]);
|
|
187
184
|
function fetchResults() {
|
|
188
185
|
setLoading(true);
|
|
189
186
|
api_services_1.PrivateMessageService.searchUser(value)
|
|
@@ -108,11 +108,12 @@ function SearchAutocomplete(inProps) {
|
|
|
108
108
|
});
|
|
109
109
|
}
|
|
110
110
|
const optionLabel = (option) => {
|
|
111
|
+
var _a, _b, _c, _d;
|
|
111
112
|
switch (option.type) {
|
|
112
113
|
case types_1.SuggestionType.CATEGORY:
|
|
113
|
-
return option[option.type]
|
|
114
|
+
return `${((_a = option[option.type]) === null || _a === void 0 ? void 0 : _a.name_synonyms) || ''} ${((_b = option[option.type]) === null || _b === void 0 ? void 0 : _b.name) || ''}`.trim();
|
|
114
115
|
case types_1.SuggestionType.USER:
|
|
115
|
-
return option[option.type]
|
|
116
|
+
return `${((_c = option[option.type]) === null || _c === void 0 ? void 0 : _c.username) || ''} ${((_d = option[option.type]) === null || _d === void 0 ? void 0 : _d.real_name) || ''}`.trim();
|
|
116
117
|
default:
|
|
117
118
|
return option[option.type]['name'];
|
|
118
119
|
}
|
|
@@ -12,8 +12,8 @@ const classes = {
|
|
|
12
12
|
const Root = (0, styles_1.styled)(material_1.AvatarGroup, {
|
|
13
13
|
name: PREFIX,
|
|
14
14
|
slot: 'Root',
|
|
15
|
-
overridesResolver: (
|
|
16
|
-
})((
|
|
15
|
+
overridesResolver: (_props, styles) => styles.root
|
|
16
|
+
})(() => ({}));
|
|
17
17
|
/**
|
|
18
18
|
* > API documentation for the Community-JS Avatar Group Skeleton component. Learn about the available props and the CSS API.
|
|
19
19
|
|
|
@@ -40,8 +40,8 @@ function AvatarGroupSkeleton(inProps) {
|
|
|
40
40
|
props: inProps,
|
|
41
41
|
name: PREFIX
|
|
42
42
|
});
|
|
43
|
-
const {
|
|
43
|
+
const { skeletonsAnimation = 'wave', count = 3 } = props, rest = tslib_1.__rest(props, ["skeletonsAnimation", "count"]);
|
|
44
44
|
const theme = (0, material_1.useTheme)();
|
|
45
|
-
return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ className: classes.root }, rest, { children: [...Array(count
|
|
45
|
+
return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ className: classes.root }, rest, { children: [...Array(count)].map((_x, i) => ((0, jsx_runtime_1.jsx)(material_1.Avatar, { children: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "circular", width: theme.selfcommunity.user.avatar.sizeSmall, height: theme.selfcommunity.user.avatar.sizeSmall, animation: skeletonsAnimation }) }, i))) })));
|
|
46
46
|
}
|
|
47
47
|
exports.default = AvatarGroupSkeleton;
|
|
@@ -25,6 +25,7 @@ function Arrow(props) {
|
|
|
25
25
|
if (type === 'prev') {
|
|
26
26
|
return (currentItem > 0 && ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ variant: "contained", className: className, size: "medium", onClick: () => handleChange('prev') }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "chevron_left" }) }))));
|
|
27
27
|
}
|
|
28
|
-
return (
|
|
28
|
+
return (itemsLength > 2 &&
|
|
29
|
+
currentItem < itemsLength - 1 && ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ variant: "contained", className: className, size: "medium", onClick: () => handleChange('next') }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "chevron_right" }) }))));
|
|
29
30
|
}
|
|
30
31
|
exports.default = Arrow;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { TextFieldProps } from '@mui/material/TextField';
|
|
2
|
+
import { AutocompleteProps } from '@mui/material';
|
|
3
|
+
import { SCTagType } from '@selfcommunity/types/src/index';
|
|
4
|
+
import { TagChipProps } from '../../shared/TagChip';
|
|
5
|
+
export interface TagAutocompleteProps extends Pick<AutocompleteProps<SCTagType | null, any, any, any>, Exclude<keyof AutocompleteProps<SCTagType | null, any, any, any>, 'open' | 'onOpen' | 'onClose' | 'onChange' | 'filterSelectedOptions' | 'disableCloseOnSelect' | 'options' | 'getOptionLabel' | 'value' | 'selectOnFocus' | 'clearOnBlur' | 'blurOnSelect' | 'handleHomeEndKeys' | 'noOptionsText' | 'isOptionEqualToValue' | 'renderTags' | 'renderOption' | 'renderInput'>> {
|
|
6
|
+
defaultValue: SCTagType[] | any;
|
|
7
|
+
/**
|
|
8
|
+
* The props applied to text field
|
|
9
|
+
* @default {variant: 'outlined, label: tags_label}
|
|
10
|
+
*/
|
|
11
|
+
TextFieldProps?: TextFieldProps;
|
|
12
|
+
/**
|
|
13
|
+
* The props to spread to TagChip component
|
|
14
|
+
*/
|
|
15
|
+
TagChipProps?: Pick<TagChipProps, Exclude<keyof TagChipProps, 'tag'>>;
|
|
16
|
+
/**
|
|
17
|
+
* Callback for change event on poll object
|
|
18
|
+
* @param value
|
|
19
|
+
*/
|
|
20
|
+
onChange?: (value: any) => void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* > API documentation for the Community-JS Tag Autocomplete component. Learn about the available props and the CSS API.
|
|
24
|
+
*
|
|
25
|
+
*
|
|
26
|
+
* This component renders a bar that allows users to search (with autocomplete) for all the tags available in the application.
|
|
27
|
+
*
|
|
28
|
+
* #### Import
|
|
29
|
+
* ```jsx
|
|
30
|
+
* import {TagAutocomplete} from '@selfcommunity/react-ui';
|
|
31
|
+
* ```
|
|
32
|
+
* #### Component Name
|
|
33
|
+
* The name `SCTagAutocomplete` can be used when providing style overrides in the theme.
|
|
34
|
+
*
|
|
35
|
+
* #### CSS
|
|
36
|
+
*
|
|
37
|
+
* |Rule Name|Global class|Description|
|
|
38
|
+
* |---|---|---|
|
|
39
|
+
* |root|.SCTagAutocomplete-root|Styles applied to the root element.|
|
|
40
|
+
*
|
|
41
|
+
* @param inProps
|
|
42
|
+
*/
|
|
43
|
+
declare const TagAutocomplete: (inProps: TagAutocompleteProps) => JSX.Element;
|
|
44
|
+
export default TagAutocomplete;
|