@selfcommunity/react-ui 0.7.50-events.76 → 0.7.50-events.78
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/EventInviteButton/EventInviteButton.d.ts +1 -1
- package/lib/cjs/components/EventInviteButton/EventInviteButton.js +17 -28
- package/lib/cjs/components/EventLocationWidget/EventLocationWidget.d.ts +1 -1
- package/lib/cjs/components/EventLocationWidget/EventLocationWidget.js +13 -13
- package/lib/cjs/components/EventMembersWidget/EventMembersWidget.js +12 -5
- package/lib/cjs/components/EventMembersWidget/TabContentComponent.d.ts +1 -0
- package/lib/cjs/components/EventMembersWidget/TabContentComponent.js +15 -2
- package/lib/cjs/components/EventParticipantsButton/EventParticipantsButton.js +3 -6
- package/lib/cjs/components/Feed/Feed.js +1 -1
- package/lib/cjs/components/OnBoardingWidget/OnBoardingWidget.d.ts +16 -13
- package/lib/cjs/components/OnBoardingWidget/OnBoardingWidget.js +75 -41
- package/lib/cjs/components/OnBoardingWidget/Steps/App/App.js +4 -4
- package/lib/cjs/components/OnBoardingWidget/Steps/Category/Category.js +5 -3
- package/lib/cjs/components/OnBoardingWidget/Steps/Content/Content.js +5 -3
- package/lib/cjs/components/RelatedEventsWidget/RelatedEventsWidget.js +1 -1
- package/lib/cjs/utils/string.d.ts +1 -1
- package/lib/cjs/utils/string.js +3 -0
- package/lib/esm/components/EventInviteButton/EventInviteButton.d.ts +1 -1
- package/lib/esm/components/EventInviteButton/EventInviteButton.js +17 -28
- package/lib/esm/components/EventLocationWidget/EventLocationWidget.d.ts +1 -1
- package/lib/esm/components/EventLocationWidget/EventLocationWidget.js +13 -13
- package/lib/esm/components/EventMembersWidget/EventMembersWidget.js +13 -6
- package/lib/esm/components/EventMembersWidget/TabContentComponent.d.ts +1 -0
- package/lib/esm/components/EventMembersWidget/TabContentComponent.js +15 -2
- package/lib/esm/components/EventParticipantsButton/EventParticipantsButton.js +4 -7
- package/lib/esm/components/Feed/Feed.js +1 -1
- package/lib/esm/components/OnBoardingWidget/OnBoardingWidget.d.ts +16 -13
- package/lib/esm/components/OnBoardingWidget/OnBoardingWidget.js +77 -43
- package/lib/esm/components/OnBoardingWidget/Steps/App/App.js +4 -4
- package/lib/esm/components/OnBoardingWidget/Steps/Category/Category.js +5 -3
- package/lib/esm/components/OnBoardingWidget/Steps/Content/Content.js +5 -3
- package/lib/esm/components/RelatedEventsWidget/RelatedEventsWidget.js +2 -2
- package/lib/esm/utils/string.d.ts +1 -1
- package/lib/esm/utils/string.js +3 -0
- package/lib/umd/react-ui.js +1 -1
- package/package.json +7 -7
|
@@ -41,28 +41,28 @@ function App(inProps) {
|
|
|
41
41
|
const handleChange = (event, newValue) => {
|
|
42
42
|
setTab(newValue);
|
|
43
43
|
};
|
|
44
|
-
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 }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.app.title", defaultMessage: "ui.onBoardingWidget.step.app.title" }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({
|
|
44
|
+
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 }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.app.title", defaultMessage: "ui.onBoardingWidget.step.app.title" }) })), (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.summary", defaultMessage: "ui.onBoardingWidget.step.app.summary" }) })), (0, jsx_runtime_1.jsxs)(material_1.Tabs, Object.assign({ className: classes.tabs, value: tab, onChange: handleChange, centered: true, variant: "fullWidth", indicatorColor: "primary" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Tab, { label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.app.tab.ios", defaultMessage: "ui.onBoardingWidget.step.app.tab.ios" }) }), (0, jsx_runtime_1.jsx)(material_1.Tab, { label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.app.tab.android", defaultMessage: "ui.onBoardingWidget.step.app.tab.android" }) })] })), (0, jsx_runtime_1.jsxs)(Box_1.default, Object.assign({ className: classes.tabContent }, { children: [tab === 0 && ((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.summary }, { 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: {
|
|
45
45
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
46
46
|
// @ts-ignore
|
|
47
47
|
icon: (...chunks) => (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ fontSize: "medium" }, { children: chunks })),
|
|
48
48
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
49
49
|
// @ts-ignore
|
|
50
50
|
b: (...chunks) => (0, jsx_runtime_1.jsx)("strong", { children: chunks })
|
|
51
|
-
} }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({
|
|
51
|
+
} }) })), (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.b", defaultMessage: "ui.onBoardingWidget.step.app.ios.b", values: {
|
|
52
52
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
53
53
|
// @ts-ignore
|
|
54
54
|
icon: (...chunks) => (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ fontSize: "medium" }, { children: chunks })),
|
|
55
55
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
56
56
|
// @ts-ignore
|
|
57
57
|
b: (...chunks) => (0, jsx_runtime_1.jsx)("strong", { children: chunks })
|
|
58
|
-
} }) })), (0, jsx_runtime_1.jsx)(material_1.CardMedia, Object.assign({ className: classes.image, component: "div" }, { children: (0, jsx_runtime_1.jsx)(Ios_1.default, {}) }))] })), tab === 1 && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({
|
|
58
|
+
} }) })), (0, jsx_runtime_1.jsx)(material_1.CardMedia, Object.assign({ className: classes.image, component: "div" }, { children: (0, jsx_runtime_1.jsx)(Ios_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.android", defaultMessage: "ui.onBoardingWidget.step.app.android" }) })), (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.android.a", defaultMessage: "ui.onBoardingWidget.step.app.android.a", values: {
|
|
59
59
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
60
60
|
// @ts-ignore
|
|
61
61
|
icon: (...chunks) => (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ fontSize: "medium" }, { children: chunks })),
|
|
62
62
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
63
63
|
// @ts-ignore
|
|
64
64
|
b: (...chunks) => (0, jsx_runtime_1.jsx)("strong", { children: chunks })
|
|
65
|
-
} }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({
|
|
65
|
+
} }) })), (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.android.b", defaultMessage: "ui.onBoardingWidget.step.app.android.b", values: {
|
|
66
66
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
67
67
|
// @ts-ignore
|
|
68
68
|
icon: (...chunks) => (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ fontSize: "medium" }, { children: chunks })),
|
|
@@ -56,16 +56,18 @@ function Category(inProps) {
|
|
|
56
56
|
if (step.status === types_1.SCOnBoardingStepStatusType.IN_PROGRESS) {
|
|
57
57
|
const intervalId = setInterval(() => {
|
|
58
58
|
setProgress((prev) => {
|
|
59
|
-
if (prev
|
|
59
|
+
if (prev < step.completion_percentage) {
|
|
60
|
+
return prev + 1;
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
60
63
|
clearInterval(intervalId);
|
|
61
64
|
return prev;
|
|
62
65
|
}
|
|
63
|
-
return prev + 1;
|
|
64
66
|
});
|
|
65
67
|
}, 1000);
|
|
66
68
|
return () => clearInterval(intervalId);
|
|
67
69
|
}
|
|
68
|
-
}, [step.status]);
|
|
70
|
+
}, [step.status, step.completion_percentage]);
|
|
69
71
|
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 }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.categories", defaultMessage: "ui.onBoardingWidget.categories" }) })), (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.category.summary", defaultMessage: "ui.onBoardingWidget.step.category.summary" }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.category.generation.steps", defaultMessage: "ui.onBoardingWidget.step.category.generation.steps", values: {
|
|
70
72
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
71
73
|
// @ts-ignore
|
|
@@ -36,16 +36,18 @@ function Content(inProps) {
|
|
|
36
36
|
if (step.status === types_1.SCOnBoardingStepStatusType.IN_PROGRESS) {
|
|
37
37
|
const intervalId = setInterval(() => {
|
|
38
38
|
setProgress((prev) => {
|
|
39
|
-
if (prev
|
|
39
|
+
if (prev < step.completion_percentage) {
|
|
40
|
+
return prev + 1;
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
40
43
|
clearInterval(intervalId);
|
|
41
44
|
return prev;
|
|
42
45
|
}
|
|
43
|
-
return prev + 1;
|
|
44
46
|
});
|
|
45
47
|
}, 1000);
|
|
46
48
|
return () => clearInterval(intervalId);
|
|
47
49
|
}
|
|
48
|
-
}, [step.status]);
|
|
50
|
+
}, [step.status, step.completion_percentage]);
|
|
49
51
|
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 }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.contents", defaultMessage: "ui.onBoardingWidget.contents" }) })), (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.content.summary", defaultMessage: "ui.onBoardingWidget.step.content.summary" }) })), (0, jsx_runtime_1.jsx)(Box_1.default, Object.assign({ component: "span", className: classes.action }, { children: (step === null || step === void 0 ? void 0 : step.status) === types_1.SCOnBoardingStepStatusType.COMPLETED ? ((0, jsx_runtime_1.jsx)(material_1.Alert, Object.assign({ severity: "success" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.contents.success", defaultMessage: "ui.onBoardingWidget.step.contents.success" }) }))) : (step === null || step === void 0 ? void 0 : step.status) === types_1.SCOnBoardingStepStatusType.IN_PROGRESS ? ((0, jsx_runtime_1.jsx)(ProgressBar_1.default, { value: progress, loadingMessage: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h4" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.contents.loading", defaultMessage: "ui.onBoardingWidget.step.contents.loading" }) })) })) : ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ size: "small", variant: "contained", color: "secondary", onClick: handleContentCreation, endIcon: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: hover ? 'ai_stars' : 'magic_wand' }), onMouseEnter: () => setHover(true), onMouseLeave: () => setHover(false) }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { defaultMessage: "ui.onBoardingWidget.step.content.button", id: "ui.onBoardingWidget.step.content.button" }) }))) }))] })));
|
|
50
52
|
}
|
|
51
53
|
exports.default = Content;
|
|
@@ -57,7 +57,7 @@ function RelatedEventsWidget(inProps) {
|
|
|
57
57
|
props: inProps,
|
|
58
58
|
name: constants_1.PREFIX
|
|
59
59
|
});
|
|
60
|
-
const { event, eventId, eventComponentProps = { elevation: 0, square: true }, endpointQueryParams = { limit:
|
|
60
|
+
const { event, eventId, eventComponentProps = { elevation: 0, square: true }, endpointQueryParams = { limit: 5, offset: Pagination_1.DEFAULT_PAGINATION_OFFSET }, cacheStrategy, dialogProps, limit = 5 } = props, rest = tslib_1.__rest(props, ["event", "eventId", "eventComponentProps", "endpointQueryParams", "cacheStrategy", "dialogProps", "limit"]);
|
|
61
61
|
// STATE
|
|
62
62
|
const [state, dispatch] = (0, react_1.useReducer)(widget_1.dataWidgetReducer, {
|
|
63
63
|
isLoadingNext: false,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const formatCroppedName: (name: any, maxLength: any) => any;
|
|
2
|
-
export declare const formatEventLocationGeolocation: (geolocation: string, isTitle?: boolean) => string;
|
|
2
|
+
export declare const formatEventLocationGeolocation: (geolocation: string | null, isTitle?: boolean) => string;
|
package/lib/cjs/utils/string.js
CHANGED
|
@@ -9,6 +9,9 @@ const formatCroppedName = (name, maxLength) => {
|
|
|
9
9
|
};
|
|
10
10
|
exports.formatCroppedName = formatCroppedName;
|
|
11
11
|
const formatEventLocationGeolocation = (geolocation, isTitle) => {
|
|
12
|
+
if (!geolocation) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
12
15
|
const parts = geolocation.split(',');
|
|
13
16
|
if (isTitle) {
|
|
14
17
|
return parts[0].trim();
|
|
@@ -20,7 +20,7 @@ export interface EventInviteButtonProps extends ButtonProps {
|
|
|
20
20
|
* Functions to handle invitations sending in event creation mode
|
|
21
21
|
* @default null
|
|
22
22
|
*/
|
|
23
|
-
handleInvitations?: (
|
|
23
|
+
handleInvitations?: ((invited: boolean) => void) | null;
|
|
24
24
|
/**
|
|
25
25
|
* Any other properties
|
|
26
26
|
*/
|
|
@@ -101,13 +101,6 @@ export default function EventInviteButton(inProps) {
|
|
|
101
101
|
PubSub.publish(`${SCTopicType.EVENT}.${SCGroupEventType.INVITE_MEMBER}`, usersInvited);
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
-
function convertToInvitedUsersObject(data) {
|
|
105
|
-
const invite_users = {};
|
|
106
|
-
data.forEach((user, index) => {
|
|
107
|
-
invite_users[`invite_users[${index}]`] = user.id;
|
|
108
|
-
});
|
|
109
|
-
return invite_users;
|
|
110
|
-
}
|
|
111
104
|
/**
|
|
112
105
|
* Memoized users invited ids
|
|
113
106
|
*/
|
|
@@ -183,26 +176,22 @@ export default function EventInviteButton(inProps) {
|
|
|
183
176
|
* Handles invitation sending
|
|
184
177
|
*/
|
|
185
178
|
const handleSendInvitations = () => {
|
|
186
|
-
|
|
187
|
-
|
|
179
|
+
const data = { users: ids };
|
|
180
|
+
setIsSending(true);
|
|
181
|
+
EventService.inviteOrAcceptEventRequest(scEvent.id, data)
|
|
182
|
+
.then(() => {
|
|
183
|
+
setIsSending(false);
|
|
188
184
|
setOpen(false);
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
})
|
|
200
|
-
.catch((error) => {
|
|
201
|
-
setOpen(false);
|
|
202
|
-
setLoading(false);
|
|
203
|
-
Logger.error(SCOPE_SC_UI, error);
|
|
204
|
-
});
|
|
205
|
-
}
|
|
185
|
+
setInvited([]);
|
|
186
|
+
notifyChanges(scEvent, invited);
|
|
187
|
+
handleInvitations === null || handleInvitations === void 0 ? void 0 : handleInvitations(true);
|
|
188
|
+
})
|
|
189
|
+
.catch((error) => {
|
|
190
|
+
setOpen(false);
|
|
191
|
+
setLoading(false);
|
|
192
|
+
handleInvitations === null || handleInvitations === void 0 ? void 0 : handleInvitations(false);
|
|
193
|
+
Logger.error(SCOPE_SC_UI, error);
|
|
194
|
+
});
|
|
206
195
|
};
|
|
207
196
|
// Autocomplete Handlers
|
|
208
197
|
const handleInputChange = (event, value, reason) => {
|
|
@@ -247,8 +236,8 @@ export default function EventInviteButton(inProps) {
|
|
|
247
236
|
});
|
|
248
237
|
};
|
|
249
238
|
/**
|
|
250
|
-
|
|
251
|
-
|
|
239
|
+
* If in event edit mode and logged-in user is not also the event manager, the component is hidden.
|
|
240
|
+
// */
|
|
252
241
|
if (event && !isEventAdmin) {
|
|
253
242
|
return null;
|
|
254
243
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { VirtualScrollerItemProps } from '../../types/virtualScroller';
|
|
2
1
|
import { SCEventType } from '@selfcommunity/types';
|
|
2
|
+
import { VirtualScrollerItemProps } from '../../types/virtualScroller';
|
|
3
3
|
export interface EventLocationWidgetProps extends VirtualScrollerItemProps {
|
|
4
4
|
/**
|
|
5
5
|
* Event Object
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { styled } from '@mui/material/styles';
|
|
4
3
|
import { Box, CardContent, Typography } from '@mui/material';
|
|
5
|
-
import
|
|
6
|
-
import Widget from '../Widget';
|
|
4
|
+
import { styled } from '@mui/material/styles';
|
|
7
5
|
import { useThemeProps } from '@mui/system';
|
|
8
|
-
import {
|
|
9
|
-
import { FormattedMessage } from 'react-intl';
|
|
10
|
-
import EventLocationWidgetSkeleton from './Skeleton';
|
|
6
|
+
import { GoogleMap, MarkerF, useLoadScript } from '@react-google-maps/api';
|
|
11
7
|
import { useSCContext, useSCFetchEvent } from '@selfcommunity/react-core';
|
|
12
8
|
import { SCEventLocationType } from '@selfcommunity/types';
|
|
13
|
-
import
|
|
9
|
+
import classNames from 'classnames';
|
|
10
|
+
import { FormattedMessage } from 'react-intl';
|
|
14
11
|
import HiddenPlaceholder from '../../shared/HiddenPlaceholder';
|
|
15
12
|
import { formatEventLocationGeolocation } from '../../utils/string';
|
|
13
|
+
import Widget from '../Widget';
|
|
14
|
+
import { PREFIX } from './constants';
|
|
15
|
+
import EventLocationWidgetSkeleton from './Skeleton';
|
|
16
16
|
const classes = {
|
|
17
17
|
root: `${PREFIX}-root`,
|
|
18
18
|
title: `${PREFIX}-title`,
|
|
@@ -76,7 +76,7 @@ export default function EventLocationWidget(inProps) {
|
|
|
76
76
|
streetViewControl: false,
|
|
77
77
|
zoomControl: false // Disables the zoom control (+/- buttons)
|
|
78
78
|
};
|
|
79
|
-
if (!((_c = (_b = (_a = scContext === null || scContext === void 0 ? void 0 : scContext.settings) === null || _a === void 0 ? void 0 : _a.integrations) === null || _b === void 0 ? void 0 : _b.geocoding) === null || _c === void 0 ? void 0 : _c.apiKey) || (scEvent
|
|
79
|
+
if (!((_c = (_b = (_a = scContext === null || scContext === void 0 ? void 0 : scContext.settings) === null || _a === void 0 ? void 0 : _a.integrations) === null || _b === void 0 ? void 0 : _b.geocoding) === null || _c === void 0 ? void 0 : _c.apiKey) || (scEvent === null || scEvent === void 0 ? void 0 : scEvent.location) === SCEventLocationType.ONLINE) {
|
|
80
80
|
return _jsx(HiddenPlaceholder, {});
|
|
81
81
|
}
|
|
82
82
|
/**
|
|
@@ -89,10 +89,10 @@ export default function EventLocationWidget(inProps) {
|
|
|
89
89
|
* Renders root object
|
|
90
90
|
*/
|
|
91
91
|
return (_jsx(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { children: _jsxs(CardContent, { children: [_jsx(Typography, Object.assign({ variant: "h4", className: classes.title, gutterBottom: true }, { children: _jsx(FormattedMessage, { id: "ui.eventLocationWidget.title", defaultMessage: "ui.eventLocationWidget.title" }) })), _jsx(Box, Object.assign({ className: classes.map }, { children: _jsx(GoogleMap, Object.assign({ mapContainerClassName: classes.map, center: {
|
|
92
|
-
lat: scEvent
|
|
93
|
-
lng: scEvent
|
|
92
|
+
lat: scEvent.geolocation_lat,
|
|
93
|
+
lng: scEvent.geolocation_lng
|
|
94
94
|
}, options: mapOptions, zoom: 15 }, { children: _jsx(MarkerF, { position: {
|
|
95
|
-
lat: scEvent
|
|
96
|
-
lng: scEvent
|
|
97
|
-
} }) })) })), _jsx(Typography, Object.assign({ variant: "h4", className: classes.locationTitle }, { children: formatEventLocationGeolocation(scEvent
|
|
95
|
+
lat: scEvent.geolocation_lat,
|
|
96
|
+
lng: scEvent.geolocation_lng
|
|
97
|
+
} }) })) })), _jsx(Typography, Object.assign({ variant: "h4", className: classes.locationTitle }, { children: formatEventLocationGeolocation(scEvent.geolocation, true) })), _jsx(Typography, Object.assign({ variant: "body1", className: classes.address }, { children: formatEventLocationGeolocation(scEvent.geolocation) }))] }) })));
|
|
98
98
|
}
|
|
@@ -10,7 +10,7 @@ import { useCallback, useEffect, useReducer, useState } from 'react';
|
|
|
10
10
|
import { FormattedMessage } from 'react-intl';
|
|
11
11
|
import 'swiper/css';
|
|
12
12
|
import { SCOPE_SC_UI } from '../../constants/Errors';
|
|
13
|
-
import {
|
|
13
|
+
import { DEFAULT_PAGINATION_OFFSET } from '../../constants/Pagination';
|
|
14
14
|
import HiddenPlaceholder from '../../shared/HiddenPlaceholder';
|
|
15
15
|
import { actionWidgetTypes, dataWidgetReducer, stateWidgetInitializer } from '../../utils/widget';
|
|
16
16
|
import Widget from '../Widget';
|
|
@@ -36,7 +36,7 @@ export default function EventMembersWidget(inProps) {
|
|
|
36
36
|
props: inProps,
|
|
37
37
|
name: PREFIX
|
|
38
38
|
});
|
|
39
|
-
const { event, eventId, userProps = {}, endpointQueryParams = { limit:
|
|
39
|
+
const { event, eventId, userProps = {}, endpointQueryParams = { limit: 5, offset: DEFAULT_PAGINATION_OFFSET }, cacheStrategy, dialogProps, limit = 5 } = props, rest = __rest(props, ["event", "eventId", "userProps", "endpointQueryParams", "cacheStrategy", "dialogProps", "limit"]);
|
|
40
40
|
// STATE
|
|
41
41
|
const [participants, dispatchParticipants] = useReducer(dataWidgetReducer, {
|
|
42
42
|
isLoadingNext: false,
|
|
@@ -54,6 +54,7 @@ export default function EventMembersWidget(inProps) {
|
|
|
54
54
|
}, stateWidgetInitializer);
|
|
55
55
|
const [invitedNumber, setInvitedNumber] = useState(0);
|
|
56
56
|
const [tabValue, setTabValue] = useState('1');
|
|
57
|
+
const [refresh, setRefresh] = useState(false);
|
|
57
58
|
// CONTEXT
|
|
58
59
|
const scUserContext = useSCUser();
|
|
59
60
|
// HOOKS
|
|
@@ -91,14 +92,20 @@ export default function EventMembersWidget(inProps) {
|
|
|
91
92
|
let _t;
|
|
92
93
|
if (scUserContext.user && scEvent) {
|
|
93
94
|
_t = setTimeout(() => {
|
|
94
|
-
|
|
95
|
-
|
|
95
|
+
if (refresh) {
|
|
96
|
+
_initInvited();
|
|
97
|
+
setRefresh(false);
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
_initParticipants();
|
|
101
|
+
_initInvited();
|
|
102
|
+
}
|
|
96
103
|
});
|
|
97
104
|
return () => {
|
|
98
105
|
clearTimeout(_t);
|
|
99
106
|
};
|
|
100
107
|
}
|
|
101
|
-
}, [scUserContext.user, scEvent]);
|
|
108
|
+
}, [scUserContext.user, scEvent, refresh]);
|
|
102
109
|
// HANDLERS
|
|
103
110
|
const handleTabChange = useCallback((_evt, newTabValue) => {
|
|
104
111
|
setTabValue(newTabValue);
|
|
@@ -113,5 +120,5 @@ export default function EventMembersWidget(inProps) {
|
|
|
113
120
|
return (_jsx(Root, Object.assign({ className: classes.root }, rest, { children: _jsxs(CardContent, Object.assign({ className: classes.content }, { children: [_jsx(Typography, Object.assign({ variant: "h5", className: classes.title }, { children: _jsx(FormattedMessage, { id: "ui.eventMembersWidget.invited", defaultMessage: "ui.eventMembersWidget.invited" }) })), _jsxs(TabContext, Object.assign({ value: tabValue }, { children: [_jsxs(TabList, Object.assign({ className: classes.tabsWrapper, onChange: handleTabChange, textColor: "primary", indicatorColor: "primary", variant: "fullWidth" }, { children: [_jsx(Tab, { label: _jsxs(Stack, Object.assign({ className: classes.tabLabelWrapper }, { children: [_jsx(Typography, Object.assign({ variant: "h3" }, { children: participants.count })), _jsx(Typography, Object.assign({ variant: "subtitle2" }, { children: _jsx(FormattedMessage, { id: "ui.eventMembersWidget.participants", defaultMessage: "ui.eventMembersWidget.participants" }) }))] })), value: "1" }), invited && (_jsx(Tab, { label: _jsxs(Stack, Object.assign({ className: classes.tabLabelWrapper }, { children: [_jsx(Typography, Object.assign({ variant: "h3" }, { children: invitedNumber })), _jsx(Typography, Object.assign({ variant: "subtitle2" }, { children: _jsx(FormattedMessage, { id: "ui.eventMembersWidget.invited", defaultMessage: "ui.eventMembersWidget.invited" }) }))] })), value: "2" }))] })), _jsx(TabPanel, Object.assign({ value: "1", className: classes.tabPanel }, { children: _jsx(TabContentComponent, { state: participants, dispatch: dispatchParticipants, userProps: userProps, dialogProps: dialogProps }) })), invited && (_jsx(TabPanel, Object.assign({ value: "2", className: classes.tabPanel }, { children: _jsx(TabContentComponent, { state: invited, dispatch: dispatchInvited, userProps: userProps, dialogProps: dialogProps, actionProps: {
|
|
114
121
|
scEvent,
|
|
115
122
|
setInvitedNumber
|
|
116
|
-
} }) })))] }))] })) })));
|
|
123
|
+
}, setRefresh: setRefresh }) })))] }))] })) })));
|
|
117
124
|
}
|
|
@@ -19,6 +19,7 @@ interface TabComponentProps {
|
|
|
19
19
|
scEvent?: SCEventType;
|
|
20
20
|
setInvitedNumber: Dispatch<SetStateAction<number>>;
|
|
21
21
|
};
|
|
22
|
+
setRefresh?: Dispatch<SetStateAction<boolean>>;
|
|
22
23
|
}
|
|
23
24
|
export default function TabContentComponent(props: TabComponentProps): JSX.Element;
|
|
24
25
|
export {};
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Button, List, ListItem, styled, Typography } from '@mui/material';
|
|
3
3
|
import { Endpoints, http } from '@selfcommunity/api-services';
|
|
4
|
+
import { Logger } from '@selfcommunity/utils';
|
|
4
5
|
import { useCallback, useState } from 'react';
|
|
5
6
|
import { FormattedMessage } from 'react-intl';
|
|
7
|
+
import { SCOPE_SC_UI } from '../../constants/Errors';
|
|
6
8
|
import BaseDialog from '../../shared/BaseDialog';
|
|
7
9
|
import InfiniteScroll from '../../shared/InfiniteScroll';
|
|
8
10
|
import { actionWidgetTypes } from '../../utils/widget';
|
|
11
|
+
import EventInviteButton from '../EventInviteButton';
|
|
9
12
|
import InviteUserEventButton from '../InviteUserEventButton';
|
|
10
13
|
import User, { UserSkeleton } from '../User';
|
|
11
14
|
import { PREFIX } from './constants';
|
|
12
15
|
const classes = {
|
|
13
16
|
actionButton: `${PREFIX}-action-button`,
|
|
17
|
+
eventButton: `${PREFIX}-event-button`,
|
|
14
18
|
dialogRoot: `${PREFIX}-dialog-root`,
|
|
15
19
|
infiniteScroll: `${PREFIX}-infinite-scroll`,
|
|
16
20
|
endMessage: `${PREFIX}-end-message`
|
|
@@ -22,7 +26,7 @@ const DialogRoot = styled(BaseDialog, {
|
|
|
22
26
|
})(() => ({}));
|
|
23
27
|
export default function TabContentComponent(props) {
|
|
24
28
|
// PROPS
|
|
25
|
-
const { state, dispatch, userProps, dialogProps, actionProps } = props;
|
|
29
|
+
const { state, dispatch, userProps, dialogProps, actionProps, setRefresh } = props;
|
|
26
30
|
// STATE
|
|
27
31
|
const [openDialog, setOpenDialog] = useState(false);
|
|
28
32
|
// HANDLERS
|
|
@@ -38,11 +42,20 @@ export default function TabContentComponent(props) {
|
|
|
38
42
|
})
|
|
39
43
|
.then((res) => {
|
|
40
44
|
dispatch({ type: actionWidgetTypes.LOAD_NEXT_SUCCESS, payload: res.data });
|
|
45
|
+
})
|
|
46
|
+
.catch((error) => {
|
|
47
|
+
Logger.error(SCOPE_SC_UI, error);
|
|
41
48
|
});
|
|
42
49
|
}, [dispatch, state.next, state.isLoadingNext, state.initialized]);
|
|
43
50
|
const handleToggleDialogOpen = useCallback(() => {
|
|
44
51
|
setOpenDialog((prev) => !prev);
|
|
45
52
|
}, []);
|
|
46
53
|
const getActionsComponent = useCallback((userId) => actionProps ? _jsx(InviteUserEventButton, { event: actionProps.scEvent, userId: userId, setInvitedNumber: actionProps.setInvitedNumber }) : undefined, [actionProps]);
|
|
47
|
-
|
|
54
|
+
const handleInvitations = useCallback((invited) => {
|
|
55
|
+
if (invited) {
|
|
56
|
+
dispatch({ type: actionWidgetTypes.RESET });
|
|
57
|
+
setRefresh(true);
|
|
58
|
+
}
|
|
59
|
+
}, [dispatch, setRefresh]);
|
|
60
|
+
return (_jsxs(_Fragment, { children: [_jsx(List, { children: state.results.map((user) => (_jsx(ListItem, { children: _jsx(User, Object.assign({ elevation: 0, user: user }, userProps, { actions: getActionsComponent(user.id) })) }, user.id))) }), state.count === 0 && actionProps && (_jsx(EventInviteButton, { event: actionProps.scEvent, className: classes.eventButton, handleInvitations: handleInvitations })), state.count > state.visibleItems && (_jsx(Button, Object.assign({ onClick: handleToggleDialogOpen, className: classes.actionButton }, { children: _jsx(Typography, Object.assign({ variant: "caption" }, { children: _jsx(FormattedMessage, { id: "ui.eventMembersWidget.showAll", defaultMessage: "ui.eventMembersWidget.showAll" }) })) }))), openDialog && (_jsx(DialogRoot, Object.assign({ className: classes.dialogRoot, title: _jsx(FormattedMessage, { defaultMessage: "ui.eventMembersWidget.title", id: "ui.eventMembersWidget.title" }), onClose: handleToggleDialogOpen, open: openDialog }, dialogProps, { children: _jsx(InfiniteScroll, Object.assign({ dataLength: state.results.length, next: handleNext, hasMoreNext: Boolean(state.next), loaderNext: _jsx(UserSkeleton, Object.assign({ elevation: 0 }, userProps)), className: classes.infiniteScroll, endMessage: _jsx(Typography, Object.assign({ className: classes.endMessage }, { children: _jsx(FormattedMessage, { id: "ui.eventMembersWidget.noMoreResults", defaultMessage: "ui.eventMembersWidget.noMoreResults" }) })) }, { children: _jsx(List, { children: state.results.map((user) => (_jsx(ListItem, { children: _jsx(User, Object.assign({ elevation: 0, user: user }, userProps)) }, user.id))) }) })) })))] }));
|
|
48
61
|
}
|
|
@@ -4,7 +4,7 @@ import { Avatar, AvatarGroup, Button, List, ListItem, Typography } from '@mui/ma
|
|
|
4
4
|
import { styled } from '@mui/material/styles';
|
|
5
5
|
import { useThemeProps } from '@mui/system';
|
|
6
6
|
import { Endpoints, EventService, http } from '@selfcommunity/api-services';
|
|
7
|
-
import { useSCFetchEvent
|
|
7
|
+
import { useSCFetchEvent } from '@selfcommunity/react-core';
|
|
8
8
|
import { SCEventSubscriptionStatusType } from '@selfcommunity/types';
|
|
9
9
|
import { Logger } from '@selfcommunity/utils';
|
|
10
10
|
import classNames from 'classnames';
|
|
@@ -71,17 +71,14 @@ export default function EventParticipantsButton(inProps) {
|
|
|
71
71
|
const [open, setOpen] = useState(false);
|
|
72
72
|
// HOOKS
|
|
73
73
|
const { scEvent } = useSCFetchEvent({ id: eventId, event });
|
|
74
|
-
const scUserContext = useSCUser();
|
|
75
|
-
const scEventsManager = scUserContext.managers.events;
|
|
76
74
|
// FETCH FIRST FOLLOWERS
|
|
77
75
|
useDeepCompareEffectNoCheck(() => {
|
|
78
76
|
if (!scEvent) {
|
|
79
77
|
return;
|
|
80
78
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
status === SCEventSubscriptionStatusType.SUBSCRIBED) &&
|
|
79
|
+
if ((scEvent.subscription_status === SCEventSubscriptionStatusType.GOING ||
|
|
80
|
+
scEvent.subscription_status === SCEventSubscriptionStatusType.NOT_GOING ||
|
|
81
|
+
scEvent.subscription_status === SCEventSubscriptionStatusType.SUBSCRIBED) &&
|
|
85
82
|
followers.length === 0) {
|
|
86
83
|
EventService.getUsersGoingToEvent(scEvent.id, { limit: 3 }).then((res) => {
|
|
87
84
|
setFollowers([...res.results]);
|
|
@@ -391,7 +391,7 @@ const Feed = (inProps, ref) => {
|
|
|
391
391
|
refresh();
|
|
392
392
|
},
|
|
393
393
|
getCurrentFeedObjectIds: () => {
|
|
394
|
-
return feedDataObject.results.map((o) => o[o.type].id);
|
|
394
|
+
return [...headData.map((o) => o[o.type].id), ...feedDataObject.results.map((o) => o[o.type].id)];
|
|
395
395
|
}
|
|
396
396
|
}));
|
|
397
397
|
const InnerItem = useMemo(() => ({ state: savedState, onHeightChange, onStateChange, children: item }) => {
|
|
@@ -1,19 +1,22 @@
|
|
|
1
|
-
import { CategoryProps } from './Steps/Category';
|
|
2
|
-
import { AppearanceProps } from './Steps/Appearance';
|
|
3
|
-
import { ProfileProps } from './Steps/Profile';
|
|
4
|
-
import { InviteProps } from './Steps/Invite';
|
|
5
|
-
import { AppProps } from './Steps/App';
|
|
6
|
-
import { ContentProps } from './Steps/Content';
|
|
7
1
|
import { StartStepParams } from '@selfcommunity/api-services';
|
|
2
|
+
import { SCFeedObjectType } from '@selfcommunity/types';
|
|
8
3
|
export interface OnBoardingWidgetProps {
|
|
4
|
+
/**
|
|
5
|
+
* Overrides or extends the styles applied to the component.
|
|
6
|
+
* @default null
|
|
7
|
+
*/
|
|
9
8
|
className?: string;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
/**
|
|
10
|
+
* The params to add to content step generation
|
|
11
|
+
* @default {}
|
|
12
|
+
*/
|
|
13
|
+
GenerateContentsParams?: StartStepParams;
|
|
14
|
+
/**
|
|
15
|
+
*The callback to pass to the feeds to publish the generated content
|
|
16
|
+
* @param feedObj
|
|
17
|
+
* @default null
|
|
18
|
+
*/
|
|
19
|
+
onGeneratedContent?: (feedObjs: SCFeedObjectType[]) => void;
|
|
17
20
|
}
|
|
18
21
|
declare const OnBoardingWidget: (inProps: OnBoardingWidgetProps) => JSX.Element;
|
|
19
22
|
export default OnBoardingWidget;
|