@selfcommunity/react-ui 0.10.5-alpha.7 → 0.10.5-alpha.9
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.
|
@@ -121,7 +121,7 @@ const Root = (0, styles_1.styled)(material_1.Box, {
|
|
|
121
121
|
* @param inProps
|
|
122
122
|
*/
|
|
123
123
|
function EventForm(inProps) {
|
|
124
|
-
var _a, _b, _c, _d;
|
|
124
|
+
var _a, _b, _c, _d, _e;
|
|
125
125
|
//PROPS
|
|
126
126
|
const props = (0, system_1.useThemeProps)({
|
|
127
127
|
props: inProps,
|
|
@@ -227,7 +227,7 @@ function EventForm(inProps) {
|
|
|
227
227
|
formData.append('location', field.location === types_1.SCEventLocationType.PERSON ? types_1.SCEventLocationType.PERSON : types_1.SCEventLocationType.ONLINE);
|
|
228
228
|
if (field.location === types_1.SCEventLocationType.ONLINE) {
|
|
229
229
|
formData.append('link', field.link);
|
|
230
|
-
formData.append('live_stream_settings',
|
|
230
|
+
formData.append('live_stream_settings', null);
|
|
231
231
|
}
|
|
232
232
|
else if (field.location === types_1.SCEventLocationType.LIVESTREAM) {
|
|
233
233
|
formData.append('link', '');
|
|
@@ -238,7 +238,7 @@ function EventForm(inProps) {
|
|
|
238
238
|
formData.append('geolocation_lat', field.lat.toString());
|
|
239
239
|
formData.append('geolocation_lng', field.lng.toString());
|
|
240
240
|
formData.append('link', '');
|
|
241
|
-
formData.append('live_stream_settings',
|
|
241
|
+
formData.append('live_stream_settings', null);
|
|
242
242
|
}
|
|
243
243
|
if (privateEnabled) {
|
|
244
244
|
formData.append('privacy', field.isPublic ? types_1.SCEventPrivacyType.PUBLIC : types_1.SCEventPrivacyType.PRIVATE);
|
|
@@ -384,7 +384,7 @@ function EventForm(inProps) {
|
|
|
384
384
|
start_date: field.startDate,
|
|
385
385
|
location: field.location,
|
|
386
386
|
geolocation: field.geolocation,
|
|
387
|
-
live_stream: Object.assign(Object.assign({ title: field.name || `${intl.formatMessage(messages.name)}` }, (event && event.live_stream.created_at && { created_at: field.startDate })), { settings: field.liveStreamSettings })
|
|
387
|
+
live_stream: Object.assign(Object.assign({ title: field.name || `${intl.formatMessage(messages.name)}` }, (event && ((_b = event.live_stream) === null || _b === void 0 ? void 0 : _b.created_at) && { created_at: field.startDate })), { settings: field.liveStreamSettings })
|
|
388
388
|
}) }, EventAddressComponentProps)), privateEnabled && ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.privacySection }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center", justifyContent: "center" }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ className: (0, classnames_1.default)(classes.switchLabel, { [classes.active]: !field.isPublic }) }, { children: [(0, jsx_runtime_1.jsx)(material_1.Icon, { children: "private" }), (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.privacy.private", defaultMessage: "ui.eventForm.privacy.private" })] })), (0, jsx_runtime_1.jsx)(material_1.Switch, { className: classes.switch, checked: field.isPublic, onChange: () => setField((prev) => (Object.assign(Object.assign({}, prev), { ['isPublic']: !field.isPublic }))), disabled: event && !field.isPublic }), (0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ className: (0, classnames_1.default)(classes.switchLabel, { [classes.active]: field.isPublic }) }, { children: [(0, jsx_runtime_1.jsx)(material_1.Icon, { children: "public" }), (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.privacy.public", defaultMessage: "ui.eventForm.privacy.public" })] }))] })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2", textAlign: "center", className: classes.privacySectionInfo }, { children: field.isPublic ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.privacy.public.info", defaultMessage: "ui.eventForm.privacy.public.info", values: {
|
|
389
389
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore,@typescript-eslint/ban-ts-comment
|
|
390
390
|
// @ts-ignores
|
|
@@ -394,8 +394,8 @@ function EventForm(inProps) {
|
|
|
394
394
|
// @ts-ignore
|
|
395
395
|
b: (chunks) => (0, jsx_runtime_1.jsx)("strong", { children: chunks })
|
|
396
396
|
} })) }))] }))), (0, jsx_runtime_1.jsx)(material_1.TextField, { multiline: true, className: classes.description, placeholder: `${intl.formatMessage(messages.description)}`, margin: "normal", value: field.description, name: "description", onChange: handleChange, InputProps: {
|
|
397
|
-
endAdornment: ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: ((
|
|
398
|
-
}, error: Boolean(((
|
|
397
|
+
endAdornment: ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: ((_c = field.description) === null || _c === void 0 ? void 0 : _c.length) ? Event_1.EVENT_DESCRIPTION_MAX_LENGTH - field.description.length : Event_1.EVENT_DESCRIPTION_MAX_LENGTH })))
|
|
398
|
+
}, error: Boolean(((_d = field.description) === null || _d === void 0 ? void 0 : _d.length) > Event_1.EVENT_DESCRIPTION_MAX_LENGTH), helperText: ((_e = field.description) === null || _e === void 0 ? void 0 : _e.length) > Event_1.EVENT_DESCRIPTION_MAX_LENGTH ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.description.error.maxLength", defaultMessage: "ui.eventForm.description.error.maxLength" })) : null }), genericError && ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.genericError }, { children: (0, jsx_runtime_1.jsx)(material_1.Alert, Object.assign({ variant: "filled", severity: "error" }, { children: genericError })) }))), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.actions }, { children: (0, jsx_runtime_1.jsx)(lab_1.LoadingButton, Object.assign({ loading: field.isSubmitting, disabled: !field.name ||
|
|
399
399
|
!field.startDate ||
|
|
400
400
|
!field.startTime ||
|
|
401
401
|
!field.endDate ||
|
|
@@ -119,7 +119,7 @@ const Root = styled(Box, {
|
|
|
119
119
|
* @param inProps
|
|
120
120
|
*/
|
|
121
121
|
export default function EventForm(inProps) {
|
|
122
|
-
var _a, _b, _c, _d;
|
|
122
|
+
var _a, _b, _c, _d, _e;
|
|
123
123
|
//PROPS
|
|
124
124
|
const props = useThemeProps({
|
|
125
125
|
props: inProps,
|
|
@@ -225,7 +225,7 @@ export default function EventForm(inProps) {
|
|
|
225
225
|
formData.append('location', field.location === SCEventLocationType.PERSON ? SCEventLocationType.PERSON : SCEventLocationType.ONLINE);
|
|
226
226
|
if (field.location === SCEventLocationType.ONLINE) {
|
|
227
227
|
formData.append('link', field.link);
|
|
228
|
-
formData.append('live_stream_settings',
|
|
228
|
+
formData.append('live_stream_settings', null);
|
|
229
229
|
}
|
|
230
230
|
else if (field.location === SCEventLocationType.LIVESTREAM) {
|
|
231
231
|
formData.append('link', '');
|
|
@@ -236,7 +236,7 @@ export default function EventForm(inProps) {
|
|
|
236
236
|
formData.append('geolocation_lat', field.lat.toString());
|
|
237
237
|
formData.append('geolocation_lng', field.lng.toString());
|
|
238
238
|
formData.append('link', '');
|
|
239
|
-
formData.append('live_stream_settings',
|
|
239
|
+
formData.append('live_stream_settings', null);
|
|
240
240
|
}
|
|
241
241
|
if (privateEnabled) {
|
|
242
242
|
formData.append('privacy', field.isPublic ? SCEventPrivacyType.PUBLIC : SCEventPrivacyType.PRIVATE);
|
|
@@ -382,7 +382,7 @@ export default function EventForm(inProps) {
|
|
|
382
382
|
start_date: field.startDate,
|
|
383
383
|
location: field.location,
|
|
384
384
|
geolocation: field.geolocation,
|
|
385
|
-
live_stream: Object.assign(Object.assign({ title: field.name || `${intl.formatMessage(messages.name)}` }, (event && event.live_stream.created_at && { created_at: field.startDate })), { settings: field.liveStreamSettings })
|
|
385
|
+
live_stream: Object.assign(Object.assign({ title: field.name || `${intl.formatMessage(messages.name)}` }, (event && ((_b = event.live_stream) === null || _b === void 0 ? void 0 : _b.created_at) && { created_at: field.startDate })), { settings: field.liveStreamSettings })
|
|
386
386
|
}) }, EventAddressComponentProps)), privateEnabled && (_jsxs(Box, Object.assign({ className: classes.privacySection }, { children: [_jsxs(Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center", justifyContent: "center" }, { children: [_jsxs(Typography, Object.assign({ className: classNames(classes.switchLabel, { [classes.active]: !field.isPublic }) }, { children: [_jsx(Icon, { children: "private" }), _jsx(FormattedMessage, { id: "ui.eventForm.privacy.private", defaultMessage: "ui.eventForm.privacy.private" })] })), _jsx(Switch, { className: classes.switch, checked: field.isPublic, onChange: () => setField((prev) => (Object.assign(Object.assign({}, prev), { ['isPublic']: !field.isPublic }))), disabled: event && !field.isPublic }), _jsxs(Typography, Object.assign({ className: classNames(classes.switchLabel, { [classes.active]: field.isPublic }) }, { children: [_jsx(Icon, { children: "public" }), _jsx(FormattedMessage, { id: "ui.eventForm.privacy.public", defaultMessage: "ui.eventForm.privacy.public" })] }))] })), _jsx(Typography, Object.assign({ variant: "body2", textAlign: "center", className: classes.privacySectionInfo }, { children: field.isPublic ? (_jsx(FormattedMessage, { id: "ui.eventForm.privacy.public.info", defaultMessage: "ui.eventForm.privacy.public.info", values: {
|
|
387
387
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore,@typescript-eslint/ban-ts-comment
|
|
388
388
|
// @ts-ignores
|
|
@@ -392,8 +392,8 @@ export default function EventForm(inProps) {
|
|
|
392
392
|
// @ts-ignore
|
|
393
393
|
b: (chunks) => _jsx("strong", { children: chunks })
|
|
394
394
|
} })) }))] }))), _jsx(TextField, { multiline: true, className: classes.description, placeholder: `${intl.formatMessage(messages.description)}`, margin: "normal", value: field.description, name: "description", onChange: handleChange, InputProps: {
|
|
395
|
-
endAdornment: (_jsx(Typography, Object.assign({ variant: "body2" }, { children: ((
|
|
396
|
-
}, error: Boolean(((
|
|
395
|
+
endAdornment: (_jsx(Typography, Object.assign({ variant: "body2" }, { children: ((_c = field.description) === null || _c === void 0 ? void 0 : _c.length) ? EVENT_DESCRIPTION_MAX_LENGTH - field.description.length : EVENT_DESCRIPTION_MAX_LENGTH })))
|
|
396
|
+
}, error: Boolean(((_d = field.description) === null || _d === void 0 ? void 0 : _d.length) > EVENT_DESCRIPTION_MAX_LENGTH), helperText: ((_e = field.description) === null || _e === void 0 ? void 0 : _e.length) > EVENT_DESCRIPTION_MAX_LENGTH ? (_jsx(FormattedMessage, { id: "ui.eventForm.description.error.maxLength", defaultMessage: "ui.eventForm.description.error.maxLength" })) : null }), genericError && (_jsx(Box, Object.assign({ className: classes.genericError }, { children: _jsx(Alert, Object.assign({ variant: "filled", severity: "error" }, { children: genericError })) }))), _jsx(Box, Object.assign({ className: classes.actions }, { children: _jsx(LoadingButton, Object.assign({ loading: field.isSubmitting, disabled: !field.name ||
|
|
397
397
|
!field.startDate ||
|
|
398
398
|
!field.startTime ||
|
|
399
399
|
!field.endDate ||
|